/* Septet RequestHub — スタイルシート
 * モック.html の <style> ブロックをそのまま抽出。
 * 変更・モダナイズ禁止 (CLAUDE.md §デザイン・ユーザー意図の保持)
 */

:root {
  color-scheme: light;
  --bg: #f6f9ff;
  --bg-soft: #eef4ff;
  --panel: #ffffff;
  --panel-translucent: rgba(255, 255, 255, 0.72);
  --border: #dbeafe;
  --border-strong: #bfdbfe;
  --text: #0b1736;
  --text-soft: #1f2a44;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --primary-50: #eff6ff;
  --primary-100: #dbeafe;
  --primary-500: #3b82f6;
  --primary-600: #2563eb;
  --primary-700: #1d4ed8;
  --primary-900: #1e3a8a;
  --accent-cyan: #38bdf8;
  --accent-sky: #60a5fa;
  --warn: #b45309;
  --warn-bg: #fef3c7;
  --danger: #b91c1c;
  --danger-bg: #fee2e2;
  --ok: #047857;
  --ok-bg: #d1fae5;
  --returned-bg: #fed7aa;
  --returned-fg: #9a3412;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .04);
  --shadow-md: 0 4px 14px -2px rgba(30, 64, 175, .08), 0 2px 6px rgba(15, 23, 42, .04);
  --shadow-lg: 0 18px 50px -12px rgba(30, 64, 175, .22), 0 6px 18px -6px rgba(15, 23, 42, .08);
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-pill: 999px;
  --grad-primary: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #60a5fa 100%);
  --grad-primary-hover: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
  --grad-soft: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 100%);
  --grad-bg: radial-gradient(1200px 600px at 0% -10%, #dbeafe 0%, transparent 50%), radial-gradient(900px 500px at 100% 0%, #e0f2fe 0%, transparent 55%), linear-gradient(180deg, #f6f9ff 0%, #eef4ff 100%);
  --grad-mesh: radial-gradient(800px 400px at 100% 0%, rgba(96, 165, 250, .18) 0%, transparent 60%), radial-gradient(600px 400px at 0% 100%, rgba(56, 189, 248, .14) 0%, transparent 60%);
  --header-h: 64px;
  --side-w: 264px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body {
  margin: 0; padding: 0;
  font-family: "LINE Seed JP", -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "Noto Sans JP", system-ui, sans-serif;
  font-size: 14px; line-height: 1.6;
  color: var(--text);
  background: var(--grad-bg);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "palt";
}
code, pre { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; }
a { color: var(--primary-700); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--primary-900); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:focus-visible { outline: 2px solid var(--primary-600); outline-offset: 2px; border-radius: 2px; }

*:focus { outline: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [role="tab"]:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--primary-600);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

button { font: inherit; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

/* スキップリンク */
.skip-link { position: absolute; left: 8px; top: 8px; background: var(--primary-700); color: #fff; padding: 8px 12px; border-radius: var(--radius-sm); font-weight: 700; transform: translateY(-200%); transition: transform .2s ease; z-index: 200; }
.skip-link:focus-visible { transform: translateY(0); }

/* トップバー */
header.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--header-h);
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(255,255,255,0.78));
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 20px; z-index: 50;
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
}
header.topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 15px; letter-spacing: .01em; margin-right: 24px; color: var(--text); white-space: nowrap; }
header.topbar .brand .logo {
  width: 30px; height: 30px; border-radius: 8px; background: var(--grad-primary);
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 13px; letter-spacing: -0.04em;
  box-shadow: 0 4px 12px -2px rgba(37, 99, 235, .55);
}
header.topbar .brand .small { color: var(--muted); font-weight: 500; font-size: 11px; }
header.topbar .right { margin-left: auto; display: flex; gap: 14px; align-items: center; font-size: 12px; }
header.topbar .role-switcher { display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 10px; background: var(--primary-50); border: 1px solid var(--border); border-radius: var(--radius-pill); font-size: 12px; }
header.topbar .role-switcher select { background: transparent; border: none; font: inherit; color: var(--text); padding: 4px 4px; border-radius: var(--radius-sm); cursor: pointer; }
header.topbar .role-switcher select:focus-visible { background: white; }
header.topbar .bell { position: relative; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); background: white; display: grid; place-items: center; color: var(--text-soft); }
header.topbar .bell:hover { border-color: var(--primary-500); color: var(--primary-700); transform: translateY(-1px); transition: transform .15s ease, border-color .15s ease, color .15s ease; }
header.topbar .bell-badge { position: absolute; top: -2px; right: -2px; background: var(--grad-primary); color: white; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: var(--radius-pill); border: 2px solid white; font-variant-numeric: tabular-nums; }
header.topbar .user-chip { display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; background: white; border: 1px solid var(--border); border-radius: var(--radius-pill); font-size: 12px; font-weight: 600; }
header.topbar .user-chip .avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--grad-primary); color: white; display: grid; place-items: center; font-size: 11px; font-weight: 700; }
header.topbar .menu-btn { display: none; width: 36px; height: 36px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: white; color: var(--text); }

