/* =========================================================
   奖学金一览 — calendar theme
   Paper, ink, one maple accent. Tear-off date tiles, ruled agenda.
   ========================================================= */

:root {
  --paper: #FAF8F4;
  --paper-2: #F3EFE7;
  --card: #FFFFFF;
  --ink: #1F2A37;
  --ink-2: #4A5462;
  --ink-3: #686D74; /* 4.9:1 on the paper colour: small labels stay readable */
  --line: #E6E0D5;
  --line-2: #D8D0C2;
  --rule: #EFEAE1;
  --accent: #B8432F;
  --accent-soft: #F6E4DF;
  --accent-ink: #8E2F1F;
  --accent-bg: #B8432F; /* filled surfaces with white text: calendar header, primary buttons */
  --green: #3F7A5A;
  --green-soft: #E3EFE7;
  --amber: #8A5F14;
  --amber-soft: #F5EBD8;
  --slate-soft: #ECEAE6;
  --focus: #2F5E8F;
  /* calendar heat: how many deadlines fall on a day */
  --heat-1: color-mix(in srgb, var(--accent) 14%, var(--card));
  --heat-2: color-mix(in srgb, var(--accent) 26%, var(--card));
  --heat-3: color-mix(in srgb, var(--accent) 42%, var(--card));
  --shadow: 0 1px 2px rgba(31, 42, 55, .04), 0 4px 16px rgba(31, 42, 55, .05);
  --shadow-lg: 0 12px 40px rgba(31, 42, 55, .16);
  --serif: "Source Serif 4", "LXGW WenKai", "Kaiti SC", "STKaiti", "KaiTi", Georgia, serif;
  --sans: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --radius: 14px;
  --sidebar-w: 248px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14181D; --paper-2: #1A1F25; --card: #1C2229;
    --ink: #E9E4DA; --ink-2: #B9B3A8; --ink-3: #8B877F;
    --line: #2A3139; --line-2: #38404A; --rule: #232930;
    --accent: #E07A63; --accent-soft: #3A2520; --accent-ink: #F0A592;
    --accent-bg: #B4472F; /* the light accent would make white text faint (5.4:1 here) */
    --green: #7DBE98; --green-soft: #1F3329; --amber: #D8AE62; --amber-soft: #33291A;
    --slate-soft: #252B32; --focus: #8DB7E2;
    --heat-1: color-mix(in srgb, var(--accent) 16%, var(--card));
    --heat-2: color-mix(in srgb, var(--accent) 28%, var(--card));
    --heat-3: color-mix(in srgb, var(--accent) 44%, var(--card));
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-lg: 0 16px 48px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------------- Layout ---------------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100dvh; }
.main { min-width: 0; outline: none; padding: 36px clamp(20px, 3vw, 56px) 140px; }
.wrap { max-width: 1640px; margin: 0 auto; }

/* ---------------- Sidebar ---------------- */
.sidebar { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; padding: 22px 14px 16px; border-right: 1px solid var(--line); background: var(--paper-2); overflow-y: auto; }
.brand { display: flex; gap: 12px; align-items: center; padding: 0 8px 22px; }
.brand-mark { width: 36px; height: 38px; border-radius: 8px; background: var(--card); border: 1px solid var(--line-2); overflow: hidden; display: flex; flex-direction: column; flex: none; box-shadow: var(--shadow); }
.brand-mark i { display: block; background: var(--accent-bg); color: #fff; font: 600 9px/12px var(--sans); text-align: center; font-style: normal; letter-spacing: .04em; }
.brand-mark b { flex: 1; display: grid; place-items: center; font: 700 16px/1 var(--serif); font-variant-numeric: tabular-nums; }
.brand-name { white-space: nowrap; font-family: var(--serif); font-weight: 700; font-size: 17px; letter-spacing: .04em; line-height: 1.25; }
.brand-sub { color: var(--ink-3); font-size: 12.5px; margin-top: 1px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 12px; color: var(--ink-3); padding: 18px 12px 6px; letter-spacing: .04em; }
.nav-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 12px; border-radius: 9px; color: var(--ink-2); text-align: left; font-size: 14.5px; transition: background .15s, color .15s; }
.nav-item:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); color: var(--ink); }
.nav-item[aria-current="page"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow); font-weight: 600; }
.nav-item[aria-current="page"] svg { color: var(--accent); }
.nav-item.sub { font-size: 14px; }
.nav-item .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); margin: 0 6px; flex: none; }
.nav-item[aria-current="page"] .dot { background: var(--accent); }
.nav-count { margin-left: auto; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; font-weight: 400; }
.sidebar-foot { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.toggles { display: flex; align-items: center; justify-content: space-between; padding: 0 6px; }
.seg { display: inline-flex; background: color-mix(in srgb, var(--ink) 6%, transparent); border-radius: 8px; padding: 2px; }
.seg button { padding: 4px 11px; border-radius: 6px; font-size: 13px; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow); font-weight: 600; }
.icon-btn { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; color: var(--ink-2); }
.icon-btn:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--ink); }
.snapshot { margin: 0; padding: 0 12px; font-size: 12px; color: var(--ink-3); }

/* ---------------- Page head ---------------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 24px; }
.eyebrow { margin: 0 0 6px; font-size: 13.5px; color: var(--accent); font-weight: 600; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.page-head h1 { margin: 0; font-family: var(--serif); font-weight: 700; font-size: clamp(28px, 3vw, 38px); line-height: 1.2; letter-spacing: .03em; }
.kpis { display: flex; margin: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--card); overflow: hidden; }
.kpis > div { padding: 10px 18px; min-width: 104px; }
.kpis > div + div { border-left: 1px solid var(--line); }
.kpis dt { font-size: 12px; color: var(--ink-3); }
.kpis dd { margin: 0; font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.3; }
.kpis .hot dd { color: var(--accent); }

/* ---------------- Controls ---------------- */
.search { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 11px; padding: 0 12px; height: 44px; transition: border-color .15s, box-shadow .15s; }
.search:focus-within { border-color: var(--line-2); box-shadow: 0 0 0 4px color-mix(in srgb, var(--focus) 14%, transparent); }
.search svg { color: var(--ink-3); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 15px; height: 100%; }
.search input::placeholder { color: var(--ink-3); }
.search kbd, .dock-search kbd { font: 12px var(--sans); color: var(--ink-3); border: 1px solid var(--line); border-radius: 5px; padding: 1px 7px; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 11px 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); font-size: 13.5px; color: var(--ink-2); white-space: nowrap; transition: border-color .15s, background .15s, color .15s; }
.pill:hover { border-color: var(--line-2); color: var(--ink); }
.pill .k { color: var(--ink-3); }
.pill.set { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.pill.set .k { color: color-mix(in srgb, var(--paper) 65%, transparent); }
.pill .n { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--paper); color: var(--ink); font-size: 11.5px; font-weight: 600; display: inline-grid; place-items: center; }
.pill svg { width: 14px; height: 14px; opacity: .7; }
.pill-reset { font-size: 13px; color: var(--ink-3); padding: 0 6px; height: 34px; text-decoration: underline; text-underline-offset: 3px; }
.pill-reset:hover { color: var(--ink); }

