:root{
  --bg:#1b1e23;
  --card:#262a30;
  --text:#ececef;
  --muted:#aeb3bd;
  --accent:#d32f2f;
  --border:rgba(255,255,255,0.10);
  --shadow:0 10px 30px rgba(0,0,0,0.28);
  --radius:16px;
}

*{box-sizing:border-box}
html, body{
  height:100%;
  margin:0;
  padding:0;
  background-color:var(--bg);
  color:var(--text);
  font:15px/1.45 -apple-system, BlinkMacSystemFont,"SF Pro Text","Inter",Segoe UI,Roboto,Arial,Helvetica,sans-serif;
  -webkit-text-size-adjust:100%;
}

a{color:inherit}

.topbar{
  position:sticky; top:0; z-index:50;
  display:flex; align-items:center; justify-content:space-between;
  gap:16px;
  padding:16px clamp(16px,3vw,28px);
  background:rgba(22,24,28,0.75);
  backdrop-filter:saturate(150%) blur(10px);
  border-bottom:1px solid var(--border);
}
.brand{display:flex; align-items:center; gap:12px; text-decoration:none; color:var(--text)}
.logo{height:36px; width:auto; display:block; filter:drop-shadow(0 2px 6px rgba(0,0,0,0.35))}
.brand-text{opacity:.95; font-weight:600; letter-spacing:.2px; font-size:16px}

.content{padding:18px clamp(16px,3vw,28px) 40px}

.grid{
  display:flex; flex-wrap:wrap; gap:18px;
}

.card{
  position:relative;
  width:320px;
  min-height:200px;
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  display:flex; flex-direction:column; gap:10px;
  padding:16px;
}
.card.wide{
  width:min(100%, 1100px);
}

h2{margin:0 0 8px; font-size:17px; font-weight:600}
.results-tick{
  margin-left:8px;
  font-size:16px;
}

.label{
  display:block;
  margin:8px 0 6px;
  color:var(--muted);
  font-size:13px;
}

.input{
  width:100%;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid var(--border);
  background:#191c21;
  color:var(--text);
  font-size:16px;
}

.row{display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-bottom:4px}
.link{color:var(--text); text-decoration:none; font-weight:600}
.link:hover{text-decoration:underline}
.link-pill{
  text-decoration:none;
  padding:8px 12px;
  border-radius:999px;
  background:#2c3138;
  border:1px solid var(--border);
  font-weight:700;
  font-size:13px;
  letter-spacing:0.2px;
  transition:transform .15s ease, box-shadow .15s ease;
  box-shadow:0 6px 16px rgba(0,0,0,0.25);
}
.link-pill:hover{
  transform:translateY(-1px);
}
.link-pill.accent{
  background:var(--accent);
  color:#fff;
  border-color:transparent;
}

.btn{
  margin-top:10px;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid var(--border);
  background:#33373e;
  color:var(--text);
  font-weight:600;
  cursor:pointer;
}

.btn.primary{
  background:var(--accent);
  border-color:rgba(0,0,0,0.3);
  color:#fff;
}

.btn:disabled{opacity:.55; cursor:not-allowed}

