/*!*************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[13].oneOf[10].use[2]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[13].oneOf[10].use[3]!./app/globals.css ***!
  \*************************************************************************************************************************************************************************************************************************************************************/
:root {
  color-scheme: light;
  /* color — light theme. The dark overrides below only reassign these, so
     every rule in the sheet is written once against the semantic names. */
  --bg: #fafaf9;
  --surface: #ffffff;
  --surface-muted: #f5f5f3;
  --field: #ffffff;
  --border: #e5e5e3;
  --border-strong: #8a8a86;
  --text: #1f1f1d;
  --text-muted: #6b6b66;
  --accent: #c2410c;
  --accent-hover: #9a3412;
  --accent-soft: #fff7ed;
  --accent-contrast: #ffffff;
  --good: #15803d;
  --good-soft: #ecfdf5;
  --good-border: #bbf7d0;
  --bad: #b91c1c;
  --bad-soft: #fef2f2;
  --warn: #92400e;
  --warn-soft: #fffbeb;
  --warn-border: #f59e0b;
  --empty-cell: #ebedf0;
  --shadow: rgba(0, 0, 0, 0.08);

  /* spacing — 4px base */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-6: 24px;

  /* radius */
  --r-1: 4px;
  --r-2: 8px;
  --r-pill: 999px;

  /* type scale (px equivalents: 11/12/13/14/16/18/22) */
  --fs-2xs: 11px;
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 14px;
  --fs-lg: 16px;
  --fs-xl: 18px;
  --fs-2xl: 22px;

  /* Published by SiteHeader from its measured height, so the meeting page's
     sticky summary offsets by the real value instead of a guessed 50px. */
  --header-h: 52px;

  /* Minimum hit size for anything clickable. Raised on coarse pointers. */
  --tap: 32px;
  /* Font size for text fields. Raised to 16px on coarse pointers — see the
     media query below; this is not a typography choice. */
  --field-fs: var(--fs-md);

  /* Heatmap: pale → saturated, read against a light page. */
  --ramp-1: #ffedd5;
  --ramp-2: #fdba74;
  --ramp-3: #f97316;
  --ramp-4: #c2410c;
  --div-low: #d73027;
  --div-midlow: #fdae61;
  --div-midhigh: #abd9e9;
  --div-high: #2c7bb6;
}

/* Dark palette, applied in two cases:
 *   1. the OS asks for dark and the reader has not overridden it, and
 *   2. the reader explicitly chose dark (ThemeToggle sets data-theme).
 * Plain CSS has no way to share one declaration block between a media query
 * and an attribute selector, so the values are listed twice. `light-dark()`
 * would collapse them, but it is too new to rely on for members' browsers.
 * Edit both blocks together. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #17171a;
    --surface: #1f1f23;
    --surface-muted: #27272c;
    --field: #15151a;
    --border: #35353c;
    --border-strong: #757582;
    --text: #ececf0;
    --text-muted: #a0a0ac;
    /* The light theme's #c2410c fails contrast on a dark surface; this is the
       same hue opened up until it passes against --surface. */
    --accent: #fb923c;
    --accent-hover: #fdba74;
    --accent-soft: #33210f;
    --accent-contrast: #1a1205;
    --good: #4ade80;
    --good-soft: #10291a;
    --good-border: #1d5436;
    --bad: #f87171;
    --bad-soft: #341717;
    --warn: #fcd34d;
    --warn-soft: #2e2510;
    --warn-border: #a16207;
    --empty-cell: #2b2b31;
    --shadow: rgba(0, 0, 0, 0.5);

    /* Heatmap: dim → bright, so "more" still reads as "stronger" on a dark page. */
    --ramp-1: #4a2d12;
    --ramp-2: #8a4b16;
    --ramp-3: #d4761f;
    --ramp-4: #fdba74;
    --div-low: #f87171;
    --div-midlow: #b45309;
    --div-midhigh: #1e5f8a;
    --div-high: #7dd3fc;
  }
}

/* Case 2 — the explicit choice. Mirror of the block above. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #17171a;
  --surface: #1f1f23;
  --surface-muted: #27272c;
  --field: #15151a;
  --border: #35353c;
  --border-strong: #757582;
  --text: #ececf0;
  --text-muted: #a0a0ac;
  --accent: #fb923c;
  --accent-hover: #fdba74;
  --accent-soft: #33210f;
  --accent-contrast: #1a1205;
  --good: #4ade80;
  --good-soft: #10291a;
  --good-border: #1d5436;
  --bad: #f87171;
  --bad-soft: #341717;
  --warn: #fcd34d;
  --warn-soft: #2e2510;
  --warn-border: #a16207;
  --empty-cell: #2b2b31;
  --shadow: rgba(0, 0, 0, 0.5);

  /* Heatmap: dim → bright, so "more" still reads as "stronger" on a dark page. */
  --ramp-1: #4a2d12;
  --ramp-2: #8a4b16;
  --ramp-3: #d4761f;
  --ramp-4: #fdba74;
  --div-low: #f87171;
  --div-midlow: #b45309;
  --div-midhigh: #1e5f8a;
  --div-high: #7dd3fc;
}

/* Explicit light wins over a dark OS — the :not() above already keeps the
   media query out of the way; this makes the scrollbars and form controls
   follow too. */
:root[data-theme="light"] { color-scheme: light; }

@media (pointer: coarse) {
  :root {
    --tap: 44px;
    /* iOS Safari zooms the whole page when a focused field computes to less
       than 16px, and does not zoom back out — the reader is left pinching to
       fit the page again after every tap into an input. 16px is the threshold,
       not a preference.
       The fix is NOT `maximum-scale=1` on the viewport: that stops the zoom by
       disabling pinch-zoom entirely, which takes away the one control someone
       with low vision has. */
    --field-fs: 16px;
  }
}

* { box-sizing: border-box; }