/* Popover */
.popover { position: fixed; z-index: 66; width: 360px; max-width: calc(100vw - 24px); max-height: min(560px, 76vh); overflow: auto; overscroll-behavior: contain; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; animation: pop .16s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } }
.pop-head { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 10px 4px; font-size: 12px; color: var(--ink-3); }
.opt { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 8px; text-align: left; font-size: 14px; }
.opt:hover, .opt:focus-visible { background: var(--paper-2); outline: none; }
.opt .box { width: 17px; height: 17px; border: 1.5px solid var(--line-2); border-radius: 5px; flex: none; display: grid; place-items: center; }
.opt[aria-checked="true"] .box { border-color: var(--ink); background: var(--ink); }
.opt[aria-checked="true"] .box::after { content: ""; width: 7px; height: 4px; border: 2px solid var(--paper); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.opt .lbl { flex: 1; min-width: 0; }
.opt .meter { width: 64px; height: 4px; border-radius: 4px; background: var(--slate-soft); overflow: hidden; flex: none; }
.opt .meter i { display: block; height: 100%; background: var(--ink-2); border-radius: 4px; }
.opt .hint { width: 42px; text-align: right; color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; flex: none; }
.pop-foot { display: flex; justify-content: space-between; border-top: 1px solid var(--line); margin-top: 6px; padding: 8px 6px 2px; }
.pop-foot button { font-size: 13px; padding: 5px 10px; border-radius: 7px; color: var(--ink-2); }
.pop-foot .primary { background: var(--ink); color: var(--paper); }

/* ---------------- Board ---------------- */
.board { display: grid; grid-template-columns: minmax(300px, 360px) minmax(0, 1fr); gap: 28px; align-items: start; }

/* Calendar */
.cal { position: sticky; top: 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.cal-top { background: var(--accent-bg); color: #fff; padding: 12px 14px 12px 18px; display: flex; align-items: center; justify-content: space-between; }
.cal-title { font-family: var(--serif); font-size: 19px; font-weight: 700; letter-spacing: .04em; }
.cal-title small { font: 500 13px var(--sans); opacity: 1; margin-left: 6px; letter-spacing: 0; }
.cal-nav { display: flex; gap: 2px; }
.cal-nav button { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: #fff; }
.cal-nav button:hover { background: rgba(255,255,255,.16); }
.cal-nav .today-btn { width: auto; padding: 0 10px; font-size: 13px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); padding: 8px 10px 4px; gap: 2px; }
.cal-wd { font-size: 11.5px; font-weight: 600; color: var(--ink-2); text-align: center; padding: 4px 0 6px; }
.cal-wd.we { color: var(--accent-ink); }
.day { position: relative; aspect-ratio: 1 / 1.02; border-radius: 9px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 6px; font-size: 13.5px; font-variant-numeric: tabular-nums; color: var(--ink); transition: background .12s; }
.day.out { color: var(--line-2); }
.day.past { color: var(--ink-3); }
.day.has { cursor: pointer; }
.day.has:hover { background: var(--paper-2); }
.day[data-heat="1"] { background: var(--heat-1); }
.day[data-heat="2"] { background: var(--heat-2); }
.day[data-heat="3"] { background: var(--heat-3); }
.day.past[data-heat] { background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); } /* past: outline only, so tinted days stand out */
.day.today .d { background: var(--ink); color: var(--paper); border-radius: 50%; width: 24px; height: 24px; display: grid; place-items: center; margin-top: -3px; font-weight: 600; }
.day.sel { outline: 2px solid var(--ink); outline-offset: -2px; }
.day .c { margin-top: auto; margin-bottom: 5px; font-size: 11px; font-weight: 700; color: var(--accent-ink); line-height: 1; }
.day[data-heat="3"] .c { color: var(--ink); } /* accent-ink is too faint on the darkest tint */
.day.past .c { color: var(--ink-3); }
.cal-legend { display: flex; gap: 14px; flex-wrap: wrap; padding: 6px 16px 12px; font-size: 12px; color: var(--ink-2); }
.cal-legend span { display: inline-flex; align-items: center; gap: 5px; }
.cal-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.cal-foot { border-top: 1px solid var(--line); padding: 12px 16px 14px; display: flex; flex-direction: column; gap: 8px; }
.cal-foot h3 { margin: 0; font-size: 12.5px; color: var(--ink-2); font-weight: 600; letter-spacing: .04em; }
.next { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 10px; align-items: center; text-align: left; padding: 6px 6px; margin: 0 -6px; border-radius: 8px; }
.next:hover { background: var(--paper-2); }
.next b { font: 700 17px/1 var(--serif); text-align: center; font-variant-numeric: tabular-nums; }
.next b small { display: block; font: 600 10.5px var(--sans); color: var(--ink-2); margin-top: 3px; }
.next span { font-size: 13px; line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.next.soon b, .next.soon b small { color: var(--accent-ink); }

/* ---------------- Agenda ---------------- */
.agenda { min-width: 0; container-type: inline-size; container-name: agenda; outline: none; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; padding: 4px 2px 12px; }
.summary { font-size: 14px; color: var(--ink-2); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.summary b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.summary .sep { color: var(--line-2); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 6px 0 11px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-ink); font-size: 13px; font-weight: 600; }
.chip button { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; }
.chip button:hover { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.chip svg { width: 12px; height: 12px; stroke-width: 2; }
.toolbar-right { display: flex; align-items: center; gap: 16px; }
.sort select { border: 0; background: none; font-size: 14px; color: var(--ink-2); padding: 4px 22px 4px 4px; cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m3 4.5 3 3 3-3' fill='none' stroke='%237A7F86' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 4px center; background-size: 12px; }
.sort select option { background: var(--card); color: var(--ink); }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; }
.switch .track { width: 32px; height: 19px; border-radius: 99px; background: var(--line-2); position: relative; transition: background .2s; }
.switch .track::after { content: ""; position: absolute; top: 2.5px; left: 2.5px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .2s var(--ease); }
.switch input:checked + .track { background: var(--ink); }
.switch input:checked + .track::after { transform: translateX(13px); }
.switch input:focus-visible + .track { outline: 2px solid var(--focus); outline-offset: 2px; }

/* row grid: date | award | institution | province | amount | actions */
.cols, .row { display: grid; grid-template-columns: 68px minmax(0, 1.35fr) minmax(0, 1fr) minmax(0, .75fr) 132px 150px; column-gap: 20px; align-items: start; }
.cols { position: sticky; top: 0; z-index: 5; background: var(--paper); border-bottom: 1px solid var(--line-2); padding: 8px 16px 8px; font-size: 12px; color: var(--ink-3); letter-spacing: .04em; }
.cols span:nth-child(5) { text-align: right; }

.list { display: flex; flex-direction: column; }
.month-head { display: flex; align-items: baseline; gap: 10px; padding: 26px 16px 8px; border-bottom: 1px solid var(--line); scroll-margin-top: 40px; }
.month-head:first-child { padding-top: 14px; }
.month-head h2 { margin: 0; font-family: var(--serif); font-size: 18px; font-weight: 700; letter-spacing: .03em; }
.month-head span { color: var(--ink-3); font-size: 13px; font-variant-numeric: tabular-nums; }

.row { position: relative; padding: 14px 16px; border-bottom: 1px solid var(--rule); cursor: pointer; transition: background .12s; }
@keyframes fade { from { opacity: 0; } }
.row:hover { background: color-mix(in srgb, var(--card) 70%, transparent); }
.row:focus-visible { outline-offset: -2px; }
.row.closed { opacity: .62; }
.row.cmp { background: color-mix(in srgb, var(--focus) 6%, transparent); }

/* tear-off date tile */
.tile { position: relative; width: 58px; border-radius: 8px; overflow: hidden; background: var(--card); border: 1px solid var(--line-2); text-align: center; box-shadow: 0 1px 0 var(--line); }
.tile i { display: block; font: 600 10.5px/17px var(--sans); font-style: normal; background: var(--ink); color: var(--paper); letter-spacing: .04em; }
.tile b { display: block; font: 700 22px/1.15 var(--serif); padding-top: 3px; font-variant-numeric: tabular-nums; }
.tile small { display: block; font-size: 10.5px; font-weight: 500; color: var(--ink-2); padding: 0 2px 4px; line-height: 1.3; white-space: nowrap; }
.tile.soon i { background: var(--accent); }
.tile.soon small { color: var(--accent-ink); font-weight: 700; }
.tile.upcoming i { background: var(--amber); }
.tile.closed i { background: var(--ink-3); }
/* expired: a used calendar page — flat grey paper, date faded, an ink seal stamped across it.
   The seal is the tile's own "已截止 / Closed" label, so it stays translated and readable to screen readers. */
.tile.closed { background: var(--paper-2); border-color: var(--line); box-shadow: none; }
.tile.closed b { color: var(--ink-3); padding-bottom: 19px; }
.tile.closed small {
  position: absolute; left: 50%; top: 76%; transform: translate(-50%, -50%) rotate(-9deg);
  padding: 2px 4px 2px 6px; border-radius: 3px; letter-spacing: .14em; line-height: 1.25;
  font-size: 10.5px; font-weight: 700; color: var(--accent);
  background: color-mix(in srgb, var(--paper-2) 45%, transparent);
  border: 1.5px solid currentColor; box-shadow: inset 0 0 0 1.5px var(--paper-2), inset 0 0 0 2.25px currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='32'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1.5 1.75'/%3E%3C/filter%3E%3Crect width='64' height='32' filter='url(%23g)'/%3E%3C/svg%3E") 0 0 / 64px 32px; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='32'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1.5 1.75'/%3E%3C/filter%3E%3Crect width='64' height='32' filter='url(%23g)'/%3E%3C/svg%3E") 0 0 / 64px 32px;
}
html[lang="en"] .tile.closed small { letter-spacing: .06em; padding: 2px 4px; }
@media (prefers-color-scheme: dark) { .tile.closed small { color: var(--accent-ink); } }
.tile.auto i { background: var(--green); }
.tile.none { border-style: dashed; box-shadow: none; background: transparent; }
.tile.none i { background: transparent; color: var(--ink-3); border-bottom: 1px dashed var(--line-2); }
.tile.none b { font-size: 18px; color: var(--ink-3); padding-top: 5px; }

/* three equal fields */
.f { min-width: 0; font-size: 15px; font-weight: 500; line-height: 1.45; color: var(--ink); overflow-wrap: anywhere; padding-top: 1px; }
.f .sub { display: block; font-size: 12.5px; font-weight: 400; color: var(--ink-3); margin-top: 2px; }
.f.muted { color: var(--ink-3); font-weight: 400; }
.f .lab { display: none; }
.row .meta { grid-column: 2 / 5; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.tag { font-size: 12px; padding: 1px 8px; border-radius: 99px; background: var(--slate-soft); color: var(--ink-2); white-space: nowrap; }
.tag.v-checked { background: var(--green-soft); color: var(--green); }
.tag.v-sparse { background: transparent; color: var(--ink-3); border: 1px dashed var(--line-2); padding: 0 7px; }
.miss { font-size: 12px; color: var(--amber); display: inline-flex; align-items: center; gap: 5px; margin-left: 2px; }
.miss::before { content: ""; width: 6px; height: 6px; border-radius: 50%; border: 1.5px solid currentColor; }

.amt { text-align: right; font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.35; white-space: nowrap; }
.amt small { font-size: 11.5px; font-weight: 400; color: var(--ink-3); margin-right: 3px; }
.amt.muted { font-size: 13px; font-weight: 400; color: var(--ink-3); white-space: normal; }
.acts { display: flex; justify-content: flex-end; gap: 2px; margin-top: -4px; }
.act { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; color: var(--ink-3); transition: color .15s, background .15s; }
.act:hover { background: var(--paper-2); color: var(--ink); }
.act[aria-pressed="true"] { color: var(--accent); }
.act.save[aria-pressed="true"] svg { fill: currentColor; }
.act.cmpb[aria-pressed="true"] { color: var(--focus); background: color-mix(in srgb, var(--focus) 10%, transparent); }

/* narrower agenda: fields stack, equal weight lines */
@container agenda (max-width: 820px) {
  .cols { display: none; }
  .row { grid-template-columns: 64px minmax(0, 1fr) auto; grid-template-rows: auto; row-gap: 2px; }
  .row .tile { grid-row: 1 / 5; }
  .row .f { grid-column: 2; padding-top: 0; }
  .row .f1 { grid-row: 1; } .row .f2 { grid-row: 2; } .row .f3 { grid-row: 3; }
  .row .meta { grid-row: 4; }
  .row .f .lab { display: inline; font-size: 12px; font-weight: 400; color: var(--ink-3); margin-right: 8px; }
  .row .amt { grid-column: 3; grid-row: 1; }
  .row .acts { grid-column: 3; grid-row: 2 / 4; align-self: end; margin: 0; }
  .row .meta { grid-column: 2 / 4; }
  .f .sub { display: inline; margin-left: 6px; }
}

.empty { text-align: center; padding: 56px 20px; color: var(--ink-2); border: 1px dashed var(--line-2); border-radius: var(--radius); margin-top: 12px; }
.empty h3 { font-family: var(--serif); margin: 0 0 6px; color: var(--ink); font-size: 18px; }
.empty p { margin: 0 0 14px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px; font-size: 14.5px; font-weight: 600; border: 1px solid var(--line); background: var(--card); color: var(--ink); text-decoration: none; transition: background .15s, border-color .15s, transform .1s; white-space: nowrap; }
.btn:hover { border-color: var(--line-2); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent-bg); border-color: var(--accent-bg); color: #fff; }
.btn.dark { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13.5px; }
.btn svg { width: 16px; height: 16px; }
.sentinel { height: 1px; }
.after { margin-top: 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.closed-reveal { width: 100%; padding: 14px; border: 1px dashed var(--line-2); border-radius: 12px; color: var(--ink-2); font-size: 14px; }
.closed-reveal:hover { color: var(--ink); border-color: var(--ink-3); }
.closed-reveal b { color: var(--ink); }
.end-note { font-size: 13px; color: var(--ink-3); text-align: center; }

/* ---------------- Compare ---------------- */
.tray { position: fixed; z-index: 55; left: calc(var(--sidebar-w) + (100vw - var(--sidebar-w)) / 2); bottom: 22px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; background: var(--ink); color: var(--paper); border-radius: 14px; box-shadow: var(--shadow-lg); max-width: calc(100vw - var(--sidebar-w) - 40px); animation: up .25s var(--ease); }
@keyframes up { from { opacity: 0; transform: translate(-50%, 10px); } }
.tray-label { font-size: 13.5px; white-space: nowrap; }
.tray-items { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.tray-item { display: inline-flex; align-items: center; gap: 4px; max-width: 180px; height: 30px; padding: 0 4px 0 10px; border-radius: 8px; background: color-mix(in srgb, var(--paper) 14%, transparent); font-size: 12.5px; }
.tray-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tray-item button { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; color: inherit; opacity: .7; flex: none; }
.tray-item button:hover { opacity: 1; background: color-mix(in srgb, var(--paper) 18%, transparent); }
.tray-item svg { width: 12px; height: 12px; stroke-width: 2; }
.tray .btn { height: 34px; font-size: 13.5px; }
.tray .btn.primary { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.tray .btn.ghost { background: transparent; color: var(--paper); border-color: transparent; opacity: .75; }

.modal-scrim, .drawer-scrim, .scrim { position: fixed; inset: 0; background: rgba(20, 24, 29, .34); z-index: 70; animation: fadein .2s ease; }
@keyframes fadein { from { opacity: 0; } }
.modal { position: fixed; z-index: 85; inset: 4vh 3vw; margin: auto; max-width: 1280px; max-height: 92vh; background: var(--paper); border-radius: 18px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; animation: pop .22s var(--ease); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-family: var(--serif); font-size: 20px; }
.modal-body { overflow: auto; padding: 0 0 20px; }
.cmp-table { table-layout: fixed; border-collapse: separate; border-spacing: 0; width: 100%; min-width: 720px; font-size: 14px; }
.cmp-table th, .cmp-table td { padding: 12px 16px; border-bottom: 1px solid var(--rule); vertical-align: top; text-align: left; }
.cmp-table thead th { position: sticky; top: 0; background: var(--paper); z-index: 2; border-bottom: 1px solid var(--line-2); font-weight: 600; vertical-align: bottom; }
.cmp-table tbody th { position: sticky; left: 0; background: var(--paper); color: var(--ink-3); font-weight: 400; width: 120px; z-index: 1; white-space: nowrap; }
.cmp-table td { overflow-wrap: anywhere; }
.cmp-table thead th:first-child { width: 120px; }
.cmp-table .best { color: var(--accent); font-weight: 650; }
.cmp-table .best::after { content: attr(data-best); display: inline-block; margin-left: 6px; font-size: 11px; font-weight: 600; padding: 0 6px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-ink); vertical-align: 1px; }
.cmp-table .unk { color: var(--ink-3); }
.cmp-table .diff td { background: color-mix(in srgb, var(--amber) 5%, transparent); }
.cmp-name { font-family: var(--serif); font-size: 16px; line-height: 1.4; display: block; }
.cmp-sub { display: block; color: var(--ink-3); font-weight: 400; font-size: 12.5px; margin-top: 3px; }
.cmp-remove { font-size: 12.5px; color: var(--ink-3); text-decoration: underline; text-underline-offset: 3px; margin-top: 6px; font-weight: 400; }
.cmp-legend { padding: 12px 24px 0; font-size: 12.5px; color: var(--ink-3); display: flex; gap: 16px; flex-wrap: wrap; }
.cmp-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ---------------- Sources page ---------------- */
.sources-page { max-width: 1200px; }
.source-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.source { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.source h3 { margin: 0; font-size: 15px; font-weight: 600; }
.source p { margin: 0; color: var(--ink-3); font-size: 13px; }
.source .r { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 13px; }
.source a { color: var(--ink-2); }
.prose { max-width: 72ch; color: var(--ink-2); }
.prose h2 { font-family: var(--serif); color: var(--ink); font-size: 19px; margin: 32px 0 8px; }
.prose ul { padding-left: 20px; }
.prose li { margin: 4px 0; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.stat b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--ink-3); }
.bar { height: 4px; background: var(--slate-soft); border-radius: 4px; margin-top: 8px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--ink-2); border-radius: 4px; }

/* ---------------- Drawer ---------------- */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 80; width: min(560px, 100vw); background: var(--paper); box-shadow: var(--shadow-lg); overflow-y: auto; overscroll-behavior: contain; animation: slidein .28s var(--ease); }
@keyframes slidein { from { transform: translateX(32px); opacity: 0; } }
.drawer-inner { padding: 22px 30px 40px; }
.d-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.d-crumb { font-size: 13px; color: var(--ink-3); }
.d-head { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 16px; align-items: start; }
.d-head .tile { width: 74px; }
.d-head .tile b { font-size: 28px; }
.d-title { font-family: var(--serif); font-size: 22px; line-height: 1.35; margin: 0; overflow-wrap: anywhere; }
.d-orig { color: var(--ink-3); margin-top: 4px; font-size: 13.5px; }
.d-three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin: 20px 0 12px; }
.d-three > div { background: var(--card); padding: 12px 14px; min-width: 0; }
.d-three .k { font-size: 12px; color: var(--ink-3); }
.d-three .v { font-size: 15px; font-weight: 600; margin-top: 2px; line-height: 1.4; overflow-wrap: anywhere; }
.d-three .v.soon { color: var(--accent); }
.d-three .v small { font-size: 11.5px; font-weight: 400; color: var(--ink-3); margin-right: 3px; }
.d-three .s { font-size: 12px; color: var(--ink-3); margin-top: 2px; overflow-wrap: anywhere; }
.d-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 22px; }
.d-actions .btn.primary { flex: 1 1 180px; }
.d-section { margin-top: 22px; }
.d-section h3 { font-size: 13px; color: var(--ink-3); font-weight: 600; margin: 0 0 8px; letter-spacing: .04em; }
.d-section p { margin: 0; white-space: pre-line; }
.facts { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 9px 16px; margin: 0; font-size: 14.5px; }
.facts dt { color: var(--ink-3); }
.facts dd { margin: 0; }
.facts dd.unk { color: var(--ink-3); }
.links { display: flex; flex-direction: column; gap: 6px; }
.links a { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; background: var(--card); font-size: 14px; overflow-wrap: anywhere; }
.links a:hover { border-color: var(--line-2); }
.links a small { color: var(--ink-3); margin-left: auto; white-space: nowrap; }
.trust { padding: 12px 14px; border-radius: 10px; background: var(--paper-2); font-size: 13.5px; color: var(--ink-2); }
.trust b { color: var(--ink); margin-right: 6px; }

.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 90; background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 10px; font-size: 14px; box-shadow: var(--shadow-lg); animation: toast .22s var(--ease); }
@keyframes toast { from { opacity: 0; transform: translate(-50%, 8px); } }
.tabbar { display: none; }

/* ---------------- Responsive ---------------- */
@media (max-width: 1180px) {
  .board { grid-template-columns: minmax(0, 1fr); }
  .cal { position: static; display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); }
  .cal-top { grid-column: 1 / -1; }

  .cal-main { border-right: 1px solid var(--line); }
  .cal-foot { border-top: 0; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 75; width: min(300px, 86vw); transform: translateX(-102%); transition: transform .28s var(--ease); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .main { padding: 22px 16px calc(150px + env(safe-area-inset-bottom)); }
  .page-head { align-items: flex-start; flex-direction: column; gap: 14px; margin-bottom: 18px; }
  .kpis { width: 100%; }
  .kpis > div { flex: 1; min-width: 0; padding: 8px 12px; }
  .kpis dd { font-size: 19px; }
  .cal { display: block; }
  .cal-main { border-right: 0; }
  .cal-foot { display: none; }
  .cal.collapsed .cal-main { display: none; }
  .cal .cal-toggle { display: inline-grid !important; }
  .row { padding: 12px 6px; }
  .tray { left: 12px; right: 12px; transform: none; max-width: none; bottom: calc(70px + env(safe-area-inset-bottom)); animation: none; }
  .tray-label { display: none; }
  .drawer { top: auto; height: 92dvh; width: 100vw; border-radius: 18px 18px 0 0; animation: slideup .3s var(--ease); }
  @keyframes slideup { from { transform: translateY(40px); opacity: 0; } }
  .drawer-inner { padding: 14px 18px calc(40px + env(safe-area-inset-bottom)); }
  .drawer-inner::before { content: ""; display: block; width: 38px; height: 4px; border-radius: 4px; background: var(--line-2); margin: 0 auto 10px; }
  .d-three { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 88px minmax(0, 1fr); }
  .modal { inset: 0; max-height: none; border-radius: 0; }
  .tabbar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar button { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--ink-3); padding: 4px 0; user-select: none; }
  .tabbar button svg { width: 21px; height: 21px; }
  .tabbar button[aria-current="page"] { color: var(--accent); }
  .opt { padding: 12px 10px; }
}
.cal-toggle { display: none !important; }

@media (hover: none) { .row:hover, .nav-item:hover { background: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* calendar header: never wrap */
.cal-title, .cal-title small, .cal-nav .today-btn { white-space: nowrap; }
@media (max-width: 860px) {
  .cal-top { padding: 10px 10px 10px 16px; }
  .cal-title { font-size: 17px; }
  .cal-title small { display: block; margin: 2px 0 0; font-size: 12px; }
}

.pop-note { margin: 6px 10px 2px; font-size: 12px; line-height: 1.5; color: var(--ink-3); }

/* Desktop app shell: header, filters and calendar stay put; only the list scrolls */
@media (min-width: 1181px) {
  body { overflow: hidden; }
  .app { height: 100dvh; }
  .main { height: 100dvh; overflow: hidden; display: flex; flex-direction: column; padding-bottom: 0; }
  .wrap { flex: 1; min-height: 0; width: 100%; display: flex; flex-direction: column; }
  .page-head { flex: none; }
  .board { flex: 1; min-height: 0; align-items: stretch; }
  .cal { position: static; align-self: start; max-height: calc(100% - 20px); overflow-y: auto; }
  .agenda { min-height: 0; display: flex; flex-direction: column; }
  .toolbar { flex: none; }
  .scroller { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-bottom: 130px; scrollbar-width: none; }
  .scroller::-webkit-scrollbar { display: none; }
  .sources-page { flex: 1; min-height: 0; overflow-y: auto; padding-bottom: 80px; }
}

/* applicant presets & eligibility tags */
.presets { display: flex; flex-direction: column; gap: 4px; padding: 2px 4px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.preset { text-align: left; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); font-size: 14px; color: var(--ink); }
.preset:hover { background: var(--paper-2); }
.preset[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.tag.aud { font-weight: 600; }
.tag.aud-intlOnly { background: color-mix(in srgb, var(--focus) 12%, transparent); color: var(--focus); }
.tag.aud-open { background: var(--green-soft); color: var(--green); }
.tag.aud-domOnly { background: var(--amber-soft); color: var(--amber); }
.tag.aud-indigOnly { background: var(--accent-soft); color: var(--accent-ink); }
.dd-sub { display: block; font-size: 12.5px; color: var(--ink-3); }

/* sortable column headers */
.cols { padding-top: 4px; padding-bottom: 4px; }
.sorth { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 6px; margin-left: -6px; border-radius: 6px; font-size: 12.5px; color: var(--ink-3); letter-spacing: .04em; white-space: nowrap; }
.sorth:hover { color: var(--ink); background: var(--paper-2); }
.sorth.on { color: var(--ink); font-weight: 600; }
.sorth.right { justify-self: end; margin-left: 0; margin-right: -6px; }
.arrows { display: inline-flex; flex-direction: column; gap: 2px; }
.arrows i { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; opacity: .35; }
.arrows i:first-child { border-bottom: 4.5px solid currentColor; }
.arrows i:last-child { border-top: 4.5px solid currentColor; }
.arrows.asc i:first-child, .arrows.desc i:last-child { opacity: 1; color: var(--accent); }

/* English: Latin type is narrower; tighten tracking on headings and labels */
html[lang="en"] .page-head h1, html[lang="en"] .brand-name, html[lang="en"] .cal-title, html[lang="en"] .month-head h2 { letter-spacing: -.005em; }
html[lang="en"] .cols, html[lang="en"] .sorth, html[lang="en"] .eyebrow, html[lang="en"] .d-section h3, html[lang="en"] .cal-foot h3 { letter-spacing: .02em; }
html[lang="en"] .tile i { letter-spacing: .06em; }
html[lang="en"] .f { font-weight: 500; letter-spacing: -.003em; }

.nav-item > span:not(.nav-count):not(.dot) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal { scrollbar-width: none; }
.cal::-webkit-scrollbar { display: none; }
.opt .meter i { transition: width .2s var(--ease); }

/* institution dialog */
.inst-modal { max-width: 880px; max-height: 86vh; inset: 7vh 4vw; }
.inst-tools { display: flex; align-items: center; gap: 14px; padding: 14px 24px 10px; }
.inst-tools .search { flex: 1; height: 42px; box-shadow: none; }
.inst-sel { font-size: 13px; color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.inst-body { padding: 0 18px 8px; flex: 1; min-height: 0; scrollbar-width: thin; }
.inst-group + .inst-group { margin-top: 12px; }
.inst-group h3 { position: sticky; top: 0; z-index: 2; box-shadow: 0 -12px 0 var(--paper), 0 1px 0 var(--line); display: flex; align-items: baseline; gap: 8px; margin: 0; padding: 10px 6px 6px; background: var(--paper); font: 700 15px/1.4 var(--serif); letter-spacing: .03em; }
.inst-group h3 span { font: 400 12px var(--sans); color: var(--ink-3); }
.inst-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 2px 8px; }
.inst-opt .lbl { line-height: 1.35; }
.inst-opt .lbl small { display: block; font-size: 11.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inst-opt .hint { width: auto; min-width: 34px; }
.inst-empty { padding: 30px; text-align: center; color: var(--ink-3); }
.inst-note { margin: 0; padding: 10px 24px 0; border-top: 1px solid var(--line); }
.inst-foot { margin: 0; padding: 10px 20px 14px; border-top: 0; }
@media (max-width: 860px) { .inst-modal { inset: 0; max-height: none; } .inst-tools { padding: 12px 16px 8px; } .inst-body { padding: 4px 10px 8px; } }

/* ---- layout polish ---- */
/* short desktop screens: keep the calendar whole */
@media (min-width: 1181px) and (max-height: 860px) {
  .cal-foot { display: none; }
  .page-head { margin-bottom: 16px; }
}
/* tablet: calendar can collapse like on phones */
@media (min-width: 861px) and (max-width: 1180px) {
  .cal .cal-toggle { display: inline-grid !important; }
  .cal.collapsed .cal-main, .cal.collapsed .cal-foot { display: none; }
}
.cal-toggle svg { transition: transform .2s var(--ease); }
.cal.collapsed .cal-toggle svg { transform: rotate(-90deg); }
@media (max-width: 860px) {
  .cmp-table { min-width: calc(84px + var(--n) * 200px); }
  .cmp-table tbody th, .cmp-table thead th:first-child { width: 84px; white-space: normal; }
}
.cal.collapsed [data-month] { display: none; }
.cal-toggle { font-size: 13px; }
.cal.collapsed .cal-toggle svg { transform: none; }

.tag.m-automatic { background: var(--green-soft); color: var(--green); }
.tag.m-nomination { background: var(--amber-soft); color: var(--amber); }

/* conflicts */
.notice { position: fixed; z-index: 95; left: 50%; bottom: 28px; transform: translateX(-50%); width: min(560px, calc(100vw - 24px)); display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 4px 12px; padding: 14px 16px; background: var(--card); border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); border-radius: 14px; box-shadow: var(--shadow-lg); animation: toast .22s var(--ease); }
.notice-icon { width: 26px; height: 26px; border-radius: 50%; background: var(--accent-bg); color: #fff; display: grid; place-items: center; font-weight: 700; }
.notice-body b { display: block; font-size: 14.5px; }
.notice-body p { margin: 4px 0 0; font-size: 13.5px; color: var(--ink-2); }
.notice-body .notice-reason { color: var(--ink-3); font-size: 12.5px; }
.notice-actions { grid-column: 2; display: flex; gap: 8px; margin-top: 8px; }
.notice .btn.ghost { border-color: transparent; color: var(--ink-2); }
.conflict-banner { margin: 12px 0 4px; padding: 12px 16px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); font-size: 14px; }
.conflict-banner > b { display: block; margin-bottom: 6px; }
.cb-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 0; border-top: 1px solid color-mix(in srgb, var(--accent) 18%, transparent); }
.cb-row span { color: var(--ink); min-width: 0; }
.cb-row small { display: block; color: var(--ink-2); font-size: 12.5px; margin-top: 2px; }
.tag.conflict { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.cmp-conflict { margin: 10px 24px 0; padding: 10px 14px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); font-size: 13.5px; }
.cmp-conflict p { margin: 4px 0 0; color: var(--ink); }
.d-note { margin: 8px 0 0; font-size: 13px; color: var(--ink-3); }

/* program picker + entry button */
.prog-step { font: 400 13px var(--sans); color: var(--ink-3); margin-left: 10px; letter-spacing: 0; }
.prog-nav { display: flex; gap: 8px; }
.prog-empty { padding: 28px 24px 32px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.prog-empty p { margin: 0; color: var(--ink-2); }
#progModal .inst-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.act.entry { text-decoration: none; }
.act.entry svg { width: 16px; height: 16px; }

/* =========================================================
   Floating glass dock — search + filters, shared by every list view
   ========================================================= */
:root {
  --dock-h: 58px;
  --dock-gap: 18px;
  --main-left: var(--sidebar-w);
  --glass: color-mix(in srgb, var(--card) 72%, transparent);
  --glass-edge: rgba(255, 255, 255, .75);
  --glass-hi: rgba(255, 255, 255, .55);
  --glass-shadow: 0 1px 1px rgba(31, 42, 55, .05), 0 8px 24px rgba(31, 42, 55, .12), 0 24px 60px rgba(31, 42, 55, .10);
}
@media (prefers-color-scheme: dark) {
  :root { --glass: color-mix(in srgb, var(--card) 70%, transparent); --glass-edge: rgba(255, 255, 255, .14); --glass-hi: rgba(255, 255, 255, .10); --glass-shadow: 0 8px 28px rgba(0, 0, 0, .45), 0 24px 60px rgba(0, 0, 0, .35); }
}
html.locked body { overflow: hidden; }

.dock {
  position: fixed; z-index: 60; bottom: calc(var(--dock-gap) + env(safe-area-inset-bottom));
  left: calc(var(--main-left) + (100vw - var(--main-left)) / 2); transform: translateX(-50%);
  width: min(1480px, calc(100vw - var(--main-left) - 40px)); height: var(--dock-h);
  display: flex; align-items: center; gap: 6px; padding: 6px;
  border-radius: 999px; background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(1.9) brightness(1.04); backdrop-filter: blur(22px) saturate(1.9) brightness(1.04);
  border: 1px solid var(--glass-edge);
  box-shadow: inset 0 1px 0 var(--glass-hi), inset 0 -1px 1px rgba(255, 255, 255, .08), var(--glass-shadow);
  animation: dockin .4s var(--ease);
}
.dock::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(180deg, rgba(255, 255, 255, .28), rgba(255, 255, 255, 0) 55%); mix-blend-mode: soft-light; }
@keyframes dockin { from { opacity: 0; transform: translate(-50%, 14px) scale(.98); } }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .dock { background: color-mix(in srgb, var(--card) 94%, transparent); } }

.dock-search {
  position: relative; flex: 0 0 clamp(200px, 24%, 300px); height: 100%; display: flex; align-items: center; gap: 8px; padding: 0 12px 0 14px;
  border-radius: 999px; background: color-mix(in srgb, var(--card) 70%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 7%, transparent);
  transition: flex-basis .3s var(--ease), background .2s;
}
.dock-search:focus-within { background: var(--card); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--focus) 35%, transparent), 0 0 0 4px color-mix(in srgb, var(--focus) 12%, transparent); }
.dock-search svg { color: var(--ink-3); }
.dock-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 14.5px; height: 100%; }
.dock-search input::placeholder { color: var(--ink-3); }
.dock-search input::-webkit-search-cancel-button { cursor: pointer; }
.dock-search kbd { font: 12px var(--sans); color: var(--ink-3); border: 1px solid var(--line); border-radius: 5px; padding: 0 6px; }
.dock-search:focus-within kbd { display: none; }

