/* 画面の共通スタイル。色・書体・余白は tokens.css の変数だけを使う。 */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html { height: 100%; }
body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  display: flex; flex-direction: column;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: var(--line-height-body);
}
[hidden] { display: none !important; }
a { color: inherit; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--color-ink); outline-offset: 2px; }

.mast {
  display: flex; justify-content: space-between; align-items: center; gap: var(--space-2) var(--space-3); flex-wrap: wrap;
  padding: 6px max(var(--space-3), env(safe-area-inset-right, 0px)) 6px max(var(--space-3), env(safe-area-inset-left, 0px));
  padding-top: max(6px, env(safe-area-inset-top, 0px));
  border-bottom: var(--rule-bold);
}
.mast__name { font-family: var(--font-display); font-weight: 800; font-size: var(--text-md); text-decoration: none; min-height: 36px; display: inline-flex; align-items: center; gap: 8px; }
.mast__mark { display: inline-grid; place-items: center; width: 28px; height: 28px; background: var(--color-season); color: var(--color-season-contrast); font-size: var(--text-md); line-height: 1; }
.mast__who { display: inline-grid; text-decoration: none; }
.mast__who .mark { width: 36px; height: 36px; border-color: var(--color-ink); }
.mast__nav { display: flex; gap: var(--space-3); font-size: var(--text-sm); }
.mast__nav a { min-height: 36px; display: inline-flex; align-items: center; }

/* 画面の本体。余白は「詰めて、関係のあるものを近づける」。上は 16px から始める。 */
.page {
  width: 100%; max-width: 34rem; margin: 0 auto; flex: 1;
  padding: var(--space-3) max(var(--space-3), env(safe-area-inset-right, 0px)) var(--space-5) max(var(--space-3), env(safe-area-inset-left, 0px));
}
.page > * + * { margin-top: 12px; }
.page > .sr:first-child + * { margin-top: 0; } /* 画面に出さない題のぶん、上を空けない */
.page p { margin-bottom: 0; margin-top: 0; }
.page > p + p, .page section > p + p { margin-top: var(--space-2); }

.title { font-family: var(--font-display); font-weight: 700; font-size: 1.375rem; line-height: var(--line-height-heading); margin: 0; text-wrap: balance; }
.muted { font-size: var(--text-sm); color: var(--color-text-muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--tap-min); padding: var(--space-2) var(--space-4);
  font: inherit; font-weight: 500; cursor: pointer;
  background: transparent; color: var(--color-ink);
  border: 1px solid var(--color-ink); border-radius: var(--radius);
  transition: background var(--motion-fast), color var(--motion-fast);
}
.btn--primary { background: var(--color-ink); color: var(--color-ink-contrast); width: 100%; }
.btn[disabled] { opacity: .55; cursor: progress; }

.notice { background: var(--color-surface); border-left: 4px solid var(--color-danger); padding: var(--space-3); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ── メニュー・お知らせ ── */
.flash { background: var(--color-season); color: var(--color-season-contrast); padding: 6px 12px; margin: 0; font-size: var(--text-sm); }
.notice ul { margin: var(--space-2) 0 0; padding-left: 1.25em; }
.notice--plain { border-left-color: var(--color-border-strong); }

/* ── 見出しまわり ── */
.head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.label { font-size: var(--text-sm); font-weight: 500; letter-spacing: .08em; color: var(--color-text-muted); margin: 0 0 6px; padding-top: 10px; border-top: var(--rule-thin); }
.state { font-size: var(--text-sm); font-weight: 700; color: var(--color-season); margin: 0; }
.page > section { margin-top: 20px; }
.page section > * + * { margin-top: 10px; }
.num { font-variant-numeric: tabular-nums; }
.prose { overflow-wrap: anywhere; }

/* ── 一覧（罫線で区切った行） ── */
.filter { display: flex; flex-wrap: wrap; gap: 0 var(--space-4); }
.filter a { display: inline-flex; align-items: center; min-height: var(--tap-min); }
.filter a[aria-current] { font-weight: 700; text-decoration: none; }
.rows { list-style: none; margin: 0; padding: 0; border-top: var(--rule-thin); }
.rows li { border-bottom: var(--rule-thin); }
.rows a { display: grid; gap: 1px; padding: 10px 0; text-decoration: none; }
.rows__state { font-size: var(--text-sm); font-weight: 700; color: var(--color-season); }
.rows__title { font-family: var(--font-display); font-weight: 700; font-size: var(--text-lg); line-height: var(--line-height-heading); overflow-wrap: anywhere; }
.rows__meta { font-size: var(--text-sm); color: var(--color-text-muted); font-variant-numeric: tabular-nums; }

/* ── 詳細 ── */
.meta { margin: var(--space-3) 0 0; display: grid; gap: var(--space-1); }
.meta div { display: grid; grid-template-columns: 5em 1fr; gap: var(--space-2); }
.meta dt { font-size: var(--text-sm); color: var(--color-text-muted); padding-top: 2px; }
.meta dd { margin: 0; }
.surface { background: var(--color-surface); padding: var(--space-3); }
.surface .label { border-top: 0; padding-top: 0; }
.surface__big { font-family: var(--font-display); font-weight: 700; font-size: var(--text-xl); margin: 0; }
.tally { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--space-4); }
.tally div { display: flex; justify-content: space-between; gap: var(--space-2); padding: var(--space-2) 0; border-bottom: var(--rule-thin); }
.tally dt { font-size: var(--text-sm); }
.tally dd { margin: 0; font-weight: 700; }
.voice { padding: var(--space-2) 0; border-bottom: var(--rule-thin); overflow-wrap: anywhere; }
.voice p { margin: 0; }
.voice__who { font-size: var(--text-sm); color: var(--color-text-muted); }

/* ── フォーム（1列、ラベルは上） ── */
.form { display: grid; gap: var(--space-3); }
.field { display: grid; gap: var(--space-1); border: 0; padding: 0; margin: 0; min-width: 0; }
.field label, .field legend { font-weight: 700; padding: 0; }
.field__hint { font-size: var(--text-sm); color: var(--color-text-muted); margin: 0; }
.field__error { font-size: var(--text-sm); font-weight: 700; color: var(--color-danger); margin: 0; }
.req { font-size: var(--text-xs); font-weight: 700; border: 1px solid currentColor; padding: 0 4px; margin-left: 4px; }
input[type="text"], input[type="date"], select, textarea {
  width: 100%; min-height: var(--tap-min); padding: var(--space-2) 12px;
  font: inherit; color: var(--color-ink); background: var(--color-surface);
  border: 1px solid var(--color-border-strong); border-radius: var(--radius);
}
textarea { resize: vertical; line-height: var(--line-height-body); }
[aria-invalid="true"] { border: 2px solid var(--color-danger); }
.choice { display: flex; align-items: center; gap: var(--space-2); min-height: var(--tap-min); font-weight: 400 !important; }
.choice input { width: 20px; height: 20px; accent-color: var(--color-ink); flex: none; }
.btn--danger { border-color: var(--color-danger); color: var(--color-danger); }

/* ── 4段階の反応（2×2。選ぶと墨の面に反転） ── */
.react { display: grid; gap: var(--space-3); }
.react__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.react__opt { position: relative; display: grid; }
.react__opt input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.react__opt span { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 56px; height: 100%; padding: var(--space-2); border: 1px solid var(--color-ink); font-weight: 500; line-height: 1.4; }
.react__opt input:checked + span { background: var(--color-ink); color: var(--color-ink-contrast); }
.react__opt input:focus-visible + span { outline: 3px solid var(--color-ink); outline-offset: 2px; }
/* 代案の欄は「反対」を選んだときだけ出す（:has が使えない端末では常に出る） */
@supports selector(:has(*)) {
  .react__alt { display: none; }
  .react:has(input[value="object"]:checked) .react__alt { display: grid; }
}

