@font-face { font-family: "Inter"; src: url(/fonts/inter.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url(/fonts/jbmono.woff2) format("woff2"); font-weight: 100 800; font-display: swap; }

/* ---------- color tokens ----------
   Every color in this file comes from these variables. Text colors are checked for
   WCAG AA (4.5:1) against both the page background and panels, in both themes. */
:root {
  color-scheme: light;
  --bg: #e5eaf3;
  --ink: #0f1929; --soft: #515c6f; --line: #dde2eb; --brand: #2459cc; --on-brand: #ffffff;
  --good: #006e48; --warn: #d08d1d; --warn-text: #8a5a06; --bad: #c8000a;
  --panel: rgba(255,255,255,0.6); --panel-solid: rgba(255,255,255,0.97); --panel-ring: rgba(15,25,41,0.07);
  --header: rgba(255,255,255,0.6); --field: rgba(255,255,255,0.88); --muted: #f1f4f8;
  --tint-1: rgba(15,25,41,0.035); --tint-2: rgba(15,25,41,0.07); --tint-3: rgba(15,25,41,0.13);
  --inverse: #0f1929; --on-inverse: #ffffff; --on-inverse-soft: rgba(255,255,255,0.68);
  --brand-tint: rgba(36,89,204,0.12); --good-tint: rgba(0,110,72,0.12); --warn-tint: rgba(208,141,29,0.16); --bad-tint: rgba(200,0,10,0.09);
  --shadow: 0 8px 30px rgba(15,25,41,0.15); --check-border: #8e99ab; --focus: rgba(36,89,204,0.6);
  --blob-a: rgba(52,114,240,0.2); --blob-b: rgba(0,135,90,0.1);
  --c-blue: #3472f0; --c-green: #0f9d63; --c-orange: #e0820c; --c-purple: #8b5cf6; --c-red: #e5484d; --c-teal: #0e98a5; --c-pink: #dc4b97; --c-slate: #64748b;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1220;
  --ink: #e7ecf5; --soft: #9eabbf; --line: #253046; --brand: #86abff; --on-brand: #0b1220;
  --good: #4fd8a0; --warn: #f0a93b; --warn-text: #f2c063; --bad: #ff7a7a;
  --panel: rgba(26,36,56,0.72); --panel-solid: #172134; --panel-ring: rgba(255,255,255,0.08);
  --header: rgba(11,18,32,0.72); --field: #0f1828; --muted: #1a2438;
  --tint-1: rgba(255,255,255,0.04); --tint-2: rgba(255,255,255,0.08); --tint-3: rgba(255,255,255,0.14);
  --inverse: #e7ecf5; --on-inverse: #0b1220; --on-inverse-soft: rgba(11,18,32,0.68);
  --brand-tint: rgba(134,171,255,0.16); --good-tint: rgba(79,216,160,0.14); --warn-tint: rgba(240,169,59,0.16); --bad-tint: rgba(255,122,122,0.14);
  --shadow: 0 8px 30px rgba(0,0,0,0.55); --check-border: #66748b; --focus: rgba(134,171,255,0.7);
  --blob-a: rgba(52,114,240,0.16); --blob-b: rgba(0,135,90,0.08);
  --c-blue: #6f9cff; --c-green: #3ecf8e; --c-orange: #f5a524; --c-purple: #a78bfa; --c-red: #ff6b70; --c-teal: #2cc4cf; --c-pink: #f472b6; --c-slate: #94a3b8;
}
/* "Auto" (no data-theme attribute): follow the device. Same values as [data-theme="dark"] above. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b1220;
    --ink: #e7ecf5; --soft: #9eabbf; --line: #253046; --brand: #86abff; --on-brand: #0b1220;
    --good: #4fd8a0; --warn: #f0a93b; --warn-text: #f2c063; --bad: #ff7a7a;
    --panel: rgba(26,36,56,0.72); --panel-solid: #172134; --panel-ring: rgba(255,255,255,0.08);
    --header: rgba(11,18,32,0.72); --field: #0f1828; --muted: #1a2438;
    --tint-1: rgba(255,255,255,0.04); --tint-2: rgba(255,255,255,0.08); --tint-3: rgba(255,255,255,0.14);
    --inverse: #e7ecf5; --on-inverse: #0b1220; --on-inverse-soft: rgba(11,18,32,0.68);
    --brand-tint: rgba(134,171,255,0.16); --good-tint: rgba(79,216,160,0.14); --warn-tint: rgba(240,169,59,0.16); --bad-tint: rgba(255,122,122,0.14);
    --shadow: 0 8px 30px rgba(0,0,0,0.55); --check-border: #66748b; --focus: rgba(134,171,255,0.7);
    --blob-a: rgba(52,114,240,0.16); --blob-b: rgba(0,135,90,0.08);
    --c-blue: #6f9cff; --c-green: #3ecf8e; --c-orange: #f5a524; --c-purple: #a78bfa; --c-red: #ff6b70; --c-teal: #2cc4cf; --c-pink: #f472b6; --c-slate: #94a3b8;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body {
  margin: 0; padding: 0; min-height: 100%;
  background: var(--bg); color: var(--ink);
  font-family: "Inter", -apple-system, system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--brand); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.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; }
.mono {
  font-family: "JetBrains Mono", ui-monospace, Menlo, monospace;
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--soft);
}
.mono.c { text-align: center; } .mono.r, .r { text-align: right; }
.right { text-align: right; margin-top: 10px; }
.blob { position: fixed; border-radius: 50%; filter: blur(64px); pointer-events: none; z-index: 0; }
.blob.a { width: 420px; height: 420px; left: -96px; top: -160px; background: var(--blob-a); }
.blob.b { width: 360px; height: 360px; right: 25%; bottom: 0; background: var(--blob-b); }

.panel {
  background: var(--panel);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
  border-radius: 18px; box-shadow: 0 0 0 1px var(--panel-ring);
}
.rise { animation: rise 0.5s cubic-bezier(0.32,0.72,0,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .rise { animation: none; } }

/* ---------- header & navigation ---------- */
header.top {
  position: sticky; top: 0; z-index: 20;
  background: var(--header);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--panel-ring);
}
.top-inner { max-width: 1360px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; gap: 28px; position: relative; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; background: var(--inverse); color: var(--on-inverse);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px;
}
.brand-name { font-size: 15px; font-weight: 700; line-height: 1.1; }
.brand .mono { font-size: 9.5px; margin-top: 3px; }
.brand.big { margin-bottom: 28px; }
.brand.big .brand-mark { width: 44px; height: 44px; font-size: 18px; border-radius: 12px; }
.brand.big .brand-name { font-size: 18px; }
nav { display: flex; gap: 4px; }
.nav-btn {
  appearance: none; border: none; background: transparent; color: var(--soft);
  font: 600 14px "Inter", sans-serif; padding: 9px 16px; border-radius: 10px; cursor: pointer;
  display: flex; align-items: center; gap: 8px;
}
.nav-btn svg { width: 20px; height: 20px; display: none; }
.nav-btn.active { background: var(--tint-2); color: var(--ink); }
.who { margin-left: auto; display: flex; align-items: center; gap: 14px; text-align: right; }
.who .time { font-family: "JetBrains Mono", monospace; font-size: 15px; font-weight: 600; }
.who .nm { font-size: 13px; font-weight: 700; line-height: 1.1; }
.who .mono { font-size: 9.5px; margin-top: 3px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--muted); border: none; cursor: pointer;
  box-shadow: 0 0 0 1px var(--line); display: flex; align-items: center; justify-content: center;
  font: 700 12px "Inter", sans-serif; color: var(--ink);
}
.menu { position: absolute; right: 24px; top: 58px; width: 260px; padding: 6px; background: var(--panel-solid); z-index: 30; box-shadow: var(--shadow), 0 0 0 1px var(--panel-ring); }
.menu-item { display: block; width: 100%; text-align: left; appearance: none; border: none; background: transparent; color: var(--ink); font: 500 14px "Inter", sans-serif; padding: 10px 12px; border-radius: 10px; cursor: pointer; }
.menu-item:hover, .menu-item:focus-visible, .menu-item:active { background: var(--muted); }
.menu-item.danger { color: var(--bad); }
.menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }

