/* Xレポート ダッシュボード — 歌舞伎町ネオン調（ダーク既定）＋ライト
   グロー（光彩）は見出し・アクティブ要素のみに控えめに使う。 */

/* ---------- トークン: ダーク（既定） ---------- */
:root {
  color-scheme: dark;
  --bg: #0a0712;
  --surface: #161126;
  --surface-2: #1d1731;
  --surface-3: #282042;
  --border: #2f2750;
  --border-strong: #4a3e75;
  --text: #f4f0fc;
  --text-2: #cdc6e2;
  --muted: #a39cc0;
  --accent: #ff3b4e;       /* 赤 */
  --accent-2: #3ee6f2;     /* シアン */
  --accent-3: #b48dff;     /* 紫 */
  --accent-ink: #ff8a94;
  --link: #9cf3fa;
  --on-accent: #12081a;
  --mark-term-bg: rgba(255, 59, 78, .22);
  --mark-term-fg: #ffd6da;
  --mark-q-bg: rgba(62, 230, 242, .22);
  --mark-q-fg: #d4fbff;
  --banner-bg: #ffcf5c;
  --banner-fg: #1d1400;
  --grid: #2a2440;
  --axis: #463d66;
  --glow-accent: 0 0 6px rgba(255, 59, 78, .45), 0 0 16px rgba(255, 59, 78, .25);
  --glow-text: 0 0 8px rgba(255, 59, 78, .55), 0 0 22px rgba(255, 59, 78, .3);
  --glow-cyan: 0 0 6px rgba(62, 230, 242, .4);
  --page-glow:
    radial-gradient(900px 500px at 0% -10%, rgba(255, 59, 78, .10), transparent 60%),
    radial-gradient(800px 500px at 100% 110%, rgba(62, 230, 242, .06), transparent 60%),
    radial-gradient(700px 400px at 70% 0%, rgba(180, 141, 255, .07), transparent 60%);
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 8px 24px rgba(0, 0, 0, .25);

  /* カテゴリ色（dataviz 検証済みパレットのダーク段。アクセントの赤と紛れないよう赤・マゼンタは既知カテゴリに使わない。
     隣接 CVD ΔE≥8・通常視 ΔE≥15 / 面 #161126 に対し 3:1 以上） */
  --cat-0: #7d7896; /* その他（ニュートラル） */
  --cat-1: #9085e9; /* ホスト（紫） */
  --cat-2: #c98500; /* キャバクラ（黄） */
  --cat-3: #199e70; /* 歌舞伎町（アクア） */
  --cat-4: #3987e5; /* 夜職その他（青） */
  --cat-5: #008300; /* 監視アカウント（緑） */
  --cat-6: #d95926; /* 未知カテゴリ予備（オレンジ） */
  --cat-7: #d55181; /* 未知カテゴリ予備（ピンク） */

  --radius: 14px;
  --radius-sm: 10px;
  --tap: 44px;
  --font: system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ---------- トークン: ライト ---------- */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f6f4fb;
    --surface: #fbfaff;
    --surface-2: #f1eef8;
    --surface-3: #e6e1f2;
    --border: #e0dbec;
    --border-strong: #c7bfdc;
    --text: #1b1528;
    --text-2: #3d3552;
    --muted: #645c7a;
    --accent: #d0102a;
    --accent-2: #0b7f8a;
    --accent-3: #6b45c9;
    --accent-ink: #b00d23;
    --link: #0a6c78;
    --on-accent: #ffffff;
    --mark-term-bg: rgba(208, 16, 42, .14);
    --mark-term-fg: #7a0a17;
    --mark-q-bg: rgba(11, 127, 138, .16);
    --mark-q-fg: #064850;
    --banner-bg: #ffd666;
    --banner-fg: #241900;
    --grid: #ebe7f3;
    --axis: #c7bfdc;
    --glow-accent: 0 0 0 transparent;
    --glow-text: none;
    --glow-cyan: none;
    --page-glow:
      radial-gradient(900px 500px at 0% -10%, rgba(208, 16, 42, .06), transparent 60%),
      radial-gradient(800px 500px at 100% 110%, rgba(11, 127, 138, .05), transparent 60%);
    --shadow: 0 1px 2px rgba(27, 21, 40, .05), 0 6px 18px rgba(27, 21, 40, .05);
    --cat-0: #8a8499;
    --cat-1: #6250d6;
    --cat-2: #eda100;
    --cat-3: #1baf7a;
    --cat-4: #2a78d6;
    --cat-5: #008300;
    --cat-6: #eb6834;
    --cat-7: #e87ba4;
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f4fb;
  --surface: #fbfaff;
  --surface-2: #f1eef8;
  --surface-3: #e6e1f2;
  --border: #e0dbec;
  --border-strong: #c7bfdc;
  --text: #1b1528;
  --text-2: #3d3552;
  --muted: #645c7a;
  --accent: #d0102a;
  --accent-2: #0b7f8a;
  --accent-3: #6b45c9;
  --accent-ink: #b00d23;
  --link: #0a6c78;
  --on-accent: #ffffff;
  --mark-term-bg: rgba(208, 16, 42, .14);
  --mark-term-fg: #7a0a17;
  --mark-q-bg: rgba(11, 127, 138, .16);
  --mark-q-fg: #064850;
  --banner-bg: #ffd666;
  --banner-fg: #241900;
  --grid: #ebe7f3;
  --axis: #c7bfdc;
  --glow-accent: 0 0 0 transparent;
  --glow-text: none;
  --glow-cyan: none;
  --page-glow:
    radial-gradient(900px 500px at 0% -10%, rgba(208, 16, 42, .06), transparent 60%),
    radial-gradient(800px 500px at 100% 110%, rgba(11, 127, 138, .05), transparent 60%);
  --shadow: 0 1px 2px rgba(27, 21, 40, .05), 0 6px 18px rgba(27, 21, 40, .05);
  --cat-0: #8a8499;
  --cat-1: #6250d6;
  --cat-2: #eda100;
  --cat-3: #1baf7a;
  --cat-4: #2a78d6;
  --cat-5: #008300;
  --cat-6: #eb6834;
  --cat-7: #e87ba4;
}

