/* =========================================================
   あかり サンプル「みはらし」 共通スタイル
   正本：system/DESIGN.md（色 2章・状態の灯り 3章・系列色 4章・密度 5章・書体 6章・形 7章・部品 9章・LP 10章）
   1. トークン  2. 土台  3. 部品（アプリ画面と LP で共通）  4. サンプル間の案内  5. LP
   app.css / catalog.css はこの上に重ねる。
   ========================================================= */

/* ---------- 1. トークン ---------- */
:root {
  /* 2.1 基本の8色（ダークが正） */
  --bg: #0E1218; --surface: #161C26; --surface-2: #1E2632; --line: #2B3646;
  --text: #E8EDF3; --text-2: #9AA7B8; --text-3: #5F7186; --accent: #4C9AFF;
  --surface-sunken: var(--bg); --surface-overlay: var(--surface-2);
  --on-accent: var(--bg);
  /* 2.3 操作の色 */
  --hover: rgba(232, 237, 243, 0.06); --pressed: rgba(232, 237, 243, 0.10); --selected: rgba(76, 154, 255, 0.14);
  --accent-hover: #62A6FF; --accent-pressed: #4388E0; --focus: var(--accent);
  /* 3.8 状態の灯り */
  --st-ok: #3FB27F; --st-info: #4C9AFF; --st-caution: #D9A62E;
  --st-warning: #E8833A; --st-critical: #E5534B; --st-stopped: #5F7186;
  --on-status: var(--bg);
  --badge-bg: 14%;
  /* 4.1 グラフの系列色（順序固定） */
  --series-1: #4C9AFF; --series-2: #3FB27F; --series-3: #A371F7; --series-4: #39C5CF;
  --series-5: #D9A62E; --series-6: #E8833A; --series-7: #E5534B; --series-8: #DB61A2;
  --series-other: var(--text-2);
  /* 6.1 書体 */
  --font-sans: 'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;
  /* 7.1 角丸・7.3 影 */
  --radius-sm: 4px; --radius-md: 8px; --radius-lg: 12px;
  --shadow-overlay: 0 4px 12px rgba(0, 0, 0, 0.32);
  --shadow-modal: 0 16px 48px rgba(0, 0, 0, 0.48);
  --backdrop: rgba(14, 18, 24, 0.72);
  /* 7.5 余白の段階 */
  --sp-2: 2px; --sp-4: 4px; --sp-8: 8px; --sp-12: 12px; --sp-16: 16px; --sp-20: 20px;
  --sp-24: 24px; --sp-32: 32px; --sp-40: 40px; --sp-48: 48px; --sp-64: 64px; --sp-96: 96px;
  /* motion */
  --t-hover: 120ms ease-out; --t-overlay: 160ms ease-out;
}

/* 5.3 密度の3段階（既定は standard） */
:root, [data-density="standard"] {
  --row-h: 40px; --list-row-h: 48px; --control-h: 36px;
  --pad: 12px; --pad-y: 8px; --card-pad: 20px; --gap: 12px; --section-gap: 24px; --page-pad: 24px;
  --fs-body: 14px; --fs-small: 12px; --lh-body: 1.6;
  --fs-h1: 24px; --fs-h2: 18px; --fs-h3: 15px; --fs-kpi: 32px;
  --icon: 16px; --badge-h: 22px; --badge-fs: 12px; --badge-icon: 12px;
  --badge-gap: 4px; --badge-px: 8px; --chart-stroke: 2px;
}
[data-density="comfortable"] {
  --row-h: 48px; --list-row-h: 56px; --control-h: 40px;
  --pad: 16px; --pad-y: 12px; --card-pad: 24px; --gap: 16px; --section-gap: 32px; --page-pad: 32px;
  --fs-body: 15px; --fs-small: 13px; --lh-body: 1.7;
  --fs-h1: 28px; --fs-h2: 20px; --fs-h3: 16px; --fs-kpi: 36px;
  --icon: 20px; --badge-h: 24px; --badge-fs: 13px; --badge-icon: 14px;
  --badge-gap: 6px; --badge-px: 8px; --chart-stroke: 2px;
}
[data-density="compact"] {
  --row-h: 32px; --list-row-h: 40px; --control-h: 32px;
  --pad: 8px; --pad-y: 4px; --card-pad: 16px; --gap: 8px; --section-gap: 16px; --page-pad: 16px;
  --fs-body: 13px; --fs-small: 12px; --lh-body: 1.5;
  --fs-h1: 20px; --fs-h2: 16px; --fs-h3: 14px; --fs-kpi: 28px;
  --icon: 14px; --badge-h: 20px; --badge-fs: 12px; --badge-icon: 12px;
  --badge-gap: 4px; --badge-px: 6px; --chart-stroke: 1.5px;
}

