:root {
  --bg: #f6f7f9; --card: #fff; --ink: #1b1f24; --muted: #667085; --line: #e3e6ea;
  --accent: #2f6fed; --accent-soft: #e8f0fe; --good: #1a7f4b; --warn: #b26a00; --bad: #c0362c;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #111418; --card: #1a1e24; --ink: #e8eaed; --muted: #9aa3ad; --line: #2a3038;
          --accent: #6b9bff; --accent-soft: #1f2a40; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); }
a { color: var(--accent); }
h1 { font-size: 22px; margin: 0 0 4px; } h2 { font-size: 17px; margin: 0 0 8px; } h3 { font-size: 15px; margin: 0 0 6px; }
.muted { color: var(--muted); } .center { text-align: center; } .small { font-size: 13px; }
main { max-width: 1180px; margin: 0 auto; padding: 20px 16px 60px; }

.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 16px; padding: 10px 16px;
  background: var(--card); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { font-weight: 700; text-decoration: none; color: var(--ink); } .brand span { color: var(--muted); font-weight: 400; }
nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
nav a { padding: 6px 10px; border-radius: 8px; text-decoration: none; color: var(--ink); }
nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

button, .btn { font: inherit; border: 1px solid var(--accent); background: var(--accent); color: #fff; padding: 7px 14px;
  border-radius: 8px; cursor: pointer; text-decoration: none; display: inline-block; }
button.ghost, .btn.ghost { background: transparent; color: var(--accent); }
button.danger { background: transparent; border-color: var(--bad); color: var(--bad); }
button:disabled { opacity: .5; cursor: default; }
input, select, textarea { font: inherit; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); color: var(--ink); }
textarea { min-height: 70px; resize: vertical; }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
.pw { display: flex; gap: 6px; }
.pw input { flex: 1; }
.pw button { flex: none; padding: 7px 10px; }
.check { display: flex; gap: 8px; align-items: flex-start; color: var(--ink); font-size: 14px; }
.check input { width: auto; margin-top: 3px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.auth { max-width: 400px; margin: 48px auto; }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > * { flex: 1; min-width: 140px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.span2 { grid-column: 1 / -1; margin-top: 8px; }
.span2[hidden] { display: none; }
.upcoming { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 2px 0; }
.pagehead { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.err { color: var(--bad); font-size: 13px; min-height: 18px; margin-top: 8px; }

.board { display: grid; grid-template-columns: repeat(5, minmax(200px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.col { background: transparent; }
.col h3 { display: flex; justify-content: space-between; color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: 12px; letter-spacing: .04em; }
.app-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 8px; cursor: pointer; }
.app-card:hover { border-color: var(--accent); }
.app-card .co { font-weight: 600; } .app-card .ti { font-size: 13px; }
.badge { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 99px; background: var(--line); color: var(--ink); margin: 4px 4px 0 0; }
.badge.bad { background: #fde8e6; color: var(--bad); } .badge.good { background: #e3f4ea; color: var(--good); } .badge.warn { background: #fff1d6; color: var(--warn); }

.list { display: grid; gap: 8px; }
.item { display: flex; justify-content: space-between; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 14px; flex-wrap: wrap; }
.item .meta { font-size: 13px; color: var(--muted); }
.actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

.drawer { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 10; display: flex; justify-content: flex-end; }
.drawer[hidden] { display: none; }
.drawer.modal-open { justify-content: center; align-items: center; padding: 16px; }
.modal { width: min(480px, 100%); }
.modal .dots { display: flex; gap: 6px; margin-bottom: 12px; }
.modal .dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.modal .dots span.on { background: var(--accent); }
.guide-body ul { padding-left: 18px; } .guide-body li { margin-bottom: 6px; }
.drawer .panel { width: min(560px, 100%); height: 100%; overflow-y: auto; background: var(--bg); padding: 20px; }
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--line); }
.timeline li { padding: 0 0 12px 14px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.timeline .when { font-size: 12px; color: var(--muted); }

.progress { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; background: var(--good); }
.lesson-body { line-height: 1.6; } .lesson-body h1, .lesson-body h2 { margin-top: 16px; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg);
  padding: 10px 16px; border-radius: 8px; z-index: 20; font-size: 14px; }

@media (max-width: 720px) {
  .board { grid-template-columns: repeat(5, 78vw); }
  .grid2 { grid-template-columns: 1fr; }
  nav { order: 3; flex: 0 0 100%; flex-wrap: nowrap; overflow-x: auto; }
  #help { margin-left: auto; }
}
