/* OpenHR Jobs. Plain CSS, light and dark, no framework. */

:root {
  /* shadcn/ui's neutral theme (https://ui.shadcn.com, MIT), written out as plain CSS, with
     OpenHR blue (#3e63dd) for the logo, ticks, the selected tab count and the main action.
     Every other blue is #3e63dd mixed in OKLab with white, black or the dark page, so the hue
     never drifts toward purple: hover = 10% black; soft = 8% blue on white (light) or 28% blue
     on #0a0a0a (dark). Text in the blue uses --accent-text, which in dark mode is 35% white
     (#7d9ced, 5.7:1 on the darkest card colour) because #3e63dd itself is only 3.8:1 there.
     Wide-gamut screens get the same blues in Display P3 (block below).
     bg = page and header; surface = cards and panels; surface-2 = muted fills (tab bar, hover);
     input = borders of buttons and fields; control-border = tick boxes, darker so they're easy to see. */
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f5f5f5;
  --text: #0a0a0a;
  --text-soft: #5c5c5c;
  --muted: #737373;
  --border: #e5e5e5;
  --input: #e5e5e5;
  --input-bg: #ffffff;
  --hover: #f5f5f5;
  --tab-on: #ffffff;
  --tab-on-border: transparent;
  --control-border: #8f8f8f;
  --accent: #3e63dd;
  --accent-hover: #3555c0;
  --accent-ink: #ffffff;
  --accent-soft: #eef3fe;
  --accent-text: #3e63dd;
  --accent-text-hover: #3555c0;
  --ring: rgba(62, 99, 221, 0.22);
  --warn-bg: #fff7e6;
  --warn-text: #6e4300;
  --warn-border: #f3dcaa;
  --good: #1d6b3a;
  --danger: #a3262a;
  --focus: #3e63dd;
  /* shadcn's radius scale: md 8px for controls, lg 10px, xl 14px for cards. */
  --radius-md: 0.5rem;
  --radius: 0.625rem;
  --radius-xl: 0.875rem;
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a3a3a3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  --check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
  /* Motion: strong ease-out for things that enter or respond to a press, and an
     iOS-like curve for the full-screen sheet on phones. */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0a0a;
    --surface: #171717;
    --surface-2: #262626;
    --text: #fafafa;
    --text-soft: #a1a1a1;
    --muted: #a1a1a1;
    --border: rgba(255, 255, 255, 0.1);
    --input: rgba(255, 255, 255, 0.15);
    --input-bg: rgba(255, 255, 255, 0.045);
    --hover: rgba(255, 255, 255, 0.075);
    --tab-on: rgba(255, 255, 255, 0.06);
    --tab-on-border: rgba(255, 255, 255, 0.15);
    --control-border: #6b6b6b;
    --accent: #3e63dd;
    --accent-hover: #3555c0;
    --accent-ink: #ffffff;
    --accent-soft: #17223d;
    --accent-text: #7d9ced;
    --accent-text-hover: #a3bbf4;
    --ring: rgba(62, 99, 221, 0.45);
    --warn-bg: #2b2110;
    --warn-text: #f6cf86;
    --warn-border: #4d3a14;
    --good: #7fd49c;
    --danger: #ff9a9e;
    --focus: #6a8ce9;
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.4), 0 1px 2px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.5);
    --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23737373' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    --check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0a0a0a;
  --surface: #171717;
  --surface-2: #262626;
  --text: #fafafa;
  --text-soft: #a1a1a1;
  --muted: #a1a1a1;
  --border: rgba(255, 255, 255, 0.1);
  --input: rgba(255, 255, 255, 0.15);
  --input-bg: rgba(255, 255, 255, 0.045);
  --hover: rgba(255, 255, 255, 0.075);
  --tab-on: rgba(255, 255, 255, 0.06);
  --tab-on-border: rgba(255, 255, 255, 0.15);
  --control-border: #6b6b6b;
  --accent: #3e63dd;
  --accent-hover: #3555c0;
  --accent-ink: #ffffff;
  --accent-soft: #17223d;
  --accent-text: #7d9ced;
  --accent-text-hover: #a3bbf4;
  --ring: rgba(62, 99, 221, 0.45);
  --warn-bg: #2b2110;
  --warn-text: #f6cf86;
  --warn-border: #4d3a14;
  --good: #7fd49c;
  --danger: #ff9a9e;
  --focus: #6a8ce9;
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.4), 0 1px 2px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.5);
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23737373' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  --check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
  color-scheme: dark;
}

