/* この写しは 商品/Webアプリ骨組み/組み立て.py が作った。直すのは骨組みの方。 */
/* Webアプリの骨組み（作る担当 2026-11-13 版1）。色は yago.css（屋号ごと）で決める。
   大きさ・形は 商品/屋号_見た目の決まり.md 1章と 2-3〜2-7 の数に合わせた。 */
html { font-size: 17px; -webkit-text-size-adjust: 100%; }
html[data-font="l"] { font-size: 20px; }
html[data-font="xl"] { font-size: 23px; }
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text); line-height: 1.75;
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  overflow-wrap: anywhere;
}
#app { max-width: 720px; margin: 0 auto; padding: 0 16px calc(84px + env(safe-area-inset-bottom)); }
h1 { font-size: 1.45rem; line-height: 1.45; margin: .6em 0 .4em; }
h2 { font-size: 1.22rem; line-height: 1.5; margin: 1.1em 0 .4em; }
h3 { font-size: 1.06rem; line-height: 1.5; margin: .8em 0 .3em; }
p { margin: .4em 0; }
a { color: var(--accent); }
.help { font-size: .9rem; color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* 頭の帯 */
.top { display: flex; align-items: center; gap: 8px; min-height: 48px; border-bottom: 1px solid var(--line); }
.yago { font-weight: 700; font-size: .95rem; color: var(--muted); }
.tag { font-size: .88rem; font-weight: 700; padding: 0 10px; border-radius: 999px; background: var(--warn-bg); color: var(--warn-text); border: 1px solid var(--warn-line); }

/* ボタン */
.btn {
  display: inline-flex; align-items: center; justify-content: center; text-align: center;
  min-height: 44px; min-width: 44px; padding: 8px 16px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  font: inherit; font-size: 1rem; line-height: 1.4; cursor: pointer; text-decoration: none;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; min-height: 48px; }
.btn.danger { color: var(--err-text); border-color: var(--err-line); }
.btn.small { min-height: 44px; font-size: .95rem; padding: 6px 12px; }
.btn.wide { width: 100%; }
.btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.btn:active { filter: brightness(.92); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.btn-col { display: flex; flex-direction: column; gap: 10px; margin: 10px 0; }
.seg { display: flex; gap: 8px; }
.seg .btn { flex: 1; }

/* 入力 */
.field { margin: 14px 0; }
.field > label { display: block; font-weight: 700; margin-bottom: 4px; }
.req { font-weight: 400; font-size: .88rem; color: var(--err-text); margin-left: 4px; }
input[type=text], input[type=date], select, textarea {
  width: 100%; min-height: 44px; padding: 8px 10px; border-radius: 8px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  font: inherit; font-size: 1.05rem;
}
input[type=date] { -webkit-appearance: none; appearance: none; }
textarea { min-height: 88px; }
.with-unit { display: flex; align-items: center; gap: 6px; }
.with-unit input { text-align: right; max-width: 12em; }
.unit { color: var(--muted); }
.is-err { border: 2px solid var(--err-line) !important; background: var(--err-bg) !important; }
.err-msg { color: var(--err-text); font-size: .9rem; margin: 4px 0 0; }
.err-sum { color: var(--err-text); background: var(--err-bg); border: 1px solid var(--err-line); border-radius: 10px; padding: 10px 12px; }
.check-row { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 700; cursor: pointer; }
.check-row input { width: 22px; height: 22px; margin: 0; accent-color: var(--accent); }
details.more { margin: 14px 0; border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; background: var(--surface); }
details.more > summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 700; color: var(--accent); }
details.more[open] { padding-bottom: 10px; }
.sticky-bar {
  position: sticky; bottom: 0; display: grid; grid-template-columns: 1fr 2fr; gap: 10px;
  padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--line); margin-top: 16px;
}
.sticky-bar .btn.primary { min-height: 54px; }
.danger-zone { margin: 28px 0 8px; padding-top: 14px; border-top: 1px dashed var(--line); }