/* 12.2 ライトテーマ（このサンプルでは使わないが、値の差し替えだけで切り替わることを示すため置く） */
[data-theme="light"] {
  --bg: #F3F5F8; --surface: #FFFFFF; --surface-2: #E9EDF2; --line: #D3DAE3;
  --text: #121821; --text-2: #4A5668; --text-3: #6B7A8D; --accent: #1F6FE0;
  --surface-overlay: var(--surface);
  --accent-hover: #3A80E4; --accent-pressed: #1B62C5; --on-accent: #FFFFFF; --on-status: #FFFFFF;
  --hover: rgba(18, 24, 33, .05); --pressed: rgba(18, 24, 33, .08); --selected: rgba(31, 111, 224, .10);
  --shadow-overlay: 0 4px 12px rgba(18, 24, 33, .12); --shadow-modal: 0 16px 48px rgba(18, 24, 33, .20);
  --backdrop: rgba(18, 24, 33, .40);
  --st-ok: #1E8A5A; --st-info: #1F6FE0; --st-caution: #A67A00; --st-warning: #C75A12; --st-critical: #D1362E; --st-stopped: #6B7A8D;
  --series-1: #1F6FE0; --series-2: #1E8A5A; --series-3: #8250DF; --series-4: #1B8F99;
  --series-5: #A67A00; --series-6: #C75A12; --series-7: #D1362E; --series-8: #BF3989;
  --badge-bg: 10%;
}

/* ---------- 2. 土台 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font-sans); font-weight: 400;
  font-size: var(--fs-body); line-height: var(--lh-body); letter-spacing: .02em;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3, h4 { font-weight: 700; letter-spacing: .01em; color: var(--text); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
img, svg { display: block; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
::selection { background: var(--selected); }

[hidden] { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.icon-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* 6.2 等幅と tabular-nums */
.num, .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.unit { font-family: var(--font-sans); color: var(--text-2); font-size: var(--fs-body); letter-spacing: .02em; }
.muted { color: var(--text-2); }
.dash { color: var(--text-3); }
code {
  font-family: var(--font-mono); font-size: .9em; letter-spacing: 0;
  background: var(--surface-2); padding: 0 4px; border-radius: var(--radius-sm);
}
pre.code {
  margin: 0; padding: var(--pad-y) var(--pad); overflow-x: auto;
  background: var(--surface-sunken); border: 1px solid var(--line); border-radius: var(--radius-md);
  font-family: var(--font-mono); font-size: var(--fs-small); line-height: 1.7; letter-spacing: 0; color: var(--text);
}
pre.code code { background: none; padding: 0; font-size: inherit; }
.ui-icon { width: var(--icon); height: var(--icon); flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- 3. 部品 ---------- */

/* 3.1 状態の灯り（DESIGN.md 3.5・3.8） */
.st--ok       { --st: var(--st-ok); }
.st--info     { --st: var(--st-info); }
.st--caution  { --st: var(--st-caution); }
.st--warning  { --st: var(--st-warning); }
.st--critical { --st: var(--st-critical); }
.st--stopped  { --st: var(--st-stopped); }
.st-icon { width: var(--badge-icon); height: var(--badge-icon); color: var(--st); flex: none; }
.badge {
  display: inline-flex; align-items: center; gap: var(--badge-gap);
  height: var(--badge-h); padding: 0 var(--badge-px); border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--st) var(--badge-bg), transparent);
  border: 1px solid color-mix(in srgb, var(--st) 40%, transparent);
  color: var(--text); font-size: var(--badge-fs); font-weight: 500; line-height: 1; white-space: nowrap;
  letter-spacing: .02em; vertical-align: middle;
}
.st-inline {
  display: inline-flex; align-items: center; gap: 4px; color: var(--text);
  font-size: var(--badge-fs); line-height: 1.4; white-space: nowrap; vertical-align: middle;
}
.st-note { margin-left: 8px; color: var(--text-2); font-size: var(--fs-small); }
/* 3.6 点滅：未確認の異常のアイコンだけ。2秒周期 */
@keyframes akari-blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.st--critical.is-live .st-icon { animation: akari-blink 2s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .st--critical.is-live .st-icon { animation: none; } }

/* 文言型（フォームのエラーなど） */
.field-error {
  display: flex; align-items: flex-start; gap: 6px; margin-top: 6px;
  font-size: var(--fs-small); line-height: 1.5; color: var(--text);
}
.field-error .st-icon { margin-top: calc((1.5em - var(--badge-icon)) / 2); }