/* ---------- ベース ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  background-image: var(--page-glow);
  background-attachment: fixed;
  overflow-x: hidden;
}
h1, h2, h3, p, ol, dl, dd { margin: 0; }
ol { padding: 0; list-style: none; }
a { color: var(--link); }
a:hover { color: var(--text); }
button, input, select { font: inherit; color: inherit; }
code { font-family: var(--mono); font-size: .9em; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.sr-only {
  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: 12px; top: -80px; z-index: 100;
  background: var(--surface-3); color: var(--text); padding: 10px 14px; border-radius: 10px;
}
.skip-link:focus { top: 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hint { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 2px; }
.wrap { width: 100%; max-width: 1280px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }

/* ---------- サンプル帯 ---------- */
.sample-banner {
  position: relative; z-index: 40;
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 4px 12px;
  padding: 10px 16px;
  background: var(--banner-bg); color: var(--banner-fg);
  font-size: 14px; text-align: center;
  border-bottom: 2px solid rgba(0, 0, 0, .25);
}
.sample-reason { font-size: 12px; opacity: .85; }

/* ---------- ヘッダー ---------- */
.site-header { border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 70%, transparent); }
.header-inner { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-top: 18px; padding-bottom: 16px; }
.title { font-size: 19px; font-weight: 700; letter-spacing: .02em; line-height: 1.3; }
.title-neon { color: var(--accent-ink); text-shadow: var(--glow-text); }
.meta { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 8px; font-size: 13px; }
.meta div { display: flex; gap: 6px; min-width: 0; }
.meta dt { color: var(--muted); white-space: nowrap; flex: none; }
.meta dd { color: var(--text-2); font-variant-numeric: tabular-nums; min-width: 0; }