/* Present to assistive tech, absent on screen. Used for table captions that
   would be redundant next to a visible heading. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  -webkit-clip-path: inset(50%);
          clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans",
    "Yu Gothic UI", "Meiryo", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* One focus treatment for everything. Only the heatmap used to define one,
   so every other control fell back to whatever the browser did. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-1);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

header.site {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 10;
}
header.site .container {
  display: flex;
  align-items: center;
  gap: 24px;
}
header.site .brand {
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
}
header.site nav {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  flex-wrap: wrap;
  flex: 1 1;
}
@media (max-width: 480px) {
  header.site .container { gap: var(--s-3); }
  header.site nav { gap: var(--s-3); font-size: var(--fs-sm); }
}
header.site nav a {
  color: var(--text-muted);
  font-size: 14px;
  padding: var(--s-1) 0;
}
header.site nav a:hover { color: var(--accent); text-decoration: none; }
header.site nav a.is-active {
  color: var(--text);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--accent);
}

/* Theme switch + owner login/logout, grouped at the far right of the nav. */
.site-nav-end {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  margin-left: auto;
  flex-wrap: wrap;
}

/* Square icon-only control. The label lives in aria-label/title, so the box
   is sized by --tap rather than by its (absent) text. */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tap);
  height: var(--tap);
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-1);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
}
.icon-btn:hover:not(:disabled) {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}
.icon-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Segmented control: 自動 / ライト / ダーク as icons. */
.theme-toggle {
  display: inline-flex;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-1);
  overflow: hidden;
  background: var(--surface);
}
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tap);
  height: var(--tap);
  padding: 0;
  border: none;
  border-right: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.theme-toggle-btn:last-child { border-right: none; }
.theme-toggle-btn:hover:not(.is-active) {
  color: var(--accent);
  background: var(--accent-soft);
}
.theme-toggle-btn.is-active {
  background: var(--accent);
  color: var(--accent-contrast);
}

.owner-bar {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
}
.owner-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tap);
  height: var(--tap);
  border-radius: var(--r-1);
  background: var(--accent-soft);
  color: var(--accent);
}
/* Holds the slot while ownership resolves client-side, so the nav does not
   reflow a beat after first paint. */