/* 3.2 ボタン（9.1） */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: var(--control-h); padding: 0 calc(var(--pad) + 4px);
  border: 1px solid transparent; border-radius: var(--radius-md);
  font-size: var(--fs-body); font-weight: 500; line-height: 1; white-space: nowrap; letter-spacing: .02em;
  cursor: pointer; text-decoration: none !important; user-select: none;
  transition: background-color var(--t-hover), color var(--t-hover), border-color var(--t-hover);
}
.btn .ui-icon { width: var(--icon); height: var(--icon); }
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-hover); }
.btn--primary:active { background: var(--accent-pressed); }
.btn--secondary { background: var(--surface-2); color: var(--text); border-color: var(--line); }
.btn--secondary:hover { background-image: linear-gradient(var(--hover), var(--hover)); }
.btn--secondary:active { background-image: linear-gradient(var(--pressed), var(--pressed)); }
.btn--ghost { background: transparent; color: var(--text-2); padding: 0 var(--pad); }
.btn--ghost:hover { background: var(--hover); color: var(--text); }
.btn--ghost:active { background: var(--pressed); }
.btn--icon { width: var(--control-h); padding: 0; background: transparent; color: var(--text-2); }
.btn--icon:hover { background: var(--hover); color: var(--text); }
.btn--icon:active { background: var(--pressed); }
.btn--sm { height: calc(var(--badge-h) + 6px); padding: 0 var(--pad); font-size: var(--fs-small); border-radius: var(--radius-sm); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .4; cursor: not-allowed; pointer-events: none; }
.btn.is-busy { pointer-events: none; }
.btn-row { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: var(--gap); }

/* 9.13 スピナー・進捗・スケルトン */
@keyframes akari-spin { to { transform: rotate(360deg); } }
.spinner {
  display: inline-block; width: 16px; height: 16px; flex: none; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--accent); border-right-color: var(--accent); border-bottom-color: var(--accent);
  animation: akari-spin .9s linear infinite;
}
.btn .spinner { width: 14px; height: 14px; }
.btn--primary .spinner { border-color: color-mix(in srgb, var(--on-accent) 30%, transparent); border-top-color: var(--on-accent); border-right-color: var(--on-accent); border-bottom-color: var(--on-accent); }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.7s; } }
.progress { height: 4px; border-radius: var(--radius-sm); background: var(--line); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: var(--radius-sm); }
.skeleton { display: block; height: var(--fs-body); border-radius: var(--radius-sm); background: var(--surface-2); }

/* 3.3 入力（9.2） */
.field { display: flex; flex-direction: column; }
.field + .field { margin-top: var(--section-gap); }
.field-label { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: var(--fs-small); font-weight: 500; color: var(--text-2); line-height: 1.5; }
.field-help { margin-top: 6px; font-size: var(--fs-small); color: var(--text-2); line-height: 1.5; }
.tag {
  display: inline-flex; align-items: center; height: 20px; padding: 0 6px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 400; line-height: 1; color: var(--text-2); white-space: nowrap;
}
.tag--count { background: var(--surface-2); border-color: transparent; font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.tag--accent { border-color: var(--accent); color: var(--text); }
.input, .select select, .textarea {
  width: 100%; height: var(--control-h); padding: 0 var(--pad);
  background: var(--surface-sunken); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius-md);
  font-size: var(--fs-body); line-height: 1.4; outline: none;
  transition: border-color var(--t-hover);
}
.textarea { height: auto; min-height: calc(var(--fs-body) * 1.6 * 3 + (var(--pad-y) + 4px) * 2 + 2px); padding: calc(var(--pad-y) + 4px) var(--pad); line-height: 1.6; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:hover, .select select:hover, .textarea:hover { border-color: var(--text-3); }
.input:focus-visible, .select select:focus-visible, .textarea:focus-visible,
.input:focus, .select select:focus, .textarea:focus { border-color: var(--accent); outline: 2px solid var(--focus); outline-offset: 0; }
.input:disabled, .select select:disabled, .textarea:disabled { background: var(--surface); color: var(--text-3); cursor: not-allowed; }
.input:disabled:hover { border-color: var(--line); }
.input.is-invalid, .textarea.is-invalid { border-color: var(--st-critical); }
.input--mono { font-family: var(--font-mono); letter-spacing: 0; }
.select { position: relative; display: block; }
.select select { appearance: none; -webkit-appearance: none; padding-right: calc(var(--pad) + 20px); cursor: pointer; }
.select::after {
  content: ""; position: absolute; right: calc(var(--pad) + 2px); top: 50%; width: 7px; height: 7px; margin-top: -5px;
  border-right: 1.5px solid var(--text-2); border-bottom: 1.5px solid var(--text-2); transform: rotate(45deg); pointer-events: none;
}
.select option { background: var(--surface-2); color: var(--text); }
.readonly-value { font-size: var(--fs-body); color: var(--text); }

/* チェックボックス・ラジオ・スイッチ */
.check, .radio, .switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: var(--fs-body); color: var(--text); }
.check input, .radio input, .switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check__box {
  position: relative; width: 16px; height: 16px; flex: none; border: 1px solid var(--text-3); border-radius: var(--radius-sm); background: var(--surface-sunken);
}
.check input:checked + .check__box { background: var(--accent); border-color: var(--accent); }
.check input:checked + .check__box::after {
  content: ""; position: absolute; left: 4.5px; top: 1.5px; width: 5px; height: 9px;
  border-right: 2px solid var(--on-accent); border-bottom: 2px solid var(--on-accent); transform: rotate(45deg);
}
.radio__dot { position: relative; width: 16px; height: 16px; flex: none; border: 1px solid var(--text-3); border-radius: 50%; background: var(--surface-sunken); }
.radio input:checked + .radio__dot { border-color: var(--accent); }
.radio input:checked + .radio__dot::after { content: ""; position: absolute; left: 3px; top: 3px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.switch__track { position: relative; width: 32px; height: 18px; flex: none; border-radius: var(--radius-sm); background: var(--line); transition: background-color var(--t-hover); }
.switch__track::after { content: ""; position: absolute; left: 2px; top: 2px; width: 14px; height: 14px; border-radius: var(--radius-sm); background: var(--text); transition: transform var(--t-hover); }
.switch input:checked + .switch__track { background: var(--accent); }
.switch input:checked + .switch__track::after { transform: translateX(14px); background: var(--on-accent); }
.check input:focus-visible + .check__box, .radio input:focus-visible + .radio__dot, .switch input:focus-visible + .switch__track { outline: 2px solid var(--focus); outline-offset: 2px; }
.check input:disabled ~ *, .radio input:disabled ~ *, .switch input:disabled ~ * { opacity: .4; cursor: not-allowed; }

/* 3.4 カード（7.2：宵の面＋1px 罫、角丸 12px、影なし） */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--card-pad); min-width: 0; }
.card__head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px var(--gap); margin-bottom: var(--gap); min-height: var(--badge-h); }
.card__title { font-size: var(--fs-h3); font-weight: 500; line-height: 1.5; }
.card__meta { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-size: var(--fs-small); }
.card--flush { padding: 0; }
.card--flush > .card__head { padding: var(--card-pad) var(--card-pad) 0; }
.card__foot { display: flex; align-items: center; justify-content: flex-end; gap: var(--gap); padding: var(--pad-y) var(--pad); border-top: 1px solid var(--line); color: var(--text-2); font-size: var(--fs-small); }

