/* ===========================================================================
   Daily Course Hub — 自帶樣式（無任何外部資源請求）
   由 build/course_build.py 產生的 hub-data.js 提供課程資料
   =========================================================================== */

:root {
  --bg: #f1f5f9;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #1e293b;
  --text-dim: #64748b;
  --text-faint: #94a3b8;
  --brand: #2563eb;
  --brand-dim: #dbeafe;
  --violet: #7c3aed;
  --violet-soft: #ede9fe;
  --teal: #0d9488;
  --teal-soft: #ccfbf1;
  --rose: #e11d48;
  --rose-soft: #ffe4e6;
  --sky: #0284c7;
  --sky-soft: #e0f2fe;
  --amber: #b45309;
  --amber-soft: #fef3c7;
  --emerald: #047857;
  --emerald-soft: #d1fae5;
  --slate: #475569;
  --slate-soft: #e2e8f0;
  --cyan: #0e7490;
  --cyan-soft: #cffafe;
  --lime: #4d7c0f;
  --lime-soft: #ecfccb;
  --indigo: #4338ca;
  --indigo-soft: #e0e7ff;
  --ok: #059669;
  --warn: #b45309;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 4px 14px rgba(15, 23, 42, .08);
  --shadow-lg: 0 18px 40px -12px rgba(15, 23, 42, .25);
  --radius: 14px;
  --radius-sm: 10px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", -apple-system,
          BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220;
    --panel: #111a2b;
    --panel-2: #16223a;
    --border: #22304c;
    --border-strong: #33456b;
    --text: #e6edf7;
    --text-dim: #9fb0c9;
    --text-faint: #6f819e;
    --brand: #60a5fa;
    --brand-dim: #1e3a5f;
    --violet: #a78bfa;
    --violet-soft: #2e2350;
    --teal: #5eead4;
    --teal-soft: #123b38;
    --rose: #fb7185;
    --rose-soft: #4a1d2a;
    --ok: #34d399;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 4px 14px rgba(0, 0, 0, .45);
    --shadow-lg: 0 18px 40px -12px rgba(0, 0, 0, .7);
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--brand); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* 沒有 JS 時的說明區塊（沒有 inline style，才能套用嚴格 CSP） */
.noscript-fallback {
  margin: 24px auto; max-width: 640px; padding: 20px 24px;
  font-family: system-ui, -apple-system, "Noto Sans TC", sans-serif;
  font-size: 14px; line-height: 1.7; color: var(--text-dim);
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
}
.noscript-fallback h1 { margin: 0 0 8px; font-size: 17px; color: var(--text); }
.noscript-fallback code {
  font-family: var(--mono); font-size: 12.5px;
  background: var(--panel-2); padding: 1px 5px; border-radius: 5px;
}

/* 圖示集本身不可見（不用 inline style，才能套用嚴格 CSP） */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.i-13 { width: 13px; height: 13px; }
.side-head-drawer { padding: 12px 8px 4px; }

/* 任何沒有指定尺寸的圖示都退回 1em，避免 SVG 以預設 300x150 撐破版面 */
svg { width: 1em; height: 1em; flex: 0 0 auto; }

/* ── Top bar ─────────────────────────────────────────────────────────── */
.topbar {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  padding-top: max(10px, env(safe-area-inset-top));
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  z-index: 30;
}
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; color: inherit; }
.brand-mark {
  width: 34px; height: 34px; flex: 0 0 auto;
  border-radius: 11px;
  display: grid; place-items: center;
  background: linear-gradient(140deg, var(--brand), var(--violet));
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.brand-mark svg { width: 18px; height: 18px; }
.brand-text { min-width: 0; }
.brand-title {
  font-weight: 800; font-size: 14px; letter-spacing: -.01em;
  display: flex; align-items: center; gap: 7px; white-space: nowrap;
}
.brand-sub { font-size: 11px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--panel-2); color: var(--text-dim);
  white-space: nowrap;
}
.chip-brand { background: var(--brand-dim); border-color: transparent; color: var(--brand); }

