/* CookBox 献立 — 色は意味と記号・文字・線の形を併用する(色だけで区別しない) */
:root {
  --bg: #F7F6F2;
  --surface: #FFFFFF;
  --line: #E2E0D8;
  --line-soft: #F1EFE9;
  --line-strong: #C9C6BC;
  --text: #1F2420;
  --muted: #5B615C;
  --muted-2: #4A504B;
  --green: #2E6B3F;
  --green-dark: #1F4D2C;
  --green-bg: #E6F0E8;
  --green-line: #C5DCCB;
  --orange: #A4461B;
  --orange-text: #8A3A14;
  --orange-bg: #FBEDE4;
  --orange-line: #EBC9B4;
  --blue-text: #2B4C73;
  --blue-bg: #E8EEF6;
  --star: #9A6412;
  --heart: #B3364A;
  --point-bg: #FBF3DC;
  --point-text: #5B4A12;
  --photo: #E9E6DD;
  /* 塗りつぶし(白文字を載せる)・反転・操作の色 */
  --accent-solid: #2E6B3F;
  --accent-solid-hover: #1F4D2C;
  --warn-solid: #A4461B;
  --warn-strong: #8A3A14;
  --on-solid: #FFFFFF;
  --inverse-bg: #1F2420;
  --inverse-text: #FFFFFF;
  --inverse-hover: #000000;
  --hover: #FAFAF7;
  --focus: #1F5FA8;
  --backdrop: rgba(31, 36, 32, .45);
  --shadow: rgba(0, 0, 0, .25);
  color-scheme: light;
  --radius: 12px;
  --nav-h: 64px;
  --font: "Noto Sans JP", "Noto Sans CJK JP", "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", Meiryo, system-ui, sans-serif;
}

/* ダークモード: 切り替えボタンでのみ切り替える(端末の設定には連動しない)。theme-init.js が data-theme を付ける */
:root[data-theme="dark"] {
  --bg: #141815;
  --surface: #1D221E;
  --line: #353B36;
  --line-soft: #282D29;
  --line-strong: #4B524C;
  --text: #E7E9E4;
  --muted: #A6ADA7;
  --muted-2: #B9BFBA;
  --green: #74C08A;
  --green-dark: #9AD6AB;
  --green-bg: #1F3326;
  --green-line: #335C40;
  --orange: #E8925F;
  --orange-text: #F0A87D;
  --orange-bg: #3A2418;
  --orange-line: #6B4029;
  --blue-text: #9DBDE6;
  --blue-bg: #1E2A3A;
  --star: #E0B050;
  --heart: #F07A8C;
  --point-bg: #352E16;
  --point-text: #E9D79A;
  --photo: #2A2F2B;
  --accent-solid: #2F7A48;
  --accent-solid-hover: #276B3E;
  --warn-solid: #B5501F;
  --warn-strong: #9E4419;
  --on-solid: #FFFFFF;
  --inverse-bg: #E7E9E4;
  --inverse-text: #141815;
  --inverse-hover: #FFFFFF;
  --hover: #252A26;
  --focus: #8AB8F2;
  --backdrop: rgba(0, 0, 0, .6);
  --shadow: rgba(0, 0, 0, .6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.5; min-width: 320px; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--green); }
a:hover { color: var(--green-dark); }
h1, h2, h3 { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.boot { padding: 40px 16px; text-align: center; color: var(--muted); }

/* ---------- 枠組み ---------- */
.app { min-height: 100vh; }
.shell { min-height: 100vh; display: flex; flex-direction: column; padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
.main { flex: 1; width: 100%; max-width: 720px; margin: 0 auto; }
.page { padding: 16px; display: flex; flex-direction: column; gap: 16px; }

.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); display: flex; background: var(--surface); border-top: 1px solid var(--line); }
.nav-brand, .nav-account { display: none; }
.nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; color: var(--muted); text-decoration: none; position: relative; min-height: 44px; }
.nav a[aria-current="page"] { color: var(--green); font-weight: 700; }
.nav a[aria-current="page"]::after { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--green); }
.nav .count { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--warn-solid); color: var(--on-solid); font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.nav .label { white-space: nowrap; }