/* サイドナビ */
aside.sidenav {
  position: fixed; top: var(--header-h); left: 0; bottom: 0; width: var(--side-w);
  background: linear-gradient(180deg, rgba(255,255,255,0.78) 0%, rgba(255,255,255,0.55) 100%);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-right: 1px solid var(--border);
  overflow-y: auto; padding: 20px 0 32px;
  overscroll-behavior: contain;
}
aside.sidenav h3 { font-size: 10px; font-weight: 800; color: var(--muted); padding: 16px 20px 6px; margin: 0; text-transform: uppercase; letter-spacing: .12em; }
aside.sidenav .nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 16px 8px 17px; margin: 0 8px; font-size: 13px; cursor: pointer; border-radius: var(--radius-sm); color: var(--text-soft); position: relative; transition: background-color .15s ease, color .15s ease;
}
aside.sidenav .nav-item:hover { background: var(--primary-50); color: var(--primary-700); }
aside.sidenav .nav-item .nav-icon { width: 18px; text-align: center; flex-shrink: 0; }
aside.sidenav .nav-item .nav-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
aside.sidenav .nav-item.active {
  background: var(--grad-primary); color: white; font-weight: 700;
  box-shadow: 0 6px 18px -6px rgba(37, 99, 235, .55);
}
aside.sidenav .nav-item.active::before { content: ""; position: absolute; left: -8px; top: 8px; bottom: 8px; width: 3px; background: var(--accent-cyan); border-radius: 2px; }
aside.sidenav .nav-item.admin-only::after, aside.sidenav .nav-item.approver-only::after {
  content: attr(data-tag); flex-shrink: 0; font-size: 9px; font-weight: 700; padding: 1px 6px; border-radius: var(--radius-pill); letter-spacing: .04em;
}
aside.sidenav .nav-item.admin-only::after { background: var(--warn-bg); color: var(--warn); }
aside.sidenav .nav-item.approver-only::after { background: #ede9fe; color: #6d28d9; }
aside.sidenav .nav-item.active.admin-only::after, aside.sidenav .nav-item.active.approver-only::after {
  background: rgba(255,255,255,.22); color: white;
}

main {
  margin-left: var(--side-w); margin-top: var(--header-h); padding: 32px 36px 80px;
  padding-left: max(36px, env(safe-area-inset-left));
  padding-right: max(36px, env(safe-area-inset-right));
}
.screen { display: none; max-width: 1180px; margin: 0 auto; animation: fadeIn .25s ease; }
.screen.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

.page-head { margin-bottom: 24px; }
.page-head h1 { margin: 0 0 6px; font-size: 26px; font-weight: 800; letter-spacing: -.01em; line-height: 1.3; text-wrap: balance; }
.page-head .page-desc { color: var(--muted); margin: 0; font-size: 13px; max-width: 760px; text-wrap: pretty; }
.crumb { font-size: 12px; color: var(--muted); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--primary-700); }