.owner-bar-pending { min-width: 180px; min-height: var(--tap); }
.owner-bar input[type="password"] {
  padding: 6px 8px;
  font-size: var(--field-fs);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-1);
  background: var(--field);
  color: var(--text);
  width: 140px;
  min-height: var(--tap);
}
.owner-bar input[type="password"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
/* 「オーナートークン」 does not fit 140px once --field-fs is bumped to 16px. */
@media (pointer: coarse) {
  .owner-bar input[type="password"] { width: 170px; }
  .owner-bar-pending { min-width: 210px; }
}
.owner-bar .error { font-size: var(--fs-2xs); }

main { padding: 32px 0 64px; }

h1 { font-size: var(--fs-2xl); margin: 0 0 16px; }
h2 { font-size: var(--fs-xl); margin: 24px 0 12px; }
h3 { font-size: var(--fs-lg); margin: 16px 0 8px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  padding: 16px;
}
.card + .card { margin-top: 12px; }
.card > h2:first-child { margin-top: 0; }

.muted { color: var(--text-muted); font-size: var(--fs-sm); }
.tag {
  display: inline-block;
  padding: 2px 8px;
  font-size: var(--fs-xs);
  border-radius: var(--r-1);
  /* Neutral: a handle is a label, not something to click. These sit several
     to a row, so an accent-coloured tag multiplied the orange. */
  background: var(--surface-muted);
  color: var(--text);
  border: 1px solid var(--border);
  margin-right: 6px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}
th, td {
  border-bottom: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
  font-size: var(--fs-md);
  vertical-align: top;
}
th {
  background: var(--surface-muted);
  font-weight: 600;
  color: var(--text-muted);
  font-size: var(--fs-xs);
  letter-spacing: 0.04em;
}
td.num, th.num { text-align: right; font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; }

/* Links inside a data table are the row's subject, not a call to action.
   Painting every title with --accent made each row carry three competing
   colours (orange title, orange MVP tags, green state pill) and left the
   eye nowhere to rest — and it spent the accent on the one thing that is
   on every single row, so it stopped meaning "notable". */
tbody a {
  color: var(--text);
  text-decoration: underline;
  /* Faint and thin: a Japanese title wraps to three or four lines, and a
     full-weight underline under each of them reads as noise rather than as
     an affordance. The row hover below carries the rest of the signal. */
  -webkit-text-decoration-color: var(--border);
          text-decoration-color: var(--border);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
tbody tr:hover a {
  -webkit-text-decoration-color: var(--text-muted);
          text-decoration-color: var(--text-muted);
}
tbody a:hover {
  color: var(--accent);
  -webkit-text-decoration-color: currentColor;
          text-decoration-color: currentColor;
}
/* Only tables whose rows lead somewhere get the hover — the vote lists and
   the alias table are not navigable. */
.programs-data-table tbody tr:hover,
.meetings-data-table tbody tr:hover,
.dashboard-list tbody tr:hover { background: var(--surface-muted); }
.meetings-data-table tbody tr.meeting-gap-row:hover { background: none; }

/* ---------------------------------------------------------- form controls ---
   One appearance for every text/number/select control, light and dark. */
input[type="text"],
input[type="search"],
input[type="number"],
input[type="password"],
select {
  font: inherit;
  font-size: var(--field-fs);
  color: var(--text);
  background: var(--field);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-1);
  padding: 6px 10px;
  min-height: var(--tap);
}
input:disabled, select:disabled { opacity: 0.5; cursor: not-allowed; }
input[aria-invalid="true"] { border-color: var(--bad); }
::placeholder { color: var(--text-muted); opacity: 1; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  grid-gap: var(--s-2);
  gap: var(--s-2);
  margin: 12px 0;
}
.stat-cell {
  background: var(--accent-soft);
  border-radius: 6px;
  padding: 10px 12px;
}
.stat-cell .label { font-size: var(--fs-2xs); color: var(--text-muted); }
.stat-cell .value {
  font-size: var(--fs-xl);
  font-weight: 600;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

.error { color: var(--bad); font-size: var(--fs-sm); }
.success { color: var(--good); font-size: var(--fs-sm); }

.histogram { display: flex; align-items: flex-end; gap: 2px; height: 80px; margin: 12px 0; }
.histogram .bar {
  flex: 1 1;
  background: var(--accent);
  opacity: 0.75;
  border-radius: 2px 2px 0 0;
  position: relative;
  min-height: 2px;
}
.histogram .bar:hover { opacity: 1; }
.histogram .bar .tip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  font-size: var(--fs-2xs);
  white-space: nowrap;
  background: var(--text);
  color: var(--bg);
  padding: 2px 6px;
  border-radius: 3px;
  opacity: 0;
  transition: opacity 0.1s;
  pointer-events: none;
}
.histogram .bar:hover .tip { opacity: 1; }
.histogram-axis {
  display: flex;
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}
.histogram-axis span { flex: 1 1; text-align: center; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  align-items: center;
  margin-bottom: 16px;
}
.toolbar label { font-size: var(--fs-sm); color: var(--text-muted); }

/* ------------------------------------------------------------- buttons ---
 * .btn + variant (primary | ghost | danger) + size (sm | icon).
 * Every control meets --tap, which becomes 44px on a touch screen. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-1);
  font: inherit;
  font-size: var(--fs-sm);
  line-height: 1.2;
  border-radius: var(--r-1);
  padding: var(--s-2) var(--s-3);
  min-height: var(--tap);
  border: 1px solid transparent;
  cursor: pointer;
  background: var(--surface);
  color: var(--text);
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:disabled, .btn.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 500;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-ghost:hover:not(:disabled):not(.is-disabled) {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}
.btn-danger {
  background: var(--surface);
  color: var(--bad);
  border-color: var(--bad);
}
.btn-danger:hover:not(:disabled) { background: var(--bad-soft); }
/* Small only shrinks the horizontal padding and type — the vertical hit area
   stays at --tap, which is what a thumb actually needs. */
.btn-sm { padding: var(--s-1) var(--s-2); font-size: var(--fs-xs); }
.btn-icon {
  padding: 0;
  width: var(--tap);
  min-width: var(--tap);
  font-size: var(--fs-md);
}
.btn-lg { padding: 10px var(--s-4); font-size: var(--fs-md); }

/* --------------------------------------------------------- batch vote form ---*/
form.batch-vote { margin: 12px 0 24px; }
.batch-vote-table {
  width: 100%;
  max-width: 560px;
  border-collapse: collapse;
  background: var(--surface);
  table-layout: fixed;
}
.batch-vote-table th:nth-child(1) { width: 52%; }
.batch-vote-table th:nth-child(2) { width: 20%; }
.batch-vote-table th:nth-child(3) { width: 28%; }
.batch-vote-table th,
.batch-vote-table td {
  border-bottom: 1px solid var(--border);
  padding: 6px 8px;
}
.batch-vote-table input[type="text"],
.batch-vote-table input[type="number"] { width: 100%; }
.batch-vote-table input[type="number"] { font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; }
/* A row that cannot be submitted as typed. The message row below it carries
 * the reason; the tint is what makes it findable while scrolling a long list. */
.batch-vote-table tr.has-issue td { background: var(--bad-soft); }
.batch-vote-table input[aria-invalid="true"] { background: var(--bad-soft); }
.batch-vote-issue-row td {
  padding: 0 var(--s-2) var(--s-2);
  background: var(--bad-soft);
}
.batch-vote-table .row-actions {
  display: flex;
  gap: 3px;
  justify-content: flex-end;
}
/* Recede while the host types down a long list, but never below a readable
 * contrast — and never at all on touch, where there is no hover to restore it. */
@media (hover: hover) and (pointer: fine) {
  .batch-vote-table .row-actions {
    opacity: 0.55;
    transition: opacity 0.12s;
  }
  .batch-vote-table tr:hover .row-actions,
  .batch-vote-table tr:focus-within .row-actions { opacity: 1; }
}
.batch-vote-table .row-move,
.batch-vote-table .row-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tap);
  height: var(--tap);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: var(--r-1);
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 0;
}
.batch-vote-table .row-move { font-size: 9px; }
.batch-vote-table .row-remove { font-size: var(--fs-lg); }
.batch-vote-table .row-move:disabled { opacity: 0.35; cursor: default; }
.batch-vote-table .row-move:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--text-muted);
}
.batch-vote-table .row-remove:hover:not(:disabled) {
  color: var(--bad);
  border-color: var(--bad);
}
.batch-vote-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  align-items: center;
  margin-top: 10px;
}
.batch-vote-actions button[type="submit"] {
  font: inherit;
  padding: 7px 14px;
  min-height: var(--tap);
  background: var(--accent);
  color: var(--accent-contrast);
  border: none;
  border-radius: var(--r-1);
  font-size: var(--fs-md);
  font-weight: 500;
  cursor: pointer;
}
.batch-vote-actions button[type="submit"]:disabled { opacity: 0.5; cursor: not-allowed; }
.batch-vote-actions button[type="submit"]:hover:not(:disabled) { background: var(--accent-hover); }
.batch-vote-preview { font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ MVP editor ---*/
.meeting-mvp-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin: var(--s-2) 0 16px;
}
.meeting-mvp-label { color: var(--text-muted); font-size: var(--fs-sm); }
.mvp-display,
.mvp-edit {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.mvp-edit-tags {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.mvp-edit-tags input[type="text"] { min-width: 200px; flex: 1 1; }
.mvp-edit-tag { display: inline-flex; align-items: center; gap: var(--s-1); }
.mvp-edit-tag .tag-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  min-height: 20px;
  background: transparent;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: var(--fs-md);
  line-height: 1;
  padding: 0 2px;
}
.mvp-edit-tag .tag-remove:hover:not(:disabled) { color: var(--bad); }

/* -------------------------------------------- sortable table headers ---*/
.sort-header {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  min-height: 24px;
  text-decoration: none;
  color: inherit;
}
.sort-header:hover { color: var(--accent); text-decoration: none; }
.sort-header.is-active { color: var(--accent); font-weight: 600; }
.sort-arrow { font-size: var(--fs-2xs); opacity: 0.55; }
.sort-header.is-active .sort-arrow { opacity: 1; }
.meetings-toolbar,
.programs-toolbar-sort {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex-wrap: wrap;
  margin: var(--s-2) 0;
}
/* Toggles group at the right. Only the first takes the auto margin so the
   pair stays adjacent as the count text on the left changes length. */
.meetings-toolbar .toggle-btn:first-of-type,
.programs-toolbar-sort .toggle-btn:first-of-type { margin-left: auto; }

/* A binary URL-state filter. Same control wherever such a filter exists. */
.toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: var(--tap);
  padding: 0 var(--s-1);
  text-decoration: none;
  color: inherit;
  font-size: var(--fs-sm);
  -webkit-user-select: none;
  -moz-user-select: none;
       user-select: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.toggle-btn:hover { text-decoration: none; }
.toggle-btn-knob {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 18px;
  border-radius: var(--r-pill);
  background: var(--border-strong);
  transition: background 120ms ease;
  flex-shrink: 0;
}
.toggle-btn-knob::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 2px var(--shadow);
  transition: transform 120ms ease;
}
.toggle-btn.is-on .toggle-btn-knob { background: var(--accent); }
.toggle-btn.is-on .toggle-btn-knob::after { transform: translateX(14px); }
.toggle-btn-label { color: var(--text-muted); }
.toggle-btn.is-on .toggle-btn-label { color: var(--text); }
/* The on/off state in words: the knob is decorative, and colour alone is not
   a state anyone should have to read. */
