/* Notice Decoder. A campus notice board at dusk: the notice is pinned on the left, its timetable answer on the right.
   Teal is the interactive colour (links, focus, the current choice); orange is kept for the one primary action;
   coral means a clash. Mobile first; both themes are designed, the system setting picks one. */

:root {
  color-scheme: light;
  --page: #f3f6f5;
  --card: #ffffff;
  --paper: #fffdf8;
  --line: rgba(0, 0, 0, .08);
  --edge: #8a9d99;          /* control borders: 3:1 on the card, teal-tinted */
  --text: #1a2e2c;
  --muted: #5e7975;
  --accent: #0b7a71;        /* teal: links, focus ring, the current choice */
  --accent-hover: #115e59;
  --accent-soft: #e6f4f2;
  --on-accent: #ffffff;
  --cta: #0b7a71;           /* the primary action: the same teal, solid */
  --on-cta: #ffffff;
  --coral: #c2410c;         /* clash, errors */
  --coral-soft: #fdece4;
  --amber: #9a5800;
  --ink-warn: #7a4300;
  --warn-bg: #fff6e5;
  --err-bg: var(--coral-soft);
  --green: #15803d;
  --mark-yellow: #c9ece6;   /* the one highlighter stroke, under "clear calendar" */
  --sky-top: #ffffff;
  --sky-bottom: #f3f6f5;
  --hill: #e8eeec;
  --campus: #dce4e1;
  --window: #d9cfbf;
  --sans-display: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --serif: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --glow: #fcd34d;
  --sel: #c9ece6;
  --qr-bg: #ffffff;
  --r-s: 8px;
  --r-m: 12px;
  --r-l: 18px;
  --r-chip: 20px;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, .04), 0 12px 32px -16px rgba(0, 0, 0, .14);
  --stack: 24px;            /* between blocks inside one section */
  --section: 40px;          /* between sections */
  --pad: 20px;
  --gutter: 16px;
  --c0-bg: #fef3c7; --c0-ink: #92400e;
  --c1-bg: #dcfce7; --c1-ink: #166534;
  --c2-bg: #fce7f3; --c2-ink: #9d174d;
  --c3-bg: #dbeafe; --c3-ink: #1e40af;
  --c4-bg: #ffedd5; --c4-ink: #9a3412;
  --c5-bg: #ede9fe; --c5-ink: #5b21b6;
  --csaved-bg: #e5e7eb; --csaved-ink: #4b5563;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0a1a1e; --card: #102a30; --paper: #143239; --line: rgba(170, 225, 215, .13); --edge: #5f8580;
  --text: #e9f4f1; --muted: #9ab9b3;
  --accent: #2dd4bf; --accent-hover: #5eead4; --accent-soft: #0f3a3a; --on-accent: #04201d;
  --cta: #2dd4bf; --on-cta: #04201d;
  --coral: #ff8a65; --coral-soft: #3a1f17;
  --amber: #f5c06b; --ink-warn: #f5c06b; --warn-bg: rgba(245, 192, 107, .12); --green: #4ade80;
  --mark-yellow: #7a3d12;
  --sky-top: #0a1a1e; --sky-bottom: #113a40; --hill: #0e2d33; --campus: #061316; --window: #f5b04f;
  --glow: rgba(252, 211, 77, .45); --sel: #7a3d12; --qr-bg: #ffffff;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, .35), 0 22px 44px -30px rgba(0, 0, 0, .9);
  --c0-bg: rgba(252, 211, 77, .22); --c0-ink: #fcd34d;
  --c1-bg: rgba(134, 239, 172, .22); --c1-ink: #86efac;
  --c2-bg: rgba(249, 168, 212, .22); --c2-ink: #f9a8d4;
  --c3-bg: rgba(147, 197, 253, .22); --c3-ink: #93c5fd;
  --c4-bg: rgba(253, 186, 116, .22); --c4-ink: #fdba74;
  --c5-bg: rgba(196, 181, 253, .22); --c5-ink: #c4b5fd;
  --csaved-bg: rgba(230, 232, 235, .28); --csaved-ink: #e6e8eb;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; }
body {
  background: var(--page);
  color: var(--text);
  font: 16px/1.55 "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
}
/* Entrance motion: the header rises in child by child; the results rise when they open. Reduced motion gets a plain fade. */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes settle { from { opacity: 0; } }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--sel); color: var(--text); }
input, textarea, select { accent-color: var(--accent); caret-color: var(--accent); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--accent) 30%, transparent); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--accent) 55%, transparent); }
html { scrollbar-color: color-mix(in srgb, var(--accent) 30%, transparent) transparent; scrollbar-width: thin; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 640px) { :root { --gutter: 24px; --pad: 28px; --stack: 32px; --section: 48px; } }
@media (min-width: 1080px) { :root { --pad: 32px; --section: 56px; } }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link {
  position: absolute; left: 8px; top: -48px; background: var(--card); padding: 8px 12px; z-index: 10;
}
.skip-link:focus { top: 8px; }

