/* The Nest — shared stylesheet: the shell and every shared component.
 *
 * The living sky (.sky-live) is a window behind the app. Everything that holds words or
 * controls is a solid surface in front of it: one ground, one 1px edge, one soft shadow
 * (see "Surfaces" in tokens.css). Nothing here is translucent, so a passing hawk is seen
 * in the margins and between surfaces, never through one.
 */

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: var(--text-md) / var(--leading-normal) var(--font-ui);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
#app { position: relative; z-index: 1; min-height: 100dvh; }
h1, h2, h3, p, ul, ol, dl, dd, figure, fieldset { margin: 0; padding: 0; }
ul, ol { list-style: none; }
h1, h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-variation-settings: "SOFT" 65, "WONK" 0;
  letter-spacing: var(--tracking-display);
}
h1 { font-size: clamp(1.9rem, 1.2rem + 1.55vw, 2.5rem); line-height: var(--leading-tight); }
h2 { font-size: var(--text-xl); line-height: var(--leading-snug); }
h3 { font-size: var(--text-md); line-height: var(--leading-snug); font-weight: 650; }
a { color: var(--brand); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--brand-strong); text-decoration-color: var(--accent); }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
fieldset { border: 0; min-width: 0; }
::selection { background: var(--sky-200); color: var(--navy-900); }

/* The living sky: one stage fixed behind the whole app (sky-canvas.js draws soft clouds and
   a few distant hawks on it). Its colours for both themes are set here and read by the
   engine. The background is the same sky as a still picture: it shows for a moment before
   the canvas draws, and stands in for it where WebGL is not to be had. */