/* ---------- ボタン ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--tap); padding: 0 16px;
  border-radius: 999px; border: 1px solid var(--border-strong);
  background: var(--surface-2); color: var(--text);
  cursor: pointer; font-size: 14px; white-space: nowrap;
  transition: background-color .15s, border-color .15s, box-shadow .15s;
}
.btn:hover { background: var(--surface-3); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; box-shadow: var(--glow-accent); }
.btn-primary:hover { background: var(--accent); filter: brightness(1.08); }
.btn-ghost { background: transparent; }

/* ---------- 状態表示 ---------- */
.state-box { margin: 48px auto; max-width: 560px; text-align: center; padding: 28px 20px; color: var(--text-2); }
.state-error { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.state-error h2 { font-size: 18px; margin-bottom: 8px; }
.state-error p { margin-bottom: 18px; word-break: break-word; }

main { padding-top: 18px; padding-bottom: 32px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.section-title { font-size: 16px; font-weight: 700; }
.section-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; }

/* ---------- サマリーカード ---------- */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stat { padding: 14px 16px; min-width: 0; }
.stat-label { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.stat-value { font-size: 28px; font-weight: 700; line-height: 1.25; margin-top: 4px; overflow-wrap: anywhere; }
.stat-sub { font-size: 12px; color: var(--muted); margin-top: 2px; min-height: 1em; }
.top-post { display: grid; gap: 4px; margin-top: 6px; min-width: 0; }
.top-post-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.top-post-value { font-size: 24px; font-weight: 700; }
.top-post-text { color: var(--text-2); font-size: 13px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.top-post-link { font-size: 13px; }
.source-note { font-size: 12px; margin: 8px 2px 14px; }

/* ---------- フィルタ ---------- */
.filters { padding: 14px 16px 16px; display: grid; gap: 14px; }
.filters-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.result-count { font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.filter-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: var(--tap); padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--border-strong);
  background: var(--surface-2); color: var(--text-2);
  cursor: pointer; font-size: 14px; max-width: 100%;
  transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.chip:hover { border-color: var(--muted); }
.chip .dot { width: 10px; height: 10px; border-radius: 3px; background: var(--c, var(--muted)); flex: none; }
.chip .chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip .count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] {
  color: var(--text); background: var(--surface-3);
  border-color: var(--accent); box-shadow: var(--glow-accent);
}
.chip[aria-pressed="true"] .count { color: var(--text-2); }
.chip[aria-pressed="true"]::after { content: "✓"; font-size: 12px; color: var(--accent-ink); font-weight: 700; }
.chip.is-zero:not([aria-pressed="true"]) { opacity: .6; }

.filter-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.field { min-width: 0; }
.input {
  width: 100%; min-height: var(--tap); padding: 0 12px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface-2); color: var(--text);
  font-size: 16px; /* iOS のズーム防止 */
}
.input::placeholder { color: var(--muted); opacity: .9; }
select.input { padding-right: 32px; }
.segmented { display: flex; border: 1px solid var(--border-strong); border-radius: 999px; padding: 2px; background: var(--surface-2); gap: 2px; }
.segmented button {
  flex: 1 1 0; min-height: var(--tap); padding: 0 10px; border: 0; border-radius: 999px;
  background: transparent; color: var(--text-2); cursor: pointer; font-size: 14px; white-space: nowrap;
}
.segmented button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); font-weight: 700; box-shadow: var(--glow-accent); }
.segmented-sm button { font-size: 13px; }
.field-check { display: flex; align-items: flex-end; }
.check { display: inline-flex; align-items: center; gap: 10px; min-height: var(--tap); cursor: pointer; font-size: 14px; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.field-reset { display: flex; align-items: flex-end; }

/* ---------- グラフ ---------- */
.charts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 14px; }
.chart-card { padding: 14px 16px 12px; min-width: 0; }
.chart-title { font-size: 15px; font-weight: 700; }
.chart-sub { font-size: 12px; margin-top: 2px; }
.chart { margin-top: 10px; position: relative; min-width: 0; }
.chart.is-empty { color: var(--muted); font-size: 13px; padding: 24px 0; text-align: center; }