/* Navigation rail: wide screens only, in the left margin beside the 1100 px column */
.rail { display: none; }
@media (min-width: 1100px) {
  .rail {
    position: fixed; top: 50%; transform: translateY(-50%); z-index: 100;
    left: max(12px, calc((100vw - 1100px) / 2 - 72px));
    display: flex; flex-direction: column; gap: 4px; padding: 8px;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--r-l);
  }
}
.rail a {
  display: flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  border-radius: var(--r-m); color: var(--muted); text-decoration: none;
  transition: background-color .15s var(--ease-out), color .15s var(--ease-out);
}
.rail a:hover, .rail a:focus-visible { background: var(--accent-soft); color: var(--accent); }
.rail a:first-child { background: var(--accent-soft); color: var(--accent); }
.rail svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* Header: dusk sky, the campus drawn once along its bottom edge, the input card overlapping that edge */
.site-head { position: relative; padding: 20px 0 0; overflow: hidden; isolation: isolate; }
.site-head-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-top) 35%, var(--sky-bottom) 100%); }
.campus-skyline { position: absolute; left: 0; bottom: 0; width: 100%; height: 64px; display: block; }
.campus-skyline .hill { fill: var(--hill); }
.campus-skyline .campus { fill: var(--campus); }
.campus-skyline .win { fill: var(--window); opacity: .8; }
.campus-skyline .win-off { fill: var(--window); opacity: .18; }
@media (min-width: 820px) { .campus-skyline { height: 190px; } }
.site-head .wrap { position: relative; padding-bottom: 72px; }
@media (min-width: 820px) { .site-head .wrap { padding-bottom: 124px; } }
.site-head .wrap > *, .hero-copy > * { animation: rise .4s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 60ms); }
.site-head .wrap > .trust { animation: none; }

h1, h2, h3 { font-family: var(--sans-display); font-weight: 600; letter-spacing: -0.015em; text-wrap: balance; }
h1 { font-size: 1.45rem; letter-spacing: -0.015em; line-height: 1.1; margin: 0; }
h2 { font-size: 1.3rem; margin: 0 0 12px; }
h3 { font-size: 1.05rem; margin: 0 0 8px; }
.lede { margin: 0; font-size: 1.125rem; line-height: 1.55; max-width: 46ch; color: var(--muted); }
.small { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

/* Top bar */
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.wordmark { position: relative; display: inline-block; }
.brand-mark { flex: none; width: 30px; height: 30px; }
.head-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 10px; margin-left: auto; }
.top-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 14px; }
.top-nav a {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: var(--r-s);
  color: var(--text); font-weight: 600; text-decoration: none; white-space: nowrap;
  transition: background-color .15s var(--ease-out), color .15s var(--ease-out);
}
.top-nav a:hover, .top-nav a:focus-visible { background: var(--accent-soft); color: var(--accent); }
.top-nav a[href="#input-card"] { background: var(--accent-soft); color: var(--accent); }
@media (pointer: coarse) { .top-nav a { min-height: 44px; } }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; padding: 0; }
.icon-btn svg { width: 20px; height: 20px; }
#install-btn { border-color: var(--cta); color: var(--text); }
#install-btn:hover:not(:disabled) { background: color-mix(in srgb, var(--cta) 14%, transparent); }
#theme-btn .i-sun { display: none; }
:root[data-theme="dark"] #theme-btn .i-sun { display: block; }
:root[data-theme="dark"] #theme-btn .i-moon { display: none; }
/* Hero copy */
.hero-title { font-family: var(--sans-display); font-weight: 600; font-size: clamp(32px, 4.3vw, 56px); line-height: 1.05; letter-spacing: -0.03em; margin: 10px 0 16px; max-width: 12.5em; }
.hero-hl { position: relative; display: inline-block; isolation: isolate; white-space: nowrap; }
.hero-stroke { position: absolute; left: -2%; bottom: -.08em; width: 104%; height: auto; z-index: -1; pointer-events: none; }
.hero-stroke path { stroke: var(--mark-yellow); }
/* What you get: a plain ticked line, not buttons */
.promise { list-style: none; margin: 24px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.promise li { display: inline-flex; align-items: center; gap: 8px; min-height: 28px; color: var(--muted); font-size: 14px; font-weight: 500; }
.promise svg { flex: none; width: 16px; height: 16px; color: var(--muted); }
.trust { display: flex; align-items: flex-start; gap: 8px; margin: 16px 0 0; font-size: 14px; color: var(--muted); max-width: 62ch; }
.trust svg { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--muted); }
.trust a { color: var(--accent); }
.desk-only { display: inline; }
@media (max-width: 519px) { .desk-only { display: none; } }