/* Display P3 for screens that can show it (most phones, Macs and newer laptops): the blue is
   #3e63dd's own numbers read as P3, which is more vivid, and the other blues are mixed from it
   the same way as above. Other screens and older browsers keep the hex values. */
@media (color-gamut: p3) {
  @supports (color: color(display-p3 0 0 0)) {
    :root {
      --accent: color(display-p3 0.2431 0.3882 0.8667);
      --accent-hover: color(display-p3 0.2063 0.3335 0.753);
      --accent-soft: color(display-p3 0.9355 0.9531 0.9937);
      --accent-text: color(display-p3 0.2431 0.3882 0.8667);
      --accent-text-hover: color(display-p3 0.2063 0.3335 0.753);
      --ring: color(display-p3 0.2431 0.3882 0.8667 / 0.22);
      --focus: color(display-p3 0.2431 0.3882 0.8667);
    }
    @media (prefers-color-scheme: dark) {
      :root:not([data-theme="light"]) {
        --accent: color(display-p3 0.2431 0.3882 0.8667);
        --accent-hover: color(display-p3 0.2063 0.3335 0.753);
        --accent-soft: color(display-p3 0.0941 0.1328 0.2381);
        --accent-text: color(display-p3 0.4956 0.6143 0.9261);
        --accent-text-hover: color(display-p3 0.6459 0.7348 0.9542);
        --ring: color(display-p3 0.2431 0.3882 0.8667 / 0.45);
        --focus: color(display-p3 0.4222 0.5525 0.9104);
      }
    }
    :root[data-theme="dark"] {
      --accent: color(display-p3 0.2431 0.3882 0.8667);
      --accent-hover: color(display-p3 0.2063 0.3335 0.753);
      --accent-soft: color(display-p3 0.0941 0.1328 0.2381);
      --accent-text: color(display-p3 0.4956 0.6143 0.9261);
      --accent-text-hover: color(display-p3 0.6459 0.7348 0.9542);
      --ring: color(display-p3 0.2431 0.3882 0.8667 / 0.45);
      --focus: color(display-p3 0.4222 0.5525 0.9104);
    }
  }
}

*, *::before, *::after { box-sizing: border-box; }

/* hidden always wins over a component's display, except where a rule below says otherwise. */
[hidden] { display: none !important; }

/* No grey flash on tap: every control below has its own :active state instead. */
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent-text); text-underline-offset: 0.15em; touch-action: manipulation; }
/* Text links dim the moment they're pressed, like a native app. */
a:not(.button):active { opacity: 0.6; }

/* Controls fire on tap without the double-tap wait, and a long press doesn't select their label.
   Text that's content (titles, places, the post) stays selectable. */
button, .button, .tab, .chip, .filters-toggle, .link-button, .theme-toggle, .pick {
  touch-action: manipulation; -webkit-user-select: none; user-select: none;
}

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 { line-height: 1.25; margin: 0; font-weight: 600; }
h1 { font-size: 1.5rem; letter-spacing: -0.025em; }
h2 { font-size: 1.15rem; letter-spacing: -0.01em; }
h1, h2 { text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 1rem; top: -3rem; z-index: 10;
  background: var(--accent); color: var(--accent-ink); padding: 0.5rem 0.75rem; border-radius: var(--radius-md);
}
.skip-link:focus { top: 0.75rem; }

/* Side padding clears the notch when a phone is on its side (viewport-fit=cover). */
.wrap {
  max-width: 76rem; margin: 0 auto;
  padding: 0 max(1rem, env(safe-area-inset-right, 0px)) 0 max(1rem, env(safe-area-inset-left, 0px));
}