/* 3.5 KPI カード（9.5） */
.kpi { display: flex; flex-direction: column; min-width: 0; }
.kpi__label { display: flex; align-items: center; gap: 8px; min-height: var(--badge-h); font-size: var(--fs-small); font-weight: 500; color: var(--text-2); line-height: 1.5; }
.kpi__label .badge { margin-left: auto; }
.kpi__value { margin-top: 8px; display: flex; align-items: baseline; gap: 4px; }
.kpi__num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 500; font-size: var(--fs-kpi); line-height: 1.1; letter-spacing: 0; color: var(--text); }
.kpi__cmp { margin-top: 8px; font-size: var(--fs-small); color: var(--text-2); line-height: 1.5; }
.kpi__cmp .num { color: var(--text-2); }
.kpi__spark { margin-top: var(--gap); height: 32px; width: 100%; }
.kpi__spark path { fill: none; stroke: var(--series-1); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }

/* 3.6 データ表（9.4） */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-body); line-height: 1.4; }
.table th, .table td { height: var(--row-h); padding: 0 var(--pad); border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; white-space: nowrap; }
.table thead th { position: sticky; top: 0; z-index: 1; background: var(--surface); font-size: var(--fs-small); font-weight: 500; color: var(--text-2); }
.table tbody th { font-weight: 400; }
.table tbody tr:hover { background: var(--hover); }
.table tbody tr.is-selected { background: var(--selected); }
.table tbody tr.is-flash { background: var(--selected); }
.table .num { text-align: right; }
.table td.mono, .table td .mono { color: var(--text); }
.table .col-st { min-width: 80px; }
.table .col-sub { color: var(--text-2); font-size: var(--fs-small); }
.table .truncate { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.table tbody tr:last-child > * { border-bottom: 0; }
.th-sort { display: inline-flex; align-items: center; gap: 4px; padding: 0; background: none; border: 0; color: inherit; font: inherit; cursor: pointer; }
.th-sort svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.table th[aria-sort="ascending"], .table th[aria-sort="descending"] { color: var(--text); }
.table th[aria-sort="ascending"] .sort-down, .table th[aria-sort="descending"] .sort-up { opacity: .35; }
.table th.num .th-sort { flex-direction: row-reverse; }

/* 3.7 タブ・セグメント（9.8） */
.tabs { display: flex; gap: calc(var(--pad) * 2); border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab {
  position: relative; display: inline-flex; align-items: center; gap: 4px; height: var(--control-h); padding: 0;
  background: none; border: 0; color: var(--text-2); font-size: var(--fs-body); font-weight: 500; cursor: pointer; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); }
.tab[aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent); }
.tab:disabled { color: var(--text-3); cursor: not-allowed; }
.tab .tag--count { height: 18px; }
.segment {
  display: inline-flex; gap: 2px; padding: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-md);
}
.segment button {
  height: calc(var(--control-h) - 6px); padding: 0 var(--pad); border: 1px solid transparent; border-radius: var(--radius-sm);
  background: none; color: var(--text-2); font-size: var(--fs-small); font-weight: 500; cursor: pointer; white-space: nowrap;
}
.segment button:hover { color: var(--text); }
.segment button[aria-pressed="true"], .segment button[aria-checked="true"] { background: var(--surface); border-color: var(--line); color: var(--text); }

