/* Daftar: a study workspace. Warm graphite, one amber accent, one red for "late". */
:root {
  --bg: #f6f5f1;
  --bg-side: #eeece6;
  --bg-raised: #ffffff;
  --bg-hover: #e5e2da;
  --bg-active: #dcd8ce;
  --line: #dedad1;
  --line-strong: #c9c4b8;
  --text: #1d1c19;
  --text-soft: #57534a;
  --text-faint: #6f6a5f;
  --accent: #b45f06;
  --accent-wash: #f6e7d2;
  --warn: #b45f06; /* "soon" and "careful": stays amber whatever the accent */
  --late: #c0362c;
  --late-wash: #f8e1dd;
  --exam: #9b3a8c;
  --ok: #3f7a4a;
  --focus: #2f6fdb;
  --shadow: 0 12px 32px -8px rgb(40 35 25 / 0.22), 0 2px 6px rgb(40 35 25 / 0.08);

  --font: 'Geist', ui-sans-serif, system-ui, sans-serif;
  --mono: 'Geist Mono', ui-monospace, monospace;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  color-scheme: light;
}

/* Dark: when the device is dark (unless Settings says light), or when Settings says dark. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121210;
    --bg-side: #191917;
    --bg-raised: #20201d;
    --bg-hover: #262622;
    --bg-active: #302f2a;
    --line: #2a2926;
    --line-strong: #3a3934;
    --text: #e9e6df;
    --text-soft: #b3aea3;
    --text-faint: #8f8a7f;
    --accent: #f0a04b;
    --accent-wash: #3a2a17;
    --warn: #f0a04b;
    --late: #ff7b6e;
    --late-wash: #3d1d1a;
    --exam: #e08ad3;
    --ok: #7fbf8a;
    --focus: #8ab4ff;
    --shadow: 0 16px 40px -8px rgb(0 0 0 / 0.6), 0 2px 8px rgb(0 0 0 / 0.4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121210;
  --bg-side: #191917;
  --bg-raised: #20201d;
  --bg-hover: #262622;
  --bg-active: #302f2a;
  --line: #2a2926;
  --line-strong: #3a3934;
  --text: #e9e6df;
  --text-soft: #b3aea3;
  --text-faint: #8f8a7f;
  --accent: #f0a04b;
  --accent-wash: #3a2a17;
  --warn: #f0a04b;
  --late: #ff7b6e;
  --late-wash: #3d1d1a;
  --exam: #e08ad3;
  --ok: #7fbf8a;
  --focus: #8ab4ff;
  --shadow: 0 16px 40px -8px rgb(0 0 0 / 0.6), 0 2px 8px rgb(0 0 0 / 0.4);
  color-scheme: dark;
}

/* Softer themes from Settings, for anyone who finds white too bright or
   black too stark. They sit on top of light and dark. */