/* ---------- header ---------- */

.site-head { background: var(--bg); border-bottom: 1px solid var(--border); }
.site-head .wrap {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; min-height: 3.5rem; padding-top: 0.5rem; padding-bottom: 0.5rem;
}
.brand { font-weight: 700; font-size: 1.05rem; letter-spacing: -0.02em; color: var(--text); text-decoration: none; margin-right: auto; }
.brand span { color: var(--accent-text); }
/* Nav links are shadcn ghost buttons; the current page gets the muted fill. */
.site-nav { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.site-nav a {
  color: var(--muted); text-decoration: none; font-size: 0.875rem; font-weight: 500;
  padding: 0.375rem 0.75rem; border-radius: var(--radius-md);
}
.site-nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; flex: none; padding: 0;
  border: 1px solid transparent; border-radius: var(--radius-md); background: transparent; color: var(--text); cursor: pointer;
}
.icon { width: 1rem; height: 1rem; flex: none; }
.theme-toggle .icon { width: 1.125rem; height: 1.125rem; }
@media (max-width: 30rem) {
  .site-head .wrap { gap: 0.5rem; }
  .brand { font-size: 1rem; }
  .site-nav a { padding: 0.375rem 0.5rem; }
}

.link-button {
  background: none; border: 0; padding: 0.25rem 0; color: var(--muted); font: inherit; font-size: 0.875rem; cursor: pointer;
}

.intro { padding: 1.5rem 0 1rem; display: grid; gap: 0.5rem; }
.intro .lede { color: var(--muted); max-width: 62ch; }
.stats { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; color: var(--muted); font-size: 0.9375rem; font-variant-numeric: tabular-nums; }
.stats strong { color: var(--text); }
.stats .new-today { color: var(--text); font-weight: 600; }

/* ---------- board layout ---------- */

.board { display: grid; gap: 1rem; padding-bottom: 2rem; }
@media (min-width: 60rem) {
  .board { grid-template-columns: 17.5rem minmax(0, 1fr); align-items: start; gap: 1.5rem; }
  .filters { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); max-height: calc(100dvh - 2rem); overflow-y: auto; }
  .filters .filters-toggle { display: none; }
  .filters-body[hidden] { display: grid !important; }
}

/* Search is always in view; the other filters fold away on phones. */
.filters-form { display: grid; gap: 0.75rem; }
.search-field input { min-height: 2.5rem; }

.filters-toggle {
  width: 100%; display: flex; justify-content: flex-start; align-items: center; gap: 0.5rem;
  min-height: 2.5rem; padding: 0 0.75rem 0 1rem; border: 1px solid var(--input); border-radius: var(--radius-md);
  background: var(--input-bg); box-shadow: var(--shadow-xs); color: var(--text);
  font: inherit; font-size: 0.875rem; font-weight: 500; cursor: pointer;
}
.filters-toggle::after { content: ""; width: 1rem; height: 1rem; margin-left: auto; background: var(--select-arrow) center / 1rem no-repeat; }
.filters-toggle[aria-expanded="true"]::after { transform: rotate(180deg); }
.filters-toggle .count { color: var(--muted); font-weight: 400; }

.filters-body {
  display: grid; gap: 1rem; padding: 1rem;
  border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--surface); box-shadow: var(--shadow);
}

.field { display: grid; gap: 0.4rem; }
.field label, .field .label { font-size: 0.875rem; font-weight: 500; }
.field .hint { font-size: 0.8125rem; color: var(--muted); }