/* 絞り込みのチップ（9.3：副ボタンの小型の中にインライン型） */
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: calc(var(--badge-h) + 6px); padding: 0 var(--pad);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--text);
  font-size: var(--badge-fs); cursor: pointer;
}
.chip:hover { background-image: linear-gradient(var(--hover), var(--hover)); }
.chip[aria-pressed="true"] { border-color: var(--accent); background-image: linear-gradient(var(--selected), var(--selected)); }
.chip .num { color: var(--text-2); }

/* 3.8 グラフ（9.6） */
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-bottom: var(--gap); font-size: var(--fs-small); color: var(--text-2); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.legend__line { width: 12px; height: 2px; background: var(--c); }
.legend__sq { width: 10px; height: 10px; background: var(--c); }
.chart { position: relative; }
.chart > svg { width: 100%; overflow: visible; }
.chart .grid line { stroke: var(--line); stroke-width: 1; shape-rendering: crispEdges; }
.chart .base { stroke: var(--text-3); stroke-width: 1; shape-rendering: crispEdges; }
.chart .tick { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: var(--fs-small); fill: var(--text-2); }
.chart .axis-title { font-family: var(--font-sans); font-size: var(--fs-small); fill: var(--text-2); }
.chart .series { fill: none; stroke-width: var(--chart-stroke); stroke-linejoin: round; stroke-linecap: round; }
.chart .threshold { stroke-width: 1; stroke-dasharray: 4 4; shape-rendering: crispEdges; }
.chart .hover-line { stroke: var(--text-3); stroke-width: 1; shape-rendering: crispEdges; }
.chart .bar-label { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: var(--fs-small); fill: var(--text); }
.chart-th { position: absolute; right: 0; display: inline-flex; align-items: center; gap: 4px; padding: 0 0 2px 8px; background: var(--surface); font-size: var(--fs-small); color: var(--text); white-space: nowrap; transform: translateY(-100%); }
.chart-th .num { color: var(--text); }

/* 状態の帯（9.6.1）：棒 幅 4〜8px（ここでは 6px）、間 2px、高さ 24px、角丸なし。
   帯全体を1つのフォーカス先にし、左右キーで日を選ぶ（script.js） */
.band { position: relative; display: flex; gap: 2px; height: 24px; width: max-content; max-width: 100%; }
.band > span { flex: 0 0 var(--band-w, 6px); height: 24px; background: var(--st); }
.band > span.is-on { outline: 1px solid var(--text); outline-offset: 1px; }
.band:focus-visible { outline-offset: 4px; }
.band-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; }

/* ツールチップ（9.11） */
.tooltip {
  position: absolute; z-index: 30; max-width: 280px; padding: 6px 8px;
  background: var(--surface-overlay); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-overlay);
  font-size: var(--fs-small); line-height: 1.5; color: var(--text); pointer-events: none; white-space: nowrap;
}
.tooltip[hidden] { display: none; }
.tooltip .num { color: var(--text); }
.tt-row { display: flex; align-items: center; gap: 8px; }
.tt-row .num { margin-left: auto; padding-left: 16px; }
.tt-time { color: var(--text-2); margin-bottom: 2px; }