.toggle-btn-state {
  margin-left: var(--s-1);
  font-size: var(--fs-2xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.toggle-btn.is-on .toggle-btn-state { color: var(--accent); }

/* ------------------------------------------------- settings: handle alias ---*/
.alias-manager-intro { margin: 0 0 var(--s-3); }
.alias-form {
  display: flex;
  align-items: flex-end;
  gap: var(--s-2);
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.alias-form-field { display: flex; flex-direction: column; gap: var(--s-1); flex: 1 1 180px; }
.alias-form-label {
  font-size: var(--fs-2xs);
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
.alias-form-arrow { font-size: var(--fs-xl); color: var(--text-muted); padding: 0 var(--s-1) var(--s-1); }
.alias-table { width: 100%; border-collapse: collapse; font-size: var(--fs-md); }
.alias-table th, .alias-table td {
  padding: 6px var(--s-2);
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.alias-table th { font-weight: 500; color: var(--text-muted); font-size: var(--fs-xs); }

/* ------------------------------------------- settings: viewer links ---*/
.issued-link-card { background: var(--accent-soft); border-color: var(--accent); }
.issued-link-url { word-break: break-all; margin: var(--s-2) 0; }

/* Native <dialog> confirmation, shared by every irreversible action. The
 * browser owns the backdrop, focus trap and ESC; we only style the chrome. */
.app-dialog {
  border: none;
  border-radius: var(--r-2);
  padding: 0;
  background: var(--surface);
  color: var(--text);
  max-width: 460px;
  width: calc(100% - 32px);
  box-shadow: 0 12px 32px var(--shadow);
}
.app-dialog::-webkit-backdrop { background: rgba(0, 0, 0, 0.45); }
.app-dialog::backdrop { background: rgba(0, 0, 0, 0.45); }
.app-dialog-body { padding: 20px; display: flex; flex-direction: column; gap: var(--s-3); }
.app-dialog-title { margin: 0; font-size: var(--fs-lg); }
.app-dialog-body p { margin: 0; }
.app-dialog-body code {
  background: var(--surface-muted);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.95em;
}
.app-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--s-2);
  margin-top: var(--s-1);
}

/* ------------------------------------------- paste-text card with copies ---*/
.paste-card { margin-top: 12px; }
.paste-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-2);
  margin-bottom: 6px;
}
.paste-card-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-1) 0;
}
.paste-card-line + .paste-card-line { border-top: 1px dashed var(--border); }
.paste-card-line code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: var(--fs-sm);
  background: transparent;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  flex: 1 1;
}

/* ------------------------------------------------- meeting detail page ---*/
.meeting-meta { margin-bottom: var(--s-1); }
.meeting-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin: 0 0 var(--s-2);
  font-size: var(--fs-sm);
}
.meeting-breadcrumb-spacer { flex: 1 1; }
.meeting-title {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin: var(--s-2) 0 var(--s-4);
  flex-wrap: wrap;
}
.meeting-title-no {
  display: inline-flex;
  align-items: baseline;
  background: var(--accent);
  color: var(--accent-contrast);
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  padding: 2px 12px;
  border-radius: var(--r-1);
  font-size: var(--fs-xl);
  font-weight: 700;
  letter-spacing: 0.02em;
}
.meeting-title-text { font-size: var(--fs-lg); font-weight: 500; }

.live-summary {
  position: -webkit-sticky;
  position: sticky;
  /* Offset by the header's real measured height (see SiteHeader). */
  top: var(--header-h);
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  flex-wrap: wrap;
  padding: 10px var(--s-4);
  margin: 0 0 var(--s-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  box-shadow: 0 2px 6px var(--shadow);
}
.live-summary.is-live { border-color: var(--accent); }
.live-summary-cells {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s-3) var(--s-4);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
.live-summary-cells strong {
  color: var(--text);
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-lg);
  font-weight: 700;
  margin-right: 2px;
}
.live-summary-badge {
  padding: 2px var(--s-2);
  border-radius: var(--r-1);
  background: var(--accent);
  color: var(--accent-contrast);
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: 0.08em;
}
.live-summary-sync {
  font-size: var(--fs-xs);
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
}
.live-summary-refresh { margin-left: var(--s-1); }

.legacy-scores-details summary {
  font-size: var(--fs-lg);
  font-weight: 600;
  cursor: pointer;
  margin: var(--s-4) 0 var(--s-2);
  min-height: var(--tap);
}
.legacy-scores-details summary::marker { color: var(--text-muted); }
.legacy-scores { font-size: var(--fs-sm); }
.vote-form-hint { margin-top: -4px; }
.vote-edit-score { width: 5.5em; }
.vote-row-actions { white-space: nowrap; }
.vote-row-actions > * + * { margin-left: var(--s-1); }
/* Shared by the vote rows and the programs table: a failure reported in the
   row it belongs to, where an alert() used to pop. */
.vote-error-row td {
  border-bottom: 1px solid var(--border);
  background: var(--bad-soft);
  padding: var(--s-2) var(--s-3);
}

.anonymous-votes {
  list-style: none;
  padding: 0;
  margin: var(--s-2) 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.anonymous-votes li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: var(--s-1) var(--s-1) var(--s-1) 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-size: var(--fs-sm);
}
.anonymous-votes li.has-issue { border-color: var(--bad); background: var(--bad-soft); }
.anonymous-vote-score { font-weight: 600; font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; }
.anonymous-vote-time { font-size: var(--fs-2xs); }
.anonymous-vote-error { padding-right: var(--s-2); }
.anonymous-vote-confirm {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  padding-left: var(--s-1);
}
.anonymous-vote-remove { border-radius: 50%; }

