/* つどいラボ 代理店ページ。仕様は ../DESIGN.md（色と書体は LP、骨組みはグロースリンクの営業ダッシュボード）
   外の書体は読まない（CSP は style-src/font-src 'self'）。切り替えは 1024px の1か所だけ。赤はエラーと失敗だけ */
:root {
  --ai: #000066; --sky: #1CACE3; --mist: #C2E8F7; --mist-line: #A2D1EE; --wall: #F0F8FC; --paper: #fff;
  --text: #23233F; --sub: #5A5E78; --rule: #CFE6F3; --input-line: #7A8BA3; --gray-line: #B7BECD;
  --go: #00843C; --go-d: #006B31; --err: #B72402; --warn: #A15C00;
  --on-ai-sub: rgba(255,255,255,.80); --on-ai-dim: rgba(255,255,255,.68); --on-ai-line: rgba(255,255,255,.16);
  --on-ai-hover: rgba(255,255,255,.08); --on-ai-active: rgba(255,255,255,.14); --scrim: rgba(0,0,40,.5);
  --font: "BIZ UDPGothic", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "Yu Gothic", "Meiryo", system-ui, sans-serif;
  --r: 8px; --r-card: 10px; --r-s: 4px;
  --side-w: 248px; --top-h: 56px; --tab-h: 64px; --page-w: 1040px; --page-narrow: 720px;
  --gap: 12px; --pad: 16px; --ease: cubic-bezier(.2,.7,.2,1);
  --tab-space: calc(var(--tab-h) + env(safe-area-inset-bottom));
}
@media (min-width: 1024px) { :root { --gap: 16px; --pad: 20px; --tab-space: 0px; } }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
html.nav-lock, html.sheet-lock { overflow: hidden; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.7; color: var(--text); background: var(--wall); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
a { color: var(--ai); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--ai); outline-offset: 2px; }
svg { flex: none; }
h1, h2, h3 { line-height: 1.4; }

/* ---------- 枠: 上の帯・サイドバー・下のタブ ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 4px; min-height: calc(var(--top-h) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 12px 0 4px; background: var(--ai); color: #fff; }
.topbar h1 { margin: 0; font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-btn { position: relative; width: 48px; height: 48px; display: grid; place-items: center; background: none; border: 0; color: #fff; cursor: pointer; border-radius: var(--r); }
.menu-btn svg { width: 26px; height: 26px; }
.menu-btn:focus-visible { outline-color: #fff; outline-offset: -2px; }
.menu-btn .dot { top: 4px; right: 2px; left: auto; }

.side { position: fixed; z-index: 50; top: 0; bottom: 0; left: 0; width: min(86vw, 320px); display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain;
  padding: calc(16px + env(safe-area-inset-top)) 12px calc(16px + env(safe-area-inset-bottom)); background: var(--ai); color: var(--on-ai-sub); transform: translateX(-100%); transition: transform 200ms var(--ease); visibility: hidden; }
.nav-open .side { transform: none; visibility: visible; transition-duration: 240ms; }
.scrim { position: fixed; inset: 0; z-index: 40; background: var(--scrim); opacity: 0; pointer-events: none; transition: opacity 200ms var(--ease); touch-action: none; }
.nav-open .scrim { opacity: 1; pointer-events: auto; }
.side:focus { outline: none; }
.side :focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.side-head { display: flex; align-items: flex-start; gap: 8px; padding-left: 8px; }
.side-brand { flex: 1; display: block; text-decoration: none; color: inherit; }
.side-brand img { display: block; height: 40px; width: auto; }
.side-brand b { display: block; margin-top: 6px; font-size: 13px; font-weight: 700; color: var(--on-ai-sub); }
.side .side-brand:focus-visible { outline-offset: 4px; }
.side-close { width: 48px; height: 48px; margin: -8px -4px 0 0; display: grid; place-items: center; background: none; border: 0; color: #fff; cursor: pointer; border-radius: var(--r); }
.side-close svg { width: 22px; height: 22px; }
.side-cta { position: relative; display: flex; align-items: center; gap: 12px; min-height: 52px; margin: 18px 0 10px; padding: 0 14px; background: #fff; color: var(--ai); border-radius: var(--r); font-size: 15px; font-weight: 700; text-decoration: none; }
.side-cta svg { width: 22px; height: 22px; stroke-width: 1.9; }
.side .side-cta:focus-visible { outline-color: var(--sky); outline-offset: -4px; }
.side-item { position: relative; display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 12px; border-radius: var(--r); color: var(--on-ai-sub); font-size: 15px; text-decoration: none; background: none; border: 0; width: 100%; text-align: left; cursor: pointer; }
.side-item svg { width: 22px; height: 22px; stroke-width: 1.75; }
.side-item.on { background: var(--on-ai-active); color: #fff; font-weight: 700; }
.side-item.on::before, .side-cta.on::before { content: ""; position: absolute; left: -12px; top: 6px; bottom: 6px; width: 4px; background: var(--sky); border-radius: 0 2px 2px 0; }
@media (hover: hover) { .side-item:hover { background: var(--on-ai-hover); } .side-item.on:hover { background: var(--on-ai-active); } }
.side-sep { height: 1px; background: var(--on-ai-line); margin: 10px 0; }
.side-count { margin-left: auto; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px; background: var(--warn); color: #fff; font-size: 13px; font-weight: 700; line-height: 24px; text-align: center; }
.side-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--on-ai-line); }
.side-foot .side-item { min-height: 44px; font-size: 14px; color: var(--on-ai-dim); }
.side-foot .side-item svg { width: 20px; height: 20px; }
.side-me { display: flex; align-items: center; gap: 10px; padding: 12px 12px 0; min-width: 0; }
.side-me .av { width: 36px; height: 36px; flex: none; border-radius: 50%; background: var(--on-ai-active); color: #fff; font-weight: 700; display: grid; place-items: center; }
.side-me > div { min-width: 0; }
.side-me b { display: block; color: #fff; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-me small { display: block; color: var(--on-ai-dim); font-size: 12px; line-height: 1.4; }

nav.tabs { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; height: var(--tab-space); padding-bottom: env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(4, 1fr); background: var(--paper); border-top: 1px solid var(--rule); }
nav.tabs a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 48px; font-size: 12px; color: var(--sub); text-decoration: none; }
nav.tabs a svg { width: 24px; height: 24px; stroke-width: 1.75; }
nav.tabs a.on { color: var(--ai); font-weight: 700; }
nav.tabs a.on::before { content: ""; position: absolute; top: 0; left: 50%; width: 40px; margin-left: -20px; height: 3px; background: var(--ai); }
nav.tabs a.cta { color: var(--ai); font-weight: 700; }
nav.tabs a.cta .tab-ic { width: 48px; height: 30px; border-radius: 15px; background: var(--ai); color: #fff; display: grid; place-items: center; }
nav.tabs a.cta svg { width: 20px; height: 20px; }
.tab-ic { position: relative; display: inline-flex; }
.dot { position: absolute; top: -5px; left: 14px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--warn); color: #fff; font-size: 11px; font-style: normal; font-weight: 700; line-height: 18px; text-align: center; }

main#view { container-type: inline-size; container-name: page; padding: 16px 16px calc(var(--tab-space) + 24px); }
main#view:has(> .fab) { padding-bottom: calc(var(--tab-space) + 96px); }
@media (min-width: 600px) { main#view { padding-left: 24px; padding-right: 24px; } }
.page { max-width: var(--page-w); margin-inline: auto; }
.page.narrow { max-width: var(--page-narrow); }
.page-head { display: none; }
.back { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; margin: -8px 0 4px -6px; padding: 0 6px; color: var(--ai); font-weight: 700; text-decoration: none; max-width: 100%; }
.back span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.back svg { width: 20px; height: 20px; }

@media (min-width: 1024px) {
  .topbar, nav.tabs, .side-close, .scrim { display: none !important; }
  .side { width: var(--side-w); transform: none; visibility: visible; transition: none; }
  main#view { margin-left: var(--side-w); padding: 28px 40px 48px; }
  main#view:has(> .fab) { padding-bottom: 48px; }
  .page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; }
  .page-head h1 { flex: 1; margin: 0; font-size: 22px; font-weight: 700; color: var(--ai); }
  .page-head h1::before { content: ""; display: block; width: 24px; height: 3px; background: var(--sky); margin-bottom: 10px; }
  .fab { display: none !important; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ---------- カード・共通 ---------- */
