:root {
  --bg: #f7f6f2;
  --card: #ffffff;
  --text: #1f1f1f;
  --muted: #6b6b6b;
  --primary: #2f6f4f;
  --primary-text: #ffffff;
  --border: #d9d6cc;
  --error: #b3261e;
  /* ホームの「片づけの状況」の薄い色（文字は --text・--label-strong でコントラスト 4.5:1 以上） */
  --tint-gray: #ecebe7;
  --tint-yellow: #fbf0c4;
  --tint-blue: #dfeafa;
  --tint-green: #dcefe2;
  --bar-blue: #2f6db5;
  --label-strong: #454545;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161716;
    --card: #222422;
    --text: #ececec;
    --muted: #a0a0a0;
    --primary: #5fae86;
    --primary-text: #0c1a12;
    --border: #3a3d3a;
    --error: #f2b8b5;
    --tint-gray: #2c2e2c;
    --tint-yellow: #3a3420;
    --tint-blue: #1d2a3a;
    --tint-green: #1e3326;
    --bar-blue: #7fb0ea;
    --label-strong: #cfcfcf;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", sans-serif;
  font-size: 18px;
  line-height: 1.6;
}
main { max-width: 640px; margin: 0 auto; padding: 16px; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.2rem; margin-top: 2rem; }
a { color: var(--primary); }
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px; background: var(--card); border-bottom: 1px solid var(--border);
}
.topbar form { margin: 0; }
.brand { font-weight: bold; text-decoration: none; color: var(--text); }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
label { display: block; font-weight: bold; margin-bottom: 6px; }
input, select, textarea {
  width: 100%; font-size: 1.1rem; padding: 12px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
}
.btn {
  display: block; width: 100%; margin: 12px 0; padding: 16px; font-size: 1.15rem; font-weight: bold;
  text-align: center; text-decoration: none; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--border); background: var(--card); color: var(--text);
}
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
button.link { background: none; border: none; color: var(--primary); font-size: 1rem; cursor: pointer; padding: 8px; }
.error { color: var(--error); font-weight: bold; }
.muted { color: var(--muted); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 8px; }
.stat {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 12px;
  display: flex; flex-direction: column; align-items: center;
}
.stat .num { font-size: 1.7rem; font-weight: bold; }
.stat .num small { font-size: 0.9rem; margin-left: 2px; }
.stat .label { color: var(--muted); font-size: 0.95rem; }
.list { padding-left: 1.4em; }
.list li { margin: 8px 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.photo { display: block; width: 100%; max-height: 60vh; object-fit: contain; border-radius: 12px; background: var(--card); }
.notice { background: var(--card); border-left: 4px solid var(--primary); padding: 10px 12px; border-radius: 6px; }
.stack label { margin-top: 14px; }
textarea { font-family: inherit; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.props { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; }
.props dt { color: var(--muted); }
.props dd { margin: 0; }
.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); display: flex; align-items: center; justify-content: center; z-index: 10; }
.overlay[hidden] { display: none; }
.overlay-box { background: var(--card); color: var(--text); border-radius: 16px; padding: 24px; text-align: center; width: min(320px, 85vw); }
.spinner { width: 44px; height: 44px; margin: 0 auto; border: 5px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.topbar nav { margin-left: auto; margin-right: 8px; }
.topbar nav a { text-decoration: none; padding: 8px; }
.gallery { display: grid; gap: 8px; }
.links { padding-left: 1.2em; }
.links li { margin: 6px 0; }
.badge { display: inline-block; padding: 0 8px; border-radius: 999px; border: 1px solid var(--border); font-size: 0.85rem; }
.filters { display: grid; gap: 8px; }
.item-list { list-style: none; padding: 0; margin: 0; }
.item-list li { margin: 8px 0; }
.item-row {
  display: flex; gap: 12px; align-items: center; text-decoration: none; color: var(--text);
  background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 8px;
}
.item-row img, .item-row .noimg { width: 76px; height: 76px; object-fit: cover; border-radius: 8px; flex: none; background: var(--bg); }
.item-body { display: flex; flex-direction: column; min-width: 0; }
.item-name { font-weight: bold; overflow-wrap: anywhere; }
.item-meta { font-size: 0.9rem; color: var(--muted); }
.slot { margin: 12px 0; }
.slot-head { display: flex; justify-content: space-between; align-items: center; }
.slot .btn { margin: 8px 0 0; }
.slot-preview { display: block; width: 100%; max-height: 220px; object-fit: contain; margin-top: 8px; border-radius: 8px; }
.btn:disabled { opacity: 0.5; cursor: default; }
[hidden] { display: none !important; }
.table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.table th, .table td { border-bottom: 1px solid var(--border); padding: 8px 6px; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.table th { color: var(--muted); font-weight: normal; }
.compare td { width: 40%; }
.verdicts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.verdicts .btn { margin: 0; }
.today h2 { margin-top: 12px; }
.nudge { font-size: 1.2rem; font-weight: bold; color: var(--primary); }
.topbar { flex-wrap: wrap; gap: 4px; }
.ai-io pre { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 8px; font-size: 0.85rem; }
.stat-link { text-decoration: none; color: var(--text); }
.stat-link.active { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.stats { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.cmp-line { font-size: 0.95rem; overflow-wrap: anywhere; }
.thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 12px 0; }
.thumb { position: relative; }
.thumb img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; }
.thumb-del {
  position: absolute; top: 2px; right: 2px; width: 32px; height: 32px; border-radius: 50%;
  border: none; background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 1.1rem; cursor: pointer;
}
.queue { margin: 12px 0; }
.queue p { margin: 0 0 8px; }
.queue-counts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 4px; }
.qc { display: flex; flex-direction: column; align-items: center; padding: 8px 4px; border-radius: 10px; background: var(--bg); }
.qc .num { font-size: 1.6rem; font-weight: bold; }
.qc .label { font-size: 0.9rem; color: var(--muted); }
.qc.active { box-shadow: inset 0 0 0 2px var(--primary); }
.btn-strong { font-size: 1.25rem; padding: 20px 16px; }
.running { margin: 12px 0 4px; }
.spinner.small { display: inline-block; width: 18px; height: 18px; border-width: 3px; vertical-align: -3px; margin: 0 6px 0 0; }
.review-progress { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 8px; }
.review-progress strong { font-size: 1.15rem; color: var(--primary); }
.review-progress progress { width: 100%; height: 10px; accent-color: var(--primary); }
fieldset.choice { border: 1px solid var(--border); border-radius: 12px; padding: 8px 12px; margin: 0; }
fieldset.choice legend { font-weight: bold; padding: 0 4px; }
label.radio { display: flex; align-items: center; gap: 10px; font-weight: normal; padding: 8px 0; margin: 0; }
label.radio input { width: 22px; height: 22px; }
.gallery-row { display: flex; gap: 6px; overflow-x: auto; margin: 8px 0; }
.gallery-row img { height: 140px; border-radius: 8px; flex: none; }
.draft { border-left-color: #c58a00; }
.diag-summary .score { display: flex; align-items: baseline; gap: 10px; }
.diag-summary .score .num { font-size: 2rem; font-weight: bold; }
.diag-summary .score .label { color: var(--muted); font-size: 0.9rem; }
.area-progress { display: block; font-size: 0.95rem; margin-top: 6px; }
progress { width: 100%; height: 8px; accent-color: var(--primary); }
.cand-list { list-style: none; padding: 0; margin: 0; }
.cand { margin: 10px 0; }
.cand-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.cand-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.cand-reason { font-size: 0.95rem; }
.cand-actions .btn { margin: 8px 0 0; }
.cand.state-済み, .cand.state-対象外 { opacity: 0.6; }
.badge.sal-高 { border-color: var(--primary); color: var(--primary); font-weight: bold; }
.badge.warn { border-color: #c58a00; color: #c58a00; }
.btn.small { padding: 8px; font-size: 0.95rem; }
.diag-nums { display: grid; gap: 4px; }
.due-btn { background: #c58a00; border-color: #c58a00; color: #fff; }
.row-wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.row-wrap .btn { width: auto; margin: 0; }
.copy-head { display: flex; justify-content: space-between; align-items: end; gap: 8px; margin-top: 14px; }
.copy-head label { margin: 0; }
.copy-head .btn { width: auto; margin: 0; padding: 6px 14px; }
.draft-card h3 { margin: 0; }
.checklist { list-style: none; padding: 0; }
.checklist li { border-bottom: 1px solid var(--border); }
.checklist form { margin: 0; }
label.check { display: flex; gap: 12px; align-items: flex-start; font-weight: normal; padding: 10px 0; margin: 0; }
label.check input { width: 24px; height: 24px; flex: none; margin-top: 2px; }
.net-line { font-size: 1.1rem; margin: 10px 0 0; }
.suggest { color: var(--text); }
section.card { margin: 14px 0; }
section.card h2 { margin-top: 0; }
label.btn, .stack label.btn { margin: 12px 0; font-weight: bold; }
#pickers label.btn { margin: 0; }
#pickers { margin: 8px 0; }
.js-error { position: fixed; left: 8px; right: 8px; bottom: 8px; padding: 10px 12px; border-radius: 8px;
  background: var(--error); color: #fff; font-size: 0.9rem; z-index: 20; }
.toc { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 8px; }
.place-list { list-style: none; padding: 0; margin: 0; }
.place-list li { border-bottom: 1px solid var(--border); padding: 10px 0; }
.place-list li.is-hidden input { color: var(--muted); }
.place-row { display: grid; gap: 6px; margin: 0; }
.place-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.place-actions .btn { width: auto; margin: 0; }
label.switch { display: flex; gap: 6px; align-items: center; font-weight: normal; margin: 0; }
label.switch input { width: 22px; height: 22px; }
input.pct { width: 4.5em; padding: 8px; }
.goal { margin: 10px 0; }
.goal-head { display: flex; justify-content: space-between; margin-bottom: 6px; }
.nav-admin { font-weight: bold; }
.admin-menu { list-style: none; padding: 0; }
.admin-menu .btn { text-align: left; }
.badge.first { border-color: var(--error); color: var(--error); font-weight: bold; }
.more-cands { margin: 16px 0; }
.more-cands summary { cursor: pointer; font-weight: bold; padding: 12px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; }
.plan tr.low td { background: var(--bg); }
.facts .fact { padding: 10px 0; border-bottom: 1px solid var(--border); }
.facts .fact label { margin: 0 0 6px; }
.facts .fact.fact-skip input:not([type=checkbox]) { opacity: 0.5; }
.facts .fact.fact-answered label strong::after { content: " ✓"; color: var(--primary); }
label.check.skip { padding: 6px 0 0; font-size: 0.95rem; }
.pending-note { font-size: 0.85rem; color: #c58a00; margin-left: auto; text-align: right; }
textarea.composed { background: var(--card); }
.edit-body { margin: 10px 0; }
.edit-body summary { cursor: pointer; color: var(--primary); }
.hints { margin-top: 12px; padding: 10px 12px; border-radius: 8px; background: var(--bg); border: 1px dashed var(--border); }
.hints ul { margin: 6px 0 0; padding-left: 1.2em; }
.draft-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.draft-head form { margin: 0; }
.draft-head .btn { width: auto; margin: 0; }
.add-channels { margin: 8px 0 16px; }
.add-channels form { margin: 0; }
.other-drafts { margin: 12px 0; }
.other-drafts > summary { cursor: pointer; font-weight: bold; padding: 12px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; }
.review { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--border); }
.review h4 { margin: 0 0 6px; }
.review-ok { font-weight: bold; color: var(--primary); }
.findings { padding-left: 1.2em; }
.finding { margin: 12px 0; display: grid; gap: 4px; }
.finding.applied { opacity: 0.55; }
.finding .btn { width: auto; }
.diff { display: grid; gap: 6px; }
.diff pre { white-space: pre-wrap; overflow-wrap: anywhere; margin: 2px 0 0; padding: 6px 8px; border-radius: 6px; font-family: inherit; font-size: 0.9rem; }
.diff-old pre { background: rgba(179, 38, 30, 0.08); text-decoration: line-through; }
.diff-new pre { background: rgba(47, 111, 79, 0.10); }
.sell-open { margin: 10px 0 4px; }
.sell-open .btn.small { width: auto; }
.copied { border-color: var(--primary) !important; }
.sheet { list-style: none; padding: 0; margin: 0; }
.sheet .card { margin: 12px 0; }
.sheet-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.step { display: inline-flex; width: 26px; height: 26px; border-radius: 50%; align-items: center; justify-content: center;
  background: var(--primary); color: var(--primary-text); font-weight: bold; font-size: 0.9rem; }
.sheet-text { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px; overflow-wrap: anywhere; }
.sheet-text.pre { white-space: pre-wrap; max-height: 40vh; overflow-y: auto; }
.sheet-value { font-size: 1.15rem; font-weight: bold; }
.sheet-hints { margin: 6px 0 0; padding-left: 1.2em; }
.btn.copied { background: var(--card); color: var(--primary); }
.paste-order { margin: 0 0 10px; }
.sheet-input { font-size: 1.05rem; }
textarea.sheet-input { line-height: 1.6; }
.sheet .count { margin-left: auto; color: var(--muted); }
.sheet .count.error { color: var(--error); font-weight: bold; }
.price-row { display: flex; align-items: center; gap: 8px; }
.price-row input { max-width: 12em; }
.sheet-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 0; }
.sheet-actions .btn { width: auto; margin: 0; flex: 1; }
.sheet-actions #save-state { flex-basis: 100%; font-size: 0.9rem; }
.review-box p { margin: 0 0 8px; }
.stepper { margin: 4px 0 14px; }
.stepper-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.stepper-bar { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.stepper-bar a { display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; color: var(--muted);
  padding: 6px 2px; border-radius: 8px; border: 1px solid var(--border); background: var(--card); font-size: 0.8rem; }
.stepper-bar .num { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--border); font-weight: bold; color: var(--text); }
.stepper-bar li.done .num { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.stepper-bar li.current a { border-color: var(--primary); color: var(--text); font-weight: bold; box-shadow: inset 0 0 0 1px var(--primary); }
.stepper-bar .name { overflow-wrap: anywhere; text-align: center; }
.step-nav { display: flex; justify-content: space-between; gap: 10px; margin: 20px 0 8px; position: sticky; bottom: 0; background: var(--bg); padding: 8px 0; }
.step-nav .btn { width: auto; flex: 1; margin: 0; }
.lead { font-size: 1.05rem; }
.badge.ok { border-color: var(--primary); color: var(--primary); font-weight: bold; }
.notice.ok { border-left-color: var(--primary); }
.price-hero { text-align: center; }
.price-big { font-size: 2.4rem; font-weight: bold; line-height: 1.2; }
.net-big { font-size: 1.2rem; margin: 4px 0 6px; }
.plan-more summary { cursor: pointer; font-weight: bold; }

/* 利用規約・プライバシーポリシー（改行をそのまま表示） */
.legal-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; }
.legal-scroll { max-height: 40vh; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; padding: 10px; }
.btn.danger { background: var(--error); border-color: var(--error); color: #fff; }
.invite-code { font-size: 1.6rem; font-weight: bold; letter-spacing: 0.1em; margin: 8px 0; }
.btn.line-login { background: #06c755; border-color: #06c755; color: #fff; }
.test-env { background: #d84315; color: #fff; text-align: center; font-weight: bold; padding: 4px; font-size: 0.9rem; }

/* メニュー: ホームの LV1 タイルと、LV2 の一覧 */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 8px 0 18px; }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
.tile { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 110px; padding: 14px 8px; background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  color: inherit; text-decoration: none; text-align: center; }
.tile-icon { font-size: 2.2rem; line-height: 1; }
.tile-name { font-weight: bold; font-size: 1.05rem; }
.tile-badge { min-width: 1.6em; padding: 1px 7px; border-radius: 999px; background: var(--error); color: #fff;
  font-size: 0.85rem; font-weight: bold; text-align: center; }
.tile .tile-badge { position: absolute; top: 8px; right: 8px; }
.next-actions h2 { margin-top: 0; }
.next-btn { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.menu-list { list-style: none; padding: 0; margin: 12px 0; }
.menu-list li { margin-bottom: 8px; }
.menu-item { display: flex; align-items: center; gap: 12px; padding: 14px 12px; background: var(--card);
  border: 1px solid var(--border); border-radius: 12px; color: inherit; text-decoration: none; }
.menu-item.soon { opacity: 0.55; }
.menu-icon { font-size: 1.6rem; width: 1.8em; text-align: center; flex: none; }
.menu-text { display: flex; flex-direction: column; flex: 1; }
.menu-text small { color: var(--muted); }
.menu-soon { font-size: 0.8rem; border: 1px solid var(--border); border-radius: 6px; padding: 2px 6px; color: var(--muted); }
.menu-switch { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 20px; font-size: 0.95rem; }
a.card.goal { display: block; color: inherit; text-decoration: none; }
.menu-edit { border-top: 1px solid var(--border); padding: 10px 0; display: flex; flex-direction: column; gap: 6px; }
.menu-edit-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.menu-edit-row > input:not(.w-icon):not(.w-sort) { flex: 1; min-width: 8em; }
.menu-edit .w-icon, .stack .w-icon { width: 3.2em; flex: none; text-align: center; }
.menu-edit .w-sort, .stack .w-sort { width: 4.5em; flex: none; }
.menu-edit-row label.check { padding: 0; }
.menu-edit-row .btn.small { width: auto; margin: 0; }

/* ホームの「片づけの状況」: 押せない表示。タイル（白・影つき）と違い、薄い色の背景・角丸だけで影も枠線もない */
.tile { box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12); }
.status-panel { margin: 4px 0 18px; }
.status-panel h2 { margin: 0 0 8px; font-size: 1.05rem; }
.status-panel .stat { border: none; box-shadow: none; border-radius: 12px; padding: 10px 6px; }
.status-panel .stat .num { font-size: 1.5rem; color: var(--text); }
.status-panel .stat .label { color: var(--label-strong); white-space: nowrap; }
.tint-gray { background: var(--tint-gray) !important; }
.tint-yellow { background: var(--tint-yellow) !important; }
.tint-blue { background: var(--tint-blue) !important; }
.tint-green { background: var(--tint-green) !important; }
.status-panel .goal { margin: 10px 0 8px; }
.status-panel progress { appearance: none; -webkit-appearance: none; width: 100%; height: 12px; border: none;
  border-radius: 999px; background: var(--tint-blue); overflow: hidden; }
.status-panel progress::-webkit-progress-bar { background: var(--tint-blue); border-radius: 999px; }
.status-panel progress::-webkit-progress-value { background: var(--bar-blue); border-radius: 999px; }
.status-panel progress::-moz-progress-bar { background: var(--bar-blue); border-radius: 999px; }
.richmenu-preview { width: 100%; height: auto; border: 1px solid var(--border); border-radius: 8px; }
