/* opencall site styles. One file, no external requests.
   Principles (design/taste-notes.md): one family, five working sizes, ink + one grey for text,
   colour only where it carries meaning (status), dense rows, wide margins, one job per section. */

/* ---------- font: Schibsted Grotesk (SIL Open Font License), self-hosted ---------- */
@font-face {
  font-family: 'Schibsted Grotesk'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url('../fonts/schibsted-grotesk-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: 'Schibsted Grotesk'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url('../fonts/schibsted-grotesk-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;
}

/* ---------- tokens ---------- */
:root {
  color-scheme: light;
  --font: 'Schibsted Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  /* five working sizes + display */
  --fs-xs: 0.75rem;     /* 12 labels */
  --fs-sm: 0.9375rem;   /* 15 secondary, controls */
  --fs-base: 1rem;      /* 16 body, row names */
  --fs-lg: 1.125rem;    /* 18 lead */
  --fs-xl: 1.5rem;      /* 24 section and page titles */
  --fs-display: clamp(2rem, 1.3rem + 2.6vw, 3.25rem); /* 32 to 52 */
  --lh-tight: 1.06; --lh-snug: 1.25; --lh-body: 1.5;
  --track-display: -0.035em; --track-tight: -0.015em;
  --w-regular: 400; --w-medium: 500; --w-semibold: 600;

  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px;
  --s-8: 32px; --s-10: 40px; --s-12: 48px; --s-16: 64px; --s-20: 80px;
  --page-max: 1160px;
  --gutter: clamp(16px, 4vw, 40px);
  --measure: 640px;
  --tap: 44px;
  --r-1: 4px; --r-2: 8px; --r-3: 12px; --r-pill: 999px;

  --dur-1: 120ms; --dur-2: 200ms;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);

  --bg: #ffffff;
  --bg-sunken: #f5f6f4;
  --bg-hover: #f2f3f0;
  --ink: #0d0f0e;
  --ink-2: #4a4f4c;
  --ink-3: #5e6460;
  --line: #e6e8e5;
  --line-2: #d2d6d2;
  --focus: #3340b8;
  --open-ink: #0b6b3a;
  --soon-ink: #a8360a;
  --today-ink: #ffffff; --today-bg: #b8390b;
  --closed-ink: #5a605c;
  --opens-ink: #3340b8;
  --unverified-ink: #8a4b00;
  --shadow-pop: 0 1px 2px rgb(13 15 14 / 0.06), 0 16px 40px rgb(13 15 14 / 0.14);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b0d0c; --bg-sunken: #121513; --bg-hover: #171b19;
    --ink: #eceeea; --ink-2: #b8bdb8; --ink-3: #a9aea9;
    --line: rgb(255 255 255 / 0.09); --line-2: rgb(255 255 255 / 0.16);
    --focus: #9aa5ff;
    --open-ink: #63d69f; --soon-ink: #ffab85; --today-ink: #0b0d0c; --today-bg: #ff9461;
    --closed-ink: #b3b8b2; --opens-ink: #a7b0ff; --unverified-ink: #f0b45a;
    --shadow-pop: 0 1px 2px rgb(0 0 0 / 0.4), 0 16px 40px rgb(0 0 0 / 0.55);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0d0c; --bg-sunken: #121513; --bg-hover: #171b19;
  --ink: #eceeea; --ink-2: #b8bdb8; --ink-3: #a9aea9;
  --line: rgb(255 255 255 / 0.09); --line-2: rgb(255 255 255 / 0.16);
  --focus: #9aa5ff;
  --open-ink: #63d69f; --soon-ink: #ffab85; --today-ink: #0b0d0c; --today-bg: #ff9461;
  --closed-ink: #b3b8b2; --opens-ink: #a7b0ff; --unverified-ink: #f0b45a;
  --shadow-pop: 0 1px 2px rgb(0 0 0 / 0.4), 0 16px 40px rgb(0 0 0 / 0.55);
}
@media (prefers-reduced-motion: reduce) { :root { --dur-1: 0ms; --dur-2: 0ms; } }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 80px; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: var(--fs-base); line-height: var(--lh-body); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
svg { display: block; }
h1, h2, h3 { margin: 0; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r-1); }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: var(--page-max); margin: 0 auto; padding: 0 var(--gutter); }
[hidden] { display: none !important; }
.num, .badge { font-variant-numeric: tabular-nums; }
.skip { position: absolute; left: var(--s-4); top: -60px; z-index: 60; background: var(--ink); color: var(--bg); padding: var(--s-2) var(--s-3); border-radius: var(--r-2); text-decoration: none; }
.skip:focus { top: var(--s-3); }