.sky-live {
  --sky-top: #c9e0f7; --sky-mid: #e0eefb; --sky-low: var(--bg);
  --sky-cloud: #ffffff; --sky-cloud-shade: #d7e6f5; --sky-cloud-amount: 0.72;
  --sky-warm: #fff4dc; --sky-warm-amount: 0.42;
  --sky-hawk: #7e4829; --sky-hawk-far: #73809f; --sky-hawk-amount: 0.8;
  position: fixed; inset: 0; width: 100vw; height: 100dvh; z-index: 0;
  pointer-events: none; overflow: hidden;
  background:
    radial-gradient(ellipse 30% 13% at 24% 15%, color-mix(in srgb, var(--sky-cloud) 70%, transparent), transparent 72%),
    radial-gradient(ellipse 26% 11% at 70% 24%, color-mix(in srgb, var(--sky-cloud) 60%, transparent), transparent 72%),
    radial-gradient(ellipse 36% 12% at 48% 47%, color-mix(in srgb, var(--sky-cloud) 42%, transparent), transparent 72%),
    linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 52%, var(--sky-low) 100%);
}
:root[data-theme="night"] .sky-live {
  --sky-top: #050e1c; --sky-mid: #091526;
  --sky-cloud: #1d3353; --sky-cloud-shade: #0b1a30; --sky-cloud-amount: 0.6;
  --sky-warm: #16304f; --sky-warm-amount: 0.3;
  --sky-hawk: #a9c1de; --sky-hawk-far: #56708f; --sky-hawk-amount: 0.4;
}
/* A few faint stars over the night sky: in front of the clouds, behind the hawks. */
.sky-live::before {
  content: ""; position: absolute; inset: 0 0 36% 0; z-index: 1; opacity: 0;
  background:
    radial-gradient(circle at 5% 21%, #eaf2ff 0 1px, transparent 1.8px),
    radial-gradient(circle at 13% 58%, #eaf2ffa6 0 0.9px, transparent 1.6px),
    radial-gradient(circle at 22% 9%, #eaf2ffcc 0 1px, transparent 1.8px),
    radial-gradient(circle at 31% 41%, #eaf2ff8c 0 0.9px, transparent 1.6px),
    radial-gradient(circle at 39% 16%, #eaf2ff 0 1.2px, transparent 2.1px),
    radial-gradient(circle at 47% 66%, #eaf2ff80 0 0.9px, transparent 1.6px),
    radial-gradient(circle at 56% 28%, #eaf2ffb3 0 1px, transparent 1.8px),
    radial-gradient(circle at 64% 7%, #eaf2ffcc 0 1px, transparent 1.8px),
    radial-gradient(circle at 71% 49%, #eaf2ff8c 0 0.9px, transparent 1.6px),
    radial-gradient(circle at 79% 19%, #eaf2ff 0 1.2px, transparent 2.1px),
    radial-gradient(circle at 87% 37%, #eaf2ffa6 0 0.9px, transparent 1.6px),
    radial-gradient(circle at 95% 12%, #eaf2ffcc 0 1px, transparent 1.8px);
  mask-image: linear-gradient(180deg, #000 50%, transparent);
}
:root[data-theme="night"] .sky-live::before { opacity: 0.8; }
.sky-live-gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* Each hawk has a small canvas of its own, moved about the stage by the engine. */
.sky-live-hawk { position: absolute; left: 0; top: 0; z-index: 2; display: block; will-change: transform; }

/* Keyboard focus: luminous horizon-blue ring with a gentle pale-sky halo. */
:focus-visible {
  outline: 2.5px solid var(--focus-ring); outline-offset: 2px;
  box-shadow: 0 0 0 6px var(--focus-halo);
}
main:focus { outline: none; box-shadow: none; }

.icon { flex: none; display: inline-block; vertical-align: -0.2em; }
.muted { color: var(--muted); }
.small { font-size: var(--text-sm); }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--font-mono); font-feature-settings: "zero"; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.boot { padding: var(--space-12) var(--space-4); text-align: center; color: var(--muted); font-weight: 600; }

/* Layout helpers */
.stack { display: grid; gap: var(--space-4); }
.stack-tight { display: grid; gap: var(--space-2); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.row-between { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); }
.grow { flex: 1 1 auto; min-width: 0; }
.grid-2 { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

/* ---------- App frame: a solid navigation rail beside a window onto the sky ---------- */
.skip {
  position: absolute; left: -999px; top: var(--space-2); z-index: 60;
  background: var(--surface); padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-2);
}
.skip:focus { left: var(--space-2); }

.shell {
  display: grid; grid-template-columns: var(--rail) minmax(0, 1fr);
  min-height: 100dvh;
}
/* The rail is opaque: the sky and its hawks pass behind the main stage only. */
.rail {
  position: sticky; top: 0; z-index: 20;
  height: 100dvh; overflow-y: auto; scrollbar-width: thin;
  display: flex; flex-direction: column; gap: var(--space-6);
  padding: var(--space-4) var(--space-3);
  background: var(--rail-bg);
  border-right: 1px solid var(--rail-edge);
  color: var(--rail-ink);
}

/* The brand: the hawk badge, the product's name, and the school's name in full beneath it
   (it wraps onto a second line rather than being cut short). */
.brand {
  display: flex; align-items: center; gap: var(--space-3); min-width: 0;
  padding: var(--space-2); border-radius: var(--radius-sm);
  color: var(--rail-ink); text-decoration: none;
}
.brand:hover { background: var(--rail-bg-hover); color: var(--rail-ink); }
.brand-mark {
  flex: none; width: 40px; height: 40px; overflow: hidden;
  border-radius: var(--radius-sm); background: var(--sky-100);
  box-shadow: 0 0 0 1px var(--rail-line), var(--shadow-1);
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.brand-text { display: grid; gap: 2px; min-width: 0; }
.brand-name {
  font-family: var(--font-display); font-size: var(--text-xl); font-weight: 600;
  font-variation-settings: "SOFT" 65, "WONK" 0;
  line-height: var(--leading-tight); letter-spacing: var(--tracking-display); color: var(--rail-ink);
}
.brand-school {
  font-size: var(--text-2xs); font-weight: 500; line-height: 1.3; color: var(--rail-muted);
  text-wrap: balance; overflow-wrap: anywhere;
}

/* ---------- Animated Open-Book Flourish Crest (crest.js) ---------- */
.book-crest {
  display: block; width: 100%; height: auto; overflow: visible;
  filter: drop-shadow(0 6px 14px #1444731f);
}
.book-crest .crest-sparkle { fill: #f4c459; }
.book-crest .bc-crown-0 { stop-color: #2c84cc; }
.book-crest .bc-crown-1 { stop-color: #1862a5; }
.book-crest .bc-crown-2 { stop-color: #134170; }
.book-crest .bc-pages-0 { stop-color: #6ab5f2; }
.book-crest .bc-pages-1 { stop-color: #2677c0; }
.book-crest .bc-cover-0, .book-crest .bc-cover-2 { stop-color: #d59422; }
.book-crest .bc-cover-1 { stop-color: #f6cd67; }

/* Hero sign-in crest over sunlit morning sky: jewel-like horizon blue with luminous halo. */
.book-crest-hero {
  filter: drop-shadow(0 10px 24px #ffffffd9) drop-shadow(0 4px 10px #14447326);
}
.book-crest-hero .bc-crown-0 { stop-color: #257ac2; }
.book-crest-hero .bc-crown-1 { stop-color: #16558f; }
.book-crest-hero .bc-crown-2 { stop-color: #0f365c; }
.book-crest-hero .bc-pages-0 { stop-color: #5ca9ea; }
.book-crest-hero .bc-pages-1 { stop-color: #1e69ad; }

/* The band of light and the loader's turning page show only while they move. */
.book-crest .crest-sheen, .book-crest .crest-page-turn { opacity: 0; }
.book-crest .bc-turn-0 { stop-color: #b9dcf9; }
.book-crest .bc-turn-1 { stop-color: #5ca9ea; }
:root[data-theme="night"] .book-crest .bc-turn-0 { stop-color: #ffffff; }
:root[data-theme="night"] .book-crest .bc-turn-1 { stop-color: #b5dbfb; }

/* Starry twilight mode: luminous moonlight-pearl crown with champagne gold binding.
   The Class nest's crest sits on a pale tile in both themes, so it keeps its day colours. */
:root[data-theme="night"] .book-crest:not(.book-crest-hero):not(.book-crest-nest) {
  filter: drop-shadow(0 6px 18px #6bb6fa38);
}
:root[data-theme="night"] .book-crest:not(.book-crest-hero):not(.book-crest-nest) .bc-crown-0 { stop-color: #f2f8ff; }
:root[data-theme="night"] .book-crest:not(.book-crest-hero):not(.book-crest-nest) .bc-crown-1 { stop-color: #a9d5fc; }
:root[data-theme="night"] .book-crest:not(.book-crest-hero):not(.book-crest-nest) .bc-crown-2 { stop-color: #6ab0ee; }
:root[data-theme="night"] .book-crest:not(.book-crest-hero):not(.book-crest-nest) .bc-pages-0 { stop-color: #d6ecff; }
:root[data-theme="night"] .book-crest:not(.book-crest-hero):not(.book-crest-nest) .bc-pages-1 { stop-color: #84c0f4; }
:root[data-theme="night"] .book-crest:not(.book-crest-hero):not(.book-crest-nest) .bc-cover-0,
:root[data-theme="night"] .book-crest:not(.book-crest-hero):not(.book-crest-nest) .bc-cover-2 { stop-color: #e5ad3c; }
:root[data-theme="night"] .book-crest:not(.book-crest-hero):not(.book-crest-nest) .bc-cover-1 { stop-color: #ffebb0; }

.signin-book-crest { display: block; width: clamp(76px, 7.6vw, 108px); }
.sk-crest { display: block; width: 52px; opacity: 0.78; }

.rail-nav { display: grid; gap: var(--space-5); }
.rail-group { display: grid; gap: 2px; }
.rail-label {
  padding: 0 var(--space-3) var(--space-1);
  font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--rail-muted);
}
.rail-link {
  position: relative; display: flex; align-items: center; gap: var(--space-3);
  width: 100%; min-height: 40px; padding: 0 var(--space-3);
  border: 0; border-radius: var(--radius-xs); background: transparent;
  color: var(--rail-ink); font-size: 0.9375rem; font-weight: 550; line-height: 1.2;
  text-decoration: none; text-align: left; cursor: pointer;
}
.rail-link:hover { background: var(--rail-bg-hover); color: var(--rail-ink); }
.rail-link:active { background: var(--rail-bg-current); }
.rail-link .icon { color: var(--rail-muted); }
.rail-link:hover .icon { color: var(--rail-ink); }

/* The screen you are on: a white tab, a bolder name, the accent in its (filled) icon. */
.rail-link[aria-current="page"] {
  background: var(--rail-bg-current); color: var(--rail-ink); font-weight: 650;
  box-shadow: 0 0 0 1px var(--rail-line), var(--shadow-0);
}
.rail-link[aria-current="page"] .icon { color: var(--accent); }
.rail-foot { margin-top: auto; display: grid; gap: 2px; padding-top: var(--space-3); border-top: 1px solid var(--rail-line); }
.rail-account {
  padding: var(--space-2) var(--space-3) 0; font-size: var(--text-xs); color: var(--rail-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* Here rather than with the other touch sizes, so the narrower layouts below can still
   set their own (taller) link heights. */
@media (pointer: coarse) { .rail-link { min-height: var(--tap); } }

/* The main stage is clear: the sky shows in its margins and between its surfaces. */
.shell-main {
  position: relative; isolation: isolate; min-width: 0; overflow-x: clip;
  background: transparent;
}

/* A still sky for a shell drawn without the living one (spots.js skyBackdrop): a soft sun or
   moon and three clouds along the top of the page. Hidden whenever .sky-live is there. */
.sky-backdrop {
  position: absolute; inset: 0 0 auto 0; height: 320px; z-index: 0;
  overflow: hidden; pointer-events: none;
}
body:has(.sky-live) .sky-backdrop { display: none; }
.sky-backdrop-svg { width: 100%; height: 100%; display: block; }
.ambient-sun-glow { fill: #fff4cc; opacity: 0.5; }
.ambient-sun-core { fill: #fce194; opacity: 0.62; }
.ambient-moon { fill: #f6e7b8; opacity: 0; }
.ambient-stars { fill: #eef6ff; opacity: 0; }
.ambient-cloud { fill: #ffffff; opacity: 0.68; filter: blur(1.5px); }
:root[data-theme="night"] .ambient-sun { opacity: 0; }
:root[data-theme="night"] .ambient-moon { opacity: 0.82; }
:root[data-theme="night"] .ambient-stars { opacity: 0.6; }
:root[data-theme="night"] .ambient-cloud { fill: #3c6999; opacity: 0.18; }

.main {
  position: relative; z-index: 1;
  max-width: var(--page); margin: 0 auto; padding: var(--space-8) var(--space-8) 112px;
  display: grid; gap: var(--space-6);
}
/* While a screen loads its surfaces stay solid (nothing behind them may show through),
   so the wait is shown by draining a little colour rather than by fading. */
.main[aria-busy="true"] > * { filter: saturate(0.55); }

/* Page headings sit on the open sky, so they carry full ink weight. */
.page-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: var(--space-3) var(--space-4); }
.page-head h1 { text-wrap: balance; }
.page-head p { margin-top: var(--space-1); color: var(--ink-2); max-width: 60ch; text-wrap: pretty; }
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; font-weight: 600; text-decoration: none; }
/* Words on the open sky keep a soft halo of the ground colour (see --ground-halo). */
.page-head > p, .page-head > div > p, .back, .empty-title, .empty-text { text-shadow: var(--ground-halo); }
.panel .empty-title, .panel .empty-text, .dialog .empty-title, .dialog .empty-text { text-shadow: none; }
.back:hover { text-decoration: underline; }

.nest-rule {
  height: 2px; border: 0; margin: var(--space-1) 0; border-radius: var(--radius-pill);
  background: linear-gradient(90deg, transparent, var(--sky-300) 20%, var(--sky-300) 80%, transparent);
}

/* ---------- Controls: one family ----------
   Buttons, inputs, selects and toolbar toggles share one height (--control, 44px), one
   1px edge (--control-line), one corner (--radius-sm) and 600-weight 15px labels. Small
   buttons and filter chips share the second height (--control-sm, 36px; --tap on a touch
   screen). Hover darkens the edge and tints the ground; nothing jumps. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--control); padding: 0 var(--space-4);
  border: 1px solid var(--control-line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-0);
  font-weight: 600; font-size: 0.9375rem; line-height: 1.2; text-decoration: none; cursor: pointer;
  white-space: nowrap; user-select: none;
}
.btn:hover { background: var(--surface-hover); border-color: var(--control-line-hover); color: var(--ink); }
.btn:active { background: var(--surface-sunk); box-shadow: none; }

/* The primary action: flat horizon cerulean with a hairline of light along its top edge. */
.btn-primary {
  background: var(--accent); border-color: var(--accent); color: var(--on-accent);
  box-shadow: var(--shadow-0), inset 0 1px 0 var(--accent-sheen);
}
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-accent); }
.btn-primary:active { background: var(--accent-strong); box-shadow: none; }
.btn-quiet { background: transparent; border-color: transparent; color: var(--brand); box-shadow: none; }
.btn-quiet:hover { background: var(--surface-hover); border-color: transparent; color: var(--brand-strong); }
.btn-quiet:active { background: var(--surface-sunk); }
.btn-danger { color: var(--alert); border-color: var(--alert-line); }
.btn-danger:hover { background: var(--alert-tint); border-color: var(--alert); color: var(--alert); }
.btn-small { min-height: var(--control-sm); padding: 0 var(--space-3); font-size: var(--text-sm); border-radius: var(--radius-xs); }
.btn-wide { width: 100%; }
/* Unavailable or busy: still solid, just drained. */
.btn:disabled, .btn[aria-busy="true"], .btn[aria-disabled="true"] {
  background: var(--surface-sunk); border-color: var(--line); color: var(--muted); box-shadow: none; cursor: default;
}
.btn-primary:disabled, .btn-primary[aria-busy="true"], .btn-primary[aria-disabled="true"] {
  background: color-mix(in srgb, var(--accent) 45%, var(--surface)); border-color: transparent; color: var(--on-accent);
}
.btn-quiet:disabled, .btn-quiet[aria-busy="true"], .btn-quiet[aria-disabled="true"] { background: transparent; border-color: transparent; }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; }
.field label, .field legend { font-weight: 600; font-size: var(--text-sm); line-height: var(--leading-snug); color: var(--ink-2); }
.optional { font-weight: 400; color: var(--muted); font-size: var(--text-xs); }
.hint { font-size: var(--text-xs); color: var(--muted); text-wrap: pretty; }
input[type="text"], input[type="email"], input[type="number"], input[type="search"],
input[type="date"], input[type="url"], select, textarea {
  width: 100%; min-height: var(--control); padding: 9px 14px; line-height: 1.5;
  border: 1px solid var(--control-line); border-radius: var(--radius-sm);
  background-color: var(--field);
  box-shadow: inset 0 1px 2px var(--field-shade);
}
select {
  appearance: none; -webkit-appearance: none;
  padding-right: var(--space-10);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%23425e7a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
:root[data-theme="night"] select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%23a6c4e2' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
textarea { min-height: 96px; resize: vertical; line-height: var(--leading-normal); }
input:hover, select:hover, textarea:hover { border-color: var(--control-line-hover); }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline-offset: 0; border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--focus-halo);
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 0.8; }
input:disabled, select:disabled, textarea:disabled { background-color: var(--surface-sunk); color: var(--muted); }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--alert); background-color: var(--alert-wash); }
.field-error { font-size: var(--text-xs); font-weight: 700; color: var(--alert); }
.input-suffix { display: flex; align-items: center; gap: var(--space-2); }
.input-suffix input { max-width: 120px; }
.check, .choice { display: flex; align-items: center; gap: var(--space-3); min-height: var(--control-sm); cursor: pointer; }
.check input, .choice input { flex: none; width: 20px; height: 20px; accent-color: var(--accent); }
.choices { display: grid; gap: var(--space-1); }
.choices legend { font-weight: 600; font-size: var(--text-sm); margin-bottom: var(--space-1); }
.form-grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); align-items: start; }
.form-grid .span-all { grid-column: 1 / -1; }

/* A filter bar gets a quiet solid backing of its own, so its labels and fields never sit
   on the open sky. Inside a panel it is just a row. */
.toolbar {
  display: flex; flex-wrap: wrap; align-items: end; gap: var(--space-3);
  padding: var(--space-4);
  background: var(--surface); border: 1px solid var(--edge); border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
}
.panel .toolbar { padding: 0; background: none; border: 0; border-radius: 0; box-shadow: none; }
.toolbar .field { flex: 1 1 200px; }
.toolbar .field-narrow { flex: 0 1 180px; }
.search { display: flex; gap: var(--space-2); }
.search input { flex: 1 1 auto; }

/* Filter chips: small solid pill toggles. The chosen one is tinted and double-edged. */
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chip {
  display: inline-flex; align-items: center; gap: var(--space-2);
  min-height: var(--control-sm); padding: 0 14px;
  border: 1px solid var(--control-line); border-radius: var(--radius-pill);
  background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-0);
  font-weight: 600; font-size: var(--text-sm); line-height: 1.2; text-decoration: none; cursor: pointer;
  white-space: nowrap;
}
.chip:hover { background: var(--surface-hover); border-color: var(--control-line-hover); color: var(--ink); }
.chip:active { background: var(--surface-sunk); box-shadow: none; }
.chip[aria-pressed="true"], .chip[aria-current="true"], .chip[aria-current="page"] {
  background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.chip-count { font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] .chip-count, .chip[aria-current] .chip-count { color: var(--accent-ink); }

/* ---------- Surfaces: panels and notices ----------
   The recipe (see tokens.css): a solid ground, a 1px --edge, --shadow-1. Anything nested
   inside a panel keeps its edge and drops its shadow. */
.panel {
  background: var(--surface);
  border: 1px solid var(--edge); border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-1);
}
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-3); margin-bottom: var(--space-4); }
.panel .loan, .panel .book, .panel .reader, .panel .table-wrap, .panel .stat { box-shadow: none; }
.notice {
  padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm);
  background: var(--brand-soft); color: var(--ink);
  box-shadow: inset 3px 0 0 var(--accent);
  display: grid; gap: var(--space-2); justify-items: start; text-wrap: pretty;
}
.notice-alert { background: var(--alert-tint); color: var(--alert); font-weight: 600; box-shadow: inset 3px 0 0 var(--alert); }
.notice-good { background: var(--good-tint); color: var(--good); font-weight: 600; box-shadow: inset 3px 0 0 var(--good); }

/* ---------- Empty, error and loading states ---------- */
.empty { padding: var(--space-8) var(--space-4) var(--space-10); text-align: center; display: grid; gap: var(--space-2); justify-items: center; }
.empty-art { width: 152px; margin-bottom: var(--space-2); color: var(--brand); }
.empty-art svg { display: block; width: 100%; height: auto; }
.empty-title {
  font-family: var(--font-display); font-size: var(--text-xl); font-weight: 600;
  font-variation-settings: "SOFT" 65, "WONK" 0; letter-spacing: var(--tracking-display);
  line-height: var(--leading-snug); text-wrap: balance;
}
/* Balanced lines: no single word left alone on the last one. */
.empty-text { color: var(--ink-2); max-width: 46ch; text-wrap: balance; }
.empty-action { margin-top: var(--space-3); }
.empty-plain { padding: var(--space-4); }
.empty-plain .empty-title { font-family: var(--font-ui); font-size: var(--text-md); font-weight: 600; letter-spacing: 0; color: var(--muted); font-variation-settings: normal; }
.empty-plain .empty-text { color: var(--muted); font-size: var(--text-sm); }
.empty-wide { padding: var(--space-12) var(--space-4); }
.empty-wide .empty-art { width: 216px; }
.empty-wide .empty-title { font-size: var(--text-2xl); }

/* Storybook spot illustrations (spots.js). */
.spot {
  display: block; width: 100%; height: auto; overflow: visible;
  filter: drop-shadow(0 12px 24px #1444731a);
}
.spot-ring { stroke: #ffffffcc; stroke-width: 2.2; }
:root[data-theme="night"] .spot { filter: drop-shadow(0 14px 28px #00000055); }
:root[data-theme="night"] .spot-ring { stroke: #ffffff38; }
.spot .n { fill: var(--spot-navy); }
.spot .k { fill: var(--navy-900); }
.spot .a { fill: var(--sun-500); }
.spot .s { fill: var(--spot-sky); }
.spot .d { fill: var(--spot-sand); }
.spot .w { fill: var(--spot-straw); }
.spot .c { fill: var(--spot-cream); }
.spot .f { fill: var(--feather-500); }
.spot .u { fill: var(--feather-700); }
.spot .m { fill: var(--moss-600); }
.spot .r { fill: var(--rust-600); }
.spot .tw { fill: none; stroke: var(--spot-straw); stroke-width: 5; stroke-linecap: round; }
.spot .wind { fill: none; stroke: var(--spot-cream); stroke-width: 3; stroke-linecap: round; opacity: 0.9; }
.spot .ln { fill: none; stroke: var(--spot-navy); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.spot .ln.thin { stroke-width: 2; }
.spot .ln.thick { stroke-width: 7; }
.spot .ln.handle { stroke-width: 10; }
.spot .ln.tick { stroke: var(--navy-900); stroke-width: 6; }
.spot .ln.dashed { stroke-width: 2.5; stroke-dasharray: 5 6; }

/* The loading outline: solid blocks in the shapes of what is coming. Lines of text are
   quiet bars; cards, rows and the scan bar are outlined like the surfaces they stand for. */
.skeleton { display: grid; gap: var(--space-6); }
.sk {
  display: block; border-radius: var(--radius-xs);
  background: linear-gradient(100deg, var(--sk-low) 30%, var(--sk-high) 50%, var(--sk-low) 70%) 0 0 / 300% 100%;
}
.sk-title { width: min(280px, 60%); height: 40px; }
.sk-line { width: min(420px, 80%); height: 16px; }
.sk-bar, .sk-card, .sk-row {
  border: 1px solid var(--edge); box-shadow: var(--shadow-1);
  background: linear-gradient(100deg, var(--surface) 30%, var(--surface-quiet) 50%, var(--surface) 70%) 0 0 / 300% 100%;
}
.sk-bar { height: 124px; border-radius: var(--radius-lg); }
.sk-grid { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); background: none; }
.sk-card { height: 112px; border-radius: var(--radius-md); }
.sk-row { height: 56px; border-radius: var(--radius-md); }
.sk-rows { display: grid; gap: var(--space-2); background: none; }

/* ---------- Stat tiles ---------- */
.stats { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fit, minmax(136px, 1fr)); }
.stat {
  display: grid; gap: var(--space-1); align-content: start; padding: var(--space-4) var(--space-5); text-align: left;
  background: var(--surface);
  border: 1px solid var(--edge); border-radius: var(--radius-md); color: var(--ink);
  box-shadow: var(--shadow-1);
}
button.stat { cursor: pointer; }
button.stat:hover { border-color: var(--edge-hover); box-shadow: var(--shadow-2); }
button.stat:active { box-shadow: var(--shadow-0); }
.stat[aria-pressed="true"], .stat[aria-pressed="true"]:hover {
  border-color: var(--accent); background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}
/* Lining, equal-width figures, so a row of tiles reads as one set of numbers. */
.stat-number {
  font-family: var(--font-display); font-size: var(--text-3xl); font-weight: 600;
  font-variation-settings: "SOFT" 65, "WONK" 0;
  line-height: 1.05; letter-spacing: var(--tracking-display); font-variant-numeric: lining-nums tabular-nums;
}
.stat-label { font-size: var(--text-sm); line-height: var(--leading-snug); color: var(--muted); font-weight: 600; }
.stat-alert .stat-number { color: var(--alert); }

/* ---------- Pills and badges ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px; min-height: 24px; padding: 0 10px;
  border-radius: var(--radius-pill); font-size: var(--text-xs); font-weight: 650; white-space: nowrap;
  background: var(--none-tint); color: var(--none);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 14%, transparent);
}
.pill-good { background: var(--good-tint); color: var(--good); }
.pill-easy { background: var(--easy-tint); color: var(--easy); }
.pill-stretch { background: var(--stretch-tint); color: var(--stretch); }
.pill-alert { background: var(--alert-tint); color: var(--alert); }
.pill-brand { background: var(--brand-soft); color: var(--brand); }
.pill-gold { background: var(--gold-tint); color: var(--gold-ink); }
.pill-good::before, .pill-easy::before, .pill-stretch::before, .pill-alert::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor;
}

.level {
  display: inline-flex; align-items: center; gap: 5px; min-height: 24px; padding: 0 8px 0 3px;
  border-radius: var(--radius-xs); background: var(--navy-800); color: #fff;
  font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 700; white-space: nowrap;
}
.level-tag { padding: 1px 5px; border-radius: 5px; background: var(--sun-300); color: var(--navy-900); font-size: 0.6875rem; letter-spacing: 0.02em; }
.level-none { padding: 0 8px; background: var(--none-tint); color: var(--none); font-family: var(--font-ui); font-weight: 600; }

.range {
  display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px;
  border: 1px solid var(--control-line); border-radius: var(--radius-xs);
  background: var(--field);
  font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 700; white-space: nowrap;
}
.range-none { border: 1px dashed var(--line-strong); background: transparent; color: var(--muted); font-family: var(--font-ui); font-weight: 600; }

.due { font-weight: 650; font-size: var(--text-sm); white-space: nowrap; font-variant-numeric: tabular-nums; }
.due-alert { color: var(--alert); }
.due-soon { color: var(--accent-ink); }
.due-calm { color: var(--muted); }

/* ---------- Covers ---------- */
.cover {
  position: relative; display: block; flex: none; overflow: hidden;
  aspect-ratio: 2 / 3; border-radius: 3px 7px 7px 3px; background: var(--brand-soft);
  box-shadow: inset 4px 0 0 #122c461a, 0 0 0 1px #122c4616, 0 8px 18px -8px #14447344;
}
/* Subtle spine crease and hardcover specular highlight over both photos and tinted jackets. */
.cover::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: linear-gradient(90deg, #00000018 0%, #ffffff30 5%, #00000010 9%, transparent 15%, transparent 94%, #0000000f 100%);
  box-shadow: inset 0 1px 0 #ffffff4d;
}
.cover-s { width: 44px; }
.cover-m { width: 84px; }
.cover-l { width: 150px; }
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #fff; }
.cover-title {
  position: absolute; inset: 0; padding: 12% 10% 12% 16%; overflow: hidden;
  font-family: var(--font-display); font-weight: 600; font-variation-settings: "SOFT" 65;
  line-height: 1.14; color: var(--navy-900); overflow-wrap: break-word; hyphens: auto;
}
.cover-s .cover-title { font-size: 7px; }
.cover-m .cover-title { font-size: 11px; }
.cover-l .cover-title { font-size: 17px; }
.cover-tint-0 { background: linear-gradient(155deg, #d7ecfd, #b4d9fa); }
.cover-tint-1 { background: linear-gradient(155deg, #fef3d2, #f7df9d); }
.cover-tint-2 { background: linear-gradient(155deg, #d8f2e7, #b2e2ce); }
.cover-tint-3 { background: linear-gradient(155deg, #fbe2dc, #f4c3b8); }
.cover-tint-4 { background: linear-gradient(155deg, #ece0fa, #d7c0f4); }
.cover-tint-5 { background: linear-gradient(155deg, #fcebd7, #f5d1a8); }

/* ---------- Loans ---------- */
.loans { display: grid; gap: var(--space-2); }
.loan {
  display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: flex-start;
  padding: var(--space-3) var(--space-4) var(--space-3) var(--space-3);
  background: var(--surface);
  border: 1px solid var(--edge); border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
  position: relative; container-type: inline-size;
}
/* Overdue: a wash and a short rust bar on the left edge, as well as the words. */
.loan.is-overdue { border-color: var(--alert-line); background: var(--alert-wash); }
.loan.is-overdue::before {
  content: ""; position: absolute; left: -1px; top: var(--space-3); bottom: var(--space-3); width: 4px;
  border-radius: 0 var(--radius-pill) var(--radius-pill) 0; background: var(--alert);
}
.loan-main { flex: 1 1 auto; min-width: 0; display: grid; gap: var(--space-1); }
.loan-title { font-weight: 650; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.loan-title:hover { text-decoration: underline; }
.loan-who { font-weight: 650; }
.loan-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: var(--text-sm); }
.loan-side { display: grid; gap: var(--space-2); justify-items: end; flex: none; }
.loan-status { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--space-2); }
@container (max-width: 560px) {
  .loan-main { flex-basis: calc(100% - 60px); }
  .loan-side {
    flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center;
    justify-content: space-between; gap: var(--space-2);
  }
}

/* ---------- Book cards ---------- */
.book-grid { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fill, minmax(304px, 1fr)); }
.book {
  display: flex; gap: var(--space-4); padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--edge); border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
}
.book:hover { border-color: var(--edge-hover); }
.book:hover .cover { transform: translateY(-2px); }
.book-cover { display: block; flex: none; text-decoration: none; }
.book-main { flex: 1 1 auto; min-width: 0; display: grid; gap: var(--space-1); align-content: start; }
.book-title { font-weight: 650; line-height: var(--leading-snug); color: var(--ink); text-decoration: none; overflow-wrap: anywhere; text-wrap: pretty; }
.book-title:hover { text-decoration: underline; }
.book-author { color: var(--muted); font-size: var(--text-sm); }
.book-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: var(--text-sm); }

/* ---------- Reader tiles ---------- */
.reader-grid { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fill, minmax(204px, 1fr)); }
.reader {
  position: relative;
  display: grid; gap: var(--space-2); align-content: start; padding: var(--space-4); text-align: left; min-height: 96px;
  background: var(--surface);
  border: 1px solid var(--edge); border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
  color: var(--ink); text-decoration: none; cursor: pointer;
}
.reader:hover { border-color: var(--edge-hover); box-shadow: var(--shadow-2); }
.reader:active { box-shadow: var(--shadow-0); }
.reader[aria-pressed="true"], .reader[aria-current="true"],
.reader[aria-pressed="true"]:hover, .reader[aria-current="true"]:hover {
  border-color: var(--accent); background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}
/* Overdue: a short rust bar on the left edge, as well as the words. */
.reader.is-overdue::before {
  content: ""; position: absolute; left: -1px; top: var(--space-4); bottom: var(--space-4); width: 4px;
  border-radius: 0 var(--radius-pill) var(--radius-pill) 0; background: var(--alert);
}
.reader-name { font-weight: 650; font-size: var(--text-lg); line-height: 1.24; overflow-wrap: anywhere; }
.reader-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: var(--text-sm); }
.reader-books { display: grid; gap: 2px; font-size: var(--text-sm); line-height: var(--leading-snug); color: var(--muted); }
.reader-books .is-overdue { color: var(--alert); font-weight: 650; }

/* ---------- Tables ---------- */
.table-wrap {
  position: relative; overflow-x: auto;
  border: 1px solid var(--edge); border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}
.table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; font-variant-numeric: tabular-nums; }
.table th, .table td { padding: var(--space-3); text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.table th:first-child, .table td:first-child { padding-left: var(--space-4); }
.table th:last-child, .table td:last-child { padding-right: var(--space-4); }
.table tbody tr:last-child > * { border-bottom: 0; }
.table tr:last-child td { border-bottom: 0; }
.table th {
  font-size: var(--text-2xs); font-weight: 700; letter-spacing: var(--tracking-caps); text-transform: uppercase;
  color: var(--muted); white-space: nowrap; vertical-align: bottom;
  background: var(--surface-sunk);
}
/* A row's own heading (a child's name) reads as part of the row, not as a column head. */
.table tbody th {
  font-size: inherit; font-weight: 650; letter-spacing: 0; text-transform: none;
  color: var(--ink); vertical-align: top; background: none;
}
.table tbody tr:hover > * { background: var(--surface-hover); }
.table .num { text-align: right; font-family: var(--font-mono); }
.table thead .num { font-family: var(--font-ui); }
.table tr.is-overdue > *, .table tbody tr.is-overdue:hover > * { background: var(--alert-wash); }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px var(--space-4); font-size: 0.9375rem; }
.facts dt { color: var(--muted); }
.facts dd { font-weight: 600; overflow-wrap: anywhere; }

/* ---------- Dialog ---------- */
.dialog {
  width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0;
  border: 1px solid var(--edge); border-radius: var(--radius-lg); color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow-3);
}
.dialog-wide { width: min(820px, calc(100vw - 24px)); }
.dialog::backdrop { background: var(--scrim, #0c1a2e73); }
.dialog-body { display: grid; gap: var(--space-4); padding: var(--space-6); }
.dialog-body > h2:first-child { font-size: var(--text-2xl); text-wrap: balance; }
.dialog-body > p { text-wrap: pretty; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-2); }

/* ---------- Toasts: one deep navy slab, solid in both themes ---------- */
.toasts { position: fixed; left: 50%; bottom: var(--space-6); z-index: 40; transform: translateX(-50%); display: grid; gap: var(--space-2); width: min(520px, calc(100vw - 24px)); }
.toast {
  display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4);
  min-height: 52px;
  border-radius: var(--radius-md); background: var(--toast-bg);
  color: var(--toast-ink); font-weight: 600; line-height: var(--leading-snug);
  border: 1px solid var(--toast-line); box-shadow: var(--shadow-2);
  --focus-ring: var(--toast-ink); --focus-halo: transparent;
}
.toast > span:not(.toast-icon) { flex: 1 1 auto; min-width: 0; text-wrap: pretty; }
.toast-icon { flex: none; display: grid; place-items: center; color: var(--sun-300); }
.toast-error { background: var(--toast-alert-bg); }
.toast-error .toast-icon { color: var(--toast-ink); }
.toast-close { flex: none; display: grid; place-items: center; border: 0; border-radius: var(--radius-xs); background: transparent; color: inherit; min-width: var(--control-sm); min-height: var(--control-sm); cursor: pointer; }
.toast-close:hover { background: var(--toast-line); }

/* ---------- Houston the Hawk — the floating assistant ----------
   A solid dock button with Houston alive in its round window, and a panel he stands on.
   Houston himself is the rig in houston-rig.css; these rules only frame him. */
.assistant {
  position: fixed; right: var(--space-6); bottom: var(--space-6); z-index: 25;
  display: grid; justify-items: end; gap: var(--space-3);
  pointer-events: none;
}
.assistant > * { pointer-events: auto; }
.assistant-fab {
  position: relative; display: inline-flex; align-items: center; gap: var(--space-3);
  min-height: 56px; padding: var(--space-1) var(--space-5) var(--space-1) var(--space-1);
  border: 1px solid var(--edge); border-radius: var(--radius-pill);
  background: var(--surface); color: var(--ink); text-align: left; cursor: pointer;
  box-shadow: var(--shadow-2), inset 0 1px 0 var(--surface-sheen);
}
.assistant-fab:hover {
  border-color: var(--edge-hover); transform: translateY(-1px);
  box-shadow: var(--shadow-3), inset 0 1px 0 var(--surface-sheen);
}
.assistant.is-open .assistant-fab { border-color: var(--edge-hover); }
/* The round window: a little sky with Houston's head and shoulders in it. */
.assistant-avatar {
  position: relative; flex: none; width: 46px; height: 46px; border-radius: 50%;
  background: var(--hawk-well);
  box-shadow: inset 0 0 0 1px var(--hawk-well-edge);
}
.assistant-avatar .hrig { width: 100%; height: 100%; border-radius: 50%; }
.assistant-avatar::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  box-shadow: inset 0 0 0 1px var(--hawk-well-edge), inset 0 2px 5px -2px var(--field-shade);
}
.assistant-label { display: grid; gap: 1px; line-height: 1.2; }
.assistant-label-name {
  font-family: var(--font-display); font-weight: 600; font-size: var(--text-md);
  font-variation-settings: "SOFT" 65, "WONK" 0; letter-spacing: var(--tracking-display);
}
.assistant-label-hint { font-size: var(--text-2xs); font-weight: 600; color: var(--muted); }

.assistant-panel {
  position: relative;
  width: min(360px, calc(100vw - 32px));
  display: grid; gap: var(--space-3); padding: 0 var(--space-4) var(--space-4);
  border: 1px solid var(--edge); border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-3), inset 0 1px 0 var(--surface-sheen);
}
/* The head is a band of sky. Houston stands on its lower edge, a head taller than the panel. */
.assistant-head {
  position: relative; display: flex; align-items: center; gap: var(--space-2);
  min-height: 76px; margin: 0 calc(var(--space-4) * -1);
  padding: var(--space-3) var(--space-3) var(--space-3) 124px;
  border-bottom: 1px solid var(--edge);
  border-radius: calc(var(--radius-lg) - 1px) calc(var(--radius-lg) - 1px) 0 0;
  background: var(--hawk-well);
}
.assistant-mascot {
  position: absolute; left: var(--space-3); bottom: 0; width: 112px; height: 112px;
  isolation: isolate; transform-origin: 50% 100%;
}
.assistant-mascot .hrig { width: 100%; height: 100%; }
.assistant-mascot::before {
  content: ""; position: absolute; z-index: -1; left: 24%; right: 16%; bottom: 0; height: 8px;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--navy-900) 26%, transparent), transparent);
}
.assistant-id { flex: 1 1 auto; min-width: 0; display: grid; gap: 2px; }
.assistant-name {
  font-family: var(--font-display); font-weight: 600; font-size: var(--text-lg);
  font-variation-settings: "SOFT" 65, "WONK" 0; line-height: 1.15; letter-spacing: var(--tracking-display);
  color: var(--ink);
}
.assistant-role { font-size: var(--text-xs); color: var(--muted); font-weight: 600; }
.assistant-close {
  flex: none; align-self: flex-start; display: grid; place-items: center; width: var(--control-sm); height: var(--control-sm);
  border: 0; border-radius: var(--radius-pill); background: transparent; color: var(--muted); cursor: pointer;
}
.assistant-close:hover { background: var(--surface); color: var(--ink); }

/* What he says: a speech bubble whose tail points up at him. */
.assistant-body {
  position: relative; display: grid; gap: var(--space-1); margin-top: var(--space-1);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--line); border-radius: var(--radius-md);
  background: var(--surface-quiet);
}
.assistant-body::before {
  content: ""; position: absolute; left: 46px; top: -6px; width: 10px; height: 10px; rotate: 45deg;
  border: solid var(--line); border-width: 1px 0 0 1px; border-top-left-radius: 2px;
  background: var(--surface-quiet);
}
.assistant-kicker { font-size: var(--text-2xs); font-weight: 700; letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--accent-ink); }
.assistant-message { font-size: var(--text-sm); color: var(--ink); line-height: 1.5; text-wrap: pretty; }
.assistant-quote {
  font-family: var(--font-display); font-size: var(--text-md); font-weight: 500;
  font-variation-settings: "SOFT" 75, "WONK" 0;
  color: var(--ink); line-height: 1.42; text-wrap: pretty;
}
.assistant-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.assistant-cheer-btn { background: var(--gold-tint); border-color: var(--sun-edge); color: var(--gold-ink); }
.assistant-cheer-btn:hover { background: var(--gold-tint); border-color: var(--sun-500); color: var(--gold-ink); }

.assistant-links {
  display: flex; flex-wrap: wrap; gap: var(--space-2); padding-top: var(--space-3);
  border-top: 1px solid var(--line);
}
.assistant-link {
  display: inline-flex; align-items: center; gap: 6px; min-height: var(--control-sm); padding: 0 var(--space-3);
  border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--surface); color: var(--brand);
  font-size: var(--text-xs); font-weight: 600; text-decoration: none;
}
.assistant-link:hover { background: var(--brand-soft); border-color: var(--edge-hover); color: var(--brand-strong); text-decoration: none; }

/* ---------- Sign-in: the living painting beside one solid card ---------- */
.signin {
  min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.16fr) minmax(400px, 0.84fr);
  background: transparent;
}
/* The picture is framed like a print: a deep radius, a hairline of light inside the edge.
   Its layers (hero-hawk.css) are placed in the painting's own coordinates. */
.signin-art {
  position: relative; isolation: isolate; overflow: hidden; min-height: 380px; container-type: size;
  margin: var(--space-4) 0 var(--space-4) var(--space-4);
  border-radius: calc(var(--radius-lg) + var(--space-2));
  background: var(--surface-sunk);
  box-shadow: 0 0 0 1px var(--edge), var(--shadow-2);
}
.signin-art::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 0 1px #ffffff8c, inset 0 1px 0 1px #ffffffb3;
}
:root[data-theme="night"] .signin-art::after { box-shadow: inset 0 0 0 1px #ffffff1a, inset 0 1px 0 1px #ffffff14; }

/* The lettering takes the theme's ink, because the painting turns to night with the theme. */
.signin-welcome {
  position: absolute; left: var(--space-12); top: var(--space-12);
  display: grid; gap: var(--space-4); justify-items: start;
  color: var(--ink);
}
.signin-welcome strong {
  max-width: 8ch;
  font-family: var(--font-display); font-size: clamp(2.5rem, 1.3rem + 3.1vw, 4.25rem);
  font-weight: 600; font-variation-settings: "SOFT" 65, "WONK" 0;
  line-height: 1.02; letter-spacing: -0.03em;
}
.signin-welcome > span:last-child {
  max-width: 25ch; font-size: var(--text-lg); font-weight: 500; line-height: 1.45;
  color: var(--ink-2); text-wrap: balance;
}
:root[data-theme="night"] .signin-welcome { text-shadow: 0 1px 18px #0c1a2e99; }
:root[data-theme="night"] .signin-book-crest .book-crest-hero { filter: drop-shadow(0 6px 18px #0c1a2e8c); }
:root[data-theme="night"] .signin-book-crest .bc-crown-0 { stop-color: #f2f8ff; }
:root[data-theme="night"] .signin-book-crest .bc-crown-1 { stop-color: #a9d5fc; }
:root[data-theme="night"] .signin-book-crest .bc-crown-2 { stop-color: #6ab0ee; }
:root[data-theme="night"] .signin-book-crest .bc-pages-0 { stop-color: #d6ecff; }
:root[data-theme="night"] .signin-book-crest .bc-pages-1 { stop-color: #84c0f4; }

.signin-panel { display: grid; place-items: center; padding: var(--space-8) var(--space-6); }
.signin-card {
  width: min(440px, 100%); display: grid; gap: var(--space-6);
  padding: var(--space-10) var(--space-8) var(--space-8);
  background: var(--surface);
  border: 1px solid var(--edge); border-radius: calc(var(--radius-lg) + var(--space-1));
  box-shadow: inset 0 1px 0 var(--surface-sheen), var(--shadow-3);
}
/* The title sits left with the hawk as a seal at its right; the school runs full width. */
.signin-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--space-4); row-gap: var(--space-1); }
.signin-title { display: contents; }
.signin-crest {
  grid-column: 2; grid-row: 1 / span 2; align-self: start;
  width: 64px; height: 64px; overflow: hidden; border-radius: var(--radius-lg);
  background: var(--sky-100);
  box-shadow: 0 0 0 1px var(--edge), var(--shadow-1);
}
.signin-crest img { width: 100%; height: 100%; object-fit: cover; }
:root[data-theme="night"] .signin-crest img { filter: brightness(0.86) saturate(0.92); }
.signin-kicker {
  grid-column: 1; grid-row: 1; align-self: end;
  font-size: var(--text-2xs); font-weight: 700; letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--accent-ink);
}
.signin-card h1 { grid-column: 1; grid-row: 2; font-size: var(--text-4xl); line-height: 1; letter-spacing: -0.03em; }
.signin-school { grid-column: 1 / -1; grid-row: 3; margin-top: var(--space-2); font-weight: 500; color: var(--muted); text-wrap: balance; }
.signin-sent { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: var(--space-4); }
.signin-sent .empty-art { width: 88px; margin: 0; }
.signin-demo {
  display: grid; gap: var(--space-3); padding: var(--space-4);
  border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-quiet);
}
.signin-demo .row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
.signin-demo .btn { justify-content: center; }
.signin-companion {
  display: flex; align-items: center; gap: var(--space-3);
  padding-top: var(--space-5); border-top: 1px solid var(--line);
  font-size: var(--text-xs); color: var(--muted); line-height: var(--leading-snug);
}
.signin-companion img {
  flex: none; width: 32px; height: 32px; border-radius: 50%; object-fit: cover;
  background: var(--surface-sunk); box-shadow: 0 0 0 1px var(--edge);
}
@media (prefers-reduced-motion: no-preference) {
  .signin-card { animation: signin-arrive var(--dur-3) var(--ease-out) both; }
}
@keyframes signin-arrive { from { opacity: 0; transform: translateY(8px); } }

:root {
  --nest-front: polygon(0 50.7%, 18.3% 50.7%, 21.7% 54.9%, 26.7% 57%, 33.3% 58.6%, 41.7% 59.6%, 50% 60%,
    58.3% 59.6%, 66.7% 58.6%, 73.3% 57%, 78.3% 54.9%, 81.7% 50.7%, 100% 50.7%, 100% 100%, 0 100%);
}

/* ---------- Smaller screens ---------- */
@media (max-width: 1100px) {
  /* The compact rail: the badge, then each screen as an icon over its name. */
  .shell { grid-template-columns: var(--rail-compact) minmax(0, 1fr); }
  .rail { padding: var(--space-3) var(--space-2); gap: var(--space-4); }
  .brand { justify-content: center; padding: var(--space-1); }
  .brand-text, .rail-label, .rail-account { display: none; }
  .rail-nav { gap: var(--space-2); }
  .rail-group + .rail-group { padding-top: var(--space-2); border-top: 1px solid var(--rail-line); }
  .rail-link {
    flex-direction: column; justify-content: center; gap: 3px; min-height: 56px; padding: 6px 2px;
    font-size: 0.71875rem; font-weight: 600; line-height: 1.15; text-align: center;
  }
  .main { padding: var(--space-6) var(--space-5) 112px; }
}
@media (max-width: 720px) {
  .shell { display: block; }
  /* The phone header: one row for the brand with Settings, the theme and Sign out as
     44px icon buttons beside it, then one row of tabs with every screen in view. About
     108px in all, so the screen's own content starts high. It is solid, like the rail. */
  .rail {
    position: static; height: auto; overflow: visible;
    display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 var(--space-2);
    padding: var(--space-1) var(--space-2) 0 var(--space-3);
    border-right: 0; border-bottom: 1px solid var(--rail-edge);
  }
  .brand { grid-area: 1 / 1; justify-content: flex-start; gap: 10px; min-height: 52px; padding: var(--space-1) var(--space-1) var(--space-1) 0; }
  .brand:hover { background: transparent; }
  .brand-mark { width: 36px; height: 36px; }
  .brand-text { display: grid; gap: 1px; }
  .brand-name { font-size: var(--text-lg); }
  .brand-school { line-height: 1.2; }
  .rail-foot { grid-area: 1 / 2; margin: 0; padding: 0; border: 0; display: flex; gap: 0; }
  .rail-foot .rail-link {
    flex: none; width: var(--tap); min-width: 0; min-height: var(--tap); padding: 0;
    border-radius: var(--radius-sm);
  }
  /* The words stay for screen readers; the icon alone is shown. */
  .rail-foot .rail-link > span {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip-path: inset(50%); white-space: nowrap;
  }
  .rail-foot .rail-link:hover { background: var(--rail-bg-hover); }
  .rail-foot .rail-link[aria-current="page"] { background: var(--rail-bg-current); box-shadow: 0 0 0 1px var(--rail-line), var(--shadow-0); }
  .rail-foot .rail-link[aria-current="page"]::after { content: none; }
  .rail-nav {
    grid-area: 2 / 1 / 3 / -1; display: flex; gap: 0;
    margin: 0 calc(var(--space-2) * -1) 0 calc(var(--space-3) * -1); padding: 0 var(--space-1);
    overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain;
  }
  .rail-nav::-webkit-scrollbar { display: none; }
  .rail-group { display: contents; }
  .rail-link {
    flex: 1 0 auto; width: auto; min-width: 56px; min-height: 52px; padding: 6px var(--space-2) var(--space-2);
    border-radius: 0; white-space: nowrap;
  }
  .rail-link:hover { background: transparent; }
  .rail-link[aria-current="page"] { background: transparent; box-shadow: none; color: var(--accent-ink); }
  .rail-link[aria-current="page"]::after {
    content: ""; position: absolute; left: var(--space-2); right: var(--space-2); bottom: 0; height: 3px;
    border-radius: 3px 3px 0 0; background: var(--accent);
  }
  .main { padding: var(--space-4) var(--space-4) 112px; gap: var(--space-4); }
  .panel { padding: var(--space-4); }
  .toolbar { padding: var(--space-3); }
  .reader-grid { grid-template-columns: repeat(auto-fill, minmax(154px, 1fr)); }
  .book-grid { grid-template-columns: 1fr; }
  .cover-l { width: 110px; }
  .dialog-body { padding: var(--space-5) var(--space-4); }
  .assistant { right: var(--space-4); bottom: var(--space-4); }
  .assistant-label { display: none; }
  .assistant-fab { padding: var(--space-1); }
}
@media (max-width: 860px) {
  .signin { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .signin-art {
    min-height: 0; height: clamp(260px, max(40dvh, 63vw), 50dvh);
    margin: var(--space-3) var(--space-3) 0; border-radius: var(--radius-lg);
  }
  .signin-welcome { left: var(--space-5); top: var(--space-5); gap: var(--space-2); }
  .signin-book-crest { width: 52px; margin-bottom: 0; }
  .signin-welcome strong { max-width: 7ch; font-size: clamp(var(--text-3xl), 5.6vw, var(--text-4xl)); line-height: 1.04; }
  .signin-welcome > span:last-child { display: none; }
  .signin-panel { place-items: start center; padding: var(--space-5) var(--space-3) var(--space-8); }
  .signin-card { gap: var(--space-5); padding: var(--space-6) var(--space-5); }
}

@media (pointer: coarse) {
  .chip, .btn-small, .back { min-height: var(--tap); }
  /* A card's title link reaches 12px above and below its words. */
  .loan-title, .book-title { position: relative; }
  .loan-title::after, .book-title::after { content: ""; position: absolute; inset: -12px 0; }
  .toast-close { min-width: var(--tap); min-height: var(--tap); }
}

/* ---------- Motion: fluid, silk-smooth choreography; stopped when reduced ---------- */
@media (prefers-reduced-motion: no-preference) {
  .btn, .chip, .reader, .stat, .rail-link, .brand, .brand-mark, .loan, .book, .cover,
  input, select, textarea, .toast-close, .assistant-fab, .assistant-close, .assistant-link {
    transition: background-color var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out),
      color var(--dur-1) var(--ease-out), box-shadow var(--dur-2) var(--ease-out),
      transform var(--dur-2) var(--ease-out);
  }
  .rail-link .icon { transition: color var(--dur-1) var(--ease-out); }
  .table tbody tr > * { transition: background-color var(--dur-1) var(--ease-out); }

  /* The crest (crest.js). Everything pivots at the book's spine.
     At rest it holds still, then every twelve seconds takes one slow breath (the wings ease
     open together, the spire lifts, the pages follow a moment later) and, once it has
     settled again, a band of light crosses it. The sparkles keep their own unequal times,
     so the three never fall into a pattern. --crest-rest is when resting begins. */
  .book-crest .crest-flourish, .book-crest .crest-wing-l, .book-crest .crest-wing-r, .book-crest .crest-spire {
    transform-box: view-box; transform-origin: 50% 80.6%;
  }
  .book-crest .crest-pages-l, .book-crest .crest-pages-r, .book-crest .crest-page-turn {
    transform-box: view-box; transform-origin: 50% 83.4%;
  }
  .book-crest .crest-cover { transform-box: view-box; transform-origin: 50% 88.4%; }

  .book-crest:not(.book-crest-loader) .crest-wing-l { animation: crest-breath-l 12s var(--ease-silk) var(--crest-rest, 0s) infinite; }
  .book-crest:not(.book-crest-loader) .crest-wing-r { animation: crest-breath-r 12s var(--ease-silk) var(--crest-rest, 0s) infinite; }
  .book-crest:not(.book-crest-loader) .crest-spire { animation: crest-breath-spire 12s var(--ease-silk) var(--crest-rest, 0s) infinite; }
  .book-crest:not(.book-crest-loader) .crest-pages-l { animation: crest-page-breath-l 12s var(--ease-silk) var(--crest-rest, 0s) infinite; }
  .book-crest:not(.book-crest-loader) .crest-pages-r { animation: crest-page-breath-r 12s var(--ease-silk) var(--crest-rest, 0s) infinite; }
  .book-crest .crest-sheen { animation: crest-sheen 12s linear var(--crest-rest, 0s) infinite; }
  .book-crest .cs-1 { animation: crest-twinkle 5.3s var(--ease-silk) calc(var(--crest-rest, 0s) + 1.2s) infinite; }
  .book-crest .cs-2 { animation: crest-twinkle 7.1s var(--ease-silk) calc(var(--crest-rest, 0s) + 3.1s) infinite; }
  .book-crest .cs-3 { animation: crest-twinkle 8.9s var(--ease-silk) calc(var(--crest-rest, 0s) + 0.2s) infinite; }

  /* Arriving (the sign-in page): the cover line draws out from the spine, the book opens,
     and the flourish draws itself along its own curves, the spire first. The sparkles
     land, one light crosses, and only then does it start to rest. */
  .book-crest.is-arriving { --crest-rest: 2.8s; }
  .is-arriving .crest-cover { animation: crest-cover-draw 560ms var(--ease-out) both; }
  .book-crest.is-arriving .crest-pages-l {
    animation: crest-open-l 640ms cubic-bezier(0.3, 1.35, 0.6, 1) 140ms both,
      crest-page-breath-l 12s var(--ease-silk) var(--crest-rest) infinite;
  }
  .book-crest.is-arriving .crest-pages-r {
    animation: crest-open-r 640ms cubic-bezier(0.3, 1.35, 0.6, 1) 140ms both,
      crest-page-breath-r 12s var(--ease-silk) var(--crest-rest) infinite;
  }
  .is-arriving .crest-flourish { animation: crest-grow 1.3s var(--ease-out) 380ms both; }
  .is-arriving .crest-draw-spire { animation: crest-draw 1080ms cubic-bezier(0.5, 0, 0.2, 1) 400ms both; }
  .is-arriving .crest-draw-leaf { animation: crest-draw 700ms cubic-bezier(0.5, 0, 0.2, 1) 380ms both; }
  .is-arriving .crest-draw-outer { animation: crest-draw 1080ms cubic-bezier(0.5, 0, 0.2, 1) 420ms both; }
  .is-arriving .crest-draw-inner { animation: crest-draw 1140ms cubic-bezier(0.5, 0, 0.2, 1) 460ms both; }
  .is-arriving .crest-draw-all { animation: crest-draw-all 200ms linear 1.62s both; }
  .book-crest.is-arriving .crest-sheen {
    animation: crest-sheen-once 1.1s linear 1.7s both, crest-sheen 12s linear var(--crest-rest) infinite;
  }
  .book-crest.is-arriving .cs-1 {
    animation: crest-sparkle-in 520ms var(--ease-out) 1.5s both,
      crest-twinkle 5.3s var(--ease-silk) calc(var(--crest-rest) + 1.2s) infinite;
  }
  .book-crest.is-arriving .cs-2 {
    animation: crest-sparkle-in 520ms var(--ease-out) 1.78s both,
      crest-twinkle 7.1s var(--ease-silk) calc(var(--crest-rest) + 3.1s) infinite;
  }
  .book-crest.is-arriving .cs-3 {
    animation: crest-sparkle-in 520ms var(--ease-out) 1.64s both,
      crest-twinkle 8.9s var(--ease-silk) calc(var(--crest-rest) + 0.2s) infinite;
  }

  /* Loading: the crest keeps still while a page turns from the right-hand side to the left. */
  .book-crest-loader .crest-page-turn { animation: crest-page-turn 1.7s linear infinite; }

  .main > * { transition: opacity var(--dur-2) var(--ease-out); animation: screen-arrive var(--dur-3) var(--ease-out) both; }
  .sk { animation: sk-breathe 1.6s var(--ease-in-out) infinite; }
  .toast { animation: toast-in var(--dur-3) var(--ease-out) both; }
  .dialog[open] { animation: dialog-in var(--dur-2) var(--ease-out) both; }
  .dialog[open]::backdrop { animation: fade-in var(--dur-2) var(--ease-out) both; }
  .toast-lend .toast-icon { animation: feather-fall 750ms var(--ease-out) both; transform-origin: 50% 0; }

  .assistant-panel { animation: panel-bloom var(--dur-3) var(--ease-out) both; transform-origin: 100% 100%; }
  .assistant-mascot { animation: assistant-rise calc(var(--dur-3) * 2) var(--ease-out) both; }



  .spot-cloud { animation: spot-drift 13s var(--ease-silk) infinite alternate; }
  .spot-cloud-slow { animation: spot-drift 17s var(--ease-silk) -5s infinite alternate-reverse; }
  .spot-hawk { animation: spot-glide 8.5s var(--ease-silk) infinite alternate; }
  .spot-feather { animation: spot-sway 7s var(--ease-silk) infinite alternate; transform-box: fill-box; transform-origin: 20% 70%; }
  .spot-sparkle { animation: star-twinkle 4.2s var(--ease-silk) infinite; }
  .spot-sun { animation: spot-sun-pulse 7s var(--ease-silk) infinite; transform-box: fill-box; transform-origin: center; }
}

@keyframes screen-arrive { from { opacity: 0; transform: translateY(6px); } }
@keyframes sk-breathe { from { background-position: 100% 0; } to { background-position: 0 0; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(10px) scale(0.97); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes panel-bloom { from { opacity: 0; transform: translateY(10px) scale(0.96); } }
@keyframes assistant-rise { from { opacity: 0; transform: translateY(14%) scale(0.9); } }
@keyframes star-twinkle { 0%, 100% { opacity: 0.3; } 50% { opacity: 0.95; } }
@keyframes spot-drift { from { transform: translateX(-4px); } to { transform: translateX(5px); } }
@keyframes spot-glide { from { transform: translate(-3px, 2px); } to { transform: translate(4px, -3px); } }
@keyframes spot-sway { from { transform: rotate(-4deg); } to { transform: rotate(5deg); } }
@keyframes spot-sun-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.045); } }
@keyframes crest-cover-draw { from { opacity: 0; transform: scaleX(0.04); } 30% { opacity: 1; } to { opacity: 1; transform: none; } }
@keyframes crest-open-l { from { opacity: 0; transform: rotate(16deg) scaleX(0.12); } 35% { opacity: 1; } to { opacity: 1; transform: none; } }
@keyframes crest-open-r { from { opacity: 0; transform: rotate(-16deg) scaleX(0.12); } 35% { opacity: 1; } to { opacity: 1; transform: none; } }
@keyframes crest-grow { from { transform: scale(0.93); } to { transform: none; } }
@keyframes crest-draw { from { stroke-dashoffset: 1.25; } to { stroke-dashoffset: 0; } }
@keyframes crest-draw-all { from { opacity: 0; } to { opacity: 1; } }
@keyframes crest-sparkle-in { from { opacity: 0; transform: scale(0) rotate(-90deg); } 60% { opacity: 1; transform: scale(1.35) rotate(8deg); } to { opacity: 1; transform: none; } }
@keyframes crest-twinkle { 0%, 62%, 100% { opacity: 1; transform: none; } 76% { opacity: 0.25; transform: scale(0.55) rotate(45deg); } 88% { opacity: 1; transform: scale(1.18); } }
@keyframes crest-breath-l { 0%, 46%, 100% { transform: none; } 20% { transform: rotate(-1.1deg) scale(1.012); } }
@keyframes crest-breath-r { 0%, 46%, 100% { transform: none; } 20% { transform: rotate(1.1deg) scale(1.012); } }
@keyframes crest-breath-spire { 0%, 48%, 100% { transform: none; } 22% { transform: translateY(-3px) scaleY(1.014); } }
@keyframes crest-page-breath-l { 0%, 6%, 52%, 100% { transform: none; } 26% { transform: rotate(1.3deg); } }
@keyframes crest-page-breath-r { 0%, 6%, 52%, 100% { transform: none; } 26% { transform: rotate(-1.3deg); } }
@keyframes crest-sheen { 0%, 60% { opacity: 0; transform: none; } 61% { opacity: 1; transform: translateX(60px); } 69% { opacity: 1; transform: translateX(720px); } 70%, 100% { opacity: 0; transform: translateX(780px); } }
@keyframes crest-sheen-once { from { opacity: 0; transform: none; } 8% { opacity: 1; } 92% { opacity: 1; } to { opacity: 0; transform: translateX(780px); } }
@keyframes crest-page-turn {
  0% { opacity: 0; transform: none; }
  4% { opacity: 1; transform: none; }
  13% { opacity: 1; transform: translateY(-2px) scale(0.978, 1.05); }
  24% { opacity: 1; transform: translateY(-6px) scale(0.707, 1.18); }
  35% { opacity: 1; transform: translateY(-8px) scale(0.02, 1.25); }
  46% { opacity: 1; transform: translateY(-6px) scale(-0.707, 1.18); }
  57% { opacity: 1; transform: translateY(-2px) scale(-0.978, 1.05); }
  64% { opacity: 1; transform: scale(-1, 1); }
  70%, 100% { opacity: 0; transform: scale(-1, 1); }
}
@keyframes feather-fall {
  0% { opacity: 0; transform: translate(10px, -24px) rotate(-24deg); }
  45% { opacity: 1; transform: translate(-4px, -9px) rotate(14deg); }
  75% { transform: translate(2px, -3px) rotate(-6deg); }
  100% { transform: none; }
}

/* ---------- Print: clean ink-saving lists without navigation, canvas, assistant or scenery ---------- */
@media print {
  body { background: #fff; font-size: 12pt; }
  .shell { display: block; }
  .shell-main { background: none; }
  .sky-live, .sky-backdrop, .assistant, .rail, .toasts, .dialog, .btn, .toolbar, .chips, .skip, .no-print { display: none !important; }
  .main { max-width: none; padding: 0; }
  .panel, .loan, .table-wrap, .stat { box-shadow: none; border-color: #999; background: #fff; break-inside: avoid; }
  .empty-art { display: none; }
  .table th { background: none; }
  a { color: inherit; text-decoration: none; }
}
