/* Spyder Apps: one stylesheet for the portal and Settings, in the Spyder KPI dashboard's design language:
   Outfit, navy inks, a white page, white cards with a hairline and a soft blue-grey shadow, pill controls,
   and no movement on hover (colour and shadow change only).
   The page is white with one soft tint bleeding down from the top; each season sets that tint and draws
   one scene under the logo. Theme: <html data-theme="light|dark">. Season: <html data-season="...">.
   data-holiday="christmas" (winter, in December) adds Santa beside the logo. */

/* Outfit (SIL Open Font License, see assets/fonts/OFL.txt), served from the portal itself.
   One variable file covers every weight; latin-ext only loads if a name needs it. */
@font-face {
  font-family: "Outfit"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/outfit-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Outfit"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/outfit-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --font: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --page: #ffffff;
  --bleed: #eef4fa;
  --surface: #ffffff;
  --surface-2: #eef4fa;
  --surface-3: #e2eaf3;
  --ink: #0c1a2c;
  --ink-2: #41566c;
  --ink-3: #5c7187;
  --hair: rgba(12, 26, 44, 0.06);
  --line: rgba(12, 26, 44, 0.08);
  --line-strong: rgba(12, 26, 44, 0.16);
  --field: #ffffff;
  --field-line: #8293a5;
  --accent: #4063f0;
  --accent-hover: #2744b4;
  --accent-bg: #e5efff;
  --accent-text: #3052d6;
  --seg-on: #0f172a;
  --seg-on-fg: #ffffff;
  --primary: #4063f0;
  --primary-hover: #2c4dcc;
  --on-primary: #ffffff;
  --focus: rgba(64, 99, 240, 0.22);
  --overlay: rgba(12, 26, 44, 0.32);
  --hover: rgba(12, 26, 44, 0.035);
  --tip-bg: #0c1a2c;
  --tip-fg: #f6f9fc;

  --danger: #cb2348; --danger-bg: #fdeef1; --danger-solid: #cb2348; --danger-solid-fg: #fff;

  --sh-1: 0 1px 2px rgba(12, 26, 44, 0.05);
  --sh-card: 0 1px 2px rgba(22, 56, 100, 0.05), 0 6px 24px rgba(22, 56, 100, 0.06);
  --sh-card-hover: 0 1px 2px rgba(22, 56, 100, 0.06), 0 10px 32px rgba(22, 56, 100, 0.11);
  --sh-menu: 0 14px 40px rgba(22, 56, 100, 0.16);

  --dur: 0.16s;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --gutter: max(16px, env(safe-area-inset-left, 0px));
  color-scheme: light dark;
}
:root[data-theme="light"] { color-scheme: light; }

:root[data-theme="dark"] {
  --page: #0b1120;
  --bleed: #121d33;
  --surface: #182c3e;
  --surface-2: #22384e;
  --surface-3: #2c4258;
  --ink: #eff4f9;
  --ink-2: #bfcad6;
  --ink-3: #a1b0bf;
  --hair: rgba(226, 232, 240, 0.07);
  --line: rgba(226, 232, 240, 0.13);
  --line-strong: rgba(226, 232, 240, 0.22);
  --field: #12202f;
  --field-line: #6c8196;
  --accent: #6993fa;
  --accent-hover: #99b8fd;
  --accent-bg: #273d6f;
  --accent-text: #99b8fd;
  --seg-on: #eff4f9;
  --seg-on-fg: #0c1a29;
  --primary: #6993fa;
  --primary-hover: #99b8fd;
  --on-primary: #0b1120;
  --focus: rgba(105, 147, 250, 0.35);
  --overlay: rgba(0, 0, 0, 0.55);
  --hover: rgba(255, 255, 255, 0.045);
  --tip-bg: #2c4054;
  --danger: #ff8aa3; --danger-bg: #3b1824; --danger-solid: #8c1d36; --danger-solid-fg: #ffe4ea;
  --sh-1: 0 1px 2px rgba(0, 0, 0, 0.3);
  --sh-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 28px rgba(0, 0, 0, 0.28);
  --sh-card-hover: 0 1px 2px rgba(0, 0, 0, 0.35), 0 12px 36px rgba(0, 0, 0, 0.4);
  --sh-menu: 0 16px 44px rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}