/* ---------- header ---------- */
.top { border-bottom: 1px solid var(--line); }
.top__in { display: flex; align-items: center; gap: var(--s-4); min-height: 60px; }
.mark { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: var(--w-semibold); font-size: var(--fs-lg); letter-spacing: var(--track-tight); min-height: var(--tap); }
.mark__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--open-ink); }
.nav { display: flex; align-items: center; gap: var(--s-1); margin-left: auto; }
.nav a { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 var(--s-3); border-radius: var(--r-2); color: var(--ink-2); text-decoration: none; font-size: var(--fs-sm); }
.nav a:hover { color: var(--ink); background: var(--bg-hover); }
.nav a[aria-current="page"] { color: var(--ink); font-weight: var(--w-medium); }
.iconbtn { display: inline-grid; place-items: center; width: var(--tap); height: var(--tap); border: 0; border-radius: var(--r-2); background: transparent; color: var(--ink-2); cursor: pointer; }
.iconbtn:hover { background: var(--bg-hover); color: var(--ink); }
.iconbtn svg { width: 18px; height: 18px; }
.theme-icon--sun { display: none; }
:root[data-theme="dark"] .theme-icon--sun { display: block; }
:root[data-theme="dark"] .theme-icon--moon { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme-icon--sun { display: block; } :root:not([data-theme="light"]) .theme-icon--moon { display: none; } }

/* ---------- sample data notice ---------- */
.notice { background: var(--bg-sunken); border-bottom: 1px solid var(--line); font-size: var(--fs-sm); color: var(--ink-2); }
.notice .wrap { padding-block: var(--s-2); }

/* ---------- intro: one headline, one or two lines, one button ---------- */
.intro { padding-block: var(--s-10) var(--s-6); }
.intro h1 { font-size: clamp(2rem, 1.3rem + 2.4vw, 3.25rem); line-height: 1.04; letter-spacing: -0.035em; font-weight: 700; text-wrap: balance; }
.intro__mark { color: var(--open-ink); }

/* live numbers under the headline: one button per type, the total first */
.intro__lead { margin-top: var(--s-3); font-size: var(--fs-lg); color: var(--ink-2); max-width: 760px; }
.intro__lead b { color: var(--ink); font-weight: var(--w-semibold); }
html:not(.is-ready) [data-live] { visibility: hidden; }