/* The hero object, from 820 px: the pinned notice and the timetable it turns into, with the clash marked */
.hero-object { display: none; }
.hero-paper {
  position: relative; width: 86%; padding: 30px 22px 22px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-m);
  font-family: var(--serif); font-size: 15px; line-height: 1.6; color: var(--text);
}
.hero-paper p { margin: 0; }
.hero-paper p + p { margin-top: 6px; }
.hero-paper mark { white-space: nowrap; padding: 0 3px; border-radius: 3px; }
.hero-notice { font-weight: 600; letter-spacing: .04em; text-align: center; text-decoration: underline; text-underline-offset: 5px; margin-bottom: 12px !important; }
.hero-pin { position: absolute; top: -7px; left: 50%; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--coral); border: 3px solid var(--paper); }
.hero-label { position: absolute; top: 12px; left: 14px; font-family: system-ui, sans-serif; font-size: 12px; font-weight: 600; color: var(--muted); }
.hero-tt {
  position: relative; align-self: flex-end; width: 88%; margin-top: -24px; padding: 14px 16px 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow-card);
}
.tt-head { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 10px; font-size: 14px; font-weight: 600; }
.tt-count { font-size: 13px; font-weight: 500; color: var(--muted); }
.tt-grid { position: relative; padding: 0 0 4px 104px; }
.tt-axis { position: relative; height: 18px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tt-axis span { white-space: nowrap; position: absolute; left: calc(var(--t) / 3 * 100%); transform: translateX(-50%); }
.tt-axis span:first-child { transform: none; }
.tt-axis span:last-child { transform: translateX(-100%); }
.tt-row { position: relative; height: 30px; }
.tt-row + .tt-row { margin-top: 6px; }
.tt-name { position: absolute; right: 100%; top: 50%; transform: translateY(-50%); width: 98px; padding-right: 8px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-track { position: absolute; inset: 0; border-radius: 6px; background: color-mix(in srgb, var(--line) 60%, transparent); }
.tt-bar { position: absolute; top: 4px; bottom: 4px; left: calc(var(--s) / 3 * 100%); width: calc((var(--e) - var(--s)) / 3 * 100%); border-radius: 5px; background: var(--bg-c); box-shadow: inset 0 0 0 1.5px var(--strong); }
.tt-dot { position: absolute; top: 50%; left: calc(var(--s) / 3 * 100%); width: 12px; height: 12px; margin: -6px 0 0 -6px; background: var(--strong); transform: rotate(45deg); border-radius: 2px; }
.tt-clash {
  position: absolute; top: 18px; height: 66px; left: calc(104px + (100% - 104px) * var(--s) / 3); width: calc((100% - 104px) * (var(--e) - var(--s)) / 3);
  border: 1.5px dashed var(--coral); border-radius: 6px; background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--coral) 22%, transparent) 0 4px, transparent 4px 8px);
}
.tt-note { display: flex; gap: 8px; align-items: flex-start; margin: 14px 0 0; padding: 10px 12px; border-radius: var(--r-m); background: var(--coral-soft); color: var(--text); font-size: 13.5px; line-height: 1.45; }
.tt-note svg { flex: none; width: 18px; height: 18px; margin-top: 1px; color: var(--coral); fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.tt-note b { color: var(--coral); }

main.wrap { padding-top: 8px; padding-bottom: 24px; }
/* One vertical rhythm: every block in the page and in the results is one stack step below the last. */
main > *, #results > * { margin-top: var(--stack); }

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  box-shadow: var(--shadow-card);
  padding: var(--pad);
}
.hint { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 8px 0 16px; max-width: 72ch; }
.lbl { display: block; font-weight: 600; font-size: 14px; margin: 0 0 8px; }
.error { color: var(--coral); font-weight: 600; font-size: 15px; margin: 8px 0 0; }

