/*
 * CC.jp Apps の共通スタイル。ccjp-entryhub の public/hub.css をそのまま持ってきたもの（見た目をそろえるため。直すときは entryhub 側も見る）。
 * 機能ごとの見た目は public/<機能>/ の CSS に足し、ここは変えない。
 * もとの説明（entryhub）：Vercel / Resend / Supabase のダッシュボードの型。
 *   左にサイドバー（切り替え・メニュー・自分）、本文は「ページ名 → 絞り込みの帯 → 1行で完結する一覧」、
 *   行を押すと詳細（ラベルと値の格子）。画面の幅いっぱいを使い、横スクロールは出さない
 *   （幅が足りないときは優先度の低い列から隠す）。シリーズの色はここでは使わない。
 * 使わないもの：数字を並べたタイル、グラデーション、ピル型、絵文字、色付きの帯、片側だけ色付きの線。
 * 色はすべて下のトークンで書く（直書きしない）。テーマはシステム／ライト／ダーク（hub.js が <html data-theme> を付ける。
 * 付いていなければ OS の設定に従う）。ダークの値は2か所（OS がダークのとき・data-theme="dark"）に同じものを書く。
 */
@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600&family=Geist+Mono:wght@400;500&display=swap');

:root {
  --bg: #ffffff;
  --side: #fafafa;
  --subtle: #fafafa;
  --border: #ebebeb;
  --border-strong: #d9d9d9;
  --fg: #0a0a0a;
  --fg-2: #3f3f46;
  --muted: #71717a;
  --faint: #a1a1aa;
  --hover: #f4f4f5;
  --active: #ededee;
  --green: #16a34a;
  --red: #dc2626;
  --red-text: #b91c1c;
  --red-bg: #fef2f2;
  --amber: #d97706;
  --amber-text: #a16207;
  --amber-bg: #fefce8;
  --amber-border: #fef08a;
  --red-border: #fecaca;
  --green-text: #15803d;
  --green-bg: #f0fdf4;
  --green-border: #bbf7d0;
  --surface: #ffffff;        /* カード・入力欄・メニュー */
  --on-fg: #ffffff;          /* 墨のボタンの上の文字 */
  --primary-hover: #27272a;
  --ring: rgba(0, 0, 0, .06);
  --shadow: rgba(0, 0, 0, .09);
  --overlay: rgba(0, 0, 0, .25);
  --logo-filter: none;       /* CC.jp の黒いロゴ */
  color-scheme: light;
  --radius: 6px;
  --side-w: 248px;
  --gutter: clamp(16px, 3vw, 40px);
  --sans: 'Geist', -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Yu Gothic', Meiryo, sans-serif;
  --mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0a0a0a;
    --side: #0f0f0f;
    --subtle: #121212;
    --border: #242424;
    --border-strong: #333333;
    --fg: #ededed;
    --fg-2: #c4c4c8;
    --muted: #8f8f96;
    --faint: #5c5c63;
    --hover: #1a1a1a;
    --active: #222222;
    --green: #22c55e;
    --red: #ef4444;
    --red-text: #f87171;
    --red-bg: rgba(239, 68, 68, .1);
    --red-border: rgba(239, 68, 68, .3);
    --amber: #f59e0b;
    --amber-text: #fbbf24;
    --amber-bg: rgba(245, 158, 11, .1);
    --amber-border: rgba(245, 158, 11, .3);
    --green-text: #4ade80;
    --green-bg: rgba(34, 197, 94, .1);
    --green-border: rgba(34, 197, 94, .3);
    --surface: #0f0f0f;
    --on-fg: #0a0a0a;
    --primary-hover: #d4d4d8;
    --ring: rgba(255, 255, 255, .08);
    --shadow: rgba(0, 0, 0, .5);
    --overlay: rgba(0, 0, 0, .6);
    --logo-filter: invert(1);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #0a0a0a;
  --side: #0f0f0f;
  --subtle: #121212;
  --border: #242424;
  --border-strong: #333333;
  --fg: #ededed;
  --fg-2: #c4c4c8;
  --muted: #8f8f96;
  --faint: #5c5c63;
  --hover: #1a1a1a;
  --active: #222222;
  --green: #22c55e;
  --red: #ef4444;
  --red-text: #f87171;
  --red-bg: rgba(239, 68, 68, .1);
  --red-border: rgba(239, 68, 68, .3);
  --amber: #f59e0b;
  --amber-text: #fbbf24;
  --amber-bg: rgba(245, 158, 11, .1);
  --amber-border: rgba(245, 158, 11, .3);
  --green-text: #4ade80;
  --green-bg: rgba(34, 197, 94, .1);
  --green-border: rgba(34, 197, 94, .3);
  --surface: #0f0f0f;
  --on-fg: #0a0a0a;
  --primary-hover: #d4d4d8;
  --ring: rgba(255, 255, 255, .08);
  --shadow: rgba(0, 0, 0, .5);
  --overlay: rgba(0, 0, 0, .6);
  --logo-filter: invert(1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 14px/1.55 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
svg.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ================= app shell ================= */
.side { position: fixed; inset: 0 auto 0 0; width: var(--side-w); background: var(--side); border-right: 1px solid var(--border); display: flex; flex-direction: column; z-index: 20; }
.side__top { padding: 14px 12px 8px; }
.side__brand { display: flex; align-items: center; gap: 9px; padding: 6px 8px; font-weight: 600; letter-spacing: -.01em; }
.mark { width: 22px; height: 22px; border-radius: 5px; background: var(--fg); color: var(--on-fg); display: grid; place-items: center; font: 600 11px/1 var(--mono); flex: none; }
.switch { position: relative; margin: 10px 0 0; }
.switch select { width: 100%; height: 36px; padding: 0 30px 0 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); appearance: none; cursor: pointer; font-weight: 500; }
.switch svg { position: absolute; right: 9px; top: 10px; pointer-events: none; color: var(--muted); }
.nav { padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; }
.nav__sep { height: 1px; background: var(--border); margin: 8px 12px; }
.nav__label { font-size: 11.5px; color: var(--muted); padding: 10px 10px 4px; letter-spacing: .02em; }
.nav a { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: var(--radius); color: var(--fg-2); }
.nav a:hover { background: var(--hover); color: var(--fg); }
.nav a[aria-current='page'] { background: var(--active); color: var(--fg); font-weight: 500; }
/* サブメニュー（Entries の下の Entry List・Results・Files、Emails の下の Templates）。左に細い線で親とつなぐ */
.nav__sub { display: flex; flex-direction: column; gap: 1px; margin: 1px 0 4px 21px; padding-left: 8px; border-left: 1px solid var(--border); }
.nav__sub a { height: 30px; font-size: 13px; }
.nav__sub a svg { width: 15px; height: 15px; }
/* Health の要確認の件数（サイドバー） */
.nav__badge { margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.side__me { margin-top: auto; padding: 12px 14px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--active); display: grid; place-items: center; font-size: 12px; font-weight: 600; color: var(--fg-2); flex: none; }
.side__who { min-width: 0; flex: 1; line-height: 1.3; }
.side__who b { display: block; font-weight: 500; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side__who span { font-size: 12px; color: var(--muted); }
.iconbtn { width: 30px; height: 30px; display: grid; place-items: center; border: 0; background: none; border-radius: var(--radius); color: var(--muted); cursor: pointer; flex: none; }
.iconbtn:hover { background: var(--hover); color: var(--fg); }

.top { display: none; }
.content { margin-left: var(--side-w); min-height: 100vh; }
.main { padding: 36px var(--gutter) 80px; }

@media (max-width: 900px) {
  .side { transform: translateX(-100%); transition: transform .18s; box-shadow: none; }
  body.nav-open .side { transform: none; box-shadow: 0 0 0 100vmax var(--overlay); }
  .top { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 12px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--bg); z-index: 10; }
  .top b { font-weight: 600; }
  .content { margin-left: 0; }
  .main { padding-top: 24px; }
}

/* ================= page ================= */
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin: 0 0 10px; }
.crumbs a:hover { color: var(--fg); }
.page-hd { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 0 0 22px; }
.page-hd h1 { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -.025em; line-height: 1.25; }
.page-hd p { margin: 6px 0 0; color: var(--muted); }
.page-hd__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.section-title { font-size: 15px; font-weight: 600; margin: 40px 0 12px; }
.tabs { display: flex; gap: 4px; margin: 0 0 20px; }
.tabs a, .tabs button { height: 32px; padding: 0 12px; display: inline-flex; align-items: center; border-radius: var(--radius); border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 13.5px; }
.tabs a:hover, .tabs button:hover { color: var(--fg); }
.tabs [aria-selected='true'] { background: var(--active); color: var(--fg); font-weight: 500; }
/* Entry List の区分のタブ：多いときは折り返す（横に流さない） */
.tabs--wrap { flex-wrap: wrap; }
.tabs__n { margin-left: 6px; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ================= controls ================= */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: var(--radius); border: 1px solid var(--border-strong); background: var(--surface); color: var(--fg); font-size: 13.5px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--hover); }
.btn--primary { background: var(--fg); border-color: var(--fg); color: var(--on-fg); }
.btn--primary:hover { background: var(--primary-hover); }
.btn--block { width: 100%; height: 40px; font-size: 14px; }
.btn:disabled { opacity: .45; cursor: default; }
.btn .count { opacity: .6; font-variant-numeric: tabular-nums; }
.input, .select { height: 34px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); font-size: 13.5px; }
.input { width: 100%; }
.input--lg { height: 40px; font-size: 14px; }
.select { padding-right: 30px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%2371717a' stroke-width='1.5'%3E%3Cpath d='m3 4.5 3 3 3-3'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; cursor: pointer; }
.input:focus, .select:focus, .switch select:focus { outline: none; border-color: var(--fg); box-shadow: 0 0 0 3px var(--ring); }
.search { position: relative; flex: 1 1 260px; min-width: 180px; }
.search svg { position: absolute; left: 10px; top: 9px; color: var(--muted); }
.search .input { padding-left: 32px; }
.filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.label { display: block; font-size: 13px; font-weight: 500; margin: 0 0 6px; }
.hint { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }
.field { margin: 0 0 18px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.check input { width: 15px; height: 15px; accent-color: var(--fg); margin: 0; }
.checks { display: flex; flex-wrap: wrap; gap: 10px 24px; }
.checks--col { flex-direction: column; gap: 8px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 20px; }

.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; width: 30px; height: 30px; display: grid; place-items: center; border-radius: var(--radius); color: var(--muted); }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary:hover, .menu[open] > summary { background: var(--hover); color: var(--fg); }
.menu__list { position: absolute; right: 0; top: 34px; z-index: 30; min-width: 190px; padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 28px var(--shadow); }
.menu__list button, .menu__list a { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 7px 10px; border: 0; background: none; border-radius: 4px; font-size: 13px; cursor: pointer; }
.menu__list button:hover, .menu__list a:hover { background: var(--hover); }
/* Entries の〔CSV〕〔印刷〕：2行の項目（名前と小さな説明） */
.menu__list--wide { width: 310px; max-width: calc(100vw - 32px); }
.menu__list a { color: inherit; text-decoration: none; }
.menu__list .menu__row { align-items: flex-start; padding: 8px 10px; }
.menu__row > svg { flex: none; margin-top: 2px; }
.menu__row > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.menu__row small { color: var(--muted); font-size: 11.5px; line-height: 1.45; white-space: normal; }
.menu__list button:disabled { opacity: .45; cursor: default; background: none; }

/* ================= data table（1行で完結。はみ出す文字は省略、狭い画面は列を隠す） ================= */
.dt { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; border: 1px solid var(--border); border-radius: 8px; font-size: 13.5px; }
.dt th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12.5px; height: 38px; padding: 0 14px; background: var(--subtle); border-bottom: 1px solid var(--border); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dt th:first-child { border-top-left-radius: 8px; }
/* 列幅（Hub.table）：見出しの右端のつまみ。列の合計が画面より広ければ表ごと横にスクロール（table-layout:fixed は列の合計まで広がる） */
.dt-wrap { overflow-x: auto; }
.dt th { position: relative; }
.th-grip { position: absolute; top: 0; right: 0; bottom: 0; width: 7px; cursor: col-resize; touch-action: none; }
.th-grip::after { content: ''; position: absolute; top: 9px; bottom: 9px; right: 3px; width: 1px; background: transparent; }
.dt th:hover .th-grip::after { background: var(--border-strong, var(--border)); }
.th-grip:hover::after, .is-resizing .th-grip::after { background: var(--fg-2); }
.is-resizing, .is-resizing * { cursor: col-resize !important; user-select: none; }
.dt th:last-child { border-top-right-radius: 8px; }
.dt td { height: 50px; padding: 0 14px; border-bottom: 1px solid var(--border); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dt tr:last-child td { border-bottom: 0; }
.dt tbody tr { cursor: pointer; }
.dt tbody tr:hover td { background: var(--subtle); }
.dt tr.is-off td { color: var(--faint); }
.dt .sub { color: var(--muted); margin-left: 8px; }
.dt .num { font-family: var(--mono); font-size: 12.5px; color: var(--fg-2); }
.dt .w-act { width: 52px; text-align: right; padding-right: 8px; overflow: visible; }
.dt td.w-act { overflow: visible; }
.empty { padding: 56px 20px; text-align: center; color: var(--muted); }
@media (max-width: 1280px) { .hide-xl { display: none; } }
@media (max-width: 1080px) { .hide-lg { display: none; } }
@media (max-width: 760px) { .hide-md { display: none; } }

/* 汎用の表（アカウントなど。折り返して横スクロールさせない） */
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--border); border-radius: 8px; font-size: 13.5px; }
.tbl th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12.5px; height: 38px; padding: 0 14px; background: var(--subtle); border-bottom: 1px solid var(--border); }
.tbl th:first-child { border-top-left-radius: 8px; }
.tbl th:last-child { border-top-right-radius: 8px; }
.tbl td { padding: 13px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; overflow-wrap: anywhere; }
/* Operations の Flow：準備・当日・あと の区切りの行 */
.flow .tag { display: inline-block; padding: 1px 8px; border: 1px solid var(--border-strong); border-radius: 999px; font-size: 12px; color: var(--fg-2); white-space: nowrap; }
.flow .flow__ph th { height: 30px; background: none; color: var(--fg); font-size: 12px; letter-spacing: .04em; border-radius: 0; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.is-off td { color: var(--faint); }
.tbl td .sub { display: block; margin-top: 2px; color: var(--muted); font-size: 12.5px; }
.tbl tr[data-href]:hover td, .tbl tr[data-e]:hover td { background: var(--hover); }
.tbl tr.is-current td { background: var(--active); font-weight: 500; }

/* ================= 状態（点と文字だけ） ================= */
.state { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.state::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; }
.state--ok::before { background: var(--green); }
.state--ng::before { background: var(--red); }
.state--warn::before { background: var(--amber); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.notice { display: flex; align-items: center; gap: 10px; padding: 9px 13px; border-radius: var(--radius); font-size: 13px; margin: 0 0 20px; background: var(--subtle); color: var(--fg-2); border: 1px solid var(--border); }
.notice--amber { background: var(--amber-bg); color: var(--amber-text); border-color: var(--amber-border); }
.notice--red { background: var(--red-bg); color: var(--red-text); border-color: var(--red-border); }
.notice--green { background: var(--green-bg); color: var(--green-text); border-color: var(--green-border); }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--fg); color: var(--on-fg); padding: 9px 16px; border-radius: var(--radius); font-size: 13px; z-index: 50; }