/* shadcn's Input and Select: a light border, a hint of shadow, and on focus a blue border with a soft ring. */
select, input[type="search"], input[type="text"], input[type="number"], textarea {
  width: 100%; font: inherit; color: var(--text); background-color: var(--input-bg);
  border: 1px solid var(--input); border-radius: var(--radius-md); padding: 0.375rem 0.75rem; min-height: 2.25rem;
  box-shadow: var(--shadow-xs);
}
select {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: var(--select-arrow); background-repeat: no-repeat;
  background-position: right 0.625rem center; background-size: 1rem 1rem;
  padding-right: 2.25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
select:disabled { opacity: 0.5; cursor: not-allowed; }
select:focus-visible, input:not([type="checkbox"]):focus-visible, textarea:focus-visible {
  outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px var(--ring);
}
/* 16px text on touch screens (phones zoom into anything smaller); shadcn's 14px with a mouse. */
@media (pointer: fine) and (min-width: 48rem) {
  select, input[type="search"], input[type="text"], input[type="number"] { font-size: 0.875rem; }
}

/* shadcn's Checkbox, in OpenHR blue when ticked. The border is darker than shadcn's so the box
   stands out (3:1 against the card), because ticking is how a post starts. */
input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; flex: none; margin: 0;
  width: 1.125rem; height: 1.125rem; border: 1px solid var(--control-border); border-radius: 0.3125rem;
  background: var(--input-bg) center / 0.875rem no-repeat; box-shadow: var(--shadow-xs); cursor: pointer;
}
input[type="checkbox"]:checked { background-color: var(--accent); background-image: var(--check); border-color: var(--accent); }
input[type="checkbox"]:disabled { opacity: 0.5; cursor: not-allowed; }
textarea { resize: vertical; line-height: 1.45; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }

.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; border: 0; padding: 0; margin: 0; }
.chips legend { font-size: 0.875rem; font-weight: 600; margin-bottom: 0.3rem; padding: 0; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.chip span {
  display: inline-block; padding: 0.3rem 0.7rem; border: 1px solid var(--border); border-radius: 999px;
  font-size: 0.875rem; background: var(--surface);
}
.chip input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Forced colours (Windows High Contrast) drop backgrounds, background images and shadows,
   which is how the tick boxes, chips and the selected tab show their state. Use the
   system tick box there, and outline whatever is picked. */
@media (forced-colors: active) {
  input[type="checkbox"], input[type="checkbox"]:checked { appearance: auto; background-image: none; }
  .chip input:checked + span, .tab[aria-selected="true"] { outline: 2px solid CanvasText; outline-offset: -4px; }
}

.filters-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ---------- buttons ---------- */

/* shadcn's Button. Outline is the everyday button here; primary (blue) is kept for the one main
   action, "Make a LinkedIn post"; ghost is for icon buttons. */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 2.25rem; padding: 0.375rem 1rem; border-radius: var(--radius-md); border: 1px solid var(--input);
  background-color: var(--input-bg); box-shadow: var(--shadow-xs); color: var(--text);
  font: inherit; font-size: 0.875rem; font-weight: 500; line-height: 1.25; cursor: pointer; text-decoration: none;
}
.button.primary { background-color: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.button.ghost { background-color: transparent; border-color: transparent; box-shadow: none; }
.button.icon-only { width: 2.25rem; padding: 0; }
.button[aria-pressed="true"] { background-color: var(--accent-soft); border-color: color-mix(in oklab, var(--accent) 45%, transparent); color: var(--text); }
.button:disabled { opacity: 0.5; cursor: not-allowed; }
.button.small { min-height: 2rem; padding: 0.25rem 0.75rem; gap: 0.375rem; }
.button.small.icon-only { width: 2rem; padding: 0; }

/* ---------- results ---------- */

.results-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; margin-bottom: 0.75rem;
}
.results-head .count { font-weight: 600; font-variant-numeric: tabular-nums; }
.results-head .sort { display: flex; align-items: center; gap: 0.5rem; }
.results-head .sort label { font-size: 0.875rem; color: var(--muted); }
.results-head .sort select { width: auto; max-width: 11rem; min-height: 2.25rem; padding: 0.25rem 2rem 0.25rem 0.75rem; background-position: right 0.5rem center; }
.active-filters { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.75rem; }

.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl);
  padding: 1rem 1.1rem; display: grid; gap: 0.5rem; box-shadow: var(--shadow);
}
.card h3 { font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; }
.card h3 a { color: var(--text); text-decoration: none; }
.card .where { color: var(--muted); }
.card .where .company { color: var(--text); font-weight: 500; }
.card .emoji { margin-right: 0.45rem; }