.hbar-list { display: grid; gap: 4px; }
.hbar {
  display: grid; grid-template-columns: minmax(84px, 9.5em) minmax(0, 1fr); align-items: center; gap: 10px;
  min-height: 32px; border-radius: 8px; padding: 0 4px; cursor: default;
}
.hbar:hover, .hbar:focus-visible { background: var(--surface-2); }
.hbar-label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); min-width: 0; }
.hbar-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-label .dot { width: 8px; height: 8px; border-radius: 2px; background: var(--c); flex: none; }
.hbar-track { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hbar-fill { height: 14px; border-radius: 0 4px 4px 0; background: var(--c); min-width: 2px; flex: none; }
.hbar-fill.is-zero { min-width: 0; width: 0 !important; }
.hbar-value { min-width: 0; font-size: 12px; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hbar-value .unk { color: var(--muted); }

.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; font-size: 12px; color: var(--text-2); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-item .sw { width: 10px; height: 10px; border-radius: 2px; background: var(--c); }

.chart-day svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-day .grid { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart-day .baseline { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.chart-day .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart-day .seg { fill: var(--c); }
.chart-day .hit { fill: transparent; cursor: pointer; }
.chart-day .col:hover .hit, .chart-day .col:focus .hit, .chart-day .col.is-active .hit { fill: var(--text); fill-opacity: .06; }
.chart-day .col:focus { outline: none; }
.chart-day .col:focus-visible .hit { stroke: var(--accent-2); stroke-width: 1.5; }

.table-view { margin-top: 8px; font-size: 13px; }
.table-view summary { cursor: pointer; color: var(--text-2); min-height: var(--tap); display: flex; align-items: center; width: max-content; }
.table-scroll { overflow-x: auto; max-height: 320px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.data-table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.data-table th, .data-table td { padding: 6px 10px; text-align: right; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table th:first-child, .data-table td:first-child { text-align: left; position: sticky; left: 0; background: var(--surface); }
.data-table thead th { position: sticky; top: 0; background: var(--surface-2); color: var(--text-2); font-weight: 600; z-index: 1; }
.data-table thead th:first-child { z-index: 2; background: var(--surface-2); }

/* ---------- ツールチップ ---------- */
.tooltip {
  position: fixed; z-index: 60; pointer-events: none;
  min-width: 140px; max-width: min(280px, calc(100vw - 24px));
  padding: 8px 10px; border-radius: 10px;
  background: var(--surface-3); border: 1px solid var(--border-strong); color: var(--text);
  font-size: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
}
.tooltip .tt-title { color: var(--text-2); margin-bottom: 4px; }
.tooltip .tt-row { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.tooltip .tt-key { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); min-width: 0; }
.tooltip .tt-key::before { content: ""; width: 12px; height: 2px; border-radius: 1px; background: var(--c, var(--muted)); flex: none; }
.tooltip .tt-key.no-key::before { display: none; }
.tooltip .tt-val { font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- 下段 ---------- */
.lower { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin-top: 14px; }
.accounts { padding: 14px 16px; align-self: start; }
.acc-list { margin-top: 8px; display: grid; gap: 2px; counter-reset: acc; }
.acc-item button {
  width: 100%; display: grid; grid-template-columns: 1.8em minmax(0, 1fr) auto; align-items: center; gap: 8px;
  min-height: var(--tap); padding: 4px 8px; border: 0; border-radius: 10px;
  background: transparent; color: var(--text); text-align: left; cursor: pointer;
}
.acc-item button:hover { background: var(--surface-2); }
.acc-item button[aria-pressed="true"] { background: var(--surface-3); box-shadow: inset 2px 0 0 var(--accent); }
.acc-rank { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; text-align: right; }
.acc-name { display: flex; align-items: center; gap: 6px; min-width: 0; }
.acc-name span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-stats { font-size: 12px; color: var(--text-2); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.acc-stats strong { color: var(--text); font-size: 13px; }
.badge-watch {
  flex: none; font-size: 11px; line-height: 1; padding: 3px 6px; border-radius: 999px;
  border: 1px solid var(--accent-3); color: var(--accent-3);
}

.posts { min-width: 0; }
.active-filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.active-filters:empty { display: none; }
.af {
  display: inline-flex; align-items: center; gap: 4px; min-height: var(--tap); padding: 0 0 0 12px;
  border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border-strong); font-size: 13px; color: var(--text-2);
  max-width: 100%;
}
.af span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.af button {
  width: var(--tap); height: var(--tap); border-radius: 50%; border: 0; background: transparent; color: var(--text-2); cursor: pointer; font-size: 16px; flex: none;
}
.af button:hover { background: var(--surface-3); color: var(--text); }
.post-list { display: grid; gap: 10px; margin-top: 8px; }
.post { padding: 14px 16px; min-width: 0; }
.post-head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
.post-user {
  display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 2px; border: 0; background: none;
  color: var(--text); font-weight: 700; cursor: pointer; font-size: 14px; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.post-user:hover { color: var(--accent-ink); text-decoration: underline; }
.post-time { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.post-cats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; line-height: 1.2;
  padding: 3px 8px; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--text-2); background: var(--surface-2);
}
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--c); }
.post-text { margin-top: 8px; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; font-size: 15px; }
.post-text a { word-break: break-all; }
mark { border-radius: 3px; padding: 0 1px; }
mark.m-term { background: var(--mark-term-bg); color: var(--mark-term-fg); }
mark.m-q { background: var(--mark-q-bg); color: var(--mark-q-fg); box-shadow: inset 0 -2px 0 var(--accent-2); }
.post-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; margin-top: 10px; }
.metrics { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 13px; color: var(--muted); }
.metrics li { display: inline-flex; gap: 4px; }
.metrics .v { color: var(--text-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.metrics .v.unk { color: var(--muted); font-weight: 400; }
.open-x {
  display: inline-flex; align-items: center; gap: 4px; min-height: var(--tap); padding: 0 12px; margin-right: -8px;
  font-size: 13px; text-decoration: none; border-radius: 999px; color: var(--link);
}
.open-x:hover { background: var(--surface-2); }
.empty { padding: 32px 16px; text-align: center; color: var(--muted); }
.more-wrap { display: flex; justify-content: center; margin-top: 14px; }
#sentinel { height: 1px; }

.site-footer { padding-top: 8px; padding-bottom: 32px; }

/* ---------- 投稿のアクション ---------- */
.post-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.btn-sm { min-height: var(--tap); padding: 0 12px; font-size: 13px; }

/* ---------- 添付メディア ---------- */
.media { display: grid; gap: 8px; margin-top: 10px; }
.media-grid { display: grid; gap: 4px; border-radius: 12px; overflow: hidden; max-width: 560px; }
.media-grid.n1 { grid-template-columns: 1fr; }
.media-grid.n2 { grid-template-columns: 1fr 1fr; }
.media-grid.n3 { grid-template-columns: 1fr 1fr; }
.media-grid.n3 > :first-child { grid-row: span 2; }
.media-grid.n4 { grid-template-columns: 1fr 1fr; }
.media-thumb {
  display: block; position: relative; padding: 0; border: 0; margin: 0; cursor: zoom-in;
  background: var(--surface-3); min-height: 120px; aspect-ratio: 16 / 10; overflow: hidden; width: 100%;
}
.media-grid.n1 .media-thumb { aspect-ratio: auto; max-height: 420px; }
.media-grid.n3 > :first-child { aspect-ratio: auto; }
.media-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.media-grid.n1 .media-thumb img { height: auto; max-height: 420px; }
.media-thumb.is-broken { cursor: default; }
.media-ph {
  display: flex; align-items: center; justify-content: center; text-align: center; gap: 4px;
  width: 100%; height: 100%; min-height: 120px; padding: 12px;
  color: var(--muted); font-size: 12px; background: repeating-linear-gradient(135deg, var(--surface-2) 0 10px, var(--surface-3) 10px 20px);
}
.media-ph-row { min-height: 64px; border-radius: 12px; flex-wrap: wrap; }
.media-video { max-width: 560px; }
.media-play {
  position: relative; display: block; width: 100%; padding: 0; border: 0; border-radius: 12px; overflow: hidden;
  background: var(--surface-3); cursor: pointer; aspect-ratio: 16 / 9; color: inherit; text-decoration: none;
}
.media-play img { width: 100%; height: 100%; object-fit: cover; display: block; }
.play-badge {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); padding: 0 16px; border-radius: 999px;
  background: rgba(10, 7, 18, .78); color: #fff; font-size: 14px; font-weight: 700; white-space: nowrap;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .25);
}
.media-play:hover .play-badge, .media-play:focus-visible .play-badge { box-shadow: 0 0 0 2px var(--accent), var(--glow-accent); }
.media-player { width: 100%; max-height: 480px; border-radius: 12px; background: #000; display: block; }

/* ---------- ライトボックス ---------- */
.lightbox {
  width: 100vw; height: 100vh; max-width: 100vw; max-height: 100vh; margin: 0; padding: 16px;
  border: 0; background: rgba(5, 3, 10, .92); color: #fff;
}
.lightbox[open] { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.lightbox::backdrop { background: rgba(5, 3, 10, .6); }
.lb-body { flex: 1; min-height: 0; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.lb-body img { max-width: 100%; max-height: calc(100vh - 140px); object-fit: contain; border-radius: 8px; }
.lb-caption, .lb-error { font-size: 13px; color: #ddd; max-width: 720px; text-align: center; }
.lb-close { background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .3); }

/* ---------- X埋め込み ---------- */
.embed-notice {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 12px; color: var(--text-2); background: var(--surface-2); border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm); padding: 2px 4px 2px 12px;
}
.notice-close { width: var(--tap); height: var(--tap); border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 18px; flex: none; border-radius: 50%; }
.notice-close:hover { color: var(--text); background: var(--surface-3); }
.post-embed { padding: 0; overflow: hidden; }
.embed-band { padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); display: grid; gap: 6px; }
.embed-band .post-head .open-x { margin-left: auto; }
.embed-band .post-cats { margin-top: 0; }
.terms { font-size: 12px; }
.terms mark { font-size: 12px; }
.embed-host { padding: 6px 12px 10px; min-height: 120px; }
.post:not(.post-embed) .embed-host { padding: 10px 0 0; border-top: 1px solid var(--border); margin-top: 10px; }
.embed-host.is-loaded { min-height: 0; }
.embed-target { display: flex; justify-content: center; }
.embed-target iframe { max-width: 100% !important; }
.embed-skeleton { display: grid; gap: 8px; padding: 10px 4px; max-width: 550px; margin: 0 auto; }
.sk-line, .sk-block { display: block; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: sk 1.4s ease-in-out infinite; }
.sk-line { height: 12px; }
.sk-line.w40 { width: 40%; } .sk-line.w90 { width: 90%; } .sk-line.w75 { width: 75%; }
.sk-block { height: 120px; }
@keyframes sk { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.embed-fallback { padding: 10px 14px 14px; }
.embed-fail {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted);
  padding: 2px 10px; border-radius: 999px; border: 1px solid var(--border-strong);
}
.embed-fail::before { content: "!"; display: inline-grid; place-items: center; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); color: var(--surface); font-size: 10px; font-weight: 700; }

/* ---------- レイアウト（幅広） ---------- */
@media (min-width: 640px) {
  .sample-banner { position: sticky; top: 0; }
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 960px) {
  .filter-grid { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto auto; align-items: end; }
  .charts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart-wide { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; animation: none !important; }
}
@media (forced-colors: active) {
  .chip[aria-pressed="true"], .segmented button[aria-pressed="true"] { outline: 2px solid CanvasText; }
}

/* ---------- 更新スケジュール・伸びペース ---------- */
.delay-note {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 6px;
  font-size: 12px; color: var(--text-2);
  padding: 2px 10px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface-2);
}
.delay-note::before { content: "!"; display: inline-grid; place-items: center; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); color: var(--surface); font-size: 10px; font-weight: 700; }
.pace { margin-top: 6px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pace.is-active { color: var(--text-2); font-size: 13px; font-weight: 600; }
.pace.is-active::before { content: ""; display: inline-block; width: 3px; height: .9em; margin-right: 6px; vertical-align: -1px; border-radius: 2px; background: var(--accent); }
.pace.unk { color: var(--muted); font-weight: 400; }
.pace-note { margin-top: 6px; color: var(--muted); padding: 8px 12px; border-left: 2px solid var(--accent-3); background: var(--surface); border-radius: 0 8px 8px 0; }
.embed-band .pace { margin-top: 0; }

/* ---------- レポート ---------- */
.report { margin-top: 14px; padding: 0; overflow: hidden; }
.report > summary, .report-sub > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; min-height: var(--tap);
}
.report > summary::-webkit-details-marker, .report-sub > summary::-webkit-details-marker { display: none; }
.report > summary { padding: 10px 16px; }
.report > summary::before, .report-sub > summary::before {
  content: ""; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg); transition: transform .15s; flex: none; margin-right: 2px;
}
.report[open] > summary::before, .report-sub[open] > summary::before { transform: rotate(45deg); }
.report-title { font-size: 16px; font-weight: 700; }
.report-title .neon { color: var(--accent-ink); text-shadow: var(--glow-text); }
.report-meta { font-size: 12px; color: var(--muted); margin-left: auto; text-align: right; }
.report-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 0 16px 16px; }
.rising-more { justify-self: center; }
.report-sub { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); min-width: 0; }
.report-sub > summary { padding: 6px 12px; flex-wrap: wrap; }
.report-sub > summary h3 { font-size: 15px; font-weight: 700; }
.report-sub-body { padding: 4px 12px 14px; display: grid; gap: 14px; min-width: 0; }
.report-pick { display: flex; align-items: center; gap: 8px; margin-left: auto; font-size: 13px; color: var(--text-2); }
.report-pick select { width: auto; min-width: 9em; max-width: 100%; flex: 0 1 auto; }
.report-part { min-width: 0; }
#report-daily-body, #report-weekly-body { display: grid; gap: 18px; min-width: 0; }
.rising-item .pace { display: none; } /* 帯にデータ側の値を出すので重複させない */
.report-part > h4 { font-size: 13px; font-weight: 700; color: var(--text-2); margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.report-part > h4::before { content: ""; width: 3px; height: 14px; border-radius: 2px; background: var(--accent); }
.report-empty { font-size: 13px; color: var(--muted); padding: 10px 12px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); }
.rising-list { display: grid; gap: 10px; }
.rising-item { min-width: 0; }
.rising-band {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 12px;
  padding: 6px 12px; border: 1px solid var(--border); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; background: var(--surface-3);
}
.rising-band .rank { font-weight: 700; color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.rising-band .cond { color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
.rising-band .rpace { color: var(--text-2); font-variant-numeric: tabular-nums; }
.rising-item > .post { border-top-left-radius: 0; border-top-right-radius: 0; }
.post-missing { padding: 12px 16px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; color: var(--muted); font-size: 13px; }
.report-table td.post-cell { text-align: left; white-space: normal; min-width: 12em; max-width: 28em; }
.report-table .rt-user { background: none; border: 0; padding: 0; color: var(--text); font-weight: 700; cursor: pointer; min-height: var(--tap); }
.report-table .rt-user:hover { color: var(--accent-ink); text-decoration: underline; }
.report-table .rt-text { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 26em; }
.report-table td a { display: inline-flex; align-items: center; min-height: var(--tap); }
.cross { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 12px; border: 1px solid var(--border-strong); color: var(--muted); }
.cross.yes { color: var(--text); border-color: var(--accent); background: var(--mark-term-bg); }
.cross.yes::before { content: "✓"; font-weight: 700; color: var(--accent-ink); }
.rate-list { display: grid; gap: 8px; }
.rate-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(60px, 1fr) 8.5em; align-items: center; gap: 10px; min-height: 32px; }
.rate-label { font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; }
.rate-meter { display: block; width: 100%; height: 10px; border-radius: 0 4px 4px 0; overflow: hidden; }
.rate-track { fill: var(--surface-3); }
.rate-fill { fill: var(--accent-2); }
.rate-value { text-align: right; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--text); }
.proposal { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; padding: 10px 12px; background: var(--surface); border-radius: var(--radius-sm); border: 1px solid var(--border); }
.cand-list { display: grid; gap: 4px; list-style: none; margin: 0; padding: 0; }
.cand-list button {
  width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: 4px 12px; text-align: left;
  min-height: var(--tap); padding: 6px 10px; border: 0; border-radius: 10px; background: var(--surface); color: var(--text); cursor: pointer;
}
.cand-list button:hover { background: var(--surface-3); }
.cand-user { font-weight: 700; }
.cand-reason { color: var(--text-2); font-size: 13px; overflow-wrap: anywhere; }
@media (max-width: 639px) {
  .rate-row { grid-template-columns: minmax(0, 1fr) auto; }
  .rate-row .rate-meter { grid-column: 1 / -1; grid-row: 2; }
  .rate-row { row-gap: 6px; }
  .report-body { padding: 0 8px 12px; }
  .report-sub-body { padding: 4px 8px 12px; }
  .report-sub .post { padding: 12px; }
  .rate-list { gap: 14px; }
  .cand-list button { grid-template-columns: minmax(0, 1fr); }
  .report-pick { margin-left: 0; width: 100%; }
  .report-pick select { flex: 1; }
}
@media (min-width: 960px) {
  .report-body { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
}

/* =====================================================================
   簡潔レイアウト（常時表示: ヘッダー／最大インプレッション／ツールバー／投稿一覧。
   それ以外は「詳細・レポート・グラフ」パネルに折りたたむ）
   ===================================================================== */
.wrap { max-width: 1040px; }
main { padding-top: 12px; }
.header-inner { align-items: center; padding-top: 10px; padding-bottom: 10px; }
.title { font-size: 20px; line-height: 1.2; }
.meta-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 4px; margin-top: 2px; font-size: 12px; color: var(--muted); }
.meta-line strong { color: var(--text-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.meta-line .sep { color: var(--border-strong); }
.delay-note { margin-top: 4px; }

/* 最大インプレッションの投稿 */
.top-card { padding: 10px 14px; }
.top-label { font-size: 12px; font-weight: 600; color: var(--muted); }
.top-card .top-post { margin-top: 2px; gap: 2px; }
.top-card .top-post-head { align-items: center; gap: 0 10px; }
.top-card .top-post-value { font-size: 22px; color: var(--accent-ink); text-shadow: var(--glow-text); }
.top-card .top-post-text { -webkit-line-clamp: 1; }
.top-card { position: relative; }
.top-card .top-post-link { position: absolute; top: 0; right: 4px; text-decoration: none; }
.top-card .top-post-head .post-user { min-height: var(--tap); }
.pt-short { display: none; }
.media-play .media-ph { align-items: flex-start; padding-top: 10px; }

/* ツールバー */
.toolbar { margin-top: 10px; padding: 10px 12px; display: grid; gap: 8px; position: relative; }
.toolbar .chips { gap: 6px; }
.toolbar .chip { padding: 0 12px; font-size: 13px; gap: 6px; }
.toolbar-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.toolbar-row .segmented { flex: 0 1 auto; }
.toolbar-row .segmented button { flex: 0 0 auto; padding: 0 12px; font-size: 13px; }
.input-sm { width: auto; max-width: 100%; font-size: 14px; padding-right: 28px; }
.panel-toggle { gap: 8px; margin-left: auto; font-size: 13px; }
.panel-toggle::after {
  content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(-2px, -2px); transition: transform .15s;
}
.panel-toggle.is-open { border-color: var(--accent); box-shadow: var(--glow-accent); }
.panel-toggle.is-open::after { transform: rotate(-135deg) translate(-2px, -2px); }
.new-badge {
  font-size: 10px; font-weight: 800; letter-spacing: .06em; line-height: 1; padding: 3px 6px; border-radius: 999px;
  background: var(--accent); color: var(--on-accent); box-shadow: var(--glow-accent);
}
.toolbar-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.toolbar-foot .result-count { font-size: 12px; color: var(--muted); }
.toolbar .active-filters { margin: 0; }
.toolbar .embed-notice { margin: 0; }

/* 詳細パネル */
.panel { display: grid; gap: 12px; margin-top: 12px; padding: 12px; border: 1px solid var(--border-strong); border-radius: calc(var(--radius) + 4px); background: color-mix(in srgb, var(--bg) 60%, var(--surface)); }
.panel-sec { padding: 12px 14px; min-width: 0; margin: 0; }
.panel-sec > .section-title, .panel-sec > .section-head { margin-bottom: 10px; }
.panel .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.panel .stat { padding: 8px 10px; background: var(--surface-2); border-radius: var(--radius-sm); }
.panel .stat-value { font-size: 22px; }
.panel .meta { margin-top: 10px; }
.panel .source-note { margin: 6px 0 0; }
.panel .charts { margin-top: 0; padding: 12px 14px; }
.panel .charts > .section-title { grid-column: 1 / -1; margin-bottom: 0; }
.panel .charts .chart-card { box-shadow: none; background: var(--surface-2); }
.panel .report { padding: 0; }
.panel .accounts { max-height: none; }
@media (min-width: 960px) {
  .panel { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .panel > .report, .panel > .charts { grid-column: 1 / -1; }
}

/* 投稿カード（詰めた版） */
.posts { margin-top: 14px; }
.post-list { gap: 8px; }
.post { padding: 8px 12px 6px; }
.post-head { gap: 0 8px; }
.post-user { min-height: var(--tap); font-size: 14px; }
.post-time { font-size: 12px; }
.post-head .post-cats { margin: 0; gap: 4px; }
.post-head .badge { font-size: 11px; padding: 2px 7px; }
.post-text { margin-top: 0; font-size: 14.5px; line-height: 1.6; }
.post-text.is-clamped { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; }
.more-text {
  display: inline-flex; align-items: center; min-height: var(--tap); margin: -8px 0 -8px -4px; padding: 0 4px;
  border: 0; background: none; color: var(--link); font-size: 13px; cursor: pointer;
}
.more-text:hover { text-decoration: underline; }
.pace { margin-top: 4px; font-size: 11.5px; }
.pace.is-active { font-size: 12.5px; }
.metrics { flex-wrap: nowrap; justify-content: flex-start; gap: 0 12px; margin-top: 2px; font-size: 12px; overflow: hidden; }
.metrics li { align-items: center; gap: 3px; flex: none; }
.metrics .mi { width: 13px; height: 13px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.metrics .v { font-weight: 600; }
.post-foot { margin-top: 0; justify-content: flex-end; }
.post-actions { margin-left: 0; gap: 2px; }
.btn-sm { padding: 0 10px; font-size: 12.5px; border-color: var(--border); }
.open-x { font-size: 12.5px; padding: 0 10px; margin-right: -6px; }
.media { margin-top: 6px; }
.media-grid, .media-video { max-width: 360px; }
.media-thumb { min-height: 72px; }
.media-grid.n1 .media-thumb, .media-grid.n1 .media-thumb img { max-height: 220px; }
.media-ph { min-height: 72px; }
.media-play { max-height: 203px; }
.media-player { max-height: 260px; }
.embed-band { padding: 6px 12px; gap: 2px; }
.post-embed .embed-host { padding: 6px 8px 8px; }
@media (max-width: 639px) {
  .wrap { padding-left: 12px; padding-right: 12px; }
  /* カテゴリチップは 1 行の横スクロール（ページ自体は横スクロールしない） */
  .toolbar .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -12px; padding: 0 12px; scroll-padding: 0 12px; }
  .toolbar .chips::-webkit-scrollbar { display: none; }
  .toolbar .chip { flex: none; }
  .toolbar-row .segmented button { padding: 0 7px; }
  #period-group button { padding: 0 6px; }
  .panel-toggle { gap: 5px; }
  .new-badge { font-size: 9px; padding: 3px 5px; }
  /* 1 行目: 期間＋詳細、2 行目: 並び替え＋表示切替 */
  #period-group { order: 1; }
  .panel-toggle { order: 2; padding: 0 12px; }
  .toolbar-row #sort { order: 3; flex: 1 1 140px; min-width: 0; }
  #view-group { order: 4; }
  .top-card .top-post-value { font-size: 20px; }
  .title { font-size: 18px; }
  .toolbar-row .segmented button { padding: 0 9px; }
  .panel { padding: 8px; }
  .panel .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .panel .stat-value { font-size: 17px; }
  .metrics { gap: 0 9px; font-size: 11.5px; }
  .metrics .mi { width: 12px; height: 12px; }
}
@media (max-width: 420px) {
  .pt-long { display: none; }
  .pt-short { display: inline; }
}
.panel .filter-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: end; }
.panel .report-body { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 639px) {
  .panel .filter-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 960px) {
  .panel > .accounts { grid-column: 1 / -1; }
  .panel .acc-list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; }
}
.post-foot { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 0 8px; margin-top: 2px; }
.post-stats { min-width: 0; flex: 1 1 280px; }
.post-foot .post-actions { margin-left: auto; }
.toolbar-row #sort { max-width: 19em; }
@media (max-width: 639px) {
  .toolbar-row #sort { max-width: none; }
}
.media-grid, .media-video { max-width: 320px; }
.media-play { aspect-ratio: 16 / 9; max-height: 180px; }
.media-grid.n2 .media-thumb, .media-grid.n4 .media-thumb { aspect-ratio: 4 / 3; min-height: 0; }
.toolbar { grid-template-columns: minmax(0, 1fr); }
.toolbar > * { min-width: 0; }
.chip-sep { flex: none; align-self: center; width: 1px; height: 24px; background: var(--border-strong); margin: 0 2px; }
.chip-group .chip-name { font-weight: 700; }
@media (max-width: 639px) {
  .toolbar-row #sort { font-size: 11.5px; padding-left: 6px; padding-right: 20px; }
  #view-group button { padding: 0 5px; }
}

/* ---------- ヘッダー: タイトル＋「夜職／一般のバズ」スイッチを 1 行、更新表示は 2 行目 ---------- */
.header-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 12px; }
.header-inner .brand { display: contents; }
.header-inner .title { grid-column: 1; grid-row: 1; }
.header-inner .meta-line { grid-column: 1 / -1; grid-row: 2; }
.header-inner .delay-note { grid-column: 1 / -1; grid-row: 3; justify-self: start; }
.mode-switch { grid-column: 2; grid-row: 1; padding: 2px; }
.mode-switch button { flex: 0 0 auto; min-height: var(--tap); padding: 0 16px; font-size: 14px; font-weight: 600; }
.mode-switch button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); box-shadow: var(--glow-accent); }
@media (min-width: 640px) {
  .header-inner { grid-template-columns: auto minmax(0, 1fr) auto; }
  .header-inner .meta-line { grid-column: 2; grid-row: 1; align-self: center; margin-top: 0; }
  .header-inner .delay-note { grid-column: 1 / -1; grid-row: 2; }
  .mode-switch { grid-column: 3; }
}
@media (max-width: 380px) {
  .mode-switch button { padding: 0 11px; font-size: 13px; }
}