.icon-btn {
  width: 36px; height: 36px; flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: 11px; border: 1px solid transparent;
  background: transparent; color: var(--text-dim);
  transition: background .15s, color .15s, transform .1s;
}
.icon-btn:hover { background: var(--panel-2); color: var(--text); }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn.is-on { background: var(--brand-dim); color: var(--brand); }

/* ── Workspace ───────────────────────────────────────────────────────── */
.workspace { flex: 1 1 auto; display: flex; min-height: 0; position: relative; }

.scrim {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(15, 23, 42, .5);
  backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.scrim.is-open { opacity: 1; pointer-events: auto; }

/* ── Sidebar ─────────────────────────────────────────────────────────── */
.sidebar {
  flex: 0 0 272px; width: 272px;
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  min-height: 0;
  transition: margin-left .22s ease, width .22s ease;
}
.sidebar-body { flex: 1 1 auto; overflow-y: auto; padding: 12px 10px 20px; }
.sidebar.is-collapsed { width: 0; flex-basis: 0; margin-left: -272px; overflow: hidden; }

.side-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 10.5px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase;
  color: var(--text-faint);
  padding: 14px 8px 6px;
}
.side-sec + .side-sec { margin-top: 8px; }

.side-item {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; margin-bottom: 2px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-dim);
  font-size: 12.5px; font-weight: 600; text-align: left;
  transition: background .15s, color .15s, border-color .15s;
}
.side-item:hover { background: var(--panel-2); color: var(--text); }
.side-item.is-active {
  background: var(--brand-dim); color: var(--brand);
  border-color: color-mix(in srgb, var(--brand) 30%, transparent);
}
.side-item svg { width: 15px; height: 15px; flex: 0 0 auto; }
/* 每個課程一個顏色，方便在側欄快速掃視 */
.side-item.accent-violet svg { color: var(--violet); }
.side-item.accent-teal svg { color: var(--teal); }
.side-item.accent-sky svg { color: var(--sky); }
.side-item.accent-amber svg { color: var(--amber); }
.side-item.accent-emerald svg { color: var(--emerald); }
.side-item.accent-rose svg { color: var(--rose); }
.side-item.accent-slate svg { color: var(--slate); }
.side-item.accent-indigo svg { color: var(--indigo); }
.side-item.accent-cyan svg { color: var(--cyan); }
.side-item.accent-lime svg { color: var(--lime); }
.side-item.is-active.accent-violet svg,
.side-item.is-active.accent-teal svg,
.side-item.is-active.accent-sky svg,
.side-item.is-active.accent-amber svg,
.side-item.is-active.accent-emerald svg,
.side-item.is-active.accent-rose svg,
.side-item.is-active.accent-slate svg,
.side-item.is-active.accent-indigo svg { color: inherit; }
.side-item.is-active.accent-cyan svg { color: inherit; }
.side-item.is-active.accent-lime svg { color: inherit; }
.side-item .label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.count {
  flex: 0 0 auto;
  font-family: var(--mono); font-size: 10.5px; font-weight: 700;
  padding: 1px 7px; border-radius: 999px;
  background: var(--panel-2); color: var(--text-dim);
  border: 1px solid var(--border);
}
.side-item.is-active .count { background: var(--panel); border-color: transparent; color: var(--brand); }

.dot { width: 9px; height: 9px; border-radius: 999px; flex: 0 0 auto; }
.dot-html { background: var(--ok); }
.dot-pdf { background: var(--rose); }
.dot-audio { background: var(--sky); }

.side-note {
  margin: 7px 4px 0; padding: 11px 12px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel-2);
  font-size: 11px; color: var(--text-dim);
}
.side-note b { color: var(--text); font-size: 11.5px; display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }
.side-note dl { margin: 0; display: grid; gap: 3px; }
.side-note div { display: flex; justify-content: space-between; gap: 8px; }
.side-note dd { margin: 0; font-family: var(--mono); color: var(--text); }
.side-note code { font-family: var(--mono); font-size: 10.5px; }

.side-foot {
  flex: 0 0 auto; border-top: 1px solid var(--border);
  padding: 8px 12px; background: var(--panel-2);
  font-size: 10.5px; color: var(--text-faint);
  display: flex; justify-content: space-between; gap: 10px;
}
.kbd {
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  padding: 1px 5px; border-radius: 5px;
  border: 1px solid var(--border-strong); background: var(--panel);
  color: var(--text-dim);
}