.hdr { position: sticky; top: 0; z-index: 10; min-height: 56px; padding: 6px 8px 6px 16px; display: flex; align-items: center; gap: 4px; background: var(--surface); border-bottom: 1px solid var(--line); }
.hdr.has-back { padding-left: 4px; }
.hdr-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hdr-title h1 { font-size: 17px; font-weight: 700; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hdr-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hdr-pill { font-size: 12px; color: var(--muted); padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; white-space: nowrap; }

/* PC: 左ナビ＋2ペイン(S8) */
@media (min-width: 1024px) {
  .shell { flex-direction: row; padding-bottom: 0; }
  .nav { position: sticky; top: 0; bottom: auto; width: 220px; height: 100vh; flex: none; flex-direction: column; align-items: stretch; gap: 2px; padding: 16px 10px; border-top: 0; border-right: 1px solid var(--line); }
  .nav-brand { display: block; font-size: 16px; font-weight: 700; padding: 6px 10px 16px; }
  .nav a { flex: none; flex-direction: row; justify-content: flex-start; gap: 10px; padding: 0 10px; height: 44px; font-size: 14px; border-radius: 8px; }
  .nav a[aria-current="page"] { background: var(--green-bg); color: var(--green-dark); }
  .nav a[aria-current="page"]::after { top: 10px; bottom: 10px; left: 0; right: auto; width: 3px; height: auto; border-radius: 0 3px 3px 0; }
  .nav .count { position: static; margin-left: auto; }
  .nav-account { display: flex; flex-direction: column; gap: 6px; margin-top: auto; padding: 10px; font-size: 12px; color: var(--muted); }
  .main { max-width: none; margin: 0; min-width: 0; }
  .main.single > .view { max-width: 760px; }
  .split { display: grid; grid-template-columns: minmax(380px, 440px) minmax(0, 1fr); height: 100vh; }
  .split > .pane { overflow-y: auto; min-width: 0; }
  .split > .pane-list { border-right: 1px solid var(--line); }
  .pane-empty { height: 100%; display: flex; align-items: center; justify-content: center; color: var(--muted); padding: 24px; text-align: center; }
  .split .hdr .back { display: none; }
  .dish.main-dish { flex-direction: row; }
  .dish.main-dish > .photo { width: 56%; flex: none; }
  .dish.main-dish .dish-body { padding: 14px 16px; }
  .split .pane-detail .page, .main.single .page { max-width: 900px; }
  .split .hdr.has-back { padding-left: 16px; }
}

/* ---------- 部品 ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card-pad { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.section-title { font-size: 13px; font-weight: 700; color: var(--muted); }
.help { font-size: 12px; color: var(--muted); line-height: 1.6; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field-label { font-size: 14px; font-weight: 700; }
.input { height: 46px; padding: 0 12px; font-size: 16px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); width: 100%; }
.input:focus { border-color: var(--green); }

.btn { min-height: 44px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; text-decoration: none; color: var(--text); white-space: nowrap; }
.btn:hover { background: var(--hover); }
.btn-primary { background: var(--accent-solid); border-color: var(--accent-solid); color: var(--on-solid); font-weight: 700; }
.btn-primary:hover { background: var(--accent-solid-hover); border-color: var(--accent-solid-hover); color: var(--on-solid); }
.btn-warn { border-color: var(--orange); color: var(--orange); font-weight: 700; }
.btn-dark { background: var(--inverse-bg); border-color: var(--inverse-bg); color: var(--inverse-text); font-weight: 700; }
.btn-dark:hover { background: var(--inverse-hover); }
.btn-lg { min-height: 54px; font-size: 17px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: 0 10px; font-size: 12px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn .spin { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { width: 44px; height: 44px; border: 0; background: transparent; padding: 0; display: inline-flex; align-items: center; justify-content: center; color: inherit; cursor: pointer; border-radius: 8px; flex: none; }
.icon-btn:hover { background: var(--line-soft); }
.theme-btn { width: 36px; padding: 0; }

.seg { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 8px; }
.seg button { height: 46px; font-size: 16px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); cursor: pointer; position: relative; }
.seg button[aria-pressed="true"] { border: 2px solid var(--green); background: var(--green-bg); color: var(--green-dark); font-weight: 700; }
.seg button[aria-pressed="true"]::before { content: ""; position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.seg.sm button { height: 40px; font-size: 13px; }

.badge { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; padding: 1px 7px; border-radius: 4px; white-space: nowrap; line-height: 1.6; }
.b-green { background: var(--green-bg); color: var(--green-dark); }
.b-orange { background: var(--orange-bg); color: var(--orange-text); }
.b-blue { background: var(--blue-bg); color: var(--blue-text); }
.b-gray { background: var(--line-soft); color: var(--muted-2); }

/* 食材ラベル: 一致=緑・実線・✓ / 辞書にない語=橙・破線・! / 対象外=灰・点線 / 照合中=灰 */
.chipbox { min-height: 48px; padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; cursor: text; }
.chipbox:focus-within { border-color: var(--green); outline: 3px solid var(--focus); outline-offset: 2px; }
.chipbox input { flex: 1; min-width: 96px; height: 32px; border: 0; outline: none; font-size: 16px; background: transparent; }
.chip { height: 32px; padding: 0 2px 0 8px; border-radius: 999px; font-size: 14px; display: inline-flex; align-items: center; gap: 3px; border: 1px solid var(--line-strong); background: var(--line-soft); color: var(--muted-2); max-width: 100%; }
.chip-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip button { width: 28px; height: 28px; border: 0; background: transparent; padding: 0; display: flex; align-items: center; justify-content: center; color: inherit; border-radius: 50%; cursor: pointer; }
.chip button:hover { background: var(--line-soft); }
.chip.ok { background: var(--green-bg); color: var(--green-dark); border: 1px solid var(--green-line); }
.chip.ng { background: var(--orange-bg); color: var(--orange-text); border: 1.5px dashed var(--orange); }
.chip.ex { border-style: dotted; }
.chip .mk { font-weight: 700; font-size: 12px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: var(--muted); }
.legend .chip { height: 24px; font-size: 12px; padding: 0 8px; }

/* 検索結果 */
.parse-row { display: grid; grid-template-columns: auto auto 1fr auto; align-items: baseline; gap: 8px; font-size: 13px; }
.parse-row .in { font-weight: 700; }
.parse-row .arrow { color: var(--muted); }
.warn-box { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--orange-text); background: var(--orange-bg); border: 1.5px dashed var(--orange); border-radius: 8px; padding: 8px 10px; }
.warn-box svg { flex: none; margin-top: 2px; }
.plan { overflow: hidden; }
.plan.any { border-color: var(--orange-line); border-width: 1px 1px 1px 1px; }
.plan.active { outline: 3px solid var(--green); outline-offset: -1px; }
.plan-head { padding: 12px 16px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line-soft); }
.slot { width: 32px; height: 32px; flex: none; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700; color: var(--on-solid); background: var(--accent-solid); border-radius: 50%; }
.plan.any .slot { background: var(--warn-solid); border-radius: 6px; }
.plan-label { font-size: 12px; font-weight: 700; color: var(--green); }
.plan.any .plan-label { color: var(--orange-text); }
.plan-title { font-size: 15px; font-weight: 700; }
.plan-last { font-size: 11px; color: var(--muted); text-align: right; margin-left: auto; }
.plan-days { padding: 4px 16px; display: flex; flex-direction: column; }
.plan-day { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.plan-day:last-child { border-bottom: 0; }
.plan-day .txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.plan-day .tag { display: flex; gap: 6px; align-items: center; font-size: 11px; font-weight: 700; color: var(--muted); flex-wrap: wrap; }
.plan-day .main-n { font-size: 14px; font-weight: 700; line-height: 1.4; }
.plan-day .subs { font-size: 12px; color: var(--muted); line-height: 1.4; }
.plan-reasons { padding: 4px 16px 10px; display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.plan-reasons ul { margin: 0; padding-left: 1.2em; line-height: 1.6; }
.plan-actions { padding: 0 16px 14px; display: flex; gap: 8px; align-items: flex-start; }
.plan-actions details { flex: 1; }
.plan-actions .btn-primary { flex: 2; }
.score summary { min-height: 44px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line-strong); border-radius: 8px; font-size: 13px; cursor: pointer; list-style: none; }
.score summary::-webkit-details-marker { display: none; }
.score[open] summary { border-radius: 8px 8px 0 0; }
.score table { width: 100%; border-collapse: collapse; font-size: 12px; border: 1px solid var(--line-strong); border-top: 0; }
.score td { padding: 3px 8px; border-top: 1px solid var(--line-soft); }
.score td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.more-btn { flex-direction: column; gap: 0; min-height: 54px; }
.more-btn small { font-size: 11px; font-weight: 400; }

/* 写真 */
.photo { position: relative; background: var(--photo); overflow: hidden; display: block; width: 100%; aspect-ratio: 4 / 3; border: 0; padding: 0; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo .alt { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--muted-2); font-size: 12px; text-align: center; padding: 6px; }
.thumb { width: 72px; flex: none; border-radius: 6px; }
.thumb .alt { font-size: 9px; }
button.photo { cursor: zoom-in; }

/* 献立詳細 */
.tabs { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 56px; z-index: 9; }
.tabs button { min-height: 48px; border: 0; border-bottom: 3px solid transparent; background: var(--surface); font-size: 14px; color: var(--muted); cursor: pointer; line-height: 1.25; padding: 4px 2px; }
.tabs button small { display: block; font-size: 10px; }
.tabs button[aria-selected="true"] { border-bottom-color: var(--green); color: var(--green-dark); font-weight: 700; }
.meta { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 2px; }
.dishes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dish { overflow: hidden; display: flex; flex-direction: column; }
.dish.main-dish { grid-column: 1 / -1; }
.dish-body { padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.role { font-size: 11px; font-weight: 700; color: var(--green); }
.dish-name { font-size: 14px; font-weight: 700; line-height: 1.4; }
.main-dish .dish-name { font-size: 16px; }
.dish-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 4px; }
.dish-top .fav { margin: -6px -6px 0 0; }
.dish-ops { display: flex; align-items: center; margin-top: auto; margin-left: -8px; }
.stars { display: flex; }
.stars button { width: 40px; height: 44px; border: 0; background: transparent; padding: 0; color: var(--star); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.stars-label { font-size: 11px; color: var(--muted); min-width: 3em; }
.fav { color: var(--muted); }
.fav[aria-pressed="true"] { color: var(--heart); }
.mats { display: flex; flex-direction: column; gap: 10px; }
.mat { padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.mat h3 { font-size: 14px; }
.mat h3 .role { margin-right: 6px; }
.mat .sub-h { font-size: 11px; font-weight: 700; color: var(--muted); margin-top: 6px; }
.mat-row { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; padding: 4px 0; border-bottom: 1px dotted var(--line); }
.mat-row:last-child { border-bottom: 0; }
.mat-row .n { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mat-row .q { text-align: right; white-space: nowrap; }
.mark { display: inline-block; width: 1.2em; color: var(--orange); font-weight: 700; }
.steps { display: flex; flex-direction: column; gap: 10px; }
.step { padding: 12px 14px; display: flex; gap: 12px; }
.step-no { width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--inverse-bg); color: var(--inverse-text); font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.step-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.step-h { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14px; font-weight: 700; }
.step-line { font-size: 13px; line-height: 1.7; }
.step-line.point { background: var(--point-bg); color: var(--point-text); border-radius: 6px; padding: 6px 8px; }
.h2 { font-size: 16px; font-weight: 700; }
.h2 small { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 8px; }
.tip { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; line-height: 1.7; }

/* 買い物リスト */
.list-hdr { position: sticky; top: 0; z-index: 10; padding: 10px 16px 12px; display: flex; flex-direction: column; gap: 8px; background: var(--surface); border-bottom: 1px solid var(--line); }
.list-hdr .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.list-count { display: flex; align-items: baseline; gap: 8px; }
.list-count strong { font-size: 24px; color: var(--orange); }
.progress { height: 8px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.progress > div { height: 100%; background: var(--green); border-radius: 999px; transition: width .2s; }
.menu summary { min-height: 48px; padding: 0 14px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; font-weight: 700; cursor: pointer; }
.menu-row { display: flex; align-items: center; gap: 8px; padding: 6px 14px; border-top: 1px solid var(--line-soft); }
.menu-row .d { width: 48px; flex: none; font-size: 11px; font-weight: 700; color: var(--muted); line-height: 1.3; }
.menu-row .d small { display: block; font-weight: 400; font-size: 10px; }
.menu-row a { flex: 1; min-width: 0; font-size: 13px; color: var(--text); text-decoration: none; line-height: 1.4; }
.menu-row a:hover { text-decoration: underline; }
.cooked-btn { min-width: 84px; }
.cooked-btn[aria-pressed="true"] { background: var(--line-soft); color: var(--muted-2); }
.group { display: flex; flex-direction: column; gap: 4px; }
.group h2 { font-size: 12px; font-weight: 700; color: var(--muted); }
.items { padding: 0 4px; }
.item { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 6px; border-bottom: 1px solid var(--line-soft); }
.item:last-child { border-bottom: 0; }
.item label { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; cursor: pointer; min-height: 44px; }
.item input[type="checkbox"] { width: 24px; height: 24px; margin: 10px; flex: none; accent-color: var(--green); }
.item .l1 { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.item .nm { font-size: 15px; font-weight: 700; }
.item .qt { font-size: 15px; font-weight: 700; color: var(--green-dark); }
.item .l2 { font-size: 12px; color: var(--muted-2); line-height: 1.45; }
.item.done .nm, .item.done .qt { text-decoration: line-through; }
.item.done .l1, .item.done .l2 { opacity: .62; }
.item .who { color: var(--green-dark); }
.item.unsent { background: var(--orange-bg); }
.unsent-note { font-size: 11px; color: var(--orange-text); font-weight: 700; display: flex; align-items: center; gap: 4px; }
.seasoning > summary { min-height: 46px; padding: 0 14px; display: flex; align-items: center; justify-content: space-between; font-size: 14px; cursor: pointer; }
.add-row { display: flex; gap: 8px; }
.add-row .input { flex: 1; min-width: 0; height: 44px; font-size: 15px; }
.empty { padding: 32px 16px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; color: var(--muted); }

/* お気に入り・履歴 */
.fav-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 10px; }
.fav-card { overflow: hidden; text-decoration: none; color: var(--text); display: flex; flex-direction: column; }
.fav-card:hover { border-color: var(--green-line); color: var(--text); }
.fav-card .dish-body { gap: 4px; }
.fav-card .sub { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.hist { padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.hist .top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.hist .date { font-size: 15px; font-weight: 700; }
.hist .who { font-size: 12px; color: var(--muted); }
.hist a { font-size: 14px; font-weight: 700; text-decoration: none; color: var(--text); }
.hist a:hover { text-decoration: underline; }
.hist .subs { font-size: 12px; color: var(--muted); }
.hist .ops { display: flex; justify-content: flex-end; }

/* ログイン */
.auth { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; gap: 24px; padding: 32px 20px; max-width: 420px; margin: 0 auto; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.auth-brand img { width: 64px; height: 64px; border-radius: 16px; }
.auth-brand h1 { font-size: 22px; }
.auth form { display: flex; flex-direction: column; gap: 16px; }
.alert { font-size: 13px; color: var(--orange-text); background: var(--orange-bg); border: 1.5px dashed var(--orange); border-radius: 8px; padding: 10px 12px; display: flex; gap: 8px; align-items: flex-start; }
.alert svg { flex: none; margin-top: 2px; }

/* ダイアログ・通知 */
dialog { border: 0; border-radius: 14px; padding: 0; width: min(440px, calc(100vw - 32px)); max-height: calc(100vh - 32px); color: var(--text); background: var(--surface); box-shadow: 0 10px 40px var(--shadow); }
dialog::backdrop { background: var(--backdrop); }
.dlg { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.dlg h2 { font-size: 17px; }
.dlg p { margin: 0; font-size: 14px; line-height: 1.7; }
.dlg .note { font-size: 13px; color: var(--muted); }
.dlg .acts { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }
.dlg .acts .btn { flex: 1; }
dialog.photo-dlg { width: min(960px, calc(100vw - 24px)); }
.photo-dlg .photo { aspect-ratio: auto; min-height: 200px; }
.photo-dlg .photo img { height: auto; max-height: calc(100vh - 140px); object-fit: contain; }
.photo-dlg .cap { padding: 10px 16px; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 700; }
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50; max-width: calc(100vw - 32px); background: var(--inverse-bg); color: var(--inverse-text); padding: 10px 16px; border-radius: 10px; font-size: 14px; display: flex; gap: 12px; align-items: center; box-shadow: 0 4px 16px var(--shadow); }
.toast button { background: transparent; border: 1px solid currentColor; color: inherit; border-radius: 6px; min-height: 36px; padding: 0 10px; cursor: pointer; }
.offline { position: sticky; top: 0; z-index: 60; background: var(--warn-strong); color: var(--on-solid); font-size: 13px; padding: 8px 16px; text-align: center; }
.loading { padding: 32px 16px; text-align: center; color: var(--muted); }
.error-box { margin: 16px; }
@media (min-width: 1024px) {
  .toast { bottom: 24px; left: calc(50% + 110px); }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