.msg{min-height:18px; margin:10px 0 0; font-size:13px}
.msg.ok{color:#7fd8a7}
.msg.err{color:#ff7474}
.muted{color:var(--muted); font-size:13px}
.hint{
  margin:8px 0 0;
  color:var(--muted);
  font-size:13px;
}

.table-wrap{
  margin-top:12px;
  border:1px solid var(--border);
  border-radius:12px;
  overflow:auto;
  background:#1c1f25;
}
.table{
  width:100%;
  border-collapse:collapse;
  font-size:13px;
}
.table th,
.table td{
  padding:8px 10px;
  border-bottom:1px solid var(--border);
  text-align:left;
  vertical-align:middle;
}
.table th{
  color:var(--muted);
  font-weight:600;
  background:#20242a;
}

.files-list{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(240px,1fr));
  gap:12px;
  margin:12px 0;
  align-items:stretch;
}
.file-card{
  background:#20242a;
  border:1px solid var(--border);
  border-radius:12px;
  padding:12px;
  display:grid;
  grid-template-rows:auto 1fr auto;
  gap:8px;
  min-height:140px;
}
.file-name{
  font-weight:600;
  font-size:13px;
  word-break:break-word;
  min-height:32px;
}
.file-meta{
  font-size:12px;
  color:var(--muted);
  min-height:32px;
  line-height:1.4;
}

.is-hidden{display:none}

.status-missing{
  color:#ffc4c4;
  background:rgba(211,47,47,0.2);
  font-weight:600;
}

:focus-visible{outline:2px solid var(--accent); outline-offset:2px}

@media (max-width: 760px){
  .card{width:100%}
  .logo{height:30px}
  .topbar{flex-direction:column; align-items:flex-start}
  .topbar-links{width:100%}
}
.topbar-links{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  font-size:13px;
}

.lang-btn{
  padding:8px 12px;
  border-radius:999px;
  border:1px solid var(--border);
  background:#2c3138;
  color:var(--text);
  font-weight:700;
  font-size:12px;
  letter-spacing:0.2px;
  cursor:pointer;
  box-shadow:0 6px 16px rgba(0,0,0,0.25);
  transition:transform .15s ease, box-shadow .15s ease;
}
.lang-btn:hover{transform:translateY(-1px)}
.lang-btn.is-active{
  background:var(--accent);
  color:#fff;
  border-color:transparent;
}

.search-wrap{position:relative}
.suggestions{
  position:absolute;
  left:0;
  right:0;
  top:calc(100% + 6px);
  background:#20242a;
  border:1px solid var(--border);
  border-radius:12px;
  padding:6px;
  display:flex;
  flex-direction:column;
  gap:4px;
  max-height:260px;
  overflow:auto;
  z-index:20;
}
.suggestion-item{
  text-align:left;
  padding:8px 10px;
  border-radius:10px;
  border:1px solid transparent;
  background:transparent;
  color:var(--text);
  cursor:pointer;
  font-size:13px;
}
.suggestion-item:hover,
.suggestion-item:focus-visible{
  background:#2c3138;
  border-color:var(--border);
}

.contact-card{
  margin-top:12px;
  border-radius:12px;
  border:1px solid var(--border);
  background:#20242a;
  padding:12px;
  font-size:13px;
  color:var(--text);
}

.samples-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(160px,1fr));
  gap:12px;
  margin-top:12px;
}
.samples-grid figure{
  margin:0;
  background:#20242a;
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px;
  display:grid;
  gap:8px;
  text-align:center;
}
.samples-grid img{
  width:100%;
  height:auto;
  border-radius:8px;
  background:#1b1e23;
  cursor:zoom-in;
}
.samples-grid figcaption{
  font-size:12px;
  color:var(--muted);
}

.image-preview{
  position:fixed;
  inset:0;
  display:grid;
  place-items:center;
  z-index:100;
}
.image-preview.is-hidden{
  display:none;
}
.image-preview__backdrop{
  position:absolute;
  inset:0;
  background:rgba(10,12,16,0.7);
}
.image-preview__content{
  position:relative;
  z-index:1;
  max-width:min(92vw, 960px);
  max-height:90vh;
  background:#20242a;
  border-radius:16px;
  border:1px solid var(--border);
  padding:16px;
  box-shadow:var(--shadow);
}
.image-preview__content img{
  width:100%;
  height:auto;
  border-radius:12px;
  display:block;
}
.image-preview__close{
  position:absolute;
  top:10px;
  right:10px;
  border:none;
  background:#2c3138;
  color:#fff;
  border-radius:999px;
  width:32px;
  height:32px;
  cursor:pointer;
}
