: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;
}

a{color:inherit}

.topbar{
  position:sticky; top:0; z-index:50;
  display:flex; align-items:center; justify-content:flex-start;
  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}

.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);
}

.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}

.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-links{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  font-size:13px;
}