/* ── 折りたたみ・推進役の操作 ── */
.fold { border-top: var(--rule-thin); border-bottom: var(--rule-thin); }
.fold summary { min-height: var(--tap-min); display: flex; align-items: center; cursor: pointer; font-weight: 700; }
.fold[open] { padding-bottom: var(--space-3); }
.fold > * + * { margin-top: var(--space-3); }
.driver form + form, .driver form + details { margin-top: var(--space-3); }

/* ── 予算の帯（配分どおりの幅。使った分を濃い色で埋める） ── */
.band__label { font-size: var(--text-xs); letter-spacing: .08em; color: var(--color-text-muted); margin: 0; }
.band__total { font-family: var(--font-display); font-weight: 800; font-size: var(--text-2xl); line-height: 1.2; margin: 0; }
.band__total small { font-size: var(--text-sm); font-weight: 500; font-family: var(--font-body); }
.band__bar { display: block; width: 100%; height: 44px; margin-top: var(--space-2); }
.band__bg--media { fill: var(--color-fill-media); } .band__bg--town { fill: var(--color-fill-town); }
.band__used--media { fill: var(--color-season); } .band__used--town { fill: var(--color-ink); }
.band__legend { margin: var(--space-2) 0 0; display: grid; gap: var(--space-1); }
.band__legend div { display: flex; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.band__legend dt { font-weight: 700; font-size: var(--text-sm); }
.band__legend dd { margin: 0; font-size: var(--text-sm); }
.band__chip { display: inline-block; width: 12px; height: 12px; margin-right: 6px; }
.band__chip--media { background: var(--color-season); } .band__chip--town { background: var(--color-ink); }

/* ── 表（数字は右揃え・等幅） ── */
.scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.table th, .table td { padding: var(--space-2) 0 var(--space-2) var(--space-3); border-bottom: var(--rule-thin); text-align: right; white-space: nowrap; font-weight: 400; }
.table th:first-child, .table td:first-child { text-align: left; padding-left: 0; }
.table thead th { font-size: var(--text-xs); color: var(--color-text-muted); }

.label--plain { border-top: 0; padding-top: 0; margin: 0; }
.head__links { display: inline-flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.rows__item { display: grid; gap: 1px; padding: 10px 0; }
.rows__line { display: flex; justify-content: space-between; gap: var(--space-3); }
.rows__line > span { overflow-wrap: anywhere; min-width: 0; }
.rows__acts { display: flex; gap: var(--space-2); margin-top: var(--space-2); }
input[type="file"] { font: inherit; max-width: 100%; }
input[type="email"] { width: 100%; min-height: var(--tap-min); padding: var(--space-2) 12px; font: inherit; color: var(--color-ink); background: var(--color-surface); border: 1px solid var(--color-border-strong); border-radius: var(--radius); }

.code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: var(--text-sm); overflow-wrap: anywhere; user-select: all; background: var(--color-paper); padding: var(--space-2); margin: 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.surface > * + * { margin-top: var(--space-2); }

/* ── 表（メディア）：表紙は季節色の面に、縦書きの題 ── */
.cover { background: var(--color-season); color: var(--color-season-contrast); padding: var(--space-3); display: grid; grid-template-columns: 1fr auto; gap: var(--space-3); }
.cover__no { font-family: var(--font-display); font-weight: 800; font-size: var(--text-xl); margin: 0; }
.cover__lead { margin: var(--space-2) 0 0 !important; font-size: var(--text-sm); }
.cover__title { writing-mode: vertical-rl; font-family: var(--font-display); font-weight: 800; font-size: var(--text-2xl); line-height: 1.5; letter-spacing: .06em; margin: 0; }
.photo { margin: 0; }
.photo img { display: block; width: 100%; height: auto; }
.photo figcaption { font-size: var(--text-sm); color: var(--color-text-muted); margin-top: var(--space-1); }
.photo form { margin-top: var(--space-2); }
.shoprow { display: grid !important; grid-template-columns: 96px 1fr; gap: var(--space-3) !important; align-items: center; }
.shoprow > span { display: grid; gap: 2px; min-width: 0; }
.shoprow__img { width: 96px; height: 96px; object-fit: cover; display: block; }
.shoprow__img--none { background: var(--color-fill-town); }

/* ── 記事（表）：目次は漢数字の番号と明朝の題。本文は読み物の行長 ── */
.cover__no b { display: block; font-size: var(--text-3xl); line-height: 1; }
.cover--prep { display: block; }
.cover--prep .cover__no { font-size: var(--text-lg); }
.toc { list-style: none; margin: 0; padding: 0; border-top: var(--rule-thin); }
.toc li { border-bottom: var(--rule-thin); }
.toc a { display: grid; grid-template-columns: 28px 1fr; gap: var(--space-2); padding: 10px 0; text-decoration: none; }
.toc a > span:last-child { display: grid; gap: 2px; min-width: 0; }
.toc__no { font-family: var(--font-display); font-weight: 700; color: var(--color-season); }
.title--story { font-size: var(--text-2xl); }
.story { font-size: 1.0625rem; line-height: 1.95; overflow-wrap: anywhere; }
.story p { margin: 0 0 1.4em; }
.fieldset--plain { display: block; }
.fieldset--plain[disabled] { opacity: .7; }


/* ── 共通の小物 ── */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.badge { display: inline-block; min-width: 1.4em; padding: 0 5px; margin-left: 5px; font-size: var(--text-xs); font-weight: 700; line-height: 1.5; text-align: center; background: var(--color-season); color: var(--color-season-contrast); font-variant-numeric: tabular-nums; }
.linkbtn { font: inherit; color: inherit; background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ── 下のメニュー（親指の届く位置に4つ） ── */
/* ── 会話（ログイン後の最初の画面。画面いっぱいを会話に使う） ── */
body.is-chat { height: 100dvh; overflow: hidden; }
.page--chat { padding: 0; display: flex; flex-direction: column; min-height: 0; }
.page--chat > * + * { margin-top: 0; }
.chat { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }
.chat__list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 10px var(--space-3); display: flex; flex-direction: column; gap: 10px; }
.chat__list > :first-child { margin-top: auto; } /* 発言が少ないときは下に寄せる */
.chat__day { text-align: center; font-size: var(--text-xs); color: var(--color-text-muted); margin: 0; }
.chat__empty { color: var(--color-text-muted); text-align: center; margin: 0; }
.chat__new { position: absolute; left: 50%; transform: translateX(-50%); bottom: 76px; font: inherit; font-size: var(--text-sm); font-weight: 700; padding: 6px 14px; background: var(--color-ink); color: var(--color-ink-contrast); border: 0; cursor: pointer; }
.chat__form { flex: none; display: grid; grid-template-columns: auto 1fr auto; gap: 6px; align-items: end; padding: 8px var(--space-3); border-top: var(--rule-thin); background: var(--color-surface); }
.chat__form textarea { min-height: 44px; max-height: 40vh; padding: 9px 10px; line-height: 1.5; resize: none; }
.chat__form .btn { min-height: 44px; width: auto; padding: 0 var(--space-3); }
.chat__error { grid-column: 1 / -1; margin: 0; font-size: var(--text-sm); font-weight: 700; color: var(--color-danger); }

.post__ref { display: grid; gap: 1px; margin-top: 4px; padding: 8px 10px; background: var(--color-surface); border-left: 3px solid var(--color-ink); text-decoration: none; }
.post__ref span { font-size: var(--text-xs); font-weight: 700; color: var(--color-season); }
.post__ref b { font-family: var(--font-display); font-size: var(--text-md); line-height: var(--line-height-heading); overflow-wrap: anywhere; }
.post__photo { display: inline-block; margin-top: 6px; border: 1px solid var(--color-border); background: var(--color-surface); line-height: 0; }
.post__img { display: block; max-width: min(220px, 62vw); max-height: 220px; min-width: 96px; min-height: 96px; object-fit: cover; }
.post__more { margin-left: auto; position: relative; }
.post__more summary { list-style: none; cursor: pointer; min-width: 44px; min-height: 24px; text-align: right; font-weight: 700; letter-spacing: .1em; }
.post__more summary::-webkit-details-marker { display: none; }
.post__menu { position: absolute; right: 0; top: 100%; z-index: 2; display: grid; gap: 10px; padding: 10px 12px; min-width: 12em; background: var(--color-surface); border: 1px solid var(--color-ink); font-size: var(--text-sm); color: var(--color-ink); }


/* ── アイコン（線の太さをそろえた線画。必ず文字を添える） ── */
.icon { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: square; stroke-linejoin: miter; display: block; }

/* ── ホームの上の状況 ──
   予算: 配分どおりの幅（12分割）の2つの面。「3分の1はメディアに」という約束が幅で見える。残りを大きな数字で出す。 */
.status { flex: none; padding: 10px var(--space-3) 0; display: grid; gap: 8px; }
.purse { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; text-decoration: none; }
.purse__tile { display: grid; gap: 3px; padding: 9px 10px 8px; min-width: 0; color: var(--color-ink-contrast); }
.purse__tile--media { background: var(--color-season); }
.purse__tile--town { background: var(--color-ink); }
.purse__tile--w1 { grid-column: span 1; } .purse__tile--w2 { grid-column: span 2; } .purse__tile--w3 { grid-column: span 3; } .purse__tile--w4 { grid-column: span 4; }
.purse__tile--w5 { grid-column: span 5; } .purse__tile--w6 { grid-column: span 6; } .purse__tile--w7 { grid-column: span 7; } .purse__tile--w8 { grid-column: span 8; }
.purse__tile--w9 { grid-column: span 9; } .purse__tile--w10 { grid-column: span 10; } .purse__tile--w11 { grid-column: span 11; } .purse__tile--w12 { grid-column: span 12; }
.purse__name { font-size: var(--text-xs); font-weight: 700; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.purse__rest { display: grid; font-size: var(--text-sm); line-height: 1.15; white-space: nowrap; }
.purse__rest small { font-size: var(--text-xs); opacity: .85; }
.purse__rest b { font-family: var(--font-display); font-weight: 800; font-size: 1.625rem; margin-right: 1px; }
.purse__gauge { display: block; width: 100%; height: 4px; margin-top: 2px; }
.purse__track { fill: currentColor; opacity: .28; }
.purse__used { fill: currentColor; }
.purse__note { font-size: var(--text-xs); line-height: 1.3; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 回答待ち: 押す場所がはっきり分かる1枚 */
.todo { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; padding: 8px 8px 8px 10px; background: var(--color-surface); border: 1px solid var(--color-ink); border-left-width: 4px; text-decoration: none; }
.todo__text { display: grid; gap: 1px; min-width: 0; }
.todo__text b { font-size: var(--text-sm); }
.todo__text span { font-size: var(--text-sm); color: var(--color-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.todo__go { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; background: var(--color-ink); color: var(--color-ink-contrast); font-size: var(--text-sm); font-weight: 700; }

/* 文字を打っている間は状況をたたみ、会話を広く使う（:has が使えない端末ではたたまない） */
@supports selector(:has(*)) { .chat:has(.chat__form:focus-within) .status { display: none; } }

.status__side { justify-self: end; display: inline-flex; align-items: center; min-height: 28px; margin-top: -4px; font-size: var(--text-xs); color: var(--color-text-muted); }

/* ── 発言: 頭文字の印で、誰の発言かを一目で ── */
.post { display: grid; grid-template-columns: 30px 1fr; gap: 8px; min-width: 0; }
.post__main { min-width: 0; }
.post--mine .mark:not(.mark--img) { background: var(--color-season); border-color: var(--color-season); color: var(--color-season-contrast); }
.post__head { display: flex; align-items: baseline; gap: 8px; font-size: var(--text-xs); color: var(--color-text-muted); line-height: 1.4; }
.post__head b { font-size: var(--text-sm); color: var(--color-ink); }
.post__body { margin: 1px 0 0; line-height: 1.6; overflow-wrap: anywhere; }

/* 入力欄の写真ボタン */
.chat__photo { position: relative; display: inline-grid; place-items: center; width: 44px; min-height: 44px; border: 1px solid var(--color-border-strong); background: var(--color-paper); cursor: pointer; }
.chat__photo input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.chat__photo:focus-within { outline: 3px solid var(--color-ink); outline-offset: 2px; }
/* 添付した写真: 送る前に小さく見せる */
.chat__preview { grid-column: 1 / -1; display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 10px; padding-bottom: 8px; border-bottom: var(--rule-thin); }
.chat__preview[hidden] { display: none; }
.chat__preview img { display: block; width: 64px; height: 64px; object-fit: cover; border: 1px solid var(--color-ink); }
.chat__preview-name { min-width: 0; font-size: var(--text-sm); color: var(--color-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ══ 画面の作り直し（議題・予算・その他）══ */

/* ボタンにアイコンを添える */
.btn--icon { gap: 6px; width: auto; padding-left: 12px; }
.btn--icon .icon { width: 20px; height: 20px; }
.head .btn { min-height: 40px; }

/* 状態の印（色だけにせず、必ず文言を入れる） */
.tag { display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; font-size: var(--text-xs); font-weight: 700; line-height: 1; white-space: nowrap; border: 1px solid var(--color-ink); }
.tag--season { background: var(--color-season); border-color: var(--color-season); color: var(--color-season-contrast); }
.tag--ink { background: var(--color-ink); color: var(--color-ink-contrast); }
.tag--line { background: transparent; }
.tag--turn { background: var(--color-danger); border-color: var(--color-danger); color: var(--color-ink-contrast); }

/* 絞り込み（数つきの切り替え） */
.chips { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 1px solid var(--color-ink); }
.chips a { display: grid; justify-items: center; gap: 1px; padding: 6px 2px; text-decoration: none; font-size: var(--text-xs); line-height: 1.3; border-left: 1px solid var(--color-ink); }
.chips a:first-child { border-left: 0; }
.chips a b { font-family: var(--font-display); font-size: var(--text-lg); line-height: 1.1; font-variant-numeric: tabular-nums; }
.chips a[aria-current] { background: var(--color-ink); color: var(--color-ink-contrast); }

/* 議題の1件 */
.cards { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.card { display: grid; gap: 5px; padding: 10px 12px 11px; background: var(--color-surface); border-left: 4px solid var(--color-border); text-decoration: none; }
.card--turn { border-left-color: var(--color-danger); }
.card__top { display: flex; align-items: center; gap: 6px; margin: 0; flex-wrap: wrap; }
.card__left { margin-left: auto; font-size: var(--text-sm); font-weight: 700; }
.card__done { font-size: var(--text-xs); color: var(--color-text-muted); }
.card__title { font-family: var(--font-display); font-weight: 700; font-size: var(--text-lg); line-height: 1.4; overflow-wrap: anywhere; }
.card__meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; font-size: var(--text-xs); color: var(--color-text-muted); }
.card__amount { color: var(--color-ink); font-size: var(--text-sm); }
.card__amount b { font-family: var(--font-display); font-size: var(--text-lg); margin-right: 1px; }

/* 何も無いとき */
.empty { display: grid; justify-items: start; gap: 10px; padding: var(--space-3); background: var(--color-surface); }

/* 議題の詳細: 金額を大きく、要点を小さな格子で */
.title--big { font-size: 1.625rem; line-height: 1.35; }
.facts { display: grid; gap: 1px; }
.facts__main { display: grid; gap: 2px; padding: 10px 12px; color: var(--color-ink-contrast); }
.facts__main--media { background: var(--color-season); } .facts__main--town { background: var(--color-ink); }
.facts__main--none { background: var(--color-surface); color: var(--color-ink); }
.facts__label { font-size: var(--text-xs); font-weight: 700; opacity: .9; }
.facts__amount { font-size: var(--text-md); line-height: 1.1; }
.facts__amount b { font-family: var(--font-display); font-weight: 800; font-size: 2rem; margin-right: 2px; }
.facts__main--none .facts__amount b { font-size: 1.375rem; }
.facts__grid { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(9em, 1fr)); gap: 1px; }
.facts__grid div { background: var(--color-surface); padding: 8px 12px; min-width: 0; }
.facts__grid dt { font-size: var(--text-xs); color: var(--color-text-muted); }
.facts__grid dd { margin: 0; font-weight: 700; font-size: var(--text-sm); overflow-wrap: anywhere; }

/* 反応の内訳: 帯グラフ＋数。賛成寄りは季節色、懸念は灰、反対は赤。数と文言を必ず併記 */
.tallybar { display: block; width: 100%; height: 14px; }
.tallybar__agree, .tally__chip--agree { fill: var(--color-season); background: var(--color-season); }
.tallybar__ok_with_note, .tally__chip--ok_with_note { fill: var(--color-fill-media); background: var(--color-fill-media); }
.tallybar__concern, .tally__chip--concern { fill: var(--color-border-strong); background: var(--color-border-strong); }
.tallybar__object, .tally__chip--object { fill: var(--color-danger); background: var(--color-danger); }
.tally__chip { display: inline-block; width: 10px; height: 10px; margin-right: 6px; }
.tally dd { font-family: var(--font-display); font-size: var(--text-lg); }

a.btn { text-decoration: none; }
.btn--small { min-height: 40px; padding: 0 var(--space-3); width: auto; }

/* 経費の1件: 内容と金額を横に並べ、金額を太く */
li.card { list-style: none; }
.card--off { opacity: .6; }
.spend { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.spend__what { font-weight: 700; overflow-wrap: anywhere; min-width: 0; }
.spend__amount { white-space: nowrap; font-size: var(--text-sm); }
.spend__amount b { font-family: var(--font-display); font-size: var(--text-lg); margin-right: 1px; }

.page > * + p, .page > section > * + p { margin-top: 12px; }

/* ══ 作り直し 2（予算・その他・下の階層の画面・アイコン）══ */

/* 見出し行: 左に「戻る」、まん中に題、右に操作を1つ */
.head .title { flex: 1; min-width: 0; }
.title--sub { font-family: var(--font-body); font-size: var(--text-sm); font-weight: 700; letter-spacing: .08em; color: var(--color-text-muted); }
.back { flex: none; display: inline-flex; align-items: center; gap: 1px; min-height: 40px; padding: 0 10px 0 4px; border: 1px solid var(--color-ink); background: var(--color-surface); font-size: var(--text-sm); font-weight: 700; text-decoration: none; }
.back .icon { width: 20px; height: 20px; }
.head__count { font-size: var(--text-sm); color: var(--color-text-muted); }
.head__count b { font-family: var(--font-display); font-size: var(--text-xl); color: var(--color-ink); margin-right: 2px; }
.muted--xs { font-size: var(--text-xs); line-height: 1.6; }
.btn--wide { width: 100%; }
.btn--tall { min-height: 56px; font-weight: 700; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pair .btn { width: 100%; }
.dot { display: inline-block; width: 10px; height: 10px; margin-right: 5px; background: var(--color-ink); }
.dot--media { background: var(--color-season); }
.surface--line { border: 1px solid var(--color-ink); }

/* 会員の印: 写真のアイコンか、名前の頭文字 */
.mark { display: inline-grid; place-items: center; flex: none; width: 30px; height: 30px; border: 1px solid var(--color-border-strong); background: var(--color-surface); color: var(--color-ink); font-size: var(--text-sm); font-weight: 700; line-height: 1; object-fit: cover; }
.mark--img { border-color: var(--color-ink); }
.mark--md { width: 44px; height: 44px; font-size: var(--text-lg); font-family: var(--font-display); }
.mark--lg { width: 60px; height: 60px; font-size: var(--text-xl); font-family: var(--font-display); }
.mark--xl { width: 128px; height: 128px; font-size: 3.5rem; font-family: var(--font-display); border-width: 2px; border-color: var(--color-ink); }

/* 予算の画面: ホームと同じ「1対2の2つの面」を、より大きく */
.purse--page .purse__tile { padding: 12px 12px 11px; gap: 5px; }
.purse--page .purse__rest { font-size: var(--text-md); }
.purse--page .purse__rest > span { display: flex; flex-wrap: wrap; align-items: baseline; }
.purse--page .purse__rest b { font-size: 2.25rem; line-height: 1.05; }
.purse--page .purse__tile { padding-left: 10px; padding-right: 8px; }
.purse--page .purse__gauge { height: 8px; margin-top: 4px; }
.purse--ratio .purse__tile { padding: 10px 12px; }
.purse--ratio .purse__rest b { font-size: 2.25rem; line-height: 1.1; }

/* 帳面: 正確な額。数字は等幅・右揃え、明朝は使わない */
.ledger { width: 100%; border-collapse: collapse; background: var(--color-surface); font-size: var(--text-sm); }
.ledger th, .ledger td { padding: 7px 10px; text-align: right; font-weight: 400; border-bottom: var(--rule-thin); white-space: nowrap; }
.ledger th:first-child { text-align: left; padding-left: 12px; }
.ledger td:last-child, .ledger th:last-child { padding-right: 12px; }
.ledger tfoot th, .ledger tfoot td { background: var(--color-paper); border-bottom: 0; color: var(--color-text-muted); font-size: var(--text-xs); }
.ledger tfoot b { font-size: var(--text-sm); color: var(--color-ink); }
.ledger thead th { font-size: var(--text-xs); font-weight: 700; line-height: 1.35; vertical-align: bottom; border-bottom: 1px solid var(--color-ink); }
.ledger thead .dot { width: 8px; height: 8px; margin-right: 4px; }
.ledger__unit { font-weight: 400; color: var(--color-text-muted); }
.ledger tbody th { color: var(--color-text-muted); }
.ledger__rest th, .ledger__rest td { font-weight: 700; font-size: var(--text-md); color: var(--color-ink) !important; border-top: 1px solid var(--color-ink); border-bottom: var(--rule-bold); }

/* 行き先への1行（アイコン＋題＋矢印）。押す場所と分かる面にする */
.linkrow { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 12px; background: var(--color-surface); border: 1px solid var(--color-ink); color: var(--color-ink); font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.linkrow > .icon:first-child { stroke: var(--color-season); }
.linkrow__text { display: grid; gap: 1px; min-width: 0; line-height: 1.4; }
.linkrow__text span { font-size: var(--text-xs); color: var(--color-text-muted); }
.linkrow--quiet { grid-template-columns: auto 1fr; border-color: var(--color-border-strong); background: transparent; }
.linkrow--quiet > .icon:first-child { stroke: currentColor; }

/* 明細の行: 日付・内容・金額。箱にせず罫線で区切る */
.xrows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--color-ink); }
.xrow { display: grid; grid-template-columns: 2.9em 1fr auto; align-items: start; gap: 10px; padding: 10px 0; border-bottom: var(--rule-thin); }
.xrow--person { grid-template-columns: 1fr auto; align-items: center; }
.xrow__day { font-size: var(--text-sm); font-weight: 700; color: var(--color-text-muted); padding-top: 2px; }
.xrow__main { display: grid; gap: 3px; min-width: 0; }
.xrow__what { font-weight: 700; line-height: 1.45; overflow-wrap: anywhere; }
.xrow__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; font-size: var(--text-xs); color: var(--color-text-muted); }
.xrow__amount { white-space: nowrap; font-size: var(--text-sm); padding-top: 1px; }
.xrow__amount b { font-size: var(--text-lg); margin-right: 1px; }
.xrow--off .xrow__what, .xrow--off .xrow__amount { color: var(--color-text-muted); }
.xrow--off .xrow__amount b { text-decoration: line-through; font-weight: 500; }
.spend__amount b { font-family: var(--font-body); font-size: 1.375rem; }
.rows__acts--fill { display: grid; grid-template-columns: 1fr auto; }
.rows__acts--fill .btn { width: 100%; }

/* 一覧の行（題＋右に印） */
.rows a.rows__go { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; }
.rows__body { display: grid; gap: 4px; min-width: 0; }
.rows__icon { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--color-border-strong); background: var(--color-surface); }
.rows__icon .icon { width: 20px; height: 20px; }
.rows__note { font-size: var(--text-sm); line-height: 1.6; overflow-wrap: anywhere; }
.rows .tag { align-self: start; }

/* 項目と値の並び */
.kv { margin: 0; border-top: 1px solid var(--color-ink); }
.kv > div { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding: 10px 0; border-bottom: var(--rule-thin); }
.kv dt { font-size: var(--text-sm); color: var(--color-text-muted); min-width: 0; }
.kv dt small { display: block; font-size: var(--text-xs); line-height: 1.5; }
.kv dd { margin: 0; font-weight: 700; text-align: right; overflow-wrap: anywhere; }
.kv dd b { font-size: var(--text-xl); }

/* 会員の並び */
.people { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--color-ink); }
.person { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; }
.people .person { padding: 10px 0; border-bottom: var(--rule-thin); }
.person__text { display: grid; gap: 1px; min-width: 0; line-height: 1.45; }
.person__text b { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: var(--text-md); overflow-wrap: anywhere; }
.person__text > span { font-size: var(--text-sm); color: var(--color-text-muted); overflow-wrap: anywhere; }
.person__text .person__sub { font-size: var(--text-xs); }
.person .post__more { margin-left: 0; }
.person .post__more summary { min-height: 44px; display: grid; place-items: center; }

/* 数字で見せる要約（会費の入金） */
.stat { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 6px 12px; padding: 12px; background: var(--color-ink); color: var(--color-ink-contrast); }
.stat__main, .stat__side { display: grid; gap: 1px; line-height: 1.3; }
.stat__side { justify-items: end; font-size: var(--text-sm); }
.stat__side b { font-size: var(--text-lg); margin-right: 1px; }
.stat__label { font-size: var(--text-xs); opacity: .85; }
.stat__fig { font-size: var(--text-md); }
.stat__fig b { font-family: var(--font-display); font-weight: 800; font-size: 2.75rem; line-height: 1.05; margin-right: 2px; }
.stat__bar { grid-column: 1 / -1; display: block; width: 100%; height: 8px; }
.stat__track { fill: currentColor; opacity: .28; }
.stat__on { fill: currentColor; }

/* フォーム: 一番大事な入力を大きく、二択は押しやすい面で */
.money { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 8px; }
.money input[type="text"] { min-height: 60px; font-size: 1.75rem; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.money > span { font-weight: 700; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.seg__opt { position: relative; display: grid; font-weight: 400 !important; }
.seg__opt input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.seg__opt > span { display: grid; align-content: center; gap: 2px; min-height: 56px; height: 100%; padding: 8px 10px; border: 1px solid var(--color-ink); background: var(--color-surface); line-height: 1.4; }
.seg__opt b { font-size: var(--text-sm); }
.seg__opt small { font-size: var(--text-xs); color: var(--color-text-muted); }
.seg__opt input:checked + span { background: var(--color-ink); color: var(--color-ink-contrast); }
.seg__opt input:checked + span small { color: inherit; opacity: .85; }
.seg__opt input:checked + span .dot { outline: 1px solid var(--color-ink-contrast); }
.seg__opt input:focus-visible + span { outline: 3px solid var(--color-ink); outline-offset: 2px; }
input[type="file"] { width: 100%; padding: 6px; background: var(--color-surface); border: 1px dashed var(--color-border-strong); font-size: var(--text-sm); }
input[type="file"]::file-selector-button { font: inherit; font-weight: 700; min-height: 40px; margin-right: 10px; padding: 0 14px; border: 1px solid var(--color-ink); border-radius: var(--radius); background: var(--color-paper); color: var(--color-ink); cursor: pointer; }
.chat__photo input[type="file"] { padding: 0; border: 0; }
.form__part { margin: 8px 0 0 !important; }
.fold--btn { border: 1px solid var(--color-ink); background: var(--color-surface); padding: 0 12px; }
.fold--btn summary { gap: 6px; list-style: none; }
.fold--btn summary::-webkit-details-marker { display: none; }
.fold--btn summary .icon { width: 20px; height: 20px; }
.fold .field { margin-top: var(--space-3); }

/* 写真の並び（店舗・記事） */
.photos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.photos .photo img { aspect-ratio: 1; object-fit: cover; }
.photos .photo .btn { width: 100%; }

/* ログイン・端末の登録・お知らせ: 1画面に1つのこと */
.gate { display: grid; gap: 14px; padding-top: 8px; }
.gate > * { margin: 0 !important; }

/* ══ 個人設定・メンバーのページ ══ */
.menu { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.person__go { grid-column: 1 / 3; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.person__arrow .icon { width: 20px; height: 20px; stroke: var(--color-text-muted); }
/* ユーザー名の入力: 先頭に @ を添える */
.affix { display: grid; grid-template-columns: auto 1fr; }
.affix > span { display: grid; place-items: center; width: 44px; border: 1px solid var(--color-border-strong); border-right: 0; background: var(--color-paper); font-weight: 700; color: var(--color-text-muted); }
input[type="tel"], input[type="url"] { width: 100%; min-height: var(--tap-min); padding: var(--space-2) 12px; font: inherit; color: var(--color-ink); background: var(--color-surface); border: 1px solid var(--color-border-strong); border-radius: var(--radius); }

/* ══ 面の中の切り替え（議題｜決定の記録｜書類 など）と、右端の操作 ══ */
.subnav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 14px; margin: -8px 0 0; border-bottom: 1px solid var(--color-ink); }
.subnav nav { display: flex; gap: 14px; min-width: 0; white-space: nowrap; }
.subnav nav a { display: inline-flex; align-items: center; min-height: 44px; font-size: var(--text-sm); text-decoration: none; color: var(--color-text-muted); border-bottom: 4px solid transparent; margin-bottom: -1px; }
.subnav nav a[aria-current] { color: var(--color-ink); font-weight: 700; border-bottom-color: var(--color-season); }
.subnav .btn { flex: none; min-height: 40px; margin-left: auto; padding: 0 12px 0 8px; gap: 4px; font-size: var(--text-sm); font-weight: 700; }
.subnav .btn .icon { width: 18px; height: 18px; }
.subnav nav { flex: 1 1 auto; }

/* ══ プロフィール（個人設定と、メンバーのページで同じ組み方）══
   主役は本人。上に1枚だけ面を置き（写真・名前・役割）、直す操作はその面の下端の3つにまとめる。
   その下は箱にせず、文と、項目と値の行で組む。 */
.prof__card { background: var(--color-surface); border-top: 6px solid var(--color-season); }
.prof__head { display: grid; grid-template-columns: 92px 1fr; align-items: center; gap: 16px; padding: 16px; }
.prof__head .mark { width: 92px; height: 92px; font-size: 2.5rem; font-family: var(--font-display); border-color: var(--color-ink); }
.prof__id { display: grid; gap: 3px; min-width: 0; line-height: 1.35; }
.prof__kana { font-size: var(--text-xs); letter-spacing: .12em; color: var(--color-text-muted); }
.prof__name { font-family: var(--font-display); font-weight: 800; font-size: 1.75rem; line-height: 1.25; overflow-wrap: anywhere; }
.prof__job { font-size: var(--text-sm); }
.prof__roles { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.prof__tools { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border-top: 1px solid var(--color-ink); }
.prof__tools a { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 52px; font-size: var(--text-sm); font-weight: 700; text-decoration: none; border-left: 1px solid var(--color-ink); }
.prof__tools a:first-child { border-left: 0; }
.prof__tools .icon { width: 20px; height: 20px; stroke: var(--color-season); }
.prof__body { display: grid; gap: 18px; margin-top: 20px; }
.prof__body > * { margin: 0 !important; }
.prof__bio { font-size: 1.0625rem; line-height: 1.85; overflow-wrap: anywhere; }
.prof__hint { font-size: var(--text-sm); color: var(--color-text-muted); line-height: 1.7; }
.prof__facts { border-top: 1px solid var(--color-ink); }
.prof__facts > div { display: grid; grid-template-columns: 6.5em 1fr; align-items: baseline; gap: 12px; padding: 11px 0; border-bottom: var(--rule-thin); }
.prof__facts dt { font-size: var(--text-sm); color: var(--color-text-muted); }
.prof__facts dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; min-width: 0; }
.prof__facts dd small { display: block; font-size: var(--text-xs); font-weight: 400; color: var(--color-text-muted); }
.prof__shop { display: grid; grid-template-columns: 1fr; align-items: center; gap: 14px; text-decoration: none; }
.prof__shop--photo { grid-template-columns: 120px 1fr; }
.prof__shop img { display: block; width: 120px; height: 90px; object-fit: cover; }
.prof__shop > span { display: grid; gap: 2px; min-width: 0; line-height: 1.4; padding-left: 12px; border-left: 4px solid var(--color-season); }
.prof__shop--photo > span { padding-left: 0; border-left: 0; }
.prof__shop small { font-size: var(--text-xs); letter-spacing: .1em; color: var(--color-text-muted); }
.prof__shop b { font-family: var(--font-display); font-size: var(--text-xl); line-height: 1.3; overflow-wrap: anywhere; }
.prof__shop em { font-style: normal; font-size: var(--text-sm); color: var(--color-text-muted); }
.prof__out { margin-top: 28px !important; }

/* 写真の右下のカメラの印: 押して写真を選ぶと、そのまま替わる */
.prof__pick { display: grid; gap: 6px; }
.prof__pick label { position: relative; display: block; width: 92px; height: 92px; cursor: pointer; }
.prof__pick input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; padding: 0; border: 0; cursor: pointer; }
.prof__cam { position: absolute; right: -8px; bottom: -8px; display: grid; place-items: center; width: 36px; height: 36px; background: var(--color-ink); color: var(--color-ink-contrast); border: 2px solid var(--color-surface); }
.prof__cam .icon { width: 20px; height: 20px; }
.prof__pick label:focus-within { outline: 3px solid var(--color-ink); outline-offset: 2px; }
.prof__pick.is-sending { opacity: .5; }

/* ══ 上の帯と、左上のメニュー（引き出し）══
   下のメニューはやめた。チャンネルは縦に並べる（増えても隠れない）。その下に議題・予算・メディア・メンバー、一番下に自分。 */
.mast { flex-wrap: nowrap; gap: 10px; padding-top: max(5px, env(safe-area-inset-top, 0px)); padding-bottom: 5px; position: sticky; top: 0; z-index: 10; background: var(--color-paper); }
.mast__title { flex: 1; min-width: 0; margin: 0; font-family: var(--font-display); font-weight: 800; font-size: var(--text-md); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mast__title a { text-decoration: none; }
.drawer { flex: none; }
.drawer__open { position: relative; display: inline-grid; place-items: center; width: 44px; height: 40px; padding: 0; border: 1px solid var(--color-ink); background: var(--color-surface); font-size: var(--text-sm); font-weight: 700; cursor: pointer; list-style: none; }
.drawer__open::-webkit-details-marker { display: none; }
.drawer__open .icon { width: 22px; height: 22px; }
.drawer__open .badge { position: absolute; right: -8px; top: -7px; margin: 0; background: var(--color-danger); color: var(--color-ink-contrast); }
.drawer__backdrop { position: fixed; inset: 0; z-index: 20; background: var(--color-ink); opacity: .45; }
.drawer__panel { position: fixed; top: 0; bottom: 0; left: 0; z-index: 21; width: min(86vw, 21rem); display: flex; flex-direction: column; background: var(--color-surface); border-right: var(--rule-bold); padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
.drawer__top { flex: none; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 8px 6px 14px; border-bottom: var(--rule-bold); }
.drawer__top .mast__name { font-size: var(--text-sm); min-width: 0; }
.drawer__close { flex: none; display: inline-flex; align-items: center; gap: 2px; min-height: 40px; padding: 0 8px; border: 0; background: none; color: inherit; font: inherit; font-size: var(--text-sm); font-weight: 700; cursor: pointer; }
.drawer__close .icon { width: 20px; height: 20px; }
.drawer__scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-bottom: 12px; }
.drawer__label { margin: 0; padding: 14px 14px 4px; font-size: var(--text-xs); font-weight: 700; letter-spacing: .12em; color: var(--color-text-muted); }
.drawer__list { list-style: none; margin: 0; padding: 0; }
.drawer__list a { display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px; text-decoration: none; font-weight: 500; border-left: 4px solid transparent; }
.drawer__list a > span:nth-child(2) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer__list a[aria-current] { background: var(--color-ink); color: var(--color-ink-contrast); font-weight: 700; border-left-color: var(--color-season); }
.drawer__list .icon { width: 22px; height: 22px; }
.drawer__list .badge { margin: 0; }
.drawer__hash { display: inline-grid; place-items: center; width: 24px; font-weight: 700; color: var(--color-season); }
.drawer__list a[aria-current] .drawer__hash { color: inherit; }
.mast__title .drawer__hash { width: auto; margin-right: 4px; }
.drawer__add { margin: 4px 14px 0; font-size: var(--text-sm); }
.drawer__add summary { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 0 12px 0 8px; border: 1px solid var(--color-ink); font-weight: 700; cursor: pointer; list-style: none; }
.drawer__add summary::-webkit-details-marker { display: none; }
.drawer__add summary .icon { width: 18px; height: 18px; }
.drawer__add form { display: grid; gap: 6px; padding: 10px 0 4px; }
.drawer__add form label { font-weight: 700; }
.drawer__add-row { display: grid; grid-template-columns: 1fr auto; gap: 6px; }
.drawer__add-row .btn { width: auto; padding: 0 var(--space-3); }
.drawer__menu { flex: none; list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border-top: var(--rule-bold); }
.drawer__menu li { border-left: var(--rule-thin); }
.drawer__menu li:first-child { border-left: 0; }
.drawer__menu a { display: grid; justify-items: center; gap: 2px; padding: 9px 0 7px; text-decoration: none; font-size: var(--text-xs); font-weight: 700; line-height: 1.2; }
.drawer__menu a[aria-current] { background: var(--color-ink); color: var(--color-ink-contrast); }
.drawer__ico { position: relative; display: block; }
.drawer__ico .icon { width: 24px; height: 24px; stroke: var(--color-season); }
.drawer__menu a[aria-current] .icon { stroke: currentColor; }
.drawer__ico .badge { position: absolute; left: 16px; top: -6px; margin: 0; background: var(--color-danger); color: var(--color-ink-contrast); }
.drawer__me { flex: none; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--color-ink); text-decoration: none; }
.drawer__me .mark { width: 40px; height: 40px; border-color: var(--color-ink); }
.drawer__me > span { display: grid; min-width: 0; line-height: 1.3; }
.drawer__me b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer__me small { font-size: var(--text-xs); color: var(--color-text-muted); }
.drawer__me .icon { width: 20px; height: 20px; }
.drawer__me[aria-current] { background: var(--color-ink); color: var(--color-ink-contrast); }
.drawer__me[aria-current] small { color: inherit; opacity: .85; }
html.is-drawer-open, html.is-drawer-open body { overflow: hidden; }

/* URL の行（店舗情報）: 名前と URL を1組にし、「外す」を右に。行は罫線で区切る */
.links { display: grid; gap: 0; border-top: 1px solid var(--color-ink); margin-top: 4px; }
.links__row { display: grid; grid-template-columns: 1fr auto; gap: 6px; padding: 10px 0; border-bottom: var(--rule-thin); }
.links__row input:first-child { grid-column: 1 / -1; }
.links__row .btn { min-height: var(--tap-min); }
.links__add { justify-self: start; margin-top: 8px; }

/* 個人設定: 登録した個人情報・店舗情報を全部出す。編集は「編集」ボタン1つ */
.prof__body > section { display: grid; gap: 12px; }
.prof__body > section > * { margin: 0 !important; }
.prof__body > section > .label { padding-top: 12px; }
.prof__body > section > .label--plain { padding-top: 0; }
.prof__shopname { display: grid; gap: 2px; line-height: 1.4; }
.prof__shopname b { font-family: var(--font-display); font-size: var(--text-xl); overflow-wrap: anywhere; }
.prof__shopname span { font-size: var(--text-sm); color: var(--color-text-muted); }
.prof__photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.prof__photos img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.prof__facts dd.prof__long { font-weight: 400; line-height: 1.75; }
.subnav--edit { margin-top: 0; }

/* チャンネルのアーカイブ */
.chanmenu { flex: none; position: static; font-size: var(--text-sm); }
.chanmenu summary { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 0 9px 0 7px; border: 1px solid var(--color-border-strong); font-size: var(--text-xs); font-weight: 700; cursor: pointer; list-style: none; }
.chanmenu summary::-webkit-details-marker { display: none; }
.chanmenu summary .icon { width: 18px; height: 18px; }
.chanmenu[open] summary { background: var(--color-ink); border-color: var(--color-ink); color: var(--color-ink-contrast); }
.chanmenu form { position: absolute; left: 0; right: 0; top: 100%; z-index: 4; display: grid; gap: 10px; padding: 14px var(--space-3) 16px; background: var(--color-surface); border-top: 1px solid var(--color-ink); border-bottom: var(--rule-bold); }
.chanmenu form p { margin: 0; line-height: 1.7; }
.drawer__arch { margin-top: 6px; border-top: var(--rule-thin); }
.drawer__arch summary { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; font-size: var(--text-sm); font-weight: 700; color: var(--color-text-muted); cursor: pointer; list-style: none; }
.drawer__arch summary::-webkit-details-marker { display: none; }
.drawer__arch summary .icon { width: 20px; height: 20px; }
.drawer__arch summary span { margin-left: auto; }
.drawer__arch .drawer__hash { color: var(--color-text-muted); }
.chat__archived { flex: none; display: flex; align-items: center; gap: 8px; margin: 0; padding: 12px var(--space-3); border-top: var(--rule-thin); background: var(--color-surface); font-size: var(--text-sm); color: var(--color-text-muted); }
.chat__archived .icon { width: 20px; height: 20px; flex: none; }

/* ホーム: 意見募集中の議題（題を出す）と、会話の上のチャンネル名の行 */
.asks { background: var(--color-surface); border: 1px solid var(--color-ink); border-left-width: 4px; }
.asks__head { display: flex; align-items: center; gap: 10px; margin: 0; padding: 6px 10px 2px; font-size: var(--text-sm); }
.asks__head strong { font-size: var(--text-xs); color: var(--color-season-ink, var(--color-ink)); }
.asks__head a { margin-left: auto; font-size: var(--text-xs); color: var(--color-text-muted); display: inline-flex; align-items: center; min-height: 28px; }
.asks__item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; min-height: 40px; padding: 5px 10px; border-top: var(--rule-thin); text-decoration: none; }
.asks__item .tag { font-style: normal; }
.asks__item span { font-family: var(--font-display); font-weight: 700; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asks__item small { font-size: var(--text-xs); font-weight: 700; white-space: nowrap; }
.asks__item em { display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; background: var(--color-ink); color: var(--color-ink-contrast); font-size: var(--text-xs); font-weight: 700; font-style: normal; white-space: nowrap; }
.asks__more { display: block; padding: 6px 10px; border-top: var(--rule-thin); font-size: var(--text-xs); color: var(--color-text-muted); }
.chat__chan { position: relative; flex: none; display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 0 var(--space-3); border-top: 1px solid var(--color-ink); border-bottom: var(--rule-thin); background: var(--color-surface); min-height: 44px; }
.chat__chan h1 { flex: 1; min-width: 0; margin: 0; font-family: var(--font-display); font-weight: 800; font-size: var(--text-lg); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat__chan .drawer__hash { width: auto; margin-right: 4px; }
/* たたむタブ: 予算・意見募集のブロックの右下の端からぶら下がる。チャンネル名の右の空きに収まる。
   ブロックと同じ地の色にして上の線を消し、「このブロックの持ち手」と分かる形にする。 */
.chat__fold { flex: none; align-self: flex-start; display: inline-flex; align-items: center; gap: 5px; min-height: 30px; margin-top: -1px; padding: 0 12px 1px; border: 1px solid var(--color-ink); border-top-color: var(--color-paper); background: var(--color-paper); color: inherit; font: inherit; font-size: var(--text-xs); font-weight: 700; line-height: 1; cursor: pointer; }
.chat__fold::before { content: ""; width: 6px; height: 6px; border-left: 2px solid currentColor; border-top: 2px solid currentColor; transform: translateY(2px) rotate(45deg); }
.chat__fold.is-closed { margin-top: 0; border-top: 0; }
.chat__fold.is-closed::before { transform: translateY(-2px) rotate(225deg); }
.chat__chan .chanmenu summary { min-height: 36px; }
.status[hidden] + .chat__chan { margin-top: 0; border-top: 0; }

/* 個人設定の「編集」: 面の右上に小さく（歯車の印＋文字）。場所を取らせない */
.prof__card { position: relative; }
.prof__edit { position: absolute; top: 8px; right: 8px; z-index: 1; display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 0 10px 0 7px; border: 1px solid var(--color-ink); background: var(--color-surface); font-size: var(--text-sm); font-weight: 700; text-decoration: none; }
.prof__edit .icon { width: 18px; height: 18px; }
.prof__card .prof__head { padding-right: 16px; }
.prof__card .prof__id { padding-top: 18px; }
/* メニューの中のアーカイブ */
.drawer__add--arch p { margin: 0; line-height: 1.6; }
.drawer__add + .drawer__add { margin-top: 6px; }

/* ══ はじめに（はじめてログインした人への説明と、会費の決済） ══ */
body.is-welcome main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.welcome { display: grid; gap: 18px; }
.welcome p { margin: 0; }
.welcome__lead { display: grid; gap: 8px; padding: 14px 14px 16px; background: var(--color-surface); border: 1px solid var(--color-ink); border-top: 6px solid var(--color-season); }
.welcome__kicker { display: flex; align-items: center; gap: 8px; font-size: var(--text-sm); color: var(--color-text-muted); }
.welcome__title { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: var(--text-2xl); line-height: 1.3; }
.welcome__title span { display: inline-block; }
.welcome__does { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.welcome__does li { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 8px; row-gap: 4px; padding: 10px; background: var(--color-surface); border: 1px solid var(--color-ink); }
.welcome__ico { display: grid; place-items: center; width: 36px; height: 36px; background: var(--color-ink); color: var(--color-ink-contrast); }
.welcome__ico .icon { width: 22px; height: 22px; }
.welcome__does b { font-family: var(--font-display); font-size: var(--text-lg); line-height: 1.2; }
.welcome__does li > span:last-child { grid-column: 1 / -1; font-size: var(--text-sm); line-height: 1.55; }
.welcome__rules { list-style: none; margin: 0; padding: 0; counter-reset: rule; display: grid; gap: 6px; }
.welcome__rules li { counter-increment: rule; display: grid; grid-template-columns: auto 1fr; column-gap: 10px; padding: 8px 10px 9px; background: var(--color-surface); border-left: 4px solid var(--color-ink); }
.welcome__rules li::before { content: counter(rule); grid-row: span 2; font-family: var(--font-display); font-weight: 800; font-size: var(--text-xl); line-height: 1.2; color: var(--color-season); }
.welcome__rules b { font-family: var(--font-display); font-size: var(--text-lg); line-height: 1.35; }
.welcome__rules span { font-size: var(--text-sm); line-height: 1.6; }
.welcome__small { font-size: var(--text-sm); color: var(--color-text-muted); margin-top: 6px !important; }
.welcome__how { display: grid; gap: 8px; }
.welcome__how .label { margin-bottom: 0; }
.welcome__logout { min-height: var(--tap-min); padding: 0; border: 0; background: none; color: var(--color-text-muted); font: inherit; font-size: var(--text-sm); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
/* 下に固定: 金額と、押す場所 */
.paybar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; margin: 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--color-surface); border-top: var(--rule-bold); }
.paybar__sum { margin: 0; display: grid; min-width: 0; }
.paybar__sum span { font-size: var(--text-xs); font-weight: 700; color: var(--color-text-muted); }
.paybar__sum b { font-family: var(--font-display); font-size: var(--text-2xl); line-height: 1.1; }
.paybar__sum small { font-family: var(--font-body); font-size: var(--text-sm); margin-left: 2px; }
.paybar__go { width: auto; padding: 0 20px 0 14px; }
.paybar__go[disabled] { opacity: .45; cursor: default; }

/* ══ 通知の印（赤まると数字）: メニューの三本線・チャンネル・メニューの項目 ══ */
.drawer .badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--radius-badge); background: var(--color-danger); color: var(--color-ink-contrast); font-size: var(--text-xs); line-height: 1; }
.drawer .badge b { font-weight: 700; }
.drawer__open .badge { right: -9px; top: -9px; box-shadow: 0 0 0 2px var(--color-paper); }
.drawer__ico .badge { box-shadow: 0 0 0 2px var(--color-surface); }
.welcome__use { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 12px; font-size: var(--text-sm); line-height: 1.65; }
.welcome__burger { display: grid; place-items: center; width: 44px; height: 40px; border: 1px solid var(--color-ink); background: var(--color-surface); }
.welcome__burger .icon { width: 22px; height: 22px; }

/* ══ 管理者の設定 ══ */
.setadd { display: grid; gap: 4px; margin: 0; }
.setadd label { font-weight: 700; font-size: var(--text-sm); }
.setadd__row { display: grid; grid-template-columns: 1fr auto; gap: 6px; }
.setadd__row .btn { width: auto; padding: 0 14px; }
.setadd__row .btn--icon { padding-left: 10px; }
.sets { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--color-ink); }
.sets > li { border-bottom: var(--rule-thin); }
.set summary, .set--row { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 8px; min-height: 52px; padding: 4px 0; }
.set summary { cursor: pointer; list-style: none; }
.set summary::-webkit-details-marker { display: none; }
.set__hash { width: 20px; text-align: center; font-weight: 700; color: var(--color-season); }
.set__name { min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set__meta { font-size: var(--text-xs); color: var(--color-text-muted); white-space: nowrap; }
.set__gear { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--color-ink); background: var(--color-surface); }
.set__gear .icon { width: 20px; height: 20px; }
.set[open] > summary .set__gear { background: var(--color-ink); color: var(--color-ink-contrast); }
.set__body { display: grid; gap: 12px; margin: 0 0 12px; padding: 12px; background: var(--color-surface); border-left: 4px solid var(--color-ink); }
.set__form { display: grid; gap: 4px; margin: 0; }
.set__body.set__form { gap: 12px; }
.set__form > label { font-weight: 700; font-size: var(--text-sm); }
.set__act { display: grid; gap: 8px; margin: 0; padding-top: 12px; border-top: var(--rule-thin); }
.set__act p, .set__note { margin: 0; font-size: var(--text-sm); color: var(--color-text-muted); line-height: 1.6; }
.set__act .btn { justify-self: start; width: auto; padding-right: 14px; }
.set--row { grid-template-columns: auto 1fr auto; row-gap: 0; }
.set--row .set__name { text-underline-offset: 3px; }
.set--row .set__meta { grid-column: 2; grid-row: 2; }
.set--row form { grid-column: 3; grid-row: 1 / span 2; margin: 0; }
.set summary .mark { flex: none; }
.set summary:has(.mark) { grid-template-columns: auto 1fr auto; padding: 8px 0; }
.set__who { display: grid; gap: 4px; min-width: 0; }
.set__who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set__tags { display: flex; flex-wrap: wrap; gap: 4px; }
.set__checks { display: grid; }
.set__checks .choice { align-items: center; padding: 4px 0; border-top: var(--rule-thin); }
.set__checks .choice:first-child { border-top: 0; }
.set__checks .choice > span { display: grid; line-height: 1.4; }
.set__checks small { font-size: var(--text-xs); color: var(--color-text-muted); }
.set__units { display: inline-flex; align-items: center; gap: 8px; }
.set__units input { width: 5em; text-align: right; }
.paystate { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.paystate__tile { display: grid; gap: 2px; padding: 12px; background: var(--color-surface); border: 1px solid var(--color-ink); border-top: 6px solid var(--color-border-strong); }
.paystate__tile.is-on { border-top-color: var(--color-season); }
.paystate__tile span { font-size: var(--text-xs); font-weight: 700; color: var(--color-text-muted); }
.paystate__tile b { font-family: var(--font-display); font-size: var(--text-xl); line-height: 1.3; }
.paystate__tile small { font-size: var(--text-xs); line-height: 1.5; color: var(--color-text-muted); }
.welcome__use + .welcome__use { margin-top: 10px; }
.welcome__burger--app { width: 44px; height: 44px; border: 0; background: var(--color-season); color: var(--color-season-contrast); font-family: var(--font-display); font-weight: 800; font-size: var(--text-xl); line-height: 1; }
.setadd { margin-top: 8px; }

/* ══ 固定費 ══ */
.recur__body { display: none; gap: var(--space-3); margin-top: 8px; padding: 12px; background: var(--color-surface); border-left: 4px solid var(--color-season); }
.recur:has(input[value="recurring"]:checked) .recur__body { display: grid; }
.recur__row { display: grid; grid-template-columns: 1fr 1.3fr; gap: 8px; align-items: end; }
.recur__row input, .recur__row select { width: 100%; min-width: 0; }
.facts__every { font-size: var(--text-sm); font-weight: 700; margin-left: 2px; }
.fixed { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.fixed__item { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 4px 10px; padding: 10px 12px; background: var(--color-surface); border-left: 4px solid var(--color-season); }
.fixed__item--off { border-left-color: var(--color-border); color: var(--color-text-muted); }
.fixed__what { font-family: var(--font-display); font-weight: 700; font-size: var(--text-lg); line-height: 1.4; text-decoration: none; overflow-wrap: anywhere; min-width: 0; }
.fixed__amount { white-space: nowrap; font-size: var(--text-sm); }
.fixed__amount b { font-family: var(--font-display); font-size: var(--text-xl); margin-right: 1px; }
.fixed__amount small { font-size: var(--text-xs); font-weight: 700; }
.fixed__meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; font-size: var(--text-xs); color: var(--color-text-muted); }
.fixed__stop { grid-column: 1 / -1; font-size: var(--text-sm); }
.fixed__stop summary { display: inline-flex; align-items: center; min-height: 36px; color: var(--color-text-muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; list-style: none; }
.fixed__stop summary::-webkit-details-marker { display: none; }
.fixed__stop form { display: grid; gap: 8px; justify-items: start; padding-top: 4px; }
.fixed__stop p { margin: 0; color: var(--color-text-muted); line-height: 1.6; }
.code--inline { display: inline; padding: 0 4px; background: var(--color-surface); }