.dock-pills {
  position: relative; flex: 1; min-width: 0; height: 100%; display: flex; align-items: center; gap: 4px; overflow-x: auto; overscroll-behavior-x: contain;
  scrollbar-width: none; padding: 0 6px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 10px, #000 calc(100% - 14px), transparent); mask-image: linear-gradient(90deg, transparent, #000 10px, #000 calc(100% - 14px), transparent);
}
.dock-pills::-webkit-scrollbar { display: none; }
.dock .pill { height: 40px; padding: 0 10px 0 13px; border: 0; background: transparent; gap: 5px; font-size: 13.5px; flex: none; transition: background .18s, color .18s, transform .12s; }
.dock .pill:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.dock .pill:active { transform: scale(.97); }
.dock .pill .k { color: var(--ink-3); }
.dock .pill .v { color: var(--ink); font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }
.dock .pill.set { background: var(--ink); color: var(--paper); box-shadow: 0 2px 8px rgba(31, 42, 55, .18); }
.dock .pill.set .k { color: color-mix(in srgb, var(--paper) 62%, transparent); }
.dock .pill.set .v { color: var(--paper); }
.dock .pill[aria-expanded="true"]:not(.set) { background: var(--card); box-shadow: 0 1px 4px rgba(31, 42, 55, .12); }
.dock .pill svg { width: 13px; height: 13px; opacity: .55; transition: transform .2s var(--ease); }
.dock .pill[aria-expanded="true"] svg { transform: rotate(180deg); }
.dock .pill-reset { flex: none; height: 40px; padding: 0 12px; border-radius: 999px; text-decoration: none; color: var(--accent-ink); font-weight: 600; }
.dock .pill-reset:hover { background: var(--accent-soft); }

