/* ============ FDE HUB — design tokens ============ */
:root {
  --bg: #f4f4f1;
  --surface: #fcfcfb;
  --surface-2: #f1f0ec;
  --border: #e4e3de;
  --border-strong: #d2d1cb;
  --text: #1a1a18;
  --text-2: #6e6d67;
  --text-3: #98978f;
  --accent: #2a78d6;
  --accent-soft: #e3edfa;
  --accent-deep: #1c5aa8;
  --good: #0ca30c;      --good-bg: #e4f4e4;
  --warn: #b97b0a;      --warn-bg: #fbf0d7;
  --bad: #d03b3b;       --bad-bg: #fbe5e5;
  --info: #2a78d6;      --info-bg: #e3edfa;
  --neutral-bg: #ecece8;
  --c1: #2a78d6; --c2: #d9822b; --c3: #3fa45b; --c4: #d34a4a;
  --c5: #8461c9; --c6: #2fa3a8; --c7: #c65c9a; --c8: #8c8c86;
  --side-bg: #141c2b;
  --side-text: #a8b3c7;
  --side-active: #ffffff;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 22, 26, .05), 0 4px 16px rgba(20, 22, 26, .05);
  --chart-grid: #e9e8e3;
  font-size: 15px;
}
:root[data-theme="dark"] {
  --bg: #12151c;
  --surface: #1b202b;
  --surface-2: #242a37;
  --border: #2b3140;
  --border-strong: #3c4456;
  --text: #e8eaf0;
  --text-2: #a2a9b8;
  --text-3: #717a8c;
  --accent: #4f92e6;
  --accent-soft: #1e2d47;
  --accent-deep: #8ab6f0;
  --good: #41c06d;      --good-bg: #173321;
  --warn: #e0a83c;      --warn-bg: #332a12;
  --bad: #e26060;       --bad-bg: #3a1a1a;
  --info: #4f92e6;      --info-bg: #1e2d47;
  --neutral-bg: #262c39;
  --c8: #7d8494;
  --side-bg: #0d1017;
  --chart-grid: #2a303e;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .22);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", Meiryo, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}
.num { font-variant-numeric: tabular-nums; }

/* ============ layout ============ */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 236px; flex: none;
  background: var(--side-bg);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.main { flex: 1; min-width: 0; padding: 28px 32px 64px; max-width: 1480px; }

/* sidebar */
.brand { display: flex; gap: 11px; align-items: center; padding: 20px 18px 16px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 9px; flex: none;
  background: linear-gradient(135deg, #3b8ae6, #1c5aa8);
  color: #fff; font-weight: 800; font-size: 20px;
  display: flex; align-items: center; justify-content: center;
}
.brand-name { color: #fff; font-weight: 700; font-size: 16px; letter-spacing: .04em; }
.brand-sub { color: #6b7893; font-size: 10px; letter-spacing: .02em; }
.nav { padding: 8px 10px; display: flex; flex-direction: column; gap: 2px;
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); border-radius: 3px; }
.nav::-webkit-scrollbar-track { background: transparent; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  color: var(--side-text); text-decoration: none;
  font-size: 13.5px; font-weight: 500;
  padding: 9px 12px; border-radius: 8px;
}
.nav a svg { width: 17px; height: 17px; fill: currentColor; opacity: .85; flex: none; }
.nav a:hover { background: rgba(255,255,255,.06); color: #dfe5ef; }
.nav a.active { background: rgba(58,124,213,.28); color: var(--side-active); }
.sidebar-foot {
  margin-top: auto; padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.08);
  display: flex; gap: 10px; align-items: center;
}
.db-dot { width: 8px; height: 8px; border-radius: 50%; background: #35c46a; flex: none;
  box-shadow: 0 0 0 3px rgba(53,196,106,.18); }
.db-line { color: #c6cedb; font-size: 11.5px; font-weight: 600; }
.db-line.muted { color: #6b7893; font-weight: 400; font-size: 11px; }

/* ============ page scaffolding ============ */
.page-head { margin-bottom: 22px; }
.page-title { font-size: 22px; font-weight: 700; letter-spacing: .01em; }
.page-desc { color: var(--text-2); font-size: 13px; margin-top: 3px; }
.crumb { font-size: 12.5px; color: var(--text-3); margin-bottom: 6px; }
.crumb a { color: var(--accent); text-decoration: none; }
.crumb a:hover { text-decoration: underline; }
.loading { color: var(--text-3); padding: 60px; text-align: center; }

.grid { display: grid; gap: 16px; }
.g-kpi { grid-template-columns: repeat(5, 1fr); }
.g-2 { grid-template-columns: 1fr 1fr; }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-main-side { grid-template-columns: 1.75fr 1fr; }
.mt { margin-top: 16px; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px; min-width: 0;
}
.card-title { font-size: 13.5px; font-weight: 700; margin-bottom: 2px; }
.card-sub { font-size: 12px; color: var(--text-2); margin-bottom: 12px; }

/* KPI */
.kpi .k-label { font-size: 12px; color: var(--text-2); font-weight: 600; }
.kpi .k-value { font-size: 25px; font-weight: 800; letter-spacing: .01em; margin-top: 4px; }
.kpi .k-value small { font-size: 13px; font-weight: 600; color: var(--text-2); margin-left: 2px; }
.kpi .k-note { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }

/* ============ tables ============ */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; font-size: 11.5px; color: var(--text-2); font-weight: 600;
  padding: 8px 10px; border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
}
.tbl td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl .r { text-align: right; }
.tbl th.r { text-align: right; }
.tbl tbody tr.rowlink { cursor: pointer; }
.tbl tbody tr.rowlink:hover { background: var(--surface-2); }
.cell-main { font-weight: 600; }
.cell-sub { font-size: 11.5px; color: var(--text-3); }

/* ============ badges / chips ============ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; padding: 2.5px 9px; border-radius: 999px;
  white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.k-pipeline { background: var(--info-bg); color: var(--accent-deep); }
.badge.k-active { background: var(--good-bg); color: #0a7a0a; }
.badge.k-hold { background: var(--warn-bg); color: var(--warn); }
.badge.k-done { background: #ecebe7; color: #63625c; }
.badge.k-lost { background: var(--bad-bg); color: var(--bad); }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 2px 9px; font-size: 11.5px; color: var(--text-2);
  white-space: nowrap;
}
.chip b { color: var(--text); font-weight: 600; }
.chip-active {
  background: var(--accent-soft); border-color: var(--accent);
  color: var(--accent-deep); font-weight: 600;
}
.chip-active .num { color: var(--accent-deep); }
.frozen-chip { background: var(--warn-bg); color: var(--warn); border-color: transparent; font-size: 11px; vertical-align: 3px; margin-left: 6px; }

/* progress bar */
.meter { display: flex; align-items: center; gap: 8px; min-width: 90px; }
.meter .bar { flex: 1; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.meter .bar i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.meter .val { font-size: 11.5px; color: var(--text-2); width: 34px; text-align: right; }
.meter.good .bar i { background: var(--good); }
.meter.warn .bar i { background: #e0a316; }
.meter.bad .bar i { background: var(--bad); }

/* stage dots */
.stagedots { display: inline-flex; gap: 3px; align-items: center; }
.stagedots i { width: 9px; height: 9px; border-radius: 2.5px; background: var(--surface-2);
  border: 1px solid var(--border-strong); }
.stagedots i.on { background: var(--accent); border-color: var(--accent); }
.stagedots i.cur { background: var(--accent); border-color: var(--accent-deep);
  box-shadow: 0 0 0 2.5px var(--accent-soft); }

/* ============ filters / forms ============ */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.input, .select {
  font: inherit; font-size: 13px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 8px; padding: 7px 11px; outline: none;
}
.input:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* a11y (Issue #23) */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 1000;
  background: var(--accent); color: #fff; padding: 8px 14px;
  border-radius: 0 0 8px 0; font-size: 13px; text-decoration: none;
}
.skip-link:focus { left: 0; }
.input { width: 230px; }
.select { cursor: pointer; }
.count-note { font-size: 12px; color: var(--text-3); margin-left: auto; }

/* pagination */
.pager { display: flex; gap: 6px; align-items: center; justify-content: flex-end; margin-top: 14px; }
.pager button {
  font: inherit; font-size: 12.5px; padding: 5px 12px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 7px;
  color: var(--text);
}
.pager button:disabled { opacity: .4; cursor: default; }
.pager button:not(:disabled):hover { border-color: var(--accent); color: var(--accent); }
.pager .pinfo { font-size: 12px; color: var(--text-2); margin: 0 6px; }

/* buttons / links */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  background: var(--accent); color: #fff; border: none;
  border-radius: 8px; padding: 8px 16px; text-decoration: none;
}
.btn:hover { background: var(--accent-deep); }
.btn.ghost { background: var(--surface); color: var(--accent); border: 1px solid var(--border-strong); }
.btn.ghost:hover { border-color: var(--accent); background: var(--accent-soft); }
a.plain { color: var(--accent); text-decoration: none; font-weight: 600; }
a.plain:hover { text-decoration: underline; }

/* ============ playbook stepper ============ */
.pb-selectors { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.pb-selectors label { font-size: 12px; color: var(--text-2); font-weight: 600; display: block; margin-bottom: 4px; }
.stage-rail { display: flex; gap: 0; margin-bottom: 22px; border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.stage-rail .st {
  flex: 1; padding: 12px 14px; border-right: 1px solid var(--border); cursor: pointer; min-width: 0;
}
.stage-rail .st:last-child { border-right: none; }
.stage-rail .st:hover { background: var(--surface-2); }
.stage-rail .st .n { font-size: 10.5px; color: var(--text-3); font-weight: 700; letter-spacing: .06em; }
.stage-rail .st .t { font-size: 13px; font-weight: 700; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage-rail .st .d { font-size: 11px; color: var(--text-3); margin-top: 1px; }
.stage-rail .st.hot { background: var(--accent-soft); box-shadow: inset 0 -3px 0 var(--accent); }

.pb-stage { margin-bottom: 18px; scroll-margin-top: 16px; }
.pb-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.pb-num {
  width: 30px; height: 30px; border-radius: 50%; flex: none; align-self: center;
  background: var(--accent); color: #fff; font-weight: 800; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.pb-title { font-size: 16px; font-weight: 700; }
.pb-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.pb-approach { margin: 12px 0 4px; font-size: 13.5px; color: var(--text); }
.pb-role { margin-top: 8px; font-size: 12.5px; color: var(--text-2); background: var(--surface-2);
  border-radius: 8px; padding: 9px 12px; }
.pb-role b { color: var(--text); }
.pb-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 14px; }
.pb-col h4 { font-size: 11.5px; color: var(--text-2); font-weight: 700; letter-spacing: .03em;
  margin-bottom: 7px; display: flex; align-items: center; gap: 5px; }
.pb-col ul { list-style: none; }
.pb-col li { font-size: 12.5px; padding: 4px 0 4px 14px; position: relative; color: var(--text); }
.pb-col li::before { content: ""; position: absolute; left: 0; top: 11px; width: 5px; height: 5px;
  border-radius: 50%; background: var(--border-strong); }
.pb-col.risks li::before { background: #e0a316; }
.pb-col.kpis li::before { background: var(--good); }
.success-wrap { display: flex; align-items: center; gap: 8px; }

/* ============ industries ============ */
.ind-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.ind-card { cursor: pointer; transition: border-color .12s; display: flex; flex-direction: column; gap: 8px; }
.ind-card:hover { border-color: var(--accent); }
.ind-top { display: flex; align-items: baseline; gap: 8px; }
.ind-name { font-size: 15px; font-weight: 700; }
.ind-en { font-size: 11px; color: var(--text-3); }
.ind-desc { font-size: 12.5px; color: var(--text-2); flex: 1; }
.ind-note { font-size: 12px; color: var(--text); background: var(--surface-2); border-radius: 7px; padding: 7px 10px; }
.ind-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mat { display: inline-flex; gap: 2.5px; }
.mat i { width: 12px; height: 5px; border-radius: 2px; background: var(--surface-2); border: 1px solid var(--border); }
.mat i.on { background: var(--accent); border-color: var(--accent); }

/* ============ detail pages ============ */
.detail-head { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.detail-title { font-size: 21px; font-weight: 700; }
.detail-badges { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 6px; }
.info-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 16px; }
.info-grid .kv { padding: 9px 0; border-bottom: 1px solid var(--border); }
.kv .k { font-size: 11px; color: var(--text-3); font-weight: 600; }
.kv .v { font-size: 13.5px; font-weight: 600; margin-top: 1px; }

/* stage stepper (client detail) */
.stepper { display: flex; gap: 6px; }
.stepper .sp { flex: 1; text-align: center; position: relative; padding-top: 20px; }
.stepper .sp::before {
  content: ""; position: absolute; top: 6px; left: 0; right: 0; height: 4px;
  background: var(--surface-2); border-radius: 2px;
}
.stepper .sp.done::before { background: var(--accent); }
.stepper .sp.cur::before { background: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.stepper .sp .nm { font-size: 11px; color: var(--text-3); font-weight: 600; }
.stepper .sp.cur .nm { color: var(--accent-deep); font-weight: 700; }
.stepper .sp.done .nm { color: var(--text-2); }

/* milestones */
.ms-list { list-style: none; }
.ms-list li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.ms-list li:last-child { border-bottom: none; }
.ms-ic { width: 18px; height: 18px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; font-size: 11px; }
.ms-done .ms-ic { background: var(--good-bg); color: var(--good); }
.ms-progress .ms-ic { background: var(--info-bg); color: var(--accent-deep); }
.ms-pending .ms-ic { background: var(--surface-2); color: var(--text-3); }
.ms-date { margin-left: auto; color: var(--text-3); font-size: 11.5px; white-space: nowrap; }

/* activity feed */
.feed { list-style: none; }
.feed li { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.feed li:last-child { border-bottom: none; }
.feed .f-type { flex: none; font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 5px;
  background: var(--surface-2); color: var(--text-2); height: fit-content; margin-top: 1px; white-space: nowrap; }
.feed .f-body { min-width: 0; }
.feed .f-note { color: var(--text); }
.feed .f-meta { font-size: 11px; color: var(--text-3); margin-top: 1px; }

/* skill chips */
.skills { display: flex; gap: 5px; flex-wrap: wrap; }
.skill { font-size: 11px; background: var(--accent-soft); color: var(--accent-deep);
  border-radius: 5px; padding: 2px 7px; font-weight: 600; white-space: nowrap; }
.skill.lo { background: var(--surface-2); color: var(--text-2); }

/* ============ charts ============ */
.chart-wrap { position: relative; }
.chart-wrap svg { display: block; width: 100%; height: auto; }
.chart-note { font-size: 11px; color: var(--text-3); margin-top: 8px; }
.legend { display: flex; flex-direction: column; gap: 7px; }
.legend .lg { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.legend .sw { width: 11px; height: 11px; border-radius: 3.5px; flex: none; }
.legend .lv { margin-left: auto; font-weight: 700; }
.legend .lp { color: var(--text-3); font-size: 11px; width: 44px; text-align: right; }
.donut-flex { display: flex; align-items: center; gap: 22px; }
.donut-flex .chart-wrap { flex: none; width: 180px; }

.tooltip {
  position: fixed; z-index: 50; pointer-events: none;
  background: #1d1d1b; color: #f3f3f0; font-size: 12px; line-height: 1.45;
  border-radius: 7px; padding: 7px 10px; box-shadow: 0 4px 14px rgba(0,0,0,.25);
  max-width: 260px;
}
.tooltip b { color: #fff; }
.tooltip .tt-sub { color: #b9b8b2; font-size: 11px; }

/* horizontal bars (direct labels) */
.hb-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 12px; }
.hb-lab { width: 130px; flex: none; color: var(--text-2); white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; text-align: right; }
.hb-track { flex: 1; height: 14px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.hb-track i { display: block; height: 100%; background: var(--c1); border-radius: 4px; }
.hb-val { width: 82px; flex: none; text-align: right; font-weight: 600; }

/* heatmap */
.heat { display: grid; gap: 3px; font-size: 11px; }
.heat .hcell {
  border-radius: 5px; min-height: 34px; display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 11.5px; cursor: default;
}
.heat .hlab { display: flex; align-items: center; font-size: 11px; color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 6px; justify-content: flex-end; }
.heat .hcol { display: flex; align-items: flex-end; justify-content: center; text-align: center;
  font-size: 10.5px; color: var(--text-2); padding-bottom: 4px; line-height: 1.25; }

/* ============ roleplay ============ */
.rp-controls { padding: 16px 20px; }
.rp-ctrl-row { display: flex; gap: 22px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.rp-ctrl-row label { font-size: 12px; color: var(--text-2); font-weight: 600; display: block; margin-bottom: 4px; }
.rp-roles { display: flex; gap: 6px; flex-wrap: wrap; }
.rp-role {
  font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 999px; padding: 6px 13px; color: var(--text-2);
}
.rp-role:hover { border-color: var(--accent); color: var(--accent); }
.rp-role.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.rp-stagebar { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.rp-phase { flex: 1; min-width: 0; }
.rp-phase-name { font-size: 10.5px; font-weight: 700; color: var(--text-3); letter-spacing: .05em; margin-bottom: 4px; }
.rp-phase-items { display: flex; gap: 4px; }
.rp-st {
  font: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer; flex: 1;
  display: flex; align-items: center; gap: 5px; justify-content: center;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 7px; padding: 6px 7px; color: var(--text-2); white-space: nowrap;
}
.rp-st i { font-style: normal; font-size: 10px; font-weight: 800; color: var(--text-3);
  background: var(--surface); border-radius: 4px; padding: 0 4px; }
.rp-st:hover { border-color: var(--accent); color: var(--accent); }
.rp-st.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.rp-st.on i { background: rgba(255,255,255,.22); color: #fff; }
.rp-scene { font-size: 13px; background: var(--surface-2); border-radius: 8px; padding: 10px 13px; }
.rp-goal { font-size: 12.5px; color: var(--text-2); margin-top: 9px; }
.rp-goal b { color: var(--text); }
.rp-chat { display: flex; flex-direction: column; gap: 14px; }
.rp-turn { max-width: 88%; }
.rp-turn.fde { align-self: flex-start; }
.rp-turn.client { align-self: flex-end; }
.rp-who { font-size: 11px; font-weight: 700; color: var(--text-3); margin-bottom: 3px; }
.rp-turn.client .rp-who { text-align: right; }
.rp-bubble {
  font-size: 13px; line-height: 1.65; padding: 11px 14px; border-radius: 12px;
  background: var(--accent-soft); border: 1px solid #cfe0f5; border-top-left-radius: 4px;
}
.rp-turn.client .rp-bubble {
  background: var(--surface-2); border-color: var(--border);
  border-top-left-radius: 12px; border-top-right-radius: 4px;
}
.rp-note { font-size: 11.5px; color: var(--warn); background: var(--warn-bg);
  border-radius: 7px; padding: 6px 10px; margin-top: 5px; line-height: 1.5; }
.rp-turn.client .rp-note { color: var(--text-2); background: var(--neutral-bg); }
.rp-obj { border-bottom: 1px solid var(--border); padding: 4px 0; }
.rp-obj:last-child { border-bottom: none; }
.rp-obj summary {
  cursor: pointer; font-size: 13px; font-weight: 600; padding: 8px 4px;
  list-style: none; position: relative; padding-right: 26px;
}
.rp-obj summary::-webkit-details-marker { display: none; }
.rp-obj summary::after { content: "+"; position: absolute; right: 8px; top: 6px;
  color: var(--text-3); font-size: 16px; font-weight: 700; }
.rp-obj[open] summary::after { content: "−"; }
.rp-obj summary:hover { color: var(--accent); }
.rp-obj-a { font-size: 12.5px; line-height: 1.7; background: var(--accent-soft);
  border-radius: 8px; padding: 10px 13px; margin: 2px 4px 8px; }
.rp-obj-t { font-size: 11.5px; font-weight: 600; color: var(--good);
  margin: 0 4px 10px; }
.rp-p-head { display: flex; gap: 12px; align-items: center; margin: 8px 0 10px; }
.rp-avatar { width: 44px; height: 44px; border-radius: 50%; flex: none; font-size: 22px;
  background: var(--surface-2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; }
.rp-p-name { font-size: 15px; font-weight: 700; }
.rp-p-name small { font-size: 11.5px; color: var(--text-3); font-weight: 500; }
.rp-p-title { font-size: 12px; color: var(--text-2); }
.rp-quote { font-size: 13px; font-weight: 600; color: var(--accent-deep);
  background: var(--accent-soft); border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0; padding: 9px 12px; margin-bottom: 10px; }
.rp-h4 { font-size: 11.5px; color: var(--text-2); font-weight: 700; letter-spacing: .03em;
  margin: 12px 0 6px; }
.rp-list { list-style: none; }
.rp-list li { font-size: 12.5px; padding: 4px 0 4px 14px; position: relative; }
.rp-list li::before { content: ""; position: absolute; left: 0; top: 11px; width: 5px; height: 5px;
  border-radius: 50%; background: var(--border-strong); }
.rp-list.tips li::before { background: var(--good); }

/* ============ sidebar search & theme ============ */
.side-search {
  margin: 2px 10px 6px; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font: inherit; font-size: 12.5px; color: var(--side-text); cursor: pointer;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px; padding: 7px 12px;
}
.side-search:hover { color: #dfe5ef; border-color: rgba(255,255,255,.28); }
.kbd { font-size: 10px; font-weight: 700; border: 1px solid rgba(255,255,255,.22);
  border-radius: 4px; padding: 0 5px; opacity: .8; }
.theme-btn {
  margin-left: auto; font: inherit; font-size: 14px; cursor: pointer;
  background: none; border: 1px solid rgba(255,255,255,.16); border-radius: 7px; padding: 3px 8px;
}
.theme-btn:hover { border-color: rgba(255,255,255,.45); }

/* ============ command palette ============ */
.palette-overlay {
  position: fixed; inset: 0; z-index: 60; background: rgba(8, 10, 16, .48);
  display: flex; justify-content: center; align-items: flex-start; padding-top: 11vh;
}
.palette-overlay[hidden] { display: none; }
.palette {
  width: min(640px, 92vw); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: 12px;
  box-shadow: 0 18px 60px rgba(0,0,0,.38); overflow: hidden;
}
.palette input {
  width: 100%; font: inherit; font-size: 15px; padding: 15px 18px;
  border: none; outline: none; background: transparent; color: var(--text);
  border-bottom: 1px solid var(--border);
}
.pal-results { max-height: 54vh; overflow-y: auto; padding: 6px; }
.pal-group { font-size: 10.5px; font-weight: 700; color: var(--text-3); letter-spacing: .05em; padding: 8px 12px 3px; }
.pal-item { display: flex; align-items: baseline; gap: 10px; padding: 8px 12px;
  border-radius: 7px; cursor: pointer; font-size: 13.5px; }
.pal-item .pal-main { font-weight: 600; }
.pal-item .pal-sub { font-size: 11.5px; color: var(--text-3); margin-left: auto; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 55%; }
.pal-item .pal-sub mark { background: var(--accent-soft); color: var(--accent-deep, inherit);
  border-radius: 3px; padding: 0 2px; font-weight: 600; }
.pal-item:hover, .pal-item.sel { background: var(--accent-soft); }
.pal-empty { color: var(--text-3); font-size: 12.5px; padding: 22px; text-align: center; }

/* ============ dashboard alerts ============ */
.alert-card { border-left: 3px solid var(--warn); }
.alert-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.alert-cols h4 { font-size: 11.5px; color: var(--text-2); font-weight: 700; margin-bottom: 5px; }
.alert-list { list-style: none; }
.alert-list li { display: flex; gap: 10px; align-items: center; justify-content: space-between;
  font-size: 12.5px; padding: 5.5px 0; border-bottom: 1px solid var(--border); }
.alert-list li:last-child { border-bottom: none; }
.alert-list .meter { min-width: 70px; max-width: 90px; }

/* ============ roleplay tools ============ */
.rp-tools { display: flex; align-items: flex-start; gap: 12px; }
.rp-tool-btns { margin-left: auto; display: flex; gap: 8px; flex: none; }
.btn.sm { font-size: 12px; padding: 5px 11px; }
.btn.ghost.on { border-color: var(--accent); background: var(--accent-soft); }
.rp-practice-note { font-size: 12px; color: var(--warn); background: var(--warn-bg);
  border-radius: 7px; padding: 7px 11px; margin-bottom: 12px; }
.rp-turn.masked { cursor: pointer; }
.rp-turn.masked .rp-bubble, .rp-turn.masked .rp-note {
  filter: blur(6px); user-select: none; opacity: .75;
}
.rp-turn.masked:hover .rp-bubble { outline: 2px dashed var(--accent); outline-offset: 2px; }

/* dark-mode fine tuning */
:root[data-theme="dark"] .rp-bubble { border-color: #2c4265; }
:root[data-theme="dark"] .badge.k-active { background: #173321; color: #5ad189; }
:root[data-theme="dark"] .badge.k-done { background: #262c39; color: #9aa1b0; }
:root[data-theme="dark"] .badge.k-pipeline { color: #8ab6f0; }
:root[data-theme="dark"] .tooltip { background: #05070b; border: 1px solid #2b3140; }

/* empty */
.empty { color: var(--text-3); font-size: 13px; padding: 26px; text-align: center; }

/* ============ notes & inline edit ============ */
.note-form { display: grid; gap: 8px; margin: 10px 0 14px; }
.note-form .input {
  width: 100%; box-sizing: border-box; font: inherit; font-size: 13px;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface-1, #fff); color: var(--text-1, inherit);
}
.note-form textarea.input { resize: vertical; min-height: 44px; }
.note-form .btn { justify-self: start; }
.note-list { list-style: none; margin: 0; padding: 0; }
.note-list .note { padding: 10px 2px; border-top: 1px solid var(--border); }
.note-body { font-size: 13px; white-space: pre-wrap; word-break: break-word; }
.note-meta { display: flex; justify-content: space-between; align-items: center;
  margin-top: 5px; font-size: 11.5px; color: var(--text-3); }
.note-del { border: none; background: none; color: var(--text-3); font-size: 11.5px;
  cursor: pointer; padding: 2px 4px; border-radius: 5px; }
.note-del:hover { color: var(--bad, #d34a4a); background: var(--bad-bg, rgba(211,74,74,.1)); }

.edit-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.edit-form .fld { display: grid; gap: 4px; font-size: 11.5px; color: var(--text-2); font-weight: 600; }
.edit-form .select, .edit-form .input {
  width: 100%; box-sizing: border-box; font: inherit; font-size: 13px;
  padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface-1, #fff); color: var(--text-1, inherit);
}
.edit-row { grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; }
.edit-msg { font-size: 12px; color: var(--text-2); }
.edit-msg.ok { color: var(--good, #3fa45b); }
.edit-msg.ng { color: var(--bad, #d34a4a); }

@media (max-width: 1180px) {
  .g-kpi { grid-template-columns: repeat(2, 1fr); }
  .g-2, .g-3, .g-main-side { grid-template-columns: 1fr; }
  .pb-cols { grid-template-columns: 1fr 1fr; }
  .ind-grid { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr 1fr; }
}

/* ==== mobile / tablet (Issue #21): off-canvas sidebar + 1カラム化 ==== */
.btn-menu { display: none; }
.nav-backdrop[hidden] { display: none; }
@media (max-width: 900px) {
  .btn-menu {
    display: flex; align-items: center; justify-content: center;
    position: fixed; top: 12px; right: 12px; z-index: 210;
    width: 42px; height: 42px; border-radius: 10px; cursor: pointer;
    border: 1px solid var(--border-strong); background: var(--surface);
    color: var(--text); font-size: 19px; line-height: 1;
    box-shadow: 0 4px 14px rgba(0,0,0,.18);
  }
  .sidebar {
    position: fixed; top: 0; left: 0; height: 100vh; height: 100dvh;
    width: min(280px, 84vw); z-index: 200;
    transform: translateX(-102%); transition: transform .22s ease;
  }
  body.nav-open .sidebar { transform: translateX(0); box-shadow: 12px 0 40px rgba(0,0,0,.35); }
  .nav-backdrop { position: fixed; inset: 0; z-index: 190; background: rgba(8,10,16,.44); }
  .main { padding: 16px 12px 48px; }
  .g-kpi, .g-2, .g-3, .g-main-side, .pb-cols, .info-grid, .alert-cols, .ind-grid,
  .grid2, .grid-2, .cms-grid, .gen-grid, .gd-picker, .drill-grid { grid-template-columns: 1fr; }
  .page-title { font-size: 19px; padding-right: 52px; }
  .detail-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .tbl { display: block; overflow-x: auto; }
  .edit-form, .crud-form { grid-template-columns: 1fr; }
  .stat-strip .stat { min-width: 45%; }
}

/* ==== stat strip (list summary) ==== */
.stat-strip { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.stat-strip .stat { flex: 1; min-width: 130px; background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px; padding: 9px 13px; display: flex; flex-direction: column; gap: 3px; }
.stat-strip .s-label { font-size: 11px; color: var(--text-3); letter-spacing: .02em; }
.stat-strip .s-value { font-size: 16.5px; font-weight: 700; color: var(--text-1, var(--text)); }
.stat-strip .stat.good .s-value { color: #2e9e60; }
.stat-strip .stat.warn .s-value { color: #b98a1c; }
.stat-strip .stat.bad .s-value { color: #c94f42; }
@media (max-width: 900px) { .stat-strip .stat { min-width: 45%; } }

/* ============ CRUD panels ============ */
.crud { max-width: 880px; margin: 18px auto 0; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-1); }
.crud summary { cursor: pointer; padding: 11px 16px; font-size: 13px; font-weight: 600; color: var(--accent); list-style: none; }
.crud summary::-webkit-details-marker { display: none; }
.crud summary:hover { background: var(--surface-2); border-radius: 10px; }
.crud[open] summary { border-bottom: 1px solid var(--border); }
.crud-form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 14px; padding: 14px 16px 16px; }
.crud-form .edit-row { grid-column: 1 / -1; }
.crud-danger { max-width: 880px; margin: 14px auto 0; padding: 12px 16px; border: 1px dashed var(--bad, #c0392b); border-radius: 10px; display: flex; align-items: center; gap: 12px; }
.btn.danger { background: transparent; color: #c0392b; border: 1px solid #c0392b; }
.btn.danger:hover { background: #c0392b; color: #fff; }
.btn.sm { padding: 2px 8px; font-size: 11px; }
@media (max-width: 720px) { .crud-form { grid-template-columns: 1fr; } }

/* ============ CMS ============ */
.cms-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.cms-grid textarea { font-size: 12px; line-height: 1.55; resize: vertical; }
.rev-list { list-style: none; margin: 0; padding: 0; }
.rev { padding: 10px 2px; border-bottom: 1px solid var(--border); }
.rev:last-child { border-bottom: none; }
.rev-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.rev-head .rev-restore { margin-left: auto; padding: 2px 10px; font-size: 11px; }
.rev-snap { margin-top: 4px; font-size: 11.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 720px) { .cms-grid { grid-template-columns: 1fr; } }

/* ============ guide / generations / rookie ============ */
.nav-badge { margin-left: auto; background: var(--accent-soft); color: var(--accent-deep); font-size: 10px; padding: 1px 6px; border-radius: 8px; font-weight: 700; }
.gd-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.gd-picker .fld span { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 4px; font-weight: 600; }
.gd-actions { margin: 10px 0 12px; padding-left: 22px; }
.gd-actions li { margin: 6px 0; line-height: 1.65; }
.gd-links { display: flex; gap: 8px; flex-wrap: wrap; }
.gd-sec { font-size: 11.5px; font-weight: 700; color: var(--text-2); margin: 12px 0 4px; letter-spacing: .04em; }
.gd-list { padding-left: 18px; margin: 4px 0; }
.gd-list li { margin: 4px 0; line-height: 1.6; font-size: 13px; }
.gd-progress { height: 6px; background: var(--surface-2); border-radius: 3px; margin: 8px 0 12px; overflow: hidden; }
.gd-progress i { display: block; height: 100%; background: var(--series-1, #2a78d6); border-radius: 3px; transition: width .25s; }
.gd-ck { list-style: none; padding: 0; margin: 0; }
.gd-ck li { border-bottom: 1px solid var(--border); }
.gd-ck li:last-child { border-bottom: none; }
.gd-ck label { display: flex; gap: 10px; padding: 9px 4px; cursor: pointer; align-items: flex-start; }
.gd-ck input { margin-top: 3px; flex: none; }
.gd-ck li.ng { background: color-mix(in srgb, #d34a4a 6%, transparent); border-radius: 6px; }
.gd-why { display: block; color: var(--text-3); font-size: 11.5px; margin-top: 2px; }
.gd-ck input:checked + span { opacity: .55; text-decoration: line-through; }
.gd-ck input:checked + span .gd-why { text-decoration: none; }
.gen-tag { display: inline-block; font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 9px; color: #fff; flex: none; }
.gen-tag.g10 { background: #8c8c86; }
.gen-tag.g20 { background: #2a78d6; }
.gen-tag.g30 { background: #8461c9; }
.gd-gen { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); align-items: flex-start; }
.gd-gen:last-of-type { border-bottom: none; }
.gd-gen-sign { font-size: 13px; font-weight: 600; line-height: 1.5; }
.gd-gen-talk { font-size: 12px; color: var(--text-2); margin-top: 2px; line-height: 1.5; }
.gd-ex { list-style: none; padding: 0; margin: 0; }
.gd-ex li { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--border); }
.gd-ex li:last-child { border-bottom: none; }
.gen-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.gen-card { display: flex; flex-direction: column; }
.gen-head { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.gen-name { font-weight: 800; font-size: 15px; }
.gen-era { font-size: 12px; color: var(--text-2); }
.gen-sum { font-size: 13px; line-height: 1.7; margin: 4px 0 2px; }
.gen-p { font-size: 12.5px; line-height: 1.6; margin: 2px 0; color: var(--text-1, inherit); }
.gen-quote { margin-top: auto; padding: 10px 12px; background: var(--surface-2); border-left: 3px solid var(--accent-deep); border-radius: 6px; font-size: 12.5px; line-height: 1.6; margin-top: 12px; }
.gen-sign { font-size: 12px; color: var(--text-2); margin-top: 8px; }
.diag-q { margin-bottom: 14px; }
.diag-t { font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.diag-o { display: flex; gap: 8px; padding: 5px 6px; border-radius: 6px; cursor: pointer; font-size: 13px; line-height: 1.5; align-items: flex-start; }
.diag-o:hover { background: var(--surface-2); }
.diag-o input { margin-top: 3px; flex: none; }
.diag-result { margin-top: 14px; padding: 14px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface-2); }
.diag-score { font-size: 15px; margin-bottom: 6px; }
.diag-score > b:first-child { font-size: 22px; }
.dist-row { display: flex; align-items: center; gap: 10px; margin: 5px 0; }
.dist-l { width: 30px; text-align: right; font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.dist-bar { flex: 1; height: 14px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.dist-bar i { display: block; height: 100%; background: linear-gradient(90deg, #8c8c86, #2a78d6 55%, #8461c9); border-radius: 4px; }
.dist-n { width: 70px; font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.drill-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.drill { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.drill summary { cursor: pointer; font-size: 13px; font-weight: 600; }
.drill-out { margin: 10px 0 8px; padding: 10px; background: var(--surface-2); border-radius: 8px; font-size: 12.5px; line-height: 1.6; font-family: ui-monospace, monospace; }
.drill-flaw { font-size: 12.5px; line-height: 1.6; color: #c0392b; margin-bottom: 4px; }
.drill-les { font-size: 12.5px; line-height: 1.6; }
.fable-note p { font-size: 13px; line-height: 1.75; }
.gls { border-bottom: 1px dotted var(--accent-deep); cursor: help; }
body.rookie .nav a[data-view="cms"], body.rookie .nav a[data-view="analytics"], body.rookie .nav a[data-view="engineers"] { display: none; }
body.rookie .nav a[data-view="connections"], body.rookie .nav a[data-view="pipelines"] { display: none; }
body.rookie .nav a[data-view="guide"] { background: var(--accent-soft); }
@media (max-width: 1100px) { .gen-grid, .gd-picker, .drill-grid { grid-template-columns: 1fr; } }

/* ============ 知識資産図鑑 (v2.0/K1) ============ */
.nav-sec { margin: 12px 12px 3px; font-size: 10px; font-weight: 700; letter-spacing: .1em; color: var(--side-text); opacity: .55; text-transform: uppercase; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.chips .chip b { margin-left: 2px; }
a.chip { text-decoration: none; cursor: pointer; }
a.chip:hover { border-color: var(--accent); color: var(--accent); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.diff { color: var(--accent); letter-spacing: 2px; font-size: 10.5px; white-space: nowrap; }
.diff.warn { color: #d9822b; }
.diff.bad { color: #d34a4a; }
.mdblock p { font-size: 13px; line-height: 1.7; margin: 6px 0; }
.md-step { display: flex; gap: 9px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px; line-height: 1.6; }
.md-step:last-child { border-bottom: none; }
.md-no { flex: none; width: 21px; height: 21px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-deep); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 11px; transform: translateY(3px); }
.md-li { font-size: 13px; line-height: 1.7; padding: 2px 0; }
.req-pre { white-space: pre-wrap; word-break: break-word; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; font-size: 12.5px; line-height: 1.75; font-family: inherit; margin: 8px 0 10px; max-height: 340px; overflow-y: auto; }
.callout.warn { background: var(--warn-bg); border: 1px solid rgba(217,130,43,.35); border-radius: 8px; padding: 10px 12px; font-size: 12.5px; line-height: 1.6; }
.stack-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.stack-card { cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.stack-card:hover { border-color: var(--accent); box-shadow: 0 2px 10px rgba(42,120,214,.12); }
.trb { padding: 0; margin-bottom: 10px; }
.trb summary { padding: 13px 16px; cursor: pointer; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.trb summary::-webkit-details-marker { display: none; }
.trb[open] summary { border-bottom: 1px solid var(--border); }
.trb-body { padding: 4px 16px 14px; }
.trb-body p { font-size: 13px; line-height: 1.7; margin: 8px 0 4px; }
.trb-mini { list-style: none; margin: 0; padding: 0; }
.trb-mini li { padding: 9px 2px; border-bottom: 1px solid var(--border); font-size: 13px; line-height: 1.7; }
.trb-mini li:last-child { border-bottom: none; }
.trb-mini li.rowlink-li { cursor: pointer; }
.trb-mini li.rowlink-li:hover { background: var(--surface-2); }
.trb-mini .chip { margin-left: 6px; }
@media (max-width: 1100px) { .grid2 { grid-template-columns: 1fr; } }

/* ---- 依存DAG (v3.0/K3) ---- */
.dag-wrap { overflow-x: auto; padding: 10px 4px 6px; }
.dag-svg { display: block; }
.dag-edge { fill: none; stroke: var(--border-strong); stroke-width: 1.5; }
.dag-arw { fill: var(--border-strong); }
.dag-node { cursor: pointer; }
.dag-node rect { fill: var(--surface); stroke: var(--border); stroke-width: 1.2; transition: all .12s; }
.dag-node:hover rect { stroke: var(--accent-deep); fill: var(--accent-soft); }
.dag-node .dag-name { font-size: 12.5px; font-weight: 600; fill: var(--text); }
.dag-node .dag-id { font-size: 10.5px; fill: var(--text-3); }
.dag-self rect { fill: var(--accent-soft); stroke: var(--accent-deep); stroke-width: 1.6; }
.dag-self { cursor: default; }
.dag-self .dag-name, .dag-self .dag-id { fill: var(--accent-deep); }

/* ---- hearings (v2.5/K2-1) ---- */
.hform{display:flex;flex-direction:column;gap:16px}
.hq-label{font-weight:600;font-size:13px;margin-bottom:7px}
.hq-id{display:inline-block;background:var(--surface-2);border:1px solid var(--border);border-radius:4px;padding:1px 5px;font-size:10.5px;color:var(--text-3);margin-right:4px;vertical-align:1px}
.req{color:#d43c3c;font-weight:700}
.hq-opts{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.hq-opt input{position:absolute;opacity:0;width:0;height:0}
.hq-opt span{display:inline-block;padding:6px 13px;border:1px solid var(--border);border-radius:999px;font-size:12.5px;cursor:pointer;background:var(--surface-1);color:var(--text-2);transition:all .12s}
.hq-opt input:checked+span{background:var(--accent-soft);border-color:var(--accent-deep);color:var(--accent-deep);font-weight:600}
.hq-opt span:hover{border-color:var(--border-strong)}
.hq-free{max-width:340px}
.form-foot{display:flex;gap:10px;align-items:center;margin-top:4px}
.form-err{color:#d43c3c;font-size:12.5px}
.grid-2{display:grid;grid-template-columns:1.4fr 1fr;gap:14px;align-items:start}
.grid-2>div>.card{margin-bottom:14px}
@media(max-width:1100px){.grid-2{grid-template-columns:1fr}}

/* ---- 入口B: 運用マトリクス (v3.0/K4) ---- */
.mx-tbl td{padding:6px 8px}
.mx-td{text-align:center}
.mx-none{color:var(--text-3);text-align:center}
.mx-cell{width:30px;height:24px;border:1px solid transparent;border-radius:6px;
  font-size:11px;font-weight:700;cursor:pointer;font-family:inherit}
.mx-cell:hover{border-color:var(--accent);transform:scale(1.12)}
.rep-todo{background:var(--bad-bg);color:#c62828}
.rep-draft{background:var(--warn-bg);color:#8a6d00}
.rep-approved{background:var(--info-bg);color:#1565c0}
.rep-sent{background:var(--good-bg);color:#1b7a3d}
.chip.rep-todo,.chip.rep-draft,.chip.rep-approved,.chip.rep-sent{border-color:transparent}
.badge.eg-daiko{background:var(--accent-soft);color:var(--accent-deep)}
.badge.eg-kyoiku{background:var(--info-bg);color:#1565c0}
.badge.eg-hosho{background:var(--warn-bg);color:#8a6d00}
.kv{display:flex;justify-content:space-between;gap:12px;padding:5px 0;border-bottom:1px solid var(--border);font-size:12.5px}
.kv:last-of-type{border-bottom:none}
.kv .k{color:var(--text-2)}

/* ---- 運用ボード(Issue #9) ---- */
.ops-q-item { padding: 9px 0; border-bottom: 1px solid var(--border); }
.ops-q-item:last-child { border-bottom: none; }
.ops-q-item .cell-sub { white-space: normal; line-height: 1.55; }
.ops-q-act { display: flex; gap: 8px; margin-top: 6px; align-items: center; }
.st-chip { cursor: pointer; border: 1px solid transparent; }
.st-chip:hover { filter: brightness(0.96); }
.chip-on { outline: 2px solid var(--accent); outline-offset: 1px; }
.mx-tbl .cell-main a { color: inherit; text-decoration: none; border-bottom: 1px dashed var(--border-strong); }
.mx-tbl .cell-main a:hover { color: var(--accent); border-bottom-color: var(--accent); }
/* ===== 環境台帳 (Issue #10) ===== */
.chip-warn { background: var(--warn-bg); color: #b8860b; }
[data-theme="dark"] .chip-warn { color: #e8c35a; }
.chip-bad { background: var(--bad-bg); color: #c0392b; }
[data-theme="dark"] .chip-bad { color: #f08a7e; }
.chip-dim { background: var(--neutral-bg); color: var(--text-2); }
.row-warn td { background: var(--warn-bg); }
.row-expired td { color: var(--text-3); }
.row-expired .cell-main { text-decoration: line-through; }
.modal-overlay { position: fixed; inset: 0; background: rgba(10,14,20,.55); display: flex; align-items: center; justify-content: center; z-index: 300; }
.modal { background: var(--surface-1, #fff); border: 1px solid var(--border); border-radius: 12px; width: min(680px, 92vw); max-height: 86vh; display: flex; flex-direction: column; padding: 14px; gap: 10px; box-shadow: 0 18px 50px rgba(0,0,0,.28); }
[data-theme="dark"] .modal { background: #10151d; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13.5px; }
.modal-text { flex: 1; min-height: 320px; resize: vertical; font-size: 12.5px; line-height: 1.75; white-space: pre-wrap; }
.modal-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
/* ===== 認証UI (Issue #17) ===== */
.login-overlay { position: fixed; inset: 0; z-index: 4000; display: flex; align-items: center; justify-content: center; background: var(--bg, #f4f6f9); }
[data-theme="dark"] .login-overlay { background: #0b0f14; }
.login-card { width: min(400px, 92vw); background: var(--surface-1, #fff); border: 1px solid var(--border); border-radius: 14px; padding: 26px 24px; box-shadow: 0 18px 50px rgba(0,0,0,.18); display: flex; flex-direction: column; gap: 12px; }
[data-theme="dark"] .login-card { background: #10151d; }
.login-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; }
.login-brand .mark { width: 34px; height: 34px; border-radius: 9px; background: var(--accent, #2b6cb0); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 800; }
.login-sub { font-size: 12.5px; color: var(--text-2); margin-bottom: 4px; }
.login-field { display: flex; flex-direction: column; gap: 4px; }
.login-field label { font-size: 11.5px; color: var(--text-2); }
.login-field input { padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13.5px; background: var(--surface-2); color: var(--text-1, inherit); }
.login-field input:focus { outline: 2px solid var(--accent-soft, #bcd7f5); border-color: var(--accent, #2b6cb0); }
.login-btn { margin-top: 6px; padding: 10px; border: none; border-radius: 8px; background: var(--accent, #2b6cb0); color: #fff; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.login-btn:hover { filter: brightness(1.08); }
.login-btn:disabled { opacity: .6; cursor: default; }
.login-err { min-height: 18px; font-size: 12px; color: #c0392b; }
.login-demo { font-size: 11px; color: var(--text-3); line-height: 1.7; border-top: 1px dashed var(--border); padding-top: 8px; }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 999px; font-size: 11.5px; background: var(--surface-2); }
.user-chip .avatar { width: 22px; height: 22px; border-radius: 50%; background: var(--accent, #2b6cb0); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 700; }
.user-chip .role-badge { padding: 1px 7px; border-radius: 999px; background: var(--accent-soft, #e3eefb); color: var(--accent-deep, #1a4e8a); font-weight: 600; font-size: 10.5px; }
.user-chip .logout-btn { border: none; background: none; color: var(--text-2); cursor: pointer; font-size: 11px; padding: 2px 4px; }
.user-chip .logout-btn:hover { color: var(--text-1, inherit); text-decoration: underline; }
.perm-toast { position: fixed; right: 16px; bottom: 16px; z-index: 5000; padding: 10px 14px; border-radius: 9px; background: #2d3436; color: #fff; font-size: 12.5px; box-shadow: 0 8px 24px rgba(0,0,0,.3); opacity: 0; transform: translateY(8px); transition: all .25s; pointer-events: none; }
.perm-toast.show { opacity: 1; transform: translateY(0); }
.login-card h1 { font-size: 19px; font-weight: 800; letter-spacing: .03em; margin-top: 2px; }
.login-logo { width: 44px; height: 44px; border-radius: 11px; background: linear-gradient(135deg, #3b8ae6, #1c5aa8); color: #fff; font-weight: 800; font-size: 24px; display: flex; align-items: center; justify-content: center; }
.login-card .fld { display: flex; flex-direction: column; gap: 4px; }
.login-card .fld span { font-size: 11.5px; color: var(--text-2); font-weight: 600; }
.login-hint { font-size: 11px; color: var(--text-3); line-height: 1.7; border-top: 1px dashed var(--border); padding-top: 10px; margin-top: 4px; }
.login-err:not([hidden]) { font-size: 12px; color: var(--bad); background: var(--bad-bg); border-radius: 7px; padding: 7px 10px; }

/* ============ audit (監査ログ・ゴミ箱) ============ */
.act-badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.act-badge.good { background: var(--good-bg); color: var(--good); border-color: transparent; }
.act-badge.info { background: var(--info-bg); color: var(--accent-deep); border-color: transparent; }
.act-badge.bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.act-badge.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.audit-tbl tr.alog { cursor: pointer; }
.audit-tbl tr.alog:hover td { background: var(--surface-2); }
.alog-path { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; color: var(--text-2); word-break: break-all; }
tr.alog-detail > td { background: var(--surface-2); padding: 10px 14px; }
.diff-tbl { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.diff-tbl th { text-align: left; font-size: 10.5px; color: var(--text-3); padding: 3px 8px; border-bottom: 1px solid var(--border); }
.diff-tbl td { padding: 4px 8px; border-bottom: 1px dashed var(--border); vertical-align: top; }
.diff-tbl td.k { font-weight: 700; color: var(--text-2); white-space: nowrap; }
.diff-tbl td.db { color: var(--bad); text-decoration: line-through; text-decoration-color: rgba(220, 68, 68, .45); }
.diff-tbl td.da { color: var(--good); font-weight: 600; }

/* ============ notifications bell (Issue #19) ============ */
.theme-btn { position: relative; }
.notif-badge { position: absolute; top: -4px; right: -6px; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 8px; background: var(--bad, #e05252); color: #fff; font-size: 9.5px; font-weight: 700; line-height: 15px; text-align: center; pointer-events: none; }
.notif-panel { position: fixed; z-index: 60; width: 330px; max-height: 420px; display: flex; flex-direction: column; background: var(--surface-1, #fff); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,.18); overflow: hidden; }
.notif-head { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.notif-head .notif-unread { color: var(--text-3); font-size: 11px; margin-right: auto; }
.notif-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; }
.notif-item { padding: 8px 12px; border-bottom: 1px dashed var(--border); cursor: pointer; }
.notif-item:hover { background: var(--surface-2); }
.notif-item.unread { background: var(--info-bg, rgba(42,120,214,.06)); }
.notif-item.unread .notif-msg { font-weight: 600; }
.notif-kind { display: inline-block; font-size: 10px; color: var(--accent-deep); border: 1px solid var(--accent-soft); border-radius: 999px; padding: 0 7px; margin-bottom: 3px; }
.notif-msg { font-size: 12.5px; color: var(--text-2); line-height: 1.45; }
.notif-time { font-size: 10.5px; color: var(--text-3); margin-top: 2px; }
.notif-empty { padding: 18px 12px; text-align: center; color: var(--text-3); font-size: 12px; }

/* ============ print (Issue #22) ============ */
.print-only { display: none; }
@media print {
  .sidebar, .mob-topbar, .nav-backdrop, .btn, .palette-overlay, .perm-toast,
  .notif-pop, .chip[data-psort], select.select, .no-print { display: none !important; }
  body { background: #fff !important; color: #000; }
  .main { width: 100%; max-width: none; margin: 0; padding: 0; }
  .card { border-color: #ccc; box-shadow: none; background: #fff; }
  tr { page-break-inside: avoid; }
  svg { max-width: 100% !important; }
  .print-only { display: block; font-size: 16px; font-weight: 700; margin-bottom: 4px; }
  .print-only .print-date { font-size: 11px; font-weight: 400; color: #555; }
}
