/* areadrive-ui v0.1.2 (7693baa) から写したもの。ここでは直さない。直すときは ~/areadrive-ui で直して bin/sync.sh で配り直す。 */
/*!
 * areadrive-ui v0.1.2 — エリアドライブ 自社プロダクトの共通UI
 * 見た目の手本: eureka 管理画面（白地・細い灰色の罫・ほぼ黒の主ボタン・角丸8px/12px・Noto Sans JP）
 *
 * このファイルは各プロダクトへ「写して」使う。写した先では直さない（直すときは areadrive-ui リポジトリで直し、bin/sync.sh で配り直す）。
 * 使い方:
 *   1. <body class="ad-app"> にする（素の要素に土台の見た目が付く。指定の強さは0なので、プロダクト側のCSSがいつでも勝つ）
 *   2. 部品は ad- で始まるクラスで組む（README.md の「部品」）
 *   3. プロダクトの色はロゴだけ。--ad-brand にロゴの色を入れる
 */

/* ───────── 変数 ───────── */
:root {
  /* 地と面 */
  --ad-bg: #ffffff;
  --ad-bg-subtle: #fafafa;      /* 左のメニュー、薄い面 */
  --ad-bg-muted: #f4f4f5;       /* 押せるものに乗ったとき、選んでいるもの */
  --ad-surface: #ffffff;
  /* 文字 */
  --ad-ink: #09090b;
  --ad-ink-2: #3f3f46;
  --ad-muted: #71717a;          /* 白地で4.8:1 */
  /* 罫 */
  --ad-rule: #e4e4e7;
  --ad-rule-strong: #d4d4d8;
  --ad-input-line: #a1a1aa;     /* 入力欄の枠。罫より一段濃くして、入れる場所だと分かるようにする */
  /* 主ボタン */
  --ad-primary: #18181b;
  --ad-primary-hover: #27272a;
  --ad-on-primary: #fafafa;
  --ad-ring: #18181b;
  /* 状態の色（画面の中で色が付くのは、ここだけ） */
  --ad-ok: #1c7d4d;     --ad-ok-soft: #eef7f1;     --ad-ok-line: #bfdfcb;
  --ad-info: #2f5fb3;   --ad-info-soft: #eff4fb;   --ad-info-line: #c6d6ef;
  --ad-attn: #a63a17;   --ad-attn-soft: #fbf1ec;   --ad-attn-line: #efcdbf;   /* 確認が必要（弁柄） */
  --ad-danger: #b3261e; --ad-danger-soft: #fdf0ef; --ad-danger-line: #f1c5c2;
  --ad-stop: #a1a1aa;   /* 止まっている・下書き（点だけに使う） */
  /* ロゴ */
  --ad-brand: #09090b;          /* プロダクトごとに差し替える */
  --ad-company: #b11920;        /* エリアドライブの赤。ロゴの「AREA DRIVE」だけに使う */
  /* 文字 */
  --ad-font: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic UI", "Yu Gothic Medium", Meiryo, sans-serif;
  --ad-font-code: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ad-text: 14px;
  --ad-text-sm: 12.5px;
  --ad-h1: 22px;
  --ad-h2: 16px;
  --ad-h3: 14px;
  /* 大きさ（全プロダクト同じ「標準」） */
  --ad-control-h: 36px;
  --ad-control-h-sm: 30px;
  --ad-control-h-lg: 40px;
  --ad-radius-s: 8px;           /* 部品 */
  --ad-radius-l: 12px;          /* 表や枠 */
  --ad-shadow-xs: 0 1px 2px rgb(0 0 0 / 0.05);
  --ad-shadow-pop: 0 10px 32px rgb(0 0 0 / 0.14);
  --ad-side-w: 15rem;
  --ad-page-pad: 28px;
}
@media (max-width: 640px) { :root { --ad-page-pad: 16px; } }

