/* 台所のメモのように、大きな文字と押しやすいボタンで。大きさはすべて rem（設定の「文字の大きさ」で全体が変わる） */
:root {
  --bg: #faf6ee;
  --surface: #ffffff;
  --surface-2: #f1ebdf;
  --ink: #26221d;
  --muted: #5f5950;
  --line: #e0d7c4;
  /* 入力欄・ボタン・スイッチの輪郭（背景との差を 3:1 以上に） */
  --edge: #8a8377;
  --accent: #1c6b62;
  --accent-ink: #ffffff;
  --accent-soft: #dcefe9;
  --warn: #7d5200;
  --warn-soft: #fbefd2;
  --neg: #a82c1d;
  --neg-soft: #fbe6e1;
  --blue: #27578f;
  --blue-soft: #e3edf9;
  --pr-bg: #26221d;
  --pr-ink: #ffffff;
  /* 赤い地（--neg）の上の文字／背景の模様の色（着せ替えで使う） */
  --on-neg: #ffffff;
  --pattern: #faf6ee;
  /* テーマ（有料の着せ替え）が使う色：模様の2色目／見出しの帯の地と文字／主ボタンの地と文字／飾りの色。標準では、ふだんの色と同じ */
  --pattern-2: #faf6ee;
  --head: #faf6ee;
  --head-ink: #26221d;
  --fill: #1c6b62;
  --fill-ink: #ffffff;
  --deco: #1c6b62;
  --deco-2: #dcefe9;
  --shadow: 0 1px 2px rgba(38, 34, 29, 0.06), 0 6px 18px rgba(38, 34, 29, 0.05);
  --radius: 1rem;
  --tabs-h: 4.1rem;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
[data-theme='dark'] {
  --bg: #171a19;
  --surface: #212625;
  --surface-2: #2c3231;
  --ink: #ece9e2;
  --muted: #b4b0a6;
  --line: #3d4442;
  --edge: #8b938f;
  --accent: #6fcdbd;
  --accent-ink: #0d201c;
  --accent-soft: #1f3b36;
  --warn: #f1bd5e;
  --warn-soft: #3d3115;
  --neg: #ff9483;
  --neg-soft: #44211b;
  --blue: #8fb8ee;
  --blue-soft: #1f2e44;
  --pr-bg: #ece9e2;
  --pr-ink: #171a19;
  --on-neg: #2a0d08;
  --pattern: #171a19;
  --pattern-2: #171a19;
  --head: #171a19;
  --head-ink: #ece9e2;
  --fill: #6fcdbd;
  --fill-ink: #0d201c;
  --deco: #6fcdbd;
  --deco-2: #1f3b36;
  --shadow: none;
  color-scheme: dark;
}

html { font-size: 17px; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html[data-text='large'] { font-size: 20.4px; }
html[data-text='xlarge'] { font-size: 23.8px; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
/* アプリ型レイアウト：ページ全体は動かさず、中身だけをスクロール */
html, body { position: fixed; inset: 0; width: 100%; height: 100%; overflow: hidden; overscroll-behavior: none; }
#root { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Noto Sans CJK JP', 'Segoe UI', Meiryo, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
a { touch-action: manipulation; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.35; }
h1 { font-size: 1.4rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1.05rem; }
h4 { font-size: 0.95rem; color: var(--muted); }
p { margin: 0.35em 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
h2:focus { outline: none; }
[hidden] { display: none !important; }

.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small, small { font-size: 0.88rem; }
.strong { font-weight: 700; }
.big-text { font-size: 1.2rem; margin: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; opacity: 0; }

.splash, .fatal { height: 100%; overflow: auto; display: grid; place-content: center; text-align: center; gap: 0.8rem; font-weight: 700; color: var(--accent); padding: 1.5rem; font-size: 1.3rem; }
.fatal p { color: var(--ink); font-size: 1rem; font-weight: 400; }
.fatal-detail { color: var(--neg); overflow-wrap: anywhere; }
.recovery { height: 100%; overflow-y: auto; max-width: 36rem; margin: 0 auto; padding: calc(var(--safe-t) + 1.5rem) 1.2rem 2rem; display: flex; flex-direction: column; gap: 0.8rem; }
.recovery-choice { display: flex; flex-direction: column; gap: 0.2rem; }
.recovery-message { background: var(--accent-soft); border-radius: 0.8rem; padding: 0.7rem 0.9rem; font-weight: 700; }

/* ---------- 骨格 ---------- */
.app { max-width: 36rem; margin: 0 auto; height: 100%; display: flex; flex-direction: column; overflow: hidden; position: relative; }
.main { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding-top: var(--safe-t); }
.screen { padding: 0.8rem 1rem 1.6rem; display: flex; flex-direction: column; gap: 0.8rem; min-height: 100%; }
.screen.with-bar { padding-bottom: 0; }
.screen-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; min-height: 3rem; }
.screen-sub { color: var(--muted); margin: 0; }
.section { display: flex; flex-direction: column; gap: 0.7rem; }
.save-error { background: var(--neg); color: var(--on-neg); padding: calc(var(--safe-t) + 0.6rem) 1rem 0.6rem; font-weight: 700; }

/* ---------- ボタン ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.1rem 0.4rem; flex-wrap: wrap;
  min-height: 3rem; padding: 0.4rem 1rem; border-radius: 0.8rem; border: 1.5px solid transparent;
  font-weight: 700; font-size: 1rem; line-height: 1.3; text-decoration: none; text-align: center; background: none;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: var(--surface); border-color: var(--edge); color: var(--ink); }
.btn.text { color: var(--accent); text-decoration: underline; text-underline-offset: 0.2em; font-weight: 600; }
.btn.danger { background: var(--neg); color: var(--on-neg); }
.btn.danger-ghost { background: var(--surface); border-color: var(--neg); color: var(--neg); }
.btn.wide { width: 100%; }
.btn.big { min-height: 3.4rem; font-size: 1.05rem; }
.btn.small { min-height: 2.75rem; padding: 0.3rem 0.8rem; font-size: 0.95rem; }
/* 押せないボタンは、枠だけにして文字は読める濃さのまま（「何をすれば押せるか」の説明を兼ねるため） */
.btn:disabled { background: var(--surface-2); border: 1.5px dashed var(--edge); color: var(--muted); cursor: default; }
.btn:active:not(:disabled) { transform: translateY(1px); filter: brightness(0.96); }
.btn.link small { font-weight: 400; font-size: 0.85rem; }
.btn-row { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: flex-end; }
.btn-row > .btn, .btn-row > .restock-link { flex: 1 1 8rem; }
/* 品物の詳細：幅が狭い画面では、文字が途中で折れないように縦に並べる */
.buy-box .btn-row > .btn, .buy-box .btn-row > .restock-link, .buy-box .btn-row > .in-list { flex: 1 1 9.6rem; }
.icon-btn { width: 3rem; height: 3rem; flex: none; display: grid; place-items: center; border: none; background: none; border-radius: 50%; color: var(--muted); }
.icon-btn.labeled { width: auto; min-width: 3rem; height: auto; min-height: 3rem; padding: 0.1rem 0.3rem; border-radius: 0.8rem; gap: 0; font-size: 0.85rem; font-weight: 600; }
.icon-btn:disabled { opacity: 0.3; }
.icon-btn:active:not(:disabled) { background: var(--surface-2); }

/* ---------- カード ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 0.8rem 0.9rem; display: flex; flex-direction: column; gap: 0.6rem; }
.cards { display: flex; flex-direction: column; gap: 0.6rem; }
.card.hint { background: var(--blue-soft); border-color: transparent; box-shadow: none; }
.card.hint .btn { align-self: flex-start; }
.empty { text-align: center; padding: 1.8rem 1rem; background: var(--surface-2); border-radius: var(--radius); }
.empty-title { font-weight: 700; font-size: 1.1rem; }
.empty-actions { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.8rem; }
.note { background: var(--warn-soft); color: var(--ink); border-radius: 0.8rem; padding: 0.7rem 0.9rem; font-size: 0.92rem; margin: 0; }

/* きょうのカード：左に内容（押すと詳細）、右に操作。1枚を低くして、開いた瞬間に3件以上見えるように */
.today-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0.4rem 0.6rem; border-left: 0.45rem solid var(--accent); padding: 0.6rem 0.7rem 0.6rem 0.75rem; }
.today-card.k-expiry, .today-card.near { border-left-color: var(--warn); }
.today-card.k-restock { border-left-color: var(--blue); }
.today-card.late { border-left-color: var(--neg); }
.today-main { display: flex; flex-direction: column; align-items: flex-start; gap: 0.05rem; text-align: left; background: none; border: none; padding: 0; min-height: 3rem; min-width: 0; justify-content: center; }
.kind { font-size: 0.82rem; font-weight: 700; padding: 0 0.5rem; border-radius: 1rem; background: var(--accent-soft); color: var(--accent); }
.k-expiry .kind { background: var(--warn-soft); color: var(--warn); }
.k-restock .kind { background: var(--blue-soft); color: var(--blue); }
.today-name { font-weight: 700; font-size: 1.08rem; line-height: 1.35; overflow-wrap: anywhere; }
.today-status { margin: 0; font-weight: 600; font-size: 0.95rem; }
.late .today-status { color: var(--neg); }
.today-actions { display: flex; flex-direction: column; gap: 0.4rem; }
.today-actions .btn { padding: 0.3rem 0.8rem; white-space: nowrap; }
.today-extra, .today-note { grid-column: 1 / -1; }
.today-note { margin: 0; font-size: 0.88rem; color: var(--muted); }
.card-done { display: flex; align-items: center; gap: 0.4rem; min-height: 3rem; padding: 0.4rem 0.9rem; border: 1.5px dashed var(--line); border-radius: var(--radius); color: var(--muted); font-weight: 600; }

/* 楽天市場へのリンクと、広告の表記 */
.restock-link { display: flex; flex-direction: column; align-items: stretch; gap: 0.25rem; }
.restock-link .btn { width: 100%; }
.restock-link.compact { flex: 1 1 100%; }
.restock-link.compact .btn { min-height: 2.75rem; padding: 0.2rem 0.7rem; font-size: 0.95rem; }
/* 広告の表記は、隣のリンクの文字と同じ大きさ以上・はっきりした色で（小さい文字や薄い色にしない） */
/* 広告リンク：<a> の中身は変えず、外側の枠で見た目を付ける。枠のどこを押してもリンクが開く */
.aff-frame { position: relative; }
.aff-frame a { color: inherit; text-decoration: none; font: inherit; overflow-wrap: anywhere; }
.aff-frame a::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.pr-mark { align-self: flex-start; font-size: 1rem; font-weight: 700; line-height: 1.4; color: var(--pr-ink); background: var(--pr-bg); border-radius: 0.35rem; padding: 0.05rem 0.55rem; }

/* ---------- 押して選ぶボタン ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip { display: inline-flex; align-items: center; gap: 0.25rem; min-height: 2.9rem; padding: 0.3rem 0.9rem; border-radius: 1.5rem; border: 1.5px solid var(--edge); background: var(--surface); font-weight: 600; text-align: left; }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip.done { background: var(--accent-soft); border-color: var(--accent); color: var(--ink); }
.chip small { font-weight: 400; color: var(--muted); }
.chip:active { filter: brightness(0.95); }

/* ---------- 下のタブ ---------- */
.tabs { flex: none; display: flex; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: var(--safe-b); }
.tab { flex: 1; min-height: var(--tabs-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.05rem; background: none; border: none; border-top: 0.25rem solid transparent; color: var(--muted); font-weight: 600; }
/* いまの画面：色だけでなく、上の線・薄い背景・太字でも示す */
.tab.on { color: var(--accent); border-top-color: var(--accent); background: var(--accent-soft); font-weight: 800; }
.tab-label { font-size: 0.9rem; }
.tab-icon { position: relative; display: grid; }
.tab-badge { position: absolute; top: -0.35rem; left: 60%; min-width: 1.35rem; height: 1.35rem; padding: 0 0.3rem; border-radius: 1rem; background: var(--neg); color: var(--on-neg); font-size: 0.8rem; line-height: 1.35rem; text-align: center; font-weight: 700; }

/* ---------- お知らせ（元に戻す）：ほかの部品に重ねず、タブ／シートのボタンのすぐ上に行として入る ---------- */
.notice { flex: none; display: flex; align-items: center; gap: 0.5rem; margin: 0.3rem 0.6rem; background: #2b2722; color: #fff; border-radius: 0.9rem; padding: 0.3rem 0.4rem 0.3rem 0.9rem; }
[data-theme='dark'] .notice { background: #ece9e2; color: #1c1a17; }
.notice.error { background: var(--neg); color: var(--on-neg); }
.notice-text { flex: 1; min-width: 0; padding: 0.3rem 0; font-weight: 600; font-size: 0.95rem; line-height: 1.4; overflow-wrap: anywhere; }
.notice-undo { flex: none; min-height: 2.75rem; padding: 0 0.9rem; border-radius: 0.7rem; border: 1.5px solid currentColor; background: none; color: inherit; font-weight: 700; white-space: nowrap; }

/* ---------- 初回 ---------- */
.welcome, .pick { flex: 1; min-height: 0; display: flex; flex-direction: column; padding-top: var(--safe-t); }
.welcome-body { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 0.5rem; padding: 1.6rem 1.4rem; }
.welcome-icon { border-radius: 22%; margin-bottom: 0.4rem; width: 5rem; height: 5rem; }
.welcome-body h1 { font-size: 1.8rem; margin-bottom: 0.3rem; }
.welcome-body p { font-size: 1.05rem; }
.welcome-privacy { margin: 0.6rem 0 !important; padding: 0.8rem 1rem; background: var(--accent-soft); border-radius: 0.8rem; font-size: 1rem !important; }
.welcome-foot, .pick-foot { flex: none; padding: 0.7rem 1.2rem calc(0.9rem + var(--safe-b)); display: flex; flex-direction: column; gap: 0.4rem; background: var(--bg); border-top: 1px solid var(--line); }
.welcome-foot { border-top: none; }
.pick-body { flex: 1; overflow-y: auto; padding: 1.2rem 1.1rem 1.5rem; display: flex; flex-direction: column; gap: 0.6rem; }
.pick-group { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.6rem; }
.pick-count { text-align: center; font-weight: 700; margin: 0; }

/* ---------- 在庫 ---------- */
/* 置き場所の切り替え：横に流さず折り返す（文字が大きくても「日用品」が画面の外に出ないように） */
.genre-tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.genre-tab { flex: none; min-height: 2.9rem; padding: 0 1rem; border-radius: 1.5rem; border: 1.5px solid var(--edge); background: var(--surface); font-weight: 700; color: var(--muted); white-space: nowrap; }
.genre-tab.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.stock-list { display: flex; flex-direction: column; gap: 1rem; flex: 1; }
.rows { display: flex; flex-direction: column; gap: 0.5rem; }
.rows > li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.4rem 0.6rem 0.5rem 0.9rem; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.5rem; }
.row-name { flex: 1 1 6rem; min-width: 0; min-height: 3rem; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; background: none; border: none; padding: 0; text-align: left; }
.row-name > svg { margin-left: auto; color: var(--muted); flex: none; }
.row.recipe .row-name { flex-direction: column; align-items: flex-start; gap: 0; justify-content: center; }
.name { font-weight: 700; font-size: 1.05rem; overflow-wrap: anywhere; }
.row-control { flex: none; }
.row.m-level .row-control { flex: 1 1 100%; }
.row-out { flex: 1 1 100%; display: flex; justify-content: flex-end; }
.row.is-out .name { color: var(--muted); }
.expiry-tag { font-size: 0.88rem; font-weight: 700; padding: 0.05rem 0.55rem; border-radius: 1rem; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.expiry-tag.near { background: var(--warn-soft); color: var(--warn); }
.expiry-tag.late { background: var(--neg-soft); color: var(--neg); }
.out-section { display: flex; flex-direction: column; gap: 0.5rem; }
.out-section h2 { color: var(--muted); font-size: 1rem; }
.out-section .rows > li { background: var(--surface-2); }
.in-list { padding: 0.6rem 0.5rem; }

/* 下に固定するボタンの帯（在庫の「品物を足す」、買い物の「追加」「在庫に入れる」）。片手で届く位置に置く */
.bottom-bar { position: sticky; bottom: 0; z-index: 10; margin: auto -1rem 0; padding: 0.9rem 1rem 0.7rem; background: linear-gradient(to top, var(--bg) 80%, transparent); display: flex; gap: 0.5rem; }
.bottom-bar .btn { flex: 1; }
.bottom-bar.two .btn.ghost { flex: 0 0 auto; }

/* 数量の ＋− */
.stepper { display: inline-flex; align-items: center; gap: 0.5rem; }
.step-btn { width: 3rem; height: 3rem; flex: none; border-radius: 0.8rem; border: 1.5px solid var(--edge); background: var(--surface-2); display: grid; place-items: center; color: var(--ink); }
.step-btn:disabled { opacity: 0.4; border-style: dashed; }
.step-btn:active:not(:disabled) { background: var(--accent-soft); }
.step-value { min-width: 3rem; height: 3rem; padding: 0 0.1rem; border: none; border-bottom: 2px dotted var(--edge); border-radius: 0; background: none; display: inline-flex; align-items: baseline; justify-content: center; gap: 0.15rem; font-size: 1.35rem; font-weight: 700; line-height: 2.9rem; }
.step-value:disabled { color: inherit; opacity: 1; border-bottom-color: transparent; }
.step-unit { font-size: 0.88rem; font-weight: 600; color: var(--muted); }
.step-input { width: 4.2rem; height: 3rem; text-align: center; font-size: 1.3rem; font-weight: 700; border: 2px solid var(--accent); border-radius: 0.7rem; background: var(--surface); padding: 0; }

/* 段階 */
.levels { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
.level { min-height: 3rem; padding: 0 0.1rem; border-radius: 0.7rem; border: 1.5px solid var(--edge); background: var(--surface); font-weight: 600; font-size: 0.95rem; color: var(--muted); white-space: nowrap; }
.level.on { background: var(--accent); border: 3px solid var(--ink); color: var(--accent-ink); font-weight: 800; }
.level.lv0.on { background: var(--muted); color: var(--bg); }
.level.lv1.on { background: var(--warn); color: var(--bg); }
/* 文字が「とても大きい」ときは、2×2 に並べる */
html[data-text='xlarge'] .levels { grid-template-columns: repeat(2, 1fr); }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0.3rem; background: var(--surface-2); border: 1.5px solid var(--edge); border-radius: 0.9rem; padding: 0.25rem; }
.seg button { min-height: 2.75rem; border: 2px solid transparent; border-radius: 0.7rem; background: none; font-weight: 600; color: var(--muted); padding: 0.1rem 0.2rem; line-height: 1.25; }
@media (max-width: 374px) {
  /* 幅の狭い画面（360px など）で、3つ並びの選択肢の文字が途中で折れないように */
  .seg { gap: 0.05rem; padding: 0.15rem; }
  .seg button { font-size: 0.85rem; padding: 0.1rem 0; letter-spacing: -0.04em; }
}
.seg button.on { background: var(--surface); color: var(--ink); font-weight: 800; border-color: var(--ink); }

.toggle { width: 100%; min-height: 3rem; display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; background: none; border: none; padding: 0; text-align: left; font-weight: 600; }
.toggle-track { flex: none; width: 3.3rem; height: 2rem; border-radius: 1rem; background: var(--edge); position: relative; transition: background 0.15s; }
.toggle-thumb { position: absolute; top: 0.2rem; left: 0.2rem; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.15s; }
.toggle.on .toggle-track { background: var(--accent); }
.toggle.on .toggle-thumb { transform: translateX(1.3rem); }

/* ---------- 入力 ---------- */
.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field-label { font-weight: 700; font-size: 0.95rem; color: var(--muted); }
.field-hint { font-size: 0.88rem; color: var(--muted); margin: 0; }
.input { width: 100%; min-height: 3rem; padding: 0.5rem 0.8rem; border-radius: 0.8rem; border: 1.5px solid var(--edge); background: var(--surface); font-size: 1.05rem; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
select.input { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 1.2rem) 50%, calc(100% - 0.85rem) 50%; background-size: 0.35rem 0.35rem; background-repeat: no-repeat; padding-right: 2.2rem; }
input[type='date'].input { -webkit-appearance: none; appearance: none; text-align: left; }
.datefield { display: flex; flex-direction: column; gap: 0.5rem; }
.with-unit { display: flex; align-items: center; gap: 0.5rem; }
.with-unit .input { flex: 1; }
.fold { border: 1.5px solid var(--edge); border-radius: 0.8rem; padding: 0 0.8rem; }
.fold summary { min-height: 3rem; display: flex; align-items: center; font-weight: 600; cursor: pointer; }
.fold[open] { padding-bottom: 0.8rem; display: flex; flex-direction: column; gap: 0.5rem; }
.buy-box { background: var(--accent-soft); border-radius: var(--radius); padding: 0.8rem; gap: 0.5rem; }

/* ---------- シート ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(20, 18, 15, 0.45); display: flex; align-items: flex-end; justify-content: center; animation: fade 0.15s ease-out; }
.sheet { width: 100%; max-width: 36rem; max-height: 92%; background: var(--bg); border-radius: 1.3rem 1.3rem 0 0; display: flex; flex-direction: column; animation: rise 0.2s ease-out; box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.2); }
.sheet.tall { height: 92%; }
.sheet-head { flex: none; position: relative; padding: 1.2rem 1.1rem 0.5rem; }
.sheet-grip { position: absolute; top: 0.45rem; left: 50%; width: 2.6rem; height: 0.28rem; margin-left: -1.3rem; border-radius: 1rem; background: var(--edge); }
.sheet-head h2 { font-size: 1.2rem; overflow-wrap: anywhere; }
.sheet-body { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 0.4rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: 1rem; }
/* 閉じるボタンは下端（片手で届く位置）。主なボタンがあるときは、その左 */
.sheet-foot { flex: none; padding: 0.6rem 1.1rem calc(0.7rem + var(--safe-b)); border-top: 1px solid var(--line); display: flex; gap: 0.5rem; }
.sheet-foot .btn { flex: 1 1 0; min-height: 3.2rem; }
.sheet-foot .sheet-close:not(:only-child) { flex: 0 0 auto; }
.sheet-close { white-space: nowrap; }
.group { display: flex; flex-direction: column; gap: 0.8rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.group.first { border-top: none; padding-top: 0; }
.group.emphasis { background: var(--blue-soft); border: none; border-radius: var(--radius); padding: 1rem; }
.predict-box { background: var(--surface); border: 1px solid var(--line); border-radius: 0.8rem; padding: 0.7rem 0.9rem; }
.history li { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; border-bottom: 1px solid var(--line); min-height: 3rem; }
.history li:last-child { border-bottom: none; }
.policy { display: flex; flex-direction: column; gap: 0.2rem; }

.dialog-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(20, 18, 15, 0.55); display: grid; place-items: center; padding: 1.2rem; animation: fade 0.15s ease-out; }
.dialog-backdrop.low { align-items: end; padding-bottom: calc(var(--safe-b) + 1.2rem); }
.dialog { width: 100%; max-width: 26rem; max-height: 92%; overflow-y: auto; background: var(--bg); border-radius: 1.2rem; padding: 1.2rem 1.1rem 1rem; display: flex; flex-direction: column; gap: 0.6rem; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3); }
.dialog h3 { font-size: 1.2rem; }
.dialog-actions { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.3rem; }

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(12%); opacity: 0.6; } }
@media (prefers-reduced-motion: reduce) {
  .sheet, .sheet-backdrop, .dialog-backdrop { animation: none; }
  .toggle-track, .toggle-thumb { transition: none; }
}

/* ---------- 買い物 ---------- */
.suggest { background: var(--blue-soft); border-color: transparent; box-shadow: none; gap: 0.3rem; }
.suggest-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.suggest-head h2 { flex: 1; min-width: 0; }
.suggest-head .btn { flex: none; white-space: nowrap; }
.suggest-list { display: flex; flex-direction: column; }
.suggest-list li { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.3rem 0.6rem; padding: 0.5rem 0; border-top: 1px solid var(--line); }
.suggest-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.suggest-list .btn.primary { flex: none; }
.shop-group { display: flex; flex-direction: column; gap: 0.5rem; }
.shop-group h2 { font-size: 1rem; color: var(--muted); }
.shop-group .rows > li { padding: 0; overflow: hidden; }
.shop-main { display: flex; align-items: stretch; }
.check { flex: 1; min-width: 0; min-height: 3.4rem; display: flex; align-items: center; gap: 0.8rem; background: none; border: none; padding: 0.3rem 0.4rem 0.3rem 0.8rem; text-align: left; }
.check-box { flex: none; width: 2rem; height: 2rem; border-radius: 0.55rem; border: 2px solid var(--edge); display: grid; place-items: center; background: var(--surface); color: var(--accent-ink); }
.check-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.checked .check-box { background: var(--accent); border-color: var(--accent); }
.checked .name { text-decoration: line-through; color: var(--muted); }
.qty-btn { flex: none; min-width: 4.6rem; display: flex; align-items: center; justify-content: center; gap: 0.2rem; background: none; border: none; border-left: 1px solid var(--line); font-weight: 700; font-size: 1.05rem; color: var(--ink); padding: 0 0.6rem; }
.shop-extra { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; padding: 0.6rem 0.8rem; border-top: 1px solid var(--line); background: var(--surface-2); }
.hint-line { text-align: center; }
.done-list { display: flex; flex-direction: column; }
.done-list li { padding: 0.5rem 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 0.5rem; }
.done-row { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; min-height: 2.75rem; }
.done-added { margin-left: 0.5rem; font-weight: 600; }
.tag { margin-left: 0.5rem; padding: 0.05rem 0.5rem; border-radius: 1rem; background: var(--accent-soft); color: var(--accent); font-weight: 700; white-space: nowrap; }

/* ---------- 料理 ---------- */
.section > h2 { margin-top: 0.3rem; }
.ing-list { display: flex; flex-direction: column; }
.ing-list li { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
/* 名前｜量｜ごみ箱 を1行に固定（ごみ箱だけ下の段に落ちて、どの食材のものか分からなくならないように） */
.ing-row { display: grid; grid-template-columns: minmax(0, 1fr) 3rem; align-items: center; gap: 0.3rem 0.5rem; padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
.ing-row .name { grid-column: 1; }
.ing-row .icon-btn { grid-column: 2; grid-row: 1 / span 2; }
.ing-row .stepper, .ing-row select.input { grid-column: 1; }
.ing-list .name { flex: 1 1 6rem; }
.ing-list li select.input { width: auto; flex: 0 1 11rem; }

/* ---------- 設定 ---------- */
.genre-list { display: flex; flex-direction: column; gap: 0.4rem; }
.genre-list li { display: flex; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 0.9rem; padding: 0.15rem 0.2rem 0.15rem 0.9rem; }
.genre-name { flex: 1; min-width: 0; min-height: 3rem; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; background: none; border: none; padding: 0; text-align: left; }
.genre-list .icon-btn.trash { margin-left: 0.5rem; }
.add-genre { display: flex; flex-direction: column; gap: 0.6rem; padding: 0.9rem; border: 1.5px dashed var(--edge); border-radius: 0.9rem; }
.steps { list-style: decimal; padding-left: 1.4rem; display: flex; flex-direction: column; gap: 0.3rem; }
.about { list-style: disc; padding-left: 1.3rem; display: flex; flex-direction: column; gap: 0.4rem; }

/* 文字が「とても大きい」ときは、カードのボタンを内容の下に並べる（内容の文字が細く折れないように） */
html[data-text='xlarge'] .today-card { grid-template-columns: minmax(0, 1fr); }
html[data-text='xlarge'] .today-actions { flex-direction: row; flex-wrap: wrap; }
html[data-text='xlarge'] .today-actions .btn { flex: 1 1 auto; }

/* ---------- レシピを探す：検索の言葉・ほかの検索サイト ---------- */
.recipe-more { margin-top: 1rem; }
.recipe-more h3 { font-size: 1rem; margin: 0; }
.recipe-query { display: flex; flex-direction: column; gap: 0.2rem; margin: 0; }
.recipe-words { font-weight: 700; overflow-wrap: anywhere; user-select: all; -webkit-user-select: all; }

/* ---------- プラス（有料の追加機能）・振り返り ---------- */
.plus-price { font-weight: 700; margin: 0; }
.test-note { background: var(--warn-soft); color: var(--ink); border-radius: 0.8rem; padding: 0.7rem 0.9rem; font-weight: 700; margin: 0; }
.report-list { list-style: disc; padding-left: 1.3rem; display: flex; flex-direction: column; gap: 0.3rem; margin: 0; }

/* β版の印（正式版では出ない）。名前のじゃまをしない、小さな札 */
.beta-tag { display: inline-block; margin-left: 0.5rem; padding: 0.05rem 0.5rem; border: 1px solid var(--line); border-radius: 999px; font-size: 0.8rem; font-weight: 600; color: var(--muted); vertical-align: middle; line-height: 1.5; white-space: nowrap; }
.beta-note { margin: 0.3rem 0 0.6rem; }

/* 買った回ごとの期限（プラス） */
.lots { display: grid; gap: 0.5rem; }
.lots-loose { margin: 0; }

/* ---- 広告（正式版だけ） ---- */
/* バナー広告：内容のいちばん下。前後を空け、出る前から高さを取っておく（あとから画面がずれて、押しまちがえるのを防ぐ） */
.ad-banner { margin: 2.5rem 0 1.5rem; padding-top: 0.8rem; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 0.3rem; }
.ad-label { margin: 0; font-size: 0.8rem; color: var(--muted); letter-spacing: 0.05em; }
.ad-slot { display: block; width: 100%; min-height: 100px; }
.ad-stub { display: grid; place-items: center; border: 1.5px dashed var(--edge); border-radius: 0.6rem; color: var(--muted); background: var(--surface-2); font-size: 0.9rem; }
.ad-notice-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.reward-offer { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 0.6rem; padding: 0.9rem; border-radius: var(--radius); background: var(--surface-2); }
.reward-offer p { margin: 0; }
.reward-active { background: var(--blue-soft); border-radius: 0.8rem; padding: 0.7rem 0.9rem; margin: 0; }
.ad-stub-overlay { position: fixed; inset: 0; z-index: 1000; background: rgba(0, 0, 0, 0.7); display: grid; place-items: center; padding: 1rem; }
.ad-stub-box { background: var(--surface); color: var(--ink); border-radius: var(--radius); padding: 1.2rem; width: min(100%, 22rem); display: flex; flex-direction: column; gap: 0.8rem; }
.ad-stub-title { margin: 0; font-weight: 700; font-size: 1.1rem; }
.bulk-text { min-height: 9rem; resize: vertical; font-family: inherit; line-height: 1.6; }
.csv-box { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 0.4rem; }
.csv-box p { margin: 0; }

/* ---------- 着せ替え（設計書 16章）。色は、<html> に当てた変数で切り替わる。ここは、選ぶ画面（カード・試着・演出）・角の丸み・背景の模様 ---------- */
.skin-section { gap: 0.6rem; }
.skin-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.7rem; }
/* カード：押しこめる厚みのある形。押すと沈む */
.skin-card { width: 100%; min-height: 3rem; display: flex; flex-direction: column; align-items: stretch; gap: 0.3rem; padding: 0.4rem 0.4rem 0.5rem; border-radius: var(--radius); border: 1px solid var(--edge); background: var(--surface); color: var(--ink); text-align: left; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.16), 0 4px 10px rgba(0, 0, 0, 0.08); transition: transform 0.08s, box-shadow 0.08s; }
.skin-card:active { transform: translateY(1px) scale(0.99); box-shadow: 0 0 2px rgba(0, 0, 0, 0.25); }
.skin-card.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent), 0 4px 10px rgba(0, 0, 0, 0.1); }
.skin-card-view { position: relative; display: block; height: 5.2rem; border-radius: calc(var(--radius) * 0.7); border: 1px solid var(--line); background-color: var(--bg); overflow: hidden; }
.skin-mini { position: absolute; left: 0.5rem; right: 0.5rem; top: 0.5rem; bottom: 0.5rem; display: flex; flex-direction: column; gap: 0.25rem; align-items: flex-start; padding: 0.35rem 0.45rem; border-radius: calc(var(--radius) * 0.6); background: var(--surface); border: 1px solid var(--line); }
.skin-mini-title { font-size: 0.72rem; font-weight: 700; color: var(--ink); line-height: 1.2; }
.skin-mini-line { width: 70%; height: 0.3rem; border-radius: 0.2rem; background: var(--muted); opacity: 0.55; }
.skin-mini-btn { margin-top: auto; font-size: 0.68rem; font-weight: 700; line-height: 1.2; padding: 0.15rem 0.6rem; border-radius: calc(var(--radius) * 0.8); background: var(--accent); color: var(--accent-ink); }
.skin-card-name { font-weight: 700; padding: 0 0.2rem; }
.skin-state { font-size: 0.85rem; font-weight: 700; color: var(--muted); padding: 0 0.2rem; }
.skin-state.on { color: var(--accent); }
.skin-card.on .skin-state, .skin-card.on .skin-card-name { color: var(--ink); }
/* 「このまま使うには」 */
.skin-keep { display: flex; flex-direction: column; gap: 0.6rem; padding: 0.9rem; border-radius: var(--radius); border: 1px solid var(--accent); background: var(--surface); box-shadow: 0 0 0 1px var(--accent), 0 3px 10px rgba(0, 0, 0, 0.1); }
.skin-keep p { margin: 0; }
.skin-keep-title { font-weight: 800; font-size: 1.05rem; color: var(--ink); }
.skin-keep-h { font-weight: 800; color: var(--accent); }
.skin-way { display: flex; flex-direction: column; gap: 0.5rem; padding: 0.8rem; border-radius: var(--radius); background: var(--surface-2); }
.skin-keep .btn.text { align-self: center; min-height: 2.75rem; }
/* 演出（飾り）。画面の上に重ねるが、押せない・読み上げない */
.skin-fx { position: fixed; inset: 0; z-index: 900; pointer-events: none; overflow: hidden; display: none; }
/* 光は、ボタンの上のふちだけを流れる（文字にはかからない。文字の下を通す）。画素の実測は、光がまん中にある時で測る */
.btn.shine { position: relative; overflow: hidden; isolation: isolate; }
@media (prefers-reduced-motion: no-preference) {
  /* カードが順に、ぽんと出る */
  .skin-cards > li { animation: skin-pop 0.28s ease-out both; animation-delay: calc(var(--i, 0) * 45ms); }
  /* 使用中のカード：ふちがゆっくり光る */
  .skin-card.on { animation: skin-pulse 2.2s ease-in-out infinite; }
  /* 見本の中の演出 */
  .skin-card-view[data-effect='twinkle']::after { content: ''; position: absolute; inset: 0; background-image: radial-gradient(circle at 18% 22%, var(--accent) 0 1.5px, transparent 2px), radial-gradient(circle at 82% 30%, var(--accent) 0 1.5px, transparent 2px), radial-gradient(circle at 70% 84%, var(--accent) 0 1.5px, transparent 2px), radial-gradient(circle at 8% 78%, var(--accent) 0 1.5px, transparent 2px); animation: skin-twinkle 1.6s ease-in-out infinite; }
  .skin-card-view[data-effect='drift'] { animation: skin-drift 6s linear infinite; }
  .skin-card-view[data-effect='glow'] { animation: skin-glow 2.4s ease-in-out infinite; }
  /* 切り替えの帯 */
  .skin-fx { display: block; }
  .skin-fx.wipe::before { content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 45%; background: linear-gradient(100deg, transparent, var(--fx) 45%, var(--fx) 55%, transparent); opacity: 0.35; transform: translateX(-120%); animation: skin-wipe 0.5s ease-out forwards; }
  /* 開放・購入：光の粒がはじける */
  .skin-fx.spark > span { position: absolute; left: 50%; top: 45%; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--fx); opacity: 0; animation: skin-spark 0.9s ease-out forwards; animation-delay: calc(var(--i, 0) * 25ms); }
  .skin-fx.spark > span:nth-child(odd) { border-radius: 0.1rem; width: 0.45rem; height: 0.45rem; }
  /* 購入のボタン：光がときどき横切る */
  .btn.shine:not(:disabled)::after { content: ''; position: absolute; top: 0; height: 24%; left: 0; width: 35%; z-index: -1; border-radius: inherit; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.4), transparent); transform: translateX(-150%); animation: skin-shine 3.2s ease-in-out infinite; pointer-events: none; }
  .skin-keep { animation: skin-rise 0.25s ease-out both; }
}
@keyframes skin-pop { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes skin-pulse { 50% { box-shadow: 0 0 0 2px var(--accent), 0 0 0 5px var(--accent-soft), 0 4px 10px rgba(0, 0, 0, 0.1); } }
@keyframes skin-twinkle { 0%, 100% { opacity: 0.15; } 50% { opacity: 0.9; } }
@keyframes skin-drift { to { background-position: 40px 0; } }
@keyframes skin-glow { 50% { box-shadow: inset 0 0 0 3px var(--accent-soft), inset 0 0 14px var(--accent-soft); } }
@keyframes skin-wipe { to { transform: translateX(340%); } }
@keyframes skin-spark { 0% { transform: translate(-50%, -50%) scale(0.4); opacity: 1; } 100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(200deg) scale(1); opacity: 0; } }
@keyframes skin-shine { 0%, 60% { transform: translateX(-150%); } 100% { transform: translateX(420%); } }
@keyframes skin-rise { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
/* 角の丸み */
[data-shape='round'] { --radius: 1rem; }
[data-shape='soft'] { --radius: 0.6rem; }
[data-shape='square'] { --radius: 0.2rem; }
[data-shape='soft'] .btn, [data-shape='soft'] .chip, [data-shape='soft'] .input { border-radius: 0.55rem; }
[data-shape='square'] .btn, [data-shape='square'] .chip, [data-shape='square'] .input, [data-shape='square'] .seg, [data-shape='square'] .seg button { border-radius: 0.2rem; }
/* 背景の模様（色は --pattern。文字とのコントラストは、模様の色に対しても確かめてある） */
html[data-pattern='dots'] body, .skin-card-view[data-pattern='dots'] { background-image: radial-gradient(var(--pattern) 2px, transparent 2.5px); background-size: 18px 18px; }
html[data-pattern='grid'] body, .skin-card-view[data-pattern='grid'] { background-image: linear-gradient(var(--pattern) 1.5px, transparent 1.5px), linear-gradient(90deg, var(--pattern) 1.5px, transparent 1.5px); background-size: 22px 22px; }
html[data-pattern='stripe'] body, .skin-card-view[data-pattern='stripe'] { background-image: repeating-linear-gradient(135deg, var(--pattern) 0 6px, transparent 6px 20px); }
/* バナー広告を上に置く設定（adNetwork.bannerPosition: top）。見出しのボタンと、下の内容のボタンの両方から離す */
.ad-banner.top { margin: 2.4rem 0 2.6rem; padding: 0 0 0.9rem; border-top: none; border-bottom: 1px solid var(--line); }
/* >>> themes (ここから下は、テーマの意匠と演出) */
/* ==========================================================================
   テーマ（有料の着せ替え 10種）。html[data-group='theme'] と html[data-skin='id'] で当てる。
   2026-11-27c：オーナーのデザイン案（各テーマ1枚）に合わせて作りなおした（設計書 19章）。
   約束：
   - 見出しの絵・地の素材・枠・ボタンの質感は、案から切り出した画像（public/skin/<id>/*.webp。scripts/skin-assets.py が作る）。
     案の中のダミー文字・偽の UI は写していない（文字は、アプリが本物を描く）。外の文字・外の画像は読みこまない。
     カジノ・スロットは見た目だけ（賭け・抽選・お金や景品の仕組みは、どこにもない）。
   - 画像を指す記述は html[data-skin='id'] の中だけ。使っている（または試着している）テーマの画像だけが読みこまれる。
     選ぶ画面の見本（.skin-card-view）は、色と CSS だけで描く（ほかのテーマの画像を読みこまない）。
   - 文字がのる画像は、地の色からの動きを 10% までに抑えてある（暗幕・明幕を画像に焼きこみ）。その上に CSS で重ねる光と陰は 3% まで
     （合わせて src/core/skins.ts の TEX_SHIFT = 13%。文字の色は、その分動いた地に対しても足りるように選んである）。
     見出しの絵（--art）・枠・飾りの部品の上には、文字を置かない。
   - 性能：絵と素材は、動かない層（.app の地・帯・カードの地）に置く。backdrop-filter・background-attachment: fixed・
     SVG フィルタは使わない。動かすのは transform / opacity だけ。ずっと動きつづける演出は、テーマには置かない。
   - 動く演出は、すべて @media (prefers-reduced-motion: no-preference) の中（「動きを減らす」設定の端末では、1つも動かない）。
   ========================================================================== */
html {
  /* 自作のテクスチャ（scripts/textures.py）。標準・シンプルの地と、絵のないテーマの地に敷く、紙の粒 */
  --t-grain: url(tex/grain.webp);
  --gloss: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0, rgba(255, 255, 255, 0.02) 46%, rgba(0, 0, 0, 0.02) 54%, rgba(0, 0, 0, 0.1) 100%);
}