/* パネル */
.panel {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 22px 24px; margin-bottom: 18px; box-shadow: var(--shadow-sm);
}
.panel.has-mesh { position: relative; overflow: hidden; }
.panel.has-mesh::before { content: ""; position: absolute; inset: 0; background: var(--grad-mesh); pointer-events: none; opacity: .8; z-index: 0; }
.panel.has-mesh > * { position: relative; z-index: 1; }
.panel h2 { font-size: 15px; font-weight: 700; margin: 0 0 16px; color: var(--text); display: flex; align-items: center; gap: 8px; letter-spacing: -.005em; }
.panel h2 .h-accent { width: 4px; height: 16px; background: var(--grad-primary); border-radius: 2px; flex-shrink: 0; }
.panel-actions { display: flex; gap: 8px; justify-content: flex-end; padding-top: 4px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-6 { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }

/* ヒーロー */
.hero {
  position: relative; overflow: hidden;
  background: var(--grad-primary);
  color: white; border-radius: var(--radius-lg); padding: 28px 32px;
  margin-bottom: 18px; box-shadow: var(--shadow-lg);
}
.hero::before {
  content: ""; position: absolute; right: -80px; top: -120px; width: 360px; height: 360px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.22) 0%, transparent 70%);
  pointer-events: none;
}
.hero::after {
  content: ""; position: absolute; left: -40px; bottom: -120px; width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, .35) 0%, transparent 70%);
  pointer-events: none;
}
.hero .hero-greet { font-size: 12px; font-weight: 600; opacity: .85; letter-spacing: .05em; text-transform: uppercase; }
.hero h1 { margin: 4px 0 8px; font-size: 28px; font-weight: 800; letter-spacing: -.01em; }
.hero .hero-sub { opacity: .9; font-size: 13px; max-width: 600px; }
.hero-stats { margin-top: 22px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 540px; }
.hero-stat { background: rgba(255,255,255,.16); backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,.22); border-radius: var(--radius); padding: 12px 14px; }
.hero-stat .label { font-size: 11px; opacity: .85; letter-spacing: .05em; text-transform: uppercase; }
.hero-stat .value { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; margin-top: 4px; }

/* 統計カード */
.stat-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.stat-card .label { color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.stat-card .value { font-size: 30px; font-weight: 800; margin: 4px 0 2px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat-card .delta { font-size: 11px; color: var(--ok); font-weight: 600; }
.stat-card.warn .value { color: var(--warn); }
.stat-card.danger .value { color: var(--danger); }

/* 申請種別ボタン */
.type-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: white; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 8px; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  min-height: 100px; color: var(--text); text-align: center;
}
.type-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--primary-500); }
.type-btn .icon-wrap { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: var(--grad-soft); border: 1px solid var(--border); }
.type-btn:hover .icon-wrap { background: var(--grad-primary); color: white; border-color: transparent; }
.type-btn .name { font-size: 12px; font-weight: 700; }

