/* スマホの窓口：共通の部品（デザインの決まり）。どの画面もこの部品だけで組む（仕様.md 5.） */

:root {
  --bg: #ffffff;
  --surface: #f2f2f2;
  --surface-2: #e5e5e5;
  --card: #ffffff;
  --line: rgba(0, 0, 0, .1);
  --text: #0f0f0f;
  --text-2: #606060;
  --text-3: #8c8c8c;
  --accent: #065fd4;
  --bar: #065fd4;
  --bar-dim: #a9c4ec;
  --good: #0b7a35;
  --good-bg: #e3f4e8;
  --bad: #b3261e;
  --warn-bg: #fff4d6;
  --warn-ink: #6b4d00;
  --chip-on: #0f0f0f;
  --chip-on-ink: #ffffff;
  --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 2px 8px rgba(0, 0, 0, .06);
  --radius: 14px;
  --appbar: 56px;
  --tabbar: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0f0f;
    --surface: #272727;
    --surface-2: #3a3a3a;
    --card: #1c1c1c;
    --line: rgba(255, 255, 255, .12);
    --text: #f1f1f1;
    --text-2: #aaaaaa;
    --text-3: #7a7a7a;
    --accent: #3ea6ff;
    --bar: #3ea6ff;
    --bar-dim: #2b4a66;
    --good: #5bd27f;
    --good-bg: #16331f;
    --bad: #ff8a80;
    --warn-bg: #3a2f10;
    --warn-ink: #ffd56b;
    --chip-on: #f1f1f1;
    --chip-on-ink: #0f0f0f;
    --shadow: none;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0f0f0f;
  --surface: #272727;
  --surface-2: #3a3a3a;
  --card: #1c1c1c;
  --line: rgba(255, 255, 255, .12);
  --text: #f1f1f1;
  --text-2: #aaaaaa;
  --text-3: #7a7a7a;
  --accent: #3ea6ff;
  --bar: #3ea6ff;
  --bar-dim: #2b4a66;
  --good: #5bd27f;
  --good-bg: #16331f;
  --bad: #ff8a80;
  --warn-bg: #3a2f10;
  --warn-ink: #ffd56b;
  --chip-on: #f1f1f1;
  --chip-on-ink: #0f0f0f;
  --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; background: var(--bg); color: var(--text); }

body {
  font: 15px/1.5 Roboto, "Noto Sans JP", "Hiragino Sans", system-ui, sans-serif;
  padding: var(--appbar) 0 calc(var(--tabbar) + var(--safe-b));
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
svg { width: 24px; height: 24px; fill: currentColor; flex: none; }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* ── 上の帯 ── */
.appbar {
  position: fixed; inset: 0 0 auto; z-index: 20;
  height: var(--appbar); display: flex; align-items: center; gap: 4px;
  padding: 0 4px 0 16px; background: var(--bg);
}
.appbar.has-back { padding-left: 4px; }
.appbar h1 { flex: 1; margin: 0; font-size: 20px; font-weight: 600; letter-spacing: .01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; }
.icon-btn:active { background: var(--surface); }
.icon-btn.spin svg { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 下のタブ（5つで固定） ── */
.tabbar {
  position: fixed; inset: auto 0 0; z-index: 20;
  height: calc(var(--tabbar) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--bg); border-top: 1px solid var(--line);
}
.tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size: 11.5px; color: var(--text-2); min-height: 48px; }
.tabbar .pill { position: relative; width: 56px; height: 30px; border-radius: 15px; display: grid; place-items: center;
  transition: background .15s; }
.tabbar button[aria-current="page"] { color: var(--text); font-weight: 600; }
.tabbar button[aria-current="page"] .pill { background: var(--surface); }
.tabbar .dot { position: absolute; top: 3px; right: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }

/* ── 画面 ── */
.screen { min-height: calc(100dvh - var(--appbar) - var(--tabbar)); padding: 0 0 24px; }
.section-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  margin: 22px 16px 10px; font-size: 17px; font-weight: 600; }
.section-h small { font-size: 12.5px; font-weight: 400; color: var(--text-2); }
.lead { margin: 4px 16px 0; color: var(--text-2); font-size: 13px; }

/* ── 知らせの帯 ── */
.banner { position: sticky; top: var(--appbar); z-index: 15; margin: 0; padding: 12px 16px;
  display: flex; align-items: center; gap: 12px; background: var(--warn-bg); color: var(--warn-ink); font-size: 13.5px; }
