:root {
  --bg: #f6f5f0;
  --surface: #ffffff;
  --surface-2: #eeede6;
  --text: #1f2421;
  --muted: #5b625d;
  --line: #d6d4ca;
  --accent: #2f6b4f;
  --accent-ink: #ffffff;
  --done-bg: #e6f0e9;
  --done-line: #8fb59f;
  --warn: #8a4b08;
  --warn-bg: #fbf0dd;
  --focus: #1f5fbf;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161917;
    --surface: #1f2420;
    --surface-2: #272d29;
    --text: #e8ebe7;
    --muted: #a3aba5;
    --line: #3a423c;
    --accent: #6fbf95;
    --accent-ink: #0f1a14;
    --done-bg: #1f3328;
    --done-line: #4f8a69;
    --warn: #f0b46a;
    --warn-bg: #3a2c17;
    --focus: #8ab4ff;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 8px; top: 8px; background: var(--surface); padding: 8px; z-index: 10; }

.top { background: var(--surface); border-bottom: 1px solid var(--line); padding: 8px 12px; }
.top h1 { font-size: 16px; margin: 0 0 6px; }
.top h1 small { font-size: 12px; color: var(--muted); font-weight: normal; }
.progress { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
@media (min-width: 640px) { .progress { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.stat { background: var(--surface-2); border-radius: 8px; padding: 2px 6px; font-size: 11px; color: var(--muted); line-height: 1.4; }
.stat b { display: block; font-size: 15px; color: var(--text); font-variant-numeric: tabular-nums; }
.stat.complete b::after { content: " 完了"; font-size: 11px; color: var(--accent); }
.bar { display: block; height: 4px; background: var(--line); border-radius: 2px; margin-top: 2px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); }

.tabs { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); }
.tabs [role=tablist] { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px 8px; }
.tabs button {
  flex: 1 1 auto; min-height: 40px; padding: 4px 8px; font: inherit; font-size: 13px;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 8px; cursor: pointer;
}
.tabs button[aria-selected=true] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: bold; }

main { padding: 10px 12px 60px; max-width: 860px; margin: 0 auto; }
h2 { font-size: 18px; margin: 8px 0; }
h3 { font-size: 16px; margin: 16px 0 6px; }
p { margin: 6px 0; }
.muted { color: var(--muted); font-size: 13px; }
.note { background: var(--warn-bg); color: var(--text); border-left: 4px solid var(--warn); padding: 8px 10px; border-radius: 6px; font-size: 13px; margin: 8px 0; }

/* フィルター */
.filters { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; margin-bottom: 10px; }
.filters .row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.filters .row .kw { grid-column: 1 / -1; }
@media (min-width: 640px) { .filters .row { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.filters label.f { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); }
select, input[type=search], input[type=text] {
  font: inherit; font-size: 16px; min-height: 44px; padding: 6px 8px; width: 100%;
  color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
}
.toggles { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; }
.toggles label { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; cursor: pointer; }
.owned { margin-top: 6px; }
.owned summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-size: 14px; }
.owned-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 2px 8px; padding: 4px 0; }
.owned-grid label { display: flex; align-items: center; gap: 6px; min-height: 40px; font-size: 13px; cursor: pointer; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; align-items: center; }
.btn {
  font: inherit; font-size: 14px; min-height: 44px; padding: 6px 12px; cursor: pointer;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 8px;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.danger { color: #b3261e; border-color: #b3261e; }
@media (prefers-color-scheme: dark) { .btn.danger { color: #ff8a80; border-color: #ff8a80; } }

/* アコーディオン */
details.area { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 8px; }
details.area > summary {
  list-style: none; cursor: pointer; min-height: 48px; padding: 8px 12px;
  display: flex; align-items: center; gap: 8px; font-weight: bold;
}
details.area > summary::-webkit-details-marker { display: none; }
details.area > summary::before { content: "▸"; color: var(--muted); }
details.area[open] > summary::before { content: "▾"; }
details.area > summary .count { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: normal; color: var(--muted); font-size: 13px; white-space: nowrap; }
details.area.all-done > summary .count::after { content: " 済"; color: var(--accent); font-weight: bold; }
.tag { font-size: 11px; border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; color: var(--muted); font-weight: normal; }

/* カード */
.cards { list-style: none; margin: 0; padding: 0 8px 8px; }
.card { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; margin-top: 6px; background: var(--surface); }
.card.done { background: var(--done-bg); border-color: var(--done-line); }
.check { display: flex; gap: 10px; align-items: flex-start; min-height: 44px; cursor: pointer; padding: 4px 0; }
.check input { width: 24px; height: 24px; margin: 2px 0 0; flex: none; accent-color: var(--accent); }
.check .title { font-weight: bold; }
.check .state { font-size: 11px; font-weight: normal; color: var(--muted); margin-left: 4px; }
.card.done .check .state { color: var(--accent); font-weight: bold; }
.badges { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0 4px 34px; }
.badge { font-size: 12px; padding: 1px 6px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--line); }
.badge.age-child { border-color: #7aa6d8; }
.badge.age-adult { border-color: #d89a7a; }
.badge.age-child-to-adult { border-color: #b08ad8; }
.badge.verify-unverified, .badge.verify-partial { background: var(--warn-bg); border-color: var(--warn); }
.badge.night { border-color: #7b7fd8; }
dl.info { margin: 4px 0 0 34px; display: grid; grid-template-columns: 6.5em 1fr; gap: 2px 8px; font-size: 13px; }
dl.info dt { color: var(--muted); }
dl.info dd { margin: 0; }
.more { margin: 4px 0 0 34px; font-size: 13px; }
.more summary { cursor: pointer; min-height: 36px; display: flex; align-items: center; color: var(--accent); }
.sources { font-size: 12px; padding-left: 18px; margin: 4px 0; }
.link-btn { background: none; border: none; padding: 0; color: var(--accent); text-decoration: underline; font: inherit; cursor: pointer; min-height: 32px; }

/* 手順リスト */
ol.steps { list-style: none; padding: 0; margin: 0; counter-reset: step; }
ol.steps > li { counter-increment: step; }
ol.steps .check .title::before { content: counter(step) ". "; }

/* 比較表（狭い画面は縦積み） */
table.cmp { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--surface); }
table.cmp th, table.cmp td { border: 1px solid var(--line); padding: 6px; text-align: left; vertical-align: top; }
table.cmp thead th { background: var(--surface-2); }
@media (max-width: 480px) {
  table.cmp thead { display: none; }
  table.cmp tr { display: block; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; }
  table.cmp th, table.cmp td { display: block; border: none; }
  table.cmp th[scope=row] { background: var(--surface-2); }
  table.cmp td::before { content: attr(data-label) "："; color: var(--muted); }
}

.empty { padding: 16px; text-align: center; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 8px 14px; border-radius: 8px; font-size: 14px; opacity: 0; pointer-events: none; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; }
.noscript { padding: 16px; }