/* ================= 詳細（Vercel のデプロイ詳細の型） ================= */
.box { border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.box + .box { margin-top: 16px; }
.box__hd { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px 12px 20px; border-bottom: 1px solid var(--border); font-weight: 500; min-height: 56px; flex-wrap: wrap; }
.box__body { padding: 20px; }
.box__ft { padding: 12px 20px; border-top: 1px solid var(--border); background: var(--subtle); border-radius: 0 0 8px 8px; display: flex; gap: 8px; justify-content: flex-end; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 22px 28px; }
.kv dt { font-size: 12.5px; color: var(--muted); margin: 0 0 3px; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.kv dd .sub { display: block; color: var(--muted); font-size: 12.5px; }

/* メールの見本（Supabase のテンプレート画面の型） */
.preview { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: start; }
.preview__list { display: flex; flex-direction: column; gap: 2px; }
.preview__list button { text-align: left; height: 34px; padding: 0 10px; border: 0; background: none; border-radius: var(--radius); color: var(--fg-2); cursor: pointer; }
.preview__list button:hover { background: var(--hover); }
.preview__list button[aria-selected='true'] { background: var(--active); color: var(--fg); font-weight: 500; }
.preview iframe { width: 100%; height: 900px; border: 0; display: block; border-radius: 0 0 8px 8px; }
@media (max-width: 900px) { .preview { grid-template-columns: 1fr; } }

/* ================= シリーズ一覧（トップ） ================= */
.series { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.series__item { display: flex; flex-direction: column; padding: 22px; border: 1px solid var(--border); border-radius: 8px; min-height: 170px; }
.series__item:hover { border-color: var(--border-strong); background: var(--subtle); }
.series__logo { height: 30px; display: flex; align-items: center; margin: 0 0 18px; }
.series__logo img { max-height: 24px; max-width: 190px; }
.series__name { font-weight: 600; font-size: 15px; }
.series__desc { color: var(--muted); font-size: 13px; }
.series__next { margin-top: auto; padding-top: 18px; font-size: 13px; color: var(--muted); }
.series__next b { color: var(--fg); font-weight: 500; }

/* ================= ログイン ================= */
.auth { max-width: 360px; margin: 16vh auto 0; padding: 0 20px; }
.auth__brand { display: flex; justify-content: center; align-items: center; gap: 9px; font-weight: 600; margin: 0 0 36px; }
.auth h1 { font-size: 24px; font-weight: 600; letter-spacing: -.02em; text-align: center; margin: 0 0 8px; }
.auth__lead { text-align: center; color: var(--muted); margin: 0 0 28px; }
.auth__foot { text-align: center; color: var(--muted); font-size: 12.5px; margin: 28px 0 0; }
.auth__foot a { text-decoration: underline; }

/* ブランド：CC.jp のロゴ＋EntryHub */
.brand-logo { height: 20px; width: auto; display: block; filter: var(--logo-filter); }
.side__brand { gap: 8px; font-size: 15px; }
.auth__brand .brand-logo { height: 26px; }
.auth__brand { font-size: 18px; gap: 10px; }

/* シリーズのロゴ：ダークでは白抜き版（hub.logoDark）に差し替える */
.logo-dark { display: none !important; }
:root[data-theme='dark'] .logo-light { display: none !important; }
:root[data-theme='dark'] .logo-dark { display: block !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .logo-light { display: none !important; }
  :root:not([data-theme='light']) .logo-dark { display: block !important; }
}

/* テーマの切り替え（サイドバーの下。システム／ライト／ダーク） */
.side__theme { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--border); margin-top: auto; font-size: 12.5px; color: var(--muted); }
.side__theme + .side__me { margin-top: 0; }
.seg { display: inline-flex; padding: 2px; gap: 2px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.seg button { width: 28px; height: 24px; display: grid; place-items: center; border: 0; border-radius: 4px; background: none; color: var(--muted); cursor: pointer; }
.seg button:hover { color: var(--fg); }
.seg button[aria-pressed='true'] { background: var(--active); color: var(--fg); }
.seg svg.i { width: 14px; height: 14px; }

/* ================= 一覧の下からせり上がる詳細（Entries・Customers・Emails。一覧はそのまま操作できる。影は付けない。hub.js の Hub.sheet） ================= */
/* 一覧と見分けられるように：詳細は一段沈んだ地の色（--sheet-bg）で、中の箱は本文と同じ色（--bg）。上端に高さを変えるつまみ。
   一覧で開いている行は濃い地＋太字。高さは hub.js が <html> の --sheet-h を書き換える（ドラッグ・広げる） */
:root { --sheet-h: min(44vh, 500px); --sheet-bg: #f4f4f5; --sheet-line: #d4d4d8; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) { --sheet-bg: #161618; --sheet-line: #3f3f46; } }
:root[data-theme='dark'] { --sheet-bg: #161618; --sheet-line: #3f3f46; }
.sheet { position: fixed; left: var(--side-w); right: 0; bottom: 0; height: var(--sheet-h); z-index: 15; display: flex; flex-direction: column; background: var(--sheet-bg); border-top: 1px solid var(--sheet-line); transform: translateY(100%); visibility: hidden; transition: transform .24s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .24s; }
body.has-sheet .sheet { transform: none; visibility: visible; transition: transform .24s cubic-bezier(.2, .8, .2, 1); }
body.has-sheet .main { padding-bottom: calc(var(--sheet-h) + 32px); }
body.has-sheet .dt tbody tr { scroll-margin-bottom: calc(var(--sheet-h) + 16px); scroll-margin-top: 16px; }
body.sheet-dragging, body.sheet-dragging * { cursor: ns-resize !important; user-select: none; }
body.sheet-dragging .sheet { transition: none; }
.sheet .box { background: var(--bg); }
.sheet .box__ft { background: var(--sheet-bg); }
.sheet__grip { position: absolute; left: 0; right: 0; top: -5px; height: 14px; cursor: ns-resize; touch-action: none; z-index: 1; display: grid; place-items: center; }
.sheet__grip::after { content: ''; width: 40px; height: 4px; border-radius: 2px; background: var(--sheet-line); margin-top: 4px; transition: background .12s; }
.sheet__grip:hover::after, .sheet__grip:focus-visible::after, body.sheet-dragging .sheet__grip::after { background: var(--muted); }
.sheet__grip:focus-visible { outline: none; }
.sheet__hd { display: flex; align-items: center; gap: 8px; padding: 12px var(--gutter) 10px; border-bottom: 1px solid var(--sheet-line); min-height: 58px; }
.sheet__title { flex: 1; min-width: 0; line-height: 1.35; }
.sheet__title b { display: block; font-size: 16px; font-weight: 600; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet__title > span { font-size: 12.5px; color: var(--muted); }
.sheet__nav { display: flex; align-items: center; gap: 2px; margin-left: 8px; }
.sheet__pos { font: 12px var(--mono); color: var(--muted); margin-right: 6px; white-space: nowrap; }
.sheet__nav .iconbtn:disabled { opacity: .35; cursor: default; background: none; }
.sheet__body { flex: 1; overflow-y: auto; padding: 16px var(--gutter) 24px; }
.sheet__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 16px; align-items: start; }
.sheet__grid .box + .box { margin-top: 0; }
.dt tbody tr.is-selected td, .dt tbody tr.is-selected:hover td { background: var(--active); color: var(--fg); font-weight: 500; }
.sheet__grid--form { grid-template-columns: minmax(0, 640px); }
.sheet .preview-frame { width: 100%; height: 760px; border: 0; display: block; border-radius: 0 0 8px 8px; }
@media (max-width: 900px) {
  :root { --sheet-h: 60vh; }
  .sheet { left: 0; }
}
@media (prefers-reduced-motion: reduce) { .sheet, body.has-sheet .sheet { transition: none; } }
/* 左に項目、右に大きく中身（Emails の本文など）。狭い画面は縦に */
.sheet__grid--wide { grid-template-columns: minmax(240px, 1fr) minmax(0, 2.4fr); }
@media (max-width: 1080px) { .sheet__grid--wide { grid-template-columns: minmax(0, 1fr); } }

/* ================= サイドバーの開閉（<html class="side-rail"> でアイコンだけの細い帯。マウスを乗せている間だけ広がる。広い画面だけ） ================= */
:root { --rail-w: 60px; }
.side__brandrow { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.side__rail { color: var(--faint); }
@media (min-width: 901px) {
  .side { transition: width .18s ease; }
  .side-rail .side { width: var(--rail-w); overflow: hidden; }
  .side-rail .side:not(.is-hold):is(:hover, :focus-within) { width: var(--side-w); } /* is-hold＝たたむボタンを押した直後。マウスがサイドバーから出るまで広げない（hub.js の setRail） */
  .side-rail .content { margin-left: var(--rail-w); }
  .side-rail .sheet { left: var(--rail-w); }
  .side-rail .side:is(.is-hold, :not(:hover):not(:focus-within)) :is(.nav__text, .switch, .side__theme, .side__who, #hubLogout, .side__rail) { display: none; }
  .side-rail .side:is(.is-hold, :not(:hover):not(:focus-within)) .side__brand { padding: 6px 0; }
  .side-rail .side:is(.is-hold, :not(:hover):not(:focus-within)) .brand-logo { height: 16px; } /* 帯の幅（60px）に CC.jp のロゴだけ残す。開くボタンはマウスを乗せると出る */
  .side-rail .side:is(.is-hold, :not(:hover):not(:focus-within)) .side__brandrow { justify-content: center; }
  .side-rail .side:is(.is-hold, :not(:hover):not(:focus-within)) .nav a { justify-content: center; padding: 0; }
  .side-rail .side:is(.is-hold, :not(:hover):not(:focus-within)) .nav__sub { margin-left: 0; padding-left: 0; border-left: 0; }
  .side-rail .side:is(.is-hold, :not(:hover):not(:focus-within)) .side__me { justify-content: center; padding: 12px 0; }
  .side-rail .side__rail { color: var(--fg); }
  .side-rail .side .nav a, .side-rail .side .side__who { white-space: nowrap; }
}
@media (max-width: 900px) { .side__rail { display: none; } }
@media (prefers-reduced-motion: reduce) { .side { transition: none; } }

/* ================= 一覧の表：見出しで並び替え・列の表示（hub.js の Hub.table） ================= */
.th-sort { all: unset; display: inline-flex; align-items: center; gap: 4px; max-width: 100%; cursor: pointer; color: inherit; font: inherit; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.th-sort svg.i { width: 12px; height: 12px; opacity: .35; flex: none; }
.th-sort:hover, .th-sort.is-on { color: var(--fg); }
.th-sort:hover svg.i, .th-sort.is-on svg.i { opacity: 1; }
.th-sort:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; border-radius: 2px; }
.menu.colmenu > summary { width: auto; height: 34px; display: inline-flex; padding: 0 13px; gap: 7px; color: var(--fg); border: 1px solid var(--border-strong); background: var(--surface); }
.menu.colmenu > summary:hover, .menu.colmenu[open] > summary { background: var(--hover); color: var(--fg); }
.menu__label { font-size: 11.5px; color: var(--muted); padding: 6px 10px 4px; }
.menu__check { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 4px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.menu__check:hover { background: var(--hover); }
.menu__check input { width: 14px; height: 14px; margin: 0; accent-color: var(--fg); }
.menu__item { display: block; width: 100%; text-align: left; padding: 6px 10px; margin-top: 4px; border: 0; border-top: 1px solid var(--border); border-radius: 0 0 4px 4px; background: none; color: var(--fg-2); font: inherit; font-size: 13px; cursor: pointer; }
.menu__item:hover { background: var(--hover); }

/* ================= ページャー（Activity。サーバーで 100 件ずつ）・記録そのもの ================= */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0 0; font-size: 13px; }
.pager__nav { display: flex; align-items: center; gap: 6px; }
.pager__nav .iconbtn:disabled { opacity: .35; cursor: default; background: none; }
.raw { margin: 0; padding: 16px 20px; font: 12.5px/1.6 var(--mono); color: var(--fg-2); white-space: pre-wrap; overflow-wrap: anywhere; }

/* ================= 文字のセグメント（Results の 表／HTML） ================= */
.seg--text button { width: auto; padding: 0 10px; font-size: 12.5px; font-weight: 500; }

/* ================= Summary（シリーズのトップ）。色は墨1色＋薄いグレー。数字は表の列だけ tabular ================= */
.sum-note { color: var(--muted); font-size: 13px; }
.sum-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 16px; margin-top: 16px; }
.sum-grid .box + .box { margin-top: 0; }
.legend { display: inline-flex; align-items: center; gap: 16px; font-size: 12.5px; font-weight: 400; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.key-strong { background: var(--fg); }
.key-soft { background: var(--border-strong); }

/* 大会ごとの参加人数（縦の棒。下＝2回目以降、上＝初めて。2px の地の隙間で分ける） */
.trend { position: relative; display: flex; align-items: flex-end; gap: 4px; height: 240px; padding: 22px 0 0 36px; }
.trend__grid { position: absolute; left: 36px; right: 0; border-top: 1px solid var(--border); }
.trend__tick { position: absolute; left: 0; width: 30px; text-align: right; transform: translateY(-50%); font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }
.trend__col { position: relative; flex: 1 1 0; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; cursor: pointer; outline: none; border-radius: 4px; }
.trend__col:hover, .trend__col:focus-visible { background: var(--hover); }
.trend__col.is-dim .trend__stack { opacity: .3; }
.trend__val { font-size: 12px; font-weight: 500; color: var(--fg-2); margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.trend__stack { width: min(24px, 70%); display: flex; flex-direction: column; gap: 2px; }
.trend__stack span { display: block; }
.trend__stack span:first-child { border-radius: 4px 4px 0 0; }
.trend__new { background: var(--border-strong); }
.trend__rep { background: var(--fg); }
.trend__x { display: flex; gap: 4px; padding: 8px 0 0 36px; }
.trend__x span { flex: 1 1 0; min-width: 0; text-align: center; font-size: 11.5px; line-height: 1.35; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trend__x b { display: block; font-weight: 400; color: var(--faint); font-size: 11px; }
.trend__x .is-on { color: var(--fg); font-weight: 500; }
.tip { position: fixed; z-index: 60; pointer-events: none; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; font-size: 12.5px; line-height: 1.5; box-shadow: 0 4px 16px var(--shadow); min-width: 150px; }
.tip b { display: block; font-weight: 500; margin-bottom: 4px; }
.tip div { display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--muted); }
.tip div strong { color: var(--fg); font-weight: 600; font-variant-numeric: tabular-nums; }
.tip i { display: inline-block; width: 10px; height: 2px; margin-right: 6px; vertical-align: middle; }

/* 横の棒のリスト（区分・性別・都道府県・参加回数・ニュースレター） */
.bars { display: grid; grid-template-columns: minmax(84px, max-content) 1fr auto; gap: 10px 14px; align-items: center; font-size: 13.5px; }
.bars__label { color: var(--fg-2); overflow-wrap: anywhere; }
.bars__track { height: 8px; }
.bars__fill { display: block; height: 100%; min-width: 2px; background: var(--fg); border-radius: 0 4px 4px 0; }
.bars__fill.is-soft { background: var(--border-strong); }
.bars__n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bars__n small { color: var(--faint); font-size: 12px; margin-left: 6px; display: inline-block; min-width: 3.2em; }
.bars__empty { color: var(--muted); margin: 0; }
.sum-table { margin-top: 18px; }
.sum-table summary { cursor: pointer; color: var(--muted); font-size: 12.5px; }
.sum-table .tbl { margin-top: 10px; }
.sum-table td.num, .sum-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .trend__val { font-size: 11px; } .trend__x span { font-size: 10.5px; } }

/* ================= Results の表（表／HTML の 表） ================= */
.rtbl td.num, .rtbl th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rtbl td.rank { width: 56px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rtbl td .tag { color: var(--muted); font-size: 12px; margin-left: 6px; }
.rsec + .rsec { margin-top: 18px; }
.rsec h3 { margin: 0 0 8px; font-size: 14px; font-weight: 600; }
.rsec h3 span { color: var(--muted); font-weight: 400; font-size: 12.5px; margin-left: 8px; }

/* Summary の上のカード（Cloudflare の Analytics の形：ラベル・数字・前回比・大会ごとの推移の線）。数字だけのタイルにはしない */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 16px; margin: 0 0 16px; }
.stat { border: 1px solid var(--border); border-radius: 8px; background: var(--surface); padding: 16px 18px 0; display: flex; flex-direction: column; min-width: 0; }
.stat__label { font-size: 12.5px; color: var(--muted); }
.stat__row { display: flex; align-items: baseline; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.stat__value { font-size: 28px; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; }
.stat__value small { font-size: 15px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.stat__delta { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.stat__delta b { font-weight: 500; color: var(--fg-2); }
.stat__spark { position: relative; height: 44px; margin: 10px -18px 0; color: var(--fg); }
.stat__spark svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.stat__dot { position: absolute; width: 8px; height: 8px; margin: 0 0 -4px -4px; border-radius: 50%; background: var(--fg); box-shadow: 0 0 0 2px var(--surface); }
.stat__none { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; color: var(--faint); }
.legend b { font-weight: 500; color: var(--fg); margin-left: 4px; font-variant-numeric: tabular-nums; }

/* ================= 補足の説明（「?」と吹き出し。Hub.help）。本文に説明文を並べない ================= */
.help { display: inline-grid; place-items: center; width: 18px; height: 18px; padding: 0; margin: 0 0 0 6px; border: 0; background: none; color: var(--faint); cursor: help; vertical-align: middle; border-radius: 50%; flex: none; }
.help .i { width: 15px; height: 15px; }
.help:hover, .help:focus-visible { color: var(--fg); outline: none; }
.help:focus-visible { box-shadow: 0 0 0 2px var(--ring); }
h1 .help { width: 20px; height: 20px; margin-left: 8px; vertical-align: 2px; }
h1 .help .i { width: 17px; height: 17px; }
.help-tip { position: fixed; z-index: 80; max-width: min(320px, calc(100vw - 16px)); padding: 9px 12px; border-radius: 6px; background: var(--fg); color: var(--bg); font-size: 12.5px; line-height: 1.65; font-weight: 400; letter-spacing: 0; white-space: pre-line; pointer-events: none; }

/* サイドバーの Health の丸（ok＝緑・warn＝黄・ng＝赤。/api/me の healthLevel）。たたんだときはアイコンの右上に */
.nav__dot { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--green); }
.nav__dot--warn { background: var(--amber); }
.nav__dot--ng { background: var(--red); }
@media (min-width: 901px) {
  .side-rail .nav a { position: relative; }
  .side-rail .side:is(.is-hold, :not(:hover):not(:focus-within)) .nav__dot { position: absolute; top: 7px; right: 14px; width: 7px; height: 7px; box-shadow: 0 0 0 2px var(--side); }
}

/* ================= グローバルヘッダー（本文の上に固定。パンくず「EntryHub / シリーズ ⇅」・Health・自分）と、サイドバーの下寄せ ================= */
.side { overflow-y: auto; }
.side__bottom { margin-top: auto; display: flex; flex-direction: column; }
.side__bottom .side__me { margin-top: 0; }
.gh { position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 var(--gutter); background: var(--bg); border-bottom: 1px solid var(--border); }
.gh__menu { display: none; margin-left: -6px; }
.gh__crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 14px; }
.gh__home { color: var(--muted); font-weight: 500; white-space: nowrap; }
.gh__home:hover { color: var(--fg); }
.gh__sep { color: var(--faint); }
.gh__switch { position: relative; min-width: 0; }
.gh__switch select { max-width: min(360px, 52vw); height: 32px; padding: 0 28px 0 8px; border: 0; border-radius: var(--radius); background: transparent; appearance: none; cursor: pointer; font-weight: 600; color: var(--fg); text-overflow: ellipsis; }
.gh__switch select:hover, .gh__switch select:focus-visible { background: var(--hover); outline: none; }
.gh__switch svg { position: absolute; right: 7px; top: 8px; pointer-events: none; color: var(--muted); }
.gh__space { flex: 1; }
.main { padding-top: 28px; }
@media (max-width: 900px) {
  .gh { padding: 0 12px; }
  .gh__menu { display: grid; }
}

/* グローバルヘッダー：ページの名前（シリーズに関係ないページ）・大会のパンくず・検索（Ctrl+K） */
.gh__page { font-weight: 600; white-space: nowrap; }
.gh__event { display: contents; }
.gh__event .gh__switch select { font-weight: 500; max-width: min(320px, 40vw); }
/* 大会はコードだけ見せ、上に透明の select を重ねる（開くとコード・大会名・日付） */
.gh__switch--code .gh__cur { display: inline-flex; align-items: center; height: 32px; padding: 0 28px 0 8px; border-radius: var(--radius); font: 500 13.5px/1 var(--mono); color: var(--fg); white-space: nowrap; }
.gh__switch--code select { position: absolute; inset: 0; width: 100%; max-width: none; opacity: 0; }
.gh__switch--code:hover .gh__cur, .gh__switch--code:focus-within .gh__cur { background: var(--hover); }
.gh__search { position: relative; }
.gh__box { display: flex; align-items: center; gap: 8px; width: 280px; height: 34px; padding: 0 8px 0 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--muted); cursor: text; }
.gh__box:focus-within { border-color: var(--border-strong); box-shadow: 0 0 0 3px var(--ring); }
.gh__box input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; color: var(--fg); font-size: 13.5px; }
.gh__box input::-webkit-search-cancel-button { display: none; }
.gh__box kbd { font: 500 11px/1 var(--mono); color: var(--faint); border: 1px solid var(--border); border-radius: 4px; padding: 3px 5px; white-space: nowrap; }
.gh__box:focus-within kbd { display: none; }
.gh__results { position: absolute; right: 0; top: calc(100% + 6px); width: min(520px, calc(100vw - 24px)); max-height: min(70vh, 520px); overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 12px 32px var(--shadow); padding: 6px; z-index: 40; }
.gh__hit { display: grid; grid-template-columns: 1fr auto; grid-template-areas: 'main order' 'sub order'; gap: 1px 16px; padding: 8px 10px; border-radius: 6px; }
.gh__hit.is-on { background: var(--hover); }
.gh__hit-main { grid-area: main; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gh__hit-main b { font-weight: 500; }
.gh__hit-main small { color: var(--muted); margin-left: 8px; font-size: 12px; }
.gh__hit-sub { grid-area: sub; font-size: 12px; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gh__hit-order { grid-area: order; align-self: center; text-align: right; font: 12.5px/1.4 var(--mono); color: var(--fg-2); }
.gh__hit-order small { display: block; font-family: var(--sans); font-size: 11.5px; color: var(--faint); }
.gh__none { margin: 0; padding: 12px; color: var(--muted); font-size: 13px; }
.gh__group { padding: 8px 10px 4px; font-size: 11.5px; font-weight: 500; letter-spacing: .04em; color: var(--muted); }
.gh__group + .gh__hit { margin-top: 0; }
.gh__hit + .gh__group { margin-top: 6px; border-top: 1px solid var(--border); padding-top: 10px; }
/* サイドバーのシリーズ名（シリーズのメニューの見出し。押すとそのシリーズの Summary） */
.nav__series { display: block; margin: 6px 12px 0; padding: 8px 10px 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.nav__series:hover { color: var(--fg); }
@media (min-width: 901px) {
  .side-rail .side:is(.is-hold, :not(:hover):not(:focus-within)) .nav__series { visibility: hidden; }
}
@media (max-width: 900px) {
  .gh__box { width: 40px; padding: 0 11px; }
  .gh__box:focus-within { position: fixed; left: 12px; right: 12px; top: 9px; width: auto; z-index: 41; }
  .gh__box kbd { display: none; }
  .gh__crumbs .gh__event { display: none; }
}

/* パンくずの末尾の枠付きの印（大会の状態・メールのモード。説明は data-help の吹き出し）と、見出しの横の小さな印（日付・会場） */
.gh__badges { display: inline-flex; align-items: center; gap: 6px; margin-left: 6px; }
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border: 1px solid var(--border-strong); border-radius: 5px; background: var(--subtle); color: var(--muted); font-size: 12px; font-weight: 500; white-space: nowrap; line-height: 1; }
.badge[data-help] { cursor: help; }
.badge--ok { border-color: var(--green-border); background: var(--green-bg); color: var(--green-text); }
.badge--warn { border-color: var(--amber-border); background: var(--amber-bg); color: var(--amber-text); }
.badge--ng { border-color: var(--red-border); background: var(--red-bg); color: var(--red-text); }
.page-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-title h1 { margin: 0; }
.page-meta { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.page-meta span { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border: 1px solid var(--border); border-radius: 5px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.page-meta .i { width: 13px; height: 13px; }
@media (max-width: 900px) { .gh__badges { display: none; } }

/* Files：ドロップの枠と、Files から選ぶダイアログ（admin.html） */
.drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 22px 16px; margin: 0 0 16px; border: 1px dashed var(--border-strong); border-radius: 8px; color: var(--fg-2); font-size: 13.5px; text-align: center; }
.drop.is-on { background: var(--hover); border-color: var(--fg); }
.drop .muted { font-size: 12px; }
dialog.pick { width: min(520px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--fg); box-shadow: 0 16px 48px var(--shadow); }
dialog.pick::backdrop { background: rgba(0, 0, 0, .35); }
dialog.pick h2 { margin: 0; padding: 14px 16px; font-size: 14px; font-weight: 500; border-bottom: 1px solid var(--border); }
.pick__list { max-height: 50vh; overflow: auto; padding: 6px; }
.pick__ft { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); }

/* Entry List（admin.html）：メモの欄・出走時間 */
.list-group .tbl td { padding-top: 8px; padding-bottom: 8px; }
.input.note { width: 100%; height: 30px; border-color: transparent; background: transparent; }
.input.note:hover { border-color: var(--border); }
.input.note:focus { border-color: var(--border-strong); background: var(--surface); }
.input.note.is-saving { opacity: .6; }
.input.note.is-saved { border-color: var(--green); }
.sg-box > summary { list-style: none; cursor: pointer; }
.sg-box > summary::-webkit-details-marker { display: none; }
.sg { display: flex; align-items: flex-start; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.sg:last-child { border-bottom: 0; }
.sg__cats { display: flex; flex-wrap: wrap; gap: 6px 14px; flex: 1; min-width: 200px; padding-top: 6px; }
.sg__cats .chk { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; white-space: nowrap; }

/* Accounts の権限グループの表（行＝権限・見られるシリーズ、列＝グループ）。列は細く、グループ名は折り返す */
.mx-wrap { border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.mx { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 13px; }
.mx th, .mx td { border-bottom: 1px solid var(--border); }
.mx tbody tr:last-child th, .mx tbody tr:last-child td { border-bottom: 0; }
.mx thead th { position: sticky; top: 52px; z-index: 2; background: var(--surface); vertical-align: bottom; padding: 12px 6px 10px; }
.mx thead th:first-child { border-top-left-radius: 8px; }
.mx thead th:last-child { border-top-right-radius: 8px; }
.mx__l { width: 38%; text-align: left; font-weight: 400; color: var(--fg-2); padding: 8px 14px; }
.mx__g { text-align: center; }
.mx__g button { display: block; width: 100%; padding: 0; border: 0; background: none; font: 500 12.5px/1.35 inherit; color: var(--fg); cursor: pointer; overflow-wrap: anywhere; }
.mx__g button:hover { text-decoration: underline; }
.mx__g span { display: block; margin-top: 3px; font-size: 11px; font-weight: 400; color: var(--muted); }
.mx__c { text-align: center; padding: 6px; }
.mx__c input { width: 16px; height: 16px; margin: 0; accent-color: var(--fg); cursor: pointer; vertical-align: middle; }
.mx__c input:disabled { cursor: default; opacity: .45; }
.mx tbody tr:not(.mx__sec):hover { background: var(--hover); }
.mx__sec th { padding: 14px 14px 6px; text-align: left; font-size: 11.5px; font-weight: 500; color: var(--muted); letter-spacing: .04em; background: var(--subtle); }
/* 子の権限（親が無いと持てない）は字下げして、左に細い線で親とつなぐ（サイドバーのサブメニューと同じ見せ方） */
.mx__child .mx__l { padding-left: 34px; position: relative; font-size: 12.5px; color: var(--muted); }
.mx__child .mx__l::before { content: ''; position: absolute; left: 21px; top: 0; bottom: 0; border-left: 1px solid var(--border-strong); }
/* Entry List の名前（押すとエントリーカード） */
.link-name { text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
tr[data-t]:hover .link-name { text-decoration-color: currentColor; }

/* Operations の Interfaces（外部とのやりとりの仕様。1つずつ開く） */
.iface { border-top: 1px solid var(--border); }
.iface:first-child { border-top: 0; }
.iface > summary { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 16px; cursor: pointer; list-style: none; }
.iface > summary::-webkit-details-marker { display: none; }
.iface > summary::before { content: '›'; color: var(--muted); transition: transform .15s; display: inline-block; width: 10px; }
.iface[open] > summary::before { transform: rotate(90deg); }
.iface > summary:hover { background: var(--hover); }
.iface__name { font-weight: 500; }
.iface__body { padding: 4px 16px 16px 36px; font-size: 13.5px; }

/* Interfaces：どの仕様の表も同じ列幅（項目 30%・例 24%・意味は残り）。どこで・形式・決まりの見出しの幅もそろえる */
.iface__tbl { width: 100%; table-layout: fixed; margin-top: 10px; }
.iface__tbl col.c-name { width: 30%; }
.iface__tbl col.c-ex { width: 24%; }
.iface__tbl td { vertical-align: top; overflow-wrap: anywhere; }
.iface__body .kv { grid-template-columns: 84px 1fr; gap: 6px 16px; }
.iface__body .kv dt { margin: 0; padding-top: 1px; }
.iface__body .kv > div { display: contents; }
/* Flow の図（Mermaid。人と場所・システムの関係図）。人の箱の色は「だれが」 */
:root { --flow-0: #e8f0fe; --flow-1: #fdeee6; --flow-2: #e7f6ec; --flow-3: #f3eafd; --flow-4: #fff6db; --flow-5: #e6f6f8; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --flow-0: #1d2a44; --flow-1: #3a2519; --flow-2: #1b3326; --flow-3: #2c2140; --flow-4: #3a3117; --flow-5: #173236; } }
:root[data-theme="dark"] { --flow-0: #1d2a44; --flow-1: #3a2519; --flow-2: #1b3326; --flow-3: #2c2140; --flow-4: #3a3117; --flow-5: #173236; }
.flow-chart { overflow-x: auto; display: flex; justify-content: safe center; }
.flow-chart svg { max-width: none; height: auto; } /* 縮めない（本来の大きさ。はみ出すときは横にスクロール） */
.flow-chart small { color: var(--muted); font-size: 11px; }

/* Entry List：レースのタブ（1行目＝時刻を太く・レース名、2行目＝区分＋人数の枠）とレースの中の区分ごとのブロック */
.race-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.race-tab { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 132px; padding: 9px 12px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--fg); cursor: pointer; text-align: left; font: inherit; }
.race-tab:hover { border-color: var(--border-strong); }
.race-tab[aria-selected="true"] { border-color: var(--fg); box-shadow: inset 0 0 0 1px var(--fg); }
.race-tab__top { display: flex; align-items: baseline; gap: 8px; line-height: 1.2; }
.race-tab__time { font: 600 17px/1.1 var(--mono); letter-spacing: -.01em; }
.race-tab__name { font-size: 13px; color: var(--fg-2); }
b.race-tab__name { font-size: 14px; font-weight: 600; color: var(--fg); }
.race-tab__bottom { display: flex; align-items: center; gap: 8px; width: 100%; font-size: 12px; color: var(--muted); }
.race-tab__cats { white-space: nowrap; }
.race-tab__n { margin-left: auto; min-width: 26px; padding: 1px 7px; border: 1px solid var(--border); border-radius: 999px; font: 500 11.5px/1.5 var(--mono); color: var(--fg-2); text-align: center; }
.race-tab[aria-selected="true"] .race-tab__n { border-color: var(--fg); color: var(--fg); }
.race__hd { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 12px; }
.race__hd > div { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.race__time { font: 600 22px/1.1 var(--mono); }
.race__name { font-size: 15px; font-weight: 500; }
.race__cats { font-size: 13px; color: var(--muted); }
.race__n { font: 500 15px var(--mono); }
.race__n small { font: 400 12px var(--sans); color: var(--muted); margin-left: 2px; }
.cat-block { margin: 0 0 14px; }
.cat-block .box__hd b { font-weight: 600; font-size: 14px; }
/* 区分ごとの表を同じ列幅に（中身で幅を決めない。幅は th の width だけ。狭い画面は横にスクロール） */
.cat-block { overflow-x: auto; }
.tbl--fixed { table-layout: fixed; min-width: 760px; }
.tbl--fixed td { overflow-wrap: anywhere; }

/* Flow の図の下の手順の表（線の番号と同じ順） */
.flow-steps { width: 100%; table-layout: fixed; border: 0; border-top: 1px solid var(--border); border-radius: 0; }
.flow-steps td { vertical-align: top; overflow-wrap: anywhere; font-size: 14px; line-height: 1.6; padding-top: 10px; padding-bottom: 10px; }
.flow-steps td.num b { font-size: 15px; font-weight: 500; }