/* 3.9 アラート履歴（9.7） */
.alerts { margin: 0; }
.alert-day { padding: var(--pad-y) var(--pad); font-size: var(--fs-small); color: var(--text-2); border-bottom: 1px solid var(--line); }
.alert {
  position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr) auto auto; align-items: center; column-gap: var(--gap);
  min-height: var(--list-row-h); padding: var(--pad-y) var(--pad); border-bottom: 1px solid var(--line);
}
.alert:hover { background: var(--hover); }
.alert.is-unread::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--accent); }
.alert__main { min-width: 0; }
.alert__title { font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alert.is-unread .alert__title { font-weight: 700; }
.alert__target { display: block; font-family: var(--font-mono); font-size: var(--fs-small); color: var(--text-2); letter-spacing: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alert__dur, .alert__time { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: var(--fs-small); color: var(--text-2); letter-spacing: 0; white-space: nowrap; }
.alert__dur { display: inline-flex; align-items: center; gap: 8px; }
.alert__dur .st-inline { font-family: var(--font-sans); letter-spacing: .02em; }
.alert__dur .st-inline .num { color: var(--text-2); }
.alert__time { text-align: right; min-width: 6.5em; }
.alerts > :last-child { border-bottom: 0; }

/* 通知バナー（9.7） */
.banner {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px var(--gap);
  padding: calc(var(--pad-y) + 4px) var(--pad); background: var(--surface);
  border: 1px solid var(--line); border-left: 2px solid var(--st); border-radius: var(--radius-md);
}
.banner__text { flex: 1 1 280px; min-width: 0; }
.banner__actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

/* 3.10 オーバーレイ：ドロップダウン・モーダル・トースト（9.9〜9.11） */
.dropdown {
  position: absolute; z-index: 40; min-width: 100%; max-width: 320px; max-height: 320px; overflow-y: auto; padding: 4px;
  background: var(--surface-overlay); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-overlay);
}
.menu-item {
  display: flex; align-items: center; gap: 8px; width: 100%; height: var(--control-h); padding: 0 var(--pad);
  border: 0; border-radius: var(--radius-sm); background: none; color: var(--text); font-size: var(--fs-body); text-align: left; cursor: pointer; white-space: nowrap;
}
.menu-item:hover, .menu-item:focus-visible { background: var(--hover); outline: none; }
.menu-item .check-mark { margin-left: auto; width: 16px; height: 16px; color: var(--accent); }
.menu-sep { height: 1px; margin: 4px 0; background: var(--line); }

.backdrop {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: var(--backdrop); opacity: 0; transition: opacity var(--t-overlay);
}
.backdrop.is-open { opacity: 1; }
.backdrop[hidden] { display: none; }
.modal {
  display: flex; flex-direction: column; width: 100%; max-width: 640px; max-height: calc(100vh - 48px);
  background: var(--surface-overlay); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-modal);
  transform: translateY(8px); transition: transform var(--t-overlay);
}
.backdrop.is-open .modal { transform: none; }
.modal--sm { max-width: 480px; }
.modal--lg { max-width: 800px; }
.modal__head { display: flex; align-items: center; gap: var(--gap); padding: calc(var(--card-pad) - 4px) var(--card-pad); }
.modal__title { font-size: var(--fs-h2); font-weight: 700; line-height: 1.5; }
.modal__head .btn--icon { margin-left: auto; margin-right: calc(var(--pad) * -.5); }
.modal__body { padding: 0 var(--card-pad) var(--card-pad); overflow-y: auto; }
.modal__foot { display: flex; justify-content: flex-end; gap: var(--gap); padding: var(--pad-y) var(--card-pad); padding-top: calc(var(--pad-y) + 4px); padding-bottom: calc(var(--pad-y) + 4px); border-top: 1px solid var(--line); }
@media (prefers-reduced-motion: reduce) { .backdrop, .modal { transition: none; } }

.toasts { position: fixed; right: 24px; bottom: 24px; z-index: 70; display: flex; flex-direction: column; gap: 8px; width: 360px; max-width: calc(100vw - 48px); }
.toast {
  display: flex; align-items: flex-start; gap: var(--gap); padding: calc(var(--pad-y) + 4px) var(--pad);
  background: var(--surface-overlay); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-overlay);
  font-size: var(--fs-body); line-height: 1.5;
}
.toast .st-inline { flex: none; padding-top: 1px; }
.toast__text { flex: 1; min-width: 0; }
.toast .btn--icon { width: 24px; height: 24px; margin: -2px -4px 0 0; border-radius: var(--radius-sm); }
.toast .btn--icon .ui-icon { width: 14px; height: 14px; }

/* 空状態（9.12） */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: calc(var(--section-gap) * 2) var(--card-pad); }
.empty__icon { width: 32px; height: 32px; color: var(--text-3); fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.empty__title { margin-top: var(--gap); font-size: var(--fs-h3); font-weight: 500; }
.empty__text { margin-top: 4px; max-width: 28em; font-size: var(--fs-small); color: var(--text-2); }
.empty .btn { margin-top: var(--section-gap); }

/* アバター */
.avatar {
  display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; flex: none;
  border-radius: var(--radius-md); background: var(--surface-2); border: 1px solid var(--line);
  font-size: 12px; font-weight: 500; color: var(--text); letter-spacing: 0;
}

/* ---------- 4. サンプル間の案内（全ページ共通） ---------- */
.sample-nav { border-bottom: 1px solid var(--line); background: var(--bg); }
.sample-nav__inner { display: flex; align-items: center; gap: 24px; height: 36px; max-width: 1264px; margin: 0 auto; padding: 0 32px; overflow-x: auto; }
.sample-nav__label { flex: none; font-family: var(--font-mono); font-size: 12px; color: var(--text-2); letter-spacing: .04em; }
.sample-nav ul { display: flex; gap: 20px; height: 100%; }
.sample-nav li { display: flex; }
.sample-nav a { position: relative; display: inline-flex; align-items: center; font-size: 13px; color: var(--text-2); white-space: nowrap; text-decoration: none; }
.sample-nav a:hover { color: var(--text); }
.sample-nav a[aria-current="page"] { color: var(--text); }
.sample-nav a[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--accent); }

