:root{
  --bg: #f6f7f9;
  --panel-bg: #ffffff;
  --border: #e2e4e9;
  --text: #16181d;
  --text-dim: #6b7280;
  --text-faint: #9aa0aa;
  --accent: #3b5bfd;
  --accent-soft: #eef1ff;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06);
  --radius: 10px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark){
  :root{
    --bg: #0f1115;
    --panel-bg: #171a21;
    --border: #2a2e37;
    --text: #e6e8eb;
    --text-dim: #9aa1ac;
    --text-faint: #6d7480;
    --accent: #7c93ff;
    --accent-soft: #1b2140;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 2px 8px rgba(0,0,0,.35);
  }
}

*{box-sizing:border-box;}
[hidden]{ display:none !important; }
html,body{height:100%;}
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  font-size:14px;
}

#app{ display:flex; flex-direction:column; min-height:100vh; }

/* ---------- topbar ---------- */
.topbar{
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  flex-wrap:wrap;
  padding:14px 20px;
  background:var(--panel-bg);
  border-bottom:1px solid var(--border);
  position:sticky; top:0; z-index:20;
}
.brand{ display:flex; align-items:center; gap:12px; }
.brand-mark{ font-size:22px; color:var(--accent); line-height:1; }
.brand-text h1{ font-size:16px; margin:0; font-weight:650; letter-spacing:-.01em; }
.brand-text p{ margin:2px 0 0; font-size:12px; color:var(--text-dim); }

.topbar-controls{ display:flex; gap:10px; flex-wrap:wrap; align-items:center; }

.segmented{
  display:flex; gap:2px; background:var(--bg); border:1px solid var(--border);
  border-radius:8px; padding:3px;
}
.segmented button{
  border:none; background:transparent; color:var(--text-dim);
  font-size:12.5px; font-weight:600; padding:6px 12px; border-radius:6px;
  cursor:pointer; white-space:nowrap;
}
.segmented button.active{ background:var(--accent); color:#fff; }
.segmented button:not(.active):hover{ color:var(--text); background:var(--accent-soft); }

.ghost-btn{
  border:1px solid var(--border); background:var(--panel-bg); color:var(--text);
  font-size:12.5px; font-weight:600; padding:7px 12px; border-radius:8px;
  cursor:pointer; white-space:nowrap;
}
.ghost-btn:hover{ background:var(--accent-soft); border-color:var(--accent); color:var(--accent); }

/* ---------- content ---------- */
main.content{
  flex:1; padding:20px; max-width:1400px; width:100%; margin:0 auto;
}

.task-sub{
  margin:0 0 16px; font-size:13px; color:var(--text-dim);
}
.task-sub b{ color:var(--text); }

.grid-wrap{
  overflow-x:auto;
}
.video-grid{
  display:grid;
  grid-template-columns: 120px repeat(5, minmax(220px, 1fr));
  gap:12px;
  min-width:1260px;
}
.grid-corner{}
.col-head{
  display:flex; flex-direction:column; align-items:center; justify-content:flex-end;
  padding:8px 6px; font-weight:650; font-size:13px; text-align:center;
  background:var(--panel-bg); border:1px solid var(--border); border-radius:var(--radius);
}
.col-head .col-sub{ font-weight:500; font-size:11px; color:var(--text-dim); margin-top:2px; }
.row-head{
  display:flex; align-items:center; justify-content:center;
  writing-mode:vertical-rl; transform:rotate(180deg);
  font-weight:650; font-size:13px;
  background:var(--panel-bg); border:1px solid var(--border); border-radius:var(--radius);
  padding:10px 4px;
}
.cell{
  background:var(--panel-bg); border:1px solid var(--border); border-radius:var(--radius);
  box-shadow:var(--shadow);
  overflow:hidden;
  display:flex; align-items:center; justify-content:center;
  aspect-ratio:4/3;
  position:relative;
}
.cell video{
  width:100%; height:100%; object-fit:contain; background:#000; display:block;
}
.cell.missing{
  color:var(--text-faint); font-size:12px; text-align:center; padding:10px;
}

footer.site-footer{
  padding:16px 20px 28px; text-align:center; color:var(--text-faint); font-size:12px;
}
footer.site-footer a{ color:var(--text-dim); }

@media (max-width: 720px){
  .topbar{ flex-direction:column; align-items:stretch; }
  .topbar-controls{ justify-content:space-between; }
}