:root[data-theme="light"][data-tone="gray"] {
  --bg: #e3e2dd;
  --bg-side: #dad8d2;
  --bg-raised: #ebeae6;
  --bg-hover: #d3d1ca;
  --bg-active: #c9c6be;
  --line: #cbc8c0;
  --line-strong: #b6b2a8;
  --text-soft: #4f4b43;
  --text-faint: #605c52;
  --warn: #9a5005;
  --late: #a82e25;
  --ok: #356c40;
}
:root[data-theme="light"][data-tone="gray"]:not([data-accent]) { --accent: #9a5005; }
:root[data-theme="dark"][data-tone="gray"] {
  --bg: #2a2a28;
  --bg-side: #31312e;
  --bg-raised: #363633;
  --bg-hover: #3e3e3a;
  --bg-active: #474743;
  --line: #43433f;
  --line-strong: #54544e;
  --text: #e6e3dc;
  --text-soft: #bdb8ad;
  --text-faint: #a09b90;
  --accent-wash: #4a3a26;
}

/* Accent colours from Settings. Amber is the default above. */
:root[data-accent="blue"] { --accent: #2b62b0; --accent-wash: #e2eaf7; }
:root[data-accent="green"] { --accent: #2e7543; --accent-wash: #deede2; }
:root[data-accent="violet"] { --accent: #6a49c0; --accent-wash: #e9e3f8; }
:root[data-accent="graphite"] { --accent: #4a463e; --accent-wash: #e5e2da; }
@media (prefers-color-scheme: dark) {
  :root[data-accent="blue"]:not([data-theme="light"]) { --accent: #7fb0f0; --accent-wash: #1c2a3e; }
  :root[data-accent="green"]:not([data-theme="light"]) { --accent: #7cc490; --accent-wash: #1a3022; }
  :root[data-accent="violet"]:not([data-theme="light"]) { --accent: #b6a0f5; --accent-wash: #2a2342; }
  :root[data-accent="graphite"]:not([data-theme="light"]) { --accent: #d4cfc4; --accent-wash: #34322d; }
}
:root[data-theme="dark"][data-accent="blue"] { --accent: #7fb0f0; --accent-wash: #1c2a3e; }
:root[data-theme="dark"][data-accent="green"] { --accent: #7cc490; --accent-wash: #1a3022; }
:root[data-theme="dark"][data-accent="violet"] { --accent: #b6a0f5; --accent-wash: #2a2342; }
:root[data-theme="dark"][data-accent="graphite"] { --accent: #d4cfc4; --accent-wash: #34322d; }

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'tnum' 1;
}
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: var(--accent-wash); color: var(--text); }
input, textarea { caret-color: var(--accent); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-radius: 6px; }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }

.icon {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
}
kbd {
  font: 500 11px/1 var(--mono); color: var(--text-faint);
  border: 1px solid var(--line-strong); border-radius: 4px; padding: 3px 5px;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-weight: 500; font-size: 13px; line-height: 1;
  border: 1px solid var(--line-strong); background: var(--bg-raised); color: var(--text);
  border-radius: 7px; padding: 8px 12px; cursor: pointer;
  transition: transform 140ms var(--ease-out), background-color 140ms ease, border-color 140ms ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn-quiet { background: transparent; border-color: transparent; color: var(--text-soft); }
.btn-wide { width: 100%; padding: 11px 14px; font-size: 14px; }
.btn[aria-busy='true'] { opacity: 0.6; pointer-events: none; }
.btn .icon { width: 15px; height: 15px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 30px; height: 30px; flex: none;
  border: 0; background: transparent; color: var(--text-faint); border-radius: 6px; cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}
.icon-btn .icon { width: 17px; height: 17px; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { border-color: var(--text-faint); }
  .btn-primary:hover { background: color-mix(in oklab, var(--text) 86%, var(--bg)); }
  .btn-quiet:hover { background: var(--bg-hover); border-color: transparent; color: var(--text); }
  .icon-btn:hover { background: var(--bg-hover); color: var(--text); }
}

/* Touch screens and the installed app: no grey flash when something is
   tapped, no bounce or pull-to-reload past the end of the page, and
   buttons that don't get selected like text on a long press. */
html { -webkit-tap-highlight-color: transparent; }
@media (display-mode: standalone) {
  html, body { overscroll-behavior: none; }
  button, summary, .btn, .icon-btn, .ribbon-btn, .tab, .tabbar, .bottombar, .tree-row, .sidebar-head, .keep-row, .chip {
    -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  }
}

/* Sign in */
.signin { min-height: calc(100dvh - var(--titlebar-h, 0px)); display: grid; place-items: center; padding: 24px 16px; }
.signin-card { width: 100%; max-width: 360px; display: grid; gap: 14px; }
.signin-top { display: grid; gap: 6px; }
.signin-for { margin: 0; font-size: 13px; font-weight: 500; color: var(--text-soft); }
.signin-site { margin: 0; font-size: 13px; color: var(--text-faint); }
.signin-logo { width: 64px; height: 64px; margin: -6px 0 2px -14px; image-rendering: pixelated; }
.signin h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.signin-lede { color: var(--text-soft); margin-bottom: 8px; text-wrap: pretty; }
.signin-bottom { display: grid; gap: 12px; margin-top: 4px; }
/* On a phone and in the installed app the sign-in fills the screen like an
   app's: the heading near the top, the button within thumb reach at the
   bottom, and nothing that looks like a web page in between. */
@media (max-width: 640px) {
  .signin {
    place-items: stretch; padding: 0 20px;
    padding-top: max(28px, env(safe-area-inset-top));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }
  .signin-card { max-width: none; display: flex; flex-direction: column; gap: 28px; }
  .signin-top { padding-top: 8vh; }
  .signin h1 { font-size: 28px; letter-spacing: -0.02em; }
  .signin-lede { font-size: 15px; margin: 0; }
  .signin-card .form { flex: 1; display: flex; flex-direction: column; gap: 14px; }
  .signin .field input { font-size: 16px; padding: 13px 14px; border-radius: 10px; }
  .signin .keep-row { padding: 4px 0; }
  .signin-bottom { margin-top: auto; padding-top: 16px; }
  .signin .btn-wide { padding: 14px; font-size: 16px; border-radius: 12px; }
  .signin .fineprint { text-align: center; text-wrap: balance; }
}
.form { display: grid; gap: 12px; }
.field { display: grid; gap: 5px; font-size: 13px; color: var(--text-soft); font-weight: 500; }
.field input, .input {
  font: 400 14px/1.4 var(--font); color: var(--text);
  background: var(--bg-raised); border: 1px solid var(--line-strong); border-radius: 7px; padding: 9px 11px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.field input:focus, .input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.site summary { cursor: pointer; font-size: 13px; color: var(--text-faint); list-style: none; width: fit-content; }
.site summary::-webkit-details-marker { display: none; }
.site summary:hover { color: var(--text); }
.site[open] summary { margin-bottom: 8px; }
.form-error { color: var(--late); font-size: 13px; }
.fineprint { color: var(--text-faint); font-size: 12px; }
.keep-row { display: flex; gap: 16px; align-items: center; justify-content: space-between; cursor: pointer; font-size: 14px; font-weight: 500; }
.keep-row small { display: block; margin-top: 2px; font-size: 12px; font-weight: 400; line-height: 1.4; color: var(--text-faint); text-wrap: pretty; }
/* An on/off switch, like the ones in a phone's settings. */
.switch {
  appearance: none; flex: none; position: relative; width: 38px; height: 22px; margin: 0; border-radius: 11px;
  background: var(--line-strong); cursor: pointer;
  transition: background-color 180ms var(--ease-out);
}
.switch::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 8px;
  background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / 0.25);
  transition: transform 220ms var(--ease-out), width 160ms var(--ease-out);
}
.switch:checked { background: var(--ok); }
.switch:checked::after { transform: translateX(16px); }
.switch:active::after { width: 20px; }
.switch:checked:active::after { transform: translateX(12px); }
.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Title bar of the Windows app (titlebar.js). The window buttons sit over
   its right end, so nothing goes there. */
.titlebar { display: none; }
html.has-titlebar body { padding-top: var(--titlebar-h); }
html.has-titlebar .titlebar {
  position: fixed; inset: 0 0 auto; z-index: 60; height: var(--titlebar-h);
  display: flex; align-items: center; gap: 8px; padding: 0 12px;
  background: var(--bg-side); color: var(--text-soft);
  font: 500 12px/1 var(--font); letter-spacing: 0.01em;
  user-select: none; -webkit-app-region: drag; app-region: drag;
}
.titlebar img { image-rendering: pixelated; }

/* Workspace grid */
.workspace {
  height: calc(100dvh - var(--titlebar-h, 0px));
  display: grid;
  grid-template-columns: 48px var(--side-w, 264px) minmax(0, 1fr) var(--panel-w, 300px);
}
.workspace.panel-hidden { grid-template-columns: 48px var(--side-w, 264px) minmax(0, 1fr) 0; }
.workspace.side-hidden { grid-template-columns: 48px 0 minmax(0, 1fr) var(--panel-w, 300px); }
.workspace.side-hidden.panel-hidden { grid-template-columns: 48px 0 minmax(0, 1fr) 0; }
.workspace.panel-hidden .panel, .workspace.side-hidden .sidebar { visibility: hidden; }

/* Drag edges for the sidebar and Up next */
.sidebar, .panel { position: relative; }
.resizer { position: absolute; top: 0; bottom: 0; width: 7px; z-index: 5; cursor: col-resize; touch-action: none; }
.resizer-side { right: -4px; }
.resizer-panel { left: -4px; }
.resizer::after { content: ''; position: absolute; top: 0; bottom: 0; left: 3px; width: 1px; background: transparent; transition: background-color 120ms ease; }
@media (hover: hover) and (pointer: fine) { .resizer:hover::after { background: var(--accent); transition-delay: 150ms; } }
.resizer:focus-visible { outline: none; }
.resizer:focus-visible::after, body.resizing .resizer::after { background: var(--accent); }
body.resizing { cursor: col-resize; user-select: none; }
body.resizing iframe { pointer-events: none; }

.ribbon {
  background: var(--bg-side); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 0;
}
.ribbon-spacer { flex: 1; }
.ribbon-btn {
  width: 34px; height: 34px; display: grid; place-items: center; cursor: pointer;
  border: 0; border-radius: 7px; background: transparent; color: var(--text-faint);
  transition: background-color 120ms ease, color 120ms ease;
}
.ribbon-btn[aria-current='true'] { color: var(--text); background: var(--bg-active); }
@media (hover: hover) and (pointer: fine) { .ribbon-btn:hover { color: var(--text); background: var(--bg-hover); } }

/* Sidebar */
.sidebar {
  background: var(--bg-side); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; min-height: 0;
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 10px 8px 16px; }
.vault-name { font-weight: 600; font-size: 13px; margin-right: auto; }
.sidebar-head .icon-btn + .icon-btn { margin-left: 2px; }
.search-trigger {
  margin: 0 10px 10px; display: flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 7px 8px 7px 10px; border-radius: 7px; border: 1px solid var(--line); background: var(--bg);
  color: var(--text-faint); font-size: 13px; text-align: left;
  transition: border-color 120ms ease;
}
.search-trigger span { flex: 1; }
.search-trigger .icon { width: 15px; height: 15px; }
@media (hover: hover) and (pointer: fine) { .search-trigger:hover { border-color: var(--line-strong); color: var(--text-soft); } }

.tree { overflow-y: auto; padding: 4px 8px 24px; flex: 1; }
.sidebar-foot { display: flex; align-items: center; gap: 4px; margin: 0 8px 8px; border-top: 1px solid var(--line); }
.sidebar-foot .icon-btn { flex: none; }
.sidebar-foot .icon-btn[aria-current='true'] { color: var(--text); }
.sync-state {
  display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; margin: 0; padding: 8px;
  border: 0; border-radius: 0; background: transparent;
  color: var(--text-faint); font: inherit; font-size: 12px; text-align: left; cursor: pointer;
  transition: color 120ms ease;
}
.sync-state .icon { width: 14px; height: 14px; flex: none; }
.sync-state span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sync-state.warn { color: var(--warn); }
.sync-state.busy .icon { animation: sync-lift 1.4s var(--ease-out) infinite; }
.sync-state[aria-current='true'] { color: var(--text); }
@media (hover: hover) and (pointer: fine) { .sync-state:hover { color: var(--text-soft); } }
@keyframes sync-lift { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.5px); } }
@media (prefers-reduced-motion: reduce) { .sync-state.busy .icon { animation: none; } }
.tree-section { margin-top: 14px; }
.tree-label {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 8px 4px; font-size: 12px; font-weight: 500; color: var(--text-faint);
}
.tree-row {
  width: 100%; display: flex; align-items: center; gap: 7px; cursor: pointer;
  padding: 5px 8px; border: 0; border-radius: 6px; background: transparent; color: var(--text-soft);
  font-size: 13px; text-align: left; text-decoration: none; min-height: 30px;
}
.tree-row .icon { width: 15px; height: 15px; color: var(--text-faint); }
.tree-row .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-hint { flex: none; font: 400 11px var(--mono); color: var(--text-faint); }
.tree-row .badge {
  font: 500 11px/1 var(--mono); color: var(--text-faint); padding: 3px 5px; border-radius: 4px;
}
.tree-row .star-mark { color: var(--accent); display: grid; }
.tree-row .star-mark .icon { width: 13px; height: 13px; fill: currentColor; color: var(--accent); }
.tree-row .badge.hot { color: var(--late); background: var(--late-wash); }
.tree-row[aria-current='true'] { background: var(--bg-active); color: var(--text); }
.tree-row[aria-current='true'] .icon { color: var(--text-soft); }
@media (hover: hover) and (pointer: fine) { .tree-row:hover { background: var(--bg-hover); color: var(--text); } }
.chev { transition: transform 160ms var(--ease-out); }
.folder[aria-expanded='true'] .chev { transform: rotate(90deg); }
.tree-children { margin-left: 15px; padding-left: 8px; border-left: 1px solid var(--line); }
.tree-row.child { font-size: 13px; }
.tree-row .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-faint); flex: none; margin: 0 4px; }
.tree-row .dot.exam { background: var(--exam); }
.tree-row .dot.late { background: var(--late); }
.tree-empty { padding: 4px 8px; color: var(--text-faint); font-size: 12px; }

/* Main column */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.tabbar {
  display: flex; align-items: flex-end; gap: 2px; padding: 6px 8px 0; min-height: 41px;
  background: var(--bg-side); border-bottom: 1px solid var(--line);
}
.tabbar > .icon-btn { margin-bottom: 5px; }
.tabs { display: flex; gap: 2px; min-width: 0; flex: 1; overflow-x: auto; scrollbar-width: none; }
.tab {
  display: flex; align-items: center; gap: 6px; max-width: 200px; min-width: 0; cursor: pointer;
  padding: 7px 6px 8px 10px; border: 1px solid transparent; border-bottom: 0; border-radius: 8px 8px 0 0;
  background: transparent; color: var(--text-faint); font-size: 13px;
  margin-bottom: -1px;
}
.tab .icon { width: 14px; height: 14px; }
.tab .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab .close {
  width: 20px; height: 20px; display: grid; place-items: center; border-radius: 4px; opacity: 0;
  transition: opacity 120ms ease, background-color 120ms ease;
}
.tab .close .icon { width: 13px; height: 13px; }
.tab[aria-selected='true'] { background: var(--bg); color: var(--text); border-color: var(--line); }
.tab[aria-selected='true'] .close, .tab:focus-visible .close { opacity: 1; }
@media (hover: hover) and (pointer: fine) {
  .tab:hover { color: var(--text-soft); }
  .tab:hover .close { opacity: 1; }
  .tab .close:hover { background: var(--bg-hover); }
}

.view { flex: 1; overflow-y: auto; min-height: 0; outline: none; }
.page { max-width: 760px; margin: 0 auto; padding: 36px 40px 96px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.page-title { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; text-wrap: balance; }
.page-sub { color: var(--text-soft); margin-top: 4px; }
.page-actions { display: flex; gap: 6px; flex: none; }
.crumbs { display: flex; gap: 6px; align-items: center; color: var(--text-faint); font-size: 12px; margin-bottom: 10px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.crumbs .icon { width: 12px; height: 12px; }

.section { margin-top: 32px; }
.section:first-of-type { margin-top: 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.section-head h2 { font-size: 13px; font-weight: 600; color: var(--text-soft); }
.section-head h2 .count { font: 400 12px var(--mono); color: var(--text-faint); margin-left: 6px; }
.section-head.late h2 { color: var(--late); }

/* Item rows (deadlines and to-dos) */
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.row {
  display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 2px 10px; align-items: center;
  padding: 9px 4px; border-bottom: 1px solid var(--line);
}
.row-main { min-width: 0; display: grid; gap: 1px; text-decoration: none; cursor: pointer; background: none; border: 0; padding: 0; text-align: left; }
.row-title { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-meta { display: flex; gap: 8px; font-size: 12px; color: var(--text-faint); align-items: center; }
.row-when { text-align: right; font: 500 12px/1.3 var(--mono); color: var(--text-soft); white-space: nowrap; }
.row-when small { display: block; font-weight: 400; color: var(--text-faint); }
.row-when.soon { color: var(--warn); }
.row-when.late { color: var(--late); }
@media (hover: hover) and (pointer: fine) { .row-main:hover .row-title { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); } }
.row.done .row-title { color: var(--text-faint); text-decoration: line-through; }

.kind { font-weight: 500; }
.kind.exam { color: var(--exam); }
.kind.assignment { color: var(--text-soft); }
.kind.quiz { color: var(--text-soft); }
.kind.mine { color: var(--ok); }
.chip-course { font-family: var(--mono); font-size: 11px; }

.marker { width: 18px; height: 18px; display: grid; place-items: center; color: var(--text-faint); }
.marker .icon { width: 16px; height: 16px; }
.marker.exam { color: var(--exam); }
.marker.late { color: var(--late); }
.check {
  appearance: none; width: 16px; height: 16px; margin: 0 1px; border: 1.5px solid var(--line-strong); border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; background: transparent;
  transition: background-color 140ms ease, border-color 140ms ease, transform 140ms var(--ease-out);
}
.check:active { transform: scale(0.88); }
.check:checked { background: var(--ok); border-color: var(--ok); }
.check:checked::after { content: ''; width: 7px; height: 4px; border: 1.5px solid var(--bg); border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }

/* Quick add */
.quick-add { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.quick-add .input { flex: 1 1 220px; min-width: 0; }
.quick-add input[type='date'] { flex: 0 0 auto; font-family: var(--mono); font-size: 13px; }
.quick-add select.input { flex: 0 1 150px; min-width: 0; }
.quick-add input[type='date'].input { flex: 0 1 150px; }

/* Today */
.focus-card {
  display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center;
  padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-raised);
  cursor: pointer; text-align: left; width: 100%;
  transition: border-color 140ms ease;
}
.focus-card .big { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.focus-card .why { color: var(--text-soft); font-size: 13px; }
.focus-rank {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  background: var(--accent-wash); color: var(--accent); font: 600 14px var(--mono);
}
.focus-card.late .focus-rank { background: var(--late-wash); color: var(--late); }
@media (hover: hover) and (pointer: fine) { .focus-card:hover { border-color: var(--line-strong); } }

.note-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.note-card {
  display: grid; gap: 4px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: transparent; text-align: left; cursor: pointer; min-height: 88px; align-content: start;
  transition: border-color 140ms ease, background-color 140ms ease;
}
.note-card .t { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-card .p { color: var(--text-faint); font-size: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (hover: hover) and (pointer: fine) { .note-card:hover { border-color: var(--line-strong); background: var(--bg-raised); } }

/* Empty states */
.empty { padding: 18px 4px; color: var(--text-faint); font-size: 13px; }
.empty strong { color: var(--text-soft); font-weight: 500; display: block; margin-bottom: 2px; }

/* Filters */
.filters { display: flex; gap: 4px; margin-bottom: 18px; }
.filter {
  border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 5px 11px;
  font-size: 12px; font-weight: 500; color: var(--text-soft); cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}
.filter[aria-pressed='true'] { background: var(--text); color: var(--bg); border-color: var(--text); }

/* Calendar */
.cal-head { display: flex; align-items: center; gap: 6px; }
.cal-head .page-title { min-width: 0; margin-right: auto; }
.cal-grid {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  border-top: 1px solid var(--line); border-left: 1px solid var(--line);
}
.cal-dow { padding: 6px 8px; font-size: 11px; font-weight: 500; color: var(--text-faint); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cal-day {
  min-height: 104px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 3px; min-width: 0;
}
.cal-day.out { background: color-mix(in oklab, var(--bg-side) 60%, transparent); }
.cal-day.out .cal-num { color: var(--text-faint); opacity: 0.6; }
.cal-num { font: 500 12px/1 var(--mono); color: var(--text-soft); padding: 3px 4px 5px; width: fit-content; border-radius: 5px; }
.cal-day.today .cal-num { background: var(--accent); color: var(--bg); }
.cal-chip {
  display: block; width: 100%; text-align: left; cursor: pointer; border: 0;
  font-size: 11.5px; line-height: 1.3; padding: 3px 6px; border-radius: 5px;
  background: var(--bg-hover); color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cal-chip.exam { background: color-mix(in oklab, var(--exam) 18%, transparent); }
.cal-chip.late { background: var(--late-wash); color: var(--late); }
.cal-chip.mine { background: color-mix(in oklab, var(--ok) 16%, transparent); }
.cal-chip.done { text-decoration: line-through; opacity: 0.6; }
.cal-more { font-size: 11px; color: var(--text-faint); padding: 0 6px; }
.cal-legend { display: flex; gap: 14px; margin-top: 12px; font-size: 12px; color: var(--text-faint); flex-wrap: wrap; }
.cal-legend span::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; background: var(--bg-active); }
.cal-legend .l-exam::before { background: var(--exam); }
.cal-legend .l-late::before { background: var(--late); }
.cal-legend .l-mine::before { background: var(--ok); }

/* Note editor */
.note-page { max-width: 760px; margin: 0 auto; padding: 28px 40px 120px; }
.note-toolbar { display: flex; align-items: center; gap: 6px; margin-bottom: 18px; color: var(--text-faint); font-size: 12px; }
.note-toolbar .spacer { flex: 1; }
.note-toolbar .crumbs { min-width: 0; flex: 0 1 auto; white-space: nowrap; overflow: hidden; }
.note-toolbar select { max-width: 170px; }
.note-toolbar .crumbs a { overflow: hidden; text-overflow: ellipsis; }
.note-toolbar #note-pin[aria-pressed="true"], .note-toolbar #note-share[aria-pressed="true"] { color: var(--accent); }
.note-toolbar select { font: 400 12px var(--font); color: var(--text-soft); background: transparent; border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; }
@media (max-width: 640px) {
  /* Everything stays on screen, the delete button included. */
  .note-toolbar { flex-wrap: wrap; row-gap: 10px; }
  .note-toolbar .crumbs { flex-basis: 100%; min-width: 0; }
  .note-toolbar .crumbs:not(:has(a)) { display: none; }
  .note-toolbar .spacer, .note-toolbar .saved-state { display: none; }
  .note-toolbar select { flex: 1 1 100%; min-width: 0; max-width: none; padding: 7px 8px; font-size: 13px; }
  .note-toolbar .btn { padding-inline: 8px; }
  .note-toolbar #note-pin { margin-left: auto; }
}
.note-title {
  width: 100%; border: 0; background: transparent; color: var(--text); padding: 0; margin-bottom: 14px;
  font: 600 30px/1.2 var(--font); letter-spacing: -0.02em;
}
.note-title:focus { outline: none; }
.note-title::placeholder { color: var(--text-faint); opacity: 0.6; }
.templates { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -4px 0 18px; }
.templates[hidden] { display: none; }
.templates-label { display: inline-flex; align-items: center; gap: 6px; margin-right: 4px; font-size: 12px; color: var(--text-faint); }
.templates-label .icon { width: 14px; height: 14px; }
.template-chip {
  border: 1px dashed var(--line); background: transparent; border-radius: 999px; padding: 4px 11px;
  font-size: 12px; font-weight: 500; color: var(--text-soft); cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease, transform 120ms ease;
}
.template-chip.own { border-style: solid; }
@media (hover: hover) { .template-chip:hover { border-color: var(--text-faint); color: var(--text); } }
.template-chip:active { transform: scale(0.97); }
.template-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.note-body {
  width: 100%; min-height: 50vh; border: 0; background: transparent; color: var(--text); padding: 0; resize: none;
  font: 400 16px/1.7 var(--font); field-sizing: content;
}
.note-body:focus { outline: none; }
/* Each line of a mixed English and Arabic note runs in its own direction. */
.note-body { unicode-bidi: plaintext; }
.note-body::placeholder { color: var(--text-faint); }
.saved-state { font-family: var(--mono); transition: opacity 300ms ease; }

/* Notes read formatted while you write: each line is drawn as it will
   look, and the line you're on shows its plain text in the same size. */
.prose.live { min-height: 50vh; cursor: text; }
.prose.live > * + * { margin-top: 0; }
.live .lp { position: relative; }
.live .lp > * { margin: 0; }
.live .lp-blank { height: 0.75em; }
.live .lp-hint .empty { color: var(--text-faint); padding: 0; text-align: start; }
.live .lp-hint { height: auto; }
.live .lp-h1, .live .lp-h2, .live .lp-h3, .live .lp-h4 { padding-top: 0.5em; padding-bottom: 0.1em; }
.live .lp:first-child { padding-top: 0; }
.live .lp-rule { padding: 0.7em 0; }
.live .lp-rule hr { margin: 0; }
.live .lp-code, .live .lp-math { padding: 0.3em 0; }
.live .lp li + li { margin-top: 0; }
.lp-edit {
  display: block; width: 100%; margin: 0; padding: 0; border: 0; border-radius: 0; resize: none; overflow: hidden;
  background: transparent; color: var(--text); font: inherit; line-height: inherit; letter-spacing: inherit;
  field-sizing: content; min-height: 1lh; unicode-bidi: plaintext; caret-color: var(--accent);
}
.lp-edit:focus { outline: none; }
.lp-on.lp-h1 .lp-edit, .lp-on.lp-h2 .lp-edit, .lp-on.lp-h3 .lp-edit, .lp-on.lp-h4 .lp-edit { font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; }
.lp-on.lp-h1 .lp-edit { font-size: 24px; }
.lp-on.lp-h2 .lp-edit { font-size: 20px; }
.lp-on.lp-h3 .lp-edit { font-size: 17px; }
.lp-on.lp-h4 .lp-edit { font-size: 15px; }
/* List lines keep their words where the drawn list puts them. */
.lp-on.lp-list .lp-edit { padding-inline-start: 0.75em; }
.lp-on.lp-olist .lp-edit { padding-inline-start: 0.2em; }
.lp-on.lp-quote .lp-edit { padding-inline-start: 12px; border-inline-start: 2px solid var(--line-strong); color: var(--text-soft); }
.lp-on.lp-code .lp-edit, .lp-on.lp-math .lp-edit {
  font: 0.88em/1.6 var(--mono); background: var(--bg-side); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px;
}

.prose { font-size: 16px; line-height: 1.7; max-width: 68ch; overflow-wrap: anywhere; }
.prose > * + * { margin-top: 0.8em; }
.prose h1, .prose h2, .prose h3, .prose h4 { font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; margin-top: 1.4em; }
.prose h1 { font-size: 24px; } .prose h2 { font-size: 20px; } .prose h3 { font-size: 17px; } .prose h4 { font-size: 15px; }
.prose ul, .prose ol { padding-inline-start: 1.4em; margin-bottom: 0; }
.prose ul.checklist { list-style: none; padding-inline-start: 0.2em; }
.prose .checklist li.done span { color: var(--text-faint); text-decoration: line-through; }
.prose .checklist input { accent-color: var(--ok); margin-inline-end: 4px; }
.prose blockquote { margin-left: 0; padding-left: 14px; border-left: 2px solid var(--line-strong); color: var(--text-soft); }
.prose code { font: 0.88em var(--mono); background: var(--bg-hover); padding: 1px 5px; border-radius: 4px; }
.prose pre { background: var(--bg-side); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; overflow-x: auto; }
.prose pre code { background: none; padding: 0; }
.prose mark { background: var(--accent-wash); color: var(--text); padding: 0 2px; border-radius: 3px; }
.prose a { color: var(--accent); text-underline-offset: 3px; }
.prose a.wikilink { text-decoration: none; border-bottom: 1px solid color-mix(in oklab, var(--accent) 40%, transparent); }
.prose a.wikilink.missing { color: var(--text-faint); border-bottom-style: dashed; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 1.6em 0; }

.backlinks { margin-top: 56px; padding-top: 16px; border-top: 1px solid var(--line); }
.backlinks h2 { font-size: 12px; font-weight: 500; color: var(--text-faint); margin-bottom: 6px; }
.backlinks a { display: block; padding: 4px 0; color: var(--text-soft); text-decoration: none; }
.backlinks a:hover { color: var(--text); }

/* Item page */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 24px; font-size: 13px; margin-bottom: 8px; }
.facts dt { color: var(--text-faint); }
.facts dd { margin: 0; }
.section.item-details { margin-top: 28px; }
.item-details .prose { font-size: 15px; }
.item-details .prose + .file-list { margin-top: 16px; }

/* Right panel */
.panel { background: var(--bg-side); border-left: 1px solid var(--line); overflow-y: auto; padding: 14px 12px 24px; min-width: 0; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 6px 8px; }
.panel-head h2 { font-size: 13px; font-weight: 600; }
.panel-sub { font-size: 12px; color: var(--text-faint); }
.upnext { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.up {
  display: grid; grid-template-columns: 20px 1fr; gap: 2px 8px; width: 100%; text-align: left; cursor: pointer;
  padding: 8px 6px; border-radius: 7px; border: 0; background: transparent;
}
.up .n { font: 500 11px/20px var(--mono); color: var(--text-faint); }
.up .t { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up .m { grid-column: 2; display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--text-faint); }
.up .m .w { font-family: var(--mono); white-space: nowrap; }
.up.late .n, .up.late .w { color: var(--late); }
.up.soon .w { color: var(--warn); }
.up[aria-current='true'] { background: var(--bg-active); }
@media (hover: hover) and (pointer: fine) { .up:hover { background: var(--bg-hover); } }
.panel-foot { margin-top: 16px; padding: 12px 6px 0; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.panel-foot p { font-size: 12px; color: var(--text-faint); }
.sync-row { display: flex; flex-wrap: wrap; gap: 6px; }

/* Command palette */
.palette {
  width: min(600px, calc(100vw - 32px)); max-height: min(480px, 70vh); padding: 0; margin: 12vh auto auto;
  border: 1px solid var(--line-strong); border-radius: 12px; background: var(--bg-raised); color: var(--text);
  box-shadow: var(--shadow); overflow: hidden;
  opacity: 0; transform: scale(0.97);
  transition: opacity 160ms var(--ease-out), transform 160ms var(--ease-out), overlay 160ms allow-discrete, display 160ms allow-discrete;
}
.palette[open] { opacity: 1; transform: scale(1); display: flex; flex-direction: column; }
@starting-style { .palette[open] { opacity: 0; transform: scale(0.97); } }
.palette::backdrop { background: rgb(0 0 0 / 0.28); }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.palette-input .icon { color: var(--text-faint); }
.palette-input input { flex: 1; border: 0; background: transparent; color: var(--text); font: 400 15px var(--font); outline: none; }
.palette-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; }
.palette-group { padding: 8px 10px 4px; font-size: 11px; font-weight: 500; color: var(--text-faint); }
.palette-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 7px; cursor: pointer; }
.palette-item .icon { width: 16px; height: 16px; color: var(--text-faint); }
.palette-item .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-item .hint { font-size: 12px; color: var(--text-faint); font-family: var(--mono); white-space: nowrap; }
.palette-item[aria-selected='true'] { background: var(--bg-active); }
.palette-item[aria-selected='true'] .icon { color: var(--text); }
.palette-empty { padding: 18px 12px; color: var(--text-faint); font-size: 13px; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: max(20px, calc(env(safe-area-inset-bottom) + 72px));
  transform: translate(-50%, 12px); opacity: 0; pointer-events: none; z-index: 50;
  background: var(--text); color: var(--bg); padding: 9px 14px; border-radius: 8px; font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow);
  transition: transform 200ms var(--ease-out), opacity 200ms var(--ease-out);
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* Loading */
.skeleton-row { height: 46px; border-bottom: 1px solid var(--line); position: relative; }
.skeleton-row::after {
  content: ''; position: absolute; left: 32px; top: 15px; height: 14px; width: 48%; border-radius: 4px;
  background: var(--bg-hover); animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.4; } }
.notice { padding: 10px 12px; border-radius: 8px; background: var(--late-wash); color: var(--text); font-size: 13px; margin-bottom: 20px; }

.scrim, .bottombar, .mobile-only { display: none; }

/* Mid widths: drop the right panel */
@media (max-width: 1180px) {
  .workspace, .workspace.panel-hidden { grid-template-columns: 48px var(--side-w, 248px) minmax(0, 1fr); }
  .workspace.side-hidden, .workspace.side-hidden.panel-hidden { grid-template-columns: 48px 0 minmax(0, 1fr); }
  .panel, #toggle-panel { display: none; }
}

/* Phones and small tablets */
@media (max-width: 820px) {
  .workspace, .workspace.panel-hidden, .workspace.side-hidden, .workspace.side-hidden.panel-hidden { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .workspace.side-hidden .sidebar { visibility: visible; }
  .ribbon, .desktop-only { display: none; }
  .mobile-only { display: inline-grid; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: min(86vw, 320px); z-index: 30;
    transform: translateX(-100%); transition: transform 280ms var(--ease-drawer), box-shadow 280ms ease;
  }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow); }
  .scrim {
    display: block; position: fixed; inset: 0; z-index: 20; background: rgb(0 0 0 / 0.35);
    opacity: 0; pointer-events: none; transition: opacity 280ms var(--ease-drawer);
  }
  .scrim.open { opacity: 1; pointer-events: auto; }
  html.has-titlebar .sidebar, html.has-titlebar .scrim { top: var(--titlebar-h); }
  .tabbar { align-items: center; padding: 6px 8px; padding-top: max(6px, env(safe-area-inset-top)); }
  .tabbar > .icon-btn { margin-bottom: 0; }
  .tab:not([aria-selected='true']) { display: none; }
  .tab[aria-selected='true'] { background: transparent; border-color: transparent; font-weight: 600; font-size: 14px; max-width: none; }
  .tab .close { display: none; }
  .page, .note-page { padding: 22px 16px 40px; }
  .page-title { font-size: 22px; }
  .note-title { font-size: 24px; }
  .page-head { flex-wrap: wrap; }
  .search-trigger kbd { display: none; }
  .focus-card { grid-template-columns: auto 1fr; }
  .focus-card > .row-when { grid-column: 2; text-align: left; }
  .quick-add select.input, .quick-add input[type='date'].input { flex: 1 1 40%; }
  .bottombar {
    display: grid; grid-template-columns: repeat(var(--dock, 5), 1fr); border-top: 1px solid var(--line); background: var(--bg-side);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .bottombar button {
    display: grid; justify-items: center; gap: 3px; padding: 8px 0 7px; border: 0; background: transparent;
    color: var(--text-faint); font-size: 11px; font-weight: 500; cursor: pointer;
  }
  .bottombar button[aria-current='true'] { color: var(--text); }
  .cal-day { min-height: 64px; padding: 3px; }
  .cal-chip { font-size: 0; height: 6px; padding: 0; border-radius: 3px; }
  .cal-chip.late { background: var(--late); } .cal-chip.exam { background: var(--exam); } .cal-chip.mine { background: var(--ok); }
  .cal-chip:not(.late):not(.exam):not(.mine) { background: var(--text-faint); }
  .cal-more { font-size: 10px; padding: 0; }
  .cal-dow { padding: 6px 4px; }
  .cal-agenda { display: block; }
}
.cal-agenda { display: none; margin-top: 20px; }

@media (prefers-reduced-motion: reduce) {
  .sidebar, .scrim { transition-duration: 0ms; }
  .palette { transform: none !important; transition: opacity 120ms ease, overlay 120ms allow-discrete, display 120ms allow-discrete; }
  @starting-style { .palette[open] { transform: none; } }
  .btn:active, .check:active { transform: none; }
  .switch, .switch::after { transition: none; }
  .toast { transform: translate(-50%, 0); }
  .chev { transition: none; }
  .skeleton-row::after { animation: none; }
}

.toast-action {
  margin-left: 10px; border: 0; background: transparent; color: var(--accent); font-weight: 600; cursor: pointer; padding: 0;
}
a.btn { text-decoration: none; }
.btn[aria-pressed='true'] .icon, .tree-row .star-mark .icon { fill: var(--accent); stroke: var(--accent); }
.row-meta .chip-course { font-family: var(--font); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.row-meta { min-width: 0; }
.quiet-toggle .name { color: var(--text-faint); }

/* Graph */
.view.view-graph { overflow: hidden; }
.graph-wrap { position: relative; height: 100%; min-height: 360px; }
.graph-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.graph-canvas:active { cursor: grabbing; }
.graph-bar {
  position: absolute; top: 12px; left: 12px; right: 12px; display: flex; justify-content: space-between; gap: 8px;
  pointer-events: none; flex-wrap: wrap;
}
.graph-bar > * { pointer-events: auto; }
.graph-bar .filters { margin: 0; }
.graph-bar .filter, .graph-zoom { background: var(--bg-raised); }
.graph-bar .filter[aria-pressed='true'] { background: var(--text); }
.graph-zoom { display: flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.graph-zoom .btn { padding: 6px 8px; font-size: 12px; }
.graph-legend {
  position: absolute; left: 12px; bottom: 12px; display: flex; flex-wrap: wrap; gap: 12px;
  font-size: 12px; color: var(--text-faint); pointer-events: none;
  background: color-mix(in oklab, var(--bg) 80%, transparent); padding: 6px 10px; border-radius: 8px;
}
.graph-legend span::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.graph-legend .l-course::before { background: var(--accent); width: 10px; height: 10px; }
.graph-legend .l-note::before { background: var(--text); }
.graph-legend .l-deadline::before { background: var(--text-faint); }
.graph-legend .l-exam::before { background: var(--exam); }
.graph-legend .l-late::before { background: var(--late); }
.graph-legend .l-ghost::before { border: 1.2px solid var(--text-faint); }
.graph-hint {
  position: absolute; left: 50%; bottom: 52px; transform: translateX(-50%); font-size: 13px; color: var(--text-faint);
  background: var(--bg-raised); border: 1px solid var(--line); padding: 8px 12px; border-radius: 8px; white-space: nowrap;
}
@media (max-width: 820px) {
  .graph-hint { white-space: normal; width: calc(100% - 32px); text-align: center; top: 64px; bottom: auto; }
  .graph-legend { right: 12px; gap: 8px; }
}

/* Your data */
.page-narrow { max-width: 620px; }
.data-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg-raised); }
.data-state { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.data-state .icon { width: 16px; height: 16px; color: var(--text-soft); }
.data-state.warn, .data-state.warn .icon { color: var(--warn); }
.data-note { color: var(--text-faint); font-size: 13px; margin-top: 8px; }
.data-text { color: var(--text-soft); max-width: 60ch; line-height: 1.55; }
.data-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.data-confirm { flex-basis: 100%; font-weight: 500; color: var(--late); margin-bottom: 2px; }
.btn-danger { color: var(--late); }
.btn-danger .icon { color: var(--late); }
.btn-danger-solid { background: var(--late); border-color: var(--late); color: var(--bg); }
@media (hover: hover) and (pointer: fine) {
  .btn-danger:hover { background: var(--late-wash); border-color: var(--late); }
}
@media (max-width: 640px) {
  .data-row { flex-wrap: wrap; }
}

/* Course files */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.file-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.file-group { font-size: 12px; font-weight: 500; color: var(--text-faint); margin: 18px 0 6px; }
.file-group-date { margin-left: 8px; font-weight: 400; }
.file-group:first-of-type { margin-top: 4px; }
.file-row {
  display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 8px 4px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit;
}
.file-row .row-meta span[aria-hidden] { color: var(--line-strong); }
.file-go { color: var(--text-faint); display: grid; }
.file-go .icon { width: 14px; height: 14px; }
@media (hover: hover) and (pointer: fine) {
  .file-row:hover .row-title { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
}
.file-icon {
  width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center;
  background: var(--bg-hover); color: var(--text-soft);
}
.file-icon .icon { width: 16px; height: 16px; }
.file-icon.t-pdf { background: var(--late-wash); color: var(--late); }
.file-icon.t-slides { background: var(--accent-wash); color: var(--accent); }
.file-icon.t-word, .file-icon.t-link { color: var(--focus); }
.file-icon.big { width: 52px; height: 52px; border-radius: 12px; }
.file-icon.big .icon { width: 24px; height: 24px; }
.show-all { margin-top: 6px; padding-left: 4px; }

.page-file { max-width: 900px; }
.page-file .page-title { overflow-wrap: anywhere; }
.pdf { display: grid; gap: 14px; }
.pdf-page {
  position: relative; width: 100%; aspect-ratio: 1 / 1.414; background: #fff;
  border-radius: 4px; box-shadow: 0 0 0 1px var(--line), 0 6px 18px -8px rgb(0 0 0 / 0.25);
  overflow: hidden;
}
.pdf-page:not(.drawn) { background: linear-gradient(90deg, #fff, #f3f2ee, #fff); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.pdf-page canvas { display: block; width: 100%; height: auto; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .pdf-page:not(.drawn) { animation: none; } }
.file-image { margin: 0; }
.file-image img { display: block; max-width: 100%; height: auto; border-radius: 6px; box-shadow: 0 0 0 1px var(--line); background: #fff; }
.doc-frame { display: block; width: 100%; min-height: 400px; border: 0; border-radius: 8px; box-shadow: 0 0 0 1px var(--line); background: var(--bg-raised); }
.file-outside {
  display: grid; justify-items: center; gap: 14px; text-align: center;
  padding: 48px 24px; border: 1px dashed var(--line-strong); border-radius: 12px;
}
.file-outside p { color: var(--text-soft); max-width: 40ch; }
.file-outside strong { display: block; color: var(--text); font-weight: 500; margin-bottom: 2px; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .page-file .page-head { flex-direction: column; }
  .pdf { gap: 8px; margin: 0 -8px; }
}

/* Study with AI */
.page-study { max-width: 720px; }
.page-sub.study-wait { color: var(--text-faint); }
.handoff { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line); }

.study-setup { padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-raised); display: grid; gap: 12px; }
.study-setup h2 { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.setup-steps { margin: 0; padding-left: 1.3em; display: grid; gap: 6px; color: var(--text-soft); }
.setup-steps a { color: var(--accent); text-underline-offset: 3px; }
.key-form { display: flex; gap: 8px; }
.key-form .input { flex: 1; min-width: 0; font-family: var(--mono); font-size: 13px; }
.key-message { font-size: 13px; color: var(--ok); }
.key-message.warn { color: var(--late); }

.chat { display: grid; gap: 10px; }
.msg { max-width: 92%; padding: 10px 14px; border-radius: 12px; line-height: 1.55; }
.msg.me { justify-self: end; background: var(--text); color: var(--bg); border-bottom-right-radius: 4px; white-space: pre-wrap; }
.msg.ai { justify-self: start; background: var(--bg-raised); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.ai > :first-child { margin-top: 0; }
.msg.ai > :last-child { margin-bottom: 0; }
.msg.thinking { display: flex; gap: 4px; padding: 14px; }
.msg.thinking span { width: 6px; height: 6px; border-radius: 50%; background: var(--text-faint); animation: think 1.2s var(--ease-out) infinite; }
.msg.thinking span:nth-child(2) { animation-delay: 0.15s; }
.msg.thinking span:nth-child(3) { animation-delay: 0.3s; }
@keyframes think { 0%, 80%, 100% { opacity: 0.3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .msg.thinking span { animation: none; } }
.chat-hello { margin: 4px 0 0; color: var(--text-soft); }
.msg-block { display: grid; gap: 4px; justify-items: start; }
.msg-block + .msg-block, .msg.me + .msg-block { margin-bottom: 6px; }
.msg-actions { padding-left: 4px; font-size: 12px; color: var(--text-faint); }
.msg-actions .link-btn { color: var(--text-soft); text-decoration-color: var(--line-strong); }
.chat-dock {
  position: sticky; bottom: 0; z-index: 2; display: grid; gap: 10px;
  margin: 8px -4px 0; padding: 12px 4px; background: var(--bg); border-top: 1px solid var(--line);
}
.starters { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -4px; padding: 0 4px; }
.starters::-webkit-scrollbar { display: none; }
.starter {
  flex: none; border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 5px 11px;
  font: inherit; font-size: 12px; font-weight: 500; color: var(--text-soft); cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease, transform 120ms var(--ease-out);
}
.starter:active:not(:disabled) { transform: scale(0.97); }
.starter:disabled { opacity: 0.5; cursor: default; }
@media (hover: hover) and (pointer: fine) { .starter:hover:not(:disabled) { border-color: var(--line-strong); color: var(--text); } }
.chat-form { display: flex; gap: 8px; align-items: flex-end; }
.chat-form .input { flex: 1; min-width: 0; }
.chat-form .btn { height: 38px; }
.chat-input { resize: none; min-height: 38px; max-height: 160px; font: inherit; line-height: 1.45; }
.chat-dock .chat-after { justify-content: flex-start; font-size: 12px; }
.chat-dock .chat-after .link-btn { font-size: 12px; color: var(--text-soft); }
.quiz-title { margin: 0; font-size: 13px; font-weight: 600; color: var(--text-soft); }
.msg-block .quiz-card, .msg-block .flashcard { width: 100%; }
.msg-block:has(.quiz-card, .flashcard) { justify-items: stretch; }

.quiz-card { padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-raised); display: grid; gap: 12px; }
.quiz-count { font: 500 12px var(--mono); color: var(--text-faint); }
.quiz-q { font-size: 16px; font-weight: 500; line-height: 1.45; }
.quiz-options { display: grid; gap: 8px; }
.quiz-option {
  text-align: left; padding: 11px 14px; border-radius: 9px; border: 1px solid var(--line-strong);
  background: var(--bg); color: var(--text); font: inherit; cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease, transform 140ms var(--ease-out);
}
.quiz-option:active:not(:disabled) { transform: scale(0.99); }
.quiz-option:disabled { cursor: default; }
.quiz-option.right { border-color: var(--ok); background: color-mix(in oklab, var(--ok) 14%, var(--bg)); }
.quiz-option.wrong { border-color: var(--late); background: var(--late-wash); }
@media (hover: hover) and (pointer: fine) { .quiz-option:hover:not(:disabled) { border-color: var(--text-soft); } }
.quiz-why { color: var(--text-soft); line-height: 1.55; }
.quiz-why strong { color: var(--text); }
.quiz-src { color: var(--text-faint); }
.quiz-score { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.quiz-card .data-actions { margin-top: 0; }

.flashcard {
  width: 100%; min-height: 220px; display: grid; grid-template-rows: auto 1fr auto; gap: 12px; text-align: center;
  padding: 18px 24px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--bg-raised);
  color: var(--text); font: inherit; cursor: pointer; box-shadow: 0 8px 24px -16px rgb(0 0 0 / 0.35);
  transition: transform 160ms var(--ease-out);
}
.flashcard:active { transform: scale(0.99); }
.flashcard.flipped { background: color-mix(in oklab, var(--accent) 7%, var(--bg-raised)); }
.flashcard .side { font: 500 11px var(--mono); color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.06em; }
.flashcard .text { align-self: center; font-size: 18px; line-height: 1.45; }
.card-nav { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 10px; font: 500 12px var(--mono); color: var(--text-soft); }
.icon-btn:disabled { opacity: 0.35; pointer-events: none; }
@media (max-width: 640px) {
  .key-form { flex-direction: column; }
  .msg { max-width: 100%; }
}

/* Flashcard review */
.review-nudge {
  display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 20px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg-raised); color: var(--text-soft);
  font: inherit; font-size: 13px; text-align: left; cursor: pointer; transition: border-color 140ms ease;
}
.review-nudge > span { flex: 1; }
.review-nudge strong { display: block; color: var(--text); font-weight: 500; font-size: 14px; }
.review-nudge .icon { width: 18px; height: 18px; color: var(--accent); flex: none; }
.review-nudge .icon:last-child { color: var(--text-faint); width: 15px; height: 15px; }
@media (hover: hover) and (pointer: fine) { .review-nudge:hover { border-color: var(--line-strong); } }
.review-count { font: 500 12px var(--mono); color: var(--text-faint); margin-bottom: 8px; }
.review-card { cursor: default; min-height: 260px; }
.review-card:active { transform: none; }
.review-card .answer {
  display: grid; gap: 6px; padding-top: 14px; border-top: 1px dashed var(--line-strong);
  font-size: 16px; line-height: 1.5; color: var(--text);
}
.review-card .answer small { font-size: 12px; color: var(--text-faint); }
.review-actions { margin-top: 14px; }
.review-actions kbd { font: 500 11px var(--mono); opacity: 0.6; margin-left: 6px; }
.grades { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.grade {
  display: grid; gap: 2px; justify-items: center; padding: 10px 8px; border-radius: 9px;
  border: 1px solid var(--line-strong); background: var(--bg-raised); color: var(--text); font: inherit; cursor: pointer;
  transition: transform 140ms var(--ease-out), border-color 140ms ease;
}
.grade:active { transform: scale(0.97); }
.grade span { font-weight: 500; }
.grade small { font: 400 11px var(--mono); color: var(--text-faint); }
.grade-again span { color: var(--late); }
.grade-easy span { color: var(--ok); }
@media (hover: hover) and (pointer: fine) { .grade:hover { border-color: var(--text-soft); } }
.review-done { padding: 28px 0 8px; }
.deck { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 14px; }
.deck summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-soft); list-style-position: inside; }
.deck summary .count { font: 400 12px var(--mono); color: var(--text-faint); margin-left: 6px; }
.deck-list { list-style: none; margin: 10px 0 0; padding: 0; }
.deck-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.deck-text { display: grid; gap: 2px; min-width: 0; font-size: 13px; }
.deck-text strong { font-weight: 500; }
.deck-text span { color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deck-due { font: 400 12px var(--mono); color: var(--text-faint); }
.card-form { display: grid; gap: 8px; margin-top: 12px; }
.card-form textarea { resize: vertical; font: inherit; }
.card-form-row { display: flex; gap: 8px; }
.card-form-row select { flex: 1; min-width: 0; }
.review-courses { flex-wrap: wrap; }

/* Grades */
.grade-total { font: 500 12px var(--mono); color: var(--text-soft); }
.grade-table { border-top: 1px solid var(--line); }
.grade-row {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(96px, auto) 84px 30px; align-items: center; gap: 12px;
  padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px;
}
.grade-row.grade-head { font-size: 12px; color: var(--text-faint); padding: 6px 0; }
.grade-row .g-name { min-width: 0; overflow-wrap: anywhere; }
.grade-row .g-name small { margin-left: 8px; font: 400 11px var(--mono); color: var(--text-faint); }
.grade-row .g-score { font: 400 13px var(--mono); font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 6px; }
.grade-row .g-score.muted { color: var(--text-faint); font-family: var(--font); }
.grade-row input {
  font: 400 13px var(--mono); font-variant-numeric: tabular-nums; color: var(--text); background: var(--bg-raised);
  border: 1px solid var(--line); border-radius: 6px; padding: 5px 7px; width: 100%; min-width: 0;
  transition: border-color 150ms var(--ease-out), box-shadow 150ms var(--ease-out);
}
.grade-row input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.grade-row input::placeholder { color: var(--text-faint); font-family: var(--font); }
.grade-row .g-name-input { font-family: var(--font); font-size: 14px; }
.grade-row .g-score input { width: 58px; }
.grade-row .g-weight { display: flex; align-items: center; gap: 4px; color: var(--text-faint); font-size: 12px; }
.grade-row .g-weight input { text-align: right; }
.grade-row .g-fixed { justify-content: flex-end; padding-right: 10px; font: 400 13px var(--mono); color: var(--text-soft); }
.grade-row .g-fixed span { font-family: var(--font); color: var(--text-faint); }
.grade-row .icon-btn { width: 28px; height: 28px; }
.grade-row .g-feedback { grid-column: 1 / -1; font-size: 13px; color: var(--text-soft); margin-top: -2px; }
.grade-actions { display: flex; gap: 8px; margin-top: 8px; }
.grade-aim { margin-top: 20px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-raised); }
.grade-aim > label { font-size: 13px; color: var(--text-soft); }
.aim-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.aim-row input {
  width: 72px; font: 500 16px var(--mono); padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--bg); color: var(--text);
}
.aim-row input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.aim-row .filters { margin: 0; flex-wrap: wrap; }
.grade-result { margin-top: 14px; }
.grade-answer { font-size: 16px; line-height: 1.5; }
.grade-answer strong { font-weight: 600; }
.grade-answer.ok strong { color: var(--ok); }
.grade-answer.late strong { color: var(--late); }
.grade-sub { font-size: 13px; color: var(--text-faint); margin-top: 6px; }
.course-grades > .grade-sub { margin: 0 0 10px; }
@media (max-width: 640px) {
  .grade-row { grid-template-columns: minmax(0, 1fr) auto 76px 28px; gap: 8px; }
  .grade-row.own { grid-template-columns: minmax(0, 1fr) 76px 28px; }
  .grade-row.own .g-name-input { grid-column: 1 / -1; }
  .grade-row.own .g-score { grid-column: 1; }
  .grade-row .g-score input { width: 54px; }
}
.check.late:not(:checked) { border-color: var(--late); }
.check.exam:not(:checked) { border-color: var(--exam); }

/* New files */
.new-tag {
  display: inline-block; margin-left: 8px; padding: 1px 6px; border-radius: 4px; vertical-align: 1px;
  font: 600 10px/1.5 var(--font); letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-wash);
}
.rows a.row-main { color: inherit; }

/* Hidden courses */
.notice.hidden-note { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: -6px 0 20px; background: var(--bg-raised); border: 1px solid var(--line); color: var(--text-soft); }
.hidden-note > .icon { width: 16px; height: 16px; flex: none; }
.hidden-note > span { flex: 1 1 220px; }
.course-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--text-faint); }

/* Course links */
.link-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.link-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px 5px 9px; border: 1px solid var(--line); border-radius: 999px;
  font-size: 13px; font-weight: 500; color: var(--text); text-decoration: none; background: var(--bg-raised);
  transition: border-color 120ms ease, transform 120ms ease;
}
.link-pill .icon { width: 14px; height: 14px; color: var(--accent); }
@media (hover: hover) { .link-pill:hover { border-color: var(--text-faint); } }
.link-pill:active { transform: scale(0.97); }
.link-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.link-list li { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto 28px; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.link-list li > .icon { width: 16px; height: 16px; color: var(--text-faint); }
.link-list a { color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (hover: hover) { .link-list a:hover { text-decoration: underline; text-underline-offset: 3px; } }
.link-host { font-size: 12px; color: var(--text-faint); }
.link-list .icon-btn { width: 28px; height: 28px; }
.link-add { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.link-add input[name=url] { flex: 2 1 220px; min-width: 0; }
.link-add input[name=label] { flex: 1 1 140px; min-width: 0; }

/* GPA */
.gpa-stats { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-raised); }
.gpa-stat { display: grid; gap: 2px; padding: 16px 18px; min-width: 0; }
.gpa-stat + .gpa-stat { border-left: 1px solid var(--line); }
.gpa-label { font-size: 12px; color: var(--text-faint); }
.gpa-value { font: 600 34px/1.1 var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.gpa-sub { font-size: 12px; color: var(--text-soft); }
.gpa-aim { margin-top: 12px; }
#gpa-result + .section { margin-top: 32px; }
.gpa-row { grid-template-columns: minmax(0, 1fr) 64px 108px 30px; }
.gpa-row select {
  font: 400 13px var(--font); color: var(--text); background: var(--bg-raised); border: 1px solid var(--line);
  border-radius: 6px; padding: 5px 6px; width: 100%; min-width: 0;
}
.gpa-row select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.gpa-row input[data-field=credits] { text-align: right; }
.gpa-past { display: flex; flex-wrap: wrap; gap: 12px; }
.gpa-past label, .gpa-scale-grid label { display: grid; gap: 4px; font-size: 12px; color: var(--text-faint); }
.gpa-past input, .gpa-scale-grid input {
  width: 120px; font: 500 15px var(--mono); padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--bg-raised); color: var(--text);
}
.gpa-past-fixed > div { display: grid; gap: 4px; min-width: 120px; }
.gpa-past-fixed span { font-size: 12px; color: var(--text-faint); }
.gpa-past-fixed strong { font: 500 20px var(--mono); font-variant-numeric: tabular-nums; color: var(--text); }
.gpa-past input:focus, .gpa-scale-grid input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.link-btn { all: unset; cursor: pointer; color: var(--text); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
.link-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
@media (hover: hover) and (pointer: fine) { .link-btn:hover { text-decoration-color: currentColor; } }
.gpa-mode { margin-top: 24px; }

.mygju-page .section { margin-bottom: 28px; }
.mygju-page .key-message { margin: 0 0 24px; }
.mygju-page .key-form .input { font-family: inherit; font-size: 14px; }
.mygju-file { margin-top: 12px; width: fit-content; }
.mygju-file:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.mygju-paste { margin-top: 14px; }
.mygju-paste summary { cursor: pointer; font-size: 13px; color: var(--text-faint); width: fit-content; }
@media (hover: hover) and (pointer: fine) { .mygju-paste summary:hover { color: var(--text); } }
.mygju-paste[open] summary { margin-bottom: 8px; }
.mygju-paste textarea { width: 100%; resize: vertical; font-size: 13px; margin-bottom: 8px; }
.gpa-scale summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-soft); padding: 4px 0; }
.gpa-scale .grade-sub { margin: 6px 0 12px; }
.gpa-scale-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 10px; margin-bottom: 10px; }
.gpa-scale-grid label span { font: 600 13px var(--mono); color: var(--text-soft); }
.gpa-scale-grid input { width: 100%; font-size: 13px; }
@media (max-width: 640px) {
  .gpa-row { grid-template-columns: minmax(0, 1fr) 52px 92px 28px; }
  .gpa-row.own { grid-template-columns: minmax(0, 1fr) 52px 92px 28px; }
  .gpa-row.own .g-name-input { grid-column: auto; }
  .gpa-value { font-size: 28px; }
  .gpa-stat { padding: 14px; }
}

/* Weekly review */
.review-nudge + .review-nudge { margin-top: 8px; }
.week-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 8px; }
.week-stats .gpa-value { font-size: 26px; }
.week-page .gpa-stats + .section { margin-top: 32px; }
@media (max-width: 640px) {
  .week-stats { grid-template-columns: 1fr; }
  .week-stats .gpa-stat { grid-template-columns: 1fr auto; align-items: baseline; column-gap: 12px; }
  .week-stats .gpa-label { grid-column: 1; }
  .week-stats .gpa-value { grid-column: 2; grid-row: 1 / span 2; font-size: 24px; align-self: center; }
  .week-stats .gpa-sub { grid-column: 1; }
  .week-stats .gpa-stat + .gpa-stat { border-left: 0; border-top: 1px solid var(--line); }
}

/* Focus */
.timer-card + .section { margin-top: 32px; }
body.has-focus-pill .view { padding-bottom: 80px; }
.timer-card { border: 1px solid var(--line); border-radius: 12px; background: var(--bg-raised); padding: 20px; }
.focus-label { display: block; font-size: 13px; color: var(--text-soft); margin-bottom: 8px; }
.timer-card select.input { width: 100%; max-width: 420px; }
.focus-start { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.focus-start .filters { margin: 0; }
.timer-card.running { text-align: center; padding: 28px 20px 22px; }
.focus-what { font-size: 14px; color: var(--text-soft); overflow-wrap: anywhere; }
.focus-clock { font: 500 64px/1.1 var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; margin: 6px 0 16px; }
.timer-card.paused .focus-clock { color: var(--text-faint); }
.focus-bar { height: 4px; border-radius: 2px; background: var(--bg-hover); overflow: hidden; max-width: 360px; margin: 0 auto; }
.focus-bar span { display: block; height: 100%; background: var(--accent); transform-origin: left; transition: transform 1s linear; }
.focus-actions { display: flex; gap: 8px; justify-content: center; margin-top: 20px; }
.focus-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; height: 132px; margin: 4px 0 18px; }
.focus-day { display: grid; grid-template-rows: 1fr auto; gap: 6px; text-align: center; min-width: 0; }
.focus-col { display: flex; align-items: flex-end; justify-content: center; }
.focus-col span { width: 100%; max-width: 28px; min-height: 2px; border-radius: 4px 4px 0 0; background: var(--line); }
.focus-col span.some { background: var(--accent); opacity: 0.85; }
.focus-day small { font: 400 11px var(--mono); color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.focus-courses { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.focus-courses li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(60px, 160px) 76px; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.focus-courses .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.focus-track { height: 6px; border-radius: 3px; background: var(--bg-hover); overflow: hidden; }
.focus-track span { display: block; height: 100%; background: var(--accent); transform-origin: left; }
.focus-courses .mins { font: 400 12px var(--mono); color: var(--text-soft); text-align: right; }
.focus-pill {
  position: fixed; right: 20px; bottom: 20px; z-index: 40; display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-raised); color: var(--text);
  font: 500 13px var(--font); box-shadow: var(--shadow); cursor: pointer; max-width: min(320px, calc(100vw - 40px));
}
.focus-pill[hidden] { display: none; }
.focus-pill #focus-pill-time { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.focus-pill-label { color: var(--text-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.focus-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }
@media (prefers-reduced-motion: no-preference) {
  .focus-dot { animation: focus-breathe 2.4s ease-in-out infinite; }
}
@keyframes focus-breathe { 50% { opacity: 0.35; } }
@media (max-width: 640px) {
  .focus-pill { right: 12px; bottom: calc(env(safe-area-inset-bottom) + 72px); }
  .focus-clock { font-size: 56px; }
  .focus-courses li { grid-template-columns: minmax(0, 1fr) 64px 70px; gap: 8px; }
}

/* Announcements */
.posts { border-top: 1px solid var(--line); }
.post { border-bottom: 1px solid var(--line); }
.post summary {
  list-style: none; cursor: pointer; padding: 11px 0; display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
}
.post summary::-webkit-details-marker { display: none; }
.post-title { font-size: 14px; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.post-meta { font: 400 12px var(--mono); color: var(--text-faint); white-space: nowrap; flex: none; }
.post[open] .post-title { color: var(--text); }
.post-body { padding: 0 0 14px; }
.post-body .prose { font-size: 15px; }
.post-body .file-list { margin-top: 12px; }
.post-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 13px; color: var(--text-soft); text-decoration: none; }
.post-link .icon { width: 14px; height: 14px; }
@media (hover: hover) and (pointer: fine) { .post summary:hover .post-title, .post-link:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); } }
@media (max-width: 640px) {
  .post summary { flex-direction: column; gap: 2px; }
}

/* Classes and absences */
.class-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.class-list li { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.class-day { font-weight: 500; }
.class-time { font: 400 13px var(--mono); font-variant-numeric: tabular-nums; color: var(--text-soft); }
.class-room { font-size: 13px; color: var(--text-faint); }
.class-edit { display: grid; gap: 8px; }
.class-slot-edit { display: grid; grid-template-columns: 96px 1fr 1fr 1fr 30px; gap: 8px; align-items: center; }
.class-slot-edit .input { min-width: 0; padding: 7px 8px; font-size: 14px; }
.class-slot-edit input[type='time'] { font-family: var(--mono); font-size: 13px; }
.class-edit-actions { display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; }
.absences { margin-top: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-raised); }
.absence-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; }
.absence-head strong { font: 600 18px var(--mono); }
.absence-limit { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-faint); }
.absence-limit input { width: 56px; font: 400 13px var(--mono); padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text); text-align: right; }
.absence-limit input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.absence-meter { height: 6px; border-radius: 3px; background: var(--bg-hover); overflow: hidden; margin-top: 10px; }
.absence-meter span { display: block; height: 100%; background: var(--ok); transform-origin: left; transition: transform 300ms var(--ease-out); }
.absences.warn .absence-meter span { background: var(--warn); }
.absences.late .absence-meter span { background: var(--late); }
.absence-note { font-size: 13px; margin-top: 8px; color: var(--warn); }
.absences.late .absence-note { color: var(--late); }
.absence-add { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.absence-add input[type='date'] { flex: 0 1 170px; font-family: var(--mono); font-size: 13px; }
.absence-list { list-style: none; margin: 10px 0 0; padding: 0; font-size: 13px; color: var(--text-soft); }
.absence-list li { display: flex; align-items: center; justify-content: space-between; padding: 3px 0; }
.absence-list .icon-btn { width: 26px; height: 26px; }
.absence-src { font-size: 12px; color: var(--text-faint); }
.absences .absence-sum { margin: 10px 0 0; }
.absence-kind { font-size: 12px; color: var(--text-faint); }
.absence-kind.absent { color: var(--late); }
.class-today { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.class-today li { border-bottom: 1px solid var(--line); }
.class-today button, .class-today .class-row { all: unset; box-sizing: border-box; cursor: pointer; width: 100%; display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding: 10px 0; font-size: 14px; }
.class-today button:focus-visible { outline: 2px solid var(--focus); }
.class-today .class-name small { margin-left: 8px; font: 500 11px var(--mono); color: var(--ok); }
.class-today li.over { opacity: 0.5; }
.timetable + .section, .tt-grid + .section, #tt-board + .section { margin-top: 32px; }

/* Timetable: a week grid on wide screens, one day at a time on phones. */
:root { --tt-1: #3c6e9f; --tt-2: #4d7f52; --tt-3: #a3612a; --tt-4: #8a4f8f; --tt-5: #2f7f7a; --tt-6: #9a4a4a; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --tt-1: #7fa9d6; --tt-2: #8bbf8f; --tt-3: #e0a06a; --tt-4: #c79acb; --tt-5: #6fbfb8; --tt-6: #d98e8e; }
}
:root[data-theme="dark"] { --tt-1: #7fa9d6; --tt-2: #8bbf8f; --tt-3: #e0a06a; --tt-4: #c79acb; --tt-5: #6fbfb8; --tt-6: #d98e8e; }
.tt-page { --tt-min: 1px; max-width: 1000px; }
.tt-picker { display: none; }
.tt-grid { display: grid; grid-template-columns: 44px repeat(var(--cols), minmax(0, 1fr)); gap: 0 6px; }
.tt-axis { position: relative; margin-top: 30px; height: calc(var(--span) * var(--tt-min)); }
.tt-axis span { position: absolute; top: calc(var(--at) * var(--tt-min)); right: 4px; transform: translateY(-50%); font: 400 11px var(--mono); color: var(--text-faint); white-space: nowrap; }
.tt-axis span:first-child { transform: translateY(-2px); }
.tt-col h2 { height: 30px; margin: 0; font-size: 12px; font-weight: 600; color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.04em; }
.tt-col.today h2 { color: var(--accent); }
.tt-track {
  position: relative; height: calc(var(--span) * var(--tt-min));
  border-radius: 6px;
}
.tt-line { position: absolute; left: 0; right: 0; top: calc(var(--top) * var(--tt-min)); border-top: 1px solid var(--line); pointer-events: none; }
.tt-col.today .tt-track { background-color: color-mix(in srgb, var(--accent) 3%, transparent); }
.tt-block {
  all: unset; box-sizing: border-box; position: absolute; left: 0; right: 0;
  top: calc(var(--top) * var(--tt-min) + 1px); height: calc(var(--len) * var(--tt-min) - 2px);
  display: flex; flex-direction: column; gap: 1px; overflow: hidden;
  padding: 5px 8px; border-radius: 6px; cursor: pointer;
  --hue: var(--tt-1);
  background: color-mix(in srgb, var(--hue) 13%, var(--bg-raised));
  box-shadow: inset 3px 0 0 var(--hue);
  transition: background-color 150ms var(--ease-out);
}
.tt-block[data-hue="2"] { --hue: var(--tt-2); }
.tt-block[data-hue="3"] { --hue: var(--tt-3); }
.tt-block[data-hue="4"] { --hue: var(--tt-4); }
.tt-block[data-hue="5"] { --hue: var(--tt-5); }
.tt-block[data-hue="6"] { --hue: var(--tt-6); }
div.tt-block { cursor: default; }
.tt-block:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
@media (hover: hover) and (pointer: fine) { button.tt-block:hover { background: color-mix(in srgb, var(--hue) 22%, var(--bg-raised)); } }
.tt-name { font-size: 12.5px; font-weight: 600; line-height: 1.3; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tt-meta { font-size: 11.5px; line-height: 1.3; color: var(--text-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-when { display: none; }
.tt-now { position: absolute; left: -3px; right: 0; top: calc(var(--top) * var(--tt-min)); height: 2px; background: var(--accent); border-radius: 1px; pointer-events: none; }
.tt-now::before { content: ''; position: absolute; left: 0; top: -2px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.tt-free { position: absolute; top: 8px; left: 0; right: 0; text-align: center; font-size: 12px; color: var(--text-faint); margin: 0; }
.tt-course-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; font-size: 14px; }
.mygju-bar { margin: -10px 0 26px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-raised); }
.mygju-bar .input { font-family: inherit; font-size: 14px; }
.mygju-bar .key-message { margin: 10px 0 0; }
.mygju-bar .data-note a { color: var(--text-soft); text-underline-offset: 3px; }

@media (max-width: 700px) {
  .tt-picker { display: flex; gap: 4px; margin-bottom: 14px; }
  .tt-pick {
    all: unset; box-sizing: border-box; flex: 1; cursor: pointer; text-align: center;
    padding: 8px 0 6px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--text-soft);
    display: grid; gap: 1px; transition: background-color 150ms var(--ease-out);
  }
  .tt-pick small { font: 400 11px var(--mono); color: var(--text-faint); min-height: 14px; }
  .tt-pick.today { color: var(--accent); }
  .tt-pick[aria-pressed="true"] { background: var(--bg-raised); box-shadow: 0 0 0 1px var(--line); color: var(--text); }
  .tt-pick:focus-visible { outline: 2px solid var(--focus); }
  .tt-grid { display: block; }
  .tt-axis, .tt-col h2, .tt-now, .tt-line { display: none; }
  .tt-col:not(.picked) { display: none; }
  .tt-track { height: auto; background: none; display: grid; gap: 8px; }
  .tt-block { position: static; height: auto; padding: 12px 14px; gap: 3px; }
  .tt-name { font-size: 15px; font-weight: 500; -webkit-line-clamp: 3; }
  .tt-col.today .tt-track { background: none; }
  .tt-meta { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 13px; white-space: normal; }
  .tt-when { display: inline; font-family: var(--mono); font-size: 12px; }
  .tt-free { position: static; text-align: left; font-size: 14px; padding: 12px 0; }
}
/* Timetable, coming up: one row per class from now on */
.tt-views { margin-bottom: 14px; }
.dep-done { margin: 0 0 6px; font-size: 13px; color: var(--text-faint); }
.dep-board { container-type: inline-size; }
.dep-head, .dep-row {
  display: grid; grid-template-columns: 92px minmax(0, 2fr) 150px minmax(0, 1.3fr) 84px 120px;
  column-gap: 12px; align-items: baseline;
}
.dep-head { padding: 0 10px 8px; font-size: 12px; font-weight: 500; color: var(--text-faint); }
.dep-head span:last-child { text-align: right; }
.dep-day { margin: 0; padding: 20px 0 6px; font-size: 13px; font-weight: 600; color: var(--text); }
.dep-day span { margin-left: 6px; font-weight: 400; color: var(--text-faint); }
.dep-head + .dep-day { padding-top: 4px; }
.dep-row {
  box-sizing: border-box; width: 100%; margin: 0; padding: 11px 10px; border: 0; border-top: 1px solid var(--line); border-radius: 0;
  background: none; color: var(--text); font: inherit; font-size: 14px; text-align: left;
  --hue: var(--tt-1);
  transition: background-color 150ms ease, transform 120ms ease-out;
}
button.dep-row { cursor: pointer; }
button.dep-row:active { transform: scale(0.985); }
button.dep-row:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; border-radius: 10px; }
@media (hover: hover) and (pointer: fine) { button.dep-row:hover { background: var(--bg-hover); border-radius: 10px; border-top-color: transparent; } }
@media (hover: hover) and (pointer: fine) { button.dep-row:hover + .dep-row { border-top-color: transparent; } }
.dep-row[data-hue="2"] { --hue: var(--tt-2); }
.dep-row[data-hue="3"] { --hue: var(--tt-3); }
.dep-row[data-hue="4"] { --hue: var(--tt-4); }
.dep-row[data-hue="5"] { --hue: var(--tt-5); }
.dep-row[data-hue="6"] { --hue: var(--tt-6); }
.dep-row.on { background: color-mix(in oklab, var(--accent-wash) 60%, transparent); border-radius: 10px; border-top-color: transparent; }
.dep-row.on + .dep-row { border-top-color: transparent; }
.dep-time { font: 500 20px var(--mono); letter-spacing: -0.02em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dep-time small { margin-left: 3px; font-size: 12px; font-weight: 400; color: var(--text-faint); letter-spacing: 0; }
.dep-course { display: flex; gap: 10px; align-items: baseline; min-width: 0; }
.dep-course > span { min-width: 0; }
.dep-dot { flex: none; width: 8px; height: 8px; border-radius: 3px; background: var(--hue); transform: translateY(-1px); }
.dep-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dep-course small { display: block; font: 12px var(--mono); color: var(--text-faint); }
.dep-room { min-width: 0; }
.dep-room span { display: inline-block; max-width: 100%; box-sizing: border-box; vertical-align: baseline; overflow: clip; text-overflow: ellipsis; font: 500 13px var(--mono); border: 1px solid var(--line-strong); border-radius: 6px; padding: 2px 7px; white-space: nowrap; }
.dep-room small { display: none; }
.dep-teacher { font-size: 13px; color: var(--text-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dep-len { font-size: 13px; color: var(--text-faint); white-space: nowrap; }
.dep-when { text-align: right; font-size: 13px; color: var(--text-soft); white-space: nowrap; }
.dep-when.on { color: var(--accent); font-weight: 500; }
.dep-quiet { margin: 0; padding: 14px 0 4px; font-size: 13px; color: var(--text-faint); }
.dep-quiet + .dep-quiet { padding-top: 4px; }
@container (max-width: 760px) {
  .dep-head { display: none; }
  .dep-row {
    grid-template-columns: 64px minmax(0, 1fr) auto; grid-template-areas: 'time course when' 'time room when' 'time teacher when';
    row-gap: 4px; align-items: start; padding: 12px 10px; margin: 0 -10px; width: calc(100% + 20px);
  }
  .dep-time { grid-area: time; font-size: 17px; line-height: 1.3; }
  .dep-time small { display: block; margin: 0; }
  .dep-course { grid-area: course; }
  .dep-course small { display: none; }
  .dep-name { font-weight: 500; white-space: normal; }
  .dep-room { grid-area: room; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; font-size: 12px; color: var(--text-faint); padding-left: 18px; }
  .dep-room span { font-size: 12px; padding: 1px 6px; color: var(--text); }
  .dep-room small { display: inline; font-size: 12px; }
  .dep-teacher { grid-area: teacher; font-size: 12px; color: var(--text-faint); padding-left: 18px; }
  .dep-teacher:empty, .dep-len { display: none; }
  .dep-when { grid-area: when; font-size: 12px; align-self: center; }
  .dep-when.later { display: none; }
}
@container (max-width: 460px) { .dep-teacher { display: none; } }
@media (prefers-reduced-motion: reduce) { .dep-row { transition: none; } button.dep-row:active { transform: none; } }

.tt-export .page-sub { margin: 0 0 12px; max-width: 60ch; }
.tt-export-row { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.tt-export-row label { display: grid; gap: 4px; font-size: 12px; color: var(--text-faint); }
.tt-export-row input { font: 400 14px var(--font); color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; }
.tt-courses { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.tt-courses li { border-bottom: 1px solid var(--line); }
.tt-courses button { all: unset; box-sizing: border-box; cursor: pointer; width: 100%; display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; font-size: 14px; }
.tt-courses .name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-courses .row-meta { flex: none; font-size: 12px; color: var(--text-faint); }
.tt-courses.gju button, .tt-courses.gju .tt-course-row { flex-direction: column; gap: 2px; }
.tt-courses.gju .row-meta { flex: initial; }
.class-teacher { margin: -4px 0 10px; font-size: 13px; color: var(--text-soft); }
@media (max-width: 640px) {
  .class-slot-edit { grid-template-columns: 1fr 1fr 30px; }
  .class-slot-edit [data-slot-field='day'] { grid-column: 1 / 3; }
  .class-slot-edit [data-slot-field='room'] { grid-column: 1 / 3; }
  .class-slot-edit .icon-btn { grid-row: 1; grid-column: 3; }
  .timetable { grid-template-columns: 1fr; }
  .tt-courses button { flex-direction: column; gap: 2px; }
}

/* Study plan */
.plan-edit { display: grid; gap: 8px; }
.plan-step { display: grid; grid-template-columns: 22px minmax(0, 1fr) 160px 30px; gap: 8px; align-items: center; }
.plan-num { font: 500 12px var(--mono); color: var(--text-faint); text-align: center; }
.plan-step .input { min-width: 0; padding: 7px 9px; font-size: 14px; }
.plan-step input[type='date'] { font-family: var(--mono); font-size: 13px; }
.plan-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.plan-actions .spacer { flex: 1; }
.plan .grade-sub { margin: 0 0 10px; }
.section.plan { margin-top: 28px; }
@media (max-width: 640px) {
  .plan-step { grid-template-columns: 22px minmax(0, 1fr) 30px; }
  .plan-step input[type='date'] { grid-column: 2; grid-row: 2; }
  .plan-step .icon-btn { grid-row: 1; grid-column: 3; }
}

/* Printing: just the page that's open, in black on white. */
@page { margin: 18mm; }
@media print {
  :root, :root[data-theme] { --bg: #fff; --bg-raised: #fff; --text: #000; --text-soft: #222; --text-faint: #555; --line: #ccc; }
  html, body, .workspace, .main, .view { height: auto; overflow: visible; background: #fff; }
  .workspace { display: block; }
  .ribbon, .sidebar, .tabbar, .panel, .bottombar, .toast, .focus-pill, .scrim, .note-toolbar, .templates,
  .page-actions, .quick-add, .grade-actions, .course-foot, .link-add, [data-link-remove], .icon-btn { display: none !important; }
  .page, .note-page { max-width: none; padding: 0; }
  .prose a { color: inherit; }
  h1, h2, h3, h4 { break-after: avoid; }
  li, .grade-row, .row { break-inside: avoid; }
}

/* Course Portfolio: every course's MyGJU files */
.portfolio-picks { flex-wrap: wrap; gap: 6px; }
.portfolio-picks .count { font: 400 11px var(--mono); margin-left: 6px; opacity: 0.7; }
.portfolio-page .section-head h2 a { color: inherit; text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .portfolio-page .section-head h2 a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; } }

/* Settings */
.set-list { display: grid; border-top: 1px solid var(--line); }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 0; border-bottom: 1px solid var(--line); }
.settings-page .section > .set-row { border-top: 1px solid var(--line); }
.set-label { font-size: 14px; font-weight: 500; }
.set-row .filters { margin: 0; flex-wrap: wrap; }
.swatches { display: flex; gap: 10px; }
.swatch {
  width: 26px; height: 26px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; background: var(--sw);
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px transparent; transition: box-shadow 150ms var(--ease-out), transform 150ms var(--ease-out);
}
.swatch[aria-pressed='true'] { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--sw); }
.swatch:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
.swatch:active { transform: scale(0.94); }
.set-select { width: auto; min-width: 180px; }
.set-pages { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.set-page { display: grid; grid-template-columns: minmax(0, 1fr) 72px; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.set-page-head { padding: 6px 0; font-size: 12px; color: var(--text-faint); }
.set-page-head span { text-align: center; }
.set-page-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.set-page-name .icon { width: 16px; height: 16px; color: var(--text-soft); flex: none; }
.set-check { display: flex; justify-content: center; }
.set-check input { width: 17px; height: 17px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.set-check input:disabled { cursor: not-allowed; opacity: 0.4; }
.set-always { font-size: 12px; color: var(--text-faint); }
.set-dock, .set-dock-note { display: none; }
.set-links { display: grid; border-top: 1px solid var(--line); }
.set-link {
  all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 12px;
  padding: 12px 4px; border-bottom: 1px solid var(--line);
}
.set-link > .icon { width: 16px; height: 16px; color: var(--text-soft); flex: none; }
.set-link > .icon:last-child { margin-left: auto; color: var(--text-faint); }
.set-link span { display: grid; gap: 1px; min-width: 0; }
.set-link strong { font-weight: 500; font-size: 14px; }
.set-link small { font-size: 12.5px; color: var(--text-faint); }
.set-link:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
@media (hover: hover) and (pointer: fine) { .set-link:hover strong { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); } }
.set-reset { margin-top: 20px; }
@media (max-width: 820px) {
  .set-page { grid-template-columns: minmax(0, 1fr) 64px 72px; }
  .set-dock { display: flex; }
  .set-page-head .set-dock { display: block; }
  .set-dock-note { display: inline; }
}

/* New marks on Today */
.new-marks .section-head .btn { padding: 3px 10px; font-size: 12px; }
.row-when.mark-score { font: 600 15px var(--mono); color: var(--text); display: grid; justify-items: end; }
.row-when.mark-score small { font: 400 11px var(--font); color: var(--text-faint); }

/* Hand in an assignment */
.hand-status { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 14px; font-size: 14px; color: var(--text-soft); }
.hand-status .icon { width: 17px; height: 17px; flex: none; margin-top: 2px; color: var(--text-faint); }
.hand-status strong { font-weight: 600; color: var(--text); }
.hand-status.ok .icon { color: var(--ok); }
.hand-status.warn .icon, .hand-status.warn strong { color: var(--warn); }
.hand-files { list-style: none; margin: 0 0 12px; padding: 0; border-top: 1px solid var(--line); }
.hand-files li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.hand-files img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; flex: none; background: var(--bg-hover); }
.hand-files .file-icon { width: 44px; height: 44px; flex: none; }
.hand-files .row-main { flex: 1; min-width: 0; display: grid; }
.hand-files .row-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hand-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.hand-buttons label.btn { cursor: pointer; }
.hand-buttons label.btn:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.hand-check { display: flex; align-items: flex-start; gap: 10px; margin-top: 14px; font-size: 14px; color: var(--text-soft); line-height: 1.45; cursor: pointer; }
.hand-check input { width: 17px; height: 17px; margin: 1px 0 0; flex: none; accent-color: var(--accent); }
.hand-pick .grade-sub { margin-top: 10px; }
.hand-text { width: 100%; margin-top: 4px; font: 400 14px/1.55 var(--font); resize: vertical; }
.hand-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.hand-actions .grade-sub { margin: 0; }
.hand-actions .btn[disabled] { opacity: 0.45; cursor: not-allowed; }
@media (max-width: 820px) { .hand-buttons .mobile-only { display: inline-flex; } }

/* Sharing a note */
.share-bar { margin: -6px 0 22px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-raised); }
.share-bar p { margin: 0 0 10px; font-size: 13px; color: var(--text-soft); }
.share-bar .key-message { margin: 10px 0 0; }
.share-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.share-url { flex: 1 1 220px; min-width: 0; font: 400 13px var(--mono); color: var(--text-soft); }

/* Semester Wrapped */
.wrapped-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.wrapped-card { display: flex; flex-direction: column; gap: 6px; min-width: 0; min-height: 148px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-raised); }
.wrapped-card.hero, .wrapped-card.fill-3 { grid-column: span 2; }
.w-label { font-size: 12px; color: var(--text-faint); }
.w-value { margin-top: auto; font: 600 34px/1.1 var(--font); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.w-value.text { font: 600 22px/1.25 var(--font); letter-spacing: -0.01em; text-wrap: balance; }
.hero .w-value { font-size: 56px; color: var(--accent); }
.w-line { margin: 0; font-size: 13px; color: var(--text-soft); }
.wrapped-card.enter { animation: wrapped-in 420ms var(--ease-out) both; animation-delay: calc(var(--i) * 45ms); }
@keyframes wrapped-in { from { opacity: 0; transform: translateY(8px); } }
.wrapped-grid + .section { margin-top: 32px; }
.wrapped-share-body { display: flex; gap: 24px; align-items: flex-start; }
.wrapped-preview { flex: none; width: 180px; aspect-ratio: 9 / 16; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--bg-hover); }
.wrapped-preview img { display: block; width: 100%; height: 100%; }
.wrapped-share-side { flex: 1; min-width: 0; max-width: 420px; }
.wrapped-share-side .grade-sub { margin: 0; }
@media (max-width: 820px) {
  .wrapped-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wrapped-card.fill-3 { grid-column: auto; }
  .wrapped-card.fill-2 { grid-column: span 2; }
}
@media (max-width: 640px) {
  .wrapped-grid { gap: 8px; }
  .wrapped-card { min-height: 128px; padding: 14px; }
  .w-value { font-size: 28px; }
  .w-value.text { font-size: 18px; }
  .hero .w-value { font-size: 44px; }
  .wrapped-share-body { flex-direction: column; gap: 16px; }
  .wrapped-preview { width: 150px; }
}

/* Study mode: pick files, then study them together */
.page-pick { max-width: 760px; }
.pick-course { display: grid; gap: 6px; max-width: 420px; margin-bottom: 20px; font-size: 13px; color: var(--text-soft); }
.pick-course select { width: 100%; }
.pick-tools { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 4px; font-size: 13px; color: var(--text-faint); }
.pick-row { grid-template-columns: 18px 30px minmax(0, 1fr); cursor: pointer; }
.pick-box { width: 17px; height: 17px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.pick-box:disabled { cursor: not-allowed; }
.pick-row:has(.pick-box:disabled) { opacity: 0.5; cursor: not-allowed; }
@media (hover: hover) and (pointer: fine) { .pick-row:hover { background: var(--bg-hover); } }
.pick-bar {
  position: sticky; bottom: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 24px -4px 0; padding: 12px 4px; background: var(--bg); border-top: 1px solid var(--line);
  font-size: 14px; color: var(--text-soft);
}
.section-actions { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.study-sources { margin: -6px 0 20px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-raised); padding: 0 14px; }
.study-sources summary { display: flex; align-items: center; gap: 6px; padding: 10px 0; cursor: pointer; list-style: none; font-size: 13px; font-weight: 500; color: var(--text-soft); }
.study-sources summary::-webkit-details-marker { display: none; }
.study-sources summary .icon { width: 14px; height: 14px; transition: transform 160ms var(--ease-out); }
.study-sources[open] summary .icon { transform: rotate(90deg); }
.study-sources ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.study-sources li { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 0; font-size: 13px; }
.study-sources li + li { border-top: 1px solid var(--line); }
.src-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src-state { font-size: 12px; color: var(--text-faint); display: inline-flex; }
.src-state.warn { color: var(--warn); }
.src-state.ok { color: var(--ok); }
.src-state .icon { width: 16px; height: 16px; }
.study-sources .link-btn { margin: 4px 0 12px; }
.study-nofiles { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 8px 8px 14px; font-size: 13px; font-weight: 500; color: var(--text-soft); }
@media (max-width: 640px) {
  .pick-bar { bottom: 0; }
  .pick-bar .btn { flex: none; }
}
.src-note { margin: 4px 0 0; font-size: 13px; color: var(--warn); }
.src-note a { color: inherit; text-underline-offset: 3px; }
.pick-sum { display: grid; gap: 4px; }
.pick-save { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-faint); cursor: pointer; }
.pick-save input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); }
.pick-own { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; border-bottom: 1px solid var(--line); }
.pick-own .file-row { border-bottom: 0; }
.pick-add-row { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; margin-top: 14px; font-size: 13px; color: var(--text-faint); }
.pick-add { cursor: pointer; }
.pick-add:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.data-note + .data-row { margin-top: 14px; }

/* Taking a Moodle quiz */
.quiz-start .quiz-tries { list-style: none; margin: 0 0 14px; padding: 0; border-top: 1px solid var(--line); }
.quiz-tries li { display: grid; grid-template-columns: 1fr auto auto; gap: 16px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.quiz-try-mark { font-variant-numeric: tabular-nums; font-weight: 500; }
.quiz-password { display: grid; gap: 6px; max-width: 320px; margin-bottom: 4px; font-size: 13px; color: var(--text-soft); }

.page-quiz { max-width: 760px; }
.page-quiz .page-head { align-items: flex-start; }
.quiz-timer {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border: 1px solid var(--line-strong); border-radius: 999px;
  font: 500 13px var(--mono); font-variant-numeric: tabular-nums; color: var(--text); background: var(--bg-raised); white-space: nowrap;
  transition: color 160ms ease, border-color 160ms ease;
}
.quiz-timer .icon { width: 14px; height: 14px; color: var(--text-faint); }
.quiz-timer.low { color: var(--late); border-color: var(--late); }
.quiz-timer.low .icon { color: var(--late); }
.quiz-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 22px; }
.quiz-dot {
  min-width: 32px; height: 32px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line-strong); background: transparent;
  font: 500 13px var(--mono); color: var(--text-soft); cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, transform 120ms var(--ease-out);
}
.quiz-dot.done { background: var(--bg-hover); color: var(--text); border-color: var(--line); }
.quiz-dot[aria-current='true'] { border-color: var(--text); color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.quiz-dot:active:not(:disabled) { transform: scale(0.96); }
.quiz-dot:disabled { cursor: default; }
@media (hover: hover) and (pointer: fine) { .quiz-dot:hover:not(:disabled) { border-color: var(--text-soft); } }

.quiz-form { display: grid; gap: 16px; }
.q { padding: 18px 20px 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-raised); min-width: 0; }
.q-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 12px; font-size: 12px; color: var(--text-faint); }
.q-no { font: 600 12px var(--mono); color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.05em; }
.q-status { margin-left: auto; }
.q-status.answersaved, .q-status.complete { color: var(--ok); }
.q-review.correct { border-color: color-mix(in oklab, var(--ok) 45%, var(--line)); }
.q-review.incorrect { border-color: color-mix(in oklab, var(--late) 45%, var(--line)); }
.q-status.correct { color: var(--ok); }
.q-status.incorrect { color: var(--late); }
.q-status.partiallycorrect { color: var(--warn); }
.q-away { background: transparent; border-style: dashed; }
.q-away a, .q-body a, .q + .grade-sub a { color: var(--accent); text-underline-offset: 3px; }

.q-body { line-height: 1.6; overflow-wrap: anywhere; }
.q-body .qtext { font-size: 16px; color: var(--text); margin-bottom: 14px; }
.q-body .qtext p { margin: 0 0 8px; }
.q-body .qtext p:last-child { margin-bottom: 0; }
.q-body img { max-width: 100%; height: auto; border-radius: 6px; }
.q-body table { border-collapse: collapse; max-width: 100%; }
.q-body td, .q-body th { padding: 6px 10px 6px 0; vertical-align: middle; }
.q-body fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.q-body .prompt { font-size: 13px; color: var(--text-faint); margin-bottom: 8px; }
.q-body .answer { display: grid; gap: 8px; }
.q-body table.answer { display: table; width: 100%; }
.q-body table.answer tr + tr td { border-top: 1px solid var(--line); }
.q-body .answer > .r0, .q-body .answer > .r1 {
  display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; border: 1px solid var(--line-strong); border-radius: 9px;
  background: var(--bg); color: var(--text); cursor: pointer; transition: border-color 140ms ease, background-color 140ms ease;
}
.q-body .answer > .r0:has(input:checked), .q-body .answer > .r1:has(input:checked) { border-color: var(--accent); background: color-mix(in oklab, var(--accent) 8%, var(--bg)); }
.q-body .answer > .r0:has(input:disabled), .q-body .answer > .r1:has(input:disabled) { cursor: default; }
@media (hover: hover) and (pointer: fine) { .q-body .answer > :is(.r0, .r1):hover:not(:has(input:disabled)) { border-color: var(--text-soft); } }
.q-body .answer label { cursor: inherit; }
.q-body input[type='radio'], .q-body input[type='checkbox'] { width: 17px; height: 17px; margin: 3px 0 0; flex: none; accent-color: var(--accent); }
.q-body code { font-family: var(--mono); font-size: 0.9em; padding: 1px 5px; border-radius: 4px; background: var(--bg-hover); }
.q-body .answernumber { color: var(--text-faint); margin-right: 4px; }
.q-body .answer > :is(.r0, .r1) div, .q-body .answer > :is(.r0, .r1) > label { display: inline; }
.q-body input[type='text'], .q-body input[type='number'], .q-body select, .q-body textarea {
  font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 10px; max-width: 100%;
}
.q-body input[type='text'], .q-body input[type='number'] { width: min(100%, 320px); margin: 0 4px; }
.q-body .qtext input[type='text'] { width: auto; min-width: 8ch; padding: 4px 8px; }
.q-body textarea { width: 100%; min-height: 180px; resize: vertical; line-height: 1.55; }
.q-body select { min-width: 160px; }
.q-body :is(input, select, textarea):focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.q-body :is(input, select, textarea):read-only:not([type='radio']):not([type='checkbox']), .q-body :is(select):disabled { background: transparent; }
.q-body .ablock > label { margin-right: 6px; color: var(--text-soft); }
.q-clear { margin-top: 6px; font-size: 13px; }
.q-clear label { color: var(--text-soft); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); cursor: pointer; }
.q-clear:has(input:checked) { display: none; }
.q-check { margin-top: 12px; }
.q-body .outcome { margin-top: 14px; padding: 12px 14px; border-radius: 9px; background: var(--bg); border: 1px solid var(--line); font-size: 14px; color: var(--text-soft); }
.q-body .outcome .rightanswer { color: var(--text); margin-top: 6px; }
.q-body .outcome > :first-child > :first-child { margin-top: 0; }
.q-body .validationerror { color: var(--late); font-size: 13px; margin-top: 6px; }

.quiz-bar {
  position: sticky; bottom: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 20px -4px 0; padding: 12px 4px; background: var(--bg); border-top: 1px solid var(--line);
}
.quiz-saved { font-size: 12px; color: var(--text-faint); }
.quiz-moodle { margin: 20px 0 0; font-size: 12px; color: var(--text-faint); }
.quiz-moodle .link-btn { color: var(--text-soft); }

.quiz-sum-list { list-style: none; margin: 0 0 18px; padding: 0; border-top: 1px solid var(--line); }
.quiz-sum-row {
  all: unset; box-sizing: border-box; width: 100%; display: flex; justify-content: space-between; gap: 12px; padding: 11px 4px;
  border-bottom: 1px solid var(--line); font-size: 14px; cursor: pointer;
}
.quiz-sum-row:disabled { cursor: default; }
.quiz-sum-row:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.quiz-sum-row .q-status { margin: 0; color: var(--text-faint); }
.quiz-sum-row .q-status.answersaved, .quiz-sum-row .q-status.complete { color: var(--ok); }
@media (hover: hover) and (pointer: fine) { .quiz-sum-row:hover:not(:disabled) { background: var(--bg-hover); } }
.quiz-result { margin-bottom: 32px; }
.quiz-result .quiz-score { font-size: 40px; letter-spacing: -0.03em; margin: 6px 0 0; font-variant-numeric: tabular-nums; }
.quiz-result .quiz-score span { font-size: 16px; font-weight: 500; color: var(--text-soft); letter-spacing: 0; margin-left: 6px; }
@media (max-width: 640px) {
  .q { padding: 16px 14px 16px; }
  .quiz-tries li { grid-template-columns: 1fr auto; }
  .quiz-tries li .row-meta { display: none; }
  .q-body select { min-width: 0; width: 100%; }
  .q-body table.answer td { display: block; padding: 6px 0; }
  .q-body table.answer tr + tr td + td { border-top: 0; }
}

/* The way back to a quiz that's still going */
.quiz-return {
  position: fixed; left: 50%; bottom: 20px; z-index: 39; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px; width: max-content; max-width: min(560px, calc(100vw - 32px));
  padding: 8px 8px 8px 16px; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--bg-raised);
  box-shadow: var(--shadow);
}
@media (prefers-reduced-motion: no-preference) {
  .quiz-return { animation: quiz-return-in 220ms var(--ease-out); }
}
@keyframes quiz-return-in { from { opacity: 0; transform: translate(-50%, 8px); } }
.quiz-return-text { display: grid; min-width: 0; line-height: 1.3; }
.quiz-return-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quiz-return-sub { font-size: 12px; color: var(--text-soft); }
.quiz-return-sub span { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.quiz-return.low .quiz-return-sub { color: var(--late); }
.quiz-return.low .focus-dot { background: var(--late); }
.quiz-return .btn { flex: none; }
body.has-quiz-return .view { padding-bottom: 96px; }
body.has-quiz-return .focus-pill { bottom: 88px; }
body.has-quiz-return .toast { bottom: 92px; }
@media (max-width: 640px) {
  .quiz-return { bottom: calc(env(safe-area-inset-bottom) + 72px); width: calc(100vw - 24px); }
  .quiz-return-text { flex: 1; }
  body.has-quiz-return .focus-pill { bottom: calc(env(safe-area-inset-bottom) + 140px); }
  body.has-quiz-return .toast { bottom: calc(env(safe-area-inset-bottom) + 144px); }
}

/* Send feedback */
.fb-form { display: grid; gap: 12px; }
.fb-kinds { margin-bottom: 0; flex-wrap: wrap; }
.fb-text { min-height: 140px; resize: vertical; font: 400 15px/1.55 var(--font); }
.fb-pic { display: flex; }
.fb-add { cursor: pointer; }
.fb-add:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.fb-thumb { position: relative; margin: 0; }
.fb-thumb img { display: block; max-width: 220px; max-height: 160px; border-radius: 8px; border: 1px solid var(--line); object-fit: cover; }
.fb-thumb .icon-btn { position: absolute; top: 6px; right: 6px; background: var(--bg-raised); border: 1px solid var(--line); box-shadow: var(--shadow); }
.fb-with { font-size: 13px; color: var(--text-faint); }
.fb-send { justify-self: start; min-width: 120px; }
.fb-sent { padding: 8px 0 0; outline: none; }
.fb-sent h2 { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.fb-sent p { color: var(--text-soft); margin: 6px 0 16px; max-width: 46ch; }
.fb-actions { display: flex; flex-wrap: wrap; gap: 8px; }
#fb-inbox:not(:empty) { margin-top: 44px; padding-top: 4px; }
.fb-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; border-top: 1px solid var(--line); }
.fb-item { padding: 14px 0; border-bottom: 1px solid var(--line); display: grid; gap: 6px; }
.fb-item-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: 13px; }
.fb-item-head strong { font-weight: 500; }
.fb-user { color: var(--text-faint); font-family: var(--mono); font-size: 12px; }
.fb-item-head time { margin-left: auto; color: var(--text-faint); font-size: 12px; }
.fb-tag { font-size: 11px; font-weight: 500; padding: 1px 7px; border-radius: 999px; background: var(--bg-active); color: var(--text-soft); }
.fb-tag.fb-bug { background: var(--late-wash); color: var(--late); }
.fb-tag.fb-idea { background: var(--accent-wash); color: var(--accent); }
.fb-item-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.fb-item-pic img { display: block; max-width: 100%; max-height: 260px; border-radius: 8px; border: 1px solid var(--line); }
.fb-item-meta { font-size: 12px; color: var(--text-faint); }
.fb-item-errors { margin: 0; padding: 8px 10px; border-radius: 6px; background: var(--bg-side); font: 400 11.5px/1.5 var(--mono); color: var(--text-soft); white-space: pre-wrap; overflow-wrap: anywhere; }
.fb-done { justify-self: start; margin-left: -8px; font-size: 13px; }

/* Welcome tour */
.tour {
  width: min(440px, calc(100vw - 32px)); padding: 0; margin: auto;
  border: 1px solid var(--line-strong); border-radius: 14px; background: var(--bg-raised); color: var(--text);
  box-shadow: var(--shadow); overflow: hidden;
  opacity: 0; transform: translateY(8px) scale(0.98);
  transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out), overlay 220ms allow-discrete, display 220ms allow-discrete;
}
.tour[open] { opacity: 1; transform: none; }
@starting-style { .tour[open] { opacity: 0; transform: translateY(8px) scale(0.98); } }
.tour::backdrop { background: rgb(0 0 0 / 0.32); }
.tour-body { padding: 26px 26px 8px; animation: tour-in 240ms var(--ease-out); }
@keyframes tour-in { from { opacity: 0; transform: translateX(calc(var(--dir, 0) * 14px)); } }
.tour-logo { display: block; width: 56px; height: 56px; margin: -4px 0 14px -10px; image-rendering: pixelated; }
.tour-count { font: 400 12px var(--mono); color: var(--text-faint); margin-bottom: 6px; }
.tour h2 { font-size: 20px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.25; text-wrap: balance; }
.tour-text { color: var(--text-soft); margin-top: 8px; line-height: 1.55; }
.tour-find { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 16px; font-size: 12px; color: var(--text-faint); }
.tour-find > span:first-child { margin-right: 2px; }
.tour-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 6px; background: var(--bg-side); border: 1px solid var(--line); color: var(--text); font-size: 13px; }
.tour-chip .icon { width: 14px; height: 14px; color: var(--text-soft); }
.tour-tip { margin-top: 16px; font-size: 13px; color: var(--text-faint); }
.tour-tip .icon { width: 14px; height: 14px; vertical-align: -2px; margin: 0 1px; }
.tour-foot { display: flex; align-items: center; gap: 6px; padding: 14px 18px 18px 26px; }
.tour-dots { display: flex; gap: 2px; margin-right: auto; }
.tour-dot { width: 18px; height: 18px; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; border-radius: 4px; }
.tour-dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); transition: background-color 160ms ease, width 200ms var(--ease-out); }
.tour-dot[aria-current='step']::before { width: 14px; border-radius: 3px; background: var(--text); }
.tour-dot:focus-visible { outline: 2px solid var(--focus); }
@media (max-width: 480px) {
  .tour { margin: auto auto 12px; }
  .tour-body { padding: 22px 20px 6px; }
  .tour-foot { padding: 12px 14px 16px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .tour, .tour-body { transition: none; animation: none; }
}

/* Offering reminders the first time */
.remind-ask-icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 14px; border-radius: 12px; background: var(--accent-wash); color: var(--accent); }
.remind-ask-icon .icon { width: 22px; height: 22px; }
#remind-ask .form-error { margin-top: 12px; }