.meta-edit-trigger { margin-left: auto; }
.meta-editor { margin: 12px 0; }
.meta-editor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  grid-gap: 10px;
  gap: 10px;
}
.meta-editor-field { display: flex; flex-direction: column; gap: var(--s-1); }
.meta-editor-label {
  font-size: var(--fs-2xs);
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
.meta-editor-actions {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex-wrap: wrap;
  margin-top: 12px;
}
.meta-editor-danger-zone {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex-wrap: wrap;
  margin-top: var(--s-4);
  padding: var(--s-3);
  border: 1px dashed var(--bad);
  border-radius: var(--r-1);
  background: var(--bad-soft);
}
.meta-editor-danger-label {
  font-size: var(--fs-xs);
  color: var(--bad);
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* --------------------------------------------------- MVP page: year tabs ---*/
.mvp-year-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 16px;
}
.mvp-year-tab {
  display: inline-flex;
  align-items: center;
  padding: var(--s-1) 12px;
  min-height: var(--tap);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  text-decoration: none;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}
.mvp-year-tab:hover {
  text-decoration: none;
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}
.mvp-year-tab.is-active {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: var(--accent);
}
.mvp-year-block { margin-top: var(--s-6); }
.mvp-year-heading { margin: 0 0 var(--s-3); font-size: var(--fs-md); color: var(--text-muted); }
.mvp-year-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  grid-gap: var(--s-3);
  gap: var(--s-3);
  align-items: start;
}
/* Cancel the vertical-stack `.card + .card` margin inside a grid — gap
   already handles spacing, and the extra margin was what pushed every
   second card down by 12px and misaligned the tables. */
.mvp-year-grid > .card + .card,
.mvp-cards > .card + .card { margin-top: 0; }
.mvp-year-section {
  /* Row 1 is the fixed-height header, row 2 the table, so with
     align-items:start on the parent every card's table starts at the same y. */
  display: grid;
  grid-template-rows: 56px auto;
  padding: var(--s-3);
}
.mvp-year-section-header {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2px;
  padding-bottom: var(--s-1);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.mvp-year-section-title {
  margin: 0;
  font-size: var(--fs-sm);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mvp-year-section-meta {
  font-size: var(--fs-2xs);
  font-weight: 400;
  text-align: right;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}
.mvp-year-table { background: transparent; width: 100%; }
.mvp-year-table th,
.mvp-year-table td { white-space: nowrap; }
.mvp-year-table th { background: transparent; padding: 2px var(--s-2); border: none; font-size: var(--fs-2xs); }
.mvp-year-table td { padding: 3px var(--s-2); border-bottom: 1px dashed var(--border); font-size: var(--fs-sm); }
.mvp-year-table th:nth-child(3),
.mvp-year-table td:nth-child(3) { text-align: right; font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; }
.mvp-year-table tr:last-child td { border-bottom: none; }

/* ------------------------------------------------ meeting list gap rows ---*/
.meeting-gap-row {
  background: repeating-linear-gradient(
    -45deg,
    var(--bg),
    var(--bg) 8px,
    var(--surface-muted) 8px,
    var(--surface-muted) 16px
  );
}
.meeting-gap-row td { color: var(--text-muted); font-size: var(--fs-sm); }
.meeting-gap-row td:first-child { font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------- dashboard ---*/
/* The one thing the host opens the dashboard to find. */
.next-up {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  margin: var(--s-4) 0;
  border-left: 4px solid var(--accent);
}
.next-up-label {
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}
.next-up-main {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex-wrap: wrap;
}
.next-up-no {
  background: var(--accent);
  color: var(--accent-contrast);
  padding: 2px 10px;
  border-radius: var(--r-1);
  font-size: var(--fs-lg);
  font-weight: 700;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}
.next-up-title { font-size: var(--fs-lg); font-weight: 500; }
.next-up-title a {
  color: var(--text);
  text-decoration: underline;
  -webkit-text-decoration-color: var(--border-strong);
          text-decoration-color: var(--border-strong);
  text-underline-offset: 3px;
}
.next-up-title a:hover { color: var(--accent); -webkit-text-decoration-color: currentColor; text-decoration-color: currentColor; }
.next-up-when {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex-wrap: wrap;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
.next-up-relative {
  padding: 2px var(--s-2);
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  font-size: var(--fs-xs);
}
.next-up-relative.is-live {
  background: var(--accent);
  color: var(--accent-contrast);
}
.next-up-action { margin: 0; }
.next-up-empty { border-left-color: var(--border-strong); }

.relative-time {
  display: block;
  /* "あと 9 日" is one phrase. The dashboard's date column is narrow enough
     that without this it breaks mid-word onto the date's own line. */
  white-space: nowrap;
  font-size: var(--fs-2xs);
  color: var(--text-muted);
}
.relative-time.is-live { color: var(--accent); font-weight: 700; }

/* The dashboard's two lists sit side by side, so their columns are narrow.
   Only the title is allowed to wrap. */
.dashboard-list { table-layout: fixed; }
.dashboard-list th:nth-child(2),
.dashboard-list td:nth-child(2) { width: 7.5em; white-space: nowrap; }
.dashboard-list th:nth-child(3),
.dashboard-list td:nth-child(3) { width: 3.5em; white-space: nowrap; }
.dashboard-list td:first-child { overflow-wrap: anywhere; }
.dashboard-list-meeting { display: inline-flex; align-items: baseline; gap: var(--s-2); flex-wrap: wrap; }
.dashboard-list-no {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0 6px;
  border-radius: var(--r-1);
  font-size: var(--fs-xs);
  font-weight: 700;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

/* これから / これまで を横並び (>=1024px) / 縦積み (<1024px). */
.schedule-grid {
  display: grid;
  grid-template-columns: 1fr;
  grid-gap: var(--s-4);
  gap: var(--s-4);
  align-items: start;
}
@media (min-width: 1024px) {
  .schedule-grid { grid-template-columns: 1fr 1fr; gap: var(--s-6); }
}

.mvp-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  grid-gap: 12px;
  gap: 12px;
  margin: 12px 0;
}
.mvp-card { padding: var(--s-3); }
.mvp-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-2);
  margin-bottom: var(--s-1);
  padding-bottom: var(--s-1);
  border-bottom: 1px solid var(--border);
}
.mvp-card-title { margin: 0; font-size: var(--fs-sm); font-weight: 600; }
.mvp-card-total { font-size: var(--fs-2xs); }
.mvp-card-list { list-style: none; margin: 0; padding: 0; }
.mvp-card-item {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: baseline;
  grid-gap: var(--s-2);
  gap: var(--s-2);
  padding: 2px 0;
  font-size: var(--fs-sm);
}
.mvp-card-item + .mvp-card-item { border-top: 1px dashed var(--border); }
.mvp-card-rank {
  color: var(--text-muted);
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-xs);
}
.mvp-card-handle { font-weight: 500; overflow-wrap: anywhere; }
.mvp-card-count { color: var(--accent); font-weight: 600; }
.mvp-cards-footer { margin-top: 12px; }

/* --------------------------------------------------------- activity heatmap ---*/
.heatmap-section {
  margin: 24px 0;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
}
.heatmap-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-3);
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.heatmap-title {
  margin: 0;
  font-size: var(--fs-md);
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.heatmap-total {
  font-size: var(--fs-xs);
  font-weight: 400;
  letter-spacing: 0;
  margin-left: var(--s-2);
}
.heatmap-mode-toggle {
  display: inline-flex;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface);
}
.heatmap-mode {
  font: inherit;
  padding: var(--s-1) 12px;
  min-height: var(--tap);
  background: var(--surface);
  color: var(--text-muted);
  border: none;
  border-right: 1px solid var(--border);
  cursor: pointer;
  font-size: var(--fs-xs);
}
.heatmap-mode:last-child { border-right: none; }
.heatmap-mode:hover { color: var(--accent); }
.heatmap-mode.is-active { background: var(--accent); color: var(--accent-contrast); }