/* 枠 */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 12px 0; }
.card h2 { margin-top: 0; }
.note { background: var(--surface-2); border-left: 4px solid var(--line-strong); border-radius: 8px; padding: 10px 14px; margin: 12px 0; font-size: .95rem; }
.note.warn, .band.warn, .band.sample { background: var(--warn-bg); color: var(--warn-text); border: 1px solid var(--warn-line); border-left-width: 4px; }
.note ul { margin: .3em 0; padding-left: 1.2em; }
.band { border-radius: 10px; padding: 10px 14px; margin: 12px 0; font-size: .95rem; background: var(--surface-2); border-left: 4px solid var(--line-strong); }
.band.warn { font-weight: 700; }
.legal { margin: 24px 0 8px; padding: 12px 14px; background: var(--surface-2); border-left: 4px solid var(--line-strong); border-radius: 8px; font-size: .9rem; line-height: 1.6; }
.legal h2 { font-size: 1rem; margin: 0 0 .3em; }
.legal p { margin: .3em 0; }

/* 一覧のカード */
.list { list-style: none; margin: 0; padding: 0; }
.item { display: block; width: 100%; text-align: left; background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); border-radius: 12px; padding: 12px 14px; margin: 10px 0; font: inherit; cursor: pointer; }
.item.is-late { border: 2px solid var(--err-line); }
.item.is-soon { border: 2px solid var(--warn-line); }
.item.is-done { opacity: .8; }
.item .next { font-weight: 700; font-size: .95rem; }
.item .ttl { font-size: 1.06rem; font-weight: 700; line-height: 1.45; margin: 2px 0; }
.item .sub { font-size: .9rem; color: var(--muted); }
.item .row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.item .yen { font-weight: 700; font-variant-numeric: tabular-nums; }
.pill { display: inline-block; font-size: .88rem; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line-strong); margin-right: 4px; }
.pill.late { color: var(--err-text); border-color: var(--err-line); background: var(--err-bg); font-weight: 700; }
.pill.soon { color: var(--warn-text); border-color: var(--warn-line); background: var(--warn-bg); font-weight: 700; }
.pill.ok { color: var(--ok-text); border-color: var(--ok-line); background: var(--ok-bg); }
.section-h { font-size: 1rem; color: var(--muted); margin: 18px 0 4px; }
.empty { text-align: center; padding: 18px 10px; }

/* 合計の数 */
.big { font-size: 1.7rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.3; }
.big-label { font-size: .95rem; font-weight: 700; }
.result { border: 2px solid var(--accent); border-radius: 14px; padding: 12px 16px; margin: 12px 0; background: var(--surface); }
table.sum { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.sum th, table.sum td { padding: 8px 4px; border-bottom: 1px solid var(--line); text-align: left; }
table.sum td.n { text-align: right; white-space: nowrap; }
.month-nav { display: grid; grid-template-columns: 56px 1fr 56px; align-items: center; gap: 8px; margin: 8px 0; }
.month-nav .m { text-align: center; font-weight: 700; font-size: 1.1rem; }

/* 画面の切りかえ（下） */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center;
  background: var(--surface); border-top: 1px solid var(--line-strong); padding-bottom: env(safe-area-inset-bottom); z-index: 5;
}
.tab { flex: 1; max-width: 240px; min-height: 56px; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: .95rem; cursor: pointer; border-top: 3px solid transparent; }
.tab[aria-current="page"] { color: var(--accent); font-weight: 700; border-top-color: var(--accent); }

/* 足す（主のボタン） */
.add-bar { margin: 8px 0 4px; }

/* 合言葉の画面 */
.gate .lead { font-size: 1rem; }
.gate .or { text-align: center; color: var(--muted); margin: 6px 0; }

/* 知らせ・確かめ */
.toast { position: fixed; left: 12px; right: 12px; bottom: calc(70px + env(safe-area-inset-bottom)); max-width: 680px; margin: 0 auto; padding: 12px 14px; border-radius: 10px; font-size: .95rem; transform: translateY(150%); opacity: 0; transition: .2s; z-index: 20; pointer-events: none; }
.toast.show { transform: none; opacity: 1; }
.toast.ok { background: var(--ok-bg); color: var(--ok-text); border: 1px solid var(--ok-line); }
.toast.err { background: var(--err-bg); color: var(--err-text); border: 1px solid var(--err-line); }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; z-index: 30; padding: 12px; }
.modal { background: var(--surface); color: var(--text); border-radius: 14px; padding: 16px; width: 100%; max-width: 520px; }
.modal h2 { margin-top: 0; }
.modal .btn-row .btn { flex: 1; }

@media print {
  .tabs, .band, .note, .btn, .sticky-bar, .toast, .top { display: none !important; }
  body { background: #fff; color: #000; }
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