/* Deadline reminders, in Settings */
.remind { display: grid; gap: 12px; padding: 4px 0 8px; }
.remind-lede { color: var(--text-soft); max-width: 52ch; }
.remind-lede .icon { width: 14px; height: 14px; vertical-align: -2px; }
.remind-opts { display: grid; gap: 2px; }
.remind-opt { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 14px; cursor: pointer; width: fit-content; }
.remind-opt input { width: 17px; height: 17px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.remind-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.remind .data-note { margin-top: 0; }

/* Email and Teams on Today */
.ms-nudge { cursor: default; flex-wrap: wrap; }
.review-nudge > .ms-nudge-acts { flex: none; display: flex; gap: 6px; margin-left: auto; }
@media (hover: hover) and (pointer: fine) { .ms-nudge:hover { border-color: var(--line); } }
.ms-links { display: flex; gap: 2px; }
.ms-links .btn { font-size: 12px; }
.row-meta .ms-from { flex: none; max-width: 45%; }
.row-meta .ms-preview { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ms-nudge > span:not(.ms-nudge-acts) { min-width: 220px; }
.ms-acts { margin-top: 10px; }

/* Moodle messages */
.row.msg-unread .row-title, .up.msg-unread .t { font-weight: 600; }
.row-when .msg-count { color: var(--accent); }
/* A chat: messages sit at the bottom like in a messenger, with the box
   pinned under them. Your own bubbles are a neutral colour, never the
   accent, so they can't be mistaken for selected text. */
:root { --bubble-mine: #2b2a26; --bubble-mine-text: #f6f5f1; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bubble-mine: #3a3934; --bubble-mine-text: #ece9e2; } }
:root[data-theme="dark"] { --bubble-mine: #3a3934; --bubble-mine-text: #ece9e2; }
.chat-page { display: flex; flex-direction: column; min-height: 100%; padding-bottom: 0; max-width: 1040px; }
.chat-page > .page-head { margin-bottom: 8px; }
.chat-list { flex: 1; list-style: none; margin: 0; padding: 0 0 8px; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; }
.chat-day { align-self: center; margin: 18px 0 6px; font-size: 12px; color: var(--text-faint); }
.chat-msg { display: flex; flex-direction: column; align-items: flex-start; align-self: flex-start; max-width: min(78%, 620px); margin-top: 10px; }
.chat-msg.cont { margin-top: 0; }
.chat-msg.mine { align-self: flex-end; align-items: flex-end; }
.chat-from { font-size: 12px; color: var(--text-faint); margin: 0 0 3px 12px; }
.chat-bubble { padding: 8px 13px; border-radius: 18px; background: var(--bg-raised); border: 1px solid var(--line); font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.chat-bubble > :first-child { margin-top: 0; }
.chat-bubble > :last-child { margin-bottom: 0; }
.chat-msg:not(.mine).cont .chat-bubble { border-top-left-radius: 6px; }
.chat-msg:not(.mine).more .chat-bubble { border-bottom-left-radius: 6px; }
.chat-msg.mine .chat-bubble { background: var(--bubble-mine); color: var(--bubble-mine-text); border-color: transparent; }
.chat-msg.mine.cont .chat-bubble { border-top-right-radius: 6px; }
.chat-msg.mine.more .chat-bubble { border-bottom-right-radius: 6px; }
.chat-msg.mine .chat-bubble a { color: inherit; }
.chat-msg.mine .chat-bubble :is(code, pre) { background: rgb(255 255 255 / 0.1); color: inherit; }
.chat-time { font-size: 11px; color: var(--text-faint); margin: 4px 12px 0; font-variant-numeric: tabular-nums; }
.chat-form { position: sticky; bottom: 0; display: flex; gap: 8px; align-items: flex-end; padding: 10px 0 18px; background: var(--bg); }
.chat-page .chat-form textarea { flex: 1; resize: none; min-height: 42px; max-height: 160px; padding-top: 10px; padding-bottom: 10px; line-height: 1.45; border-radius: 21px; padding-inline: 16px; }
.chat-page .chat-form .btn { height: 42px; border-radius: 21px; padding-inline: 18px; }

/* Right panel: next class and recent chats */
.panel-block { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.panel-head a.panel-sub { text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .panel-head a.panel-sub:hover { color: var(--text); } }
.panel-class { display: grid; gap: 2px; width: 100%; padding: 8px 6px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.panel-class .t { font-size: 13px; font-weight: 500; }
.panel-class .m { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--text-faint); }
.panel-class .m .w { font-family: var(--mono); }
@media (hover: hover) and (pointer: fine) { .panel-class:hover { background: var(--bg-hover, var(--line)); } }
.up .n .icon { width: 13px; height: 13px; vertical-align: -2px; }
.up .m .p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.up .m { min-width: 0; }
.up .t { min-width: 0; }
.chat-page .page-head .btn { white-space: nowrap; flex: none; }
.panel-new { margin-left: 6px; font: 400 12px var(--mono); color: var(--accent); }
.panel-read { display: flex; align-items: center; gap: 6px; width: 100%; margin-top: 4px; padding: 7px 6px; border: 0; border-radius: 7px; background: none; color: var(--text-soft); font: inherit; font-size: 12px; text-align: left; cursor: pointer; white-space: nowrap; }
.panel-read .icon { width: 14px; height: 14px; flex: none; }
@media (hover: hover) and (pointer: fine) { .panel-read:hover { background: var(--bg-hover); color: var(--text); } }
.msg-readall { margin-top: 6px; }
.ms-links { flex-wrap: wrap; justify-content: flex-end; }
.ms-links .btn, .msg-readall { white-space: nowrap; }
.notice-body { margin: 4px 0 18px; }
.notice-card { margin-top: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-raised); }
.notice-card .section-head { margin-bottom: 10px; }
.notice-card .section-head h2 { color: var(--text); font-size: 14px; }
.notice-facts { display: grid; gap: 6px; margin: 0; }
.notice-facts > div { display: grid; grid-template-columns: 90px 1fr; gap: 12px; font-size: 13px; }
.notice-facts dt { color: var(--text-faint); }
.notice-facts dd { margin: 0; color: var(--text); }
.notice-grade { font: 500 15px var(--mono); }
.notice-sub { margin: 14px 0 4px; font-size: 13px; font-weight: 600; color: var(--text-soft); }
.notice-links { margin: 18px 0 14px; }

/* Saving quiz questions for revision */
.quiz-save { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 28px; }
.q-head .q-save { align-self: center; margin-left: auto; min-height: 30px; padding: 0 8px; font-size: 12px; }
.q-head .q-save:disabled { opacity: 1; color: var(--ok); }
.quiz-try-review { min-height: 30px; padding: 0 10px; font-size: 12px; }
.flashcard .text, .review-card .answer { white-space: pre-line; }
.quiz-tries li:has(.quiz-try-review) { grid-template-columns: 1fr auto auto auto; }
.q-status + .q-save { margin-left: 0; }

/* Handed in on Moodle but still open: a fixed tick, not a checkbox */
.check.check-moodle { cursor: default; background: var(--ok); border-color: var(--ok); }
.check.check-moodle::after { content: ''; width: 7px; height: 4px; border: 1.5px solid var(--bg); border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }
.check.check-moodle:active { transform: none; }
.row-handed { color: var(--ok); }
.section .sub-head { margin: 22px 0 6px; font-size: 13px; font-weight: 600; color: var(--text-soft); }
.done-earlier { margin-top: 18px; }
.done-earlier > summary { cursor: pointer; width: fit-content; font-size: 13px; font-weight: 600; color: var(--text-soft); padding: 4px 0; list-style-position: outside; }
.done-earlier > summary .count { margin-left: 6px; font-weight: 400; color: var(--text-faint); }
@media (hover: hover) and (pointer: fine) { .done-earlier > summary:hover { color: var(--text); } }
.row-when.done { color: var(--text-faint); }
.row.handed .row-title { text-decoration: none; }
.q-head .q-save[aria-pressed="true"] { color: var(--accent); }

/* Motion (app.js play() and flipRows()). Short and quiet: things you do
   many times a day should feel quick, never slow you down. */
#view.page-in > .page > * { animation: page-in 240ms var(--ease-out) both; }
#view.page-in > .page > :nth-child(2) { animation-delay: 30ms; }
#view.page-in > .page > :nth-child(3) { animation-delay: 60ms; }
#view.page-in > .page > :nth-child(4) { animation-delay: 90ms; }
#view.page-in > .page > :nth-child(5) { animation-delay: 120ms; }
#view.page-in > .page > :nth-child(n+6) { animation-delay: 150ms; }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } }

.check.just-done { animation: tick-pop 280ms var(--ease-out); }
.check.just-done::after { animation: tick-draw 220ms 60ms var(--ease-out) both; }
@keyframes tick-pop { 0% { transform: scale(0.82); } 55% { transform: scale(1.14); } 100% { transform: none; } }
@keyframes tick-draw { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

.review-card.reveal .answer { animation: page-in 200ms var(--ease-out) both; }
.review-card.card-next { animation: card-next 220ms var(--ease-out); }
@keyframes card-next { from { opacity: 0; transform: translateX(14px); } }
.flashcard.flip-in { animation: flip-in 260ms var(--ease-out); }
@keyframes flip-in { from { opacity: 0.4; transform: perspective(900px) rotateY(-70deg); } }

/* Folding sections open and shut instead of snapping (where browsers can). */
:root { interpolate-size: allow-keywords; }
details::details-content {
  block-size: 0; overflow-y: clip;
  transition: block-size 220ms var(--ease-out), content-visibility 220ms allow-discrete;
}
details[open]::details-content { block-size: auto; }

@media (prefers-reduced-motion: reduce) {
  #view.page-in > .page > *, .check.just-done, .check.just-done::after,
  .review-card.reveal .answer, .review-card.card-next, .flashcard.flip-in { animation: none; }
  details::details-content { transition: none; }
}

/* People: message a teacher or classmate by name */
.people-find { margin-bottom: 8px; }
.people-input { position: relative; display: block; }
.people-input > .icon { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--text-faint); pointer-events: none; }
.people-input .input { width: 100%; height: 42px; padding-left: 38px; font-size: 14px; }
.people-input .input::-webkit-search-cancel-button { cursor: pointer; }
.people-results, .people-list { list-style: none; margin: 6px 0 0; padding: 0; }
.people-results:empty { display: none; }
.people-note { padding: 10px 2px 4px; font-size: 12px; color: var(--text-faint); }
.person-row {
  display: flex; align-items: center; gap: 12px; width: calc(100% + 16px); padding: 8px; margin: 0 -8px;
  border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer;
  transition: background-color 120ms ease;
}
.person-row:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.person-row:active { background: var(--bg-active); }
@media (hover: hover) and (pointer: fine) { .person-row:hover { background: var(--bg-hover); } }
.avatar {
  flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg-side); border: 1px solid var(--line); color: var(--text-soft); font: 600 12px var(--font); letter-spacing: 0.02em;
}
.avatar.teacher { background: var(--accent-wash); border-color: transparent; color: var(--accent); }
.person-text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.person-name { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-meta { font-size: 12px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-go { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-faint); }
.person-go .icon { width: 14px; height: 14px; }
@media (hover: hover) and (pointer: fine) {
  .person-go span { opacity: 0; transition: opacity 120ms ease; }
  .person-row:hover .person-go, .person-row:focus-visible .person-go { color: var(--text); }
  .person-row:hover .person-go span, .person-row:focus-visible .person-go span { opacity: 1; }
}
@media (pointer: coarse) { .person-go span { display: none; } }
.classmates { margin-top: 6px; }
.classmates summary { display: inline-flex; align-items: center; gap: 6px; padding: 6px 0; cursor: pointer; list-style: none; font-size: 13px; font-weight: 500; color: var(--text-soft); }
.classmates summary::-webkit-details-marker { display: none; }
.classmates summary .icon { width: 14px; height: 14px; transition: transform 160ms var(--ease-out); }
.classmates[open] summary .icon { transform: rotate(90deg); }
.classmates summary .count { margin-left: 2px; }
@media (prefers-reduced-motion: reduce) { .classmates summary .icon { transition: none; } }
.people-strip { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 4px; }
.person-chip {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 3px 12px 3px 3px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--bg-raised); color: var(--text); font: inherit; font-size: 13px; cursor: pointer;
  transition: border-color 120ms ease, transform 120ms var(--ease-out);
}
.person-chip .avatar { width: 26px; height: 26px; font-size: 11px; }
.person-chip > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-chip:active { transform: scale(0.97); }
.person-chip:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .person-chip:hover { border-color: var(--line-strong); } }
@media (max-width: 640px) {
  .people-strip { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 4px 16px 2px; scrollbar-width: none; }
  .people-strip::-webkit-scrollbar { display: none; }
  .person-chip { flex: none; }
}
@media (prefers-reduced-motion: reduce) { .person-chip:active { transform: none; } }

/* Ask */
.page-ask .page-head .btn { flex: none; }
.ask-sees { margin-top: 18px; }
.ask-sees .data-note { margin: 4px 0 8px; }
.ask-context {
  max-height: 320px; overflow: auto; margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg-raised); font: 12px/1.6 var(--mono); color: var(--text-soft); white-space: pre-wrap; overflow-wrap: anywhere;
}
.page-ask .starters { flex-wrap: wrap; overflow: visible; }
.page-ask .msg-block.me { justify-items: end; gap: 6px; }
.ask-photo { display: block; max-width: min(240px, 70%); border-radius: 12px; border: 1px solid var(--line); }
.msg.thinking em { font-style: normal; font-size: 13px; color: var(--text-soft); padding: 0 2px; }
.ask-used { color: var(--text-faint); }
.ask-attach { flex: none; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.ask-attach:has(input:disabled) { opacity: 0.5; cursor: default; }
.ask-attach:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.ask-pending { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--text-soft); }
.ask-pending-one { position: relative; display: block; }
.ask-pending-one img { display: block; width: 52px; height: 52px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.ask-pending-one .icon-btn {
  position: absolute; top: -7px; right: -7px; width: 22px; height: 22px; padding: 0; border-radius: 999px;
  background: var(--bg-raised); border: 1px solid var(--line); box-shadow: 0 1px 2px rgb(0 0 0 / 0.12);
}
.ask-pending-one .icon-btn .icon { width: 12px; height: 12px; }
/* A bigger target than it looks, for fingers. */
.ask-pending-one .icon-btn::after { content: ''; position: absolute; inset: -8px; }
.ask-pending-text { flex: 1; margin-left: 4px; }
.msg-block.me { display: grid; justify-items: end; gap: 6px; }
.msg-block.me .ask-photo + .ask-photo { margin-top: 0; }
.chat-after { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.study-recent { margin-bottom: 22px; }
.study-recent .file-row { text-decoration: none; color: inherit; }
.study-recent-q { color: var(--text-soft); font-weight: 400; }
.ask-files { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-faint); }
.ask-files .icon { width: 14px; height: 14px; }
.ask-files select {
  min-width: 0; max-width: 100%; border: 0; background: transparent; color: var(--text-soft);
  font: inherit; font-size: 12px; font-weight: 500; padding: 2px 0; cursor: pointer; text-overflow: ellipsis;
}
.ask-files select:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.ask-todos { width: min(100%, 560px); margin-top: 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-raised); display: grid; gap: 10px; }
.ask-todos-head { margin: 0; font-size: 13px; font-weight: 600; }
.ask-todos ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.ask-todos label { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; cursor: pointer; }
.ask-todos input { margin-top: 3px; accent-color: var(--accent); }
.ask-todos label > span { display: grid; gap: 1px; min-width: 0; }
.ask-todos .t { font-size: 14px; }
.ask-todos small { font-size: 12px; color: var(--text-faint); }
.ask-todos .btn { justify-self: start; }
.ask-todos.done { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ask-todos.done p { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; color: var(--text-soft); }
.ask-todos.done .icon { width: 16px; height: 16px; color: var(--accent); }
.ask-files select { field-sizing: content; }

/* GJU academic calendar */
.cal-gju {
  position: relative; z-index: 1; display: block; flex: none; height: 18px;
  width: calc(var(--span, 1) * (100% + 13px) - 13px);
  font-size: 11px; line-height: 18px; padding: 0 6px; border-radius: 5px;
  background: color-mix(in oklab, var(--text-faint) 12%, transparent); color: var(--text-soft);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cal-gju.exam { background: color-mix(in oklab, var(--exam) 12%, transparent); color: var(--exam); }
.cal-gju.off { background: color-mix(in oklab, var(--ok) 14%, transparent); color: var(--ok); }
.cal-gju.deadline { background: color-mix(in oklab, var(--accent) 12%, transparent); color: var(--text); }
.cal-gju.cont { visibility: hidden; }
.cal-day.gju-off { background: color-mix(in oklab, var(--ok) 7%, transparent); }
.cal-legend .l-gju::before { background: color-mix(in oklab, var(--ok) 30%, transparent); }
.gju-dates { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 2px; }
.gju-dates li { display: flex; align-items: baseline; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.gju-dates li:last-child { border-bottom: 0; }
.gju-dates li::before { content: ''; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--text-faint); transform: translateY(-1px); }
.gju-dates li.exam::before { background: var(--exam); }
.gju-dates li.off::before { background: var(--ok); }
.gju-dates li.deadline::before { background: var(--accent); }
.gju-what { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 10px; font-size: 14px; }
.gju-what small { font-size: 12px; color: var(--text-faint); }
.gju-in { flex: none; font: 500 12px/1 var(--mono); color: var(--text-soft); }
.gju-off-note .icon { color: var(--ok); }
@media (max-width: 820px) {
  .cal-gju, .cal-gju.cont { visibility: visible; width: 100%; font-size: 0; height: 3px; padding: 0; border-radius: 2px; background: var(--text-faint); opacity: 0.5; }
  .cal-gju.exam { background: var(--exam); } .cal-gju.off { background: var(--ok); } .cal-gju.deadline { background: var(--accent); }
}
.notice.gju-off-note { display: flex; align-items: center; gap: 10px; background: color-mix(in oklab, var(--ok) 10%, var(--bg-raised)); color: var(--text-soft); }

/* Maths in answers and notes */
.math { font-family: "Cambria Math", "STIX Two Math", "Latin Modern Math", Georgia, serif; font-size: 1.05em; }
.math i { font-style: italic; }
.math .m-up { font-style: normal; }
.math sub, .math sup { font-size: 0.72em; line-height: 0; }
.math-block { display: block; margin: 0.6em 0 1em; text-align: center; font-size: 1.15em; white-space: normal; overflow-x: auto; }
.m-frac { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; margin: 0 0.15em; font-size: 0.9em; line-height: 1.2; }
.m-frac > span:first-child { border-bottom: 1px solid currentColor; padding: 0 0.15em; }
.m-frac > span:last-child { padding: 0 0.15em; }
.m-root { border-top: 1px solid currentColor; padding: 0 0.1em; }