.heatmap-layout { display: flex; align-items: flex-start; gap: 16px; }
.heatmap-scroller { flex: 1 1; min-width: 0; overflow-x: auto; padding-bottom: 6px; }
.heatmap-year-tabs {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
  flex-shrink: 0;
  min-width: 64px;
}
.heatmap-year-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-1) 12px;
  min-height: var(--tap);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  text-decoration: none;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}
.heatmap-year-tab:hover {
  text-decoration: none;
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}
.heatmap-year-tab.is-active {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: var(--accent);
}
.heatmap-grid-wrap { display: inline-block; min-width: 100%; }
.heatmap-months { display: flex; gap: 2px; margin-left: 24px; margin-bottom: var(--s-1); }
.heatmap-month-label {
  width: 12px;
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
}
.heatmap-body { display: flex; gap: var(--s-1); }
.heatmap-dow {
  display: grid;
  grid-template-rows: repeat(7, 12px);
  grid-gap: 2px;
  gap: 2px;
  align-content: start;
}
.heatmap-dow-label { font-size: 10px; line-height: 12px; color: var(--text-muted); }
.heatmap-grid { display: flex; gap: 2px; }
.heatmap-week { display: grid; grid-template-rows: repeat(7, 12px); grid-gap: 2px; gap: 2px; }
.heatmap-cell {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  background: var(--empty-cell);
  display: block;
}
a.heatmap-cell:hover { outline: 1px solid var(--text); outline-offset: 1px; }

/* Heatmap ramps.
 *
 * The swatches were literal hex outside any theme block, so dark mode drew
 * the light-mode ramp on a dark page — and the ramp inverted. A light ramp
 * runs pale→saturated because pale is the low end *against white*; on
 * #17171a the pale end is the highest-contrast thing on screen, so one vote
 * looked louder than eleven. Measured: light ran 1.10→4.96 (increasing),
 * dark ran 15.61→3.45 (decreasing).
 *
 * Each ramp is therefore a set of variables, assigned per theme below, so a
 * level always means "more" the further up it goes. */
.heatmap-mode-broadcasts.heatmap-level-1,
.heatmap-mode-votes.heatmap-level-1 { background: var(--ramp-1); }
.heatmap-mode-broadcasts.heatmap-level-2,
.heatmap-mode-votes.heatmap-level-2 { background: var(--ramp-2); }
.heatmap-mode-broadcasts.heatmap-level-3,
.heatmap-mode-votes.heatmap-level-3 { background: var(--ramp-3); }
.heatmap-mode-broadcasts.heatmap-level-4,
.heatmap-mode-votes.heatmap-level-4 { background: var(--ramp-4); }

/* avg_score is diverging, not sequential: low and high are both meant to
   stand out and the middle to recede. Red→blue rather than red→green, the
   one pair the common colour-vision deficiencies cannot separate — and the
   score is exactly what you read off the colour. */
.heatmap-mode-avg_score.heatmap-level-1 { background: var(--div-low); }
.heatmap-mode-avg_score.heatmap-level-2 { background: var(--div-midlow); }
.heatmap-mode-avg_score.heatmap-level-3 { background: var(--div-midhigh); }
.heatmap-mode-avg_score.heatmap-level-4 { background: var(--div-high); }

/* "other" — a broadcast happened but the program is not a critique meeting,
   so the meeting-only metrics have nothing to colour by. */
.heatmap-mode-avg_score.heatmap-level-other,
.heatmap-mode-votes.heatmap-level-other { background: var(--empty-cell); border: 1px solid var(--border-strong); }

.heatmap-legend {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-top: var(--s-2);
  font-size: var(--fs-xs);
}
.heatmap-legend-step { display: inline-flex; align-items: center; gap: var(--s-1); }
.heatmap-legend .heatmap-cell { cursor: default; flex-shrink: 0; }

/* Single shared detail panel under the grid (rather than 370 per-cell tooltips) */
.heatmap-focus {
  margin-top: var(--s-3);
  padding: var(--s-2) var(--s-3);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--r-1);
  font-size: var(--fs-sm);
  min-height: 2.4em;
}
.heatmap-focus-empty { font-size: var(--fs-xs); text-align: center; margin: var(--s-3) 0; }
.heatmap-focus-head {
  display: flex;
  justify-content: space-between;
  gap: var(--s-3);
  margin-bottom: var(--s-1);
  font-size: var(--fs-sm);
}
.heatmap-focus-list { list-style: none; margin: 0; padding: 0; }
.heatmap-focus-list li { padding: 2px 0; }
.heatmap-focus-other {
  margin-top: var(--s-1);
  padding-top: var(--s-1);
  border-top: 1px dashed var(--border);
}
.heatmap-cell:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ------------------------------------------------------- programs page ---*/
.programs-tab-caption { margin: 0 0 var(--s-3); }