/* ---------- 5. 紹介サイト（LP。10章・6.4 の固定の文字の階梯） ---------- */
.lp { font-size: 16px; line-height: 1.8; letter-spacing: .02em; }
.container { max-width: 1264px; margin: 0 auto; padding: 0 32px; }
.eyebrow { font-family: var(--font-mono); font-size: 13px; font-weight: 500; line-height: 1.4; letter-spacing: .08em; color: var(--text-2); }
.display { font-size: 48px; line-height: 1.3; letter-spacing: .01em; }
.lp h2 { font-size: 32px; line-height: 1.4; }
.lp h3 { font-size: 20px; line-height: 1.5; }
.lead { font-size: 18px; line-height: 1.8; color: var(--text-2); max-width: 40em; }
.small { font-size: 14px; line-height: 1.7; }
.note { font-size: 14px; line-height: 1.7; color: var(--text-2); }

.lp-header { position: sticky; top: 0; z-index: 50; height: 64px; background: var(--bg); border-bottom: 1px solid var(--line); }
.lp-header__inner { display: flex; align-items: center; gap: 32px; height: 100%; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 18px; letter-spacing: .04em; text-decoration: none !important; }
.logo__mark { width: 24px; height: 24px; }
.lp-nav { display: flex; gap: 28px; margin-left: auto; }
.lp-nav a { color: var(--text-2); font-size: 14px; font-weight: 500; }
.lp-nav a:hover { color: var(--text); text-decoration: none; }
.lp-header .btn { height: 40px; }
.nav-toggle { display: none; }

.lp-sec { padding: 96px 0; border-top: 1px solid var(--line); }
.sec-head { display: flex; flex-direction: column; gap: 12px; margin-bottom: 48px; max-width: 46em; }
.sec-head--center { margin-left: auto; margin-right: auto; align-items: center; text-align: center; }
.grid-12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; }

/* 背景の格子（8.5：ヒーローと CTA だけ。罫の色 40% 以下、マスクで端に向かって消す） */
.bg-grid { position: relative; isolation: isolate; }
.bg-grid::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .4;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 24px 24px; background-position: -1px -1px;
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 60% 40%, #000 30%, transparent 80%);
          mask-image: radial-gradient(ellipse 70% 70% at 60% 40%, #000 30%, transparent 80%);
}
.bg-dots { position: relative; isolation: isolate; overflow: hidden; }
.bg-dots::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .4;
  background-image: radial-gradient(circle, var(--line) 1px, transparent 1.2px); background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 50% 50%, #000 20%, transparent 75%);
          mask-image: radial-gradient(ellipse 60% 70% at 50% 50%, #000 20%, transparent 75%);
}

.hero { padding: 96px 0; }
.hero__grid { align-items: center; }
.hero__copy { grid-column: span 5; display: flex; flex-direction: column; gap: 24px; }
.hero__copy .eyebrow { margin-bottom: -12px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 8px; }
.hero__actions .btn { height: 44px; padding: 0 24px; font-size: 16px; }
.hero__visual { grid-column: span 7; }