.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.tag {
  font-size: 0.75rem; font-weight: 500; padding: 0.125rem 0.5rem; border-radius: 999px; background: var(--surface-2); color: var(--text);
}
.tag.pay { font-weight: 600; }
.tag.early { background: var(--accent-soft); }
.tag.closes { background: var(--warn-bg); color: var(--warn-text); }
.tag.marked { background: var(--accent-soft); font-weight: 600; }

.warning {
  font-size: 0.875rem; color: var(--warn-text); background: var(--warn-bg); border: 1px solid var(--warn-border);
  border-radius: var(--radius-md); padding: 0.375rem 0.625rem;
}
.source { font-size: 0.8125rem; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }

/* ---------- "Copy for LinkedIn" sheet: a dialog on wide screens, a full-screen page on phones ---------- */

.sheet {
  padding: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); color: var(--text);
  width: min(44rem, calc(100vw - 2rem)); max-width: none; max-height: min(54rem, calc(100dvh - 2rem)); overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.sheet[open] { display: flex; flex-direction: column; }
.sheet::backdrop { background: rgba(0, 0, 0, 0.5); }
html.sheet-open { overflow: hidden; }
.sheet-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.625rem 0.75rem 0.625rem 1.5rem; border-bottom: 1px solid var(--border); flex: none;
}
.sheet-head h2 { font-size: 1.125rem; letter-spacing: -0.01em; }
.sheet-head .button.ghost { color: var(--muted); }
.sheet-head h2:focus { outline: none; }
.sheet-body { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; padding: 1.25rem 1.5rem; display: grid; gap: 1.25rem; align-content: start; }
.sheet-step { display: grid; gap: 0.6rem; }
.sheet-step h3 { font-size: 0.95rem; }
.sheet-step h3 label { font-size: inherit; font-weight: inherit; }
.sheet .field label { font-size: 0.875rem; font-weight: 500; }
.sheet textarea[readonly] { background: var(--surface-2); font-size: 0.9375rem; }
#sheet-post { font-size: 0.9375rem; line-height: 1.5; }
.sheet .restart .link-button { color: var(--accent-text); text-decoration: underline; padding: 0; font-size: inherit; }
.sheet-foot {
  flex: none; display: grid; gap: 0.6rem; padding: 1rem 1.5rem calc(1rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border); background: var(--bg);
}
.sheet-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.sheet-actions .button { flex: 1 1 11rem; min-height: 2.75rem; font-size: 0.9375rem; }
.sheet-note { font-size: 0.875rem; background: var(--accent-soft); color: var(--text); border-radius: var(--radius-md); padding: 0.5rem 0.75rem; }
.sheet-note .link-button { color: var(--text); font-weight: 600; text-decoration: underline; padding: 0; }
@media (max-width: 40rem) {
  .sheet {
    width: 100%; height: 100%; max-height: none; margin: 0; inset: 0; border: 0; border-radius: 0; box-shadow: none;
  }
  .sheet[open] { height: 100dvh; }
  .sheet-head { padding-top: max(0.625rem, env(safe-area-inset-top, 0px)); padding-left: 1rem; }
  .sheet-body { padding: 1rem; }
  .sheet-foot { padding-left: 1rem; padding-right: 1rem; }
}
/* 16px stops phones and tablets zooming in when a box is tapped. */
@media (max-width: 40rem), (pointer: coarse) {
  .sheet textarea, .sheet textarea[readonly], #sheet-post { font-size: 1rem; }
}

/* Opening the sheet: a dialog settles in from slightly smaller on wide screens (it stays
   centred, like any modal); on phones the full-screen page slides up from the bottom edge.
   Closing is instant. With reduced motion it only fades. */