.programs-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
  margin: 16px 0;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
}

.sync-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-right: auto;
}
.sync-bar-button { gap: 6px; font-weight: 500; }
.sync-bar-button:disabled { opacity: 0.7; cursor: progress; }
.sync-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.sync-summary { color: var(--good); font-size: var(--fs-sm); }
.sync-vanished {
  flex-basis: 100%;
  padding: 10px 12px;
  border: 1px solid var(--warn-border);
  border-radius: var(--r-1);
  background: var(--warn-soft);
  color: var(--warn);
  font-size: var(--fs-sm);
}
.sync-vanished-head { font-weight: 500; }
.sync-vanished-list { margin: 6px 0; padding-left: 20px; }
.sync-vanished-list li { margin: 2px 0; }

/* Tab conventions used in the app:
 *   - .programs-tab: underline tabs for top-level VIEW switching
 *     (changes URL via Link, mutually exclusive).
 *   - .mvp-year-tab / .heatmap-year-tab: rounded pills for FACET
 *     filtering (year, candidate-only, etc).
 *   - .heatmap-mode: segmented control for compact MODE toggles
 *     (small set of mutually-exclusive options, no URL change).
 */
.programs-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-1);
  border-bottom: 1px solid var(--border);
  margin: 12px 0 var(--s-2);
}
.programs-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: var(--s-2) 14px;
  min-height: var(--tap);
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  color: var(--text-muted);
  font-size: var(--fs-md);
  text-decoration: none;
  position: relative;
  bottom: -1px;
}
.programs-tab:hover {
  text-decoration: none;
  color: var(--accent);
  background: var(--accent-soft);
}
.programs-tab.is-active {
  color: var(--accent);
  background: var(--surface);
  border-color: var(--border);
  border-bottom-color: var(--surface);
  font-weight: 500;
}
.programs-tab-label { font-weight: 500; }
.programs-tab-count {
  display: inline-block;
  padding: 1px 6px;
  border-radius: var(--r-pill);
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: var(--fs-2xs);
  font-weight: 600;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}
.programs-tab.is-active .programs-tab-count {
  background: var(--accent-soft);
  color: var(--accent);
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  margin: var(--s-4) 0;
}
.pager-position { font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; }

/* Horizontal scroll wrapper for wide data tables. The card layout
 * (below `@media (max-width: 880px)`) takes over on phones; in between
 * we let the user scroll the table sideways rather than squeezing CJK
 * text into narrow columns. */
.table-scroll { overflow-x: auto; max-width: 100%; }
/* Every other column is nowrap, so without an explicit share the longest
   content — the title — was squeezed to the width of 「カテゴリ」 and wrapped
   to four lines while 「配信状況」 sat on one. */
.programs-data-table { min-width: 960px; }
.programs-data-table th:first-child,
.programs-data-table td:first-child { width: 30%; }
.meetings-data-table th:nth-child(2),
.meetings-data-table td:nth-child(2) { width: 38%; }
.meetings-data-table { min-width: 760px; }

/* Short-content columns shouldn't wrap (「シラスフロントロー」 was wrapping
 * char-by-char because the column was narrower than the text). Title and
 * MVP can still wrap. */
.programs-data-table th,
.meetings-data-table th { white-space: nowrap; }
.programs-data-table td[data-label="カテゴリ"],
.programs-data-table td[data-label="状態"],
.programs-data-table td[data-label="配信日時"],
.programs-data-table td[data-label="配信状況"],
.programs-data-table td[data-label="リンク"] { white-space: nowrap; }

/* Two-line stacked date/time cell — line 1 = date, line 2 = time */
.broadcast-stack {
  display: inline-flex;
  flex-direction: column;
  font-size: var(--fs-sm);
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}
.broadcast-time { font-size: var(--fs-xs); }

/* Compact icon-only external link (the shirasu favicon with a hit area). */
.external-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tap);
  height: var(--tap);
  border-radius: var(--r-1);
  text-decoration: none;
  color: var(--accent);
  border: 1px solid transparent;
}
.external-link:hover {
  text-decoration: none;
  background: var(--accent-soft);
  border-color: var(--border);
}
.external-link img { width: 16px; height: 16px; display: block; }

/* Status badge in table rows. These are *states*, never buttons — the
 * actions live in their own column. */
.status-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  background: var(--surface);
}
.status-pill.status-registered {
  background: var(--good-soft);
  color: var(--good);
  border-color: var(--good-border);
}
.status-pill.status-registered:hover { text-decoration: none; filter: brightness(0.97); }
.status-pill.status-candidate {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}
.status-pill.status-dismissed {
  background: var(--surface-muted);
  color: var(--text-muted);
  border-color: var(--border);
}
.programs-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.programs-data-table tr.is-dismissed td { opacity: 0.6; }
.muted-link {
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  margin-left: var(--s-2);
}
.muted-link:hover { color: var(--text); }