/* ── Center feed ─────────────────────────────────────────────────────── */
.feed {
  flex: 1 1 auto; min-width: 300px;
  display: flex; flex-direction: column; min-height: 0;
  border-right: 1px solid var(--border);
  background: var(--bg);
}
.feed-head {
  flex: 0 0 auto; padding: 12px 14px 10px;
  background: var(--panel); border-bottom: 1px solid var(--border);
}
.search-row { display: flex; align-items: center; gap: 8px; }
.search-wrap { position: relative; flex: 1 1 auto; min-width: 0; }
.search-wrap svg {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; color: var(--text-faint); pointer-events: none;
}
#q {
  width: 100%; padding: 9px 34px 9px 33px;
  font: inherit; font-size: 12.5px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel-2); color: var(--text);
}
#q:focus { outline: none; border-color: var(--brand); background: var(--panel); box-shadow: 0 0 0 3px var(--brand-dim); }
#q::placeholder { color: var(--text-faint); }
.search-clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px; display: none; place-items: center;
  border: 0; border-radius: 7px; background: transparent; color: var(--text-faint);
}
.search-clear.is-on { display: grid; }
.search-clear svg { position: static; transform: none; width: 14px; height: 14px; }

.seg { display: flex; gap: 2px; padding: 2px; border-radius: var(--radius-sm); background: var(--panel-2); border: 1px solid var(--border); }
.seg button {
  padding: 6px 10px; border: 0; border-radius: 8px; background: transparent;
  color: var(--text-dim); font-size: 11.5px; font-weight: 700;
}
.seg button.is-on { background: var(--panel); color: var(--text); box-shadow: var(--shadow-sm); }
.seg svg { width: 14px; height: 14px; vertical-align: -2px; }

.pills {
  display: flex; gap: 7px; overflow-x: auto; padding-top: 9px;
  scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent;
}
/* 課程 chips 這排是橫向捲動的（10 個課程放不下）。以前刻意把捲軸藏起來，
   結果使用者只看得到前幾顆、也無從得知還能捲 —— 現在把細捲軸畫出來，
   並在 hub.js 把垂直滾輪轉成橫向捲動。 */
.pills::-webkit-scrollbar { height: 8px; }
.pills::-webkit-scrollbar-track { background: transparent; }
.pills::-webkit-scrollbar-thumb {
  background: var(--border-strong); border-radius: 4px; border: 2px solid transparent; background-clip: content-box;
}
.pills::-webkit-scrollbar-thumb:hover { background: var(--text-faint); background-clip: content-box; }

/* 講義清單與課程側欄：一律畫出捲軸。
   Windows 11 與 macOS 預設會把捲軸自動隱藏，使用者就會覺得「只有 4 張卡、
   沒有捲軸可以捲到其他講義」—— 用 ::-webkit-scrollbar 強制顯示，
   再用 scrollbar-width/color 照顧 Firefox。 */