/* Seasons only change the tint at the top of the page (and the scene). Winter's is the dashboard's blue. */
:root[data-season="spring"] { --bleed: #f4f9f5; }
:root[data-season="summer"] { --bleed: #fdf9ef; }
:root[data-season="autumn"] { --bleed: #fcf5ef; }
:root[data-season="winter"] { --bleed: #f0f5fd; }
:root[data-season="spring"][data-theme="dark"] { --bleed: #0e1a1b; }
:root[data-season="summer"][data-theme="dark"] { --bleed: #171719; }
:root[data-season="autumn"][data-theme="dark"] { --bleed: #18151a; }
:root[data-season="winter"][data-theme="dark"] { --bleed: #0e182a; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--page); }
body {
  margin: 0; min-height: 100vh; color: var(--ink);
  background: linear-gradient(180deg, var(--bleed) 0%, var(--page) 100%) no-repeat, var(--page);
  font: 0.875rem/1.5 var(--font); font-variant-numeric: tabular-nums; font-size-adjust: 0.483; /* Outfit's own x-height: Outfit is unchanged, a fallback font is matched to it */
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overflow-x: clip;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
svg.i { width: 18px; height: 18px; flex-shrink: 0; display: block; }

/* ---------- Page frame and top row ---------- */
.wrap { max-width: 1320px; margin: 0 auto; padding-block: 28px 96px; padding-left: var(--gutter); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
@media (min-width: 900px) { .wrap { padding-left: 48px; padding-right: 48px; } }
.brandline { position: relative; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 44px; }
.brand {
  display: inline-flex; align-items: center; gap: 14px; padding: 6px 8px; margin: -6px -8px; border: 0; background: none; border-radius: 10px;
  cursor: pointer; text-decoration: none; color: var(--ink); touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.brand img { width: 132px; height: auto; }
.brand .logo-dark { display: none; }
:root[data-theme="dark"] .brand .logo-light { display: none; }
:root[data-theme="dark"] .brand .logo-dark { display: block; }
.brand .custom-logo { height: 32px; width: auto; }
@media (max-width: 760px) { .brand img { width: 110px; } }
.preview-banner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 12px; padding: 8px 16px;
  background: var(--tip-bg); color: var(--tip-fg); font-size: 0.8125rem; text-align: center;
}
.preview-banner button { border: 0; background: rgba(255, 255, 255, 0.14); color: inherit; border-radius: 999px; padding: 3px 11px; font-size: 0.75rem; cursor: pointer; }

/* Top controls: round icons like the dashboard header, plus a pill search button. */
.dock { display: flex; align-items: center; gap: 4px; }
.dock-sep { width: 1px; height: 20px; margin: 0 6px; background: var(--line); }
.dock-item { position: relative; }
.dock-btn {
  position: relative; display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 999px;
  background: transparent; color: var(--ink-3); cursor: pointer; text-decoration: none;
  transition: background-color var(--dur) ease, color var(--dur) ease, box-shadow var(--dur) ease;
}
.dock-btn:hover, .dock-btn[aria-expanded="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line), var(--sh-1); }
.dock-btn svg.i { width: 20px; height: 20px; }
.dock-btn .tip {
  position: absolute; top: calc(100% + 8px); left: 50%; translate: -50% 0; z-index: 2; padding: 5px 9px; border-radius: 8px;
  background: var(--tip-bg); color: var(--tip-fg); font-size: 0.75rem; white-space: nowrap; opacity: 0; visibility: hidden;
  transition: opacity var(--dur) ease, visibility 0s linear var(--dur);
}
.dock-btn .tip::before { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 8px; }
.dock-btn:hover .tip, .dock-btn:focus-visible .tip { opacity: 1; visibility: visible; transition-delay: 0s; }
.dock-btn.tip-off .tip { opacity: 0; visibility: hidden; }
.dock-btn[aria-expanded="true"] .tip { display: none; }

.pop {
  position: absolute; z-index: 40; right: 0; top: calc(100% + 10px); width: 256px; padding: 6px;
  background: var(--surface); border-radius: 14px; box-shadow: 0 0 0 1px var(--line), var(--sh-menu);
  opacity: 0; visibility: hidden; pointer-events: none; transition: opacity var(--dur) ease;
}
.pop.open { opacity: 1; visibility: visible; pointer-events: auto; }
.pop .pop-h { margin: 6px 10px 4px; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.pop [role="group"] + [role="group"] .pop-h { margin-top: 10px; }
@media (max-width: 480px) { .dock { position: relative; } .dock-item { position: static; } .pop { right: 0; max-width: calc(100vw - 32px); } }
.pop .pop-link { display: flex; align-items: center; justify-content: space-between; margin: 6px 2px 0; padding: 9px 10px 4px; border-top: 1px solid var(--hair); font-size: 0.8125rem; color: var(--ink-2); text-decoration: none; }
.pop .pop-link:hover { color: var(--accent-text); }
.opt {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 38px; padding: 0 10px; border: 0; border-radius: 9px;
  background: transparent; color: var(--ink); font-size: 0.8438rem; text-align: left; cursor: pointer; transition: background-color var(--dur) ease;
}
.opt:hover { background: var(--hover); }
.opt svg.i { width: 18px; height: 18px; color: var(--ink-3); }
.opt small, .opt .now { margin-left: 4px; color: var(--ink-3); }
.opt .check { margin-left: auto; opacity: 0; color: var(--accent); }
.opt[aria-checked="true"] .check { opacity: 1; }

/* ---------- Department row ---------- */
.depts { margin-top: 76px; }
.dept-row { display: flex; gap: 4px; overflow-x: auto; padding: 4px 2px 8px; margin: -4px -2px; }
@media (pointer: coarse) { .dept-row { scrollbar-width: none; } .dept-row::-webkit-scrollbar { display: none; } }
.dept {
  --c: #41566c;
  width: 86px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 6px 2px;
  border: 0; border-radius: 14px; background: transparent; color: var(--ink); cursor: pointer;
}
.dept .ico {
  width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center;
  background: var(--surface); color: color-mix(in srgb, var(--c) 72%, #5c7187);
  box-shadow: inset 0 0 0 1px var(--line), var(--sh-1);
  transition: background-color var(--dur) ease, color var(--dur) ease, box-shadow var(--dur) ease;
}
:root[data-theme="dark"] .dept .ico { color: color-mix(in srgb, var(--c) 45%, #dce5ee); }
.dept .ico svg.i { width: 24px; height: 24px; }
.dept.all .ico { color: var(--ink-2); }
.dept .name { font-size: 0.7812rem; line-height: 1.25; text-align: center; color: var(--ink-3); transition: color var(--dur) ease; }
.dept:hover .ico { box-shadow: inset 0 0 0 1px var(--line-strong), var(--sh-card); }
.dept:hover .name { color: var(--ink); }
.dept[aria-pressed="true"] .ico { background: var(--seg-on); color: var(--seg-on-fg); box-shadow: 0 6px 16px -8px rgba(12, 26, 44, 0.5); }
.dept[aria-pressed="true"] .name { color: var(--ink); font-weight: 500; }

/* ---------- Results heading ---------- */
.results-head { display: flex; align-items: baseline; gap: 10px; margin: 32px 0 16px; }
.results-head h2 { margin: 0; font-size: 1.125rem; font-weight: 600; letter-spacing: -0.01em; }
.results-head .count { font-size: 0.8125rem; color: var(--ink-3); }

/* ---------- Shared app pieces ---------- */
.app-ico {
  display: grid; place-items: center; flex-shrink: 0; border-radius: 50%; font-weight: 600;
  background: color-mix(in srgb, var(--c) 12%, var(--surface)); color: color-mix(in srgb, var(--c) 82%, #0c1a2c);
}
:root[data-theme="dark"] .app-ico { background: color-mix(in srgb, var(--c) 26%, var(--surface)); color: color-mix(in srgb, var(--c) 40%, #fff); }
.round-open {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  background: var(--surface-2); color: var(--ink-2); transition: background-color var(--dur) ease, color var(--dur) ease;
}
.round-open svg.i { width: 15px; height: 15px; }

/* ---------- View: cards (compact) ---------- */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(224px, 1fr)); gap: 26px 24px; }
.card {
  position: relative; display: flex; flex-direction: column; min-width: 0; padding: 7px;
  background: var(--surface); border-radius: 20px; box-shadow: inset 0 0 0 1px var(--line), var(--sh-card);
  transition: box-shadow var(--dur) ease;
}
.card:hover { box-shadow: inset 0 0 0 1px var(--line-strong), var(--sh-card-hover); }
.card.featured { box-shadow: inset 0 0 0 1px rgba(64, 99, 240, 0.32), var(--sh-card); }
.card.featured:hover { box-shadow: inset 0 0 0 1px rgba(64, 99, 240, 0.45), var(--sh-card-hover); }
.card:hover .round-open, .row:hover .round-open { background: var(--seg-on); color: var(--seg-on-fg); }
.open-link { color: inherit; text-decoration: none; }
.open-link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.open-link:focus-visible { outline: none; }
.card:has(.open-link:focus-visible), .row:has(.open-link:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.cover {
  position: relative; height: 124px; padding: 14px 14px 0; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden;
  border-radius: 15px; background: color-mix(in srgb, var(--c) 6%, var(--surface-2));
}
:root[data-theme="dark"] .cover { background: color-mix(in srgb, var(--c) 14%, var(--surface-2)); }
.cover .shot {
  height: 100%; width: 100%; object-fit: cover; object-position: top left; border-radius: 8px 8px 0 0; background: #fff;
  box-shadow: 0 0 0 1px rgba(12, 26, 44, 0.05), 0 -2px 12px -4px rgba(22, 56, 100, 0.14);
}
.cover.empty { justify-content: center; align-items: center; padding: 0; }
.cover.empty .app-ico { width: 54px; height: 54px; border-radius: 17px; font-size: 1.125rem; }
.card-body { display: flex; flex-direction: column; gap: 4px; flex: 1; padding: 14px 12px 12px; }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.card-dept { font-size: 0.75rem; color: var(--ink-3); }
.card h3 { margin: 0; font-size: 0.9375rem; line-height: 1.3; font-weight: 600; letter-spacing: -0.005em; }
.card p.desc { margin: 2px 0 0; font-size: 0.7812rem; line-height: 1.44; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .round-open { margin-top: 2px; }

/* ---------- View: list ---------- */
.list { background: var(--surface); border-radius: 20px; box-shadow: inset 0 0 0 1px var(--line), var(--sh-card); padding: 6px; }
.row {
  position: relative; display: grid; grid-template-columns: 56px minmax(0, 2.6fr) minmax(0, 1fr) auto; align-items: center; gap: 16px;
  padding: 8px 10px 8px 8px; border-radius: 14px; transition: background-color var(--dur) ease;
}
.row + .row { box-shadow: 0 -1px 0 var(--hair); }
.row:hover { background: var(--hover); }
.thumb { width: 56px; height: 36px; border-radius: 8px; overflow: hidden; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 7%, var(--surface-2)); }
.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.thumb .app-ico { width: 24px; height: 24px; border-radius: 8px; font-size: 0.5938rem; }
.row .main { min-width: 0; }
.row .main strong { display: block; font-size: 0.875rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .main span { display: block; font-size: 0.7812rem; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .dept-name { font-size: 0.7812rem; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) { .row { grid-template-columns: 52px minmax(0, 1fr) auto; gap: 12px; } .row .thumb { width: 52px; } .row .dept-name { display: none; } }

/* ---------- View: launcher ---------- */
.launcher { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 10px 6px; }
.tile {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 9px; padding: 14px 6px 12px;
  border-radius: 18px; text-decoration: none; color: var(--ink); text-align: center; transition: background-color var(--dur) ease, box-shadow var(--dur) ease;
}
.tile:hover { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line), var(--sh-card); }
.tile .app-ico { width: 60px; height: 60px; border-radius: 19px; font-size: 1.1875rem; box-shadow: inset 0 0 0 1px var(--line); }
.tile.featured .app-ico { box-shadow: inset 0 0 0 1.5px rgba(64, 99, 240, 0.45); }
.tile .nm { font-size: 0.7812rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Search palette ---------- */
.palette {
  width: min(600px, calc(100vw - 32px)); margin: min(14vh, 120px) auto auto; padding: 0; border: 0; border-radius: 20px;
  background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line), var(--sh-menu); overflow: hidden;
  opacity: 0; transition: opacity 0.18s ease, overlay 0.18s, display 0.18s; transition-behavior: allow-discrete;
}
.palette[open] { opacity: 1; }
@starting-style { .palette[open] { opacity: 0; } }
.palette::backdrop { background: var(--overlay); opacity: 0; transition: opacity 0.18s ease, overlay 0.18s, display 0.18s; transition-behavior: allow-discrete; }
.palette[open]::backdrop { opacity: 1; }
@starting-style { .palette[open]::backdrop { opacity: 0; } }
.palette-input { display: flex; align-items: center; gap: 12px; padding: 0 18px; min-height: 58px; border-bottom: 1px solid var(--hair); color: var(--ink-3); }
.palette-input input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 1rem; }
.palette-input input::placeholder { color: var(--ink-3); }
.palette-input:has(input:focus) { outline: 2px solid var(--accent); outline-offset: -4px; border-radius: 18px 18px 0 0; }
.palette-ico { display: grid; place-items: center; color: var(--ink-3); }
.palette-close { display: grid; place-items: center; padding: 4px; border: 0; border-radius: 8px; background: transparent; color: inherit; cursor: pointer; }
.palette-close:hover kbd { background: var(--surface-3); color: var(--ink); }
.palette-input kbd { font: 500 0.6875rem var(--font); color: var(--ink-3); background: var(--surface-2); border-radius: 6px; padding: 2px 7px; }
.palette-list { max-height: min(56vh, 440px); overflow-y: auto; padding: 6px; }
.palette-label { margin: 8px 10px 4px; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.hit { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; text-decoration: none; color: var(--ink); }
.hit .thumb { width: 48px; height: 30px; border-radius: 6px; }
.hit .thumb .app-ico { width: 20px; height: 20px; border-radius: 6px; font-size: 0.5rem; }
.hit .txt { flex: 1; min-width: 0; }
.hit strong { display: block; font-size: 0.875rem; font-weight: 500; }
.hit small { display: block; font-size: 0.75rem; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hit .go { display: grid; place-items: center; color: var(--ink-3); opacity: 0; }
.hit[aria-selected="true"] { background: var(--surface-2); }
.hit[aria-selected="true"] .go { opacity: 1; }
.palette-empty { padding: 32px 20px; text-align: center; color: var(--ink-2); }
.palette-foot { display: flex; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--hair); font-size: 0.75rem; color: var(--ink-3); }
.palette-foot kbd { font: 500 0.6875rem var(--font); background: var(--surface-2); border-radius: 5px; padding: 1px 6px; margin-right: 4px; }
@media (max-width: 600px) { .palette-foot { display: none; } }

/* ---------- Empty, loading, motion ---------- */
.empty-state {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 56px 24px; text-align: center;
  background: var(--surface); border-radius: 20px; box-shadow: inset 0 0 0 1px var(--line), var(--sh-card);
}
.empty-state .art { width: 56px; height: 56px; border-radius: 17px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-3); margin-bottom: 6px; }
.empty-state .art svg.i { width: 26px; height: 26px; }
.empty-state h3 { margin: 0; font-size: 1.125rem; font-weight: 600; }
.empty-state p { margin: 0 0 8px; color: var(--ink-2); max-width: 44ch; }
.skeleton { border-radius: 20px; background: linear-gradient(100deg, var(--surface-2) 40%, var(--surface) 50%, var(--surface-2) 60%); background-size: 200% 100%; }
@media (prefers-reduced-motion: no-preference) { .skeleton { animation: shimmer 1.4s ease infinite; } }
@keyframes shimmer { to { background-position: -200% 0; } }
.rise { animation: fadein 0.2s ease backwards; }
@media (prefers-reduced-motion: no-preference) { .rise { animation: rise 0.24s ease backwards; } }
.swap { animation: fadein 0.14s ease backwards; }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.fade-in { animation: fadein 0.25s ease backwards; }
@keyframes fadein { from { opacity: 0; } }

/* ---------- Buttons (the dashboard's: no movement on hover) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink);
  font-size: 0.8125rem; font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color var(--dur) ease, border-color var(--dur) ease, color var(--dur) ease;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-bg); }
.btn.danger-solid, .btn.danger-solid:hover { background: var(--danger-solid); border-color: var(--danger-solid); color: var(--danger-solid-fg); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.small { min-height: 32px; padding: 0 12px; font-size: 0.7812rem; }
.btn[disabled] { opacity: 0.5; pointer-events: none; }
.btn svg.i { width: 16px; height: 16px; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; z-index: 100; left: 50%; top: 20px; translate: -50% 0; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast-stack { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.toast { display: flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 999px; background: var(--tip-bg); color: var(--tip-fg); font-size: 0.8125rem; box-shadow: var(--sh-menu); animation: fadein 0.2s ease backwards; pointer-events: auto; }
.toast.err { background: var(--danger); color: #fff; }
:root[data-theme="dark"] .toast.err { background: #8c1d36; color: #ffe4ea; }
.toast.err { padding-right: 8px; }
.toast-x { display: grid; place-items: center; width: 26px; height: 26px; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; }
.toast-x:hover { background: rgba(255, 255, 255, 0.18); }
.toast-x svg.i { width: 14px; height: 14px; }
.toast.out { opacity: 0; transition: opacity 0.25s ease; }

/* ---------- Seasonal scenes (visible, but soft) ---------- */
.season-art, .season-fx, .santa { display: none; pointer-events: none; }
@media screen {
  :root[data-season] .season-art { display: block; position: relative; z-index: 0; height: 0; }
  :root[data-holiday="christmas"] .santa { display: block; }
}
.season-art svg { position: absolute; top: 8px; left: calc(50% - 50vw); display: block; width: 100vw; height: 76px; -webkit-mask-image: linear-gradient(#000 62%, transparent 100%); mask-image: linear-gradient(#000 62%, transparent 100%); }
:root[data-season="winter"] { --sa-far: #dbe7f6; --sa-near: #f4f8fd; --sa-a: #bccee4; --sa-b: #cddbeb; }
:root[data-season="spring"] {
  --sa-far: #dcedd9; --sa-near: #eaf5e7; --sa-stem: #b2d0ad; --sa-leaf: #c4dfbf;
  --fl-white: #ffffff; --fl-edge: #d6e6d3; --fl-yellow: #f1dc97; --fl-pink: #f3d4dd; --fl-peach: #f5e0cf; --fl-lilac: #e3daf1; --fl-blue: #d4e0f3; --fl-vein: #cbbfe3;
}
:root[data-season="summer"] { --sa-far: #d4e8f3; --sa-near: #e8f3f9; --sa-a: #c0dcec; --sa-b: #d6eaf5; --sa-sun: #f6e2ae; }
:root[data-season="autumn"] { --sa-far: #f2e2d4; --sa-near: #f9eee5; --sa-a: #edc9ae; --sa-b: #e8bc9e; --sa-c: #f0dcb4; --sa-stem: #d6c0ae; }
:root[data-season][data-theme="dark"] {
  --sa-far: color-mix(in srgb, var(--bleed), #fff 6%); --sa-near: color-mix(in srgb, var(--bleed), #fff 11%);
  --sa-a: color-mix(in srgb, var(--bleed), #fff 16%); --sa-b: color-mix(in srgb, var(--bleed), #fff 12%); --sa-c: color-mix(in srgb, var(--bleed), #fff 14%);
  --sa-stem: color-mix(in srgb, var(--bleed), #fff 18%); --sa-leaf: color-mix(in srgb, var(--bleed), #fff 14%); --sa-sun: color-mix(in srgb, var(--bleed), #f6e2ae 35%);
  --fl-white: color-mix(in srgb, var(--bleed), #fff 55%); --fl-edge: transparent; --fl-yellow: color-mix(in srgb, var(--bleed), #f1dc97 45%);
  --fl-pink: color-mix(in srgb, var(--bleed), #f3d4dd 40%); --fl-peach: color-mix(in srgb, var(--bleed), #f5e0cf 40%); --fl-lilac: color-mix(in srgb, var(--bleed), #e3daf1 40%);
  --fl-blue: color-mix(in srgb, var(--bleed), #d4e0f3 40%); --fl-vein: transparent;
}
:root[data-season="autumn"][data-theme="dark"] { --sa-a: color-mix(in srgb, var(--bleed), #edc9ae 28%); --sa-b: color-mix(in srgb, var(--bleed), #e8bc9e 24%); --sa-c: color-mix(in srgb, var(--bleed), #f0dcb4 24%); }
.season-art .far { fill: var(--sa-far); } .season-art .near { fill: var(--sa-near); }
.season-art .a { fill: var(--sa-a); } .season-art .b { fill: var(--sa-b); } .season-art .c { fill: var(--sa-c); }
.season-art .stem { fill: none; stroke: var(--sa-stem); stroke-width: 0.7; stroke-linecap: round; }
.season-art .leaf { fill: var(--sa-leaf); }
.season-art .p-white { fill: var(--fl-white); stroke: var(--fl-edge); stroke-width: 0.25; }
.season-art .p-yellow { fill: var(--fl-yellow); } .season-art .p-pink { fill: var(--fl-pink); } .season-art .p-peach { fill: var(--fl-peach); }
.season-art .p-lilac { fill: var(--fl-lilac); } .season-art .p-blue { fill: var(--fl-blue); }
.season-art .vein { fill: none; stroke: var(--fl-vein); stroke-width: 0.3; }
.season-art .sun { fill: var(--sa-sun); opacity: 0.8; }
.season-art .ray { fill: none; stroke: var(--sa-sun); stroke-width: 0.7; stroke-linecap: round; opacity: 0.7; }
.season-art .boat { position: absolute; top: 47px; left: calc(50% - 50vw + 34vw); width: 18px; height: 16px; will-change: transform; }
.season-art .boat svg { position: static; width: 18px; height: 16px; -webkit-mask-image: none; mask-image: none; transform-origin: 50% 90%; transform: scale(calc(var(--s, 1) * var(--flip, 1)), var(--s, 1)); }
.season-art .boat-bob { transform-origin: 50% 90%; }
@media (prefers-reduced-motion: no-preference) { .season-art .boat-bob { animation: boat-bob 6s ease-in-out infinite; } }
@keyframes boat-bob { 0%, 100% { transform: translateY(0) rotate(-1.4deg); } 50% { transform: translateY(0.7px) rotate(1.4deg); } }
.season-art .boat .hull { fill: #9cb1c6; }
.season-art .boat .stripe { fill: none; stroke: #b9c9d9; stroke-width: 1.2; }
.season-art .boat .sail { fill: #ffffff; stroke: #d0dce8; stroke-width: 1; stroke-linejoin: round; }
.season-art .boat .jib { fill: #f6f9fc; }
.season-art .boat .mast { fill: none; stroke: #a3b2c1; stroke-width: 1.4; }
.season-art .boat .flag { fill: #eebcb2; }
:root[data-theme="dark"] .season-art .boat { opacity: 0.8; }
:root[data-theme="dark"] .season-art .boat .hull { fill: #5f7690; }
:root[data-theme="dark"] .season-art .boat .sail { fill: #d9e2ec; stroke: none; }
.depts, .results-head, #results, .page-head, .settings-layout { position: relative; z-index: 1; }
.season-fx { position: fixed; inset: 0; z-index: 25; width: 100%; height: 100%; }
:root[data-season] .season-fx { display: block; }
.season-fx.out { opacity: 0; transition: opacity 0.8s ease; }

/* Hidden moments: spring's hummingbird (summer's wave lives inside the scene) */
.egg { position: fixed; left: 0; top: 0; z-index: 26; pointer-events: none; will-change: transform; }
.egg svg { display: block; overflow: visible; }
/* Each wing beats from its own shoulder, smoothly, in step with the other. */
.egg .wing-f { transform-box: view-box; transform-origin: 466px 214px; }
.egg .wing-b { transform-box: view-box; transform-origin: 372px 124px; }
@media (prefers-reduced-motion: no-preference) {
  .egg .wing-f { animation: wing-f 0.16s ease-in-out infinite alternate; }
  .egg .wing-b { animation: wing-b 0.16s ease-in-out infinite alternate; }
}
@keyframes wing-f { from { transform: rotate(-12deg); } to { transform: rotate(24deg) scaleY(0.8); } }
@keyframes wing-b { from { transform: rotate(8deg); } to { transform: rotate(-20deg); } }
:root[data-theme="dark"] .egg.bird svg { opacity: 0.85; }
.egg.out { opacity: 0; transition: opacity 0.9s ease; }

:root[data-holiday="christmas"] {
  --sm-red: #c2414b; --sm-skin: #f3cfae; --sm-white: #fff; --sm-edge: rgba(40, 70, 105, 0.4);
  --sm-eye: #22364d; --sm-sleigh: #35506e; --sm-deer: #6f8196; --sm-sack: #8fa1b4; --sm-spark: #fff;
}
:root[data-holiday="christmas"][data-theme="dark"] { --sm-red: #e0656d; --sm-white: #f4f8fc; --sm-edge: rgba(0, 0, 0, 0.35); --sm-sleigh: #a9bdd2; --sm-deer: #8499ae; --sm-sack: #62778c; --sm-spark: #dbe9f7; }
.santa { height: 26px; width: auto; aspect-ratio: 84 / 30; overflow: visible; }
.santa .r { fill: var(--sm-red); } .santa .sk { fill: var(--sm-skin); } .santa .w { fill: var(--sm-white); stroke: var(--sm-edge); stroke-width: 0.3; }
.santa .brim { fill: none; stroke: var(--sm-white); stroke-width: 1.3; stroke-linecap: round; }
.santa .arm { fill: none; stroke: var(--sm-red); stroke-width: 1.7; stroke-linecap: round; }
.santa .eye { fill: var(--sm-eye); } .santa .sl { fill: var(--sm-sleigh); }
.santa .run { fill: none; stroke: var(--sm-sleigh); stroke-width: 1.1; stroke-linecap: round; stroke-linejoin: round; }
.santa .sack { fill: var(--sm-sack); } .santa .fur { fill: var(--sm-deer); }
.santa .legs, .santa .neck, .santa .ant { fill: none; stroke: var(--sm-deer); stroke-linecap: round; stroke-linejoin: round; }
.santa .legs { stroke-width: 1.1; } .santa .neck { stroke-width: 2.3; } .santa .ant { stroke-width: 0.75; }
.santa .tail { fill: var(--sm-white); } .santa .rein { fill: none; stroke: var(--sm-deer); stroke-width: 0.55; opacity: 0.85; }
.santa .spark { fill: var(--sm-spark); }
.santa .team { transform-box: view-box; transform-origin: 39px 22px; transform: translate(0, -4.5px) rotate(-6deg); }
.santa .bob { transform-box: view-box; transform-origin: 39px 22px; }
@media (prefers-reduced-motion: no-preference) { .santa .bob { animation: sm-bob 7s ease-in-out infinite; } }
@keyframes sm-bob { 0%, 100% { transform: translate(0, 0) rotate(0); } 25% { transform: translate(0.9px, -1.1px) rotate(-1.1deg); } 50% { transform: translate(0, -0.2px) rotate(0); } 75% { transform: translate(-0.9px, 0.9px) rotate(1deg); } }
.santa .trail circle { opacity: 0.6; }
@media (prefers-reduced-motion: no-preference) { .santa .trail circle { animation: sm-tw 3.5s ease-in-out infinite; } }
.santa .trail circle:nth-child(2) { animation-delay: -1.2s; } .santa .trail circle:nth-child(3) { animation-delay: -2.3s; }
@keyframes sm-tw { 0%, 100% { opacity: 0.25; } 50% { opacity: 0.9; } }

/* ---------- Settings ---------- */
.page-head { margin-top: 64px; }
.page-head h1 { margin: 0; font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; }
.page-head p { margin: 6px 0 0; color: var(--ink-3); font-size: 0.8438rem; max-width: 60ch; }
.settings-layout { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; margin-top: 24px; }
.side-nav { flex: 1 1 200px; max-width: 220px; display: flex; flex-direction: column; gap: 2px; }
@media (max-width: 860px) { .side-nav { max-width: none; flex-direction: row; overflow-x: auto; flex-basis: 100%; padding-bottom: 4px; } }
@media (max-width: 860px) and (pointer: coarse) { .side-nav { scrollbar-width: none; } }
.side-nav a {
  display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 12px; border-radius: 999px; text-decoration: none;
  color: var(--ink-2); font-size: 0.8438rem; white-space: nowrap; transition: background-color var(--dur), color var(--dur);
}
.side-nav a:hover { color: var(--ink); background: var(--surface); box-shadow: 0 0 0 1px var(--line), var(--sh-1); }
.side-nav a[aria-current="page"] { background: var(--seg-on); color: var(--seg-on-fg); }
.side-nav svg.i { width: 17px; height: 17px; }
.nav-group { margin: 16px 12px 6px; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.nav-group:first-child { margin-top: 0; }
@media (max-width: 860px) { .nav-group { display: none; } }
.panels { flex: 999 1 560px; min-width: 0; }
.panel { background: var(--surface); border-radius: 22px; padding: clamp(18px, 2.5vw, 26px); box-shadow: inset 0 0 0 1px var(--line), var(--sh-card); }
.panel + .panel { margin-top: 16px; }
.panel-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 16px; margin-bottom: 20px; }
.panel-head h2 { margin: 0; font-size: 1.125rem; font-weight: 600; letter-spacing: -0.01em; }
.panel-head p { margin: 4px 0 0; font-size: 0.8125rem; color: var(--ink-3); max-width: 62ch; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 0.8125rem; font-weight: 500; color: var(--ink); }
.field .hint { font-weight: 400; color: var(--ink-3); font-size: 0.75rem; }
.field .err { font-weight: 500; color: var(--danger); font-size: 0.75rem; }
.field .req { color: var(--danger); }
.inline-save { display: flex; gap: 8px; align-items: center; }
.inline-save .select { flex: 1; } .inline-save select { width: 100%; }
.dropzone:has(input:focus-visible), label.btn:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.input, .field select, .field textarea {
  width: 100%; min-height: 40px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--field);
  color: var(--ink); font-size: 0.8438rem; font-weight: 400; transition: border-color var(--dur) ease, box-shadow var(--dur) ease;
}
.field textarea { padding: 10px 14px; line-height: 1.43; resize: vertical; min-height: 64px; }
.input:hover, .field select:hover, .field textarea:hover { border-color: var(--field-line); }
.input:focus, .field select:focus, .field textarea:focus { outline: 2px solid transparent; outline-offset: 2px; border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus); }
.field.invalid .input, .field.invalid textarea { border-color: var(--danger); }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.form-section + .form-section { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--hair); }
.form-section > h3 { margin: 0 0 14px; font-size: 0.875rem; font-weight: 600; }
.search-field { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--field); color: var(--ink-3); }
.search-field input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 0.8125rem; }
.search-field:focus-within { outline: 2px solid transparent; border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus); }
.select { position: relative; display: inline-flex; align-items: center; }
.select select { appearance: none; padding-right: 36px; cursor: pointer; }
.select svg.i { position: absolute; right: 12px; width: 15px; height: 15px; pointer-events: none; color: var(--ink-3); }
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); width: fit-content; max-width: 100%; }
.seg button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 32px; padding: 0 14px;
  border: 0; border-radius: 999px; background: transparent; color: var(--ink-3); font-size: 0.8125rem; cursor: pointer; white-space: nowrap;
  transition: background-color var(--dur) ease, color var(--dur) ease;
}
.seg button svg.i { width: 16px; height: 16px; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--seg-on); color: var(--seg-on-fg); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink-2); font-size: 0.7812rem; cursor: pointer; transition: background-color var(--dur), color var(--dur), border-color var(--dur);
}
.chip:hover { background: var(--surface-2); }
.chip[aria-pressed="true"] { background: var(--seg-on); border-color: var(--seg-on); color: var(--seg-on-fg); }
.chip .x { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: -6px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-3); cursor: pointer; }
.chip .x:hover { background: var(--surface-2); color: var(--ink); }
.chip .x svg.i { width: 13px; height: 13px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--c); cursor: pointer; transition: box-shadow var(--dur); }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }
.icon-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 6px; max-width: 540px; }
.icon-pick button { height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink-2); cursor: pointer; transition: all var(--dur); }
.icon-pick button svg.i { width: 22px; height: 22px; }
.icon-pick button:hover { border-color: var(--line-strong); color: var(--ink); }
.icon-pick button[aria-pressed="true"] { background: var(--seg-on); color: var(--seg-on-fg); border-color: var(--seg-on); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--hair); }
.switch-row:first-child { border-top: 0; padding-top: 0; }
.switch-row strong { display: block; font-size: 0.8438rem; font-weight: 500; }
.switch-row span { display: block; font-size: 0.7812rem; color: var(--ink-3); }
/* A real checkbox (role="switch"), drawn as a switch: the knob is a gradient that slides when checked. */
.switch {
  appearance: none; position: relative; width: 42px; height: 24px; flex-shrink: 0; margin: 0; border: 0; border-radius: 999px; cursor: pointer;
  background: radial-gradient(circle at 12px 50%, #fff 8.5px, transparent 9px) no-repeat var(--surface-3);
  transition: background-color var(--dur) ease, background-position 0.25s var(--ease);
}
.switch:checked { background-color: var(--accent); background-position: 18px 0; }
.switch-row label { cursor: pointer; }

/* Settings: lists */
.app-table, .dept-list, .people { border-radius: 16px; box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.app-row { display: grid; grid-template-columns: 56px minmax(0, 2fr) minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 8px 10px; transition: background-color var(--dur); }
.app-row + .app-row { border-top: 1px solid var(--hair); }
.app-row:hover { background: var(--hover); }
.app-row .thumb { width: 56px; height: 36px; }
.app-row strong { display: flex; align-items: center; gap: 6px; font-size: 0.8438rem; font-weight: 600; overflow: hidden; white-space: nowrap; }
.app-row strong svg.i { width: 13px; height: 13px; color: var(--accent); }
.app-row small { display: block; color: var(--ink-3); font-size: 0.75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-row .muted { font-size: 0.7812rem; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-row .acts { display: flex; gap: 2px; justify-content: flex-end; }
@media (max-width: 760px) { .app-row { grid-template-columns: 48px minmax(0, 1fr) auto; } .app-row .muted { display: none; } }
.dept-item + .dept-item { border-top: 1px solid var(--hair); }
.dept-line { display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 10px; }
.dept-line .ico { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: color-mix(in srgb, var(--c) 72%, #5c7187); flex-shrink: 0; }
:root[data-theme="dark"] .dept-line .ico { color: color-mix(in srgb, var(--c) 45%, #dce5ee); }
.dept-line .ico svg.i { width: 20px; height: 20px; }
.dept-line .nm { flex: 1; min-width: 0; font-size: 0.8438rem; font-weight: 500; }
.dept-line .cnt { font-size: 0.7812rem; color: var(--ink-3); white-space: nowrap; }
.dept-line .acts { display: flex; gap: 2px; }
.dept-editor { padding: 18px; background: var(--surface-2); animation: fadein 0.2s ease; }
.mini-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-3); cursor: pointer; transition: background-color var(--dur), color var(--dur); }
.mini-btn:hover { background: var(--surface-2); color: var(--ink); }
.mini-btn.danger:hover { background: var(--danger-bg); color: var(--danger); }
.mini-btn[disabled] { opacity: 0.3; pointer-events: none; }
.mini-btn svg.i { width: 17px; height: 17px; }
.note { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: 16px; background: var(--surface-2); font-size: 0.8125rem; color: var(--ink-2); }
.note strong { display: block; color: var(--ink); margin-bottom: 2px; font-weight: 600; }
.note .art { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); color: var(--ink-2); box-shadow: var(--sh-1); flex-shrink: 0; }
.person { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 10px 10px 10px 14px; }
.person + .person { border-top: 1px solid var(--hair); }
.person .av { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-size: 0.6875rem; font-weight: 600; color: var(--ink-2); }
.person .who { flex: 1 1 200px; min-width: 0; }
.person .who strong { display: block; font-size: 0.8438rem; font-weight: 500; }
.person .who span { display: block; font-size: 0.75rem; color: var(--ink-3); }
.pill { display: inline-flex; align-items: center; min-height: 24px; padding: 0 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-size: 0.75rem; }
.logo-preview { display: flex; align-items: center; justify-content: center; width: 200px; height: 80px; border-radius: 16px; background: var(--surface-2); padding: 12px; }
.logo-preview img { max-height: 40px; width: auto; }
.logo-preview .logo-dark { display: none; }
:root[data-theme="dark"] .logo-preview .logo-light { display: none; }
:root[data-theme="dark"] .logo-preview .logo-dark { display: block; }

/* Season picker (Settings) */
.season-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin: 0; padding: 0; border: 0; min-inline-size: 0; }
.season-opt {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px 12px 10px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface); color: var(--ink); text-align: left; cursor: pointer; transition: border-color var(--dur), background-color var(--dur);
}
.season-opt:hover { background: var(--hover); }
.season-opt:has(> input:checked) { border-color: var(--seg-on); box-shadow: inset 0 0 0 1px var(--seg-on); }
.season-opt:has(> input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.season-opt .sw { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--sw-bg, var(--surface-2)); color: var(--sw-fg, var(--ink-3)); margin-bottom: 2px; }
.season-opt .sw svg.i { width: 17px; height: 17px; }
.season-opt strong { font-size: 0.8125rem; font-weight: 600; }
.season-opt small { font-size: 0.7188rem; color: var(--ink-3); line-height: 1.35; }
.season-opt[data-s="spring"] { --sw-bg: #ecf6ee; --sw-fg: #4f8a5b; }
.season-opt[data-s="summer"] { --sw-bg: #fdf5e2; --sw-fg: #a5741a; }
.season-opt[data-s="autumn"] { --sw-bg: #fbeee3; --sw-fg: #b0623a; }
.season-opt[data-s="winter"] { --sw-bg: #e6effc; --sw-fg: #3f6aa6; }
:root[data-theme="dark"] .season-opt .sw { background: var(--surface-2); color: var(--ink-2); }

/* Drawer and confirm (native <dialog>) */
dialog { color: var(--ink); }
dialog:modal { overscroll-behavior: contain; }
dialog::backdrop { overflow: hidden; overscroll-behavior: contain; }
.palette-list, .drawer-body { overscroll-behavior: contain; }
.drawer {
  margin: 0 0 0 auto; width: min(1040px, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh; padding: 0; border: 0;
  background: var(--page); box-shadow: -20px 0 60px -20px rgba(12, 26, 44, 0.3);
  opacity: 0; transition: opacity 0.2s ease, overlay 0.2s, display 0.2s; transition-behavior: allow-discrete;
}
.drawer[open] { opacity: 1; display: flex; flex-direction: column; }
@starting-style { .drawer[open] { opacity: 0; } }
.drawer::backdrop { background: var(--overlay); opacity: 0; transition: opacity 0.2s ease, overlay 0.2s, display 0.2s; transition-behavior: allow-discrete; }
.drawer[open]::backdrop { opacity: 1; }
@starting-style { .drawer[open]::backdrop { opacity: 0; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 24px; border-bottom: 1px solid var(--hair); background: var(--surface); }
.drawer-head h2 { margin: 0; font-size: 1.125rem; font-weight: 600; }
.drawer-body { flex: 1; overflow-y: auto; padding: 24px; display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; background: linear-gradient(180deg, var(--bleed), var(--page) 60%); }
.drawer-body form { flex: 999 1 460px; min-width: 0; background: var(--surface); border-radius: 20px; padding: clamp(18px, 2.5vw, 24px); box-shadow: inset 0 0 0 1px var(--line), var(--sh-card); }
.drawer-body aside { flex: 1 1 240px; max-width: 280px; min-width: 0; position: sticky; top: 0; }
.drawer-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 24px; border-top: 1px solid var(--hair); background: var(--surface); }
.drawer-foot .right { display: flex; gap: 8px; margin-left: auto; }
.dialog-msg { flex: 1 1 200px; margin: 0; font-size: 0.8125rem; color: var(--ink-2); }
.dialog-msg.err { color: var(--danger); font-weight: 500; }
.close-btn { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-3); cursor: pointer; transition: background-color var(--dur), color var(--dur); }
.close-btn:hover { background: var(--surface-2); color: var(--ink); }
.dropzone {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 20px; border: 1.5px dashed var(--line-strong); border-radius: 16px;
  background: var(--surface-2); cursor: pointer; transition: border-color var(--dur);
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); }
.dropzone .art { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); color: var(--ink-3); box-shadow: var(--sh-1); }
.dropzone .txt { flex: 1 1 200px; }
.dropzone .txt strong { display: block; font-size: 0.8438rem; font-weight: 500; }
.dropzone .txt span { font-size: 0.75rem; color: var(--ink-3); }
.file-chip { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); }
.file-chip img { width: 72px; height: 42px; object-fit: cover; object-position: top left; border-radius: 6px; }
.file-chip .txt { flex: 1 1 160px; font-size: 0.7812rem; color: var(--ink-2); }
.preview-label { margin: 0 0 10px 4px; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.confirm { width: min(420px, calc(100vw - 32px)); padding: 24px; border: 0; border-radius: 20px; background: var(--surface); box-shadow: 0 0 0 1px var(--line), var(--sh-menu); }
.confirm::backdrop { background: var(--overlay); }
.confirm h2 { margin: 0 0 6px; font-size: 1.125rem; font-weight: 600; }
.confirm p { margin: 0 0 20px; color: var(--ink-2); }
.confirm .btns { display: flex; justify-content: flex-end; gap: 8px; }

@media print { .season-art, .season-fx, .santa, .dock, .egg { display: none !important; } }
@media (forced-colors: active) {
  .season-art, .season-fx, .santa, .egg { display: none !important; }
  [aria-pressed="true"], [aria-checked="true"], .hit[aria-selected="true"], .season-opt:has(> input:checked) { outline: 2px solid Highlight; outline-offset: 1px; }
  .switch { appearance: auto; background: none; width: auto; height: auto; }
}