@keyframes sheet-pop { from { transform: scale(0.96); opacity: 0; } }
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes fade-in { from { opacity: 0; } }
@media (prefers-reduced-motion: no-preference) {
  .sheet[open] { animation: sheet-pop 200ms var(--ease-out); }
  .sheet[open]::backdrop { animation: fade-in 200ms var(--ease-out); }
}
@media (prefers-reduced-motion: no-preference) and (max-width: 40rem) {
  .sheet[open] { animation: sheet-up 380ms var(--ease-drawer); }
}
@media (prefers-reduced-motion: reduce) {
  .sheet[open], .sheet[open]::backdrop { animation: fade-in 150ms ease; }
}

/* ---------- tabs, row cards and the post bar ---------- */

.tabs-bar { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 0.5rem 0; }
.tabs {
  display: flex; gap: 0; padding: 3px; border-radius: var(--radius); background: var(--surface-2);
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 0.375rem;
  min-height: 2.25rem; padding: 0.25rem 0.75rem; border: 1px solid transparent; border-radius: var(--radius-md); background: transparent;
  color: var(--text-soft); font: inherit; font-size: 0.875rem; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.tab[aria-selected="true"] { background: var(--tab-on); border-color: var(--tab-on-border); color: var(--text); box-shadow: var(--shadow); }
.tab .count {
  font-variant-numeric: tabular-nums;
  min-width: 1.25rem; padding: 0 0.375rem; border-radius: 999px; background: var(--border); color: var(--text);
  font-size: 0.75rem; font-weight: 500; line-height: 1.25rem; text-align: center;
}
.tab[aria-selected="true"] .count { background: var(--accent); color: var(--accent-ink); }
@media (max-width: 30rem) {
  .tab { padding: 0.25rem 0.375rem; gap: 0.25rem; }
  .tab .count { min-width: 1.125rem; padding: 0 0.25rem; font-size: 0.6875rem; line-height: 1.125rem; }
}
.tabpanel { display: grid; gap: 0.75rem; }
.tabpanel:focus { outline: none; }
.tabpanel:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }

.card.row { grid-template-columns: minmax(0, 1fr) auto; align-items: start; column-gap: 0.75rem; padding: 1rem; }
.card.row.can-pick { grid-template-columns: auto minmax(0, 1fr) auto; }
.row-body { display: grid; gap: 0.3rem; min-width: 0; }
.card.row h3 { font-size: 1rem; }
.card.row .where { font-size: 0.875rem; }
.pick {
  align-self: stretch; display: flex; justify-content: center; width: 2.75rem;
  margin: -1rem 0 -1rem -1rem; padding-top: calc(1rem + 1px); cursor: pointer;
}
span.pick { cursor: default; }
#results .tabs-bar { margin-bottom: -0.25rem; }
/* On the board's rows the details read as one line of text, not chips, so cards stay short on phones. */
.card.row .tags { display: block; font-size: 0.8125rem; color: var(--muted); line-height: 1.45; }
.card.row .tag { display: inline; padding: 0; border-radius: 0; background: none; color: inherit; font-size: inherit; font-weight: 400; }
.card.row .tag + .tag::before { content: " · "; color: var(--muted); font-weight: 400; }
.card.row .tag.pay { color: var(--text); font-weight: 600; }
.card.row .tag.closes { color: var(--warn-text); background: none; }
.card.row .tag.marked { color: var(--accent-text); background: none; font-weight: 600; }
.card.row .tag.early { background: none; }
.card.row .actions { margin-top: 0.15rem; }
#results .tabpanel { margin-top: 0.5rem; }
.card.is-picked { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.card.row .button.small { white-space: nowrap; }
.row-note { font-size: 0.8125rem; color: var(--muted); }

.pickbar {
  position: sticky; bottom: 0; z-index: 5; margin: 0.25rem -1rem 0;
  padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 0.75rem;
  background: var(--bg); border-top: 1px solid var(--border); box-shadow: 0 -4px 12px -2px rgba(0, 0, 0, 0.08);
}
.pickbar-status { font-weight: 600; font-size: 0.9375rem; font-variant-numeric: tabular-nums; }
.pickbar-status .hint { display: block; font-weight: 400; font-size: 0.8125rem; }
.pickbar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.pickbar-actions .button.primary { min-height: 2.75rem; padding-left: 1.1rem; padding-right: 1.1rem; font-size: 0.9375rem; }
@media (max-width: 40rem) {
  .pickbar-actions { flex: 1 1 100%; }
  .pickbar-actions .button.primary { flex: 1 1 auto; }
}
@media (min-width: 40.01rem) {
  .pickbar { margin: 0.25rem 0 0; bottom: 1rem; border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); }
}