.feed-scroll, .sidebar-body {
  scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent;
}
.feed-scroll::-webkit-scrollbar, .sidebar-body::-webkit-scrollbar { width: 10px; height: 10px; }
.feed-scroll::-webkit-scrollbar-track, .sidebar-body::-webkit-scrollbar-track { background: transparent; }
.feed-scroll::-webkit-scrollbar-thumb, .sidebar-body::-webkit-scrollbar-thumb {
  background: var(--border-strong); border-radius: 6px; border: 2px solid transparent; background-clip: content-box;
}
.feed-scroll::-webkit-scrollbar-thumb:hover, .sidebar-body::-webkit-scrollbar-thumb:hover {
  background: var(--text-faint); background-clip: content-box;
}
.pill {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--panel);
  color: var(--text-dim); font-size: 11.5px; font-weight: 700; white-space: nowrap;
}
.pill.is-on { background: var(--brand); border-color: var(--brand); color: #fff; }
.pill svg { width: 12px; height: 12px; }

.course-intro {
  flex: 0 0 auto; padding: 11px 14px;
  background: var(--panel-2); border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-start; gap: 11px;
}
.course-intro .badge {
  flex: 0 0 auto; width: 32px; height: 32px; border-radius: 10px;
  display: grid; place-items: center; color: #fff;
}
.course-intro .badge svg { width: 16px; height: 16px; }
.accent-violet .badge { background: var(--violet); }
.accent-teal .badge { background: var(--teal); }
.accent-sky .badge { background: var(--sky); }
.accent-amber .badge { background: var(--amber); }
.accent-emerald .badge { background: var(--emerald); }
.accent-rose .badge { background: var(--rose); }
.accent-slate .badge { background: var(--slate); }
.accent-indigo .badge { background: var(--indigo); }
.accent-cyan .badge { background: var(--cyan); }
.accent-lime .badge { background: var(--lime); }
.course-intro h2 { margin: 0; font-size: 13.5px; font-weight: 800; }
.course-intro p { margin: 2px 0 0; font-size: 11.5px; color: var(--text-dim); }

.status-strip {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 7px 14px; font-size: 11px; color: var(--text-dim);
  background: var(--bg); border-bottom: 1px solid var(--border);
}
.status-strip .left { display: flex; align-items: center; gap: 7px; min-width: 0; }
.pulse { width: 7px; height: 7px; border-radius: 999px; background: var(--ok); flex: 0 0 auto; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .3 } }
.status-strip b { font-family: var(--mono); color: var(--text); }

.feed-scroll { flex: 1 1 auto; overflow-y: auto; padding: 12px 14px 28px; }
.feed-scroll.is-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 11px; align-content: start; }
.feed-scroll.is-grid .empty { grid-column: 1 / -1; }

.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 13px 14px; margin-bottom: 10px; text-align: left; width: 100%;
  box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s, transform .12s;
  display: block;
}
.feed-scroll.is-grid .card { margin-bottom: 0; }
.card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-1px); }
.card.is-current { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-dim), var(--shadow); }

.card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.kind-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 800; letter-spacing: .02em;
  padding: 2px 8px; border-radius: 7px; border: 1px solid transparent;
}
.kind-badge svg { width: 11px; height: 11px; }
.kind-badge[hidden] { display: none !important; }
.kind-html { background: var(--teal-soft); color: var(--teal); border-color: color-mix(in srgb, var(--teal) 28%, transparent); }
.kind-pdf { background: var(--rose-soft); color: var(--rose); border-color: color-mix(in srgb, var(--rose) 28%, transparent); }
.kind-audio { background: var(--sky-soft); color: var(--sky); border-color: color-mix(in srgb, var(--sky) 28%, transparent); }

/* 語音導覽：原生播放器 */
.reader-audio { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; height: 100%; padding: 32px 20px; text-align: center; }
.reader-audio-icon { display: grid; place-items: center; width: 66px; height: 66px; border-radius: 50%; background: var(--sky-soft); color: var(--sky); }
.reader-audio-icon svg { width: 30px; height: 30px; }
.reader-audio-meta { display: flex; flex-direction: column; gap: 4px; }
.reader-audio-meta b { font-size: 15px; }
.reader-audio-meta span { font-family: var(--mono); font-size: 12px; color: var(--text-faint); }
.reader-audio audio { width: min(100%, 420px); }
.card-no { margin-left: auto; font-family: var(--mono); font-size: 10.5px; font-weight: 700; color: var(--text-faint); }

.card-step { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--text-faint); }
.card-title { display: block; margin: 1px 0 0; font-size: 13.5px; font-weight: 800; line-height: 1.45; }
.card-summary { display: block; margin: 5px 0 0; font-size: 11.5px; font-weight: 400; color: var(--text-dim); }
.card-foot {
  margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 11px; color: var(--text-faint);
}
.card-open { font-weight: 800; color: var(--brand); display: inline-flex; align-items: center; gap: 4px; }
.card-open svg { width: 12px; height: 12px; }

.empty { padding: 48px 20px; text-align: center; color: var(--text-faint); }
.empty svg { width: 34px; height: 34px; margin-bottom: 10px; }
.empty b { display: block; color: var(--text); font-size: 13.5px; margin-bottom: 3px; }
.empty button {
  margin-top: 14px; padding: 8px 16px; border: 0; border-radius: var(--radius-sm);
  background: var(--brand); color: #fff; font-size: 12px; font-weight: 700;
}