.banner span { flex: 1; }
.banner button { min-height: 40px; padding: 0 14px; border-radius: 20px; background: var(--warn-ink); color: var(--warn-bg); font-weight: 600; }

/* ── 切り替え（2つ） ── */
.sticky-tools { position: sticky; top: var(--appbar); z-index: 10; background: var(--bg); padding: 4px 0 6px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; margin: 0 16px 8px; padding: 4px; border-radius: 24px; background: var(--surface); }
.seg button { min-height: 40px; border-radius: 20px; font-weight: 600; color: var(--text-2); }
.seg button[aria-selected="true"] { background: var(--card); color: var(--text); box-shadow: var(--shadow); }
:root[data-theme="dark"] .seg button[aria-selected="true"] { background: var(--surface-2); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg button[aria-selected="true"] { background: var(--surface-2); } }

/* ── 絞り込みのボタン（チップ） ── */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips:empty { display: none; }
.chip { position: relative; flex: none; min-height: 36px; padding: 0 14px; border-radius: 10px;
  background: var(--surface); font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.chip::before { content: ""; position: absolute; inset: -6px -2px; }
.chip[aria-pressed="true"] { background: var(--chip-on); color: var(--chip-on-ink); }
.chip .arrow { font-size: 12px; }
.chip-sep { flex: none; width: 1px; margin: 6px 2px; background: var(--line); }
.chip-label { flex: none; align-self: center; font-size: 12px; color: var(--text-2); padding-right: 2px; }

.count-line { margin: 6px 16px 2px; font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.count-line .q { display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px 4px 10px; border-radius: 14px; background: var(--surface); color: var(--text); }
.count-line .q button { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; }
.count-line .q svg { width: 16px; height: 16px; }

/* ── 動画の一覧（1行） ── */
.vlist { display: flex; flex-direction: column; }
.vrow { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 16px; text-align: left; min-height: 100px; }
.vrow:active { background: var(--surface); }
.thumb { position: relative; flex: none; width: 60px; height: 80px; border-radius: 8px; overflow: hidden; background: var(--surface); }
.thumb.long { width: 112px; height: 63px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .ph { position: absolute; inset: 0; display: grid; place-items: center; font-size: 22px; font-weight: 700; color: rgba(255,255,255,.95);
  background: linear-gradient(150deg, hsl(var(--h) 55% 52%), hsl(calc(var(--h) + 40) 60% 38%)); }
.thumb .tag { position: absolute; left: 4px; bottom: 4px; padding: 1px 5px; border-radius: 4px; font-size: 10px; font-weight: 600;
  background: rgba(0,0,0,.72); color: #fff; }
.vmeta { flex: 1; min-width: 0; }
.vtitle { font-size: 14.5px; line-height: 1.4; font-weight: 500; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vsub { margin-top: 4px; font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vnum { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; min-width: 62px; }
.vnum b { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.vnum small { font-size: 11px; color: var(--text-2); }

/* 同時期比の印（色だけに頼らない：▲▼の形と数字を必ず添える） */
.ratio { display: inline-flex; align-items: center; gap: 2px; padding: 2px 7px; border-radius: 8px; font-size: 12px; font-weight: 600;
  font-variant-numeric: tabular-nums; background: var(--surface); color: var(--text-2); white-space: nowrap; }
.ratio.up { background: var(--good-bg); color: var(--good); }
.ratio.down { color: var(--bad); }

/* 良い・いつもくらい・低いの印（app.js の markHtml） */
.jm { display: inline-flex; width: 1.05em; height: 1.05em; margin-left: .3em; vertical-align: -.16em; flex: none; }
.jm svg { width: 100%; height: 100%; fill: currentColor; }
.jm.good { color: var(--good); }
.jm.norm { color: var(--text-3); }
.jm.bad { color: var(--text-2); }
.vnum b .jm { font-size: .8em; vertical-align: -.1em; }
.bars-axis .jm { margin-left: .15em; }
.jm-help { margin: -4px 16px 12px; font-size: 12px; color: var(--text-2); line-height: 1.7; }
.jm-help .jm { margin: 0 .15em 0 .5em; }
.jm-help .jm:first-child { margin-left: 0; }

.sentinel { height: 1px; }
.empty { margin: 48px 24px; text-align: center; color: var(--text-2); }
.empty svg { width: 48px; height: 48px; color: var(--text-3); display: block; margin: 0 auto 12px; }
.empty h2 { margin: 0 0 6px; font-size: 17px; color: var(--text); }

/* ── カード ── */
.card { margin: 0 16px 12px; padding: 16px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); border: 1px solid var(--line); }
.card h3 { margin: 0 0 10px; font-size: 15px; font-weight: 600; }
.card-link { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; min-height: 64px; }
.card-link .big { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.card-link .grow { flex: 1; min-width: 0; }
.card-link .sub { font-size: 12.5px; color: var(--text-2); }

/* ── 数字のカード ── */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 0 16px 12px; }
.kpis.three { grid-template-columns: repeat(3, 1fr); }
.kpi { padding: 12px 14px; border-radius: var(--radius); background: var(--surface); min-height: 76px; }
.kpi .k { font-size: 12px; color: var(--text-2); }
.kpi .v { margin-top: 2px; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.25; }
.kpi .v small { font-size: 13px; font-weight: 500; margin-left: 2px; }
.kpi .s { font-size: 11.5px; color: var(--text-2); }
.kpi.hero { grid-column: 1 / -1; }
.kpi.hero .v { font-size: 34px; }

/* ── 小さなグラフ（1つの系列の棒） ── */
.bars { position: relative; display: flex; align-items: flex-end; gap: 2px; height: 120px; padding-top: 18px; border-bottom: 1px solid var(--line); }
.bars .b { position: relative; flex: 1; height: 100%; display: flex; align-items: flex-end; }
.bars .b i { display: block; width: 100%; min-height: 2px; border-radius: 4px 4px 0 0; background: var(--bar-dim); }
.bars .b.on i { background: var(--bar); }
.bars .b em { position: absolute; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 11px; color: var(--text-2);
  white-space: nowrap; font-variant-numeric: tabular-nums; }
.bars-axis { display: flex; gap: 2px; margin-top: 4px; font-size: 11px; color: var(--text-3); }
.bars-axis span { flex: 1; text-align: center; }
.bars-note { margin-top: 8px; font-size: 12px; color: var(--text-2); }
.bars.big { height: 150px; gap: 10px; }
.bars.big .b em { font-size: 12px; color: var(--text); font-weight: 600; }
.bars-axis.big { gap: 10px; font-size: 12px; color: var(--text-2); }

/* ── 詳しく ── */
.hero { display: flex; gap: 14px; padding: 8px 16px 16px; }
.hero .thumb { width: 96px; height: 128px; border-radius: 10px; }
.hero .thumb.long { width: 160px; height: 90px; }
.hero > div:last-child { flex: 1; min-width: 0; }
.hero h2 { margin: 0; font-size: 16.5px; line-height: 1.4; font-weight: 600; }
.hero .sub { margin-top: 6px; font-size: 13px; color: var(--text-2); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 16px 16px; }
.btn { min-height: 48px; padding: 0 18px; border-radius: 24px; background: var(--surface); font-weight: 600; font-size: 14.5px;
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); }
.btn.primary { background: var(--chip-on); color: var(--chip-on-ink); }
.btn svg { width: 20px; height: 20px; }
.btn.block { width: 100%; justify-content: center; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 0 12px; margin: 0; }
.kv dt, .kv dd { margin: 0; padding: 10px 0; border-top: 1px solid var(--line); }
.kv dt { color: var(--text-2); font-size: 13.5px; }
.kv dd { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.kv dt:first-of-type, .kv dt:first-of-type + dd { border-top: 0; }
.kv.stack { grid-template-columns: 1fr; }
.kv.stack dt { padding-bottom: 0; font-size: 12px; }
.kv.stack dd { padding-top: 2px; border-top: 0; text-align: left; font-weight: 400; font-size: 14px; }
.help { font-size: 12px; color: var(--text-2); margin-top: 6px; }

/* 台本（md）を読む */
.md { font-size: 14.5px; line-height: 1.7; overflow-wrap: anywhere; }
.md h1, .md h2, .md h3 { font-size: 15.5px; margin: 18px 0 6px; }
.md h1:first-child, .md h2:first-child { margin-top: 0; }
.md p { margin: 6px 0; }
.md ul { padding-left: 1.3em; margin: 6px 0; }
.md .tbl { overflow-x: auto; margin: 8px -4px; }
.md table { border-collapse: collapse; font-size: 13.5px; min-width: 100%; }
.md th, .md td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.md th { color: var(--text-2); font-weight: 500; font-size: 12px; white-space: nowrap; }
.md code { font-size: 12.5px; background: var(--surface); padding: 1px 4px; border-radius: 4px; }

/* ── メニュー ── */
.dept { margin: 18px 0 4px; }
.dept-h { margin: 0 16px 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.tool { display: flex; align-items: center; gap: 4px; padding: 0 4px 0 16px; min-height: 64px; }
.tool:active { background: var(--surface); }
.tool .go { flex: 1; min-width: 0; text-align: left; padding: 10px 0; min-height: 64px; }
.tool .name { font-size: 15px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.tool .what { font-size: 12.5px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.badge { flex: none; padding: 1px 6px; border-radius: 6px; font-size: 10.5px; font-weight: 600; background: var(--good-bg); color: var(--good); }
.badge.pc { background: var(--surface); color: var(--text-2); }
.star { width: 48px; height: 48px; display: grid; place-items: center; color: var(--text-3); }
.star[aria-pressed="true"] { color: #f2a900; }
.favs { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 16px; }
.favs .chip { min-height: 44px; border-radius: 22px; }
.list-plain { margin: 0; padding-left: 1.2em; font-size: 13.5px; }
.list-plain li { margin: 4px 0; }

/* さがす */
.search-box { position: sticky; top: var(--appbar); z-index: 10; margin: 4px 16px 8px; display: flex; align-items: center; gap: 8px;
  padding: 0 14px; min-height: 52px; border-radius: 26px; background: var(--surface); }
.search-box svg { color: var(--text-2); }
.search-box input { flex: 1; min-width: 0; height: 52px; border: 0; outline: 0; background: none; color: var(--text); font: inherit; font-size: 16px; }
.more { display: block; width: calc(100% - 32px); margin: 4px 16px 8px; min-height: 48px; border-radius: 24px; background: var(--surface); font-weight: 600; color: var(--accent); }

/* 知らせ（下に少し出る） */
.toast { position: fixed; left: 16px; right: 16px; bottom: calc(var(--tabbar) + var(--safe-b) + 12px); z-index: 30;
  padding: 14px 16px; border-radius: 12px; background: #323232; color: #fff; font-size: 14px;
  opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: none; }

/* 読み込み中の形（骨組み） */
.skel { margin: 0 16px; }
.skel div { height: 80px; margin: 10px 0 20px; border-radius: 10px; background: var(--surface); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }

/* 詳しくの画面は、上から重ねて出す */
.overlay { animation: slide-in .16s ease-out; }
@keyframes slide-in { from { transform: translateX(24px); opacity: .4; } }

/* ── ログイン（画面いっぱい。Google のボタンは Google が描く） ── */
.login { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px 16px; background: var(--bg); overflow-y: auto; }
.login-box { width: 100%; max-width: 360px; text-align: center; }
.login-logo { width: 72px; height: 72px; border-radius: 18px; }
.login h1 { margin: 16px 0 8px; font-size: 22px; }
.login p { margin: 0 0 24px; color: var(--text-2); font-size: 14px; line-height: 1.6; }
.gbtn { display: flex; flex-direction: column; align-items: center; gap: 12px; min-height: 48px; }
.login .login-err { margin: 16px 0 0; padding: 12px; border-radius: 12px; background: var(--warn-bg); color: var(--warn-ink); font-size: 13.5px; }
.login .login-note { margin: 24px 0 0; font-size: 12.5px; }
body.locked { overflow: hidden; }

/* ── 詳しくの見出し（PC の幅で横に出すときだけ） ── */
.panel-h { display: none; }
.wide-only { display: none; }
.brand { display: none; }

/* ── PC の幅の表（成績） ── */
.vtable { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.vtable th { position: sticky; top: calc(var(--appbar) + var(--tools-h, 0px)); z-index: 5; background: var(--bg);
  padding: 0 4px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; font-weight: 500; font-size: 12.5px; color: var(--text-2); }
.vtable th.t, .vtable th.c { text-align: left; padding: 12px 8px; }
.vtable th button { min-height: 44px; padding: 0 8px; border-radius: 8px; color: inherit; font-weight: inherit; }
.vtable th button:hover { background: var(--surface); }
.vtable th[aria-sort] { color: var(--text); font-weight: 700; }
.vtable td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.vtable td.t, .vtable td.c { text-align: left; }
.vtable td.t { white-space: normal; padding-left: 8px; }
.vtable tr.vrow { display: table-row; width: auto; min-height: 0; padding: 0; cursor: pointer; }
.vtable tbody tr:hover { background: var(--surface); }
.vrow.sel, .vtable tbody tr.sel { background: var(--surface-2); }
.vtable .tt { display: flex; align-items: center; gap: 12px; min-width: 300px; }
.vtable .tt .thumb { width: 36px; height: 48px; border-radius: 6px; }
.vtable .tt .thumb.long { width: 64px; height: 36px; }
.vtable .tt .thumb .ph { font-size: 15px; }
.vtable .tt .thumb .tag { display: none; }
.vtable .tt .vtitle { font-size: 14px; }

/* タブレットの幅：スマホの形のまま、真ん中に */
@media (min-width: 640px) and (max-width: 899px) {
  body { max-width: 560px; margin: 0 auto; }
  .appbar, .tabbar { max-width: 560px; margin: 0 auto; }
}

/* ── PC の幅：左の縦のメニュー・広い表・詳しくは右に並べる（YouTube Studio のブラウザ版の形） ── */
@media (min-width: 900px) {
  :root { --rail: 240px; --panel: 460px; }
  body { padding: var(--appbar) 0 32px var(--rail); }
  .appbar { left: var(--rail); padding-left: 24px; border-bottom: 1px solid var(--line); }
  .tabbar { inset: 0 auto 0 0; width: var(--rail); height: 100dvh; padding: 0 12px 16px; display: flex; flex-direction: column; gap: 2px;
    border-top: 0; border-right: 1px solid var(--line); }
  .brand { display: flex; align-items: center; gap: 10px; height: var(--appbar); padding: 0 8px; margin-bottom: 8px; font-weight: 700; font-size: 15px; }
  .brand img { width: 28px; height: 28px; border-radius: 7px; }
  .tabbar button { flex-direction: row; justify-content: flex-start; gap: 18px; min-height: 48px; padding: 0 14px; border-radius: 12px; font-size: 14.5px; }
  .tabbar button:hover { background: var(--surface); }
  .tabbar .pill { width: 24px; height: 24px; background: none !important; }
  .tabbar button[aria-current="page"] { background: var(--surface); }
  .tabbar .dot { top: -2px; right: -4px; }

  .screen { max-width: 1280px; margin: 0 auto; padding: 0 16px 32px; }
  .split .screen:not(#s-detail) { margin-right: var(--panel); }
  .split #s-detail { position: fixed; top: var(--appbar); right: 0; bottom: 0; z-index: 12; width: var(--panel); max-width: none; margin: 0;
    overflow-y: auto; overscroll-behavior: contain; background: var(--bg); border-left: 1px solid var(--line); animation: none; padding-bottom: 32px; }
  .panel-h { display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 2; padding: 4px 4px 4px 16px; background: var(--bg); }
  .panel-h h2 { flex: 1; margin: 0; font-size: 16px; }
  .wide-only { display: block; }

  #stats-sorts { display: none; }          /* PC は表の見出しで並べ替える */
  .sticky-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 0 8px; }
  .sticky-tools .seg { width: 320px; margin: 0 8px 0 16px; }
  .sticky-tools .chips { flex: 1; min-width: 0; }

  .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; align-items: start; }
  .kpis.three { grid-template-columns: repeat(3, 1fr); }
  .depts { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 0 24px; }
  #s-menu > .seg, #s-menu > .section-h, #s-menu > .card { max-width: 560px; }
  .search-box, #search-results { max-width: 820px; }
  .hero .thumb { width: 120px; height: 160px; }
  .toast { left: auto; right: 24px; bottom: 24px; width: 360px; }
  .vrow:hover { background: var(--surface); }
}
/* 詳しくを横に開いたときは、表を細くする（列の数は、開く前の幅で app.js が決める） */
@media (min-width: 900px) {
  .split .vtable :is(th, td):nth-child(n+6) { display: none; }
  .split .vtable .tt { min-width: 220px; }
}