/* フォーム */
.form-row { display: grid; grid-template-columns: 180px 1fr; gap: 18px; align-items: flex-start; padding: 12px 0; border-bottom: 1px dashed var(--border); }
.form-row:last-child { border-bottom: none; }
.form-row > .form-label { padding-top: 8px; font-weight: 600; color: var(--text-soft); font-size: 13px; }
.form-row > .form-label .req { color: var(--danger); margin-left: 4px; font-weight: 800; }
.form-row > .form-label .opt-tag { color: var(--muted); margin-left: 6px; font-size: 11px; font-weight: 500; }
.form-row > .field { min-width: 0; }
.form-row .help { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.form-row .help .em { color: var(--text-soft); font-weight: 600; }

input[type="text"], input[type="date"], input[type="time"], input[type="number"], input[type="email"], input[type="password"], input[type="tel"], input[type="url"], select, textarea {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font: inherit; font-size: 13px; color: var(--text);
  background: white;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:hover:not(:disabled), select:hover:not(:disabled), textarea:hover:not(:disabled) { border-color: var(--primary-500); }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none; border-color: var(--primary-600);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}
textarea { min-height: 88px; resize: vertical; line-height: 1.6; }

.input-inline { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* date_range / datepair / timepair の input は親幅いっぱいではなく自然幅で並ばせる
   wrap も無効化して 1 行表示を強制 */
.input-inline { flex-wrap: nowrap; }
.input-inline > input[type="date"],
.input-inline > input[type="time"] { width: auto !important; min-width: 0; flex: 0 0 auto; max-width: 200px; }
@media (max-width: 600px) {
  .input-inline { flex-wrap: wrap; }
  .input-inline > input[type="date"],
  .input-inline > input[type="time"] { max-width: 100%; }
}
.radio-group, .check-group { display: flex; gap: 14px; flex-wrap: wrap; }
.radio-group label, .check-group label { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; cursor: pointer; padding: 6px 10px; border-radius: var(--radius-pill); border: 1px solid var(--border); background: white; transition: border-color .15s ease, background-color .15s ease; }
.radio-group label:hover, .check-group label:hover { border-color: var(--primary-500); background: var(--primary-50); }
.radio-group input[type="radio"], .check-group input[type="checkbox"] { accent-color: var(--primary-600); }

/* ボタン */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: white; color: var(--text); font-size: 13px; font-weight: 600;
  font-family: inherit; line-height: 1.2; box-sizing: border-box;
  text-decoration: none; cursor: pointer; vertical-align: middle;
  transition: background-color .15s ease, border-color .15s ease, transform .15s ease, color .15s ease, box-shadow .15s ease;
  white-space: nowrap;
}
a.btn { text-decoration: none; }
button.btn { font-family: inherit; }
/* <form style="display:inline"> が包む <button.btn> と直置き <a.btn> の縦位置を揃える */
form[style*="display:inline"] { display: inline-flex !important; vertical-align: middle; margin: 0; }
.btn:hover { background: var(--primary-50); border-color: var(--primary-500); color: var(--primary-700); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--grad-primary); border-color: transparent; color: white; box-shadow: 0 6px 18px -6px rgba(37, 99, 235, .55); }
.btn.primary:hover { background: var(--grad-primary-hover); color: white; box-shadow: 0 8px 22px -6px rgba(37, 99, 235, .65); }
.btn.danger { background: white; border-color: var(--danger); color: var(--danger); }
.btn.danger:hover { background: var(--danger-bg); color: var(--danger); }
.btn.warn { background: white; border-color: var(--warn); color: var(--warn); }
.btn.warn:hover { background: var(--warn-bg); color: var(--warn); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--bg-soft); color: var(--text); }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* バッジ */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 700; letter-spacing: .02em; white-space: nowrap; flex-shrink: 0; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.draft { background: #f1f5f9; color: #475569; }
.badge.pending { background: var(--warn-bg); color: var(--warn); }
.badge.approved { background: var(--ok-bg); color: var(--ok); }
.badge.rejected { background: var(--danger-bg); color: var(--danger); }
.badge.returned { background: var(--returned-bg); color: var(--returned-fg); }
.badge.withdrawn { background: #e2e8f0; color: #475569; }
.badge.archive { background: #f1f5f9; color: #64748b; }

/* テーブル */
table.list, table.data-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
table.list th, table.list td, table.data-table th, table.data-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.list th, table.data-table th { background: var(--bg-soft); font-weight: 700; color: var(--muted); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
table.list tbody tr, table.data-table tbody tr { transition: background-color .12s ease; }
table.list tbody tr:nth-child(even), table.data-table tbody tr:nth-child(even) { background: var(--bg-soft); }
table.list tbody tr:nth-child(odd), table.data-table tbody tr:nth-child(odd) { background: #ffffff; }
table.list tbody tr:hover, table.data-table tbody tr:hover { background: var(--primary-50); }
table.list .cell-strong, table.data-table .cell-strong { color: var(--text); font-weight: 600; }
table.list .actions, table.data-table .actions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
/* 申請ID列 — monospace + 幅制限 */
table.data-table .col-request-id { width: 12ch; max-width: 12ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: "JetBrains Mono", monospace; font-size: 12px; }

/* タブ */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; padding: 0 4px; overflow-x: auto; }
.tab { padding: 10px 16px; cursor: pointer; border-bottom: 2px solid transparent; font-size: 13px; color: var(--muted); font-weight: 600; background: transparent; border-top: none; border-left: none; border-right: none; white-space: nowrap; transition: color .15s ease, border-color .15s ease; }
.tab:hover { color: var(--primary-700); }
.tab.active { border-bottom-color: var(--primary-600); color: var(--primary-700); }

/* 経路の進捗 */
.route-steps { display: flex; align-items: center; gap: 8px; padding: 14px 16px; background: var(--grad-soft); border: 1px solid var(--border); border-radius: var(--radius); flex-wrap: wrap; }
.route-step { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border: 1px solid var(--border); border-radius: var(--radius-pill); font-size: 12px; background: white; font-weight: 600; }
.route-step.done { background: var(--ok-bg); border-color: #6ee7b7; color: var(--ok); }
.route-step.done::before { content: "✓"; font-weight: 800; }
.route-step.current { background: var(--grad-primary); border-color: transparent; color: white; box-shadow: 0 4px 12px -4px rgba(37, 99, 235, .55); }
.route-step.current::before { content: "→"; font-weight: 800; }
.route-arrow { color: var(--muted-2); font-size: 14px; user-select: none; }

/* モーダル */
/* レコード詳細モーダル (リストの 詳細/編集 リンク用) */
.record-modal-overlay { position: fixed; inset: 0; background: rgba(11, 23, 54, .58); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: none; align-items: flex-start; justify-content: center; z-index: 110; padding: 24px 20px; overflow-y: auto; }
.record-modal-overlay.show { display: flex; }
.record-modal { background: white; border-radius: var(--radius-lg); max-width: 1100px; width: 100%; min-height: 200px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); position: relative; }
.record-modal-close { position: sticky; top: 0; right: 0; float: right; margin: 8px 8px 0 0; background: white; border: 1px solid var(--border); width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 18px; color: var(--muted); display: grid; place-items: center; z-index: 2; }
.record-modal-close:hover { color: var(--danger); border-color: var(--danger); background: var(--danger-bg); }
.record-modal-body { padding: 8px 24px 24px; }
.record-modal-loading { padding: 60px 24px; text-align: center; color: var(--muted); font-size: 13px; }
.record-modal .screen { display: block !important; }
.record-modal .crumb { display: none; }
.record-modal .page-head { padding-top: 4px; }

.modal-overlay { position: fixed; inset: 0; background: rgba(11, 23, 54, .58); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal-overlay.show { display: flex; }
.modal { background: white; border-radius: var(--radius-lg); max-width: 640px; width: 100%; max-height: 85vh; overflow: auto; box-shadow: var(--shadow-lg); border: 1px solid var(--border); overscroll-behavior: contain; }
.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 10px; }
.modal-body { padding: 24px; }
.modal-footer { padding: 18px 24px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; background: var(--bg-soft); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

/* アラート */
[hidden] { display: none !important; }
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 13px; display: flex; align-items: flex-start; gap: 10px; line-height: 1.55; }
.alert .alert-icon { flex-shrink: 0; font-size: 16px; line-height: 1.2; }
.alert.warn { background: var(--warn-bg); border-left: 3px solid var(--warn); color: #78350f; }
.alert.info { background: var(--primary-50); border-left: 3px solid var(--primary-600); color: #1e3a8a; }
.alert.danger { background: var(--danger-bg); border-left: 3px solid var(--danger); color: #7f1d1d; }
.alert.success { background: var(--ok-bg); border-left: 3px solid var(--ok); color: #064e3b; }
.alert strong { font-weight: 700; }

/* 印刷ビュー */
.print-toolbar { background: white; border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 18px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; box-shadow: var(--shadow-sm); }
.print-paper {
  background: white; padding: 56px 64px;
  border: 1px solid var(--border); border-radius: var(--radius);
  max-width: 760px; margin: 0 auto;
  box-shadow: var(--shadow-md);
  color: #000;
}
.print-paper h2 { text-align: center; font-size: 24px; margin: 0 0 28px; padding-bottom: 12px; border-bottom: 2.5px solid #000; letter-spacing: .25em; font-weight: 800; }
.print-paper dl { display: grid; grid-template-columns: 140px 1fr; gap: 8px 16px; margin: 0 0 28px; font-size: 13px; }
.print-paper dt { font-weight: 700; color: #555; }
.print-paper table.print-table { width: 100%; border-collapse: collapse; margin-bottom: 18px; font-size: 12px; font-variant-numeric: tabular-nums; }
.print-paper table.print-table th, .print-paper table.print-table td { border: 1px solid #444; padding: 7px 9px; }
.print-paper table.print-table th { background: #f1f5f9; font-weight: 700; }
.stamp-box { display: flex; gap: 28px; justify-content: flex-end; margin-top: 56px; }
.stamp-cell { text-align: center; font-size: 12px; color: #555; }
.stamp-cell .stamp-area { border: 1px solid #444; border-radius: 4px; width: 88px; height: 56px; margin-top: 6px; }

/* レピーター */
.repeater-head, .repeater-row { display: grid; grid-template-columns: 30px 80px 80px 100px 0.65fr 0.8fr 0.8fr 0.6fr minmax(140px,1fr) 30px 30px; gap: 4px; align-items: center; min-width: 0; }
.repeater-head { padding: 8px 0; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.repeater-row { padding: 6px 0; }
.repeater-row input { padding: 6px 8px; font-size: 12px; width: 100%; box-sizing: border-box; min-width: 0; }
.repeater-row > * { min-width: 0; overflow: hidden; }
.repeater-row .row-num { color: var(--muted); font-size: 11px; text-align: center; font-variant-numeric: tabular-nums; }
.repeater-row .del-btn { background: transparent; border: 1px solid transparent; color: var(--muted); padding: 6px; border-radius: var(--radius-sm); display: grid; place-items: center; }
.repeater-row .del-btn:hover { color: var(--danger); border-color: var(--danger); background: var(--danger-bg); }
.repeater-row .dup-btn { background: transparent; border: 1px solid transparent; color: var(--muted); padding: 6px; border-radius: var(--radius-sm); display: grid; place-items: center; cursor: pointer; font-size: 14px; line-height: 1; }
.repeater-row .dup-btn:hover { color: var(--primary-700); border-color: var(--primary-500); background: var(--primary-50); }

/* 運賃ボタン付きセル（repeater 内 fare_search フィールド） */
.cell-with-action { display: flex; flex-direction: row; align-items: center; gap: 4px; width: 100%; min-width: 0; overflow: visible; }
.cell-with-action input { flex: 1 1 0; min-width: 0; width: 0; }
.cell-with-action .btn { flex: 0 0 auto; white-space: nowrap; font-size: 11px; padding: 6px 8px; }
.cell-with-action .fare-result { display: none; }

/* オートコンプリートラッパー（repeater 内） */
.repeater-row .autocomplete-wrap { position: relative; width: 100%; min-width: 0; }
.repeater-row .autocomplete-wrap input { width: 100%; box-sizing: border-box; }
.autocomplete-list { position: absolute; top: 100%; left: 0; right: 0; z-index: 100; background: var(--panel); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); list-style: none; margin: 2px 0 0; padding: 0; max-height: 200px; overflow-y: auto; }
.autocomplete-list li { padding: 8px 12px; font-size: 13px; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.autocomplete-list li:hover { background: var(--primary-50); }
.ac-kind-badge { display: inline-flex; align-items: center; padding: 1px 6px; border-radius: var(--radius-pill); font-size: 10px; font-weight: 700; line-height: 1.4; flex: 0 0 auto; }
.ac-kind-bus { background: #fff7ed; color: #9a3412; border: 1px solid #fed7aa; }

/* info type フィールド (read-only 計算結果表示) */
.info-display { background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; font-size: 14px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.info-display .info-placeholder { color: var(--muted); font-weight: 400; font-size: 13px; }

/* 行モード切替 (鉄道/バス) */
.repeater-mode-toggle { display: inline-flex; gap: 2px; padding: 2px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-pill); width: 100%; box-sizing: border-box; }
.repeater-mode-option { flex: 1 1 0; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 4px 6px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 600; color: var(--muted); user-select: none; }
.repeater-mode-option input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.repeater-mode-option:has(input[type="radio"]:checked) { background: var(--primary-500); color: #fff; }
.repeater-mode-option span { white-space: nowrap; }
.btn-mode-disabled { opacity: 0.5; cursor: not-allowed; }

/* 運賃選択モーダル */
.fare-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 200; display: flex; align-items: center; justify-content: center; }
.fare-modal-overlay.hidden { display: none; }
.fare-modal { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow-lg); width: min(480px, 95vw); max-height: 80vh; overflow-y: auto; padding: 24px; }
.fare-modal h3 { margin: 0 0 16px; font-size: 15px; font-weight: 700; }
.fare-candidate-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.fare-candidate-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; transition: background .12s; }
.fare-candidate-list li:hover { background: var(--primary-50); border-color: var(--primary-500); }
.fare-candidate-list li .cand-via { font-size: 13px; font-weight: 600; color: var(--text); }
.fare-candidate-list li .cand-meta { font-size: 12px; color: var(--muted); }
.fare-candidate-list li .cand-fare { font-size: 14px; font-weight: 700; color: var(--primary-700); white-space: nowrap; }
.fare-modal-cancel { margin-top: 14px; width: 100%; }

/* チップ */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; background: var(--primary-50); color: var(--primary-700); border-radius: var(--radius-pill); font-size: 11px; font-weight: 600; border: 1px solid var(--border); }

/* 通知行 */
.notif-row { display: grid; grid-template-columns: 140px 1fr; gap: 16px; padding: 10px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.notif-row:last-child { border-bottom: none; }
.notif-row .notif-time { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }

/* レスポンシブ */
@media (max-width: 880px) {
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-6 { grid-template-columns: repeat(3, 1fr); }
  .hero-stats { grid-template-columns: repeat(3, 1fr); max-width: none; }
}
@media (max-width: 720px) {
  aside.sidenav { transform: translateX(-100%); transition: transform .2s ease; z-index: 60; box-shadow: var(--shadow-lg); }
  aside.sidenav.open { transform: translateX(0); }
  main { margin-left: 0; padding: 18px 14px 80px; padding-bottom: max(80px, env(safe-area-inset-bottom)); }
  .form-row { grid-template-columns: 1fr; gap: 6px; padding: 10px 0; }
  .form-row > .form-label { padding-top: 0; }
  .grid-6 { grid-template-columns: repeat(2, 1fr); }
  header.topbar { padding: 0 14px; }
  header.topbar .menu-btn { display: grid; place-items: center; margin-right: 12px; }
  header.topbar .brand .small { display: none; }
  header.topbar .role-switcher { font-size: 11px; padding: 4px 4px 4px 8px; }
  header.topbar .user-chip span:not(.avatar) { display: none; }
  .repeater-head { display: none; }
  .repeater-row { grid-template-columns: 1fr; gap: 6px; padding: 12px; background: white; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; }
  .repeater-row .row-num { text-align: left; color: var(--primary-700); font-weight: 700; }
  .cell-with-action { flex-wrap: nowrap; }
  .panel { padding: 18px 16px; }
  .hero { padding: 22px 22px; }
  .hero h1 { font-size: 22px; }
  .hero-stats { grid-template-columns: 1fr 1fr; max-width: none; }
  .print-paper { padding: 28px 22px; }
  .print-paper dl { grid-template-columns: 1fr; }
  .panel.p-0 { overflow-x: auto; }
  table.list, table.data-table { min-width: 0; }
}

/* 印刷時 */
@media print {
  body { background: white; }
  header.topbar, aside.sidenav, .no-print, .print-toolbar,
  .crumb, .page-head, .record-modal-close { display: none !important; }
  main { margin: 0; padding: 0; }

  /* モーダル経由で詳細を開いた場合: 背景の main (検索結果テーブル等) を消し、
     モーダル overlay を通常フローに戻して中身だけを印刷する */
  body:has(.record-modal-overlay.show) main { display: none !important; }
  .record-modal-overlay {
    position: static !important; background: none !important;
    backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
    padding: 0 !important; overflow: visible !important;
  }
  .record-modal-overlay.show { display: block !important; }
  .record-modal { box-shadow: none !important; border: none !important; max-width: none !important; }
  .record-modal-body { padding: 0 !important; }

  /* print-paper を A4 1 ページに収めるための圧縮 */
  .print-paper { border: none; box-shadow: none; padding: 0; max-width: none; font-size: 11px; }
  .print-paper h2 { font-size: 18px; margin: 0 0 14px; padding-bottom: 8px; }
  .print-paper dl { grid-template-columns: 110px 1fr; gap: 4px 12px; margin: 0 0 14px; font-size: 11px; }
  .print-paper table.print-table { font-size: 10px; margin-bottom: 10px; }
  .print-paper table.print-table th, .print-paper table.print-table td { padding: 4px 6px; }
  .stamp-box { margin-top: 24px; gap: 16px; }
  .stamp-cell { font-size: 10px; }
  .stamp-cell .stamp-area { width: 64px; height: 40px; }

  @page { size: A4; margin: 10mm; }
}

/* スクロールバー */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--primary-500); }

/* アクセシビリティ */
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }

/* 休憩時間ペア入力 */
.break-time-pair { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.break-time-label { font-size: 12px; color: var(--muted); white-space: nowrap; }
.break-time-warning { color: var(--warn); font-weight: 600; }

/* 下書き選択ページ */
.draft-picker-list { display: flex; flex-direction: column; gap: 8px; }
.draft-picker-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); text-decoration: none; color: var(--text); transition: background 0.15s, border-color 0.15s; }
.draft-picker-item:hover { background: var(--primary-50); border-color: var(--primary-400); }
.draft-picker-title { font-weight: 600; font-size: 14px; }
.draft-picker-date { font-size: 12px; color: var(--muted); white-space: nowrap; margin-left: 16px; }

/* 確認モーダル タイトルプレビュー */
.title-preview-label { font-weight: 700; color: var(--primary-700); }
.title-preview-value { font-size: 15px; font-weight: 600; color: var(--primary-800); padding-bottom: 8px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