/* ── Reader ──────────────────────────────────────────────────────────── */
.reader {
  flex: 0 0 56%; max-width: 56%;
  display: flex; flex-direction: column; min-height: 0;
  background: var(--panel);
}
/* 全寬閱讀：填滿「剩下的」空間（不是外層容器的 100%，那會寬過視窗），
   同時把中間清單欄隱藏（feed.is-hidden 由 hub.js 的 syncLayout 加上）。 */
.reader.is-wide { flex: 1 1 auto; min-width: 0; max-width: none; }
.feed.is-hidden { display: none; }
.reader-head {
  flex: 0 0 auto; display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  padding-top: max(10px, env(safe-area-inset-top));
  background: var(--panel); z-index: 2;
}
.reader-title-wrap { min-width: 0; flex: 1 1 auto; }
.reader-meta { display: flex; align-items: center; gap: 7px; }
.reader-head h2 { margin: 0; font-size: 13px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-head .sub { font-size: 10.5px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tabs { display: flex; flex: 0 0 auto; gap: 2px; padding: 2px; border-radius: var(--radius-sm); background: var(--panel-2); border: 1px solid var(--border); }
.tabs button {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 10px; border: 0; border-radius: 8px; background: transparent;
  color: var(--text-dim); font-size: 11px; font-weight: 700; white-space: nowrap;
}
.tabs button svg { width: 13px; height: 13px; }
.tabs button.is-on { background: var(--panel); color: var(--text); box-shadow: var(--shadow-sm); }

.reader-body { flex: 1 1 auto; min-height: 0; position: relative; background: var(--panel-2); }
.reader-body iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }

.reader-empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; color: var(--text-faint); }
.reader-empty svg { width: 40px; height: 40px; margin-bottom: 10px; }
.reader-empty b { display: block; color: var(--text); font-size: 14px; margin-bottom: 4px; }

.reader-foot {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px; border-top: 1px solid var(--border);
  padding-bottom: max(9px, env(safe-area-inset-bottom));
  background: var(--panel); font-size: 12px;
}
.nav-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--panel); color: var(--text-dim); font-size: 11.5px; font-weight: 700;
}
.nav-btn:hover:not(:disabled) { color: var(--brand); border-color: var(--brand); }
.nav-btn:disabled { opacity: .4; cursor: default; }
.nav-btn svg { width: 13px; height: 13px; }
.reader-foot .idx { font-family: var(--mono); font-size: 11px; color: var(--text-faint); }

/* ── Toast ───────────────────────────────────────────────────────────── */
.toast {
  position: fixed; top: 62px; left: 50%; transform: translate(-50%, -8px);
  z-index: 60; display: flex; align-items: center; gap: 8px;
  padding: 9px 15px; border-radius: 999px;
  background: rgba(15, 23, 42, .95); color: #f8fafc;
  font-size: 12px; font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast svg { width: 14px; height: 14px; color: #4ade80; }

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 1023px) {
  .desktop-only { display: none !important; }
  .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 50;
    width: 285px; flex-basis: 285px; max-width: 86vw;
    transform: translateX(-100%); transition: transform .26s cubic-bezier(.16,1,.3,1);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.is-collapsed { margin-left: 0; transform: translateX(-100%); }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar .mobile-only { display: flex; }

  .feed { border-right: 0; }
  .reader {
    position: fixed; inset: 0; z-index: 50;
    flex-basis: auto; max-width: none;
    transform: translateY(100%); transition: transform .28s cubic-bezier(.16,1,.3,1);
    visibility: hidden;
  }
  .reader.is-open { transform: translateY(0); visibility: visible; }
  .reader.is-wide { flex-basis: auto; }
  .reader-head h2 { font-size: 12.5px; }
}
@media (min-width: 1024px) {
  .mobile-only { display: none !important; }
  .scrim { display: none; }
}
@media (max-width: 480px) {
  .brand-sub, .topbar-right .label { display: none; }
  .feed-scroll { padding: 10px 10px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