/* Buttons and inputs */
.btn {
  min-height: 44px; padding: 12px 16px; border-radius: var(--r-s);
  border: 1px solid var(--edge); background: var(--card); color: var(--text);
  font: inherit; font-weight: 600; cursor: pointer;
  transition-property: background-color, border-color, transform, filter; transition-duration: .15s; transition-timing-function: var(--ease-out);
}
.btn:hover:not(:disabled) { background: var(--accent-soft); }
.btn.primary { background: var(--cta); border-color: transparent; color: var(--on-cta); font-weight: 600; border-radius: 980px; padding-inline: 24px; }
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn:active:not(:disabled), .mode:active { transform: scale(.97); transition-duration: .1s; }
/* Clear and other secondary clean-ups: a text link, not a box */
.btn.btn-quiet { background: none; border-color: transparent; box-shadow: none; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; padding-inline: 12px; }
.btn.btn-quiet:hover:not(:disabled) { background: none; transform: none; text-decoration-thickness: 2px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.small { min-height: 44px; padding: 8px 12px; font-size: 14px; }
.btn-out.accent { border-color: var(--accent); color: var(--accent); }
.btn-out.accent:hover:not(:disabled) { background: var(--accent-soft); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
/* Groups inside a card: a hint under a button row stays close, the next control group starts clearly lower */
.actions + .hint { margin-top: 12px; }
.hint + .check, .actions + .check { margin-top: 24px; }

/* Recent notices history chips */
.history-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.history-row .history-label { font-size: 13px; color: var(--muted); flex: none; }
#history-chips { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.history-chip { font-size: 13px; padding: 4px 10px; border-radius: var(--r-s); border: 1px solid var(--line); background: transparent; cursor: pointer; color: var(--text); white-space: nowrap; max-width: 200px; overflow: hidden; text-overflow: ellipsis; transition: background .15s var(--ease-out), border-color .15s var(--ease-out); font: inherit; }
.history-chip:hover { background: var(--accent-soft); border-color: var(--accent); }
#history-clear { font-size: 16px; padding: 2px 6px; color: var(--muted); flex: none; line-height: 1; }

/* How the notice comes in. Primary (label = paste) is wider; secondary buttons are compact. */
.modes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.mode {
  display: inline-flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 16px 10px 10px;
  border: 1px solid var(--line); border-radius: var(--r-m); background: transparent; color: var(--text);
  cursor: pointer; text-align: left; font: inherit; text-decoration: none; box-shadow: none;
  transition: background-color .15s var(--ease-out), border-color .15s var(--ease-out);
}
/* Primary paste tile: takes 2× the flex share */
label.mode { flex: 2 1 180px; }
/* Secondary tiles: compact, sublabel hidden on small screens */
button.mode { flex: 1 1 110px; }
@media (max-width: 480px) { button.mode small { display: none; } button.mode { min-height: 52px; } }
.mode:hover:not(:disabled) { background: var(--accent-soft); border-color: var(--edge); }
.mode.is-on { background: var(--accent-soft); border-color: var(--accent); }
.mode span { display: flex; flex-direction: column; }
.mode b { font-size: 15px; font-weight: 600; line-height: 1.25; }
.mode small { font-size: 13px; color: var(--muted); display: block; margin-top: 2px; font-weight: 400; }
.mode .ic { box-sizing: content-box; width: 20px; height: 20px; padding: 9px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.mode.is-on .ic { background: var(--accent); color: var(--on-accent); }

/* The paste card sits over the bottom edge of the header, on the campus */
#input-card { position: relative; z-index: 2; margin-top: -56px; border-radius: 22px; }
@media (min-width: 820px) { #input-card { margin-top: -72px; padding: 36px 40px 32px; } }
/* The paste box: a dashed frame, so it reads as a drop zone as well as a field */
#notice-input { border: 1.5px dashed var(--edge); border-radius: var(--r-l); background: color-mix(in srgb, var(--page) 55%, var(--card)); padding: 16px 18px; margin-top: 12px; }
#notice-input:focus { border-style: solid; border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
@media (min-width: 820px) { #notice-input { min-height: 168px; font-size: 17px; } }

textarea, input, select {
  width: 100%; font: inherit; font-size: 16px; color: var(--text); background: var(--card);
  border: 1px solid var(--edge); border-radius: var(--r-s); padding: 12px 12px;
}
textarea { min-height: 10rem; resize: vertical; }
input, select { min-height: 44px; }
[aria-invalid="true"] { border-color: var(--coral); box-shadow: 0 0 0 1px var(--coral); }

/* The samples are their own group under the paste card's notes */
.samples { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.samples > span { font-weight: 600; font-size: 15px; }
.sample-list { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 16px; border-radius: var(--r-chip);
  border: 1px solid var(--edge); background: var(--card); color: var(--text);
  font: inherit; font-size: 15px; cursor: pointer;
  transition-property: background-color, border-color; transition-duration: .15s; transition-timing-function: var(--ease-out);
}
.chip-btn:hover { background: var(--accent-soft); border-color: var(--accent); }

/* Event colours: one per event, shared by its notice highlight, card and timeline bar */
.c0 { --bg-c: var(--c0-bg); --strong: var(--c0-ink); }
.c1 { --bg-c: var(--c1-bg); --strong: var(--c1-ink); }
.c2 { --bg-c: var(--c2-bg); --strong: var(--c2-ink); }
.c3 { --bg-c: var(--c3-bg); --strong: var(--c3-ink); }
.c4 { --bg-c: var(--c4-bg); --strong: var(--c4-ink); }
.c5 { --bg-c: var(--c5-bg); --strong: var(--c5-ink); }
.csaved { --bg-c: var(--csaved-bg); --strong: var(--csaved-ink); }

/* Warnings */
.warnings { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
.warnings li { padding: 12px 12px; background: var(--card); border: 1px solid; border-radius: var(--r-s); }
.warnings .warn-error { border-color: var(--coral); background: var(--err-bg); }
.warnings .warn-warn { border-color: var(--amber); background: var(--warn-bg); }
.warnings .warn-info { border-color: var(--accent); background: var(--accent-soft); }

/* Notice panel with highlighted sources */
.notice-text {
  font-family: var(--serif);
  white-space: pre-wrap; overflow-wrap: anywhere; font-size: 17px; line-height: 1.75;
  max-height: 28rem; overflow: auto; padding: 16px clamp(12px, 4vw, 18px) 24px; border-radius: 2px; background: var(--paper);
  box-shadow: 0 1px 1px rgba(0, 0, 0, .05), 0 10px 24px -14px rgba(0, 0, 0, .25);
  scrollbar-color: #c3c7ce transparent;
}
/* Real circulars open with NOTICE, centred and underlined. */
.notice-text::before {
  content: "NOTICE"; display: block; text-align: center; font-weight: 600; letter-spacing: 0;
  text-decoration: underline; text-underline-offset: 4px; margin-bottom: 16px; white-space: normal;
}
@media (min-width: 640px) { .notice-text { padding: 28px 40px 32px; } }
/* The signature: a highlighter stroke with soft, slanted ends, like a marker on a printout. */
mark {
  color: var(--text); padding: 0.05em 0.25em; margin: 0 -0.1em; cursor: default;
  background: linear-gradient(100deg, transparent 0.15em, var(--bg-c) 0.3em, var(--bg-c) calc(100% - 0.3em), transparent calc(100% - 0.12em));
  border-radius: 0.3em 0.15em; -webkit-box-decoration-break: clone; box-decoration-break: clone;
  background-repeat: no-repeat; background-size: 100% 100%;
}
@media (prefers-reduced-motion: no-preference) {
  .notice-text.draw mark { animation: stroke .5s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 45ms + 120ms); }
}
@media (prefers-reduced-motion: reduce) {
  .notice-text.draw mark { animation: fade .4s var(--ease-out) both; }
}
@keyframes stroke { from { background-size: 0% 100%; } }
@keyframes fade { from { opacity: .4; } }
mark:focus-visible { outline: 3px solid var(--strong); outline-offset: 1px; }
mark.pulse { outline: 3px solid var(--strong); outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) {
  mark.pulse { animation: pulse 0.9s var(--ease-out) 2; }
}
@keyframes pulse { 50% { outline-color: transparent; } }

/* Event cards */
.section-title { margin-top: 0; }
.events { display: grid; gap: 16px; grid-template-columns: 1fr; }
/* Event cards: the hairline only, no shadow at rest; hover changes the border colour, nothing moves */
.ev { border-radius: var(--r-m); box-shadow: none; transition-property: border-color, background-color; transition-duration: .15s; transition-timing-function: var(--ease-out); }
@media (hover: hover) { .ev:hover:not(.hot) { border-color: var(--edge); } }
.ev.hot { box-shadow: 0 0 0 3px var(--bg-c), 0 0 0 5px var(--strong); }
.card-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 12px;
}
/* The type word wears its event's highlighter, so card and notice read as one. */
.badge {
  display: inline-block; padding: 0.1em 0.4em; font-size: 15px; font-weight: 600; color: var(--text);
  background: linear-gradient(100deg, transparent 0.1em, var(--bg-c) 0.25em, var(--bg-c) calc(100% - 0.25em), transparent calc(100% - 0.1em));
}
.head-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.gcal { display: inline-flex; align-items: center; text-decoration: none; }
.check-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 14px; color: var(--ink-warn); font-weight: 600; }
.check-line.ok { color: var(--green); }
.needs-check input, .needs-check select { border-color: var(--amber); box-shadow: 0 0 0 2px var(--glow); }
/* Fields follow the card's own width, not the screen's: one column on a narrow phone, two once a date fits. */
.card.ev { container-type: inline-size; }
.fields { display: grid; gap: 12px 12px; grid-template-columns: 1fr; }
@container (min-width: 340px) { .fields { grid-template-columns: 1fr 1fr; } }
.field { min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.why { font-size: 13px; color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }
.link {
  background: none; border: 0; padding: 4px 0 4px 8px; min-height: 28px;
  color: var(--accent); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer;
}
.flags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.flags:empty { display: none; }
.chip {
  margin: 0; font-size: 13px; padding: 4px 12px; border-radius: var(--r-s); border: 1px solid;
}
.chip-info { border-color: #bfdbfe; background: var(--accent-soft); color: var(--accent-hover); }
.add-btn { width: 100%; margin-top: 12px; }
.empty { color: var(--muted); }

/* Clash timelines */
.tl-day { margin-top: 24px; }
.tl-day-title { font-size: 1rem; margin: 0 0 12px; }
.tl-scroll {
  overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-s);
  padding: 12px 12px 0; background: var(--paper); scrollbar-color: #c3c7ce transparent;
}
.tl-body { position: relative; min-width: calc(var(--ticks, 6) * 50px); padding-bottom: 28px; }
.tl-axis { position: relative; height: 24px; z-index: 1; }
.tl-tick {
  position: absolute; top: 0; transform: translateX(-50%);
  font-size: 12px; color: var(--muted); white-space: nowrap; background: var(--paper); padding: 0 4px;
}
.tl-grid { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); z-index: 0; }
.tl-dash { position: absolute; top: 0; bottom: 0; border-left: 2px dashed var(--muted); z-index: 0; }
.tl-band { position: absolute; top: 0; bottom: 0; z-index: 0; border-inline: 1.5px dashed var(--coral); background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--coral) 20%, transparent) 0 4px, transparent 4px 8px); }  /* the signature: a clash is a hatched coral band, as in the hero */
.tl-band-label {
  position: absolute; left: 50%; bottom: 4px; transform: translateX(-50%);
  white-space: nowrap; font-size: 12px; font-weight: 600; color: var(--coral);
  background: var(--card); padding: 0 8px; border-radius: 4px;
}
.tl-row { position: relative; z-index: 1; margin-bottom: 8px; }
.tl-label { position: relative; z-index: 2; width: max-content; max-width: 100%; background: var(--paper); padding: 0 4px; font-size: 14px; margin-bottom: 2px; overflow-wrap: anywhere; }
.tl-track { position: relative; height: 28px; }
.tl-bar {
  position: absolute; top: 4px; height: 20px; min-width: 8px; border-radius: 4px; background: var(--bg-c); box-shadow: inset 0 0 0 1px var(--strong);
}
.tl-diamond {
  position: absolute; top: 4px; width: 16px; height: 16px; border-radius: 2px;
  background: var(--strong); transform: translateX(-50%) rotate(45deg);
}
.dot {
  display: inline-block; width: 12px; height: 12px; margin-right: 8px;
  border-radius: 50%; background: var(--strong); vertical-align: middle;
}

/* Clash table */
.table-wrap { overflow-x: auto; margin-top: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; vertical-align: top; padding: 16px 12px; border-bottom: 1px solid var(--line); }
th { font-size: 14px; color: var(--muted); }
.verdict { margin: 0; }
#clash-rows tr:has(.verdict.bad) td, .verdict.bad { background: var(--coral-soft); }
.verdict.bad strong { color: var(--coral); }
.verdict.ok strong { color: var(--green); }
.verdict .ic { width: 16px; height: 16px; margin-right: 6px; vertical-align: -3px; }
.verdict.bad .ic { color: var(--coral); }
.verdict.ok .ic { color: var(--green); }
.action { margin: 8px 0 0; color: var(--muted); font-size: 14px; }

/* Lists */
.plain { margin: 0; padding-left: 20px; }
.plain li { margin-bottom: 8px; }

/* Export */
.check { display: flex; align-items: center; gap: 12px; min-height: 44px; font-size: 16px; }
.check input { flex: none; width: 24px; height: 24px; min-height: 24px; margin: 0; }
.status { min-height: 1.5em; margin: 12px 0 0; font-weight: 600; }
.status[data-kind="error"] { color: var(--coral); }
.status[data-kind="ok"] { color: var(--green); }

.foot { color: var(--muted); font-size: 14px; padding-top: 32px; padding-bottom: 48px; }
.foot p { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; margin: 0; padding-top: 24px; border-top: 1px solid var(--line); }
.foot-brand { font-family: var(--sans-display); font-weight: 600; color: var(--text); }
.foot a { display: inline-block; padding: 4px 0; color: var(--accent); }

/* Narrow phones: a row of buttons shares the width instead of leaving ragged gaps */
@media (max-width: 519px) {
  .actions > .btn { flex: 1 1 auto; }
  /* The paste card's main action fills the phone width; Clear drops to a quiet line under it */
  .paste-go { width: 100%; justify-content: flex-start; }
  /* Clear sits on its own line under Find the dates, at the right (in a flex row, margin-left auto does the alignment) */
  #clear-btn { margin-top: 4px; margin-left: auto; justify-self: end; }
  #decode-btn { order: -1; flex: 1 1 100%; }
  #notice-input { min-height: 110px; padding: 10px 12px; }
  .site-head { padding-top: 8px; }
  /* Header: brand and theme button on row 1, the nav on row 2, the install prompt below */
  .site-head .head-row { display: grid; grid-template-columns: 1fr auto; align-items: start; gap: 2px 12px; }
  .head-tools { display: contents; }
  .top-nav { grid-column: 1 / -1; grid-row: 2; flex-wrap: wrap; font-size: 12.5px; gap: 0 10px; }
  .lede { font-size: 14.5px; line-height: 1.25; margin: 4px 0 0; }
  /* Tighter phone rhythm so the paste box starts above the fold */
  .site-head .wrap { padding-bottom: 46px; }
  #input-card { margin-top: -30px; padding: 16px; border-radius: var(--r-l); }
  .top-nav a { min-height: 32px; }
  main.wrap { padding-top: 0; }
  main > * { margin-top: 8px; }
  .hero-title { font-size: clamp(22px, 6vw, 26px); line-height: 1.15; margin: 6px 0; }
  .paste-head { gap: 2px 12px; }
  .paste-head h2 { font-size: 1.15rem; margin: 0; }
  .modes {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 8px;
    margin: 6px -14px 0;
    padding: 0 14px;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 30px), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 30px), transparent);
  }
  .modes::-webkit-scrollbar { display: none; }
  .modes > .mode { flex: 0 0 auto; padding: 8px 12px; min-height: 50px; gap: 8px; }
  .mode b { font-size: 13.5px; white-space: nowrap; }
  .mode small { font-size: 11.5px; white-space: nowrap; }
  #theme-btn { grid-column: 2; grid-row: 1; }
  #install-btn { grid-column: 1 / -1; grid-row: 3; justify-self: start; }
  #ios-install { grid-column: 1 / -1; grid-row: 4; }
  /* The four promise chips are one swipeable row on a phone (all four stay in the page), so the paste box stays above the fold.
     The fade at the right edge is the scroll cue. */
  .promise { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 8px; margin: 6px -16px 0; padding: 0 16px; scroll-padding: 0 16px; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); }
  .promise::-webkit-scrollbar { display: none; }
  /* Recent notices: one swipeable line (label, chips, clear) instead of one chip per line */
  .history-row { flex-wrap: nowrap; margin-bottom: 4px; }
  #history-chips { flex: 1 1 auto; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent); }
  #history-chips::-webkit-scrollbar { display: none; }
  .history-chip { flex: none; max-width: 160px; }
  .promise li { flex: none; height: 36px; min-height: 0; padding: 0 12px; font-size: 14px; white-space: nowrap; }
}