/* inline promote / edit form inside a table row */
.promote-form-row td { background: var(--accent-soft); padding: 16px; }
.promote-form { display: flex; flex-direction: column; gap: 10px; }
.promote-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  grid-gap: 10px;
  gap: 10px;
}
.promote-form-field { display: flex; flex-direction: column; gap: var(--s-1); }
.promote-form-field-mvp { grid-column: 1 / -1; }
.promote-form-label {
  font-size: var(--fs-2xs);
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
/* A field the server owns — shown so the value is visible, not editable.
   Matches the input metrics so the grid rows stay aligned. */
.promote-form-fixed {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 6px 10px;
  min-height: var(--tap);
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-1);
  background: var(--surface-muted);
  font-size: var(--fs-md);
}
.promote-form-fixed .muted { font-size: var(--fs-2xs); }
.promote-form-actions { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.promote-form-hint { margin: 0; font-size: var(--fs-xs); }

/* Programs / meetings data tables stack to card layout under 880px so
 * many narrow columns don't crash on phones / tablets. `data-label` is
 * surfaced as a pseudo-element label next to each cell value. */
@media (max-width: 880px) {
  .programs-data-table,
  .programs-data-table thead,
  .programs-data-table tbody,
  .programs-data-table tr,
  .programs-data-table td,
  .meetings-data-table,
  .meetings-data-table thead,
  .meetings-data-table tbody,
  .meetings-data-table tr,
  .meetings-data-table td {
    display: block;
    width: 100%;
  }
  .programs-data-table { min-width: 0; }
  .meetings-data-table { min-width: 0; }
  .programs-data-table thead,
  .meetings-data-table thead { display: none; }
  .programs-data-table tr,
  .meetings-data-table tr {
    margin-bottom: var(--s-3);
    border: 1px solid var(--border);
    border-radius: var(--r-2);
    background: var(--surface);
    overflow: hidden;
  }
  .programs-data-table td,
  .meetings-data-table td {
    border-bottom: 1px dashed var(--border);
    padding: var(--s-2) var(--s-3);
    text-align: left;
  }
  .programs-data-table td:last-child,
  .meetings-data-table td:last-child { border-bottom: none; }
  /* The desktop column widths must not survive into the card layout:
     `td:first-child` outranks the `td { width: 100% }` above, so the title —
     the longest value — was being folded into 30% of the card. */
  .programs-data-table th:first-child,
  .programs-data-table td:first-child,
  .meetings-data-table th:nth-child(2),
  .meetings-data-table td:nth-child(2) { width: 100%; }

  /* Label and value as two columns rather than the label being an inline box
     the value flows around — a wrapped title used to start under the label
     and leave a near-empty first line. */
  .programs-data-table td,
  .meetings-data-table td {
    display: flex;
    /* nowrap, so every row reads label | value. With wrap, a value whose
       natural width overflows gets pushed to its own line before it is
       allowed to shrink — so long titles sat under their label while short
       values sat beside theirs, and no two rows lined up. */
    flex-wrap: nowrap;
    align-items: baseline;
    gap: var(--s-2);
  }
  .programs-data-table td::before,
  .meetings-data-table td::before {
    content: attr(data-label);
    flex: 0 0 5.5em;
    font-size: var(--fs-2xs);
    color: var(--text-muted);
    letter-spacing: 0.04em;
  }
  /* The value takes the rest of the row and wraps inside it. min-width:0
     lets a flex item shrink below its content width; without it the title
     would push the card wider than the screen. */
  .programs-data-table td > *,
  .meetings-data-table td > * { min-width: 0; }
  .programs-data-table td,
  .meetings-data-table td { overflow-wrap: anywhere; }
  /* Cells holding several chips still need to wrap internally. */
  .programs-data-table td[data-label="MVP"],
  .programs-data-table td[data-label="操作"],
  .meetings-data-table td[data-label="MVP"] { flex-wrap: wrap; }
  /* num cells should still align numerically in cards */
  .meetings-data-table td.num { text-align: left; }
  /* Expanded forms and error rows span the card — drop the colSpan visual. */
  .programs-data-table tr.promote-form-row td,
  .programs-data-table tr.vote-error-row td { display: block; padding: var(--s-3); }
  .programs-data-table tr.promote-form-row td::before,
  .programs-data-table tr.vote-error-row td::before { display: none; }
  /* Don't card-stack the gap placeholder rows (they only have a meeting no). */
  .meetings-data-table tr.meeting-gap-row { padding: var(--s-2); }
  .meetings-data-table tr.meeting-gap-row td { display: block; border: none; padding: 2px var(--s-2); }
  .meetings-data-table tr.meeting-gap-row td::before { display: none; }
  /* In card layout, date + time fit on one line beside the data-label.
     Scoped to the two tables that actually card-stack: .broadcast-stack is a
     global class, so an unscoped rule also flipped the dashboard lists — which
     stay real tables at this width — widening their date column and squeezing
     the titles, exactly where horizontal space is scarcest. */
  .programs-data-table .broadcast-stack,
  .meetings-data-table .broadcast-stack {
    flex-direction: row;
    gap: var(--s-2);
    align-items: baseline;
  }
  .programs-data-table .relative-time,
  .meetings-data-table .relative-time {
    display: inline;
    margin-left: var(--s-2);
  }
}

/* Below the two-column split the dashboard lists get the full width back,
   so the fixed narrow columns are no longer needed. */
@media (max-width: 1023px) {
  .dashboard-list { table-layout: auto; }
  .dashboard-list th:nth-child(2),
  .dashboard-list td:nth-child(2),
  .dashboard-list th:nth-child(3),
  .dashboard-list td:nth-child(3) { width: auto; }
}

/* ---------------------------------------------- error / loading / notice ---*/
.error-page-causes { margin: var(--s-2) 0 var(--s-4); padding-left: 1.3em; }
.error-page-causes li { margin: var(--s-1) 0; font-size: var(--fs-sm); color: var(--text-muted); }
.error-page-actions { display: flex; gap: var(--s-2); flex-wrap: wrap; margin-top: var(--s-3); }
.error-page-digest { margin-top: var(--s-4); font-size: var(--fs-xs); }

.page-loading {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding: var(--s-6) 0;
}
.page-loading-bar {
  display: block;
  height: 3px;
  border-radius: var(--r-pill);
  background: linear-gradient(
    90deg,
    var(--border) 0%,
    var(--accent) 50%,
    var(--border) 100%
  );
  background-size: 200% 100%;
  animation: page-loading-sweep 1.1s linear infinite;
}
@keyframes page-loading-sweep {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

/* A state the page wants read, not an error: truncation, caps, caveats. */
.notice {
  margin: 0 0 var(--s-3);
  padding: var(--s-2) var(--s-3);
  border: 1px solid var(--warn-border);
  border-radius: var(--r-1);
  background: var(--warn-soft);
  color: var(--warn);
  font-size: var(--fs-sm);
}

/* Heatmap cells are buttons now — strip the control chrome, keep the swatch. */
button.heatmap-cell {
  padding: 0;
  border: none;
  cursor: pointer;
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
}
.heatmap-cell.is-pinned {
  outline: 2px solid var(--text);
  outline-offset: 1px;
}
.heatmap-focus.is-pinned { border-color: var(--accent); }
.heatmap-focus-head { align-items: center; }