/* ---- 標準・シンプル（無料）：紙の地の、ごくひかえめな粒（地を動かす量は 4% まで。カード・文字の色は、そのまま）---- */
.app { position: relative; isolation: isolate; }
.app::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: var(--lay, var(--t-grain) 0 0 / 160px 160px); opacity: var(--lay-o, 0.45); -webkit-mask: var(--lay-mask, none); mask: var(--lay-mask, none); }

/* ---- 共通の骨組み（テーマごとの値は、下の --pat / --art / --head-tex / --card-* / --btn-* / --h-* で決める）---- */
html[data-group='theme'] { --lay: none; --lay-o: 1; --app-w: min(100vw, var(--app-max, 36rem)); --art-h: calc(var(--app-w) * var(--art-r, 0)); --art-pt: var(--art-h); }
html[data-group='theme'] .app { background: var(--pat); }
/* 選ぶ画面の見本は、使用中のテーマの画像を受けつがない（色と CSS だけ） */
.skin-card-view { --pat: none; --card-img: none; --card-frame: none; --head-tex: none; --btn-img: var(--gloss); --btn-frame: none; --art: none; }
.skin-card-view[data-group='theme'] { background: var(--pat), var(--bg); }
html[data-group='theme'] .sheet { background-image: var(--sheet-img, none); background-size: var(--tile-size, auto); }
/* 見出しの帯：上（カジノは下）に案の絵、その下に題名の行（素材の地） */
html[data-group='theme'] :is(.screen-head, .top) { position: relative; isolation: isolate; background-color: var(--head); background-image: var(--head-tex, none); background-size: var(--head-tex-size, auto); color: var(--head-ink); border-bottom-color: transparent; box-shadow: var(--head-shadow, none); }
html[data-group='theme'] :is(.screen-head, .top)::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: calc(var(--safe-t) + var(--art-h)); z-index: -1; pointer-events: none; background: var(--art, none) center bottom / cover no-repeat; }
html[data-group='theme'] :is(.screen-head, .top) :is(h1, h1.brand, .screen-sub, .icon-btn) { color: var(--head-ink); }
html[data-group='theme'] :is(.screen-head, .top) .icon-btn:active:not(:disabled) { background: transparent; outline: 2px solid var(--head-ink); outline-offset: -2px; }
html[data-group='theme'] :is(.screen-head, .top)::after { content: ''; position: absolute; left: var(--strip-x, 0); right: var(--strip-x, 0); bottom: var(--strip-b, 0); height: var(--strip-h, 1px); background: var(--strip, linear-gradient(rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.12))); pointer-events: none; }
html[data-group='theme'] :is(.screen-head, .top) h1 { font-family: var(--h-font); letter-spacing: var(--h-space, 0.02em); font-style: var(--h-style, normal); font-weight: var(--h-weight, 700); text-shadow: var(--h-shadow, none); }
html[data-group='theme'] :is(h2, h3, .card-title, .empty-title, .skin-keep-title) { font-family: var(--h-font); letter-spacing: var(--h-space, 0.02em); font-style: var(--h-style, normal); }
/* 主ボタン・丸い追加ボタン・カード・タブ・小さな部品 */
html[data-group='theme'] :is(.btn.primary, .fab) { background-color: var(--fill); background-image: var(--btn-img, var(--gloss)); background-size: var(--btn-img-size, auto); border-color: var(--btn-edge, var(--fill)); border-image: var(--btn-frame, none); color: var(--fill-ink); box-shadow: var(--btn-shadow, none); }
html[data-group='theme'] :is(.btn.primary, .fab):active:not(:disabled) { transform: var(--press, translateY(1px)); box-shadow: var(--btn-shadow-on, none); filter: none; }
html[data-group='theme'] :is(.fab.fab, .tabs .fab) { background-color: var(--fab-color, var(--fill)); background-image: var(--fab-img, var(--btn-img, var(--gloss))); background-size: var(--fab-size, var(--btn-img-size, auto)); background-position: center; background-repeat: var(--fab-rep, repeat); border-image: var(--fab-frame, none); border-radius: var(--fab-r, 18px); box-shadow: var(--fab-shadow, var(--btn-shadow, none)); }
html[data-group='theme'] :is(.card:not(.hint, .hero, .today-card), .empty) { background-image: var(--card-img, none); background-size: var(--card-img-size, auto); background-repeat: var(--card-img-rep, repeat); border: var(--card-border, 1px solid var(--line)); border-image: var(--card-frame, none); box-shadow: var(--card-shadow, none); }
html[data-group='theme'] .tabs { background-image: var(--tab-img, none); background-size: var(--tile-size, auto); border-top: var(--tab-line, 1px solid var(--line)); box-shadow: var(--tab-shadow, 0 -1px 4px rgba(0, 0, 0, 0.1)); }
html[data-group='theme'] :is(.chip:not(.on), .seg, .input) { box-shadow: var(--ctl-shadow, inset 0 1px 2px rgba(0, 0, 0, 0.08)); }
html[data-group='theme'] { --edge-hi: rgba(255, 255, 255, 0.5); }
html[data-group='theme'][data-theme='dark'] { --edge-hi: rgba(255, 255, 255, 0.08); }
/* 空のときの箱も、札と同じ素材で */
html[data-group='theme'] .empty { background-color: var(--surface); }
html[data-group='theme'] :is(.card.hint, .today-card, .hero) { box-shadow: var(--card-shadow2, 0 1px 2px rgba(0, 0, 0, 0.16), 0 3px 8px rgba(0, 0, 0, 0.07)); }
/* 選ぶ画面の見本：帯・カード・ボタンを、そのテーマの色と形で（画像は使わない） */
.skin-card-view[data-group='theme'] .skin-mini { padding: 0; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22); }
.skin-card-view[data-group='theme'] .skin-mini-title { align-self: stretch; padding: 3px 7px 5px; background-color: var(--head); background-image: var(--mini-head, none); color: var(--head-ink); font-family: var(--h-font); letter-spacing: var(--h-space, 0.02em); font-style: var(--h-style, normal); border-bottom: 2px solid var(--mini-edge, var(--deco)); }
.skin-card-view[data-group='theme'] :is(.skin-mini-line, .skin-mini-nums) { margin-left: 7px; }
.skin-card-view[data-group='theme'] .skin-mini-btn { margin: auto 0 5px 7px; background-color: var(--fill); background-image: var(--gloss); color: var(--fill-ink); border-radius: var(--mini-r, 6px); box-shadow: inset 0 0 0 1px var(--mini-btn-edge, transparent), 0 1px 2px rgba(0, 0, 0, 0.25); }
/* 角の形（テーマ用） */
[data-shape='pill'] { --radius: 20px; }
[data-shape='pill'] :is(.btn, .chip, .input, .seg, .seg button, input, select) { border-radius: 999px; }
[data-shape='puffy'] { --radius: 22px; }
[data-shape='puffy'] :is(.btn, .chip, .seg, .seg button) { border-radius: 999px; }
/* 開放したときの言葉（「開放！」）。演出の層の中だけに出る飾り */
.skin-fx-word, .skin-fx-reels { display: none; }