/* Tablets and up */
@media (min-width: 820px) {
  .site-head { padding-top: 40px; }
  .hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: center; }
  .hero-object { display: flex; flex-direction: column; position: relative; width: 100%; max-width: 470px; justify-self: end; margin-top: 24px; }
}
#events-section { container-type: inline-size; }
@container (min-width: 720px) { .events { grid-template-columns: 1fr 1fr; } }

/* Desktop: the notice stays beside the results, so a highlight and its card are on screen together. */
@media (min-width: 1080px) {
  :root { --gutter: 32px; }
  #results:not([hidden]) {
    display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); column-gap: 40px; align-items: start;
  }
  #results > * { grid-column: 2; }
  /* Left column: the notice, its example note and how it works. It sticks while the results scroll. */
  #results > .results-side {
    grid-column: 1; grid-row: 1 / span 20; position: sticky; top: 16px; margin-top: 0;
    max-height: calc(100vh - 32px); overflow-y: auto; display: flex; flex-direction: column; gap: 24px;
  }
  #notice-card { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; margin: 0; }
  #notice-card { flex-shrink: 0; }
  #notice-card .notice-text { max-height: 26rem; flex: 1 1 auto; min-height: 14rem; }
  .summary-add { flex: none; width: auto; }
}

/* Line icons: one 16 px box, a 1.5 stroke, the colour of the text they sit in (sprite in index.html) */
.ic { flex: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* Paste card: the heading and the three tools share a row (they wrap on a phone); the options and the one primary action sit under the field */
.paste-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.paste-head h2 { margin: 0; line-height: 1.25; }
.btn-out { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 12px; font-size: 14px; }
.btn.accent { border-color: var(--accent); color: var(--accent); }
.paste-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; margin-top: 16px; }
#input-hint { margin-top: 20px; }
#input-card .trust { margin-top: 12px; }
.paste-opts { display: flex; flex-wrap: wrap; gap: 0 20px; }
.paste-opts .check { min-height: 40px; font-size: 14px; }
.paste-go { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 12px; margin-left: auto; }
.chip-btn .ic { width: 16px; height: 16px; }