.group-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.4rem 1rem; }
.group-head h3 { font-size: 1rem; }
.group-head .hint { font-weight: 400; }
.cards > li.group-head { margin-top: 0.5rem; }
.cards > li.group-head:first-child { margin-top: 0; }
.hidden-link { text-align: center; margin-top: 0.25rem; }
#hidden-title:focus { outline: none; }

.more { display: flex; justify-content: center; margin-top: 1rem; }
.empty, .loading, .error {
  padding: 2rem 1rem; text-align: center; color: var(--muted);
  border: 1px dashed var(--border); border-radius: var(--radius-xl); background: transparent;
}
.error { color: var(--danger); }

/* ---------- prose pages ---------- */

.prose { max-width: 46rem; padding-top: 1.5rem; padding-bottom: 2.5rem; display: grid; gap: 1rem; }
.prose h2 { margin-top: 1rem; }
.prose ul, .prose dl { margin: 0; padding-left: 1.25rem; display: grid; gap: 0.35rem; }
.prose dl { padding-left: 0; }
.prose dt { font-weight: 600; }
.prose dd { margin: 0 0 0.5rem; color: var(--muted); }

/* ---------- tables (status) ---------- */

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 0.875rem; }
th, td { text-align: left; padding: 0.5rem 0.7rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-weight: 500; color: var(--muted); background: transparent; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.banner { padding: 0.75rem 1rem; border-radius: var(--radius); border: 1px solid var(--warn-border); background: var(--warn-bg); color: var(--warn-text); }
.banner.ok { border-color: var(--border); background: var(--surface); color: var(--text); }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 1rem; display: grid; gap: 0.75rem; box-shadow: var(--shadow); }
.section { display: grid; gap: 0.75rem; padding: 0.75rem 0; }

/* ---------- posts page ---------- */

.posts-layout { display: grid; gap: 1.25rem; padding-bottom: 2rem; }
@media (min-width: 64rem) { .posts-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.controls-row { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); }
.slot { border: 1px solid var(--border); border-radius: var(--radius); padding: 0.85rem; display: grid; gap: 0.5rem; background: var(--surface); }
.slot.is-posted { opacity: 0.6; }
.slot-head { font-weight: 600; }
.slot .note { font-size: 0.8125rem; color: var(--muted); }
.output textarea { font-family: inherit; min-height: 22rem; background: var(--surface-2); }
.output .comment textarea { min-height: 8rem; }
.counter { font-size: 0.8125rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.counter.over { color: var(--danger); font-weight: 600; }
.warnings { margin: 0; padding: 0.6rem 0.75rem 0.6rem 1.75rem; color: var(--warn-text); font-size: 0.875rem;
  background: var(--warn-bg); border: 1px solid var(--warn-border); border-radius: var(--radius-md); display: grid; gap: 0.25rem; }
fieldset.panel { margin: 0; min-width: 0; }
fieldset.panel legend { padding: 0 0.25rem; font-weight: 600; }
.check { display: flex; align-items: flex-start; gap: 0.5rem; font-size: 0.9375rem; cursor: pointer; }
.check input { margin: 0.2rem 0 0; }
.label-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.25rem 1rem; }
.label-row label { font-size: 0.875rem; font-weight: 600; }
.slots-title { margin-top: 0.5rem; }
.slots { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.slot label { font-size: 0.875rem; font-weight: 600; }
.pin-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; }
.pin-results li {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 0.45rem 0.6rem; border: 1px solid var(--border); border-radius: var(--radius-md); font-size: 0.875rem;
}
.pin-results li.is-posted { opacity: 0.6; }
.pin-results .note { color: var(--muted); }
.pin-results li > .button { flex: none; }
@media (min-width: 64rem) { .output .panel { position: sticky; top: 1rem; } }