/* ---- 1. レトロゲーム（案 retro_a）：ブラウン管の絵・走査線の帯・筐体のクリーム色・角が段になった札とボタン ---- */
html[data-skin='retro'] {
  --art: url(skin/retro/art.webp); --art-r: 0.39;
  --tile: url(skin/retro/bg.webp); --tile-size: 128px 128px;
  --pat: var(--tile) 0 0 / 128px 128px; --sheet-img: var(--tile); --tab-img: var(--tile);
  --lay: repeating-conic-gradient(rgba(60, 50, 30, 0.045) 0 25%, transparent 0 50%) 0 0 / 8px 8px; --lay-mask: linear-gradient(180deg, #000 0, #000 30%, transparent 46%, transparent 80%, #000 96%);
  --head-tex: url(skin/retro/head.webp); --head-tex-size: 100% 100%;
  --px: linear-gradient(var(--bg), var(--bg));
  --card-border: 0; --card-shadow: 0 3px 0 -1px rgba(70, 60, 40, 0.1), 0 4px 9px rgba(70, 60, 40, 0.16);
  --btn-edge: transparent; --btn-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.13), inset 0 -4px 0 rgba(0, 0, 0, 0.13); --btn-shadow-on: inset 0 3px 0 rgba(0, 0, 0, 0.13);
  --btn2-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.35), inset 0 -3px 0 rgba(0, 0, 0, 0.1);
  --fab-r: 3px; --tab-line: 2px dashed color-mix(in srgb, var(--muted) 45%, transparent); --tab-shadow: none;
}
html[data-skin='retro'][data-theme='dark'] { --tile: url(skin/retro/bg-d.webp); --lay: repeating-conic-gradient(rgba(255, 255, 255, 0.03) 0 25%, transparent 0 50%) 0 0 / 8px 8px; --card-shadow: 0 4px 9px rgba(0, 0, 0, 0.4); }
html[data-skin='retro'], .skin-card-view[data-view='retro'] { --h-font: ui-monospace, 'SF Mono', Menlo, Consolas, 'MS Gothic', 'Osaka-Mono', monospace; --h-space: 0.08em; --mini-edge: #17201e; --mini-r: 2px; }
html[data-skin='retro'] :is(.btn, .chip, .input, .card, .empty) { border-radius: 0; }
/* 角を、段に欠く（地の色の小さな四角を、四すみに置く） */
html[data-skin='retro'] :is(.card:not(.hint, .hero, .today-card), .empty, .btn:not(.text, :disabled)) { background-image: var(--px), var(--px), var(--px), var(--px), var(--px), var(--px), var(--px), var(--px); background-size: 6px 3px, 3px 6px, 6px 3px, 3px 6px, 6px 3px, 3px 6px, 6px 3px, 3px 6px; background-position: 0 0, 0 0, 100% 0, 100% 0, 0 100%, 0 100%, 100% 100%, 100% 100%; background-repeat: no-repeat; background-origin: border-box; border-color: transparent; }
html[data-skin='retro'] :is(.screen-head, .top) h1 { text-shadow: 0 0 6px color-mix(in srgb, var(--head-ink) 45%, transparent); }

/* ---- 2. 和風（案 wafu_a）：和紙・墨の筆跡と金箔の絵・重ねた和紙の札・朱の紙のボタン・筆でかこんだボタン ---- */
html[data-skin='wafu'] {
  --art: url(skin/wafu/art.webp); --art-r: 0.337;
  --tile: url(skin/wafu/bg.webp); --tile-size: 192px 192px;
  --pat: var(--tile) 0 0 / 192px 192px; --sheet-img: var(--tile); --tab-img: var(--tile);
  --head-tex: var(--tile); --head-tex-size: 192px 192px; --strip: none;
  --veil: rgba(255, 255, 255, 0.4);
  --card-img: linear-gradient(var(--veil), var(--veil)), var(--tile); --card-img-size: auto, 192px 192px; --card-border: 0;
  --card-shadow: 0 1px 1px rgba(70, 50, 25, 0.22), 0 5px 0 -2px color-mix(in srgb, var(--surface) 90%, #6b5a40), 0 6px 2px -2px rgba(70, 50, 25, 0.28), 0 10px 16px rgba(70, 50, 25, 0.12);
  --btn-img: url(skin/wafu/btn.webp); --btn-img-size: 64px 64px; --btn-edge: transparent; --btn-shadow: 0 1px 1px rgba(70, 30, 20, 0.45), 0 3px 7px rgba(70, 30, 20, 0.22); --btn-shadow-on: 0 1px 1px rgba(70, 30, 20, 0.45);
  --btn2-frame: url(skin/wafu/ink.webp) 36 / 13px / 2px stretch; --btn2-bg: transparent; --btn2-shadow: none;
  --fab-r: 16px; --tab-shadow: 0 -1px 5px rgba(70, 50, 25, 0.14);
}
html[data-skin='wafu'][data-theme='dark'] { --tile: url(skin/wafu/bg-d.webp); --tile-size: 128px 128px; --pat: var(--tile) 0 0 / 128px 128px; --head-tex-size: 128px 128px; --card-img-size: auto, 128px 128px; --veil: rgba(255, 255, 255, 0.045); --btn2-frame: url(skin/wafu/ink-d.webp) 36 / 13px / 2px stretch; --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.6), 0 5px 0 -2px #151412, 0 9px 14px rgba(0, 0, 0, 0.3); }
/* 暗い色のとき：見出しの絵は、あかりを落とした和紙として見せる */
html[data-skin='wafu'][data-theme='dark'] :is(.screen-head, .top)::before { opacity: 0.6; }
html[data-skin='wafu'], .skin-card-view[data-view='wafu'] { --h-font: 'Hiragino Mincho ProN', 'Yu Mincho', YuMincho, 'Noto Serif JP', 'Noto Serif CJK JP', 'MS PMincho', serif; --h-space: 0.08em; --mini-edge: #1d1b19; }
html[data-skin='wafu'] .btn { border-radius: 14px 16px 13px 17px / 16px 13px 17px 14px; }
html[data-skin='wafu'] :is(.card, .empty) { border-radius: 9px 11px 8px 10px; }
html[data-skin='wafu'] :is(.card-title, .card > h2, .card > h3) { border-left: 3px solid var(--deco); padding-left: 0.55em; }

/* ---- 3. サイバー（案 cyber_b）：ネオン管の枠の帯・雨の夜の街のぼけ・ガラスの札・ネオンのふちのボタン ---- */
html[data-skin='cyber'] {
  --pat: url(skin/cyber/bg.webp) center / cover no-repeat; --art-pt: 26px; --head-px: 36px; --head-pb: 34px;
  --neon: url(skin/cyber/neon.webp); --strip: none;
  --card-img: linear-gradient(160deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0) 55%); --card-border: 1px solid color-mix(in srgb, var(--deco) 38%, var(--line));
  --card-shadow: 0 4px 14px rgba(20, 30, 60, 0.14);
  --btn-img: none; --btn-edge: var(--deco); --btn-shadow: 0 0 0 1px color-mix(in srgb, var(--deco) 35%, transparent), 0 0 9px color-mix(in srgb, var(--deco) 55%, transparent), inset 0 0 7px color-mix(in srgb, var(--deco) 28%, transparent); --btn-shadow-on: 0 0 4px color-mix(in srgb, var(--deco) 55%, transparent);
  --btn2-edge: var(--deco-2); --btn2-shadow: 0 0 7px color-mix(in srgb, var(--deco-2) 40%, transparent);
  --tab-line: 1px solid color-mix(in srgb, var(--deco) 35%, var(--line)); --tab-shadow: none;
}
html[data-skin='cyber'][data-theme='dark'] { --pat: url(skin/cyber/bg-d.webp) center / cover no-repeat; --card-shadow: 0 6px 18px rgba(0, 0, 0, 0.45); }
html[data-skin='cyber'], .skin-card-view[data-view='cyber'] { --h-font: ui-sans-serif, system-ui, 'Helvetica Neue', Arial, 'Hiragino Sans', 'Noto Sans JP', sans-serif; --h-space: 0.16em; --h-weight: 600; --mini-edge: var(--deco-2); --mini-btn-edge: var(--deco); --mini-r: 999px; }
html[data-skin='cyber'] :is(.screen-head, .top)::before { inset: calc(var(--safe-t) + 4px) 4px 4px; height: auto; background: none; border: 30px solid transparent; border-image: var(--neon) 75 / 30px stretch; }
html[data-skin='cyber'] :is(.screen-head, .top) h1 { text-shadow: 0 0 8px color-mix(in srgb, var(--head-ink) 45%, transparent); }
html[data-skin='cyber'] .btn { border-radius: 999px; }
html[data-skin='cyber'] :is(.card, .empty) { border-radius: 14px; }

/* ---- 4. ドリーミー（案 dreamy_b）：虹色のガラスの絵・あわい光の地・ガラスのふちの札・ガラス玉のボタン ---- */
html[data-skin='dreamy'] {
  --art: url(skin/dreamy/art.webp); --art-r: 0.3;
  --pat: url(skin/dreamy/bg.webp) center / cover no-repeat; --strip: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0));
  --head-tex: linear-gradient(100deg, color-mix(in srgb, var(--deco) 9%, transparent), rgba(255, 255, 255, 0.1) 45%, color-mix(in srgb, var(--deco-2) 10%, transparent));
  --card-img: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0) 60%); --card-border: 1px solid transparent; --card-frame: url(skin/dreamy/rim.webp) 30 / 17px stretch;
  --card-shadow: 0 6px 18px rgba(120, 100, 170, 0.14);
  --btn-img: radial-gradient(ellipse 80% 60% at 30% 0, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0) 70%), linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(120, 90, 180, 0.1)); --btn-edge: rgba(255, 255, 255, 0.7);
  --btn-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), inset 0 -2px 4px rgba(120, 90, 180, 0.25), 0 3px 9px rgba(120, 100, 170, 0.28); --btn-shadow-on: inset 0 2px 5px rgba(120, 90, 180, 0.35);
  --btn2-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 2px 6px rgba(120, 100, 170, 0.18);
  --fab-r: 22px; --tab-shadow: 0 -2px 10px rgba(120, 100, 170, 0.12);
}
html[data-skin='dreamy'][data-theme='dark'] { --pat: url(skin/dreamy/bg-d.webp) center / cover no-repeat; --card-shadow: 0 6px 18px rgba(0, 0, 0, 0.4); --strip: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0)); }
html[data-skin='dreamy'][data-theme='dark'] :is(.screen-head, .top)::before { opacity: 0.72; }
html[data-skin='dreamy'], .skin-card-view[data-view='dreamy'] { --h-font: 'Hiragino Maru Gothic ProN', 'Tsukushi A Round Gothic', 'Arial Rounded MT Bold', 'Yu Gothic', sans-serif; --h-space: 0.03em; --h-weight: 600; --mini-edge: #fff; --mini-r: 999px; --mini-head: linear-gradient(100deg, #f6d6ea, #e3dcf8 45%, #cdeee6); }
html[data-skin='dreamy'] :is(.card, .empty) { border-radius: 20px; }

/* ---- 5. Y2K（案 y2k_b）：クロームのかたまりの絵・空の映りこむ地・クロームの枠の札・ゲルのボタン ---- */
html[data-skin='ytwok'] {
  --art: url(skin/ytwok/art.webp); --art-r: 0.36;
  --pat: url(skin/ytwok/bg.webp) center / cover no-repeat; --strip: none;
  --card-border: 1px solid transparent; --card-frame: url(skin/ytwok/frame.webp) 52 / 25px / 2px stretch;
  --card-shadow: 0 5px 14px rgba(60, 80, 110, 0.2);
  --btn-img: radial-gradient(ellipse 70% 55% at 32% 8%, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0) 70%), linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(0, 20, 60, 0.1)); --btn-edge: transparent;
  --btn-frame: url(skin/ytwok/gel.webp) 48 / 17px stretch; --btn-shadow: 0 3px 8px rgba(40, 60, 110, 0.3); --btn-shadow-on: 0 1px 3px rgba(40, 60, 110, 0.3);
  --btn2-shadow: inset 0 1px 0 #fff, inset 0 -2px 3px rgba(60, 80, 110, 0.18), 0 0 0 1px rgba(90, 100, 120, 0.5), 0 2px 5px rgba(60, 80, 110, 0.2);
  --fab-r: 22px; --tab-shadow: 0 -2px 8px rgba(60, 80, 110, 0.14);
}
html[data-skin='ytwok'][data-theme='dark'] { --pat: url(skin/ytwok/bg-d.webp) center / cover no-repeat; --card-shadow: 0 5px 14px rgba(0, 0, 0, 0.45); --btn2-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0 0 1px rgba(150, 160, 180, 0.4), 0 2px 5px rgba(0, 0, 0, 0.4); }
html[data-skin='ytwok'][data-theme='dark'] :is(.screen-head, .top)::before { opacity: 0.8; }
html[data-skin='ytwok'], .skin-card-view[data-view='ytwok'] { --h-font: 'Helvetica Neue', Helvetica, Arial, 'Hiragino Sans', 'Yu Gothic', sans-serif; --h-space: 0.01em; --h-weight: 500; --mini-edge: #9aa3b2; --mini-r: 999px; --mini-head: linear-gradient(180deg, #f4f7fb, #b9c2cf 55%, #e8edf4); }
html[data-skin='ytwok'] :is(.card:not(.hint, .hero, .today-card), .empty) { border-radius: 22px; padding: 20px 21px; }

/* ---- 6. ニュースペーパー（案 news_a）：古紙の地・活版の罫線（かすれ）・罫線で区切る紙面・インクの枠のボタン（特定の作品の意匠は使わない）---- */
html[data-skin='news'] {
  --tile: url(skin/news/bg.webp); --tile-size: 192px 192px; --art-r: 0; --art-pt: 18px; --head-pb: 26px;
  --pat: var(--tile) 0 0 / 192px 192px; --sheet-img: var(--tile); --tab-img: var(--tile);
  --rule: url(skin/news/rule.webp); --box: url(skin/news/box.webp);
  --head-tex: var(--rule), var(--tile); --head-tex-size: calc(100% - 20px) 14px, 192px 192px;
  --strip: var(--rule) center / 100% 100% no-repeat; --strip-h: 14px; --strip-x: 10px; --strip-b: 3px;
  --card-img: none; --card-border: 0; --card-shadow: none;
  --btn-img: none; --btn-edge: transparent; --btn-frame: var(--box) 26 / 11px / 1px stretch; --btn-shadow: none;
  --btn2-shadow: none; --tab-line: 3px double var(--ink); --tab-shadow: none; --ctl-shadow: none; --well-shadow: none; --card-shadow2: none;
}
html[data-skin='news'][data-theme='dark'] { --tile: url(skin/news/bg-d.webp); --tile-size: 128px 128px; --pat: var(--tile) 0 0 / 128px 128px; --head-tex-size: calc(100% - 20px) 14px, 128px 128px; --rule: url(skin/news/rule-d.webp); --box: url(skin/news/box-d.webp); }
html[data-skin='news'], .skin-card-view[data-view='news'] { --h-font: 'American Typewriter', 'Courier New', Courier, 'Hiragino Mincho ProN', 'Yu Mincho', 'Noto Serif JP', serif; --h-space: 0.1em; --mini-edge: var(--ink); --mini-btn-edge: var(--ink); --mini-r: 4px; }
html[data-skin='news'] :is(.screen-head, .top) { background-repeat: no-repeat, repeat; background-position: center calc(var(--safe-t) + 5px), 0 0; }
html[data-skin='news'] :is(.card:not(.hint, .hero, .today-card), .empty) { background-color: transparent; border-radius: 0; border-top: 3px double var(--ink); border-bottom: 3px double var(--ink); }
html[data-skin='news'] :is(.btn, .chip, .input) { border-radius: 9px; }

/* ---- 7. キャンディポップ（案 candy_c）：飴の写真の帯・うすい桃色の地・白い札・飴玉のボタン ---- */
html[data-skin='candy'] {
  --art: url(skin/candy/art.webp); --art-r: 0.36;
  --pat: var(--t-grain) 0 0 / 160px 160px; --strip: none;
  --card-border: 0; --card-shadow: 0 1px 2px rgba(190, 120, 140, 0.1), 0 6px 16px rgba(190, 120, 140, 0.12);
  --btn-img: radial-gradient(ellipse 60% 50% at 30% 6%, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0) 70%), linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(90, 0, 30, 0.1)); --btn-edge: transparent;
  --btn-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.7), inset 0 -3px 5px rgba(190, 70, 110, 0.3), 0 4px 10px rgba(200, 80, 120, 0.28); --btn-shadow-on: inset 0 2px 5px rgba(190, 70, 110, 0.4);
  --btn2-shadow: 0 1px 2px rgba(190, 120, 140, 0.14), 0 4px 10px rgba(190, 120, 140, 0.12);
  --fab-img: url(skin/candy/ball.webp); --fab-size: cover; --fab-rep: no-repeat; --fab-color: transparent; --fab-r: 50%; --fab-shadow: 0 7px 9px -3px rgba(170, 80, 110, 0.45);
  --tab-line: 0; --tab-shadow: 0 -4px 14px rgba(190, 120, 140, 0.12);
}
html[data-skin='candy'][data-theme='dark'] { --card-shadow: 0 6px 16px rgba(0, 0, 0, 0.35); --btn2-shadow: 0 2px 6px rgba(0, 0, 0, 0.35); --fab-shadow: 0 7px 9px -3px rgba(0, 0, 0, 0.6); }
html[data-skin='candy'][data-theme='dark'] :is(.screen-head, .top)::before { opacity: 0.82; }
html[data-skin='candy'], .skin-card-view[data-view='candy'] { --h-font: 'Hiragino Maru Gothic ProN', 'Arial Rounded MT Bold', 'Yu Gothic', 'Noto Sans JP', sans-serif; --h-space: 0.04em; --h-weight: 700; --mini-edge: #f6c6d2; --mini-r: 999px; }

/* ---- 8. ポスト（案 post_b）：封筒の束と封ろうの絵・エアメールのふち・クラフト紙の地・封筒のふたの札・封ろうの丸いボタン ---- */
html[data-skin='post'] {
  --art-r: 0.36; --head-px: 24px;
  --tile: url(skin/post/bg.webp); --tile-size: 128px 128px;
  --pat: var(--tile) 0 0 / 128px 128px; --sheet-img: var(--tile); --tab-img: var(--tile);
  --amail: url(skin/post/edge.webp);
  --head-tex: url(skin/post/art.webp), var(--amail), var(--amail), linear-gradient(rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.14)), var(--tile);
  --head-tex-size: auto calc(var(--art-h) - 6px), 13px auto, 13px auto, auto, 128px 128px;
  --strip: url(skin/post/edge-b.webp) 0 0 / auto 100% repeat-x; --strip-h: 9px;
  --flap: url(skin/post/flap.webp);
  --card-img: var(--flap); --card-img-size: 100% 34px; --card-img-rep: no-repeat; --card-border: 0;
  --card-shadow: inset 0 0 0 1px rgba(120, 85, 50, 0.16), 0 2px 2px rgba(80, 50, 20, 0.3), 0 6px 12px rgba(80, 50, 20, 0.2);
  --btn-img: var(--tile); --btn-img-size: 128px 128px; --btn-edge: transparent;
  --btn-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 -2px 2px rgba(80, 50, 20, 0.3), 0 1px 2px rgba(80, 50, 20, 0.45), 0 3px 7px rgba(80, 50, 20, 0.25); --btn-shadow-on: inset 0 2px 4px rgba(80, 50, 20, 0.4);
  --btn2-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 1px 2px rgba(80, 50, 20, 0.35);
  --fab-img: url(skin/post/seal.webp); --fab-size: 112% 112%; --fab-rep: no-repeat; --fab-color: transparent; --fab-r: 50%; --fab-shadow: 0 6px 8px -3px rgba(60, 20, 10, 0.55);
  --tab-shadow: 0 -2px 8px rgba(80, 50, 20, 0.2);
}
html[data-skin='post'][data-theme='dark'] { --tile: url(skin/post/bg-d.webp); --flap: none; --btn-img: var(--gloss); --btn-img-size: auto; --card-shadow: inset 0 0 0 1px rgba(255, 220, 170, 0.07), 0 6px 12px rgba(0, 0, 0, 0.4); }
html[data-skin='post'], .skin-card-view[data-view='post'] { --h-font: 'Courier New', Courier, 'Hiragino Mincho ProN', 'Yu Mincho', 'Noto Serif JP', serif; --h-space: 0.03em; --mini-edge: #2f3f63; --mini-r: 6px; }
html[data-skin='post'] :is(.screen-head, .top) { background-repeat: no-repeat, repeat-y, repeat-y, repeat, repeat; background-position: center calc(var(--safe-t) + 4px), 0 0, 100% 0, 0 0, 0 0; }
html[data-skin='post'] :is(.screen-head, .top)::before { display: none; }
html[data-skin='post'] :is(.card:not(.hint, .hero, .today-card), .empty) { border-radius: 3px; padding-top: calc(1rem + 24px); }
html[data-skin='post'][data-theme='dark'] :is(.card:not(.hint, .hero, .today-card), .empty) { padding-top: 1rem; }
html[data-skin='post'] .btn { border-radius: 10px; }

/* ---- 9. カジノ（案 casino_c）：緑のフェルトの帯・金の線の木のレール・生成りの紙の地・細い金の線でかこんだ札・フェルトと金のふちのボタン（見た目だけ。賭けの仕組みはない）---- */
html[data-skin='casino'] {
  --art: url(skin/casino/art.webp); --art-r: 0.06; --art-pt: 0px;
  --tile: url(skin/casino/bg.webp); --tile-size: 128px 128px;
  --pat: var(--tile) 0 0 / 128px 128px; --strip: none;
  --felt: url(skin/casino/felt.webp);
  --head-tex: linear-gradient(180deg, rgba(0, 0, 0, 0.14), rgba(0, 0, 0, 0) 45%), var(--felt); --head-tex-size: auto, 128px 128px;
  --card-img: var(--t-grain); --card-img-size: 160px 160px; --card-border: 1px solid transparent; --card-frame: url(skin/casino/frame.webp) 35 / 18px stretch;
  --card-shadow: 0 1px 2px rgba(70, 52, 24, 0.2), 0 6px 14px rgba(70, 52, 24, 0.14);
  --btn-img: var(--felt); --btn-img-size: 128px 128px; --btn-edge: transparent; --btn-frame: url(skin/casino/gold.webp) 20 / 13px / 2px stretch;
  --btn-shadow: 0 2px 3px rgba(0, 0, 0, 0.4), 0 5px 10px rgba(0, 0, 0, 0.22); --btn-shadow-on: 0 1px 2px rgba(0, 0, 0, 0.4);
  --btn2-shadow: 0 1px 2px rgba(70, 52, 24, 0.25); --fab-frame: none; --fab-r: 50%; --fab-shadow: 0 0 0 2px #c9a24a, 0 0 0 3px #6b4d10, 0 5px 10px rgba(0, 0, 0, 0.4);
  --tab-img: var(--t-grain); --tab-shadow: 0 -2px 8px rgba(70, 52, 24, 0.22);
}
html[data-skin='casino'][data-theme='dark'] { --tile: url(skin/casino/bg-d.webp); --card-shadow: 0 0 0 1px rgba(201, 162, 74, 0.2), 0 8px 12px rgba(0, 0, 0, 0.5); }
html[data-skin='casino'], .skin-card-view[data-view='casino'] { --h-font: Georgia, 'Times New Roman', 'Hiragino Mincho ProN', 'Yu Mincho', 'Noto Serif JP', serif; --h-space: 0.12em; --h-weight: 500; --mini-edge: #6b3a1f; --mini-btn-edge: #c9a24a; --mini-r: 8px; }
html[data-skin='casino'] :is(.screen-head, .top) { border-bottom: var(--art-h) solid transparent; background-clip: padding-box; }
html[data-skin='casino'] :is(.screen-head, .top)::before { top: auto; bottom: calc(-1 * var(--art-h) - var(--art-h) * 0.2); height: calc(var(--art-h) * 1.2); background-position: center top; background-size: 100% 100%; }
html[data-skin='casino'] :is(.card, .empty) { border-radius: 12px; }
html[data-skin='casino'] .btn.primary { border-radius: 14px; }

/* ---- 10. スロット（案 slot_a）：電球の列の絵・みがいた金属の帯・金の筐体の地・金属のふちの札・電球でかこんだボタン（見た目だけ。抽選の仕組みはない）---- */
html[data-skin='slot'] {
  --art: url(skin/slot/art.webp); --art-r: 0.165;
  --tile: url(skin/slot/bg.webp); --tile-size: 128px 128px;
  --pat: var(--tile) 0 0 / 128px 128px; --sheet-img: var(--tile); --tab-img: var(--tile);
  --head-tex: linear-gradient(90deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0) 5%, rgba(0, 0, 0, 0) 95%, rgba(0, 0, 0, 0.1)), url(skin/slot/head.webp); --head-tex-size: 100% 100%;
  --strip: linear-gradient(180deg, #6b6660, #f4f2ee 45%, #8d8780); --strip-h: 3px;
  --veil: rgba(255, 255, 255, 0.3);
  --card-img: linear-gradient(var(--veil), var(--veil)), var(--tile); --card-img-size: auto, 128px 128px; --card-border: 1px solid transparent; --card-frame: url(skin/slot/frame.webp) 36 / 14px stretch;
  --card-shadow: 0 0 9px 1px rgba(255, 214, 140, 0.55), 0 5px 12px rgba(70, 45, 5, 0.3);
  --btn-img: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(0, 0, 0, 0.02) 50%, rgba(0, 0, 0, 0.1)); --btn-edge: transparent; --btn-frame: url(skin/slot/ring.webp) 47 54 / 24px 27px / 5px round stretch;
  --btn-shadow: 0 0 12px 5px rgba(255, 190, 90, 0.35); --btn-shadow-on: 0 0 8px 4px rgba(255, 190, 90, 0.5);
  --btn2-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), inset 0 -2px 2px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(60, 55, 50, 0.55), 0 2px 5px rgba(70, 45, 5, 0.3);
  --fab-frame: none; --fab-r: 50%; --fab-shadow: 0 0 0 2px #f4f2ee, 0 0 0 3px #6b6660, 0 0 12px 4px rgba(255, 190, 90, 0.5);
  --tab-shadow: 0 -3px 10px rgba(70, 45, 5, 0.25);
}
html[data-skin='slot'][data-theme='dark'] { --tile: url(skin/slot/bg-d.webp); --veil: rgba(255, 255, 255, 0.045); --card-shadow: 0 0 9px 1px rgba(255, 190, 90, 0.3), 0 5px 12px rgba(0, 0, 0, 0.5); }
html[data-skin='slot'], .skin-card-view[data-view='slot'] { --h-font: 'Avenir Next', Avenir, 'Helvetica Neue', Arial, 'Hiragino Sans', 'Yu Gothic', sans-serif; --h-space: 0.18em; --h-weight: 600; --mini-edge: #ffb84a; --mini-r: 999px; --mini-head: linear-gradient(180deg, #f1efec, #b9b5b0 60%, #dcd9d5); }
html[data-skin='slot'] :is(.card, .empty) { border-radius: 16px; }
html[data-skin='slot'] .btn.primary { border-radius: 999px; }

/* ---- 演出（押した時／切り替え＝試着のとき／開放・購入のとき）。案の素材に合わせた、短く・ひかえめな動きだけ。色は、演出の層に渡した --fx* ---- */
@media (prefers-reduced-motion: no-preference) {
  /* 試着：どのテーマも、帯の色のうすい幕が、ひと呼吸で引く（下で、素材ごとに形だけ変える） */
  .skin-fx[data-fx]:not([data-fx='plain']).wipe::before { left: 0; width: 100%; transform: none; background: var(--fxbg); opacity: 0; animation: fx-veil 0.5s ease-out forwards; }
  /* 開放：粒は飛ばさない。その素材の小さな札に「開放！」が出て、消える */
  .skin-fx[data-fx]:not([data-fx='plain']).spark > span { display: none; }
  .skin-fx.spark .skin-fx-word { display: block; position: absolute; left: 50%; top: 45%; padding: 0.35em 1em; font-size: 26px; font-weight: 800; line-height: 1.2; white-space: nowrap; background: var(--fxbg); color: var(--fxink); border: 1px solid color-mix(in srgb, var(--fxink) 45%, transparent); border-radius: 10px; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28); opacity: 0; transform: translate(-50%, -50%); animation: fx-word 1.5s cubic-bezier(0.2, 1, 0.4, 1) forwards; }
  /* 1. レトロゲーム：ブラウン管の電源（絵が横1本の光る線につぶれて消える） */
  .skin-fx[data-fx='retro'].wipe::before { animation: fx-crt 0.55s cubic-bezier(0.3, 0, 0.2, 1) forwards; }
  .skin-fx[data-fx='retro'] .skin-fx-word { border-radius: 2px; font-family: ui-monospace, Menlo, Consolas, 'MS Gothic', monospace; letter-spacing: 0.1em; }
  /* 2. 和風：墨が、紙ににじんで広がる／開放は、印を押す（少し沈んで戻る） */
  .skin-fx[data-fx='wafu'].wipe::before { left: 50%; top: 40%; bottom: auto; width: 80vmax; height: 80vmax; margin: -40vmax 0 0 -40vmax; border-radius: 50%; background: radial-gradient(circle, #1d1b19 0 30%, rgba(29, 27, 25, 0.5) 48%, transparent 66%); transform: scale(0.06); animation: fx-bleed 0.8s cubic-bezier(0.1, 0.6, 0.2, 1) forwards; }
  .skin-fx[data-fx='wafu'] .skin-fx-word { border: 3px solid var(--fx2); color: var(--fx2); background: transparent; box-shadow: none; border-radius: 6px; font-family: 'Hiragino Mincho ProN', 'Yu Mincho', serif; letter-spacing: 0.2em; animation-name: fx-stamp; }
  /* 3. サイバー：ネオン管が、ちらついてから灯る（明滅は2回まで） */
  .skin-fx[data-fx='cyber'].wipe::before { background: radial-gradient(ellipse 90% 50% at 50% 20%, color-mix(in srgb, var(--fx2) 40%, transparent), transparent 72%); animation: fx-ignite 0.7s linear forwards; }
  .skin-fx[data-fx='cyber'] .skin-fx-word { border: 1.5px solid var(--fx2); border-radius: 999px; letter-spacing: 0.16em; box-shadow: 0 0 10px color-mix(in srgb, var(--fx2) 60%, transparent), inset 0 0 8px color-mix(in srgb, var(--fx2) 30%, transparent); animation-name: fx-neon-on; animation-timing-function: linear; }
  html[data-skin='cyber'] :is(.btn.primary, .fab):active:not(:disabled) { animation: fx-flick 0.2s linear 1; }
  /* 4. ドリーミー：やわらかい光が、ひろがって消える */
  .skin-fx[data-fx='dreamy'].wipe::before { background: radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.9), color-mix(in srgb, var(--fx2) 35%, transparent) 40%, transparent 75%); animation-duration: 0.8s; }
  .skin-fx[data-fx='dreamy'] .skin-fx-word { border: 1px solid rgba(255, 255, 255, 0.8); border-radius: 999px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 8px 22px rgba(120, 100, 170, 0.3); }
  /* 5. Y2K：クロームの映りこみが、斜めに1度だけ横切る */
  .skin-fx[data-fx='ytwok'].wipe::before { width: 55%; opacity: 0.85; background: linear-gradient(100deg, transparent 0, rgba(233, 241, 251, 0.5) 22%, #fff 45%, #aab4c4 52%, #fff 62%, transparent 92%); transform: translateX(-150%) skewX(-18deg); animation: fx-sheen 0.65s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
  .skin-fx[data-fx='ytwok'] .skin-fx-word { border: 1px solid #7b8494; border-radius: 999px; box-shadow: inset 0 1px 0 #fff, 0 0 0 3px #e2e8f0, 0 0 0 4px #7b8494, 0 8px 20px rgba(0, 0, 0, 0.3); }
  /* 6. ニュースペーパー：紙面が、左を軸にめくれる／開放は、刷られた札が置かれる */
  .skin-fx[data-fx='news'].wipe::before { opacity: 1; background: linear-gradient(90deg, rgba(0, 0, 0, 0) 70%, rgba(0, 0, 0, 0.16) 100%), var(--fxbg); box-shadow: 10px 0 26px rgba(0, 0, 0, 0.35); transform-origin: 0 50%; backface-visibility: hidden; animation: fx-turn 0.7s cubic-bezier(0.5, 0, 0.7, 1) forwards; }
  .skin-fx[data-fx='news'] .skin-fx-word { border-radius: 1px; border: 4px double var(--fxink); font-family: 'American Typewriter', 'Courier New', 'Hiragino Mincho ProN', serif; letter-spacing: 0.14em; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25); animation-name: fx-stamp; }
  /* 7. キャンディポップ：桃色の光が、ふわっと引く */
  .skin-fx[data-fx='candy'].wipe::before { background: radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.85), color-mix(in srgb, var(--fx3) 30%, transparent) 45%, transparent 78%); animation-duration: 0.7s; }
  .skin-fx[data-fx='candy'] .skin-fx-word { border: 0; border-radius: 999px; box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.6), inset 0 -3px 5px rgba(0, 0, 0, 0.18), 0 8px 18px rgba(200, 80, 120, 0.3); }
  /* 8. ポスト：封ろうが押される（少し沈んで戻る）。封ろうは、案の絵 */
  .skin-fx[data-fx='post'].wipe::before { left: 50%; top: 40%; bottom: auto; width: 150px; height: 150px; margin: -75px 0 0 -75px; background: url(skin/post/seal.webp) center / contain no-repeat; transform: scale(1.4); animation: fx-seal 0.8s cubic-bezier(0.3, 1.2, 0.5, 1) forwards; }
  .skin-fx[data-fx='post'] .skin-fx-word { border: 1px dashed color-mix(in srgb, var(--fxink) 50%, transparent); border-radius: 3px; font-family: 'Courier New', 'Hiragino Mincho ProN', serif; box-shadow: 0 2px 3px rgba(80, 50, 20, 0.35), 0 8px 16px rgba(80, 50, 20, 0.2); animation-name: fx-stamp; }
  /* 9. カジノ：札が1枚、置かれてめくれる（見た目だけ） */
  .skin-fx[data-fx='casino'].wipe::before { left: 50%; top: 42%; bottom: auto; width: 110px; height: 154px; margin: -77px 0 0 -55px; border-radius: 10px; background: #ece0d0; box-shadow: 0 2px 0 #d8c9b4, 0 4px 0 #ece0d0, 0 12px 20px rgba(0, 0, 0, 0.4); animation: fx-deal 0.8s cubic-bezier(0.2, 0.7, 0.3, 1) forwards; }
  .skin-fx[data-fx='casino'] .skin-fx-word { border: 2px solid #c9a24a; border-radius: 12px; font-family: Georgia, 'Hiragino Mincho ProN', serif; letter-spacing: 0.1em; box-shadow: 0 0 0 1px #6b4d10, 0 10px 22px rgba(0, 0, 0, 0.45); }
  /* 10. スロット：電球が、あたたまるように灯る（明滅しない。見た目だけ） */
  .skin-fx[data-fx='slot'].wipe::before { background: radial-gradient(ellipse 100% 45% at 50% 8%, rgba(255, 200, 110, 0.75), rgba(255, 190, 90, 0.2) 55%, transparent 80%); animation: fx-warm 0.9s ease-out forwards; }
  .skin-fx[data-fx='slot'] .skin-fx-word { border: 1px solid #6b6660; border-radius: 999px; letter-spacing: 0.16em; box-shadow: inset 0 1px 0 #fff, 0 0 0 3px #f4f2ee, 0 0 0 4px #6b6660, 0 0 22px 6px rgba(255, 190, 90, 0.45); }
}
@keyframes fx-veil { 0% { opacity: 0; } 25% { opacity: 0.55; } 100% { opacity: 0; } }
@keyframes fx-word { 0% { opacity: 0; transform: translate(-50%, -46%); } 16%, 78% { opacity: 1; transform: translate(-50%, -50%); } 100% { opacity: 0; transform: translate(-50%, -50%); } }
@keyframes fx-stamp { 0% { opacity: 0; transform: translate(-50%, -50%) scale(1.5) rotate(-6deg); } 18% { opacity: 1; transform: translate(-50%, -50%) scale(0.96) rotate(-4deg); } 27%, 80% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(-4deg); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1) rotate(-4deg); } }
@keyframes fx-neon-on { 0% { opacity: 0; transform: translate(-50%, -50%); } 9% { opacity: 1; } 15% { opacity: 0.3; } 24%, 80% { opacity: 1; transform: translate(-50%, -50%); } 100% { opacity: 0; transform: translate(-50%, -50%); } }
@keyframes fx-crt { 0% { opacity: 0; transform: scale(1, 1); } 12% { opacity: 0.9; transform: scale(1, 1); } 60% { opacity: 0.9; transform: scale(1, 0.006); } 100% { opacity: 0; transform: scale(0, 0.006); } }
@keyframes fx-bleed { 0% { opacity: 0.8; transform: scale(0.06); } 60% { opacity: 0.6; transform: scale(1.05); } 100% { opacity: 0; transform: scale(1.4); } }
@keyframes fx-ignite { 0% { opacity: 0; } 8% { opacity: 1; } 14% { opacity: 0.2; } 30% { opacity: 0.25; } 38%, 70% { opacity: 1; } 100% { opacity: 0; } }
@keyframes fx-sheen { to { transform: translateX(330%) skewX(-18deg); } }
@keyframes fx-turn { 0% { transform: perspective(1400px) rotateY(0deg); } 100% { transform: perspective(1400px) rotateY(-97deg); } }
@keyframes fx-seal { 0% { opacity: 0; transform: scale(1.4); } 28% { opacity: 1; transform: scale(0.95); } 38%, 75% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1); } }
@keyframes fx-deal { 0% { opacity: 0; transform: perspective(900px) translate(0, 50vh) rotate(-20deg) rotateY(180deg); } 20% { opacity: 1; } 65%, 82% { opacity: 1; transform: perspective(900px) rotate(-3deg) rotateY(0deg); } 100% { opacity: 0; transform: perspective(900px) rotate(-3deg) rotateY(0deg); } }
@keyframes fx-warm { 0% { opacity: 0; } 45% { opacity: 0.8; } 100% { opacity: 0; } }
@keyframes fx-flick { 0% { opacity: 1; } 40% { opacity: 0.65; } 100% { opacity: 1; } }
/* ---- テーマ：このアプリの画面に合わせた調整 ---- */
/* 見出しの帯を、画面の上の端・左右の端まで広げる。上に、案の絵の高さ（--art-pt）をあける */
html[data-group='theme'] { --app-max: 36rem; }
html[data-group='theme'] .main { padding-top: 0; }
html[data-group='theme'] .screen-head { margin: -0.8rem -1rem var(--head-mb, 0.6rem); padding: calc(var(--safe-t) + var(--art-pt) + var(--head-pt, 0.5rem)) var(--head-px, 1rem) var(--head-pb, 0.6rem); }
/* 副ボタン（白い地のボタン）：同じ素材の、うすい立体 */
html[data-group='theme'] :is(.btn.ghost, .btn.danger-ghost):not(:disabled) { background-color: var(--btn2-bg, var(--surface)); border-image: var(--btn2-frame, none); box-shadow: var(--btn2-shadow, inset 0 1px 0 var(--edge-hi), 0 1px 2px rgba(0, 0, 0, 0.18)); }
html[data-group='theme'] .btn.ghost:not(:disabled) { border-color: var(--btn2-edge, var(--edge)); }
html[data-group='theme'] :is(.btn.ghost, .btn.danger-ghost):active:not(:disabled) { box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.25); filter: none; }
html[data-group='theme'] .btn.primary:disabled { background: var(--surface-2); border: 1.5px dashed var(--edge); border-image: none; color: var(--muted); box-shadow: none; }
/* 選ぶ画面：まとまり（標準／シンプル／テーマ）の見出しと、カードの説明 */
.skin-group { display: flex; flex-direction: column; gap: 0.45rem; }
.skin-group + .skin-group { margin-top: 0.6rem; padding-top: 0.8rem; border-top: 1px solid var(--line); }
.skin-group-h { margin: 0; font-weight: 800; font-size: 1.05rem; color: var(--ink); }
.skin-group .field-hint { margin: 0; }
.skin-card-note { font-size: 0.8rem; line-height: 1.35; color: var(--muted); padding: 0 0.2rem; }
html[data-group='theme'] .screen-head h1 { font-size: 1.22rem; }
/* <<< themes */