.demo-banner a { color: var(--ink); font-weight: 600; }
.demo-banner { position: relative; z-index: 1; text-align: center; font-size: 13px; padding: 8px 16px; background: var(--brand-tint); color: var(--ink); }

main { position: relative; z-index: 1; max-width: 1360px; margin: 0 auto; padding: 24px 24px 32px; min-height: 70vh; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; }
h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.6px; margin: 0 0 6px; }
.stat-box { padding: 12px 18px; text-align: right; }
.stat-box .big { font-family: "JetBrains Mono", monospace; font-size: 26px; font-weight: 700; margin-top: 4px; }

/* ---------- grades ---------- */
.grade-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.grade {
  padding: 14px 16px 16px; min-width: 0; text-align: left; color: var(--ink); font: inherit; border: none; cursor: pointer; width: 100%;
}
.grade[aria-expanded="true"] { box-shadow: 0 0 0 2px var(--brand); }
.grade .g-name, .grade .bar, .grade .g-tag { display: block; }
.g-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill { flex: none; font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; display: inline-block; }
.pill.good { background: var(--good-tint); color: var(--good); }
.pill.warn { background: var(--warn-tint); color: var(--warn-text); }
.pill.bad { background: var(--bad-tint); color: var(--bad); }
.pill.brand { background: var(--brand-tint); color: var(--brand); }
.pill.muted { background: var(--muted); color: var(--soft); box-shadow: 0 0 0 1px var(--line); }
.g-mid { display: flex; align-items: center; gap: 8px; margin: 8px 0 12px; }
.g-letter { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; }
.g-pct { letter-spacing: 0; text-transform: none; font-size: 12px; margin-left: auto; }
.g-tag { margin-top: 10px; }
.bar { height: 6px; border-radius: 999px; background: var(--tint-2); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 999px; }
.hidden-note { grid-column: 1 / -1; font-size: 12px; color: var(--soft); margin: -4px 2px 0; }