/* ───────── 土台（素の要素。指定の強さ0） ───────── */
:where(.ad-app), :where(.ad-app) *, :where(.ad-app) ::before, :where(.ad-app) ::after { box-sizing: border-box; }
:where(body.ad-app) { margin: 0; }
:where(.ad-app) {
  background: var(--ad-bg); color: var(--ad-ink);
  font-family: var(--ad-font); font-size: var(--ad-text); line-height: 1.75;
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
}
:where(.ad-app) :where(a) { color: var(--ad-ink); text-decoration-color: #a1a1aa; text-underline-offset: 0.22em; }
:where(.ad-app) :where(a:hover) { text-decoration-color: var(--ad-ink); }
:where(.ad-app) :where(h1, h2, h3, h4) { margin: 0; font-weight: 700; line-height: 1.4; }
:where(.ad-app) :where(h1) { font-size: var(--ad-h1); letter-spacing: 0.02em; }
:where(.ad-app) :where(h2) { font-size: var(--ad-h2); }
:where(.ad-app) :where(h3) { font-size: var(--ad-h3); }
:where(.ad-app) :where(p) { margin: 0 0 0.6em; }
:where(.ad-app) :where(button, input, select, textarea) { font: inherit; color: inherit; }
:where(.ad-app) :where(:focus-visible) { outline: 2px solid var(--ad-ring); outline-offset: 2px; }
:where(.ad-app) :where(input[type="checkbox"], input[type="radio"]) { accent-color: var(--ad-primary); width: 16px; height: 16px; }
:where(.ad-app) :where(mark) { background: #fde68a; color: inherit; padding: 0 1px; }
/* クラスの付いていない素のボタン・入力欄・表（古い画面に読み込むだけで、ある程度そろう） */
:where(.ad-app) :where(button:not([class]), input[type="submit"]:not([class]), input[type="button"]:not([class])) {
  min-height: var(--ad-control-h); padding: 0 14px; border: 1px solid var(--ad-rule); border-radius: var(--ad-radius-s);
  background: var(--ad-surface); box-shadow: var(--ad-shadow-xs); font-size: var(--ad-text); font-weight: 500; cursor: pointer;
}
:where(.ad-app) :where(input:not([type]):not([class]), input[type="text"]:not([class]), input[type="email"]:not([class]), input[type="password"]:not([class]),
  input[type="number"]:not([class]), input[type="search"]:not([class]), input[type="tel"]:not([class]), input[type="url"]:not([class]),
  input[type="date"]:not([class]), select:not([class]), textarea:not([class])) {
  min-height: var(--ad-control-h); padding: 0 0.75em; border: 1px solid var(--ad-input-line); border-radius: var(--ad-radius-s);
  background: var(--ad-surface); box-shadow: var(--ad-shadow-xs);
}
:where(.ad-app) :where(table:not([class])) { border-collapse: collapse; font-variant-numeric: tabular-nums; }
:where(.ad-app) :where(table:not([class]) th) { text-align: left; font-size: var(--ad-text-sm); font-weight: 500; color: var(--ad-muted); padding: 8px 12px; border-bottom: 1px solid var(--ad-rule); }
:where(.ad-app) :where(table:not([class]) td) { padding: 9px 12px; border-bottom: 1px solid var(--ad-rule); }

/* ───────── 外枠: 左のメニュー＋上の作業バー ───────── */
.ad-shell { display: grid; grid-template-columns: var(--ad-side-w) minmax(0, 1fr); min-height: 100vh; }
.ad-side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column;
  padding: 16px 10px; background: var(--ad-bg-subtle); border-right: 1px solid var(--ad-rule);
}
.ad-brand { display: grid; gap: 1px; padding: 4px 10px 14px; border-bottom: 1px solid var(--ad-rule); color: inherit; text-decoration: none; }
.ad-brand-co { font-size: 10.5px; font-weight: 700; letter-spacing: 0.22em; color: var(--ad-company); }
.ad-brand-name { font-size: 18px; font-weight: 700; letter-spacing: 0.06em; line-height: 1.4; color: var(--ad-brand); }
.ad-brand-sub { font-size: 11.5px; letter-spacing: 0.04em; color: var(--ad-muted); }
.ad-nav { display: grid; align-content: start; gap: 1px; margin-top: 12px; }   /* 高さのある所に置いても、項目が伸びない */
.ad-nav-group { margin: 14px 10px 4px; font-size: 11.5px; letter-spacing: 0.06em; color: var(--ad-muted); }
.ad-nav-group:first-child { margin-top: 0; }
.ad-nav-item {
  display: flex; align-items: center; gap: 0.6em; min-height: 34px; padding: 5px 10px; border-radius: var(--ad-radius-s);
  color: var(--ad-ink-2); font-size: var(--ad-text); text-decoration: none; letter-spacing: 0.02em;
}
.ad-nav-item .ad-icon { color: var(--ad-muted); }
.ad-nav-item:hover { background: var(--ad-bg-muted); color: var(--ad-ink); }
.ad-nav-item.is-current, .ad-nav-item[aria-current="page"] { background: var(--ad-bg-muted); color: var(--ad-ink); font-weight: 500; }
.ad-nav-item.is-current .ad-icon, .ad-nav-item[aria-current="page"] .ad-icon { color: var(--ad-ink); }
.ad-side-foot { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid var(--ad-rule); display: grid; gap: 4px; font-size: var(--ad-text-sm); color: var(--ad-muted); line-height: 1.6; }
.ad-side-foot strong { color: var(--ad-ink-2); font-weight: 500; }
.ad-workspace { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.ad-bar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; min-height: 56px;
  padding: 6px var(--ad-page-pad); border-bottom: 1px solid var(--ad-rule); background: rgb(255 255 255 / 0.92);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.ad-crumb { display: grid; min-width: 0; line-height: 1.35; }
.ad-crumb small { font-size: 11px; letter-spacing: 0.06em; color: var(--ad-muted); }
.ad-crumb strong { font-size: var(--ad-text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-bar-end { margin-left: auto; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 4px 14px; font-size: 13px; color: var(--ad-muted); }
.ad-workspace-foot { display: none; }
@media (max-width: 860px) {
  .ad-shell { grid-template-columns: minmax(0, 1fr); }
  .ad-side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 8px var(--ad-page-pad); border-right: 0; border-bottom: 1px solid var(--ad-rule); }
  .ad-brand { border-bottom: 0; padding: 0; }
  .ad-brand-sub { display: none; }
  .ad-nav { display: flex; flex-wrap: nowrap; overflow-x: auto; margin: 0; gap: 2px; max-width: 100%; }
  .ad-nav-group, .ad-side-foot { display: none; }
  .ad-nav-item { white-space: nowrap; }
  .ad-bar { position: static; }
  .ad-workspace-foot { display: block; padding: 16px var(--ad-page-pad) 24px; border-top: 1px solid var(--ad-rule); font-size: var(--ad-text-sm); color: var(--ad-muted); }
}

/* ───────── 画面の中身 ───────── */
.ad-page { width: 100%; max-width: 96rem; padding: 28px var(--ad-page-pad) 64px; }
.ad-page-narrow { max-width: calc(64rem + 2 * var(--ad-page-pad)); }
.ad-back { display: inline-flex; align-items: center; gap: 4px; margin: 0 0 6px; font-size: var(--ad-text-sm); color: var(--ad-muted); text-decoration: none; }
.ad-back:hover { color: var(--ad-ink); text-decoration: underline; }
.ad-page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 20px; margin: 0 0 20px; }
.ad-page-head h1 { font-size: var(--ad-h1); line-height: 1.4; letter-spacing: 0.02em; margin: 0; }
.ad-page-sub { margin: 2px 0 0; font-size: 13px; color: var(--ad-muted); }
.ad-page-actions { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.ad-section-title { margin: 28px 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--ad-rule); font-size: var(--ad-h2); }
.ad-lead { color: var(--ad-muted); margin: 0 0 14px; }
.ad-empty { padding: 28px 0; color: var(--ad-muted); }

/* ───────── ボタン ───────── */
.ad-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; min-height: var(--ad-control-h); padding: 0 14px;
  border: 1px solid var(--ad-rule); border-radius: var(--ad-radius-s); background: var(--ad-surface); color: var(--ad-ink);
  box-shadow: var(--ad-shadow-xs); font: inherit; font-size: var(--ad-text); font-weight: 500; line-height: 1.3;
  text-decoration: none; white-space: nowrap; cursor: pointer; transition: background-color 0.12s ease, border-color 0.12s ease;
}
.ad-btn:hover { background: var(--ad-bg-muted); color: var(--ad-ink); }
.ad-btn:disabled, .ad-btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.ad-btn-primary { background: var(--ad-primary); color: var(--ad-on-primary); border-color: transparent; }
.ad-btn-primary:hover { background: var(--ad-primary-hover); color: var(--ad-on-primary); }
.ad-btn-primary:disabled:hover { background: var(--ad-primary); }
.ad-btn-danger { color: var(--ad-danger); border-color: var(--ad-danger-line); }
.ad-btn-danger:hover { background: var(--ad-danger-soft); color: var(--ad-danger); }
.ad-btn-sm { min-height: var(--ad-control-h-sm); padding: 0 10px; font-size: 13px; }
.ad-btn-lg { min-height: var(--ad-control-h-lg); padding: 0 18px; }
.ad-btn .ad-icon { width: 15px; height: 15px; }
/* 文中の操作（文字だけ） */
.ad-btn-link {
  display: inline; min-height: 0; padding: 0; border: 0; background: none; box-shadow: none; color: var(--ad-ink);
  font: inherit; text-decoration: underline; text-decoration-color: #a1a1aa; text-underline-offset: 0.22em; cursor: pointer;
}
.ad-btn-link:hover { text-decoration-color: var(--ad-ink); }
.ad-btn-link:disabled { color: var(--ad-muted); text-decoration: none; cursor: default; }
.ad-btn-link-danger { color: var(--ad-danger); text-decoration-color: var(--ad-danger-line); }
.ad-btn-link-danger:hover { text-decoration-color: var(--ad-danger); }

/* ───────── 入力 ───────── */
.ad-field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.ad-field > label, .ad-label { font-size: 13px; font-weight: 500; }
.ad-hint { font-size: var(--ad-text-sm); color: var(--ad-muted); }
.ad-input, .ad-select, .ad-textarea {
  font: inherit; font-size: var(--ad-text); color: var(--ad-ink); background: var(--ad-surface);
  border: 1px solid var(--ad-input-line); border-radius: var(--ad-radius-s); box-shadow: var(--ad-shadow-xs);
}
.ad-input { min-height: var(--ad-control-h); padding: 0 0.75em; max-width: 100%; }
.ad-select { min-height: var(--ad-control-h); padding: 0 0.5em; max-width: 100%; }
.ad-select-sm { min-height: var(--ad-control-h-sm); font-size: 13px; }
.ad-textarea { display: block; width: 100%; min-height: 88px; padding: 0.5em 0.75em; line-height: 1.7; resize: vertical; }
.ad-input:focus-visible, .ad-select:focus-visible, .ad-textarea:focus-visible { outline: none; border-color: var(--ad-ink-2); box-shadow: 0 0 0 3px rgb(161 161 170 / 0.45); }
.ad-input:disabled, .ad-select:disabled, .ad-textarea:disabled { background: var(--ad-bg-muted); color: var(--ad-muted); }
.ad-check { display: inline-flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.ad-check input { flex: none; margin-top: 0.32em; }

/* 答えを選ぶ札（押すと選ばれる） */
.ad-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.ad-choice {
  display: inline-flex; align-items: center; min-height: var(--ad-control-h); padding: 5px 14px; border: 1px solid var(--ad-rule-strong);
  border-radius: var(--ad-radius-s); background: var(--ad-surface); color: var(--ad-ink); box-shadow: var(--ad-shadow-xs);
  font: inherit; font-size: var(--ad-text); line-height: 1.5; text-align: left; cursor: pointer;
}
.ad-choice:hover { background: var(--ad-bg-muted); }
.ad-choice[aria-pressed="true"] { background: var(--ad-primary); border-color: var(--ad-primary); color: var(--ad-on-primary); }
.ad-choice:disabled { opacity: 0.5; cursor: default; }

/* 切り替え・タブ（灰色の台に、選んだものだけ白） */
.ad-seg, .ad-tabs { display: inline-flex; flex-wrap: wrap; gap: 2px; max-width: 100%; padding: 3px; background: var(--ad-bg-muted); border-radius: var(--ad-radius-s); }
.ad-seg > button, .ad-tabs > button {
  display: inline-flex; align-items: center; gap: 6px; min-height: var(--ad-control-h-sm); padding: 0 12px; border: 0; border-radius: 6px;
  background: transparent; color: var(--ad-muted); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.ad-seg > button:hover, .ad-tabs > button:hover { color: var(--ad-ink); }
.ad-seg > button[aria-pressed="true"], .ad-tabs > button[aria-pressed="true"], .ad-tabs > button[aria-selected="true"] {
  background: var(--ad-surface); color: var(--ad-ink); box-shadow: 0 1px 2px rgb(0 0 0 / 0.08);
}
.ad-seg > button:disabled { opacity: 0.45; cursor: default; }
.ad-count { display: inline-block; min-width: 1.7em; padding: 0 6px; border-radius: 999px; background: var(--ad-surface); border: 1px solid var(--ad-rule); color: var(--ad-ink); font-size: 11.5px; line-height: 1.6; text-align: center; font-variant-numeric: tabular-nums; }
.ad-count-attn { background: var(--ad-attn); border-color: var(--ad-attn); color: #ffffff; }

/* ───────── 状態の札・小さな札 ───────── */
.ad-status {
  display: inline-flex; align-items: center; gap: 0.45em; padding: 1px 8px; border: 1px solid var(--ad-rule); border-radius: 6px;
  background: var(--ad-surface); color: var(--ad-ink); font-size: var(--ad-text-sm); font-weight: 500; line-height: 1.6; white-space: nowrap;
}
.ad-status::before { content: ""; flex: none; width: 0.5em; height: 0.5em; border-radius: 50%; background: var(--ad-dot, var(--ad-stop)); }
.ad-status-ok { --ad-dot: var(--ad-ok); }
.ad-status-info { --ad-dot: var(--ad-info); }
.ad-status-stop { --ad-dot: var(--ad-stop); }
.ad-status-attn { background: var(--ad-attn); border-color: var(--ad-attn); color: #ffffff; --ad-dot: #ffffff; }
.ad-status-danger { background: var(--ad-danger); border-color: var(--ad-danger); color: #ffffff; --ad-dot: #ffffff; }
.ad-tag { display: inline-block; padding: 0 6px; border: 1px solid var(--ad-attn-line); border-radius: 4px; background: var(--ad-attn-soft); color: var(--ad-attn); font-size: 12px; font-weight: 500; line-height: 20px; white-space: nowrap; vertical-align: 1px; }
.ad-tag-muted { border-color: var(--ad-rule); background: var(--ad-surface); color: var(--ad-muted); }

/* ───────── 枠（カード） ───────── */
.ad-card { min-width: 0; background: var(--ad-surface); border: 1px solid var(--ad-rule); border-radius: var(--ad-radius-l); box-shadow: var(--ad-shadow-xs); }
.ad-card-head { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--ad-rule); }
.ad-card-head > h2, .ad-card-head > h3 { margin: 0; font-size: 14.5px; font-weight: 700; }
.ad-card-head-end { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: var(--ad-text-sm); color: var(--ad-muted); }
.ad-card-body { padding: 18px; }
.ad-card-strong { border-color: var(--ad-ink); box-shadow: 0 4px 16px rgb(0 0 0 / 0.07); }
.ad-card > .ad-kv { padding: 0 18px; }

/* 数字のまとまり */
.ad-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); gap: 12px; }
.ad-stat { padding: 14px 18px; border: 1px solid var(--ad-rule); border-radius: var(--ad-radius-l); background: var(--ad-surface); box-shadow: var(--ad-shadow-xs); }
.ad-stat-label { font-size: var(--ad-text-sm); font-weight: 500; color: var(--ad-muted); }
.ad-stat-value { font-size: 26px; font-weight: 700; line-height: 1.35; font-variant-numeric: tabular-nums; }

/* ───────── 表 ───────── */
.ad-table-wrap { min-width: 0; overflow-x: auto; background: var(--ad-surface); border: 1px solid var(--ad-rule); border-radius: var(--ad-radius-l); }
.ad-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.ad-table th { text-align: left; padding: 9px 14px; border-bottom: 1px solid var(--ad-rule); color: var(--ad-muted); font-size: var(--ad-text-sm); font-weight: 500; white-space: nowrap; }
.ad-table td { padding: 10px 14px; border-bottom: 1px solid var(--ad-rule); vertical-align: middle; }
.ad-table tbody tr:last-child td { border-bottom: 0; }
@media (hover: hover) { .ad-table tbody tr:hover td { background: var(--ad-bg-subtle); } }   /* 指で触れる端末では、触れたあとに色が残るので付けない */
.ad-table th.ad-num, .ad-table td.ad-num { text-align: right; }
.ad-card-body > .ad-table th:first-child, .ad-card-body > .ad-table td:first-child { padding-left: 0; }

/* 項目と値 */
.ad-kv { display: grid; grid-template-columns: minmax(7rem, 11rem) minmax(0, 1fr); margin: 0; }
.ad-kv dt, .ad-kv dd { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--ad-rule); }
.ad-kv dt { padding-right: 16px; color: var(--ad-muted); font-size: 13px; font-weight: 500; }
.ad-kv dd { min-width: 0; }
.ad-kv > dt:nth-last-of-type(1), .ad-kv > dd:last-child, .ad-kv > div:last-child > dt, .ad-kv > div:last-child > dd { border-bottom: 0; }

/* ───────── お知らせ ───────── */
.ad-notice {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 12px; align-items: start; margin: 16px 0 0; padding: 12px 16px;
  background: var(--ad-surface); border: 1px solid var(--ad-rule); border-radius: var(--ad-radius-l); font-size: 13.5px;
}
.ad-notice:not(:has(> .ad-notice-icon)) { grid-template-columns: minmax(0, 1fr) auto; }
.ad-notice-icon { display: grid; place-items: center; width: 20px; height: 20px; margin-top: 1px; border-radius: 50%; background: var(--ad-bg-muted); color: var(--ad-ink); font-size: 12px; font-weight: 700; line-height: 1; }
.ad-notice-body { min-width: 0; }
.ad-notice-body > strong { display: block; font-size: var(--ad-text); font-weight: 700; }
.ad-notice-body > p { margin: 2px 0 0; color: var(--ad-ink-2); }
.ad-notice-actions { display: flex; flex-wrap: wrap; align-self: center; gap: 8px 14px; }
.ad-notice-info { background: var(--ad-info-soft); border-color: var(--ad-info-line); }
.ad-notice-info > .ad-notice-icon { background: var(--ad-info); color: #ffffff; }
.ad-notice-ok { background: var(--ad-ok-soft); border-color: var(--ad-ok-line); }
.ad-notice-ok > .ad-notice-icon { background: var(--ad-ok); color: #ffffff; }
.ad-notice-ok .ad-notice-body > strong { color: var(--ad-ok); }
.ad-notice-attn { background: var(--ad-attn-soft); border-color: var(--ad-attn-line); }
.ad-notice-attn > .ad-notice-icon { background: var(--ad-attn); color: #ffffff; }
.ad-notice-attn .ad-notice-body > strong { color: var(--ad-attn); }
.ad-notice-danger { background: var(--ad-danger-soft); border-color: var(--ad-danger-line); }
.ad-notice-danger > .ad-notice-icon { background: var(--ad-danger); color: #ffffff; }
.ad-notice-danger .ad-notice-body > strong { color: var(--ad-danger); }
@media (max-width: 640px) {
  .ad-notice { grid-template-columns: auto minmax(0, 1fr); }
  .ad-notice > .ad-notice-actions { grid-column: 2; }
  .ad-notice:not(:has(> .ad-notice-icon)) { grid-template-columns: minmax(0, 1fr); }
  .ad-notice:not(:has(> .ad-notice-icon)) > .ad-notice-actions { grid-column: 1; }
}

/* ───────── 工程 ───────── */
.ad-steps { display: flex; gap: 2px; margin: 0 0 18px; padding: 4px; list-style: none; background: var(--ad-bg-subtle); border: 1px solid var(--ad-rule); border-radius: var(--ad-radius-l); font-size: 13px; color: var(--ad-muted); }
.ad-steps > li { flex: 1 1 0; min-width: 0; }
.ad-steps > li > a, .ad-steps > li > span { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 5px 10px; border-radius: var(--ad-radius-s); color: inherit; text-decoration: none; white-space: nowrap; overflow: hidden; }
.ad-steps > li > a:hover { background: var(--ad-bg-muted); color: var(--ad-ink); }
.ad-step-num { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid var(--ad-rule-strong); border-radius: 50%; background: var(--ad-surface); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.ad-step-label { overflow: hidden; text-overflow: ellipsis; }
.ad-steps > li.is-done { color: var(--ad-ink-2); }
.ad-steps > li.is-done .ad-step-num { background: var(--ad-ink-2); border-color: var(--ad-ink-2); color: #ffffff; font-size: 0; }
.ad-steps > li.is-done .ad-step-num::after { content: "✓"; font-size: 12px; }
.ad-steps > li.is-current { color: var(--ad-ink); font-weight: 500; }
.ad-steps > li.is-current > span { background: var(--ad-surface); box-shadow: 0 1px 2px rgb(0 0 0 / 0.08); }
.ad-steps > li.is-current .ad-step-num { background: var(--ad-primary); border-color: var(--ad-primary); color: var(--ad-on-primary); }
@media (max-width: 640px) {
  .ad-steps > li > a, .ad-steps > li > span { justify-content: center; padding: 5px 4px; }
  .ad-steps > li:not(.is-current) .ad-step-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .ad-steps > li.is-current { flex: 3 1 0; }
}

/* ───────── 下の操作の帯・引き出し ───────── */
.ad-action-bar {
  position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
  margin: 24px calc(-1 * var(--ad-page-pad)) 0; padding: 12px var(--ad-page-pad);
  background: rgb(255 255 255 / 0.95); border-top: 1px solid var(--ad-rule); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.ad-spacer { flex: 1; }
@media (max-width: 640px) { .ad-action-bar { position: static; } }
.ad-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 30; width: min(36rem, 100vw); overflow-y: auto; padding: 20px 24px; background: var(--ad-surface); border-left: 1px solid var(--ad-rule); box-shadow: var(--ad-shadow-pop); }
.ad-drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 12px; }

/* ───────── ログインなど、外枠の無い画面 ───────── */
.ad-auth { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; background: var(--ad-bg-subtle); }
.ad-auth-card { width: min(100%, 26rem); padding: 28px; background: var(--ad-surface); border: 1px solid var(--ad-rule); border-radius: var(--ad-radius-l); box-shadow: var(--ad-shadow-xs); }
.ad-auth-card .ad-brand { padding: 0 0 14px; margin-bottom: 18px; }

/* ───────── 小物 ───────── */
.ad-icon { width: 16px; height: 16px; flex: none; }
.ad-muted { color: var(--ad-muted); }
.ad-small { font-size: var(--ad-text-sm); }
.ad-num { font-variant-numeric: tabular-nums; }
.ad-error { color: var(--ad-danger); font-weight: 500; }
.ad-ok-text { color: var(--ad-ok); }
.ad-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.ad-stack { display: grid; gap: 16px; }
.ad-flow > * + * { margin-top: 16px; }   /* 縦に並べる枠や表の間隔（グリッドの中では使わない） */
.ad-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 狭い画面で、表を1行ずつの帳票にする（td に data-label を付ける） */
@media (max-width: 640px) {
  .ad-table-stack thead { display: none; }
  .ad-table-stack, .ad-table-stack tbody, .ad-table-stack tr, .ad-table-stack td { display: block; width: 100%; }
  .ad-table-stack tr { padding: 10px 0; border-bottom: 1px solid var(--ad-rule); }
  .ad-table-stack td { border: 0; padding: 2px 0; max-width: none !important; }
  .ad-table-stack td.ad-num { text-align: left; }
  .ad-table-stack td[data-label]::before { content: attr(data-label); display: inline-block; min-width: 7.5em; margin-right: 8px; font-size: 12px; color: var(--ad-muted); vertical-align: top; }
  .ad-table-stack td:empty { display: none; }
  .ad-kv { grid-template-columns: minmax(0, 1fr); }
  .ad-kv dt { border-bottom: 0; padding-bottom: 0; }
  .ad-kv dd { padding-top: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  .ad-btn { transition: none; }
}
