/* ============================================================
   AI営業エンジン — スタイル（ライト／ダーク・スマホ対応）
   グラフの色は検証済みのパレット（AIスクール＝青、ガチャ＝橙）。
   状態の色（良い・注意・重い・停止）は必ずアイコンと文字を添える。
   ============================================================ */
:root {
  color-scheme: light;
  --bg: #f3f4f6; --panel: #ffffff; --surface: #fcfcfb; --bg2: #f7f7f5;
  --ink: #0b0b0b; --ink2: #52514e; --muted: #77756f; --line: #e1e0d9; --axis: #c3c2b7;
  --brand: #2a78d6; --brand-ink: #1c5cab; --brand-wash: #e8f1fc;
  --school: #2a78d6; --gacha: #eb6834;
  --good: #0ca30c; --warn: #fab219; --serious: #ec835a; --critical: #d03b3b; --good-text: #006300; --bad-text: #b42f2f;
  --seq-100: #cde2fb; --seq-200: #9ec5f4; --seq-300: #6da7ec; --seq-400: #3987e5; --seq-500: #256abf; --seq-600: #184f95; --seq-700: #0d366b;
  --side: #141a2e; --side-ink: #c9d0e6; --side-muted: #7f8aae;
  --radius: 12px; --shadow: 0 1px 2px rgba(11, 11, 11, .05), 0 4px 14px rgba(11, 11, 11, .04);
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --bg: #0d0d0d; --panel: #161615; --surface: #1a1a19; --bg2: #1f1f1d;
    --ink: #ffffff; --ink2: #c3c2b7; --muted: #9a988f; --line: #2c2c2a; --axis: #383835;
    --brand: #3987e5; --brand-ink: #86b6ef; --brand-wash: #17263b;
    --school: #3987e5; --gacha: #d95926; --good-text: #0ca30c; --bad-text: #e66767;
    --side: #0f1322; --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0d0d; --panel: #161615; --surface: #1a1a19; --bg2: #1f1f1d;
  --ink: #ffffff; --ink2: #c3c2b7; --muted: #9a988f; --line: #2c2c2a; --axis: #383835;
  --brand: #3987e5; --brand-ink: #86b6ef; --brand-wash: #17263b;
  --school: #3987e5; --gacha: #d95926; --good-text: #0ca30c; --bad-text: #e66767;
  --side: #0f1322; --shadow: 0 1px 2px rgba(0, 0, 0, .4);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;
  background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.6;
}
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
a { color: var(--brand-ink); }
h1, h2, h3 { margin: 0; }
.num, td.n, th.n { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.muted { color: var(--muted); }
.sub { color: var(--ink2); font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* ---------- レイアウト ---------- */
#app { display: flex; min-height: 100vh; }
.sidebar { width: 252px; flex: 0 0 252px; background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; padding: 16px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 6px 14px; }
.brand-mark { width: 38px; height: 38px; border-radius: 10px; background: linear-gradient(135deg, #3987e5, #1c5cab); display: grid; place-items: center; font-weight: 800; color: #fff; font-size: 15px; letter-spacing: -.02em; }
.brand-title { font-weight: 800; color: #fff; font-size: 15px; }
.brand-sub { font-size: 11px; color: var(--side-muted); }
#nav { display: flex; flex-direction: column; gap: 2px; }
.nav-sec { font-size: 10.5px; color: var(--side-muted); padding: 10px 10px 4px; letter-spacing: .06em; }
.nav-item { display: flex; align-items: center; gap: 9px; width: 100%; border: 0; background: transparent; color: var(--side-ink); padding: 8px 10px; border-radius: 9px; cursor: pointer; text-align: left; font-size: 13.5px; font-family: inherit; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.active { background: #2a78d6; color: #fff; }
.nav-ico { width: 18px; text-align: center; opacity: .9; }
.nav-lbl { flex: 1; }
.nav-tag { font-size: 10px; opacity: .55; font-weight: 600; }
.nav-badge { font-size: 10.5px; font-weight: 800; background: #eb6834; color: #fff; border-radius: 999px; min-width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; }
.ctx { margin-top: auto; padding: 12px 6px 4px; border-top: 1px solid rgba(255, 255, 255, .08); display: flex; flex-direction: column; gap: 8px; }
.ctx label { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--side-muted); }
.ctx select { background: #1d2440; color: #e6ebff; border: 1px solid #2e3760; border-radius: 8px; padding: 6px 8px; font-size: 12.5px; font-family: inherit; }
#ctx-local, #ctx-server { display: flex; flex-direction: column; gap: 8px; }
#ctx-local.hidden, #ctx-server.hidden { display: none; }
.ctx .me { font-size: 12.5px; color: #e6ebff; line-height: 1.5; }
.clock { background: #1d2440; border: 1px solid #2e3760; border-radius: 10px; padding: 9px 10px; }
.clock-t { color: #fff; font-weight: 700; font-size: 13.5px; }
.clock-l { font-size: 10.5px; color: var(--side-muted); }
.clock-btns { display: flex; gap: 5px; margin-top: 7px; flex-wrap: wrap; }
.mini-btn { background: transparent; border: 1px solid #39436d; color: #c2cae8; border-radius: 7px; padding: 4px 8px; cursor: pointer; font-size: 11.5px; font-family: inherit; }
.mini-btn:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.side-foot { font-size: 10.5px; color: var(--side-muted); padding: 10px 6px 0; line-height: 1.5; }
#main { flex: 1; min-width: 0; padding: 24px 28px 64px; max-width: 1240px; }
#mobile-bar { display: none; }
#backdrop { display: none; }

/* ---------- 見出し・フィルタ ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.page-head h1 { font-size: 21px; letter-spacing: .01em; display: flex; align-items: center; gap: 8px; }
.page-head .tag { font-size: 11px; font-weight: 700; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.page-head p { margin: 3px 0 0; color: var(--ink2); font-size: 13px; }
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.pill { border: 1px solid var(--line); background: var(--panel); color: var(--ink2); border-radius: 999px; padding: 5px 13px; cursor: pointer; font-size: 12.5px; font-weight: 600; font-family: inherit; }
.pill.on { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.pill .cnt { font-weight: 800; margin-left: 4px; }
select, input, textarea { font-family: inherit; font-size: 13.5px; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; }
textarea { width: 100%; resize: vertical; line-height: 1.55; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--brand); vertical-align: middle; }
input[type="number"] { width: 110px; }

/* ---------- カード・グリッド ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); margin-bottom: 16px; min-width: 0; }
.card-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 0 12px; flex-wrap: wrap; }
.card-h h2 { font-size: 14.5px; font-weight: 700; }
.card-h .sub { font-size: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid2 > .card, .grid3 > .card { margin-bottom: 0; }
.stack { display: flex; flex-direction: column; gap: 16px; margin-bottom: 16px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.note { font-size: 12px; color: var(--ink2); background: var(--bg2); border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; margin-top: 10px; line-height: 1.6; }
.empty { color: var(--muted); padding: 18px; text-align: center; font-size: 13px; }

/* ---------- 数字タイル ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile { border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; background: var(--surface); }
.tile-l { font-size: 12px; color: var(--ink2); }
.tile-v { font-size: 23px; font-weight: 650; margin: 2px 0 0; letter-spacing: -.01em; }
.tile-s { font-size: 11.5px; color: var(--muted); }
.hero { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.hero-v { font-size: 52px; font-weight: 700; line-height: 1; letter-spacing: -.02em; }
.hero-u { font-size: 18px; color: var(--ink2); font-weight: 600; }
.hero-s { color: var(--ink2); font-size: 13px; }

/* ---------- メーター（同じ色の濃淡） ---------- */
.meter { position: relative; height: 10px; background: var(--seq-100); border-radius: 5px; overflow: hidden; }
:root[data-theme="dark"] .meter { background: #1c2c44; }
@media (prefers-color-scheme: dark) { :root:where(:not([data-theme="light"])) .meter { background: #1c2c44; } }
.meter > i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--brand); border-radius: 5px; }
.meter > b { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); opacity: .55; }
.reps { display: flex; flex-direction: column; gap: 12px; }
.rep { display: grid; grid-template-columns: 110px 1fr 200px; gap: 12px; align-items: center; }
.rep-n { font-weight: 600; font-size: 13px; }
.rep-v { font-size: 12.5px; color: var(--ink2); text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- 事業・区分・状態のしるし ---------- */
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; color: var(--ink2); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px 1px 6px; white-space: nowrap; background: var(--panel); }
.chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.chip.school::before { background: var(--school); }
.chip.gacha::before { background: var(--gacha); }
.chip.plain::before { display: none; }
.st { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.st::before { width: 16px; height: 16px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 10px; font-weight: 900; color: #fff; flex: 0 0 16px; }
.st.good::before { content: "✓"; background: var(--good); }
.st.warn::before { content: "!"; background: var(--warn); color: #3a2a00; }
.st.serious::before { content: "!"; background: var(--serious); }
.st.critical::before { content: "■"; background: var(--critical); font-size: 8px; }
.st.info::before { content: "i"; background: var(--brand); }
.st.idle::before { content: "–"; background: var(--muted); }
.badge { display: inline-block; font-size: 11px; font-weight: 700; border-radius: 6px; padding: 0 6px; border: 1px solid var(--line); color: var(--ink2); background: var(--bg2); white-space: nowrap; }
.badge.extra { color: var(--brand-ink); border-color: var(--brand); background: var(--brand-wash); }

/* ---------- 通知 ---------- */
.alerts { display: flex; flex-direction: column; gap: 8px; }
.alert { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: start; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.alert .st { grid-row: span 2; padding-top: 2px; }
.alert-t { font-weight: 650; font-size: 13.5px; }
.alert-d { font-size: 12.5px; color: var(--ink2); }

/* ---------- 表 ---------- */
.tbl-wrap { overflow-x: auto; margin: 0 -2px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 600; color: var(--ink2); font-size: 12px; padding: 7px 8px; border-bottom: 1px solid var(--axis); white-space: nowrap; }
.tbl td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr.grp td { font-weight: 700; background: var(--bg2); }
.tbl tr.dim td { color: var(--muted); }
.tbl tr:hover td { background: var(--bg2); }
.tbl .acts { white-space: nowrap; text-align: right; }

/* ---------- ボタン ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 9px; padding: 7px 13px; cursor: pointer; font-size: 13px; font-weight: 600; font-family: inherit; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--bg2); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { filter: brightness(1.05); }
.btn.danger { color: var(--bad-text); border-color: var(--critical); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--brand-ink); }
.btn.sm { padding: 4px 9px; font-size: 12px; border-radius: 7px; }
.btn.lg { padding: 12px 16px; font-size: 15px; border-radius: 11px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------- フォーム ---------- */
.form { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 16px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--ink2); }
.field > span { font-weight: 600; }
.field .hint { font-size: 11.5px; color: var(--muted); }
.field.wide { grid-column: 1 / -1; }
.days { display: flex; gap: 4px; flex-wrap: wrap; }
.days label { display: inline-flex; align-items: center; gap: 3px; border: 1px solid var(--line); border-radius: 7px; padding: 3px 7px; font-size: 12.5px; color: var(--ink); cursor: pointer; }
.err { color: var(--bad-text); font-size: 12.5px; font-weight: 600; min-height: 1em; }
.settings-group { margin-bottom: 18px; }
.settings-group h3 { font-size: 13px; color: var(--ink2); margin: 0 0 8px; border-bottom: 1px solid var(--line); padding-bottom: 5px; }
.set-row { display: grid; grid-template-columns: 1fr 170px; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.set-row .l { font-size: 13px; font-weight: 600; }
.set-row .d { font-size: 11.5px; color: var(--muted); }
.set-row input[type="number"], .set-row input[type="text"] { width: 100%; }

/* ---------- グラフ（日ごとの実施） ---------- */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .axis line { stroke: var(--axis); stroke-width: 1; }
.chart text { fill: var(--muted); font-size: 11px; font-family: inherit; }
.chart .bar { fill: var(--brand); }
.chart .bar.weekend { fill: var(--seq-300); }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .hit:hover + .bar, .chart .hit:focus + .bar { filter: brightness(1.12); }
.chart .target { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; opacity: .7; }
.chart .lbl { fill: var(--ink2); font-weight: 600; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink2); margin-top: 6px; }
.legend .k { display: inline-flex; align-items: center; gap: 6px; }
.legend .sw { width: 12px; height: 12px; border-radius: 3px; background: var(--brand); }
.legend .sw.weekend { background: var(--seq-300); }
.legend .ln { width: 16px; height: 2px; background: var(--ink); opacity: .7; }
.tip { position: absolute; pointer-events: none; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 9px; padding: 8px 10px; font-size: 12px; min-width: 140px; z-index: 5; }
.tip b { font-size: 15px; }
.tip .r { display: flex; justify-content: space-between; gap: 12px; color: var(--ink2); }
details.tv { margin-top: 8px; font-size: 12.5px; }
details.tv summary { cursor: pointer; color: var(--brand-ink); }

/* 曜日別・時間帯別（ひとつの色の濃淡） */
.heat { border-collapse: separate; border-spacing: 2px; font-size: 11.5px; }
.heat th { color: var(--muted); font-weight: 600; padding: 2px 4px; }
.heat td { width: 38px; height: 26px; text-align: center; border-radius: 4px; font-variant-numeric: tabular-nums; }
.h0 { background: var(--bg2); color: var(--muted); }
.h1 { background: var(--seq-100); color: #0b0b0b; } .h2 { background: var(--seq-200); color: #0b0b0b; }
.h3 { background: var(--seq-300); color: #0b0b0b; } .h4 { background: var(--seq-500); color: #fff; } .h5 { background: var(--seq-700); color: #fff; }

/* ---------- 予約カレンダー ---------- */
.cal { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 10px; overflow: auto; background: var(--surface); }
.cal-h { position: sticky; top: 0; background: var(--panel); border-bottom: 1px solid var(--axis); padding: 8px; font-size: 12.5px; z-index: 2; }
.cal-h .nm { font-weight: 700; }
.cal-t { font-size: 11px; color: var(--muted); padding: 4px 6px; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
.cal-c { border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); padding: 2px; display: flex; gap: 2px; min-height: 34px; }
.cal-c.off { background: var(--bg2); }
.bk { flex: 1; min-width: 0; border-radius: 6px; padding: 3px 6px; font-size: 11.5px; line-height: 1.35; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--school); cursor: pointer; overflow: hidden; text-align: left; font-family: inherit; color: var(--ink); }
.bk.gacha { border-left-color: var(--gacha); }
.bk.confirmed { border-style: solid; box-shadow: inset 0 0 0 1px var(--brand); }
.bk.held { opacity: .75; }
.bk.no_show { opacity: .55; text-decoration: line-through; }
.bk .co { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.bk .mt { color: var(--ink2); font-size: 10.5px; }

/* ---------- 営業の当日画面（スマホ） ---------- */
.mtg { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--surface); margin-bottom: 10px; }
.mtg-top { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.mtg-time { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mtg-co { font-size: 15px; font-weight: 650; }
.mtg-hint { font-size: 12.5px; color: var(--ink2); margin: 6px 0 8px; }
.mtg-acts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.mtg-acts .btn { padding: 10px 6px; }
.mtg-acts .both { grid-column: 1 / -1; }

/* ---------- モーダル・トースト ---------- */
#modal-root .bg { position: fixed; inset: 0; background: rgba(8, 10, 20, .45); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 14px; overflow-y: auto; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; width: min(720px, 100%); box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.modal.wide { width: min(980px, 100%); }
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-h h2 { font-size: 15.5px; }
.modal-b { padding: 16px 18px; }
.modal-f { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.x { border: 0; background: transparent; font-size: 20px; cursor: pointer; color: var(--muted); }
#toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.toast { background: #141a2e; color: #fff; padding: 9px 14px; border-radius: 10px; font-size: 13px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); max-width: 90vw; }
.toast.err { background: #8f2424; }
pre.mail { white-space: pre-wrap; word-break: break-word; font-family: inherit; font-size: 12.5px; background: var(--bg2); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; margin: 6px 0; max-height: 360px; overflow: auto; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 4px 12px; font-size: 13px; }
.kv dt { color: var(--ink2); }
.kv dd { margin: 0; word-break: break-word; }

/* ---------- はじめの画面・読み込み ---------- */
.setup { max-width: 760px; margin: 8vh auto; padding: 0 16px; }
.setup.login { max-width: 420px; }
.setup h1 { font-size: 26px; margin-bottom: 6px; }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
.choice .card { display: flex; flex-direction: column; gap: 8px; }
.progress { height: 8px; background: var(--seq-100); border-radius: 4px; overflow: hidden; margin-top: 10px; }
.progress > i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .2s; }
#busy { position: fixed; inset: 0; background: rgba(8, 10, 20, .35); z-index: 70; display: none; align-items: center; justify-content: center; }
#busy.on { display: flex; }
#busy .card { min-width: 280px; text-align: center; }

/* ---------- 相手側の公開ページ（予約・配信停止） ---------- */
.pub { max-width: 760px; margin: 0 auto; padding: 22px 16px 60px; }
.pub-h { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.pub h1 { font-size: 20px; }
.slots-day { margin-bottom: 14px; }
.slots-day h3 { font-size: 13.5px; margin-bottom: 6px; }
.slots { display: flex; flex-wrap: wrap; gap: 6px; }
.slot { border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 7px 11px; cursor: pointer; font-size: 13.5px; font-variant-numeric: tabular-nums; font-family: inherit; color: var(--ink); }
.slot:hover { border-color: var(--brand); }
.slot.sel { background: var(--brand); color: #fff; border-color: var(--brand); }
.slot .rec { font-size: 10.5px; font-weight: 700; color: var(--good-text); margin-left: 4px; }
.slot.sel .rec { color: #fff; }

/* ---------- スマホ ---------- */
@media (max-width: 1000px) { .grid3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 900px) {
  #app { display: block; }
  #mobile-bar { display: flex; position: sticky; top: 0; z-index: 30; align-items: center; gap: 10px; background: var(--side); color: #fff; padding: 10px 14px; }
  #mobile-bar button { background: transparent; border: 1px solid #39436d; color: #fff; border-radius: 8px; padding: 4px 10px; font-size: 16px; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 40; transform: translateX(-105%); transition: transform .2s; height: 100vh; }
  #app.nav-open .sidebar { transform: none; }
  #app.nav-open #backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 35; }
  #main { padding: 16px 16px 60px; }
  .grid2, .grid3, .choice { grid-template-columns: 1fr; }
  .rep { grid-template-columns: 90px 1fr; }
  .rep-v { grid-column: 1 / -1; text-align: left; }
  .hero-v { font-size: 44px; }
  .mtg-acts { grid-template-columns: 1fr 1fr; }
  .set-row { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
}
ol.steps { margin: 0 0 8px; padding-left: 1.4em; display: grid; gap: 4px; font-size: 13.5px; }