/* ---------- program type navigation and labels ---------- */
.type-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px; margin: 0 -4px; scrollbar-width: none; }
.type-tabs::-webkit-scrollbar { display: none; }
.switchbar .type-tabs { mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
.switchbar .type-tabs.is-end { mask-image: none; -webkit-mask-image: none; }
.type-tab { flex: none; min-height: var(--tap); display: inline-flex; align-items: center; gap: var(--s-2); border: 1px solid var(--line-2); border-radius: 999px; padding: 0 12px; color: var(--ink); background: var(--type-bg); white-space: nowrap; cursor: pointer; }
.type-tab:hover { border-color: var(--ink-3); }
.type-tab[aria-pressed="true"] { color: var(--bg); background: var(--ink); border-color: var(--ink); }
.type-tab__name { font-size: var(--fs-sm); font-weight: var(--w-semibold); line-height: var(--lh-snug); }
.type-tab__count { font-size: var(--fs-sm); color: var(--ink-3); }
.type-tab[aria-pressed="true"] .type-tab__count { color: color-mix(in srgb, var(--bg) 75%, var(--ink)); }
.type-description { color: var(--ink-3); }

[data-type-color] { --type-accent: #879493; --type-bg: color-mix(in srgb, var(--type-accent) 16%, var(--bg)); }
[data-type-color="grant"] { --type-accent: #46a879; }
[data-type-color="micro_grant"] { --type-accent: #8fb84a; }
[data-type-color="accelerator"] { --type-accent: #658ce6; }
[data-type-color="vc"] { --type-accent: #a378d1; }
[data-type-color="fellowship"] { --type-accent: #cc7097; }
[data-type-color="residency"] { --type-accent: #42a9b4; }
[data-type-color="competition"] { --type-accent: #e38b4e; }
[data-type-color="credits"] { --type-accent: #caa33b; }
.row__type { justify-self: start; display: inline-flex; align-items: baseline; gap: 5px; padding: 2px 8px; border-radius: var(--r-1); background: var(--type-bg); color: var(--ink); font-size: var(--fs-xs); font-weight: var(--w-medium); line-height: var(--lh-snug); overflow-wrap: anywhere; }
.row__type::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--type-accent); flex: none; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 0 var(--s-4); border-radius: var(--r-2); border: 1px solid transparent; background: none; text-decoration: none; font-size: var(--fs-sm); font-weight: var(--w-medium); cursor: pointer; white-space: nowrap; transition: background var(--dur-1), border-color var(--dur-1), color var(--dur-1); }
.btn--primary { background: var(--ink); color: var(--bg); }
.btn--primary:hover { background: color-mix(in srgb, var(--ink) 85%, var(--bg)); }
.btn--quiet { border-color: var(--line-2); color: var(--ink); background: var(--bg); }
.btn--quiet:hover { border-color: var(--ink-3); }
.btn--text { padding: 0 var(--s-2); color: var(--ink-2); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; font-weight: var(--w-regular); }
.btn--text:hover { color: var(--ink); }
.btn[aria-disabled="true"] { opacity: 0.55; pointer-events: none; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn--lg { min-height: 48px; padding: 0 var(--s-5); font-size: var(--fs-base); }

/* ---------- closing today and this week: compact strip ---------- */

/* ---------- planner: sections by date, rows led by a date block ---------- */
.planner { padding-bottom: var(--s-8); }
.pl-sec { margin-top: var(--s-8); }
.pl-sec:first-child { margin-top: var(--s-2); }
.pl-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s-1) var(--s-3); padding-bottom: var(--s-2); border-bottom: 1px solid var(--ink); }
.pl-h { font-size: var(--fs-lg); font-weight: var(--w-semibold); letter-spacing: var(--track-tight); display: inline-flex; align-items: baseline; gap: var(--s-2); }
.pl-h .c { font-size: var(--fs-sm); font-weight: var(--w-regular); color: var(--ink-3); }
.pl-note { font-size: var(--fs-sm); color: var(--ink-3); }
.pl-empty { padding: var(--s-4) 0; color: var(--ink-2); font-size: var(--fs-sm); border-bottom: 1px solid var(--line); }
.pl-list { list-style: none; margin: 0; padding: 0; }
.pl-row { display: grid; grid-template-columns: minmax(0, 1fr) var(--tap); align-items: center; border-bottom: 1px solid var(--line); }
.pl-main { display: grid; grid-template-columns: 48px minmax(0, 1fr) 150px; gap: var(--s-4); align-items: center; min-height: 72px; padding: var(--s-3) var(--s-2) var(--s-3) var(--s-2); color: inherit; text-decoration: none; transition: background var(--dur-1); }
.pl-main:hover { background: var(--bg-hover); }
.pl-main:hover .pl-name { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.pl-main:focus-visible { outline-offset: -2px; border-radius: var(--r-2); }
.pl-main--dated { grid-template-columns: 48px 36px minmax(0, 1fr) 150px; }
.pl-lead, .pl-logo { display: grid; place-items: center; }
.pl-lead .logo { width: 36px; height: 36px; }
.pl-date { display: grid; justify-items: center; align-content: center; width: 48px; height: 52px; border: 1px solid var(--line-2); border-radius: var(--r-2); background: var(--bg); line-height: 1; }
.pl-date b { font-size: var(--fs-xl); font-weight: var(--w-semibold); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.pl-date span { margin-top: 3px; font-size: var(--fs-xs); color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.04em; }
.pl-date--soon { border-color: var(--soon-ink); }
.pl-date--soon b { color: var(--soon-ink); }
.pl-date--today { background: var(--today-bg); border-color: var(--today-bg); }
.pl-date--today b, .pl-date--today span { color: var(--bg); }
.pl-body { display: grid; gap: 2px; min-width: 0; }
.pl-name { font-weight: var(--w-medium); line-height: var(--lh-snug); overflow-wrap: anywhere; }
.pl-meta { font-size: var(--fs-sm); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-meta i { font-style: normal; color: var(--ink-3); }
.pl-marks { display: flex; flex-wrap: wrap; align-items: center; gap: 2px var(--s-3); margin-top: 2px; }
.pl-marks > * { margin-top: 0; }
.pl-marks .unverified { font-size: var(--fs-xs); }
.pl-when { justify-self: end; text-align: right; font-size: var(--fs-sm); color: var(--ink-2); white-space: nowrap; }
.pl-when--week { color: var(--soon-ink); font-weight: var(--w-semibold); }
.pl-when--today { color: var(--today-bg); }
.pl-when--anytime { color: var(--open-ink); font-weight: var(--w-medium); }
.pl-when--closed, .pl-when--unknown { color: var(--ink-3); }
.pl-new { display: inline-flex; align-items: center; margin-left: var(--s-2); padding: 1px 6px; border-radius: var(--r-1); background: var(--ink); color: var(--bg); font-size: var(--fs-xs); font-weight: var(--w-semibold); vertical-align: 2px; }
.btn .pl-new { margin: 0 2px 0 0; vertical-align: 0; }
.pl-more { padding: var(--s-4) 0; border-bottom: 1px solid var(--line); }
.pl-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: var(--s-2); padding-top: var(--s-4); }
.pl-card { display: grid; gap: var(--s-2); align-content: space-between; min-height: 92px; padding: var(--s-4); text-align: left; color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-3); background: var(--type-bg); cursor: pointer; transition: border-color var(--dur-1); }
.pl-card:hover { border-color: var(--ink-3); }
.pl-card__n { font-size: var(--fs-xl); font-weight: var(--w-semibold); line-height: 1; letter-spacing: -0.02em; }
.pl-card__l { font-size: var(--fs-sm); color: var(--ink-2); }
.pl-fold { border-bottom: 1px solid var(--line); }
.pl-fold > summary { list-style: none; display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s-1) var(--s-3); min-height: var(--tap); padding-block: var(--s-3); cursor: pointer; border-top: 1px solid var(--line-2); }
.pl-fold > summary::-webkit-details-marker { display: none; }
.pl-fold > summary .pl-h { color: var(--ink-2); }
.pl-fold > summary::before { content: ''; width: 7px; height: 7px; margin-right: 4px; border-right: 1.5px solid var(--ink-2); border-bottom: 1.5px solid var(--ink-2); transform: rotate(-45deg); transition: transform var(--dur-1); align-self: center; }
.pl-fold[open] > summary::before { transform: rotate(45deg); }
.pl-fold > summary:hover .pl-h { color: var(--ink); }
.pl-sec + .pl-fold { margin-top: var(--s-10); }
.pl-fold + .pl-fold { margin-top: 0; }
.pl-fold > summary:focus-visible { outline-offset: 2px; }
.pl-ai { padding-bottom: var(--s-12); font-size: var(--fs-sm); color: var(--ink-3); }
.planner .empty { padding: var(--s-10) 0; border-top: 1px solid var(--line); }

/* ---------- toolbar: search, status, one "More filters" ---------- */
.switchbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); }
.switchbar .type-tabs { padding-block: var(--s-2); }
.toolbar__in { display: flex; align-items: center; gap: var(--s-2); padding-top: var(--s-4); }
.search { position: relative; flex: 1 1 300px; min-width: 0; max-width: 380px; }
.search input { width: 100%; height: var(--tap); padding: 0 40px 0 40px; border: 1px solid var(--line-2); border-radius: var(--r-2); background: var(--bg); font-size: var(--fs-sm); }
.search input::placeholder { color: var(--ink-3); }
.search input:hover { border-color: var(--ink-3); }
.search input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 28%, transparent); }
.search__icon { position: absolute; left: 13px; top: 50%; translate: 0 -50%; width: 16px; height: 16px; color: var(--ink-3); pointer-events: none; }
.kbd { position: absolute; right: 10px; top: 50%; translate: 0 -50%; min-width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid var(--line-2); border-radius: var(--r-1); font-size: var(--fs-xs); color: var(--ink-3); pointer-events: none; }
.search input:focus ~ .kbd { opacity: 0; }
.morebtn { margin-left: auto; }
.savedbtn .c, .morebtn .c { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-pill); background: var(--ink); color: var(--bg); font-size: var(--fs-xs); }
.savedbtn .c:empty { display: none; }
.savedbtn[aria-pressed="true"] { border-color: var(--ink); background: var(--bg-sunken); }
.morebtn .c { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-pill); background: var(--ink); color: var(--bg); font-size: var(--fs-xs); }
.morebtn[aria-expanded="true"] { border-color: var(--ink); }

.panel { border-top: 1px solid var(--line); padding-block: var(--s-4) var(--s-5); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4) var(--s-8); }
.panel__group { display: grid; gap: var(--s-2); align-content: start; min-width: 0; }
.panel__label { font-size: var(--fs-xs); color: var(--ink-3); font-weight: var(--w-medium); }
.select { position: relative; display: block; }
.select select { appearance: none; width: 100%; min-height: var(--tap); padding: 0 34px 0 var(--s-3); border: 1px solid var(--line-2); border-radius: var(--r-2); background: var(--bg); font-size: var(--fs-sm); cursor: pointer; }
.select select:hover { border-color: var(--ink-3); }
.select::after { content: ''; position: absolute; right: 14px; top: 50%; width: 6px; height: 6px; border-right: 1.5px solid var(--ink-3); border-bottom: 1.5px solid var(--ink-3); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.check { display: inline-flex; align-items: center; gap: var(--s-2); min-height: var(--tap); font-size: var(--fs-sm); color: var(--ink-2); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); margin: 0; }