/* How it works: a static card, beside the notice on desktop and last on phones */
.how h2 { margin: 0 0 12px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; }
.step-n {
  flex: none; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px;
  border: 1px solid var(--edge); border-radius: var(--r-s); font-size: 13px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums;
}
.step-t { margin: 0; font-weight: 600; }
.steps .hint { margin: 0; }
.how-note { margin: 16px 0 0; }

/* Windows high contrast: colours are replaced, so highlights and bars keep an outline */
@media (forced-colors: active) {
  mark, .badge, .tl-bar, .dot { outline: 1px solid CanvasText; }
  .ev.hot { outline: 2px solid CanvasText; }
  .tl-band { outline: 1px dashed CanvasText; }
}

a, .link { color: var(--accent); text-underline-offset: 3px; }

/* Summary row: the verdict line and its one button, one card (stacked on phones, side by side on desktop) */
.summary-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: var(--pad); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow-card); }
.summary-row:has(> #summary:empty):has(> #summary-add-btn[hidden]) { display: none; }
.summary { flex: 1 1 240px; min-width: 0; margin: 0; font-weight: 600; }
.summary a { color: var(--accent); }
.summary-add { flex: 1 1 100%; }

/* Keep the first and last hour labels inside the box */
.tl-axis .tl-tick:first-child { transform: none; }
.tl-axis .tl-tick:last-child { transform: translateX(-100%); }

#offline-note { color: var(--amber); font-weight: 600; }

/* Class link banner: the page opened from a shared link, there is no notice text to show */
.shared-banner { border-color: var(--line); background: var(--card); }
.shared-banner h2 { margin-bottom: 4px; }
.shared-banner .hint { margin: 0; color: var(--text); }

/* Clean events: one line each, the full card only when something needs eyes */
.row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  padding: 16px 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-m); font-size: 15px;
}
.row .dot { margin-right: 0; }
.row-when { font-weight: 600; white-space: nowrap; }
.row-title { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.row-venue { color: var(--muted); }
.row-actions { display: flex; gap: 8px; margin-left: auto; }
/* Edit and Delete are 36 px icon buttons. The words live in a visually-hidden span (screen readers) and in the tooltip. */
.row-icon {
  display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0;
  border: 1px solid transparent; border-radius: var(--r-s); background: none; color: var(--accent); cursor: pointer;
  transition-property: background-color, border-color; transition-duration: .15s; transition-timing-function: var(--ease-out);
}
.row-icon:hover { background: var(--accent-soft); border-color: var(--line); }
.row-icon.link-muted { color: var(--muted); }
.row-icon .ic { width: 16px; height: 16px; }
.row .badge { font-size: 13px; }
@container (min-width: 720px) { .events .row { grid-column: 1 / -1; } }

/* Files: drop target, read status, Hindi toggle */
#input-card.drop { outline: 3px dashed var(--accent); outline-offset: -6px; background: var(--accent-soft); }
#file-status { margin: 12px 0 0; }
#file-status[data-kind="busy"] { color: var(--accent); }

/* Export and share */
.share-hint { margin-top: 16px; }
#gcal-note { margin: 8px 0 4px; }
#class-console { margin-top: 12px; }
#class-console-list li { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.console-clash { color: var(--ink-warn); }
.console-cancelled { color: var(--muted); text-decoration: line-through; }
#class-open-row { margin-top: 16px; }
.cr-entry { margin: 16px 0 0; }
.cr-entry .link { padding: 4px 0; min-height: 32px; font-size: 15px; font-weight: 600; text-align: left; overflow-wrap: anywhere; }
#cr-entry-note { margin: 4px 0 0; }
.join-row { align-items: stretch; }
.join-row input { flex: 1 1 220px; }
#class-section .lbl { margin-top: 16px; }
.status .link { font-size: inherit; padding-left: 4px; }
.undo { color: var(--text); }
.undo .link { padding-left: 2px; font-size: 14px; }
.fallback-copy { margin-top: 12px; font-size: 14px; }
input[type="number"] { -moz-appearance: textfield; }

/* AI check: one quiet line under the events, never in the way */
.ai-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 0 0 12px; }
.ai-line .status { margin: 0; flex: 1 1 260px; font-weight: 500; font-size: 14px; }
#ai-status[data-kind="busy"] { color: var(--accent); }
#ai-row { font-size: 14px; }