/* >>> headboard：見出しの帯の「きょうの要点」（2つのアプリで同じ内容。元は /home/claude/shared/headboard.css）
   - 標準・シンプル：題名の下に、数だけを1行で。
   - テーマ：上の絵の中（ブラウン管・墨の筆あと・虹色のガラス・クローム）か、題名の行の中（ネオンの看板・号外の見出し・フェルトの上の札・リールの窓）に、その素材の仕掛けとして出す。
   - 文字は、いつも下に地を敷く（絵の上にじかに置かない）か、色を確かめてある組（帯の地と帯の文字）だけを使う。
   - 動きは、出てくるときの1回だけ・transform と opacity だけ。「動きを減らす」設定の端末では、動かさずに数だけを出す。 */
:is(.screen-head, .top) { flex-wrap: wrap; }
:is(.screen-head, .top) > :first-child { flex: 1 1 0; min-width: 0; }
.hb { flex: 1 0 100%; min-width: 0; display: flex; gap: 6px; margin-top: 6px; }
.hb-cell { flex: 1 1 0; min-width: 0; min-height: 44px; display: flex; align-items: baseline; justify-content: center; gap: 5px; padding: 6px 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; line-height: 1.2; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.hb-cell:active { transform: translateY(1px); }
.hb-cell:focus-visible, .hb-headline:focus-visible { outline: 2px solid var(--hb-focus, var(--accent)); outline-offset: 2px; }
.hb-label { font-size: 12px; font-weight: 600; color: var(--hb-sub, var(--muted)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.hb-val { display: inline-flex; align-items: baseline; gap: 2px; white-space: nowrap; }
.hb-num { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--hb-ink, var(--ink)); display: inline-flex; }
.hb-unit { font-size: 11px; color: var(--hb-sub, var(--muted)); }
.hb-d i { display: block; font-style: normal; }
.hb-headline { display: none; }
/* 額・日数（きんけつうちょう）は、見出しを上・数を下に重ねる（見出しが切れないように） */
.hb-cell:is([data-k='amount'], [data-k='days']) { flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 4px 6px; }
html[data-skin='news'] .hb-cell:is([data-k='amount'], [data-k='days']) { align-items: flex-start; }
html:not([data-group='theme']) .hb-cell[data-tone='alert'] .hb-num { color: var(--neg); }
html:not([data-group='theme']) .hb-cell[aria-current='page'] { border-color: var(--edge, var(--muted)); }

/* ---- テーマ：共通 ---- */
html[data-group='theme'] .hb-cell { background: var(--hb-bg, var(--surface)); border: var(--hb-border, 1px solid var(--line)); border-radius: var(--hb-r, 12px); box-shadow: var(--hb-shadow, 0 1px 2px rgba(0, 0, 0, 0.18)); color: var(--hb-ink, var(--ink)); font-family: var(--hb-font, inherit); }
/* 上の絵の中に置くテーマ：絵の高さ（--art-h）に合わせて、位置を決める */
html:is([data-skin='retro'], [data-skin='wafu'], [data-skin='dreamy'], [data-skin='ytwok']) .hb { position: absolute; margin: 0; left: var(--hb-x, 8%); right: var(--hb-x2, var(--hb-x, 8%)); top: calc(var(--safe-t) + var(--art-h) * var(--hb-top, 0.2)); height: calc(var(--art-h) * var(--hb-h, 0.6)); align-items: stretch; }
html:is([data-skin='retro'], [data-skin='wafu'], [data-skin='cyber'], [data-skin='dreamy'], [data-skin='ytwok'], [data-skin='casino']) .hb-cell { flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 2px 4px; min-height: 44px; }

/* 1. レトロゲーム：ブラウン管の中に、緑の文字で出す */
html[data-skin='retro'] { --hb-x: 9%; --hb-top: 0.17; --hb-h: 0.6; --hb-bg: transparent; --hb-border: 0; --hb-r: 6px; --hb-shadow: none; --hb-ink: #c2f8cc; --hb-sub: #a5e6b6; --hb-font: 'Courier New', 'Osaka-Mono', 'MS Gothic', monospace; --hb-focus: #c2f8cc; }
html[data-skin='retro'] .hb-num { font-size: 22px; letter-spacing: 0.06em; text-shadow: 0 0 6px rgba(140, 255, 170, 0.55); }
html[data-skin='retro'] .hb-label { letter-spacing: 0.04em; }
/* 文字の下に、ふちをぼかした暗い面を敷く（ブラウン管の映りこみの上でも読めるように。四角く見えないように、ふちは影でぼかす） */
html[data-skin='retro'] .hb { background: rgba(3, 22, 20, 0.78); border-radius: 10px; box-shadow: 0 0 10px 6px rgba(3, 22, 20, 0.78); }
html[data-skin='retro'] .hb-cell + .hb-cell { border-left: 1px dashed rgba(194, 248, 204, 0.3); border-radius: 0; }

/* 2. 和風：墨の筆あとの上に、白抜きの文字。急ぐものがなければ、朱の印 */
html[data-skin='wafu'] { --hb-x: 13%; --hb-x2: 24%; --hb-top: 0.24; --hb-h: 0.46; --hb-bg: transparent; --hb-border: 0; --hb-r: 0; --hb-shadow: none; --hb-ink: #f6eedd; --hb-sub: #e2d8c4; --hb-font: 'Hiragino Mincho ProN', 'Yu Mincho', 'Noto Serif JP', serif; --hb-focus: #f6eedd; }
html[data-skin='wafu'] .hb { gap: 0; background: rgba(24, 22, 20, 0.9); border-radius: 8px; box-shadow: 0 0 9px 6px rgba(24, 22, 20, 0.9); }
html[data-skin='wafu'] .hb-cell + .hb-cell { border-left: 1px solid rgba(246, 238, 221, 0.28); }
html[data-skin='wafu'] .hb-num { font-size: 21px; font-weight: 600; }
html[data-skin='wafu'] .hb[data-seal]::after { content: attr(data-seal); position: absolute; right: -19%; top: 50%; width: 34px; height: 34px; margin-top: -17px; display: grid; place-items: center; background: #a73f2c; color: #fff6ea; border-radius: 4px; font: 600 18px/1 'Hiragino Mincho ProN', 'Yu Mincho', 'Noto Serif JP', serif; transform: rotate(-5deg); box-shadow: inset 0 0 0 2px #a73f2c, inset 0 0 0 3px rgba(255, 246, 234, 0.55); }

/* 3. サイバー：ネオンの看板に、数が灯る（題名の行の中） */
html[data-skin='cyber'] { --hb-bg: transparent; --hb-border: 1px solid color-mix(in srgb, var(--head-ink) 45%, transparent); --hb-r: 8px; --hb-shadow: none; --hb-ink: var(--head-ink); --hb-sub: var(--head-ink); --hb-focus: var(--head-ink); }
html[data-skin='cyber'][data-theme='dark'] .hb-num { text-shadow: 0 0 8px color-mix(in srgb, var(--deco) 80%, transparent), 0 0 2px color-mix(in srgb, var(--deco) 80%, transparent); }
html[data-skin='cyber'] .hb-num { font-size: 20px; letter-spacing: 0.04em; }

/* 4. ドリーミー：虹色の光の上に、ガラスの玉 */
html[data-skin='dreamy'] { --hb-x: 5%; --hb-top: 0.26; --hb-h: 0.46; --hb-bg: rgba(255, 255, 255, 0.8); --hb-border: 1px solid rgba(255, 255, 255, 0.95); --hb-r: 999px; --hb-shadow: inset 0 1px 0 #fff, inset 0 -6px 10px rgba(190, 170, 240, 0.16), 0 4px 12px rgba(110, 90, 170, 0.2); }
html[data-skin='dreamy'][data-theme='dark'] { --hb-bg: rgba(26, 22, 42, 0.88); --hb-border: 1px solid rgba(255, 255, 255, 0.3); --hb-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 4px 12px rgba(20, 10, 50, 0.4); }

/* 5. Y2K：クロームにはめた、液晶の窓 */
html[data-skin='ytwok'] { --hb-x: 17%; --hb-top: 0.25; --hb-h: 0.5; --hb-bg: transparent; --hb-border: 0; --hb-r: 0; --hb-shadow: none; --hb-ink: #172219; --hb-sub: #2c3b30; --hb-font: 'Courier New', 'Osaka-Mono', 'MS Gothic', monospace; --hb-focus: #172219; }
html[data-skin='ytwok'] .hb { gap: 0; padding: 0 4px; background: #b7c6b0; border-radius: 12px; box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.45), inset 0 -1px 0 rgba(255, 255, 255, 0.5), 0 0 0 3px #e8edf1, 0 0 0 4px #77818c, 0 3px 8px rgba(20, 30, 50, 0.45); }
html[data-skin='ytwok'] .hb-cell + .hb-cell { border-left: 1px solid rgba(23, 34, 25, 0.25); }
html[data-skin='ytwok'] .hb-num { font-size: 22px; letter-spacing: 0.05em; }

/* 6. ニュースペーパー：号外の見出し（いちばん急ぐ1件）と、その下の小見出し */
html[data-skin='news'] { --hb-bg: transparent; --hb-border: 0; --hb-r: 0; --hb-shadow: none; --hb-ink: var(--head-ink); --hb-sub: var(--head-ink); --hb-focus: var(--head-ink); }
html[data-skin='news'] .hb { flex-wrap: wrap; gap: 0; margin-top: 8px; border-top: 1px solid var(--head-ink); }
html[data-skin='news'] .hb-headline { display: block; flex: 1 0 100%; min-height: 44px; padding: 7px 0 5px; border: 0; background: none; color: var(--head-ink); text-align: left; font: 800 19px/1.3 Georgia, 'Hiragino Mincho ProN', 'Yu Mincho', 'Noto Serif JP', serif; letter-spacing: 0.01em; cursor: pointer; }
html[data-skin='news'] .hb-cell { border-top: 1px solid color-mix(in srgb, var(--head-ink) 50%, transparent); justify-content: flex-start; padding-left: 8px; }
html[data-skin='news'] .hb-cell:first-of-type { padding-left: 0; }
html[data-skin='news'] .hb-cell + .hb-cell { border-left: 1px solid color-mix(in srgb, var(--head-ink) 50%, transparent); }
html[data-skin='news'] .hb-num { font-family: Georgia, 'Times New Roman', serif; }

/* 9. カジノ：フェルトの上に置いた札 */
html[data-skin='casino'] { --hb-r: 7px; --hb-border: 0; --hb-shadow: 0 1px 0 rgba(0, 0, 0, 0.35), 0 4px 8px rgba(0, 0, 0, 0.35); --hb-font: Georgia, 'Times New Roman', 'Hiragino Mincho ProN', 'Yu Mincho', 'Noto Serif JP', serif; --hb-focus: #e6c88f; }
html[data-skin='casino'] .hb { gap: 8px; margin-top: 8px; perspective: 600px; }
html[data-skin='casino'] .hb-cell { min-height: 52px; outline: 1px solid rgba(184, 146, 74, 0.55); outline-offset: -4px; }
html[data-skin='casino'] .hb-cell:focus-visible { outline: 2px solid #e6c88f; outline-offset: 2px; }
html[data-skin='casino'] .hb-num { font-size: 20px; font-weight: 600; }

/* 10. スロット：みがいた金属の板に、リールの窓（数字が止まるだけ。そろっても、何も起きない） */
html[data-skin='slot'] { --hb-bg: transparent; --hb-border: 0; --hb-r: 0; --hb-shadow: none; --hb-ink: #231c12; --hb-sub: var(--head-ink); --hb-focus: var(--head-ink); }
html[data-skin='slot'] .hb-cell { align-items: center; gap: 6px; padding: 4px 2px; }
html[data-skin='slot'] .hb-num { gap: 2px; }
html[data-skin='slot'] .hb-num.hb-plain { color: var(--head-ink); }
html[data-skin='slot'] .hb-d { width: 20px; height: 30px; display: grid; place-items: center; overflow: hidden; background: linear-gradient(180deg, #cfc8b8, #fffdf6 28%, #fffdf6 72%, #cfc8b8); border-radius: 4px; box-shadow: inset 0 0 0 1px #6b6660, inset 0 3px 3px rgba(0, 0, 0, 0.25), inset 0 -3px 3px rgba(0, 0, 0, 0.2); font: 700 19px/1 'Helvetica Neue', Arial, sans-serif; color: #231c12; }

@media (prefers-reduced-motion: no-preference) {
  html[data-skin='retro'] .hb { animation: hb-crt 0.5s cubic-bezier(0.2, 0.8, 0.3, 1) both; }
  html[data-skin='wafu'] .hb-cell { animation: hb-rise 0.5s ease-out both; animation-delay: calc(var(--i, 0) * 0.09s); }
  html[data-skin='wafu'] .hb[data-seal]::after { animation: hb-stamp 0.35s cubic-bezier(0.3, 1.6, 0.5, 1) 0.45s both; }
  html[data-skin='cyber'] .hb-cell { animation: hb-flicker 0.7s linear both; animation-delay: calc(var(--i, 0) * 0.08s); }
  html[data-skin='dreamy'] .hb-cell { animation: hb-pop 0.55s cubic-bezier(0.3, 1.3, 0.5, 1) both; animation-delay: calc(var(--i, 0) * 0.08s); }
  html[data-skin='ytwok'] .hb-val { animation: hb-lcd 0.5s steps(1) both; }
  html[data-skin='news'] .hb-headline { animation: hb-rise 0.4s ease-out both; }
  html[data-skin='casino'] .hb-cell { animation: hb-flip 0.5s cubic-bezier(0.2, 0.7, 0.3, 1) both; animation-delay: calc(var(--i, 0) * 0.1s); backface-visibility: hidden; }
  html[data-skin='slot'] .hb-d i { animation: hb-reel 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; animation-delay: calc(var(--i, 0) * 0.16s + var(--j, 0) * 0.06s); }
  @keyframes hb-crt { 0% { transform: scale(1, 0.03); opacity: 0.9; } 55% { transform: scale(1, 0.03); opacity: 1; } 100% { transform: none; opacity: 1; } }
  @keyframes hb-rise { from { transform: translateY(5px); opacity: 0; } to { transform: none; opacity: 1; } }
  @keyframes hb-stamp { from { transform: rotate(-5deg) scale(1.5); opacity: 0; } to { transform: rotate(-5deg); opacity: 1; } }
  @keyframes hb-flicker { 0% { opacity: 0; } 12% { opacity: 1; } 22% { opacity: 0.2; } 34% { opacity: 1; } 46% { opacity: 0.4; } 60%, 100% { opacity: 1; } }
  @keyframes hb-pop { from { transform: scale(0.86); opacity: 0; } to { transform: none; opacity: 1; } }
  @keyframes hb-lcd { 0% { opacity: 0; } 30% { opacity: 1; } 45% { opacity: 0.25; } 60%, 100% { opacity: 1; } }
  @keyframes hb-flip { from { transform: rotateY(88deg); opacity: 0.4; } to { transform: none; opacity: 1; } }
  @keyframes hb-reel { 0% { transform: translateY(-260%); } 100% { transform: none; } }
}
/* <<< headboard */

/* >>> headfit：見出しの帯を低くし、スクロールでたたむ（2つのアプリで同じ内容。元は /home/claude/shared/headfit.css）
   - 帯（絵＋題名＋きょうの要点）の高さを、画面の高さの 20% まで・最大 140px におさえる（--band-max）。
     絵の高さ（--art-h）は「帯の上限 − 絵のほかの高さ（--band-rest）」で決まり、絵は切り抜き位置（--art-y）で、主役（電球の列・墨の筆あとなど）が窓に入るようにする。
   - スクロールすると、帯をたたんで題名の行だけにする（src/app/headFold.ts が、帯に data-fold と、たたむ量 --fold-y・題名を下げる量 --fold-t を付ける）。
     動かすのは transform と opacity だけ。「動きを減らす」設定の端末では、動かさずに切り替える。テーマのときだけ（標準・シンプルの帯は、もとから低い）。 */
html[data-group='theme'] { --band-max: min(140px, 20vh); --band-rest: 96px; --art-min: 18px; --head-pt: 2px; --head-pb: 6px; }
html:is([data-skin='retro'], [data-skin='wafu'], [data-skin='dreamy'], [data-skin='ytwok'], [data-skin='candy'], [data-skin='post'], [data-skin='slot'])[data-group='theme'] {
  --art-h: clamp(var(--art-min), calc(var(--band-max) - var(--band-rest)), calc(var(--app-w) * var(--art-r, 0)));
}
/* 絵の中に要点を置くテーマ：絵のほかは、題名の行だけ */
html:is([data-skin='retro'], [data-skin='wafu'], [data-skin='dreamy'], [data-skin='ytwok'])[data-group='theme'] { --band-rest: 46px; }
html[data-group='theme'] :is(.screen-head, header.top)::before { background-position: center var(--art-y, 50%); background-size: var(--art-size, cover); background-repeat: var(--art-rep, no-repeat); }
html[data-skin='casino'] { --art-size: 100% 100%; }
/* 題名の行と要点の行を、つめる */
html[data-group='theme'] :is(.screen-head, header.top) { min-height: 0; row-gap: 0; }
html[data-group='theme'] :is(.screen-head, header.top) .hb { margin-top: 2px; }
html[data-group='theme'] :is(.screen-head, header.top) > :is(.icon-btn, .top-actions) { margin-block: -4px; }
html[data-group='theme'] .screen-head > div:first-child:has(> .screen-sub) { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 0.6em; }
html[data-group='theme'] .screen-head .screen-sub { margin: 0; font-size: 0.8rem; line-height: 1.25; }
/* 題名は1行におさめる（字間の広いテーマでも、折り返して帯が高くならないように） */
html[data-group='theme'] :is(.screen-head, header.top) h1 { font-size: 1.12rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
html[data-group='theme'] header.top h1 { font-size: 19px; }
/* 題名の下に日付がある画面（あるもノートの「きょう」）：その分だけ、絵を低くする */
html:is([data-skin='retro'], [data-skin='wafu'], [data-skin='dreamy'], [data-skin='ytwok'], [data-skin='candy'], [data-skin='post'], [data-skin='slot'])[data-group='theme'] .screen-head:has(.screen-sub) {
  --band-rest: 104px; --art-h: clamp(var(--art-min), calc(var(--band-max) - var(--band-rest)), calc(var(--app-w) * var(--art-r, 0))); --art-pt: var(--art-h);
}
html:is([data-skin='retro'], [data-skin='wafu'], [data-skin='dreamy'], [data-skin='ytwok'])[data-group='theme'] .screen-head:has(.screen-sub) { --band-rest: 66px; }
html[data-group='theme'] .screen-head .icon-btn.labeled { min-height: 2.6rem; }
/* 絵の中の要点：絵の窓の、たての中ほどに 46px で置く */
html:is([data-skin='retro'], [data-skin='wafu'], [data-skin='dreamy'], [data-skin='ytwok'])[data-group='theme'] .hb { --hb-px: 46px; top: calc(var(--safe-t) + (var(--art-h) - var(--hb-px)) / 2); height: var(--hb-px); }
/* Y2K：液晶の窓は、内側の影が文字にかからないように、少し高く */
html[data-skin='ytwok'][data-group='theme'] .hb { --hb-px: 54px; }

/* テーマごとの、絵の切り抜き位置と、つめ方 */
html[data-skin='candy'] { --art-y: 58%; }
/* ポスト：封筒の束と封ろうは、題名の行の中ほどまで下ろし、大きめに見せる（題名・ボタンとは重ならない所） */
html[data-skin='post'] { --head-tex-size: auto calc(var(--art-h) + 30px), 13px auto, 13px auto, auto, 128px 128px; }
html[data-skin='post'] :is(.screen-head, header.top) { background-position: var(--post-x, 50%) calc(var(--safe-t) + 3px), 0 0, 100% 0, 0 0, 0 0; }
/* 題名の長い画面（あるもノートの「きょう」・きんけつうちょうのホーム）では、絵は題名の行に下ろさない（題名に重ねない） */
html[data-skin='post'] :is(.screen-head:has(.screen-sub), header.top:has(> h1.brand)) { background-size: auto calc(var(--art-h) - 4px), 13px auto, 13px auto, auto, 128px 128px; }
/* スロット：電球の列は、電球1つ分のこま（bulbs.webp。案の絵から切った）を横にくり返す。帯が低くても、電球が切れずに、丸ごと小さく並ぶ */
html[data-skin='slot'] { --art: url(skin/slot/bulbs.webp); --art-size: auto 100%; --art-rep: repeat-x; }
/* きんけつうちょう：リールの窓を少し低く（額の見出しの下に、日数のリールが並ぶため） */
html[data-skin='slot'] header.top .hb-d { width: 18px; height: 25px; font-size: 17px; }
html[data-skin='slot'] header.top .hb-cell { padding-block: 1px; }
/* サイバー：ネオン管の枠を細くして、内側をつめる */
html[data-skin='cyber'] { --art-pt: 12px; --head-pb: 18px; --head-px: 26px; }
html[data-skin='cyber'] :is(.screen-head, header.top)::before { inset: calc(var(--safe-t) + 3px) 3px 3px; border-width: 20px; border-image-width: 20px; }
/* ニュースペーパー：罫線を細く、すきまをつめる。高さ 900px 未満の画面では、号外の見出しと小見出しの片方だけにする
   （あるもノートは号外の見出し＝いちばん急ぐ1件／きんけつうちょうは小見出し＝今日使っていい額と日数。見出しの中身は、小見出しの日数と同じ） */
html[data-skin='news'] { --art-pt: 8px; --head-pb: 10px; --strip-h: 7px; --strip-b: 2px; --head-tex-size: calc(100% - 20px) 7px, 192px 192px; }
html[data-skin='news'][data-theme='dark'] { --head-tex-size: calc(100% - 20px) 7px, 128px 128px; }
html[data-skin='news'] :is(.screen-head, header.top) { background-position: center calc(var(--safe-t) + 2px), 0 0; }
html[data-skin='news'] :is(.screen-head, header.top) > :is(.icon-btn, .top-actions) { margin-block: -7px; }
html[data-skin='news'] .hb { margin-top: 0; }
html[data-skin='news'] .hb-headline { padding: 3px 0 2px; font-size: 17px; }
html[data-skin='news'] .hb-cell { padding-block: 2px; }
@media (max-height: 899px) {
  html[data-skin='news'] .screen-head .hb-cell, html[data-skin='news'] header.top .hb-headline { display: none; }
  html[data-skin='news'] header.top .hb-cell { border-top: 0; }
}
/* カジノ：札の高さは、そのまま（札の金の線が、見出しの文字にかからないように） */
html[data-skin='casino'] .hb { margin-top: 4px; }

/* ---- スクロールで、帯をたたむ ---- */
html[data-group='theme'] .screen-head { position: sticky; top: 0; z-index: 4; }
html[data-group='theme'] .app > header.top { position: absolute; top: 0; left: 0; right: 0; }
html[data-group='theme'] .app > main { padding-top: var(--top-h, 0px); }
html[data-group='theme'] :is(.screen-head, header.top)[data-fold='1'] { transform: translateY(calc(-1 * var(--fold-y, 0px))); }
html[data-group='theme'] :is(.screen-head, header.top)[data-fold='1'] > :not(.hb) { transform: translateY(var(--fold-t, 0px)); }
html[data-group='theme'] :is(.screen-head, header.top)[data-fold='1'] :is(.hb, .screen-sub) { opacity: 0; visibility: hidden; }
/* 上の絵は消す（カジノの木のレールは、たたんだ帯のふちとして残す） */
html[data-group='theme']:not([data-skin='casino']) :is(.screen-head, header.top)[data-fold='1']::before { opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  html[data-group='theme'] :is(.screen-head, header.top), html[data-group='theme'] :is(.screen-head, header.top) > :not(.hb) { transition: transform 0.24s cubic-bezier(0.3, 0.7, 0.3, 1); }
  html[data-group='theme'] :is(.screen-head, header.top) :is(.hb, .screen-sub) { transition: opacity 0.18s ease-out, visibility 0s linear 0s; }
  html[data-group='theme'] :is(.screen-head, header.top)[data-fold='1'] :is(.hb, .screen-sub) { transition: opacity 0.14s ease-in, visibility 0s linear 0.14s; }
  html[data-group='theme'] :is(.screen-head, header.top)::before { transition: opacity 0.2s ease-out; }
}
/* <<< headfit */

/* ---------- 新しい版のお知らせ（src/app/swUpdate.ts）。画面の下、タブの上に重ねる。押すまで消えない ---------- */
.sw-update { position: fixed; z-index: 90; left: 12px; right: 12px; bottom: calc(env(safe-area-inset-bottom, 0px) + 84px); max-width: 520px; margin: 0 auto; padding: 12px 14px; border-radius: 14px; background: #2b2722; color: #fff; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); font-size: 15px; line-height: 1.5; }
[data-theme='dark'] .sw-update { background: #ece9e2; color: #1c1a17; }
.sw-update-text { margin: 0 0 8px; font-weight: 600; }
.sw-update-row { display: flex; justify-content: flex-end; gap: 8px; }
.sw-update-btn { min-height: 44px; min-width: 44px; padding: 0 14px; border-radius: 10px; border: 1.5px solid currentColor; background: none; color: inherit; font: inherit; font-weight: 700; cursor: pointer; }
.sw-update-btn.primary { background: #fff; color: #2b2722; border-color: #fff; }
[data-theme='dark'] .sw-update-btn.primary { background: #1c1a17; color: #ece9e2; border-color: #1c1a17; }