/* ---------- results bar ---------- */
.resbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); padding-block: var(--s-4) var(--s-2); }
.resbar__count { font-size: var(--fs-sm); color: var(--ink-2); }
.resbar__count b { color: var(--ink); font-weight: var(--w-semibold); }
.resbar__end { margin-left: auto; display: flex; flex-wrap: wrap; gap: var(--s-2); }
.elig { display: inline-flex; align-items: center; gap: var(--s-2); min-height: 32px; padding: 0 4px 0 var(--s-3); border: 1px solid var(--ink); border-radius: var(--r-pill); font-size: var(--fs-sm); }
.elig__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--open-ink); flex: none; }
.elig__who { color: var(--ink-2); }
.elig button { border: 0; background: var(--bg-sunken); border-radius: var(--r-pill); min-height: 26px; padding: 0 var(--s-3); font-size: var(--fs-xs); font-weight: var(--w-medium); cursor: pointer; }
.elig button:hover { background: var(--bg-hover); text-decoration: underline; }

/* ---------- list ---------- */
.directory { padding-bottom: var(--s-16); }
.list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.group { padding: var(--s-6) 0 var(--s-2); font-size: var(--fs-xs); font-weight: var(--w-semibold); color: var(--ink); border-bottom: 1px solid var(--line); display: flex; gap: var(--s-2); }
.group:first-child { padding-top: var(--s-3); }
.group .c { color: var(--ink-3); font-weight: var(--w-regular); }
.group--type { align-items: baseline; font-size: var(--fs-base); }
.group--type h3 { font-size: inherit; font-weight: inherit; }
.row { border-bottom: 1px solid var(--line); }
.row__head { display: grid; grid-template-columns: minmax(0, 1fr) var(--tap); align-items: center; }
.row__main { display: grid; grid-template-columns: 36px minmax(0, 1fr) 128px 168px 188px; gap: var(--s-4); align-items: center; width: 100%; min-height: 68px; padding: var(--s-3) var(--s-2) var(--s-3) var(--s-3); border: 0; background: transparent; text-align: left; cursor: pointer; transition: background var(--dur-1); color: inherit; text-decoration: none; }
.row__main:hover { background: var(--bg-hover); }
.row__main:hover .row__name { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.row__main:focus-visible { outline-offset: -2px; border-radius: var(--r-2); }
.row__main[aria-expanded="true"] { background: var(--bg-sunken); }
.row__head:has(.row__main[aria-expanded="true"]) { background: var(--bg-sunken); }
.row__title { display: grid; min-width: 0; }
.row__name { font-weight: var(--w-medium); line-height: var(--lh-snug); overflow-wrap: anywhere; }
.row__org { font-size: var(--fs-sm); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row__maybe { font-size: var(--fs-xs); color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; margin-top: 2px; }
.row__inv { font-size: var(--fs-xs); color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; margin-top: 2px; }
.row__inv::before { content: ''; width: 9px; height: 9px; border-radius: 2px; box-shadow: inset 0 0 0 1.5px currentColor; flex: none; }
.row__no { font-size: var(--fs-xs); color: var(--ink-3); display: inline-flex; align-items: center; gap: 6px; margin-top: 2px; }
.row__no::before { content: ''; width: 9px; height: 9px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px currentColor; flex: none; }
.row__maybe::before { content: ''; width: 9px; height: 9px; border-radius: 50%; border: 1.5px dashed currentColor; flex: none; }
.row__region { font-size: var(--fs-sm); color: var(--ink-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.row__region { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; white-space: normal; }
.row__when { display: grid; justify-items: end; gap: 2px; text-align: right; }
.dl { font-size: var(--fs-sm); color: var(--ink-2); }
.when__sub { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 2px var(--s-2); }
.save { width: var(--tap); height: var(--tap); border: 0; background: transparent; border-radius: var(--r-2); display: grid; place-items: center; cursor: pointer; color: var(--ink-3); }
.save:hover { color: var(--ink); background: var(--bg-hover); }
.save svg { width: 18px; height: 18px; }
.save[aria-pressed="true"] { color: var(--ink); }
.save[aria-pressed="true"] svg path { fill: currentColor; }

/* logo or neutral letter badge, same frame every time */
.logo { width: 36px; height: 36px; border-radius: var(--r-2); border: 1px solid var(--line); background: var(--bg); display: grid; place-items: center; overflow: hidden; flex: none; }
.logo img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.logo--letter { background: var(--bg-sunken); color: var(--ink-2); font-size: var(--fs-sm); font-weight: var(--w-semibold); }
.logo--lg { width: 56px; height: 56px; border-radius: var(--r-3); }
.logo--lg.logo--letter { font-size: var(--fs-xl); }

/* expanded detail */
.row__detail { padding: var(--s-2) var(--s-3) var(--s-6) calc(36px + var(--s-4) + var(--s-3)); background: var(--bg-sunken); }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--s-4) var(--s-6); margin: 0 0 var(--s-5); max-width: 900px; }
.facts dt { font-size: var(--fs-xs); color: var(--ink-3); margin-bottom: 2px; }
.facts dd { margin: 0; font-size: var(--fs-sm); overflow-wrap: anywhere; }
.facts__wide { grid-column: 1 / -1; }
.facts dd.due { color: var(--unverified-ink); }
.actions { display: flex; flex-wrap: wrap; gap: var(--s-2); }

/* ---------- status: shape + colour + words ---------- */
.badge { display: inline-flex; align-items: center; gap: 7px; min-height: 22px; font-size: var(--fs-sm); font-weight: var(--w-medium); white-space: nowrap; }
.badge i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.badge--open { color: var(--open-ink); }
.badge--open i { background: currentColor; }
.badge--closing { color: var(--soon-ink); }
.badge--closing i { background: conic-gradient(currentColor 0 50%, transparent 50% 100%); box-shadow: inset 0 0 0 1.5px currentColor; }
.badge--today { color: var(--today-ink); background: var(--today-bg); padding: 0 8px; border-radius: var(--r-1); }
.badge--today i { background: currentColor; border-radius: 1px; transform: rotate(45deg) scale(0.85); }
.badge--closed { color: var(--closed-ink); }
.badge--closed i { box-shadow: inset 0 0 0 1.5px currentColor; }
.badge--opens { color: var(--opens-ink); }
.badge--opens i { box-shadow: inset 0 0 0 1.5px currentColor; background: radial-gradient(currentColor 0 1.6px, transparent 2px); }
.badge--muted { color: var(--ink-2); }
.badge--muted i { box-shadow: inset 0 0 0 1.5px currentColor; }

.unverified { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-xs); font-weight: var(--w-medium); color: var(--unverified-ink); white-space: nowrap; }
.unverified::before { content: ''; width: 10px; height: 10px; border-radius: 50%; border: 1.5px dashed currentColor; flex: none; }

/* ---------- empty and more ---------- */
.empty { padding: var(--s-16) 0; }
.empty__title { font-size: var(--fs-xl); font-weight: var(--w-medium); letter-spacing: var(--track-tight); }
.empty__sub { margin-top: var(--s-2); color: var(--ink-2); }
.empty .actions { margin-top: var(--s-5); }
.more { display: flex; margin: var(--s-8) auto 0; }
.loading { padding: var(--s-10) 0; color: var(--ink-3); }

/* ---------- pages: program, needs checking, about ---------- */
.page { padding-block: var(--s-10) var(--s-16); }
.crumbs { font-size: var(--fs-sm); color: var(--ink-3); margin-bottom: var(--s-6); display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--s-2); }
.crumbs a { color: var(--ink-2); display: inline-flex; min-height: var(--tap); align-items: center; }
.phead { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s-4); align-items: center; }
.phead h1, .page h1 { font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.5rem); line-height: var(--lh-tight); letter-spacing: var(--track-tight); font-weight: var(--w-semibold); text-wrap: balance; }
.phead h1, .phead__org { overflow-wrap: anywhere; }
.phead__org { color: var(--ink-2); margin-top: var(--s-1); }
.poffer { margin-top: var(--s-4); font-size: var(--fs-lg); font-weight: var(--w-medium); max-width: var(--measure); overflow-wrap: anywhere; }
.pstatus { margin-top: var(--s-6); display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-4); }
.pstatus .when { color: var(--ink-2); }
.page .actions { margin-top: var(--s-6); }
.block { margin-top: var(--s-12); padding-top: var(--s-6); border-top: 1px solid var(--line); max-width: 900px; }
.block h2 { font-size: var(--fs-sm); font-weight: var(--w-semibold); margin-bottom: var(--s-4); }
.block p { max-width: var(--measure); color: var(--ink-2); }
.block p + p { margin-top: var(--s-3); }
.fit { display: inline-flex; align-items: center; gap: var(--s-2); font-weight: var(--w-medium); margin-bottom: var(--s-4); }
.fit i { width: 10px; height: 10px; border-radius: 50%; }
.fit--yes i { background: var(--open-ink); }
.fit--maybe i { border: 1.5px dashed var(--ink-2); }
.fit--no i { box-shadow: inset 0 0 0 1.5px var(--closed-ink); }
.similar { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.similar a { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: var(--s-4); align-items: center; padding: var(--s-3) 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.similar a:hover .row__name { text-decoration: underline; text-underline-offset: 3px; }
.lead { margin-top: var(--s-3); font-size: var(--fs-lg); color: var(--ink-2); max-width: var(--measure); }
.prose { max-width: var(--measure); }
.prose h2 { font-size: var(--fs-xl); font-weight: var(--w-semibold); letter-spacing: var(--track-tight); margin: var(--s-10) 0 var(--s-3); }
.prose p, .prose li { color: var(--ink-2); }
.prose p + p { margin-top: var(--s-3); }
.prose ul { padding-left: 1.2em; margin: var(--s-3) 0 0; }
.prose li + li { margin-top: var(--s-2); }
.prose b { color: var(--ink); font-weight: var(--w-medium); }

/* ---------- dialogs and toast ---------- */
dialog { border: 0; padding: 0; border-radius: var(--r-3); background: var(--bg); color: var(--ink); box-shadow: var(--shadow-pop); width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 32px); }
dialog::backdrop { background: rgb(13 15 14 / 0.45); }
.dlg { padding: var(--s-6); display: grid; gap: var(--s-4); }
.dlg h2 { font-size: var(--fs-xl); font-weight: var(--w-semibold); letter-spacing: var(--track-tight); line-height: var(--lh-snug); }
.dlg__sub { color: var(--ink-2); font-size: var(--fs-sm); }
.field { display: grid; gap: 6px; }
.field label { font-size: var(--fs-sm); font-weight: var(--w-medium); }
.field__hint { font-size: var(--fs-xs); color: var(--ink-3); }
.dlg__actions { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-2); }
.dlg__actions .btn--primary { flex: 1 1 auto; }
.dlg__privacy { font-size: var(--fs-xs); color: var(--ink-3); }
.dlg textarea { width: 100%; min-height: 220px; padding: var(--s-3); border: 1px solid var(--line-2); border-radius: var(--r-2); background: var(--bg-sunken); font-size: var(--fs-xs); line-height: 1.5; resize: vertical; }
.toast { position: fixed; left: 50%; bottom: var(--s-6); translate: -50% 0; z-index: 80; background: var(--ink); color: var(--bg); padding: var(--s-3) var(--s-4); border-radius: var(--r-2); font-size: var(--fs-sm); box-shadow: var(--shadow-pop); max-width: calc(100vw - 32px); opacity: 0; transition: opacity var(--dur-2) var(--ease-out); pointer-events: none; }
.toast.is-shown { opacity: 1; }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); padding: var(--s-10) 0 var(--s-12); color: var(--ink-2); font-size: var(--fs-sm); }
.foot__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: var(--s-8); }
.foot h2 { font-size: var(--fs-sm); font-weight: var(--w-semibold); color: var(--ink); margin-bottom: var(--s-2); }
.foot p { max-width: 48ch; }
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li a { display: inline-flex; min-height: 32px; align-items: center; }
.foot__base { margin-top: var(--s-8); color: var(--ink-3); font-size: var(--fs-xs); }