/* Class calendar v2: preview before publish, console, what changed */
.follow-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 12px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--card); font-weight: 600; }
.preview { margin-top: 16px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--card); box-shadow: none; }
.preview h3 { margin: 0 0 4px; font-size: 1.05rem; }
.preview-list li { margin-bottom: 12px; }
.plan-tag { display: inline-block; min-width: 5.5em; font-size: 12px; font-weight: 600; text-transform: none; letter-spacing: 0; padding: 1px 8px; border-radius: 4px; border: 1px solid var(--line); text-align: center; }
.plan-add .plan-tag { border-color: var(--green); color: var(--green); }
.plan-move .plan-tag, .plan-update .plan-tag { border-color: var(--amber); color: var(--amber); }
.plan-restore .plan-tag { border-color: var(--accent); color: var(--accent); }
.plan-past { color: var(--muted); }
.plan-past .plan-tag { border-color: var(--muted); color: var(--muted); }
#push-row { align-items: center; }
#push-note { margin: 0; }
.plan-same { color: var(--muted); }
.changes li { margin-bottom: 8px; }
.muted { color: var(--muted); }
.console-past { color: var(--muted); }
.link-muted { color: var(--muted); }
.chev { display: inline-block; width: 1em; text-align: center; color: var(--accent); transition-property: transform; transition-duration: .15s; transition-timing-function: var(--ease-out); }
.class-block[open] .chev { transform: rotate(90deg); }
::placeholder { color: var(--muted); opacity: 1; }
#results:focus { outline: none; }
@media (min-width: 520px) { #notice-input { min-height: 150px; } }
.console-what { flex: 1 1 240px; min-width: 0; overflow-wrap: anywhere; }
.console-edit { flex: 1 1 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; padding: 12px; margin-top: 4px; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--paper); }
.console-edit .actions { grid-column: 1 / -1; margin-top: 4px; }
#class-section .console-edit .lbl { margin: 0 0 4px; }
#class-manage, #class-changes-wrap { margin-top: 12px; }
#class-manage summary, #class-changes-wrap summary { cursor: pointer; font-weight: 600; min-height: 32px; }
@media (pointer: coarse) { #class-manage summary, #class-changes-wrap summary { min-height: 44px; } }
.qr-box { margin-top: 12px; text-align: center; }
.qr-box svg { width: min(300px, 80vw); height: auto; background: var(--qr-bg); padding: 8px; border-radius: var(--r-s); border: 1px solid var(--line); }
input[type="url"] { overflow-wrap: anywhere; }
.open-link { display: inline-flex; align-items: center; text-decoration: none; }
.status[data-kind="warn"] { color: var(--amber); }
#class-console-list .link { font-size: 14px; padding: 8px 8px; min-height: 36px; }

/* Feature strip: three honest promises at the end of the page */
.feat-strip {
  list-style: none;
  margin: var(--section) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 640px) {
  .feat-strip {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
}
.feat-strip li { display: flex; align-items: center; gap: 14px; padding: 8px 0; font-size: 15px; font-weight: 600; color: var(--text); }
.feat-strip svg { flex: none; box-sizing: content-box; width: 22px; height: 22px; padding: 11px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; fill: none; }

/* Class block: one hint-style line folds the class tools away from the paste card */
.class-block { margin-top: 20px; }
.class-block > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; list-style: none; }
.class-block > summary::-webkit-details-marker { display: none; }
/* First visit: the example notice says so, above the results */
.example-banner { margin: 16px 0 0; padding: 16px 20px; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--card); font-size: 15px; }
.example-banner .link { font-size: 14px; }
/* Join with Google waits for the age box: the button is greyed and has no link until it is ticked */
#join-row > .check { flex: 1 1 100%; }
#join-btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }

