/* =========================================================
   営業管理ツール（仮称 SalesDesk）UI プロトタイプ
   方針: 差し色はブランドの青1色。影・枠線・色帯・グラデーションなし。
         面と余白で区切る。スマホは下タブ＋縦1列。
   ========================================================= */
:root {
  --brand: #1C5FD4;
  --brand-deep: #143F8F;
  --head: #1A8BE0;
  --tint: #EAF4FF;
  --tint-2: #D6E8FB;
  --bg: #FFFFFF;
  --canvas: #F2F5FA;
  --line: #DCE2EB;
  --line-strong: #C8D1DE;
  --ink: #172033;
  --ink-2: #3A4256;
  --ink-3: #6B7488;
  --nav: #172033;
  --nav-2: #222D47;
  --nav-text: #C9D3E6;
  /* chart ramp (one hue, light -> dark; ordinal use starts at --r1) */
  --r1: #86B6EF; --r2: #5598E7; --r3: #2A78D6; --r4: #1C5CAB; --r5: #104281;
  --s1: #2A78D6;
  --de: #CBD3DF;
  --grid: #E6EAF0;
  --axis: #C8D1DE;
  --good: #0A7A3B;
  --good-bg: #E3F5EA;
  --bad: #C0392B;
  --bad-bg: #FBE9E7;
  --ff: 'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic', system-ui, sans-serif;
  --fs-title: 28px;
  --fs-h: 18px;
  --fs-body: 15px;
  --fs-small: 13px;
  --fs-cap: 12px;
  --sb: 232px;
  --tb: 60px;
  --pad: 32px;
  --gap: 24px;
  --r: 8px;
  --tabbar: 64px;
}
@media (max-width: 900px) {
  :root { --pad: 16px; --gap: 16px; --fs-title: 22px; --fs-h: 17px; --fs-body: 15px; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; font-variant-numeric: lining-nums; }
body {
  margin: 0; background: var(--canvas); color: var(--ink-2);
  font-family: var(--ff); font-weight: 500; font-size: var(--fs-body);
  line-height: 1.7; letter-spacing: .02em; min-width: 320px;
}
a { color: inherit; text-decoration: none; }
p, h1, h2, h3, h4 { margin: 0; }
h1, h2, h3, h4 { color: var(--ink); font-weight: 700; line-height: 1.4; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button, input, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
img, svg { display: block; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
[hidden] { display: none !important; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sp-only { display: none; }
@media (max-width: 900px) { .sp-only { display: initial; } .pc-only { display: none !important; } }

/* ---------- icons ---------- */
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic--s { width: 16px; height: 16px; }
.ic--l { width: 24px; height: 24px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--sb) minmax(0, 1fr); min-height: 100vh; }
.side {
  background: var(--nav); color: var(--nav-text); position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; padding: 20px 14px;
}
.side__logo { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 17px; letter-spacing: .04em; padding: 6px 10px 22px; }
.side__logo .mark { width: 30px; height: 30px; border-radius: 8px; background: var(--brand); display: grid; place-items: center; color: #fff; font-size: 14px; font-weight: 700; }
.side__logo small { display: block; font-size: 11px; font-weight: 500; color: var(--nav-text); letter-spacing: .08em; line-height: 1.2; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 8px; font-weight: 700; font-size: 14px; letter-spacing: .03em; color: var(--nav-text); min-height: 44px; }
.nav a:hover { background: var(--nav-2); color: #fff; }
.nav a[aria-current="page"] { background: var(--brand); color: #fff; }
.nav__group { font-size: 11px; font-weight: 700; letter-spacing: .14em; color: #7E8AA8; padding: 18px 12px 6px; }
.side__foot { margin-top: auto; padding: 12px 10px 0; }
.me { display: flex; align-items: center; gap: 10px; color: #fff; font-size: 13px; }
.me small { display: block; color: var(--nav-text); font-size: 11px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--tint-2); color: var(--brand-deep); display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.avatar--s { width: 26px; height: 26px; font-size: 11px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--tb); background: var(--bg); display: flex; align-items: center; gap: 16px;
  padding: 0 var(--pad); position: sticky; top: 0; z-index: 20;
}
.search { flex: 1; max-width: 520px; display: flex; align-items: center; gap: 10px; background: var(--canvas); border-radius: 8px; padding: 0 14px; height: 40px; color: var(--ink-3); }
.search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; color: var(--ink); font-size: 14px; }
.search input::placeholder { color: var(--ink-3); }
.search kbd { font-family: inherit; font-size: 11px; color: var(--ink-3); background: var(--bg); padding: 2px 6px; border-radius: 4px; }
.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.tenant { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 8px; background: var(--tint); color: var(--brand-deep); font-weight: 700; font-size: 13px; white-space: nowrap; }
.tenant:hover { background: var(--tint-2); }

/* 業種テンプレート（設定・初期設定） */
.tpls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.tpls--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tpl { background: var(--canvas); border-radius: 8px; padding: 16px 18px; min-width: 0; cursor: pointer; }
.tpl.is-on { background: var(--tint); outline: 2px solid var(--brand); outline-offset: -2px; }   /* 選択中を示す機能の枠 */
.tpl__name { font-weight: 700; color: var(--ink); font-size: 15px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tpl__who { font-size: var(--fs-cap); color: var(--ink-3); margin-top: 2px; }
.tpl__chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 10px 0 8px; }
.tpl__chips span { font-size: 11px; font-weight: 700; background: var(--bg); color: var(--brand-deep); border-radius: 4px; padding: 2px 7px; }
.tpl.is-on .tpl__chips span { background: var(--bg); }
.tpl__d { font-size: var(--fs-cap); color: var(--ink-2); line-height: 1.7; }
.path--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.tpl__ico { width: 56px; height: 56px; border-radius: 12px; margin-bottom: 10px; object-fit: cover; }
.wiz__intro { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; align-items: center; margin-bottom: 18px; }
.wiz__ill { width: 100%; border-radius: 10px; }
.wiz__intro h2 { font-size: var(--fs-h); }
.wiz__intro p { font-size: var(--fs-small); color: var(--ink-2); margin-top: 4px; }
@media (max-width: 640px) { .wiz__intro { grid-template-columns: minmax(0, 1fr); } }
.wiz__foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.rename { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.rename div { background: var(--canvas); border-radius: 6px; padding: 10px 12px; font-size: 13px; }
.rename b { display: block; color: var(--ink); font-size: 15px; }
@media (max-width: 900px) { .tpls, .tpls--2, .rename { grid-template-columns: minmax(0, 1fr); } }
.iconbtn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 8px; color: var(--ink-2); position: relative; }
.iconbtn:hover { background: var(--canvas); }
.iconbtn .dot { position: absolute; top: 10px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.topbar__title { display: none; font-weight: 700; color: var(--ink); font-size: 16px; }

.content { padding: var(--pad); display: flex; flex-direction: column; gap: var(--gap); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 8px; font-weight: 700; font-size: 14px; letter-spacing: .03em; white-space: nowrap; }
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-deep); }
.btn--soft { background: var(--tint); color: var(--brand); }
.btn--soft:hover { background: var(--tint-2); }
.btn--ghost { color: var(--brand); padding: 0 10px; }
.btn--sm { min-height: 36px; padding: 0 14px; font-size: 13px; }
.btn--ai { background: var(--ink); color: #fff; }
.btn--ai:hover { background: var(--nav-2); }

/* ---------- page header ---------- */
.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ph__eyebrow { font-size: var(--fs-cap); font-weight: 700; color: var(--brand); letter-spacing: .12em; }
.ph h1 { font-size: var(--fs-title); letter-spacing: .02em; }
.ph__sub { color: var(--ink-3); font-size: var(--fs-small); margin-top: 2px; }
.ph__actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- filter row ---------- */
.filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filters__label { font-size: var(--fs-cap); font-weight: 700; color: var(--ink-3); letter-spacing: .08em; margin-right: 4px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 999px; background: var(--bg); color: var(--ink-2); font-size: 13px; font-weight: 700; border: 1px solid var(--line-strong); }
.chip[aria-pressed="true"], .chip.is-on { background: var(--tint); color: var(--brand); border-color: var(--brand); }
.chip .n { color: var(--ink-3); font-weight: 500; }
.select { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line-strong); font-size: 13px; font-weight: 700; color: var(--ink-2); }
.filters--scroll { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
.filters--scroll > * { flex: none; }

/* ---------- panels ---------- */
.panel { background: var(--bg); border-radius: var(--r); padding: 22px 24px; min-width: 0; }
.panel__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel__head h2 { font-size: var(--fs-h); letter-spacing: .02em; }
.panel__head .more { font-size: var(--fs-small); font-weight: 700; color: var(--brand); white-space: nowrap; }
.btnrow { display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 640px) { .panel__head { flex-wrap: wrap; } .panel__head .btnrow { width: 100%; } }
.panel__sub { font-size: var(--fs-small); color: var(--ink-3); }
.grid { display: grid; gap: var(--gap); grid-template-columns: repeat(12, minmax(0, 1fr)); }
.col-3 { grid-column: span 3; } .col-4 { grid-column: span 4; } .col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; } .col-7 { grid-column: span 7; } .col-8 { grid-column: span 8; } .col-12 { grid-column: span 12; }
@media (max-width: 1180px) { .col-3 { grid-column: span 6; } .col-4, .col-5, .col-7, .col-8 { grid-column: span 12; } }
@media (max-width: 900px) { .grid > [class*="col-"] { grid-column: span 12; } .panel { padding: 18px 16px; } }

/* ---------- KPI tiles ---------- */
.kpi { display: flex; flex-direction: column; gap: 6px; }
.kpi__label { font-size: var(--fs-cap); font-weight: 700; color: var(--brand); letter-spacing: .1em; }
.kpi__value { font-size: 34px; font-weight: 700; color: var(--ink); line-height: 1.1; letter-spacing: 0; }
.kpi__value small { font-size: 15px; font-weight: 700; color: var(--ink-3); margin-left: 4px; }
.kpi__delta { font-size: var(--fs-small); color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.kpi__delta b { color: var(--good); }
.kpi__delta b.down { color: var(--bad); }
.kpi__spark { margin-top: 6px; height: 36px; }
.kpi--hero .kpi__value { font-size: 48px; }
@media (max-width: 900px) { .kpi__value { font-size: 30px; } .kpi--hero .kpi__value { font-size: 40px; } }

/* ---------- tags ---------- */
.tag { display: inline-flex; align-items: center; min-height: 24px; padding: 0 9px; border-radius: 4px; font-size: var(--fs-cap); font-weight: 700; letter-spacing: .04em; white-space: nowrap; background: var(--tint); color: var(--brand); }
.tag--solid { background: var(--brand); color: #fff; }
.tag--line { background: var(--bg); color: var(--brand); border: 1px solid var(--brand); }
.tag--ink { background: var(--bg); color: var(--ink-2); border: 1px solid var(--line-strong); }
.tag--good { background: var(--good-bg); color: var(--good); }
.tag--bad { background: var(--bad-bg); color: var(--bad); }
.tag--s1 { background: var(--r1); color: var(--ink); } .tag--s2 { background: var(--r2); color: #fff; }
.tag--s3 { background: var(--r3); color: #fff; } .tag--s4 { background: var(--r4); color: #fff; } .tag--s5 { background: var(--r5); color: #fff; }

/* ---------- tables ---------- */
.tblwrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: var(--fs-cap); font-weight: 700; color: var(--ink-3); letter-spacing: .08em; padding: 0 12px 10px; white-space: nowrap; border-bottom: 1px solid var(--line); }
.tbl td { padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; color: var(--ink-2); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .t-name { font-weight: 700; color: var(--ink); }
.tbl .t-name small { display: block; font-weight: 500; color: var(--ink-3); font-size: var(--fs-cap); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl th.num { text-align: right; }
.tbl tr:hover td { background: var(--canvas); }
.tbl .t-cb { width: 36px; }
.tbl a.t-name:hover { color: var(--brand); }
.cb { width: 18px; height: 18px; border: 1.5px solid var(--line-strong); border-radius: 4px; display: inline-block; vertical-align: middle; background: var(--bg); }
.cb.is-on { background: var(--brand); border-color: var(--brand); }
.tfoot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 14px; font-size: var(--fs-small); color: var(--ink-3); flex-wrap: wrap; }
.pager { display: flex; gap: 4px; }
.pager a { min-width: 36px; height: 36px; display: grid; place-items: center; border-radius: 6px; font-weight: 700; color: var(--ink-2); }
.pager a[aria-current="page"] { background: var(--brand); color: #fff; }
/* phone: each row becomes a block */
@media (max-width: 900px) {
  .tbl--cards thead { display: none; }
  .tbl--cards, .tbl--cards tbody, .tbl--cards tr, .tbl--cards td { display: block; }
  .tbl--cards tr { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .tbl--cards tr:last-child { border-bottom: 0; }
  .tbl--cards td { padding: 2px 0; border: 0; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
  .tbl--cards td.t-first { display: block; padding-bottom: 6px; }
  .tbl--cards td[data-l]::before { content: attr(data-l); font-size: var(--fs-cap); font-weight: 700; color: var(--ink-3); letter-spacing: .06em; flex: none; }
  .tbl--cards td.num { text-align: right; }
  .tbl--cards .t-cb, .tbl--cards .t-hide { display: none; }
  .tbl tr:hover td { background: none; }
}

/* ---------- lists ---------- */
.list { display: flex; flex-direction: column; }
.list__item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list__item:last-child { border-bottom: 0; }
.list__title { font-weight: 700; color: var(--ink); font-size: 14px; }
.list__meta { font-size: var(--fs-cap); color: var(--ink-3); display: flex; gap: 10px; flex-wrap: wrap; }
.list__time { margin-left: auto; font-size: var(--fs-cap); color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.list__item.is-overdue .list__time { color: var(--bad); font-weight: 700; }
.task { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); min-height: 44px; }
.task:last-child { border-bottom: 0; }
.task .cb { margin-top: 3px; flex: none; }
.task.is-done .list__title { color: var(--ink-3); text-decoration: line-through; }

/* activity timeline */
.tl { display: flex; flex-direction: column; }
.tl__item { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.tl__item:last-child { border-bottom: 0; }
.tl__icon { width: 36px; height: 36px; border-radius: 50%; background: var(--tint); color: var(--brand); display: grid; place-items: center; }
.tl__icon--solid { background: var(--brand); color: #fff; }
.tl__icon--ai { background: var(--ink); color: #fff; }
.tl__text { font-size: 14px; color: var(--ink-2); }
.tl__text b { color: var(--ink); }
.tl__meta { font-size: var(--fs-cap); color: var(--ink-3); margin-top: 2px; }
.tl__note { margin-top: 8px; background: var(--canvas); border-radius: 6px; padding: 10px 12px; font-size: 13px; line-height: 1.7; }

/* ---------- kanban ---------- */
.kanban { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; align-items: start; }
.kcol { background: var(--bg); border-radius: var(--r); padding: 14px 12px 12px; min-width: 0; }
.kcol__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.kcol__name { font-weight: 700; color: var(--ink); font-size: 14px; display: flex; align-items: center; gap: 8px; }
.kcol__name i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.kcol__count { font-size: var(--fs-cap); color: var(--ink-3); font-weight: 700; }
.kcol__sum { font-size: var(--fs-small); color: var(--ink-3); margin-bottom: 12px; font-variant-numeric: tabular-nums; }
.kcol__sum b { color: var(--ink); font-size: 15px; }
.kcards { display: flex; flex-direction: column; gap: 8px; }
.kcard { background: var(--canvas); border-radius: 6px; padding: 12px 12px 10px; display: block; min-width: 0; }
.kcard:hover { background: var(--tint); }
.kcard__co { font-size: var(--fs-cap); color: var(--ink-3); font-weight: 700; }
.kcard__title { font-weight: 700; color: var(--ink); font-size: 14px; line-height: 1.5; margin: 2px 0 8px; }
.kcard__row { display: flex; align-items: center; gap: 8px; font-size: var(--fs-cap); color: var(--ink-3); }
.kcard__amt { font-weight: 700; color: var(--ink); font-size: 14px; }
.kcard__row .avatar--s { margin-left: auto; }
.kcard__next { margin-top: 8px; font-size: var(--fs-cap); color: var(--brand); font-weight: 700; display: flex; align-items: center; gap: 6px; }
.kcard__next.is-overdue { color: var(--bad); }
.kcol--lost .kcard { opacity: .7; }
@media (max-width: 1180px) { .kanban { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px; padding-bottom: 6px; -webkit-overflow-scrolling: touch; align-items: flex-start; } .kcol { flex: 0 0 300px; scroll-snap-align: start; max-height: calc(100svh - 220px); overflow-y: auto; } }
@media (max-width: 640px) { .kcol { flex-basis: 82vw; height: calc(100svh - 260px); max-height: none; } }

/* stage path (deal detail) */
.path { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
.path__step { background: var(--canvas); color: var(--ink-3); border-radius: 6px; padding: 10px 8px; font-size: var(--fs-cap); font-weight: 700; text-align: center; min-height: 44px; display: grid; place-items: center; }
.path__step.is-done { background: var(--tint-2); color: var(--brand-deep); }
.path__step.is-now { background: var(--brand); color: #fff; }
@media (max-width: 900px) { .path { display: flex; overflow-x: auto; gap: 4px; } .path__step { flex: 0 0 auto; padding: 10px 14px; } }

/* ---------- detail header ---------- */
.dhead { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.dhead__logo { width: 64px; height: 64px; border-radius: 12px; background: var(--tint); color: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: 20px; flex: none; }
.dhead__body { min-width: 0; flex: 1; }
.dhead__tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.dhead h1 { font-size: 24px; }
.dhead__meta { font-size: var(--fs-small); color: var(--ink-3); display: flex; gap: 14px; flex-wrap: wrap; }
.dhead__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.fact { background: var(--canvas); border-radius: 6px; padding: 12px 14px; min-width: 0; }
.fact__l { font-size: var(--fs-cap); font-weight: 700; color: var(--ink-3); letter-spacing: .06em; }
.fact__v { font-size: 20px; font-weight: 700; color: var(--ink); line-height: 1.3; margin-top: 2px; }
.fact__v small { font-size: 13px; color: var(--ink-3); margin-left: 3px; }
.facts--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 900px) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } .fact__v { font-size: 18px; } }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a { padding: 10px 14px; font-weight: 700; font-size: 14px; color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; min-height: 44px; display: flex; align-items: center; gap: 6px; }
.tabs a[aria-current="page"] { color: var(--brand); border-bottom-color: var(--brand); }
.tabs a .n { font-size: 11px; background: var(--tint); color: var(--brand); border-radius: 4px; padding: 0 6px; }

/* definition list */
.dl { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 8px 16px; font-size: 14px; }
.dl dt { color: var(--ink-3); font-size: var(--fs-cap); font-weight: 700; padding-top: 3px; letter-spacing: .04em; }
.dl dd { margin: 0; color: var(--ink); }
.dl dd a { color: var(--brand); font-weight: 700; }
.dl--wide { grid-template-columns: 140px minmax(0, 1fr); }
@media (max-width: 640px) { .dl, .dl--wide { grid-template-columns: minmax(0, 1fr); gap: 0; } .dl dt { padding-top: 10px; } .dl dd { padding-bottom: 6px; border-bottom: 1px solid var(--line); } .dl dd:last-child { border-bottom: 0; } }

/* contact card */
.person { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.person:last-child { border-bottom: 0; }
.person__name { font-weight: 700; color: var(--ink); font-size: 14px; }
.person__role { font-size: var(--fs-cap); color: var(--ink-3); }

/* AI panel */
.ai { background: var(--ink); color: #fff; border-radius: var(--r); padding: 22px 24px; }
.ai h2 { color: #fff; font-size: var(--fs-h); display: flex; align-items: center; gap: 8px; }
.ai p { color: #C9D3E6; font-size: 14px; margin-top: 6px; }
.ai__body { margin-top: 14px; background: var(--nav-2); border-radius: 6px; padding: 14px 16px; font-size: 14px; line-height: 1.8; color: #fff; }
.ai__body b { color: #9EC5F4; }
.ai__actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.ai .btn--soft { background: var(--brand); color: #fff; }
.ai .btn--ghost { color: #9EC5F4; }
.ai__note { font-size: var(--fs-cap); color: #7E8AA8; margin-top: 10px; }

/* ---------- forms ---------- */
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field label { font-size: var(--fs-cap); font-weight: 700; color: var(--ink-3); letter-spacing: .06em; }
.field input, .field select, .field textarea { min-height: 44px; border: 1px solid var(--line-strong); border-radius: 6px; padding: 8px 12px; background: var(--bg); font-size: 14px; color: var(--ink); width: 100%; }
.field textarea { min-height: 96px; resize: vertical; }
.field--full { grid-column: 1 / -1; }
.form--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form--1 { grid-template-columns: minmax(0, 1fr); }
.form--add { grid-template-columns: minmax(0, 1fr) 160px auto; align-items: end; }
@media (max-width: 640px) { .form, .form--3, .form--add { grid-template-columns: minmax(0, 1fr); } }
.toggle { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; color: var(--ink); min-height: 44px; }
.toggle i { width: 42px; height: 24px; border-radius: 12px; background: var(--line-strong); position: relative; flex: none; }
.toggle i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; }
.toggle.is-on i { background: var(--brand); } .toggle.is-on i::after { left: 21px; }

/* settings rows */
.srow { display: flex; gap: 16px; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.srow:last-child { border-bottom: 0; }
.srow__t { font-weight: 700; color: var(--ink); font-size: 14px; }
.srow__d { font-size: var(--fs-cap); color: var(--ink-3); }
.stage-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.stage-row:last-child { border-bottom: 0; }
.stage-row i { width: 14px; height: 14px; border-radius: 4px; flex: none; }
.stage-row .grip { color: var(--line-strong); }
.stage-row b { color: var(--ink); font-size: 14px; }
.stage-row > span:not(.grip) { color: var(--ink-3); font-size: var(--fs-cap); margin-left: auto; white-space: nowrap; }
.tbl .nw { white-space: nowrap; }

/* ---------- charts ---------- */
.chart { position: relative; width: 100%; }
.chart svg { width: 100%; height: auto; overflow: visible; font-family: var(--ff); }
.chart .ax { fill: var(--ink-3); font-size: 11px; font-weight: 500; }
.chart .lab { fill: var(--ink-2); font-size: 12px; font-weight: 700; }
.chart .val { fill: var(--ink); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .axis { stroke: var(--axis); stroke-width: 1; }
.chart .hit { fill: transparent; }
.chart .hit:hover + .mark, .chart .hit:focus + .mark { opacity: .85; }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: #fff; font-size: 12px; font-weight: 700; padding: 6px 10px; border-radius: 6px; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); opacity: 0; transition: opacity .12s; z-index: 5; }
.tip.is-on { opacity: 1; }
.tip small { display: block; font-weight: 500; color: #C9D3E6; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: var(--fs-cap); color: var(--ink-2); font-weight: 700; margin-top: 10px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
details.tbltoggle { margin-top: 12px; font-size: var(--fs-small); }
details.tbltoggle summary { color: var(--brand); font-weight: 700; cursor: pointer; list-style: none; min-height: 36px; display: flex; align-items: center; gap: 6px; }
details.tbltoggle summary::-webkit-details-marker { display: none; }

/* funnel */
.funnel { display: flex; flex-direction: column; gap: 10px; }
.funnel__row { display: grid; grid-template-columns: 112px minmax(0, 1fr) 72px; gap: 12px; align-items: center; font-size: 13px; }
.funnel__row b { color: var(--ink); font-weight: 700; }
.funnel__bar { height: 18px; border-radius: 0 4px 4px 0; background: var(--r3); }
.funnel__n { text-align: right; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.funnel__n small { color: var(--ink-3); font-weight: 500; margin-left: 4px; }
@media (max-width: 640px) { .funnel__row { grid-template-columns: 92px minmax(0, 1fr) 64px; } }

/* calendar week */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.week__day { background: var(--canvas); border-radius: 6px; padding: 10px 8px; min-height: 180px; min-width: 0; }
.week__day.is-today { background: var(--tint); }
.week__dn { font-size: var(--fs-cap); color: var(--ink-3); font-weight: 700; }
.week__dd { font-size: 18px; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.ev { font-size: 11px; font-weight: 700; color: #fff; background: var(--brand); border-radius: 4px; padding: 4px 6px; margin-bottom: 4px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev--soft { background: var(--tint-2); color: var(--brand-deep); }
.ev--ink { background: var(--nav-2); }
/* phone: one row per day, events wrap to the right of the date */
@media (max-width: 640px) {
  .week { display: flex; flex-direction: column; gap: 4px; }
  .week__day { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 0 12px; min-height: 56px; align-items: center; padding: 8px 12px; }
  .week__dn { grid-column: 1; grid-row: 1; }
  .week__dd { grid-column: 1; grid-row: 2; margin: 0; }
  .week__evs { grid-column: 2; grid-row: 1 / 3; display: flex; flex-wrap: wrap; gap: 4px; }
  .ev { white-space: normal; margin: 0; font-size: 12px; padding: 5px 8px; }
}

/* mail preview */
.mailbox { display: flex; flex-direction: column; }
.mail { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: start; }
.mail:last-child { border-bottom: 0; }
.mail__from { font-weight: 700; color: var(--ink); font-size: 14px; }
.mail__subj { font-size: 14px; color: var(--ink-2); }
.mail__snip { font-size: var(--fs-cap); color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail__right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; font-size: var(--fs-cap); color: var(--ink-3); white-space: nowrap; }

/* ---------- 案内役ピコ（guide.js） ---------- */
.guide-fab { position: fixed; right: 20px; bottom: 20px; z-index: 35; display: flex; align-items: center; gap: 8px; background: var(--bg); color: var(--brand-deep); font-weight: 700; font-size: 13px; padding: 6px 16px 6px 8px; border-radius: 999px; min-height: 56px; cursor: pointer; }
.guide-fab:hover { background: var(--tint); }
.guide-fab.is-open { background: var(--tint); }
.guide { position: fixed; right: 20px; bottom: 88px; width: 380px; max-width: calc(100vw - 32px); max-height: min(640px, calc(100vh - 120px)); background: var(--bg); border-radius: 14px; z-index: 36; display: flex; flex-direction: column; }
.guide__head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: var(--tint); border-radius: 14px 14px 0 0; }
.guide__head b { display: block; color: var(--ink); font-size: 15px; line-height: 1.2; }
.guide__head small { color: var(--ink-3); font-size: 12px; }
.guide__close { margin-left: auto; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: var(--ink-2); font-size: 20px; }
.guide__close:hover { background: var(--bg); }
.guide__log { padding: 14px 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; flex: 1; min-height: 160px; }
.guide__msg { display: flex; gap: 8px; align-items: flex-start; }
.guide__msg--me { justify-content: flex-end; }
.guide__bubble { background: var(--canvas); border-radius: 12px; padding: 10px 12px; font-size: 14px; line-height: 1.7; color: var(--ink); max-width: 100%; }
.guide__msg--me .guide__bubble { background: var(--brand); color: #fff; }
.guide__bubble a { color: var(--brand); font-weight: 700; }
.guide__bubble small { color: var(--ink-3); }
.guide__chips { display: flex; flex-wrap: wrap; gap: 6px; padding-left: 36px; }
.guide__chips .chip { min-height: 36px; font-size: 13px; }
.guide__mini { margin-left: 36px; background: var(--canvas); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.guide__mini .field span { font-size: 12px; font-weight: 700; color: var(--ink-3); }
.guide__mini input, .guide__mini select { min-height: 40px; }
.guide__form { display: flex; gap: 8px; padding: 12px 16px 16px; border-top: 1px solid var(--line); }
.guide__form input { flex: 1; min-width: 0; min-height: 44px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 12px; font-size: 14px; }
.guide__tbl { border-collapse: collapse; font-size: 12px; width: 100%; }
.guide__tbl th, .guide__tbl td { text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--line); }
.guide__tbl th { color: var(--ink-3); font-weight: 700; }
.g-hl { outline: 2px solid var(--brand); outline-offset: 4px; border-radius: 10px; }   /* 案内中の場所（機能の枠） */
.g-dim { opacity: .35; }
.g-new { background: var(--tint) !important; }
@media (max-width: 900px) {
  .guide-fab { right: 12px; bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 12px); padding: 6px; }
  .guide-fab span { display: none; }
  .guide { right: 0; left: 0; bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); width: auto; max-width: none; max-height: 70vh; border-radius: 14px 14px 0 0; }
}

/* ---------- 設定（左のサブメニュー＋1画面1セクション） ---------- */
.settings { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: var(--gap); align-items: start; }
.snav { position: sticky; top: calc(var(--tb) + 16px); display: flex; flex-direction: column; gap: 2px; background: var(--bg); border-radius: var(--r); padding: 10px; }
.snav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; font-weight: 700; font-size: 14px; color: var(--ink-2); min-height: 44px; }
.snav a:hover { background: var(--canvas); }
.snav a.is-on { background: var(--tint); color: var(--brand); }
.spanel { display: none; flex-direction: column; gap: var(--gap); min-width: 0; }
.spanel.is-on { display: flex; }
.spanel__head { display: flex; align-items: center; gap: 18px; background: var(--bg); border-radius: var(--r); padding: 20px 24px; flex-wrap: wrap; }
.spanel__ill { width: 72px; height: 72px; border-radius: 12px; flex: none; object-fit: cover; }
.spanel__head h2 { font-size: 20px; }
.spanel__head p { font-size: var(--fs-small); color: var(--ink-2); margin-top: 2px; }
.spanel__head .btn { margin-left: auto; }
.meter { height: 8px; border-radius: 4px; background: var(--tint-2); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--brand); }
.swatch { display: inline-flex; align-items: center; gap: 8px; }
.swatch i { width: 24px; height: 24px; border-radius: 6px; background: var(--brand); }
.drop { background: var(--tint); border-radius: 10px; padding: 28px 20px; text-align: center; color: var(--brand-deep); font-weight: 700; }
.drop small { display: block; font-weight: 500; color: var(--ink-2); font-size: var(--fs-cap); margin-top: 4px; }
.irow { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.irow:last-child { border-bottom: 0; }
.irow__ico { width: 48px; height: 48px; border-radius: 12px; background: var(--tint); color: var(--brand); display: grid; place-items: center; }
.irow__t { font-weight: 700; color: var(--ink); font-size: 14px; }
.irow__d { font-size: var(--fs-cap); color: var(--ink-3); }
.irow__r { display: flex; gap: 8px; align-items: center; }
.frow { display: grid; grid-template-columns: minmax(0, 1fr) 120px 90px 110px 44px; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.frow:last-child { border-bottom: 0; }
.frow input, .frow select { min-height: 40px; border: 1px solid var(--line-strong); border-radius: 6px; padding: 0 10px; font-size: 14px; width: 100%; background: var(--bg); }
.frow .del { color: var(--ink-3); width: 44px; height: 40px; display: grid; place-items: center; border-radius: 6px; }
.frow .del:hover { background: var(--bad-bg); color: var(--bad); }
.frow--h { font-size: var(--fs-cap); font-weight: 700; color: var(--ink-3); letter-spacing: .06em; padding-bottom: 6px; }
@media (max-width: 900px) {
  .settings { grid-template-columns: minmax(0, 1fr); }
  .snav { position: static; flex-direction: row; overflow-x: auto; padding: 6px; }
  .snav a { white-space: nowrap; flex: none; }
  .spanel__head .btn { margin-left: 0; width: 100%; }
  .frow { grid-template-columns: minmax(0, 1fr) 90px; }
  .frow > :nth-child(n+3) { display: none; }
  .frow--h { display: none; }
  .irow { grid-template-columns: 48px minmax(0, 1fr); }
  .irow__r { grid-column: 2; }
}

/* ---------- 操作感：触りたくなる・押したくなる（DESIGN_RULES 15） ----------
   押せる物は「色面＋角丸」で示し、反応は 120ms で色・位置・大きさで返す。影・枠線・グラデーションは使わない。
   動きは意味のあるものだけ（順番に現れる／伸びる／着いたら強調）。prefers-reduced-motion では止める。 */
:root { --t-fast: 120ms; --t-med: 240ms; --t-slow: 700ms; --ease: cubic-bezier(.2, .7, .2, 1); }
.btn, .chip, .select, .iconbtn, .nav a, .tabbar a, .kcard, .tpl, .snav a, .tabs a, .cb, .toggle i, .toggle i::after, .pager a, .more, .path__step, .tbl tbody tr, .irow, .list__item, .task, .person, .linkchip, .guide-fab, .drawer__close, .mail {
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), left var(--t-fast) var(--ease), opacity var(--t-fast) var(--ease);
}
.btn:active, .chip:active, .iconbtn:active, .kcard:active, .tpl:active, .snav a:active, .nav a:active, .tabbar a:active, .path__step:active, .guide-fab:active { transform: scale(.97); }
.btn .ic { transition: transform var(--t-fast) var(--ease); }
.btn:hover .ic:last-child:not(:first-child) { transform: translateX(3px); }   /* 末尾の矢印だけ前へ */
.btn--primary:hover { transform: translateY(-1px); }
.btn--soft:hover .ic { transform: scale(1.1); }
.more:hover { text-decoration: underline; text-underline-offset: 3px; }
.chip:hover { border-color: var(--brand); color: var(--brand); }
.select:hover { border-color: var(--brand); color: var(--brand); }
.iconbtn:hover .ic { transform: scale(1.08); }
.nav a:hover .ic, .snav a:hover .ic { transform: translateX(2px); }
.tabs a { position: relative; border-bottom-color: transparent !important; }
.tabs a::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 2px; background: var(--brand); transform: scaleX(0); transform-origin: left; transition: transform var(--t-med) var(--ease); }
.tabs a:hover::after, .tabs a[aria-current="page"]::after { transform: scaleX(1); }
.tabs a:hover { color: var(--brand); }
.field input:hover, .field select:hover, .field textarea:hover, .frow input:hover, .frow select:hover, .guide__form input:hover { border-color: var(--brand); }
.tbl tbody tr[data-href] { cursor: pointer; }
.tbl tbody tr[data-href]:hover .t-name { color: var(--brand); }
.list__item:hover, .person:hover, .irow:hover, .mail:hover { background: var(--canvas); margin: 0 -12px; padding-left: 12px; padding-right: 12px; border-radius: 8px; }
.task:hover { background: var(--canvas); margin: 0 -12px; padding-left: 12px; padding-right: 12px; border-radius: 8px; }

/* チェック：押すと青に塗ってチェックが描かれる */
.cb { position: relative; cursor: pointer; }
.cb::after { content: ""; position: absolute; left: 5px; top: 1px; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) scale(0); transition: transform var(--t-fast) var(--ease); }
.cb.is-on::after { transform: rotate(45deg) scale(1); }
.cb:hover { border-color: var(--brand); }
.toggle { cursor: pointer; } .toggle:hover i { background: var(--line); } .toggle.is-on:hover i { background: var(--brand-deep); }

/* カンバン：つかめる・運べる・次へ送れる */
.kcard { position: relative; cursor: grab; }
.kcard:hover { transform: translateY(-2px); }
.kcard.is-dragging { opacity: .45; cursor: grabbing; }
.kcol.is-over { background: var(--tint); outline: 2px solid var(--brand); outline-offset: -2px; }   /* 置ける列を示す機能の枠 */
.kcard__go { position: absolute; right: 8px; top: 8px; min-height: 30px; padding: 0 9px; border-radius: 6px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; opacity: 0; transform: translateY(-4px); transition: opacity var(--t-fast), transform var(--t-fast), background-color var(--t-fast); cursor: pointer; }
.kcard:hover .kcard__go, .kcard:focus-within .kcard__go { opacity: 1; transform: none; }
.kcard__go:hover { background: var(--brand-deep); }
@media (hover: none) { .kcard__go { opacity: 1; transform: none; } .kcard { cursor: default; } }
.kcard.is-moved { animation: landed var(--t-slow) var(--ease); }
@keyframes landed { 0% { background: var(--brand); color: #fff; } 100% { background: var(--canvas); } }

/* ステージの道のり：押して進められる */
.path__step { cursor: pointer; }
.path__step:not(.is-now):hover { background: var(--tint-2); color: var(--brand-deep); }

/* 数字・グラフ：順番に現れる、伸びる（意味のある動きだけ） */
.content > * { animation: rise var(--t-med) var(--ease) both; }
.content > :nth-child(2) { animation-delay: 40ms; } .content > :nth-child(3) { animation-delay: 80ms; } .content > :nth-child(4) { animation-delay: 120ms; } .content > :nth-child(5) { animation-delay: 160ms; } .content > :nth-child(n+6) { animation-delay: 200ms; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.chart .mark--h { transform-box: fill-box; transform-origin: left center; animation: growx var(--t-slow) var(--ease) both; }
.chart .mark--v { transform-box: fill-box; transform-origin: center bottom; animation: growy var(--t-slow) var(--ease) both; }
.chart .line--draw { animation: draw 1.1s var(--ease) both; }
@keyframes growx { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes growy { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes draw { from { stroke-dashoffset: var(--len, 1200); } to { stroke-dashoffset: 0; } }

/* 案内役ピコ：ときどき浮く、触ると首をかしげる */
.guide-fab .pico { animation: bob 3.4s ease-in-out infinite; transform-origin: center bottom; }
.guide-fab:hover .pico { animation: tilt .5s var(--ease) both; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes tilt { 0% { transform: rotate(0); } 40% { transform: rotate(-8deg); } 100% { transform: rotate(0); } }
.guide__msg { animation: rise var(--t-med) var(--ease) both; }

/* トースト：やったことの返事 */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 16px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px; font-weight: 700; font-size: 14px; display: flex; gap: 10px; align-items: center; opacity: 0; pointer-events: none; transition: opacity var(--t-med) var(--ease), transform var(--t-med) var(--ease); z-index: 50; max-width: calc(100vw - 32px); }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 900px) { .toast { bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 16px); } }

/* 空の状態：ピコが次の一歩を示す */
.empty { text-align: center; padding: 28px 16px 12px; }
.empty img { width: min(320px, 88%); margin: 0 auto 10px; border-radius: 12px; }
.kanban--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.empty b { display: block; color: var(--ink); font-size: 16px; }
.empty p { font-size: 14px; color: var(--ink-2); margin: 4px 0 12px; }

@media (prefers-reduced-motion: reduce) {
  .content > *, .chart .mark--h, .chart .mark--v, .chart .line--draw, .guide-fab .pico, .guide__msg, .kcard.is-moved { animation: none !important; }
  * { transition-duration: 0s !important; }
}

/* ---------- bottom tab bar (phone) & drawer ---------- */
.tabbar { display: none; }
.drawer { display: none; }
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .topbar { height: 56px; gap: 8px; }
  .topbar__title { display: block; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .search { display: none; }
  .topbar .btn--primary.btn--new { min-height: 40px; padding: 0 12px; }
  .topbar .btn--new span { display: none; }
  .content { padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 24px); }
  .tabbar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--tabbar) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--bg); z-index: 30; border-top: 1px solid var(--line); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 700; color: var(--ink-3); min-height: 44px; }
  .tabbar a[aria-current="page"] { color: var(--brand); }
  .drawer { position: fixed; inset: 0; z-index: 40; background: rgba(23, 32, 51, .5); }
  .drawer:not(.is-open) { display: none; }
  .drawer__panel { position: absolute; top: 0; bottom: 0; left: 0; width: min(300px, 84vw); background: var(--nav); color: var(--nav-text); padding: 20px 14px; overflow-y: auto; display: flex; flex-direction: column; }
  .drawer__close { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; display: grid; place-items: center; color: #fff; }
  body.drawer-open { overflow: hidden; }
}