.final-panel { margin: -6px 0 18px; }
.final-panel .row { align-items: flex-end; }
.final-panel .field { margin-bottom: 0; min-width: 120px; }
.final-answer { font-size: 15px; line-height: 1.5; margin-top: 14px; }
.final-answer b { font-family: "JetBrains Mono", monospace; }

/* ---------- dashboard columns ---------- */
.cols { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(0,1fr) minmax(0,0.9fr); gap: 14px; margin-bottom: 18px; align-items: start; }
.stack { display: grid; gap: 14px; min-width: 0; }
.card-pad { padding: 18px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.card-head.center { align-items: center; }
.baseline { display: flex; align-items: baseline; gap: 12px; }
.card-title { font-size: 15px; font-weight: 700; margin: 0; }
.card-head .mono { font-size: 10px; }
.link-btn { appearance: none; border: none; background: none; color: var(--brand); font: 600 12px "Inter", sans-serif; padding: 4px 0; min-height: 24px; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
#forgot-password-btn { display: block; margin: -6px 0 14px; }
.empty { color: var(--soft); font-size: 13px; padding: 8px 2px; line-height: 1.5; }

.calc-table { border-radius: 12px; background: var(--panel); box-shadow: 0 0 0 1px var(--line); overflow: hidden; }
.calc-head, .calc-row { display: grid; grid-template-columns: minmax(0,1fr) 58px 44px 62px 34px 22px; gap: 6px; align-items: center; padding: 8px 10px; }
.calc-head { background: var(--muted); }
.calc-head .mono { font-size: 9.5px; }
.calc-row { border-top: 1px solid var(--line); font-size: 13px; }
.c-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; display: flex; align-items: center; gap: 7px; }
.c-pct { font-family: "JetBrains Mono", monospace; font-size: 12px; background: var(--muted); border-radius: 8px; padding: 4px 6px; text-align: center; }
.calc-row input, .calc-row select {
  font-family: "JetBrains Mono", monospace; font-size: 12px; color: var(--ink); background: var(--muted);
  border: none; border-radius: 8px; padding: 5px 4px; width: 100%; text-align: center; -webkit-appearance: none; appearance: none;
}
.calc-row input.name-in { font-family: "Inter", sans-serif; font-size: 13px; text-align: left; padding: 5px 8px; }
.c-pts { font-family: "JetBrains Mono", monospace; font-size: 12px; text-align: right; color: var(--soft); }
.c-x { appearance: none; border: none; background: none; color: var(--soft); font-size: 18px; padding: 0; min-width: 22px; min-height: 24px; cursor: pointer; }
.add-course { width: 100%; margin-top: 10px; padding: 10px; border-radius: 12px; border: 1px dashed var(--check-border); background: transparent; color: var(--soft); font: 400 11px "JetBrains Mono", monospace; letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer; }
.live-gpa { margin-top: 12px; background: var(--inverse); color: var(--on-inverse); border-radius: 14px; padding: 14px 18px; display: flex; justify-content: space-between; align-items: flex-end; }
.live-gpa .mono { color: var(--on-inverse-soft); font-size: 10px; }
.live-gpa .num { font-family: "JetBrains Mono", monospace; font-size: 30px; font-weight: 700; margin-top: 4px; }
.live-gpa .r { text-align: right; }
.live-gpa .cr { font-family: "JetBrains Mono", monospace; font-size: 18px; font-weight: 600; margin-top: 4px; }

/* course color dot */
.cc { width: 9px; height: 9px; border-radius: 50%; background: var(--cc, var(--c-slate)); flex: none; display: inline-block; }

/* ---------- schedule items (dashboard Today card + week view) ---------- */
.sched-item { display: flex; gap: 14px; padding: 12px 14px; border-radius: 12px; background: var(--tint-1); margin-bottom: 8px; }
.sched-item.now { background: var(--brand-tint); box-shadow: 0 0 0 1px var(--brand-tint); }
.sched-item.done .sched-name { color: var(--soft); font-weight: 600; }
.sched-times { font-family: "JetBrains Mono", monospace; font-size: 11px; color: var(--soft); width: 64px; flex: none; line-height: 1.45; }
.sched-item.now .sched-times { color: var(--brand); }
.sched-bar { width: 3px; border-radius: 2px; background: var(--cc, var(--tint-3)); flex: none; }
.sched-body { flex: 1; min-width: 0; }
.sched-row1 { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.sched-name { font-size: 14px; font-weight: 700; overflow-wrap: anywhere; }
.sched-sub { font-size: 12px; color: var(--soft); margin-top: 3px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.sched-actions { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.warn-note { color: var(--warn-text); font-weight: 600; }
.tag { font: 500 9.5px "JetBrains Mono", monospace; letter-spacing: 0.06em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; background: var(--tint-2); color: var(--soft); white-space: nowrap; }
.tag.brand { background: var(--brand-tint); color: var(--brand); }

.join {
  display: inline-flex; align-items: center; gap: 6px; font: 600 12px "Inter", sans-serif; text-decoration: none;
  padding: 6px 12px; min-height: 30px; border-radius: 999px; background: var(--field); color: var(--brand); box-shadow: 0 0 0 1px var(--brand); white-space: nowrap;
}
.join svg { width: 14px; height: 14px; flex: none; }
.join:hover { text-decoration: none; filter: brightness(1.05); }
.join.hot { background: var(--brand); color: var(--on-brand); box-shadow: none; }

.sched-item.compact { padding: 8px 12px; margin-bottom: 6px; align-items: center; }
.sched-item.compact .sched-times { width: 136px; line-height: 1.3; }
.sched-item.compact .sched-sub:empty { display: none; }
.sched-item.compact .sched-actions { margin-top: 6px; }
@media (max-width: 520px) { .sched-item.compact { flex-wrap: wrap; gap: 4px 12px; } .sched-item.compact .sched-times { width: 100%; } .sched-item.compact .sched-bar { display: none; } }
.agenda-day { padding: 12px 0; border-top: 1px solid var(--line); }
.agenda-day:first-child { border-top: none; padding-top: 0; }
.agenda-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.agenda-head b { font-size: 14px; }
.agenda-day .sched-item:last-child { margin-bottom: 0; }

/* ---------- services / weather ---------- */
.svc { padding: 12px 14px; border-radius: 12px; background: var(--panel); box-shadow: 0 0 0 1px var(--line); margin-bottom: 8px; }
.svc.soon { opacity: 0.65; }
.svc-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.svc-name { font-size: 14px; font-weight: 700; }
.svc-state { font: 400 10px "JetBrains Mono", monospace; color: var(--soft); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--check-border); display: inline-block; }
.dot.on { background: var(--good); }
.svc-detail { font: 400 10px "JetBrains Mono", monospace; color: var(--soft); margin-top: 6px; line-height: 1.5; overflow-wrap: anywhere; }

.wx-current { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.wx-temp { font-family: "JetBrains Mono", monospace; font-size: 28px; font-weight: 700; }
.wx-desc { color: var(--soft); font-size: 13px; }
.wx-days { display: flex; gap: 8px; }
.wx-day { flex: 1; min-width: 0; padding: 10px 6px; border-radius: 12px; background: var(--panel); box-shadow: 0 0 0 1px var(--line); text-align: center; }
.wx-day .d { font-size: 11px; font-weight: 700; margin-bottom: 4px; }
.wx-day .t { font: 400 11px "JetBrains Mono", monospace; color: var(--soft); }
.wx-day .c { font-size: 10px; color: var(--soft); margin-top: 2px; overflow-wrap: anywhere; }

/* ---------- assignments ---------- */
.seg { display: inline-flex; background: var(--tint-2); border-radius: 10px; padding: 3px; }
.seg button { appearance: none; border: none; background: transparent; color: var(--soft); font: 400 11px "JetBrains Mono", monospace; letter-spacing: 0.1em; text-transform: uppercase; padding: 7px 13px; border-radius: 8px; cursor: pointer; }
.seg button.on { background: var(--inverse); color: var(--on-inverse); }
.a-head, .a-row { display: grid; grid-template-columns: 34px minmax(0,1.7fr) minmax(0,1.2fr) 100px 128px; gap: 12px; align-items: center; padding: 12px 14px; }
.a-head { background: var(--muted); border-radius: 10px; }
.a-head .mono { font-size: 10px; }
.a-row { border-top: 1px solid var(--line); font-size: 14px; }
.a-row.is-done .a-title-text { text-decoration: line-through; color: var(--soft); }
.a-title { font-weight: 600; overflow-wrap: anywhere; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.a-title a { color: inherit; text-decoration: none; }
.a-title a:hover { text-decoration: underline; }
.a-course { color: var(--soft); font-size: 13px; overflow-wrap: anywhere; display: flex; align-items: center; gap: 7px; }
.a-when { font-size: 13px; }
.a-status { text-align: right; }
.chk { width: 24px; height: 24px; border-radius: 6px; border: 1.5px solid var(--check-border); background: var(--field); appearance: none; -webkit-appearance: none; padding: 0; position: relative; display: block; cursor: pointer; }
.chk.on { background: var(--inverse); border-color: var(--inverse); }
.chk.on::after { content: ""; position: absolute; left: 7px; top: 3px; width: 6px; height: 11px; border: solid var(--on-inverse); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.status-line { font: 400 11px "JetBrains Mono", monospace; color: var(--soft); margin-top: 18px; letter-spacing: 0.04em; }

/* ---------- buttons & forms ---------- */
.btn { appearance: none; border: none; background: var(--tint-2); color: var(--ink); font: 600 13px "Inter", sans-serif; padding: 10px 16px; min-height: 40px; border-radius: 10px; cursor: pointer; }
.btn.primary { background: var(--inverse); color: var(--on-inverse); }
.btn.sm { padding: 6px 12px; min-height: 32px; font-size: 12px; }
.btn.danger { color: var(--bad); }
.btn:disabled { opacity: 0.55; cursor: default; }
.icon-btn { appearance: none; border: none; background: var(--tint-2); color: var(--ink); width: 32px; height: 32px; border-radius: 8px; cursor: pointer; font-size: 14px; line-height: 1; }
.icon-btn:disabled { opacity: 0.35; cursor: default; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { appearance: none; border: none; cursor: pointer; padding: 7px 13px; border-radius: 999px; background: var(--panel); box-shadow: 0 0 0 1px var(--tint-3); color: var(--soft); font: 400 11px "JetBrains Mono", monospace; letter-spacing: 0.1em; text-transform: uppercase; }
.chip.on { background: var(--inverse); color: var(--on-inverse); box-shadow: 0 0 0 1px var(--inverse); }

/* ---------- updates (digest) ---------- */
.list { overflow: hidden; }
.d-item { display: flex; gap: 14px; padding: 16px 20px; border-top: 1px solid var(--line); }
.d-item:first-child { border-top: none; }
.d-item.unread { background: var(--brand-tint); }
.d-dot { width: 8px; height: 8px; border-radius: 50%; background: transparent; margin-top: 7px; flex: none; }
.d-item.unread .d-dot { background: var(--brand); }
.d-main { flex: 1; min-width: 0; }
.d-toggle { display: block; width: 100%; text-align: left; appearance: none; border: none; background: none; padding: 0; color: inherit; font: inherit; cursor: pointer; }
.d-toggle > span { display: block; }
.d-tags { display: flex !important; gap: 8px; align-items: center; margin-bottom: 5px; flex-wrap: wrap; }
.d-source { font: 400 10px "JetBrains Mono", monospace; letter-spacing: 0.08em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; }
.d-source.announcement { background: var(--field); color: var(--bad); box-shadow: 0 0 0 1px var(--bad-tint); }
.d-source.inbox { background: var(--field); color: var(--good); box-shadow: 0 0 0 1px var(--good-tint); }
.d-title { font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
.d-snippet { font-size: 13px; color: var(--soft); margin-top: 3px; overflow-wrap: anywhere; }
.d-full { font-size: 14px; line-height: 1.55; margin-top: 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.d-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.d-when { font: 400 11px "JetBrains Mono", monospace; color: var(--soft); flex: none; }

/* ---------- sign in / accounts ---------- */
.signin { max-width: 520px; margin: 4vh auto 0; }
.seg.wide { display: flex; width: 100%; margin-bottom: 16px; }
.seg.wide button { flex: 1; padding: 10px 13px; }
#entry-account .card-pad { margin-bottom: 0; }
#auth-seg { margin-bottom: 16px; }
.or-sep { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: var(--soft); font-size: 12px; }
.or-sep::before, .or-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.btn.google {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--field); box-shadow: 0 0 0 1px var(--line);
}
.fine.tight { margin-top: 14px; }
.verify-page { text-align: center; margin-top: 4vh; }
.verify-title { font-size: 22px; font-weight: 800; }
.verify-page p { color: var(--soft); font-size: 14px; line-height: 1.6; margin: 10px 0 0; }
.verify-actions { justify-content: center; margin-top: 20px; }
#verify-resend-msg { margin-top: 12px; min-height: 14px; }
.conn-card { margin-bottom: 14px; }
.conn-card.soon { opacity: 0.8; }
.conn-note { color: var(--soft); font-size: 13px; line-height: 1.5; margin: 0 0 14px; }
.gmail-opt-row, .check-row { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 14px; font-size: 13px; color: var(--ink); cursor: pointer; line-height: 1.4; }
.gmail-opt-row input, .check-row input { margin-top: 2px; flex: none; width: 16px; height: 16px; accent-color: var(--brand); }
.gmail-opt-row .mono { display: block; margin-top: 3px; font-size: 10px; }
.conn-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.conn-detail { color: var(--soft); font-size: 13px; }
.signin h1 { font-size: 32px; line-height: 1.15; }
.lede { color: var(--soft); font-size: 16px; line-height: 1.55; margin: 0 0 22px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field.grow { flex: 1; min-width: 160px; }
.field.full, .full { grid-column: 1 / -1; width: 100%; }
.field input, .field select, .select {
  font: 400 16px "Inter", sans-serif;
  background: var(--field); color: var(--ink); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; width: 100%;
}
.select { font-size: 14px; padding: 8px 10px; border-radius: 10px; width: auto; }
.form-error { background: var(--bad-tint); color: var(--bad); border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-bottom: 14px; }
.form-error.success { background: var(--good-tint); color: var(--good); }
.howto { margin-top: 18px; font-size: 14px; color: var(--ink); }
.howto summary { cursor: pointer; font-weight: 600; color: var(--brand); padding: 4px 0; }
.howto ol { padding-left: 20px; line-height: 1.6; }
.howto p { color: var(--soft); font-size: 13px; }
.fine { color: var(--soft); font-size: 12px; line-height: 1.6; margin-top: 16px; }
.field-hint { color: var(--soft); font-size: 12px; line-height: 1.5; }

/* ---------- schedule editor ---------- */
.sched-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.sched-form .field { margin-bottom: 0; }
.sched-form .seg { margin-bottom: 2px; }
.days { display: flex; gap: 6px; flex-wrap: wrap; }
.day { appearance: none; border: none; cursor: pointer; padding: 8px 12px; min-height: 36px; border-radius: 10px; background: var(--tint-2); color: var(--soft); font: 400 11px "JetBrains Mono", monospace; letter-spacing: 0.08em; text-transform: uppercase; }
.day.on { background: var(--inverse); color: var(--on-inverse); }
.sl-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.sl-row:first-child { border-top: none; }
.sl-main { flex: 1; min-width: 180px; }
.sl-name { font-weight: 700; overflow-wrap: anywhere; }
.sl-meta { font: 400 11px "JetBrains Mono", monospace; color: var(--soft); margin-top: 3px; overflow-wrap: anywhere; }
.sl-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.section-gap { margin-top: 14px; }

/* ---------- courses & settings ---------- */
.course-row { display: grid; grid-template-columns: minmax(0,1fr) 150px 130px auto; gap: 10px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.course-row:first-child { border-top: none; }
.course-name { display: flex; align-items: center; gap: 10px; font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.course-name .cc { width: 12px; height: 12px; }
.course-row input { font: 400 14px "Inter", sans-serif; background: var(--field); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; width: 100%; }
.course-row .select { width: 100%; }
.course-actions { display: flex; gap: 6px; justify-content: flex-end; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.settings-row:first-of-type { border-top: none; }
.settings-row .label { font-weight: 600; font-size: 14px; }
.settings-row .field-hint { margin-top: 2px; }
.settings-card { margin-bottom: 14px; }

/* ---------- footer ---------- */
.foot { position: relative; z-index: 1; max-width: 1360px; margin: 0 auto; padding: 8px 24px 32px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--soft); }
.foot-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.seg.sm button { padding: 5px 9px; font-size: 10px; }
.doc { max-width: 760px; margin: 0 auto; padding: 32px 24px 64px; line-height: 1.65; position: relative; z-index: 1; }
.doc h1 { font-size: 30px; } .doc h2 { font-size: 18px; margin: 28px 0 8px; }

@media (max-width: 1100px) {
  .cols { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .cols .stack { grid-column: 1 / -1; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
}
@media (max-width: 860px) {
  .cols { grid-template-columns: 1fr; }
  .who-text, .who .time, .brand .mono { display: none; }
  .top-inner { gap: 12px; padding: 10px 16px; }
  .menu { right: 16px; }
  main { padding: 18px 16px 28px; }
  .page-head { flex-wrap: wrap; }
  .a-head, .a-row { grid-template-columns: 34px minmax(0,1fr) 110px; }
  .a-head .h-course, .a-head .h-when, .a-row .a-when { display: none; }
  .a-row .a-course { grid-column: 2; grid-row: 2; font-size: 12px; margin-top: -6px; }
  .signin h1 { font-size: 26px; }
  .calc-head, .calc-row { grid-template-columns: minmax(0,1fr) 50px 44px 64px 30px 22px; gap: 5px; padding: 8px 8px; }
  .calc-row input, .calc-row select, .calc-row input.name-in { font-size: 16px; }
  .course-row { grid-template-columns: minmax(0,1fr) auto; }
  .course-row .course-color, .course-row .course-group { grid-column: auto; }
}
/* Phones: the main tabs move to a bottom tab bar. */
@media (max-width: 720px) {
  header.top { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--panel-solid); } /* a blurred ancestor would trap the fixed tab bar */
  nav#nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: var(--panel-solid); border-top: 1px solid var(--panel-ring);
  }
  .nav-btn { flex-direction: column; gap: 3px; font-size: 11px; padding: 6px 2px; justify-content: center; }
  .nav-btn svg { display: block; }
  .nav-btn.active { background: transparent; color: var(--brand); }
  body.tabbar main { padding-bottom: 24px; }
  body.tabbar .foot { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
}
@media (max-width: 520px) {
  header.top .brand-name { display: none; }
  .wx-days { gap: 6px; }
  /* Too narrow for the name beside five number columns: the name gets its own line. */
  .calc-head, .calc-row { grid-template-columns: minmax(0,1fr) 48px 66px 34px 22px; gap: 4px 6px; padding: 8px 10px; }
  .calc-head > :first-child, .calc-row > :first-child { grid-column: 1 / -1; }
  .c-pct { justify-self: start; min-width: 56px; }
  .calc-head > :nth-child(2) { text-align: left; padding-left: 18px; }
  .course-row { grid-template-columns: 1fr; }
  .course-actions { justify-content: flex-start; }
  .foot { flex-direction: column; align-items: flex-start; }
}

/* ---------- first-run checklist ---------- */
.getting-started { margin-bottom: 18px; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.checklist li { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 14px; line-height: 1.45; }
.checklist .step { width: 26px; height: 26px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; font: 700 12px "Inter", sans-serif; background: var(--tint-2); color: var(--ink); }
.checklist li.done .step { background: var(--good-tint); color: var(--good); }
.checklist li.done .step-text { color: var(--soft); text-decoration: line-through; }
.checklist .step-text { flex: 1; min-width: 200px; }