/* Phones: the events come before the notice text (flex order only; desktop keeps the notice beside the results). */
@media (max-width: 1079px) {
  #results:not([hidden]) { display: flex; flex-direction: column; }
  #results > * { order: 3; }
  #results > .summary-row, #results > #warnings, #results > #shared-banner { order: 0; }
  /* Phones: the left column is flattened, so its parts sort on their own (the example note on top, how it works last) */
  .results-side { display: contents; }
  .results-side > * { order: 3; margin-top: var(--section); }
  .results-side > #example-banner { order: -1; margin-top: 16px; }
  .results-side > .how { order: 4; }
}
/* Touch targets: .link (Edit, Delete, Undo, Looks right helpers) to 44px on touch screens only. */
@media (pointer: coarse) { .link { min-height: 44px; } }

/* Rhythm: each result section starts one and a half stacks below the one before (components stay at one stack) */
#results > section, #results > .card { margin-top: var(--section); }
/* The results rise in when they open; reduced motion gets a plain 200 ms fade (never no motion at all) */
#results:not([hidden]) { animation: rise .4s var(--ease-out); }
@media (prefers-reduced-motion: reduce) {
  .site-head .wrap > *, .hero-copy > * { animation: settle .4s both; }
  #results:not([hidden]) { animation: settle .4s; }
}
/* Nested boxes sit flat: the card shadow is for cards only */
.row, .console-edit, .preview { box-shadow: none; }

/* Phones: the hill and trees only (buildings would sit behind the promise line), and a one-row nav */
@media (max-width: 819px) { .campus-skyline .campus-main, .campus-skyline .win, .campus-skyline .win-off { display: none; } }
@media (max-width: 519px) { .top-nav { gap: 0; font-size: 12px; } .top-nav a { padding: 0 6px; } .top-nav a:first-child { margin-left: -6px; } }

/* Light: cards float on #f5f5f7 with one soft shadow and no outline (dark keeps the hairline, shadows do not read there) */
:root:not([data-theme="dark"]) .card, :root:not([data-theme="dark"]) .summary-row, :root:not([data-theme="dark"]) .hero-tt, :root:not([data-theme="dark"]) .rail { border-color: transparent; }
:root:not([data-theme="dark"]) .hero-paper { box-shadow: var(--shadow-card); border-color: transparent; }
:root:not([data-theme="dark"]) .rail { box-shadow: var(--shadow-card); }