.card { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-card); padding: var(--pad); margin-bottom: var(--gap); min-width: 0; }
.card > h2 { font-size: 16px; font-weight: 700; margin: 0 0 12px; color: var(--ai); display: flex; align-items: center; gap: 8px; text-wrap: balance; word-break: auto-phrase; }
.nw { white-space: nowrap; } /* phrased() のまとまり。まとまりの途中では折らない */
.item-name > span { display: block; }
.item-name .item-sub { display: block; font-size: 13px; font-weight: 400; color: var(--sub); line-height: 1.5; word-break: auto-phrase; } /* itemName() の括弧の中 */
.card > h2::before { content: ""; width: 14px; height: 3px; background: var(--sky); flex: none; }
@media (min-width: 1024px) { .card > h2 { font-size: 17px; } }
.card.none { text-align: center; }
.card.none p { margin: 0 0 12px; color: var(--sub); }
.card.one-line { display: flex; align-items: center; gap: 10px; min-height: 56px; padding-block: 8px; color: var(--go); font-weight: 700; }
.card.one-line svg { width: 22px; height: 22px; }
.card.list { padding-block: 4px; }
.card.list > h2 { margin-top: 12px; }
.muted { color: var(--sub); font-size: 14px; }
.pad { padding: 12px 4px; }
.pre { white-space: pre-wrap; margin: 0; }
.why { margin: 8px 0 0; font-size: 14px; color: var(--sub); }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.row.end { justify-content: flex-end; margin-bottom: var(--gap); }
.gap8 { gap: 8px; margin-top: 8px; }
.mb-gap { margin-bottom: var(--gap); } /* 下のカードとの間（月額の「契約を足す」と一覧が2pxしか空いていなかった） */
.grow { flex: 1; min-width: 0; }
.nowrap { white-space: nowrap; }
.ellipsis { display: block; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strong { font-weight: 700; }
.num, .amt { font-variant-numeric: tabular-nums; }
.amt { color: var(--ai); font-weight: 800; white-space: nowrap; }
.err-text { color: var(--err); }
.warn-text { color: var(--warn); font-weight: 700; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.warn-text svg { width: 18px; height: 18px; }
.more { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; margin-top: 4px; font-size: 14px; font-weight: 700; text-decoration: none; }
.more svg { width: 18px; height: 18px; }
.count-pill { min-width: 24px; height: 24px; padding: 0 8px; border-radius: 12px; background: var(--ai); color: #fff; font-size: 13px; line-height: 24px; text-align: center; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.stack { display: grid; gap: 8px; margin-top: 8px; }
.band { display: flex; align-items: flex-start; gap: 8px; padding: 12px 14px; margin: 0 0 var(--gap); border: 1px solid var(--rule); border-radius: var(--r); background: var(--paper); font-size: 14px; color: var(--text); text-decoration: none; }
.band.warn { border-left: 4px solid var(--warn); }
.band svg { width: 20px; height: 20px; color: var(--warn); margin-top: 1px; }
.band > span { flex: 1; min-width: 0; }
.card.jump { scroll-margin-top: calc(72px + env(safe-area-inset-top)); } /* 月額の一覧から開いたとき、上の帯に隠れないように */
button.band { width: 100%; min-height: 48px; text-align: left; font: inherit; font-size: 14px; cursor: pointer; }

/* スケルトン（200ms を超えたら） */
.skel i { display: block; height: 14px; margin: 10px 0; border-radius: 4px; background: #E3EDF3; }
.skel i:first-child { width: 40%; height: 18px; }
.skel i:last-child { width: 70%; }
.center-msg { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 64px 16px; }
.center-msg > svg { width: 40px; height: 40px; color: var(--ai); }
.center-msg h2 { margin: 0; font-size: 17px; }
.center-msg p { margin: 0 0 12px; color: var(--sub); }

/* 空の画面 */
.empty { display: grid; justify-items: center; text-align: center; padding: 40px 16px 24px; }
.empty > svg { width: min(200px, 56vw); height: auto; margin-bottom: 16px; }
.empty .empty-title { font-size: 17px; font-weight: 700; margin: 0; }
.empty p { margin: 6px 0 0; color: var(--sub); max-width: 22em; }
.empty .btn { margin-top: 20px; width: 100%; max-width: 320px; }
.ill { fill: none; stroke: var(--ai); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ill .f { fill: #fff; } .ill .b { fill: var(--mist); }

/* ---------- 札（白地・1px枠・アイコン＋文字＋色） ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; min-height: 22px; padding: 0 7px; border: 1px solid var(--gray-line); border-radius: var(--r-s); background: #fff; color: var(--sub); font-size: 12px; font-weight: 700; line-height: 1.4; white-space: nowrap; flex: none; }
.badge svg { width: 13px; height: 13px; stroke-width: 2.4; }
.badge.ai { color: var(--ai); border-color: var(--ai); }
.badge.go { color: var(--go); border-color: var(--go); }
.badge.warn { color: var(--warn); border-color: var(--warn); }
.badge.err { color: var(--err); border-color: var(--err); }
.badge.new { color: var(--ai); background: var(--mist); border-color: var(--mist-line); }
.badge.strike > span { text-decoration: line-through; }
.dots6 { display: inline-flex; gap: 2px; }
.dots6 i { width: 5px; height: 5px; border-radius: 50%; border: 1px solid currentColor; }
.dots6 i.on { background: currentColor; }
.badges { display: inline-flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.next { display: inline-flex; align-items: center; gap: 3px; font-size: 14px; color: var(--sub); white-space: nowrap; }
.next svg { width: 15px; height: 15px; }
.next.today { color: var(--ai); font-weight: 700; }
.next.late { color: var(--warn); font-weight: 700; }

/* ---------- ボタン ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px; border: 2px solid var(--ai); border-radius: var(--r); background: #fff; color: var(--ai); font-size: 16px; font-weight: 700; text-decoration: none; cursor: pointer; white-space: nowrap; max-width: 100%; }
.btn span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.btn svg { width: 18px; height: 18px; }
.btn.primary { background: var(--go); border-color: var(--go); color: #fff; }
.btn.primary:active { background: var(--go-d); border-color: var(--go-d); transform: scale(.98); }
.btn.danger { border-color: var(--err); color: var(--err); }
.btn.quiet { border-color: transparent; background: none; padding: 0 8px; }
.btn.quiet.danger { color: var(--err); border-color: transparent; }
.btn.small { padding: 0 12px; font-size: 15px; }
.btn.big { width: 100%; min-height: 56px; font-size: 17px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn[aria-busy="true"] { opacity: .7; }
.fab { position: fixed; right: 16px; bottom: calc(var(--tab-space) + 16px); z-index: 25; border-radius: 28px; min-height: 52px; padding: 0 20px; box-shadow: 0 4px 12px rgba(0,0,102,.25); }
.icon-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; flex: none; padding: 0; border: 0; border-radius: var(--r); background: none; color: var(--ai); cursor: pointer; text-decoration: none; }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn.line { border: 1px solid var(--rule); background: #fff; }
button.link { background: none; border: 0; padding: 0; min-height: 44px; color: var(--ai); text-decoration: underline; cursor: pointer; font-size: 14px; }
button.link.muted { color: var(--sub); }

/* ---------- フォーム ---------- */
.f { margin-bottom: 14px; position: relative; }
.f-label { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--sub); margin-bottom: 6px; }
.f > .tip { vertical-align: top; }
.req { font-style: normal; font-size: 12px; color: var(--warn); border: 1px solid var(--warn); border-radius: var(--r-s); padding: 0 5px; line-height: 1.5; }
.f-hint { display: block; font-size: 13px; color: var(--sub); margin-top: 4px; }
.f-err { display: flex; align-items: center; gap: 4px; font-size: 14px; color: var(--err); margin-top: 4px; }
.f-err svg { width: 16px; height: 16px; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=tel], input[type=url], input[type=date], input[type=file], select, textarea {
  display: block; width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid var(--input-line); border-radius: var(--r); background: #fff; color: var(--text); font-size: 16px; }
input[type=date] { -webkit-appearance: none; appearance: none; min-height: 48px; }
input[type=file] { padding: 10px; }
textarea { min-height: 96px; resize: vertical; line-height: 1.7; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ai); box-shadow: 0 0 0 1px var(--ai); }
input:disabled { background: var(--wall); color: var(--sub); border-style: dashed; cursor: not-allowed; -webkit-text-fill-color: var(--sub); opacity: 1; }
input.bad, select.bad, textarea.bad { border: 2px solid var(--err); }
.f.must textarea:placeholder-shown { border-color: var(--warn); border-width: 2px; } /* 必須の欄は、空のあいだだけ橙の枠（入れたあとも橙のままだった） */
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 10px; }
@media (max-width: 360px) { .grid2 { grid-template-columns: 1fr; } }
label.check { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
label.check input { width: 22px; height: 22px; accent-color: var(--ai); flex: none; }
.err-box { display: flex; align-items: flex-start; gap: 8px; padding: 12px 14px; margin: 0 0 12px; border: 2px solid var(--err); border-radius: var(--r); background: #fff; color: var(--err); font-size: 15px; }
.err-box svg { width: 20px; height: 20px; margin-top: 2px; }
.err-box > span { flex: 1; min-width: 0; color: var(--text); }
.err-box .btn { flex: none; }
.more-fields > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 700; color: var(--ai); list-style-position: inside; }
/* 開閉の見出しの印: display:flex にすると三角の印が消え、開けると分からなかった（2026-11-15 ヘルスチェック31）。右端に下向きの印、開いたら上向き */
.more-fields > summary, .price-edit > summary, .audit > summary { list-style: none; }
.more-fields > summary::-webkit-details-marker, .price-edit > summary::-webkit-details-marker, .audit > summary::-webkit-details-marker { display: none; }
.more-fields > summary::after, .price-edit > summary::after, .audit > summary::after {
  content: ""; flex: none; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg); transition: transform .15s;
}
.more-fields[open] > summary::after, .price-edit[open] > summary::after, .audit[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
details.card.more-fields > summary { margin: -4px 0; }
details.card.more-fields[open] > summary { margin-bottom: 8px; }
.seg { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); border: 1px solid var(--input-line); border-radius: var(--r); overflow: hidden; margin-bottom: 12px; }
.seg label { position: relative; display: flex; align-items: center; justify-content: center; gap: 4px; min-height: 44px; padding: 0 4px; cursor: pointer; border-right: 1px solid var(--input-line); font-size: 15px; }
.seg label:last-child { border-right: 0; }
.seg label svg { width: 18px; height: 18px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--ai); color: #fff; font-weight: 700; }
.seg label:has(input:focus-visible) { outline: 3px solid var(--sky); outline-offset: -3px; }
.search { position: relative; margin-bottom: 10px; }
.search > svg { position: absolute; left: 12px; top: 14px; width: 20px; height: 20px; color: var(--sub); pointer-events: none; }
.search input { padding-left: 42px; }

/* 「?」（見た目20px・当たり44px） */
.tip { position: relative; display: inline-flex; vertical-align: middle; }
.tip-btn { position: relative; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--sub); background: #fff; color: var(--sub); font-size: 12px; font-weight: 700; line-height: 1; padding: 0; cursor: help; }
.tip-btn::after { content: ""; position: absolute; inset: -12px; }
.tip-body { display: none; position: absolute; left: -8px; top: 28px; z-index: 35; width: 260px; max-width: 70vw; padding: 10px 12px; border-radius: var(--r); background: var(--text); color: #fff; font-size: 14px; font-weight: 400; line-height: 1.6; text-align: left; white-space: normal; }
.tip.open > .tip-body { display: block; }
@media (hover: hover) { .tip:hover > .tip-body { display: block; } }
@media (max-width: 1023px) {
  .tip.open > .tip-body { position: fixed; left: 12px; right: 12px; top: auto; bottom: calc(var(--tab-space) + 12px); width: auto; max-width: none; z-index: 80; font-size: 15px; padding: 14px 16px; }
  .tip:hover > .tip-body { display: none; }
  .tip.open:hover > .tip-body { display: block; }
}

/* ---------- トースト ---------- */
.toast { position: fixed; left: 50%; bottom: calc(var(--tab-space) + 16px); transform: translateX(-50%); z-index: 90; display: flex; align-items: center; gap: 8px; max-width: min(92vw, 520px); padding: 10px 16px; border-radius: var(--r); background: var(--text); color: #fff; font-size: 15px; }
.toast.err { background: var(--err); padding-right: 4px; }
.toast-x { width: 44px; height: 44px; display: grid; place-items: center; background: none; border: 0; color: #fff; cursor: pointer; flex: none; }
.toast-x svg { width: 18px; height: 18px; }
@media (min-width: 1024px) { .toast { left: calc(50% + var(--side-w) / 2); bottom: 24px; } }

/* ---------- シート（SP は下から最大85dvh・PC は中央480px） ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 70; display: flex; align-items: flex-end; justify-content: center; }
.sheet-scrim { position: absolute; inset: 0; background: var(--scrim); opacity: 0; transition: opacity 200ms var(--ease); }
.sheet { position: relative; width: 100%; max-height: 85dvh; display: flex; flex-direction: column; background: var(--paper); border-radius: var(--r-card) var(--r-card) 0 0; padding-bottom: env(safe-area-inset-bottom); transform: translateY(24px); opacity: 0; transition: transform 220ms var(--ease), opacity 220ms var(--ease); }
.sheet:focus { outline: none; }
.sheet-wrap.open .sheet-scrim { opacity: 1; }
.sheet-wrap.open .sheet { transform: none; opacity: 1; }
.sheet.tall { height: 85dvh; }
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--rule); }
.sheet-head h2 { flex: 1; min-width: 0; margin: 0; font-size: 17px; font-weight: 700; color: var(--ai); }
.sheet-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px; }
.sheet-foot { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--rule); }
.sheet-foot .pick-sum { flex: 1; min-width: 0; font-size: 14px; font-weight: 700; color: var(--ai); }
@media (min-width: 1024px) {
  .sheet-wrap { align-items: center; }
  .sheet { width: 480px; max-height: min(85vh, 760px); border-radius: var(--r-card); transform: translateY(8px); }
  .sheet.tall { height: min(85vh, 760px); }
  .sheet-wrap:has(.sheet.panel) { justify-content: flex-end; align-items: stretch; }
  .sheet.panel { width: 520px; max-height: none; height: 100%; border-radius: 0; transform: translateX(24px); }
}
.confirm .kv { margin-bottom: 12px; }
.confirm-note { margin: 0 0 12px; font-size: 15px; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 0; }
.kv dt { color: var(--sub); font-size: 14px; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.kv.small { font-size: 14px; }
.menu-list, .pick-list { display: grid; }
.menu-item, .pick { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 8px; border: 0; border-bottom: 1px solid var(--rule); background: none; text-align: left; cursor: pointer; width: 100%; color: var(--text); font-size: 16px; }
.menu-item svg { width: 20px; height: 20px; color: var(--ai); }
.menu-item.danger, .menu-item.danger svg { color: var(--err); }
.pick > span:first-child { flex: 1; min-width: 0; }
.pick small { color: var(--sub); font-size: 13px; }
.pick > svg { width: 20px; height: 20px; color: var(--ai); }
.pick.on { background: var(--mist); }
.pick .badge { font-size: 13px; }

/* ---------- ホーム ---------- */
.home { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 1fr); align-items: start; } /* start: 隣のカードに合わせて縦に伸び、中が空いていた */
.home > * { margin: 0; }
@container page (min-width: 680px) {
  .home { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .home .span2 { grid-column: 1 / -1; }
  .home .o-first { order: -2; }
  .home .o-tiles { order: -1; }
}
.review-band { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 12px 0 14px; border: 1px solid var(--rule); border-left: 4px solid var(--warn); border-radius: var(--r-card); background: var(--paper); color: var(--text); text-decoration: none; font-weight: 700; }
.review-band svg { width: 22px; height: 22px; color: var(--warn); }
.review-band span { flex: 1; }
.review-band b { color: var(--warn); font-size: 18px; }
.rows { display: grid; }
.row-link { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 8px 2px; border: 0; border-bottom: 1px solid var(--rule); background: none; color: inherit; text-decoration: none; text-align: left; width: 100%; cursor: pointer; font-size: 15px; }
.rows > .row-link:last-child { border-bottom: 0; }
.row-link > svg { width: 20px; height: 20px; color: var(--sub); }
.rl-main { flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.rl-main > b { display: block; font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.rl-sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; color: var(--sub); margin-top: 2px; }
.mail-kind { display: inline-flex !important; align-items: center; gap: 6px; }
.mail-kind svg { width: 18px; height: 18px; color: var(--ai); }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@container page (min-width: 680px) { .tiles { grid-template-columns: repeat(8, minmax(0, 1fr)); } }
.tile { display: flex; flex-direction: column; justify-content: flex-start; min-height: 72px; padding: 6px 8px; border: 1px solid var(--rule); border-radius: var(--r); background: var(--wall); color: var(--text); text-decoration: none; line-height: 1.3; }
.tile b { font-size: 24px; font-weight: 800; color: var(--ai); }
.tile span { font-size: 13px; color: var(--text); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.tile.zero b { color: var(--sub); }
@media (hover: hover) { .tile:hover { border-color: var(--ai); } }
/* 金額は折り返さない。スマホ幅で2列に入りきらないときは1列にする（2026-11-14 375px で「¥150,00／0」に折れた） */
/* 数字は横に並べる（スマホで5つの大きな数字が縦に積まれ、長くなっていた。2026-11-15 デザインの点検）。字の大きさは画面の幅に合わせる */
.nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr)); gap: 12px; }
.nums.sub { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--rule); grid-template-columns: repeat(auto-fit, minmax(min(100%, 90px), 1fr)); }
.num span { display: block; font-size: 14px; color: var(--sub); }
.num b { display: block; font-size: clamp(20px, 6cqi, 28px); font-weight: 800; color: var(--ai); line-height: 1.3; white-space: nowrap; }
.nums.sub .num b { font-size: clamp(16px, 4.5cqi, 20px); }
@media (min-width: 1024px) { .num b { font-size: 32px; } }

/* ---------- 一覧（SP は縦2段・PC は表） ---------- */
.chips { position: relative; display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 10px; scrollbar-width: none; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent); }
.chips::-webkit-scrollbar { display: none; }
.chips > :last-child { margin-right: 24px; }
.chip { flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--rule); border-radius: var(--r); background: var(--paper); color: var(--text); font-size: 15px; text-decoration: none; cursor: pointer; white-space: nowrap; }
.chip.on { background: var(--ai); border-color: var(--ai); color: #fff; font-weight: 700; }
.cust-row { display: block; min-height: 64px; padding: 10px 4px; border: 0; border-bottom: 1px solid var(--rule); color: inherit; text-decoration: none; background: none; width: 100%; text-align: left; }
.card.list > .cust-row:last-child { border-bottom: 0; }
.cr-top { display: flex; align-items: flex-start; gap: 8px; }
.cr-top > b:first-child { flex: 1; min-width: 0; font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.cr-sub { font-size: 14px; color: var(--sub); }
.cr-sub:empty { display: none; }
.cr-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; font-size: 14px; color: var(--sub); min-width: 0; }
.cr-foot.nowrap-foot { flex-wrap: nowrap; }
.dup-first { margin-left: auto; font-size: 14px; color: var(--ai); }
.cr-foot .ellipsis { max-width: 100%; }
.pick-row { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.pick-row input[type=checkbox] { width: 24px; height: 24px; accent-color: var(--ai); flex: none; margin: 12px; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { padding: 12px 8px; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: middle; }
.tbl th { font-size: 13px; font-weight: 700; color: var(--sub); padding-top: 0; white-space: nowrap; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .r { text-align: right; white-space: nowrap; }
.tbl td small { display: block; color: var(--sub); font-size: 13px; }
.tbl td .badge + .badge { margin-left: 4px; }
.tbl tr.click { cursor: pointer; }
@media (hover: hover) { .tbl tr.click:hover td { background: var(--wall); } }
.total-card { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.total-card span { color: var(--sub); }
.total-card b { font-size: 28px; font-weight: 800; color: var(--ai); }
.rate-card { display: grid; gap: 4px; }
.rate-card > p { margin: 0; }
.rate-log { list-style: none; margin: 0; padding: 0; }
.rate-log li { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--rule); }

/* ---------- お客様の詳細 ---------- */
.detail { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 1fr); align-items: start; }
@container page (min-width: 880px) { .detail { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); } }
.d-main, .d-side { min-width: 0; }
/* 狭い画面（1列）: DESIGN.md §3-2 の順に並べ替える（見出し→面談→見積・請求→月額→対応の記録→送ったメール→リンク）。
   前は 見出し→対応の記録→面談… の順で、見積・請求が長い記録の下に隠れていた（2026-11-15 ヘルスチェック31）。広い画面は左右の2列のまま */
@container page (max-width: 879.98px) {
  .detail { display: flex; flex-direction: column; align-items: stretch; gap: 0; } /* stretch: 上の grid の align-items: start のままだと、カードが中身の幅に縮んだ */
  .d-main, .d-side { display: contents; }
  .detail .cust-head { order: 1; }
  .detail .d-side > * { order: 2; }
  .detail .act-card { order: 3; }
  .detail .d-side > .after-act { order: 4; }
}
.ch-top { display: flex; align-items: flex-start; gap: 8px; }
.ch-top > div { flex: 1; min-width: 0; }
.card .cust-name { margin: 0; font-size: 20px; font-weight: 700; color: var(--text); }
.card .cust-name::before { display: none; }
.cust-person { margin: 2px 0 0; color: var(--sub); }
.ch-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.stage-btn, .next-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 10px; border: 1px solid var(--rule); border-radius: var(--r); background: #fff; cursor: pointer; color: var(--ai); }
.stage-btn > svg, .next-btn > svg { width: 16px; height: 16px; }
.contact { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0 12px; margin: 0 0 12px; }
.contact dt { display: flex; align-items: center; gap: 6px; min-height: 44px; color: var(--sub); font-size: 14px; }
.contact dt svg { width: 16px; height: 16px; }
.contact dd { margin: 0; display: flex; align-items: center; min-height: 44px; min-width: 0; }
.contact .tel { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; }
.with-copy { gap: 4px; }
.memo { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; margin: 0 0 14px; padding: 10px 12px; border-radius: var(--r); background: var(--wall); color: var(--text); text-decoration: none; white-space: pre-wrap; font-size: 14px; }
.cust-head .btn.big { margin-bottom: 8px; }
.card .sub-h { font-size: 14px; font-weight: 700; color: var(--sub); margin: 8px 0 0; }
.act-form { padding-bottom: 14px; margin-bottom: 8px; border-bottom: 1px solid var(--rule); }
.acts { list-style: none; margin: 0; padding: 0; }
.act { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.act:last-child { border-bottom: 0; }
.act-ic { width: 32px; height: 32px; flex: none; border-radius: 50%; background: var(--mist); color: var(--ai); display: grid; place-items: center; }
.act-ic svg { width: 16px; height: 16px; }
.act > div { min-width: 0; flex: 1; }
.act-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--sub); }
.act-meta b { color: var(--text); }
.act-body { margin: 2px 0 0; white-space: pre-wrap; }
.act.thin { display: grid; grid-template-columns: 16px minmax(0, 1fr); column-gap: 8px; row-gap: 2px; align-items: start; font-size: 14px; color: var(--sub); }
.act.thin svg { width: 16px; height: 16px; color: var(--sub); margin-top: 3px; }
/* 日付と記録者は本文の下に置く（右に並べると、375px で本文が細く押しつぶされていた。2026-11-15 ヘルスチェック31） */
.act.thin small { grid-column: 2; font-size: 12px; }
.own-link { display: flex; align-items: center; gap: 12px; }
.qr-sm { flex: none; width: 76px; height: 76px; padding: 1px; border: 1px solid var(--rule); border-radius: var(--r); background: #fff; cursor: zoom-in; }
.qr-sm img { display: block; width: 72px; height: 72px; }
.ol-text { flex: 1; min-width: 0; display: grid; gap: 6px; font-size: 14px; justify-items: start; }
.ol-text .ellipsis { width: 100%; }

/* ---------- 見積書・請求書 ---------- */
.doc-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.doc-head > a, .doc-head > b { flex: 1; min-width: 0; }
.doc-no { font-size: 18px; color: var(--ai); }
.lines { display: grid; gap: 8px; margin-bottom: 12px; }
.line { padding: 10px 12px; border: 1px solid var(--rule); border-radius: var(--r); background: #fff; }
.line.discount { background: var(--wall); }
.ln-top { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 6px; }
.ln-top > :first-child { flex: 1; min-width: 0; }
.ln-name { font-size: 15px; font-weight: 700; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; padding-top: 10px; }
.ln-calc { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.ln-calc .f { margin: 0; flex: 1; min-width: 160px; }
.ln-amt { margin-left: auto; font-size: 18px; font-weight: 800; color: var(--ai); white-space: nowrap; }
.times { color: var(--sub); }
.ln-price { display: inline-flex; align-items: center; gap: 8px; flex-wrap: nowrap; min-width: 0; } /* 「×」と単価と単位を一緒に折り返す */
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--input-line); border-radius: var(--r); overflow: hidden; background: #fff; flex: none; }
.stepper button { width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: none; color: var(--ai); cursor: pointer; }
.stepper button svg { width: 18px; height: 18px; }
.stepper input.qty, .stepper output { width: 52px; min-height: 44px; border: 0; border-left: 1px solid var(--rule); border-right: 1px solid var(--rule); border-radius: 0; text-align: center; padding: 0 4px; font-size: 16px; font-weight: 700; display: grid; place-items: center; }
.stepper input.qty:focus { box-shadow: inset 0 0 0 2px var(--ai); }
.price-in { position: relative; display: block; flex: none; width: 140px; }
.price-in .yen-mark { position: absolute; left: 10px; top: 12px; color: var(--sub); pointer-events: none; }
.price-in input { padding-left: 26px; text-align: right; }
input.unit { width: 80px; flex: none; }
.unit-t { color: var(--sub); font-size: 14px; }
.line > .badge { margin-top: 6px; }
.line > label.check { margin-top: 4px; }
.totals { display: grid; grid-template-columns: minmax(0, 1fr) max-content; gap: 6px 0; margin: 0; align-items: baseline; }
.totals dd { padding-left: 16px; } /* 列のすき間は dd の左の余白でとる（gap だと税込の行の線が2本に途切れていた。ヘルスチェック31） */
.totals dt { color: var(--sub); display: flex; align-items: center; gap: 6px; }
.totals dd { margin: 0; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.totals .big { font-size: 15px; color: var(--text); font-weight: 700; padding-top: 6px; border-top: 1px solid var(--rule); }
.totals dd.big { font-size: 28px; font-weight: 800; color: var(--ai); }
/* 税込の行は、左右の箱を行の上から下まで伸ばして、上の線の高さをそろえる（ベースラインでそろえると、大きい数字の箱だけ上に出て、線が段違いになっていた。2026-11-15 デザインの点検） */
.totals .big { align-self: stretch; }
.totals dt.big { align-items: flex-end; padding-bottom: 6px; }
.rlines { margin-bottom: 12px; }
.rline { padding: 10px 0; border-bottom: 1px solid var(--rule); }
.rl-name { display: flex; align-items: flex-start; gap: 8px; }
.rl-name b { flex: 1; min-width: 0; }
.rl-calc { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 14px; color: var(--sub); }
.rl-calc b { color: var(--text); font-size: 16px; }
.actions { display: grid; gap: 8px; }
.actions .two { margin: 0; }
.has-dock { padding-bottom: 8px; }
.dock { position: sticky; bottom: calc(var(--tab-space) + 8px); z-index: 15; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin-top: var(--gap); padding: 8px; border: 1px solid var(--rule); border-radius: var(--r-card); background: rgba(240, 248, 252, .96); }
.dock.one { grid-template-columns: minmax(0, 1fr); }
.dock .btn { min-height: 52px; }
@media (min-width: 1024px) { .dock { bottom: 16px; } }
.price-list { display: grid; margin-top: 4px; }
.price-row { display: flex; align-items: center; gap: 8px; min-height: 64px; border-bottom: 1px solid var(--rule); border-left: 4px solid transparent; }
.price-row.on { border-left-color: var(--ai); background: var(--mist); }
.pr-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 8px 8px 8px 10px; border: 0; background: none; text-align: left; cursor: pointer; color: var(--text); }
.pr-name { flex: 1; min-width: 0; }
.pr-name b { display: block; font-size: 15px; font-weight: 700; }
.pr-name small { color: var(--sub); font-size: 13px; }
.pr-price { font-size: 16px; font-weight: 800; color: var(--ai); white-space: nowrap; }
.pr-price small { font-size: 12px; font-weight: 700; margin-left: 2px; }
.stepper.sm { margin-right: 6px; }

/* ---------- QR・リンク ---------- */
.channels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.channel { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 72px; border: 1px solid var(--input-line); border-radius: var(--r); background: #fff; font-size: 15px; font-weight: 700; cursor: pointer; }
.channel svg { width: 26px; height: 26px; color: var(--ai); stroke-width: 1.8; }
.channel input { position: absolute; opacity: 0; pointer-events: none; }
.channel:has(input:checked) { background: var(--ai); border-color: var(--ai); color: #fff; }
.channel:has(input:checked) svg { color: #fff; }
.channel:has(input:focus-visible) { outline: 3px solid var(--sky); outline-offset: 2px; }
.pick-btn { justify-content: flex-start; }
.pick-btn > span { flex: 1; text-align: left; }
.guide-text { min-height: 220px; line-height: 1.8; }
.guide-tools { display: flex; justify-content: flex-end; min-height: 24px; }
.count { font-size: 13px; color: var(--sub); }
.copy-fail { margin: 0; color: var(--err); font-size: 14px; text-align: center; }
.link-card { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 8px 8px 8px 12px; border: 1px solid var(--rule); border-radius: var(--r); background: #fff; margin-bottom: 8px; }
.link-card > svg { width: 22px; height: 22px; color: var(--ai); }
.link-card .t { flex: 1; min-width: 0; }
.link-card .t b { display: block; font-size: 15px; }
.link-card .t small { display: block; font-size: 14px; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qr-card { text-align: center; }
.qr-big { display: grid; place-items: center; padding: 12px; margin: 0 auto 12px; background: #fff; }
.qr-big img { display: block; width: 240px; height: 240px; max-width: 100%; }
.qr-url { font-size: 14px; color: var(--sub); margin: 0 0 12px; overflow-wrap: anywhere; }

/* ---------- 資料 ---------- */
.file-grid { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 1fr); }
@container page (min-width: 600px) { .file-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.file-card { display: flex; gap: 12px; padding: var(--pad); border: 1px solid var(--rule); border-radius: var(--r-card); background: var(--paper); }
.file-card.is-hidden { opacity: .6; }
.file-tile { width: 72px; height: 72px; flex: none; border-radius: var(--r); background: var(--mist); color: var(--ai); display: grid; place-items: center; }
.file-tile svg { width: 30px; height: 30px; stroke-width: 1.75; }
.file-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.file-body > b { font-size: 16px; }
.file-body > small { font-size: 14px; color: var(--sub); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.file-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 8px; }

/* ---------- 送ったメール ---------- */
.mail-row { display: block; width: 100%; min-height: 72px; padding: 10px 4px; border: 0; border-bottom: 1px solid var(--rule); background: none; text-align: left; cursor: pointer; color: inherit; font-size: 15px; }
.card.list > .mail-row:last-child { border-bottom: 0; }
.mr-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mr-to { font-size: 14px; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mr-foot { display: flex; gap: 12px; font-size: 14px; }
.mr-foot .ellipsis { flex: 1; }
.mail-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.mail-subject { font-size: 16px; font-weight: 700; margin: 16px 0 8px; }
.mail-body { margin: 0 0 12px; padding: 14px; border: 1px solid var(--rule); border-radius: var(--r); background: #fff; font: inherit; font-size: 15px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- 管理 ---------- */
.admin { display: grid; gap: 24px; }
@media (min-width: 1024px) { .admin { grid-template-columns: 200px minmax(0, 1fr); align-items: start; } .admin-index { position: sticky; top: 24px; } }
.admin-body { min-width: 0; }
.admin-h { font-size: 18px; color: var(--ai); margin: 0 0 12px; }
.admin-index { display: grid; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-card); padding: 4px; }
.ai-item { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 56px; padding: 6px 10px; border-radius: var(--r); color: var(--text); text-decoration: none; }
.ai-item > span:first-of-type { flex: 1; min-width: 0; }
.ai-item > svg:first-child { width: 20px; height: 20px; color: var(--ai); }
.ai-item > svg:last-child { width: 18px; height: 18px; color: var(--sub); }
.ai-item.on { background: var(--mist); font-weight: 700; }
.ai-item .side-count { margin-left: 0; }
@media (min-width: 1024px) { .ai-item { min-height: 48px; font-size: 14px; } .ai-item > svg:last-child { display: none; } .ai-item .badge { flex-basis: 100%; justify-content: flex-start; width: max-content; } }
.invite-check { margin-bottom: 12px; }
.inv-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.inv-row b { display: block; overflow-wrap: anywhere; }
.inv-row small { display: block; font-size: 13px; color: var(--sub); }
.inv-mark { width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center; border: 1px solid currentColor; }
.inv-mark svg { width: 16px; height: 16px; }
.inv-row.ok .inv-mark { color: var(--go); }
.inv-row.warn .inv-mark, .inv-row.warn .inv-msg { color: var(--warn); }
.inv-row.err .inv-mark, .inv-row.err .inv-msg { color: var(--err); }
.price-edit { border-bottom: 1px solid var(--rule); }
.price-edit > summary { display: flex; align-items: center; gap: 10px; min-height: 56px; cursor: pointer; list-style-position: inside; }
.price-edit[open] > summary { margin-bottom: 8px; }
.price-edit[open] { padding-bottom: 12px; }
.price-edit.off > summary { color: var(--sub); }
.bk-hours { display: grid; grid-template-columns: 2em minmax(0, 1fr); align-items: center; gap: 8px; margin-bottom: 8px; }
.bk-hours > span { font-weight: 700; }
.bk-hours .f-err { grid-column: 2; }
.secret { padding: 12px; border: 1px solid var(--rule); border-radius: var(--r); background: var(--wall); font-size: 14px; overflow-wrap: anywhere; white-space: pre-wrap; }
.switch-row { display: flex; align-items: center; gap: 12px; min-height: 64px; border-bottom: 1px solid var(--rule); }
.switch-row:last-child { border-bottom: 0; }
.switch-row b { display: inline-flex; align-items: center; gap: 6px; }
.sw-word { font-size: 14px; color: var(--sub); min-width: 2.4em; text-align: right; }
.switch { position: relative; width: 52px; height: 32px; flex: none; border: 0; border-radius: 16px; background: var(--gray-line); cursor: pointer; padding: 0; }
.switch::after { content: ""; position: absolute; inset: -6px; }
.switch i { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: transform 180ms var(--ease); }
.switch.on { background: var(--go); }
.switch.on i { transform: translateX(20px); }
.audit { border-bottom: 1px solid var(--rule); padding: 4px 0; }
.audit > summary { display: flex; align-items: center; gap: 10px; min-height: 48px; cursor: pointer; list-style-position: inside; }
.audit > summary .muted { flex: 1; }
.audit[open] { padding-bottom: 12px; }
.csv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }

/* ---------- ログイン ---------- */
.auth-page { display: flex; min-height: 100vh; min-height: 100dvh; align-items: center; justify-content: center; padding: 16px; }
.auth-card { width: 100%; max-width: 420px; overflow: hidden; border: 1px solid var(--rule); border-radius: var(--r-card); background: var(--paper); }
.auth-brand { display: flex; align-items: center; gap: 12px; padding: 16px 20px; background: var(--ai); color: var(--on-ai-sub); font-size: 13px; font-weight: 700; }
.auth-brand img { height: 40px; width: auto; }
.auth-body { padding: 20px; }
.auth-body h1 { display: flex; align-items: center; gap: 8px; font-size: 18px; color: var(--ai); margin: 0 0 16px; }
.auth-body > p { margin-top: -8px; }
.auth-links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; }

/* 2つ並びのボタン（「予約のリンクを送る」「リンクとQR」など）は、375px で字が切れないよう折り返す */
.two .btn { white-space: normal; line-height: 1.35; padding: 6px 10px; text-align: center; }
.two .btn span { overflow: visible; }