/* ---------- status page ---------- */

.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.35rem 1.25rem; margin: 0; }
.facts dt { font-weight: 600; }
.facts dd { margin: 0; color: var(--muted); }
@media (max-width: 30rem) { .facts { grid-template-columns: minmax(0, 1fr); } .facts dd { margin-bottom: 0.4rem; } }
.breakdown { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); align-items: start; }
caption { text-align: left; font-weight: 600; padding: 0.6rem 0.7rem; }
.late { color: var(--danger); }
ul.plain { margin: 0.35rem 0 0; padding-left: 1.1rem; }
.field.narrow { max-width: 22rem; }
.hint { font-size: 0.875rem; color: var(--muted); }

/* ---------- footer ---------- */

.site-foot { border-top: 1px solid var(--border); background: var(--bg); color: var(--muted); font-size: 0.875rem; }
.site-foot .wrap { padding-top: 1.5rem; padding-bottom: 2rem; display: grid; gap: 0.6rem; }
.site-foot details summary { cursor: pointer; color: var(--text); font-weight: 600; }
.site-foot dl { margin: 0.5rem 0 0; display: grid; gap: 0.3rem; }
.site-foot dt { color: var(--text); font-weight: 600; }
.site-foot dd { margin: 0 0 0.35rem; }

/* ---------- hover, press and motion ---------- */

/* Hover only where there's a mouse: on a phone a tap would leave the hover look stuck on. */
@media (hover: hover) and (pointer: fine) {
  a:hover { color: var(--accent-text-hover); }
  .site-nav a:hover { color: var(--text); background: var(--hover); }
  .card h3 a:hover { color: var(--accent-text); text-decoration: underline; }
  .link-button:hover { color: var(--text); text-decoration: underline; }
  .button:hover, .theme-toggle:hover, .filters-toggle:hover { background-color: var(--hover); }
  .button[aria-pressed="true"]:hover { background-color: var(--accent-soft); border-color: var(--accent); }
  .button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
  .tab:hover { color: var(--text); }
}

/* Every control answers the moment it's pressed, not when the finger lifts. */
.button:active, .theme-toggle:active, .filters-toggle:active { background-color: var(--surface-2); }
.button.primary:active { background-color: var(--accent-hover); border-color: var(--accent-hover); }
.button[aria-pressed="true"]:active { background-color: var(--accent-soft); }
.tab:active { color: var(--text); }
.chip input:active + span { border-color: var(--muted); }

@media (prefers-reduced-motion: no-preference) {
  .card, .chip span { transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease; }
  .filters-toggle::after { transition: transform 200ms var(--ease-out); }
  input[type="checkbox"] { transition: background-color 120ms ease, border-color 120ms ease; }
  .button, .tab, .theme-toggle, .filters-toggle {
    transition: transform 160ms var(--ease-out), border-color 150ms ease, background-color 150ms ease, color 150ms ease;
  }
  /* A slight press-in. Wide controls move less, so the shrink looks the same size. */
  .button:active, .tab:active, .theme-toggle:active { transform: scale(0.97); }
  .filters-toggle:active, .pickbar-actions .button.primary:active, .sheet-actions .button:active { transform: scale(0.985); }
  .button:disabled:active { transform: none; }

  /* The post bar rises from the bottom edge the first time a role is ticked. */
  .pickbar { animation: bar-up 240ms var(--ease-out); }
  @keyframes bar-up { from { transform: translateY(100%); opacity: 0; } }

  /* On phones the filters fade in under their button rather than popping in. */
  @media (max-width: 59.99rem) {
    .filters-body { animation: drop-in 180ms var(--ease-out); }
    @keyframes drop-in { from { transform: translateY(-0.25rem); opacity: 0; } }
  }
}

/* While the theme changes, nothing transitions, so every colour switches in the same frame. */
html.theme-switching *, html.theme-switching *::before, html.theme-switching *::after {
  transition: none !important; animation: none !important;
}