/* popover rises from the dock */
.popover { border-radius: 18px; padding: 6px; background: color-mix(in srgb, var(--card) 92%, transparent); -webkit-backdrop-filter: blur(24px) saturate(1.6); backdrop-filter: blur(24px) saturate(1.6); border: 1px solid var(--glass-edge); box-shadow: inset 0 1px 0 var(--glass-hi), var(--glass-shadow); display: flex; flex-direction: column; }
.popover:not([hidden]) { display: flex; }
.pop-list { overflow-y: auto; min-height: 0; flex: 1; scrollbar-width: thin; }
.popover .pop-note, .popover .pop-foot { flex: none; }

/* things that float above the dock */
.tray { bottom: calc(var(--dock-h) + var(--dock-gap) + 14px + env(safe-area-inset-bottom)); left: calc(var(--main-left) + (100vw - var(--main-left)) / 2); border-radius: 16px; }
.toast { bottom: calc(var(--dock-h) + var(--dock-gap) + 16px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 14px; }
.toast-act { color: var(--paper); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.notice { bottom: calc(var(--dock-h) + var(--dock-gap) + 16px + env(safe-area-inset-bottom)); }
.tray:not([hidden]) ~ .toast { bottom: calc(var(--dock-h) + var(--dock-gap) + 74px + env(safe-area-inset-bottom)); }
body.no-dock .tray, body.no-dock .toast, body.no-dock .notice { bottom: 24px; }
.main { padding-bottom: calc(var(--dock-h) + var(--dock-gap) + 70px); }

/* banner, links, extra toolbar buttons */
.banner { margin: 4px 0 10px; padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, var(--focus) 9%, transparent); color: var(--ink-2); font-size: 13.5px; }
.tool-extra { display: inline-flex; gap: 8px; }
.tool-extra:empty { display: none; }
.link-btn { display: inline-flex; align-items: center; gap: 4px; font-size: 13.5px; color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
.link-btn svg { width: 15px; height: 15px; }
.hidden-note { color: var(--amber); }
.act-text { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--card); font-size: 13px; color: var(--ink); white-space: nowrap; }
.act-text:hover { border-color: var(--ink-3); }
.act-text svg { width: 15px; height: 15px; }
.act.trashb:hover { color: var(--accent); }
.tag.ap-prereq { background: color-mix(in srgb, var(--focus) 10%, transparent); color: var(--focus); }
.tag.ap-contest, .tag.ap-draw { background: var(--amber-soft); color: var(--amber); }
.v-muted { font-weight: 400; color: var(--ink-3); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { border-color: var(--line); }
.btn[disabled] { opacity: .45; cursor: default; }
.d-back { color: var(--ink-2); text-decoration: none; font-size: 13.5px; }
.links a .rel-t { display: flex; flex-direction: column; min-width: 0; }
.links a .rel-t small { margin: 2px 0 0; color: var(--ink-3); white-space: normal; }
.links a svg { width: 16px; height: 16px; color: var(--ink-3); }
details.orig summary { cursor: pointer; color: var(--ink-3); font-size: 13.5px; }
details.orig p { margin-top: 8px; color: var(--ink-2); font-size: 14px; }

/* drawer: "more about this award" — one folding row per topic, closed by default so the drawer stays short */
.d-more details.more { border-top: 1px solid var(--line); }
.d-more details.more:last-of-type { border-bottom: 1px solid var(--line); }
.d-more details.more > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 11px 2px; font-weight: 600; font-size: 14.5px; color: var(--ink); border-radius: 6px; }
.d-more details.more > summary::-webkit-details-marker { display: none; }
.d-more details.more > summary::before {
  content: ""; flex: none; width: 0; height: 0; border-style: solid; border-width: 4.5px 0 4.5px 6.5px;
  border-color: transparent transparent transparent var(--ink-3); transition: transform .15s ease;
}
.d-more details.more[open] > summary::before { transform: rotate(90deg); border-left-color: var(--accent); }
.d-more details.more > summary:hover { color: var(--accent-ink); }
.d-more details.more > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.d-more .more-body { padding: 0 2px 14px 17px; color: var(--ink-2); font-size: 14px; }
.d-more .more-body p { white-space: pre-line; }
.d-more .more-lang { font-weight: 500; font-size: 11.5px; color: var(--ink-3); border: 1px solid var(--line-2); border-radius: 999px; padding: 0 7px; }
.d-more .more-note, .d-more .more-src { margin-top: 8px; font-size: 12.5px; color: var(--ink-3); }
.d-more .more-src { margin-top: 10px; }
.d-more .more-src a, .d-more .hist a { color: var(--accent-ink); }
.d-more .more-gone { margin-bottom: 10px; padding: 9px 12px; border-radius: 8px; background: var(--amber-soft); color: var(--ink); font-size: 13.5px; }
.d-more .hist-wrap { overflow-x: auto; scrollbar-width: none; }
.d-more .hist-wrap::-webkit-scrollbar { display: none; }
.d-more table.hist { border-collapse: collapse; width: 100%; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.d-more table.hist th, .d-more table.hist td { padding: 7px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.d-more table.hist thead th { font-size: 12px; font-weight: 600; color: var(--ink-3); background: var(--paper-2); }
.d-more table.hist tbody th { font-weight: 700; }
.d-more table.hist td { color: var(--ink); }
.d-more table.hist td.blank { color: var(--ink-3); font-size: 12px; }
@media (prefers-reduced-motion: reduce) { .d-more details.more > summary::before { transition: none; } }
.notice-icon.share { background: var(--ink); }
.notice-icon.share svg { width: 15px; height: 15px; color: var(--paper); }
.share-input { width: 100%; margin-top: 8px; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); font-size: 13px; color: var(--ink-2); }

/* institution dialog tabs */
.seg.tabs { flex: none; }
.seg.tabs button { padding: 6px 12px; font-size: 13.5px; }
.seg.tabs small { color: var(--ink-3); font-size: 11.5px; margin-left: 2px; font-variant-numeric: tabular-nums; }

/* program picker: list + side panel of chosen programs */
.prog-modal { max-width: 1180px; }
.prog-modal.prog-modal-small { max-width: 560px; max-height: 360px; }
.prog-layout { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 280px; }
.prog-layout .inst-body { min-height: 0; }
.prog-aside { border-left: 1px solid var(--line); background: var(--paper-2); padding: 14px 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.prog-aside-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 13.5px; }
.prog-aside-head span { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.prog-aside-sc { font: 700 13.5px var(--serif); color: var(--ink); text-align: left; }
.prog-aside-sc:hover { text-decoration: underline; text-underline-offset: 3px; }
.prog-aside .chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.pchip { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; height: 28px; padding: 0 3px 0 10px; border-radius: 99px; background: var(--card); border: 1px solid var(--line); font-size: 12.5px; }
.pchip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pchip button { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-3); flex: none; }
.pchip button:hover { background: var(--accent-soft); color: var(--accent-ink); }
.pchip svg { width: 11px; height: 11px; stroke-width: 2.2; }
.prog-aside-empty { margin: 0; color: var(--ink-3); font-size: 13px; }
.prog-clearall { margin-top: auto; align-self: flex-start; }

/* tablet: sidebar still visible, page scrolls */
@media (min-width: 861px) and (max-width: 1180px) {
  .dock { width: calc(100vw - var(--main-left) - 32px); }
  .dock-search { flex-basis: 190px; }
}
/* phones: dock sits above the tab bar; search collapses to an icon until used */
@media (max-width: 860px) {
  :root { --main-left: 0px; --dock-h: 52px; --dock-gap: 74px; }
  .dock { width: calc(100vw - 20px); gap: 4px; padding: 5px; }
  .dock-search { flex: 0 0 42px; padding: 0 0 0 12px; overflow: hidden; }
  .dock-search kbd { display: none; }
  .dock-search input { opacity: 0; }
  .dock.has-q .dock-search { flex-basis: 128px; }
  .dock.has-q .dock-search input, .dock.searching .dock-search input { opacity: 1; }
  .dock.searching .dock-search { flex: 1 1 auto; }
  .dock.searching .dock-pills { flex: 0 0 0; opacity: 0; pointer-events: none; padding: 0; }
  .dock .pill { height: 38px; padding: 0 9px 0 11px; font-size: 13px; }
  .popover { left: 8px; right: 8px; width: auto; max-width: none; border-radius: 22px; padding: 10px; }
  .tray { left: 10px; right: 10px; transform: none; }
  .tabbar { background: var(--glass); -webkit-backdrop-filter: blur(22px) saturate(1.9); backdrop-filter: blur(22px) saturate(1.9); border-top: 1px solid var(--glass-edge); }
  .prog-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .prog-aside { order: -1; border-left: 0; border-bottom: 1px solid var(--line); max-height: 28dvh; padding: 10px 14px; gap: 8px; }
  .prog-modal.prog-modal-small { inset: auto 0 0 0; max-height: 60dvh; border-radius: 18px 18px 0 0; }
  .inst-tools { flex-wrap: wrap; }
  .seg.tabs { order: 2; }
  .toolbar-right { width: 100%; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
  .act-text span { display: none; }
}
@media (min-width: 1181px) { .main { padding-bottom: 0; } }
.sidebar, .drawer, .prog-aside, .modal-body { scrollbar-width: none; }
.sidebar::-webkit-scrollbar, .drawer::-webkit-scrollbar, .prog-aside::-webkit-scrollbar, .modal-body::-webkit-scrollbar { display: none; }
.nav-item.sub { padding-top: 6px; padding-bottom: 6px; }
@container agenda (max-width: 560px) {
  .row .acts { grid-column: 2 / 4; grid-row: 5; justify-content: flex-start; margin: 6px 0 0 -8px; }
}
@media (max-width: 860px) { :root { --glass: color-mix(in srgb, var(--card) 82%, transparent); } }

/* PC: stacked dock — search on top, filter pills wrap into rows below (no long single strip) */
@media (min-width: 861px) {
  .dock { flex-wrap: wrap; height: auto; width: min(860px, calc(100vw - var(--main-left) - 40px)); border-radius: 26px; padding: 8px; gap: 6px; }
  .dock-search { flex: 1 1 100%; height: 44px; }
  .dock-pills { flex: 1 1 100%; height: auto; flex-wrap: wrap; overflow: visible; padding: 0 2px 2px; gap: 4px; -webkit-mask-image: none; mask-image: none; }
  .dock .pill, .dock .pill-reset { height: 36px; }
  .tray { bottom: calc(var(--dock-real, var(--dock-h)) + var(--dock-gap) + 14px); }
  .toast, .notice { bottom: calc(var(--dock-real, var(--dock-h)) + var(--dock-gap) + 16px); }
  .tray:not([hidden]) ~ .toast { bottom: calc(var(--dock-real, var(--dock-h)) + var(--dock-gap) + 74px); }
  .main { padding-bottom: calc(var(--dock-real, var(--dock-h)) + var(--dock-gap) + 40px); }
}
@media (min-width: 1181px) {
  .main { padding-bottom: 0; }
  .scroller { padding-bottom: calc(var(--dock-real, var(--dock-h)) + var(--dock-gap) + 30px); }
  .cal { max-height: calc(100% - var(--dock-real, var(--dock-h)) - var(--dock-gap) - 16px); }
}
@media (min-width: 861px) {
  .dock-pills { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .dock .pill { justify-content: flex-start; min-width: 0; }
  .dock .pill .v { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .dock .pill svg { margin-left: auto; }
  .dock .pill-reset { justify-self: start; }
}
/* collapse arrow in the dock, and the small floating button it collapses into */
.dock-min { flex: none; order: 3; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-2); transition: background .18s, transform .12s; }
.dock-min:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.dock-min:active { transform: scale(.94); }
.dock-min svg { width: 17px; height: 17px; }
.dock.searching .dock-min { display: none; }
.dock { transition: opacity .22s var(--ease), transform .32s var(--ease), visibility 0s; }
.dock-fab {
  position: fixed; z-index: 60; bottom: calc(var(--dock-gap) + env(safe-area-inset-bottom));
  left: calc(var(--main-left) + (100vw - var(--main-left)) / 2);
  height: 46px; padding: 0 14px 0 16px; display: flex; align-items: center; gap: 8px;
  border-radius: 999px; background: var(--glass); color: var(--ink); font-size: 14px; font-weight: 500;
  -webkit-backdrop-filter: blur(22px) saturate(1.9) brightness(1.04); backdrop-filter: blur(22px) saturate(1.9) brightness(1.04);
  border: 1px solid var(--glass-edge);
  box-shadow: inset 0 1px 0 var(--glass-hi), var(--glass-shadow);
  opacity: 0; visibility: hidden; pointer-events: none; transform: translate(-50%, 12px) scale(.9);
  transition: opacity .18s var(--ease), transform .26s var(--ease), visibility 0s .26s;
}
.dock-fab svg { width: 17px; height: 17px; color: var(--ink-2); }
.dock-fab svg.up { width: 14px; height: 14px; opacity: .55; }
.dock-fab b { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--ink); color: var(--paper); font-size: 11.5px; font-weight: 600; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.dock-fab b:empty { display: none; }
.dock-fab:hover { background: color-mix(in srgb, var(--card) 88%, transparent); }
.dock-fab:active { transform: translate(-50%, 0) scale(.96); }
body.dock-folded { --dock-h: 46px; --dock-real: 46px; }
body.dock-folded .dock { opacity: 0; visibility: hidden; pointer-events: none; transform: translate(-50%, 18px) scale(.94); transition: opacity .18s var(--ease), transform .26s var(--ease), visibility 0s .26s; }
body.dock-folded .dock-fab { opacity: 1; visibility: visible; pointer-events: auto; transform: translate(-50%, 0); transition: opacity .22s var(--ease) .06s, transform .32s var(--ease) .06s, visibility 0s; }
body.no-dock .dock-fab { display: none; }
@media (min-width: 861px) {
  .dock-search { flex: 1 1 0; min-width: 0; }
  .dock-min { order: 0; width: 44px; height: 44px; }
}
/* backup: export / import */
.backup { max-width: 520px; top: 12vh; bottom: auto; max-height: 76vh; overflow: auto; }
.bk-body { padding: 18px 24px 24px; display: flex; flex-direction: column; gap: 14px; }
.bk-body p { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.6; }
.bk-stat { font-variant-numeric: tabular-nums; color: var(--ink); font-size: 14px; }
.bk-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.bk-file { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.bk-file .bk-how { font-size: 12px; color: var(--ink-3); }
.bk-error { color: var(--accent-ink); font-size: 13px; }
/* move a whole school to the trash */
.school-trash { max-width: 640px; }
.school-trash > .pop-note { margin: 0 20px 8px; }
.st-list { display: flex; flex-direction: column; gap: 2px; }
.st-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; }
.st-row:hover { background: var(--paper-2); }
.st-name { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 14px; }
.st-name small { color: var(--ink-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-meta { flex: none; color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; text-align: right; }
.st-row .btn { flex: none; }
.st-row.all-trashed .st-name { color: var(--ink-3); }
.d-school-trash { margin-top: 10px; }
/* filter presets */
.preset-row { display: flex; align-items: center; gap: 2px; border-radius: 10px; }
.preset-row:hover, .preset-row:focus-within { background: var(--paper-2); }
.preset-apply { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; text-align: left; border-radius: 10px; }
.preset-apply:focus-visible { outline: none; box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--focus) 40%, transparent); }
.preset-name { font-size: 14px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preset-sum { font-size: 12px; color: var(--ink-3); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.preset-row.on .preset-name::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-right: 7px; vertical-align: 2px; }
.preset-del { flex: none; width: 30px; height: 30px; margin-right: 4px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-3); opacity: .7; }
.preset-del:hover, .preset-del:focus-visible { opacity: 1; background: var(--accent-soft); color: var(--accent-ink); }
.preset-del svg { width: 13px; height: 13px; stroke-width: 2; }
.preset-foot { display: block; }
.preset-foot .pop-note { margin: 2px 4px; }
.preset-save { display: flex; gap: 6px; }
.preset-save input { flex: 1; min-width: 0; height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); font-size: 13.5px; color: var(--ink); }
.preset-save input:focus { outline: none; border-color: color-mix(in srgb, var(--focus) 50%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 12%, transparent); }
.pop-foot .preset-save .primary { padding: 0 14px; }
@media (max-width: 860px) { .preset-save input { font-size: 16px; height: 38px; } }
.opt .hint { width: auto; min-width: 46px; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.opt .hint b { font-weight: 600; color: var(--ink-2); }
.opt .hint small { font-size: 10.5px; color: var(--amber); white-space: nowrap; }