/* ---------- responsive ---------- */
@media (max-width: 1020px) {
  .row__main { grid-template-columns: 36px minmax(0, 1fr) 104px 120px 144px; }
}
@media (max-width: 760px) {
  html { scroll-padding-top: 76px; }
  .nav a { padding: 0 var(--s-2); }
  .intro { padding-block: var(--s-8) var(--s-6); }
  .intro__lead { font-size: var(--fs-base); }
  .toolbar__in { flex-wrap: wrap; gap: var(--s-2); padding-block: var(--s-2); }
  .search { flex: 1 1 0; max-width: none; }
  .kbd { display: none; }
  .morebtn { margin-left: 0; padding: 0 var(--s-3); }
  .toolbar__in { padding-top: var(--s-3); }
  .toolbar__in .search { flex: 1 1 100%; }
  .toolbar__in .btn { flex: 1 1 0; padding: 0 var(--s-2); }
  .pl-sec { margin-top: var(--s-6); }
  .pl-main { grid-template-columns: 44px minmax(0, 1fr); grid-template-areas: 'lead body' 'lead when'; gap: 2px var(--s-3); padding: var(--s-3) 0; align-items: start; }
  .pl-lead { grid-area: lead; }
  .pl-main--dated { grid-template-columns: 44px minmax(0, 1fr); }
  .pl-logo { display: none; }
  .pl-date { width: 44px; height: 48px; }
  .pl-date b { font-size: var(--fs-lg); }
  .pl-body { grid-area: body; }
  .pl-when { grid-area: when; justify-self: start; text-align: left; font-size: var(--fs-xs); }
  .pl-meta { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .pl-cards { grid-template-columns: 1fr 1fr; }
  .panel { grid-template-columns: 1fr; gap: var(--s-4); }
  .resbar__end { margin-left: 0; width: 100%; }
  .resbar__end .btn { flex: 1 1 auto; }
  .row__main { grid-template-columns: 36px minmax(0, 1fr); grid-template-areas: 'logo title' 'logo type' 'logo when'; gap: var(--s-1) var(--s-3); padding: var(--s-3) 0 var(--s-3) 0; align-items: start; }
  .row__main .logo { grid-area: logo; }
  .row__title { grid-area: title; }
  .row__type { grid-area: type; }
  .row__region { display: none; }
  .row__when { grid-area: when; justify-items: start; text-align: left; display: flex; flex-wrap: wrap; align-items: center; gap: 2px var(--s-3); }
  .when__sub { justify-content: flex-start; }
  .row__detail { padding: var(--s-2) 0 var(--s-5); background: transparent; }
  .row__main[aria-expanded="true"], .row__head:has(.row__main[aria-expanded="true"]) { background: transparent; }
  .facts { grid-template-columns: 1fr 1fr; gap: var(--s-3) var(--s-4); }
  .actions .btn { flex: 1 1 auto; }
  .foot__grid { grid-template-columns: 1fr; gap: var(--s-6); }
  .phead { grid-template-columns: 1fr; }
}
@media (max-width: 400px) { .facts { grid-template-columns: 1fr; } .nav a.nav__long { display: none; } }
@media (hover: none) { .row__main:hover, .pl-main:hover { background: transparent; } }
@media (max-height: 560px) { .switchbar { position: static; } html { scroll-padding-top: 0; } }
@media print { .switchbar, .toolbar__in, .top, .foot, .save, .pl-cards { display: none; } .pl-fold > .pl-list { display: block; } }