/* 画面フレーム（10.2） */
.frame { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.frame__bar {
  display: flex; align-items: center; gap: 12px; height: 32px; padding: 0 16px;
  background: var(--surface-2); border-bottom: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 12px; color: var(--text-2); letter-spacing: 0;
}
.frame__body { padding: var(--card-pad); font-size: var(--fs-body); line-height: var(--lh-body); }
.frame__body .card { background: var(--bg); }
.fr-top { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-bottom: var(--gap); }
.fr-top h3 { font-size: var(--fs-h2); }
.fr-top .muted { font-size: var(--fs-small); }
.fr-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.fr-kpis .card { padding: var(--pad); }
.fr-kpis .kpi__num { font-size: 26px; }

.problems { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.problem { display: flex; flex-direction: column; gap: 12px; padding: 32px; }
.problem .ui-icon { --icon: 24px; color: var(--text-2); }
.problem p { color: var(--text-2); }

.feature { align-items: center; }
.feature + .feature { margin-top: 96px; }
.feature__text { grid-column: span 5; display: flex; flex-direction: column; gap: 16px; }
.feature__visual { grid-column: span 7; }
.feature--rev .feature__text { grid-column: 8 / span 5; grid-row: 1; }
.feature--rev .feature__visual { grid-column: 1 / span 7; grid-row: 1; }
.feature__text ul { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.feature__text li { position: relative; padding-left: 20px; color: var(--text-2); }
.feature__text li::before { content: ""; position: absolute; left: 2px; top: .8em; width: 8px; height: 1px; background: var(--text-2); }

.states { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.state { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 24px; }
.state p { color: var(--text-2); font-size: 14px; line-height: 1.7; }
.state__ex { font-family: var(--font-mono); font-size: 12px; color: var(--text-2); letter-spacing: 0; }
.states-note { margin-top: 24px; }

.numbers { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.numbers .card { padding: 24px; }
.numbers .kpi__num { font-size: 36px; }
.numbers .kpi__cmp { color: var(--text-2); }

.plans { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; }
.plan { display: flex; flex-direction: column; gap: 16px; padding: 32px; }
.plan--rec { border-color: var(--accent); }
.plan__head { display: flex; align-items: center; gap: 12px; }
.plan__price { display: flex; align-items: baseline; gap: 6px; }
.plan__price .kpi__num { font-size: 36px; }
.plan p { color: var(--text-2); font-size: 14px; }
.plan .btn { margin-top: auto; }
.plan-table { margin-top: 24px; }
.plan-table .table { font-size: 15px; }
.plan-table .table th, .plan-table .table td { height: 48px; padding: 0 16px; }
.plan-table .table thead th { font-size: 13px; }

.faq { max-width: 880px; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex; align-items: center; gap: 16px; min-height: 64px; padding: 16px 4px; cursor: pointer; list-style: none;
  font-size: 17px; font-weight: 500; color: var(--text);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; margin-left: auto; width: 8px; height: 8px; flex: none; margin-right: 6px;
  border-right: 1.5px solid var(--text-2); border-bottom: 1.5px solid var(--text-2); transform: rotate(45deg); transition: transform var(--t-hover);
}
.faq details[open] summary::after { transform: rotate(-135deg); }
.faq summary:hover { color: var(--text); background: var(--hover); }
.faq .faq__a { padding: 0 4px 24px; color: var(--text-2); max-width: 40em; }

.cta { padding: 96px 0; }
.cta__box { padding: 80px 32px; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.cta__box h2 { font-size: 32px; }
.cta__box .lead { margin: 16px auto 0; }
.cta__box .btn { margin-top: 32px; height: 44px; padding: 0 24px; font-size: 16px; }

.lp-footer { border-top: 1px solid var(--line); padding: 48px 0 64px; font-size: 14px; color: var(--text-2); }
.lp-footer__grid { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 32px; }
.lp-footer h4 { font-size: 14px; font-weight: 500; color: var(--text); margin-bottom: 12px; }
.lp-footer li + li { margin-top: 6px; }
.lp-footer a { color: var(--text-2); }
.lp-footer a:hover { color: var(--text); }
.lp-footer__note { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 13px; }

.fade { opacity: 0; transition: opacity .4s ease-out; }
.fade.is-in, html:not(.js) .fade { opacity: 1; }

@media (max-width: 1023px) {
  .hero__copy, .hero__visual, .feature__text, .feature__visual,
  .feature--rev .feature__text, .feature--rev .feature__visual { grid-column: 1 / -1; grid-row: auto; }
  .problems, .states, .plans { grid-template-columns: 1fr; }
  .numbers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lp-footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 767px) {
  .container { padding: 0 20px; }
  .sample-nav__inner { padding: 0 20px; }
  .display { font-size: 32px; }
  .lp h2, .cta__box h2 { font-size: 24px; }
  .lp h3 { font-size: 18px; }
  .lead { font-size: 16px; }
  .lp-sec, .hero, .cta { padding: 64px 0; }
  .feature + .feature { margin-top: 64px; }
  .lp-nav {
    position: absolute; left: 0; right: 0; top: 64px; display: none; flex-direction: column; gap: 0; padding: 8px 20px 16px;
    background: var(--bg); border-bottom: 1px solid var(--line);
  }
  .lp-nav.is-open { display: flex; }
  .lp-nav a { display: flex; align-items: center; height: 44px; font-size: 16px; }
  .lp-header__inner { gap: 12px; }
  .lp-header__cta { margin-left: auto; height: 36px !important; padding: 0 12px; font-size: 14px; }
  .nav-toggle { display: inline-flex; }
  .fr-kpis { grid-template-columns: 1fr 1fr; }
  .fr-kpis .card:nth-child(3) { display: none; }
  .numbers { grid-template-columns: 1fr; }
  .lp-footer__grid { grid-template-columns: 1fr; }
  .cta__box { padding: 48px 20px; }
  .problem, .plan { padding: 24px; }
}
