/* 下限だけ守る: 本文16px、見出しは本文の1.5倍以上、押せるものは44px以上、本文のコントラスト4.5以上。値の写しは DESIGN.md。
   箱・影・角丸で飾らず、罫線と余白と文字の大きさで組む。 */
:root {
  --paper: #fbfaf7;
  --ink: #17191f;
  --sub: #565b66;
  --line: #d9d7cf;
  --hit: #f0eee6;
  --accent: #c2321d;   /* 白地で約5.6。線と数字に使う */
  --ok: #0f6b47;
  --ng: #a3321f;
  --axis: #b9b7ae;
  --gainfill: rgba(15, 107, 71, 0.12);
  --liquid: #4f6bff;
  --liquid-done: #f5a800;
  --done-bg: #fff4d1;
  --glass: #17191f;
  color-scheme: light dark;
}
/* ダークモード。既定は端末の設定に合わせる。data-theme で手動指定（ライト/ダーク）できる */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #14161b;
    --ink: #eceae3;
    --sub: #a4a9b4;
    --line: #333844;
    --hit: #20242d;
    --accent: #ff7a63;
    --ok: #4cc38a;
    --ng: #ff8f7a;
    --axis: #4a505e;
    --gainfill: rgba(76, 195, 138, 0.18);
    --liquid: #6f86ff;
    --liquid-done: #ffc83d;
    --done-bg: #3a2d08;
    --glass: #eceae3;
    color-scheme: dark;
  }
  :root:not([data-theme="light"]) .cpct { color: var(--b1, var(--accent)); }
  :root:not([data-theme="light"]) .card.done .cpct { color: var(--liquid-done); }
}
:root[data-theme="dark"] {
    --paper: #14161b;
    --ink: #eceae3;
    --sub: #a4a9b4;
    --line: #333844;
    --hit: #20242d;
    --accent: #ff7a63;
    --ok: #4cc38a;
    --ng: #ff8f7a;
    --axis: #4a505e;
    --gainfill: rgba(76, 195, 138, 0.18);
    --liquid: #6f86ff;
    --liquid-done: #ffc83d;
    --done-bg: #3a2d08;
    --glass: #eceae3;
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] .cpct { color: var(--b1, var(--accent)); }
:root[data-theme="dark"] .card.done .cpct { color: var(--liquid-done); }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Hiragino Sans", "Yu Gothic Medium", "Yu Gothic", "Meiryo", sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.8;
  word-break: auto-phrase;
  overflow-wrap: anywhere;
}
.wrap { max-width: 44rem; margin: 0 auto; padding: 2rem 1rem 2rem; }
.phrase { display: inline-block; }
h1 { font-size: 1.5rem; font-weight: 700; line-height: 1.35; margin: 0 0 0.75rem; }
h2 { font-size: 1.5rem; font-weight: 700; line-height: 1.4; margin: 1.25rem 0 0.5rem; }
p { margin: 0 0 0.75rem; }
.lead { color: var(--sub); max-width: 36em; }
.note { color: var(--sub); font-size: 0.875rem; margin-bottom: 0.25rem; max-width: 40em; }

/* 答え */
.detail { border-top: 4px solid var(--b2, var(--ink)); padding: 0.75rem 0 0.5rem; margin: 0 0 1rem; }
.detail h2 { font-size: 1.125rem; margin: 0 0 0.25rem; color: var(--sub); font-weight: 700; }
.answer { font-size: 1.5rem; font-weight: 700; line-height: 1.3; margin: 0 0 0.75rem; }
.answer strong { font-size: 4rem; line-height: 1.1; color: transparent; background: linear-gradient(var(--b1, #c2321d), var(--b2, #c2321d)); -webkit-background-clip: text; background-clip: text; font-weight: 800; padding: 0 0.1em; }
.calc { color: var(--sub); }
.steps { list-style: none; margin: 0.75rem 0; padding: 0; }
.steps li { padding: 0.5rem 0; border-top: 1px solid var(--line); line-height: 1.6; }
.steps strong { display: block; }
.steps .ok strong { color: var(--ok); }
.steps .ng strong { color: var(--ng); }

/* 上の1行: ミニコップと％。横にはみ出すときは横スクロール */
#list { margin: 0 0 1rem; }
.cards { list-style: none; margin: 0; padding: 0.25rem 0 0.5rem; display: flex; gap: 0.5rem; overflow-x: auto; padding: 0.75rem 0.5rem 1.1rem; }
.cards li { flex: none; }
.card {
  display: grid; justify-items: center; gap: 0.1rem; width: 6rem; min-height: 56px; padding: 0.5rem 0.25rem;
  font: inherit; line-height: 1.25; color: var(--ink); background: none; border: 2px solid var(--line); border-radius: 6px; cursor: pointer;
}
.card:hover { background: var(--hit); }
.card { position: relative; opacity: 0.78; }
.card:hover { opacity: 1; }
.card[aria-pressed="true"] { opacity: 1; border: 3px solid var(--b2, var(--ink)); background: color-mix(in srgb, var(--b1, transparent) 14%, var(--paper)); transform: translateY(-2px); }
.card[aria-pressed="true"] .name { font-size: 0.875rem; }
.card[aria-pressed="true"]::after { content: ''; position: absolute; left: 50%; bottom: -0.7rem; margin-left: -0.5rem; border: 0.5rem solid transparent; border-top-color: var(--b2, var(--ink)); border-bottom: 0; }
.card.done::before { content: '★'; position: absolute; top: -0.5rem; right: -0.4rem; width: 1.3rem; height: 1.3rem; display: grid; place-items: center; border-radius: 50%; background: var(--liquid-done); color: #fff; font-size: 0.75rem; line-height: 1; }
.card:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.mini { display: block; width: 2.4rem; height: auto; overflow: visible; }
.card.done .mini { filter: drop-shadow(0 0 4px var(--liquid-done)); }
.card.done .cup { stroke: var(--liquid-done); }
.cpct { font-weight: 800; font-size: 1.125rem; color: var(--bt, var(--liquid)); }
.card.done .cpct { color: var(--liquid-done); }
.name { font-weight: 700; font-size: 0.8125rem; max-width: 5.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan { color: var(--sub); font-size: 0.75rem; max-width: 5.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.foot { max-width: 44rem; margin: 0 auto; padding: 1.25rem 1rem 3rem; border-top: 1px solid var(--line); color: var(--sub); font-size: 0.875rem; }
.foot p { margin-bottom: 0.25rem; }

/* ボタン */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; min-width: 44px; padding: 0.25rem 1.25rem;
  border: 2px solid var(--ink); background: var(--paper); color: var(--ink);
  font: inherit; font-weight: 700; line-height: 1.3; cursor: pointer; border-radius: 3px;
}
.btn:hover { background: var(--hit); }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.primary:hover { opacity: 0.85; }
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.detail .btn { margin: 0.25rem 0 0.75rem; }

/* 表示の切り替え（グラフ／表） */
.tabs { display: inline-flex; margin: 0.25rem 0 0.5rem 0.5rem; vertical-align: middle; border: 2px solid var(--ink); border-radius: 3px; }
.tab { min-height: 44px; min-width: 64px; padding: 0 1rem; border: 0; background: var(--paper); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }
.tab + .tab { border-left: 2px solid var(--ink); }
.tab[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.tab:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* グラフ */
.fig { margin: 0.5rem 0 0.75rem; }
.chart { display: block; width: 100%; height: auto; }
.ch-t { font-size: 11px; fill: var(--sub); font-weight: 500; }
.ch-axis { stroke: var(--axis); stroke-width: 1; }
.ch-cost { stroke: var(--sub); stroke-width: 2; stroke-dasharray: 6 4; }
.ch-val { stroke: var(--b2, var(--accent)); stroke-width: 3.5; stroke-linecap: round; }
.ch-gain { fill: var(--gainfill); }
.ch-guide { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 3 3; }
.ch-dot { fill: var(--b2, var(--accent)); stroke: var(--paper); stroke-width: 3; }
.ch-lab { font-size: 12px; font-weight: 700; }
.ch-lab-val { fill: var(--bt, var(--accent)); }
.ch-lab-cost { fill: var(--sub); }

/* 640px以上 */
@media (min-width: 640px) {
  h1 { font-size: 1.5rem; }
}
/* 960px以上: 画面1枚に収める。メーター、記録欄、グラフを横に並べる */
@media (min-width: 960px) {
  .wrap, .foot { max-width: 76rem; }
  .wrap { padding-top: 1rem; padding-bottom: 1rem; }
  h1 { font-size: 1.5rem; margin-bottom: 0.25rem; }
  .lead { margin-bottom: 0.25rem; }
  .detail { margin-bottom: 0.5rem; padding-top: 0.5rem; }
  .answer { margin-bottom: 0.5rem; }
  .answer strong { font-size: 3.25rem; }
  .cols { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) 17rem; column-gap: 2rem; align-items: start; }
  .meter-wrap { display: contents; }
  .meter-wrap .meter { grid-column: 1; border-bottom: 0; }
  .meter-wrap .kinds { grid-column: 2; margin-top: 0; }
  .side { grid-column: 3; grid-row: 1; }
  .meter { grid-template-columns: 7.5rem 1fr; }
  .glass-box { width: 6.5rem; }
}
.side .tabs { margin: 0 0 0.25rem; }
.side .fig { margin: 0; }
.side .fig .note { font-size: 0.8125rem; line-height: 1.5; }
.more { border-top: 1px solid var(--line); margin-top: 0.5rem; padding-top: 0.25rem; }
.more summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
.more[open] summary { margin-bottom: 0.25rem; }

/* 元とりメーター: コップに液がたまる */
.meter-wrap { margin: 0 0 1rem; }
.meter { display: grid; grid-template-columns: 7.5rem 1fr; column-gap: 1.25rem; align-items: center; padding: 0.75rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.glass-box { width: 6.5rem; }
.glass { display: block; width: 100%; height: auto; overflow: visible; }
.cup { fill: none; stroke: var(--glass); stroke-width: 3; stroke-linejoin: round; }
.liq { transform: translateY(118px); transition: transform 1s cubic-bezier(.3, 1.2, .4, 1); }
.wave { fill: url(#lgA); }
.meter.done .wave { fill: url(#lgD); }
.st-a1 { stop-color: var(--b1, #7f9bff); } .st-a2 { stop-color: var(--b2, #3a4fe0); }
.st-d1 { stop-color: #ffe27a; } .st-d2 { stop-color: #f08a00; }
.glass-box { position: relative; margin-left: 0.75rem; }
.spark { position: absolute; display: none; color: #f5a800; font-size: 1.25rem; line-height: 1; }
.meter.done .spark { display: none; }
.s1 { top: -4px; left: -6px; } .s2 { top: 30%; right: -10px; font-size: 1rem; } .s3 { bottom: 12%; left: -10px; font-size: 0.9rem; }
.meter.done { border-color: var(--liquid-done); }
.meter.done .glass-box { filter: drop-shadow(0 0 6px var(--liquid-done)); }
.meter.done .cup { stroke: var(--liquid-done); }
.m-title { margin: 0; color: var(--sub); font-size: 0.875rem; font-weight: 700; line-height: 1.4; }
.m-pct { margin: 0; font-size: 1.5rem; font-weight: 800; line-height: 1.2; }
.m-pct strong { font-size: 3.25rem; color: transparent; background: linear-gradient(var(--b1, #7f9bff), var(--b2, #3a4fe0)); -webkit-background-clip: text; background-clip: text; padding-right: 0.05em; }
.meter.done .m-pct strong { background: linear-gradient(#ffe27a, #f08a00); -webkit-background-clip: text; background-clip: text; }
.meter.done .m-pct { color: var(--ink); }
.m-msg { margin: 0.25rem 0 0; font-size: 0.9375rem; line-height: 1.6; }
.kinds { list-style: none; margin: 0.25rem 0 0.5rem; padding: 0; }
.kind { display: grid; grid-template-columns: 1fr auto auto; align-items: center; column-gap: 0.75rem; padding: 0.4rem 0; border-bottom: 1px solid var(--line); }
.k-name { font-weight: 700; line-height: 1.3; }
.k-yen { display: block; color: var(--sub); font-size: 0.8125rem; font-weight: 500; }
.k-count { font-size: 1.25rem; font-weight: 800; min-width: 3.5rem; text-align: right; }
.k-btns { display: inline-flex; gap: 0.35rem; }
.detail .k-btn { margin: 0; padding: 0.25rem 0.6rem; min-width: 48px; }

/* 動き。「動きを減らす」設定のときは付けない */
@media (prefers-reduced-motion: no-preference) {
  .meter.pulse .glass-box { animation: glass-pop 0.4s cubic-bezier(.2, 1.6, .4, 1); }
  .meter.burst { animation: burst 0.9s ease-out; }
  .answer strong { display: inline-block; animation: num-pop 0.5s cubic-bezier(.2, 1.4, .4, 1) both; }
  .ch-val { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 0.9s ease-out 0.15s forwards; }
  .ch-gain { animation: fade 0.5s ease-out 0.9s both; }
  .ch-guide, .ch-lab { animation: fade 0.4s ease-out 1s both; }
  .ch-dot { transform-box: fill-box; transform-origin: center; animation: dot-pop 0.45s cubic-bezier(.2, 1.6, .4, 1) 0.95s both; }
  .card { transition: background 0.15s, transform 0.12s; }
  .card:active { transform: scale(0.985); }
  .card[aria-pressed="true"] .mark { animation: mark-pop 0.35s cubic-bezier(.2, 1.6, .4, 1); }
  .btn, .tab { transition: background 0.15s, color 0.15s; }
}
@keyframes wave { to { transform: translateX(-100px); } }
@keyframes glass-pop { 0% { transform: scale(1); } 40% { transform: scale(1.03); } 100% { transform: scale(1); } }
@keyframes glow-text { 0%, 100% { filter: drop-shadow(0 0 0 rgba(245,168,0,0)); } 50% { filter: drop-shadow(0 0 10px rgba(245,168,0,0.95)); } }
@keyframes glow-box { 0%, 100% { filter: drop-shadow(0 0 4px #f5a800); } 50% { filter: drop-shadow(0 0 18px #ffd34d); } }
@keyframes twinkle { 0%, 100% { transform: scale(0.6) rotate(0); opacity: 0.4; } 50% { transform: scale(1.3) rotate(25deg); opacity: 1; } }
@keyframes burst { 0% { box-shadow: 0 0 0 0 rgba(245,168,0,0.9); } 100% { box-shadow: 0 0 0 40px rgba(245,168,0,0); } }
@keyframes num-pop { from { transform: scale(0.7); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes dot-pop { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes mark-pop { from { transform: scale(0.6); } to { transform: none; } }

.lib { margin: 0 0 0.5rem; font-size: 0.9375rem; }
.lib span { color: var(--sub); }
.lib strong { display: block; }
.lib-why { display: block; font-size: 0.875rem; }
.lib + .lib { margin-top: 0; }

/* 色を大胆に: ボタンも、そのサービスの色 */
.detail .k-btn.primary { background: var(--b2, var(--ink)); border-color: var(--b2, var(--ink)); color: #fff; }
.detail .k-btn.primary:hover { opacity: 0.85; }
.bubble { fill: rgba(255, 255, 255, 0.55); }
.drop { position: absolute; left: 50%; top: -0.5rem; width: 0.7rem; height: 0.9rem; margin-left: -0.35rem; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: var(--b1, #7f9bff); opacity: 0; pointer-events: none; }
@media (prefers-reduced-motion: no-preference) {
  .bubble { animation: rise 3s ease-in infinite; }
  .bb1 { animation-delay: 0.8s; animation-duration: 3.6s; } .bb2 { animation-delay: 1.6s; } .bb3 { animation-delay: 2.2s; animation-duration: 2.6s; }
  .drop.fall { animation: drop-fall 0.6s ease-in; }
}
@keyframes rise { 0% { transform: translateY(0); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(-45px); opacity: 0; } }
@keyframes drop-fall { 0% { transform: translateY(0) scale(1); opacity: 1; } 85% { transform: translateY(5.5rem) scale(1); opacity: 1; } 100% { transform: translateY(6rem) scale(1.8, 0.3); opacity: 0; } }

/* 100%を超えた分は、コップからあふれる */
.dome, .dripc { display: none; }
.mdome { fill: var(--liquid-done); }
.mdrip { fill: var(--liquid-done); }
.meter.over1 .dome { display: block; fill: var(--liquid-done); }
.meter.over1 .dc0, .meter.over1 .dc1, .meter.over2 .dc2, .meter.over2 .dc3, .meter.over3 .dc4, .meter.over3 .dc5 { display: block; fill: var(--liquid-done); }
@media (prefers-reduced-motion: no-preference) {
  .dripc { animation: spill 1.1s ease-in infinite; }
  .dc1 { animation-delay: 0.3s; } .dc2 { animation-delay: 0.55s; } .dc3 { animation-delay: 0.15s; } .dc4 { animation-delay: 0.7s; } .dc5 { animation-delay: 0.45s; }
  .meter.over2 .dripc { animation-duration: 0.8s; } .meter.over3 .dripc { animation-duration: 0.55s; }
  .dome { animation: dome 1.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center bottom; }
  .mdrip { animation: spill 1.2s ease-in infinite; } .m1 { animation-delay: 0.5s; }
}
@keyframes spill { 0% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(95px); opacity: 0; } }
@keyframes dome { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(1.5); } }

.shine { fill: rgba(255, 255, 255, 0.4); }
.shine2 { fill: rgba(255, 255, 255, 0.25); }
.pt { fill: var(--b1, #7f9bff); }
.meter.done .drop-pt { fill: var(--liquid-done); }
@media (prefers-reduced-motion: no-preference) {
  .meter.pulse .glass-box { animation: glass-pop 0.5s cubic-bezier(.2, 1.8, .4, 1); }
}
@keyframes glass-pop { 0% { transform: scale(1) rotate(0); } 30% { transform: scale(1.03); } 60% { transform: scale(0.995); } 100% { transform: scale(1) rotate(0); } }

/* ---- 控えめな演出 ---- */
.glass-box { isolation: isolate; }
.m-rank { margin: 0.1rem 0 0; }
.rank { display: inline-block; padding: 0 0.7rem; border-radius: 999px; font-size: 0.8125rem; font-weight: 700; line-height: 1.7; color: var(--paper); background: var(--sub); }
.rank[data-r="4"], .rank[data-r="5"], .rank[data-r="6"] { background: var(--liquid-done); color: #14161b; }
/* 達成: 金の輪が1度だけ広がり、そのあとは静かに金色のまま */
.meter.burst .glass-box::after { content: ''; position: absolute; inset: 10%; border-radius: 50%; border: 2px solid var(--liquid-done); opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  .meter.burst .glass-box::after { animation: ring 1.1s ease-out; }
}
@keyframes ring { 0% { transform: scale(0.6); opacity: 0.9; } 100% { transform: scale(1.7); opacity: 0; } }
@media (min-width: 960px) {
  .meter { grid-template-columns: 8.5rem 1fr; }
  .glass-box { width: 8rem; }
}

/* サブスク・モトトル */
.dhead { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.dhead h2 { margin: 0; }
.sub-toggle { min-height: 44px; padding: 0 1rem; border: 2px solid var(--ink); border-radius: 999px; background: var(--paper); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }
.sub-toggle[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.sub-toggle:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.subtag { position: absolute; top: -0.6rem; left: 0.4rem; padding: 0 0.45rem; border-radius: 999px; background: var(--ink); color: var(--paper); font-size: 0.6875rem; font-weight: 800; line-height: 1.5; }
/* 契約中の合計 */
#summary { margin: 0 0 0.25rem; }
.sum-empty { margin: 0; padding: 0.5rem 0; color: var(--sub); font-size: 0.875rem; }
.sum { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1.5rem; padding: 0.5rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sum-main { display: flex; align-items: center; gap: 0.6rem; flex: 1 1 100%; min-width: 0; }
.sum-t { font-weight: 700; font-size: 0.875rem; color: var(--sub); white-space: nowrap; }
.sum-pct { font-size: 1.75rem; font-weight: 800; line-height: 1; white-space: nowrap; }
.sum-bar { display: block; flex: 1 1 4rem; min-width: 3rem; max-width: 12rem; height: 0.6rem; border-radius: 999px; background: var(--line); overflow: hidden; }
.sum-bar i { display: block; height: 100%; background: linear-gradient(90deg, #7f9bff, #3a4fe0); transition: width 0.8s; }
.sum-bar.done i { background: linear-gradient(90deg, #ffe27a, #f08a00); }
.sum-line, .sum-loss { margin: 0; font-size: 0.9375rem; }
.sum-loss strong { font-size: 1.5rem; color: var(--ng); }
.sum.ok .sum-loss strong { color: var(--ok); }

/* ヘッダー（1行） */
.top { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 0 1rem; border-bottom: 2px solid var(--ink); padding-bottom: 0.4rem; margin-bottom: 0.75rem; }
.brand { margin: 0; font-size: 1.5rem; font-weight: 900; line-height: 1.3; letter-spacing: 0.01em; color: var(--ink); }
.top h1 { margin: 0; padding: 0; border: 0; font-size: 0.875rem; font-weight: 500; color: var(--sub); line-height: 1.3; }
@media (min-width: 640px) { .brand { font-size: 1.75rem; } }

/* フォントと余白（モダン化） */
:root { --num: "Outfit", "Zen Kaku Gothic New", system-ui, sans-serif; }
body { font-family: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic Medium", "Yu Gothic", "Meiryo", sans-serif; line-height: 1.75; }
.answer strong, .sum-pct, .sum b, .sum-loss strong, .cpct, .rank, [class*="pct"] { font-family: var(--num); letter-spacing: 0; }
.wrap { padding-top: 1.5rem; }
.top { padding-bottom: 0.75rem; margin-bottom: 1.1rem; }
.sum { padding: 0.9rem 0; margin-bottom: 0.5rem; }
.sum-pct { font-size: 2.25rem; }
#list { margin-top: 1rem; margin-bottom: 1.25rem; }
.detail { padding-top: 1.1rem; }

/* AIっぽさ対策1: グラデーションをやめて単色にする（コップの液は残す） */
.answer strong, .m-pct strong, .meter.done .m-pct strong { background: none; color: var(--b2, var(--accent)); -webkit-background-clip: border-box; background-clip: border-box; }
.meter.done .m-pct strong { color: var(--liquid-done); }
.sum-bar i { background: var(--ink); }
.sum-bar.done i { background: var(--liquid-done); }

/* AIっぽさ対策2: 丸いラベルをやめて、文字だけにする */
.subtag { top: 0.2rem; left: 0.35rem; padding: 0; border-radius: 0; background: none; color: var(--sub); font-size: 0.6875rem; font-weight: 700; }
.card.done::before { top: 0.1rem; right: 0.3rem; width: auto; height: auto; border-radius: 0; background: none; color: var(--liquid-done); font-size: 0.9375rem; }
.rank { padding: 0; border-radius: 0; background: none; color: var(--sub); font-size: 0.875rem; }
.rank[data-r="4"], .rank[data-r="5"], .rank[data-r="6"] { background: none; color: var(--liquid-done); }
.card { padding-top: 1.25rem; }
.subtag { top: 0.3rem; left: 0; right: 0; text-align: center; }
.card.done::before { top: 0.15rem; right: 0.35rem; }

/* AIっぽさ対策3: 強弱。選んだものだけを強くする */
.card[aria-pressed="false"] { opacity: 0.85; filter: saturate(0.45); }
.card[aria-pressed="false"]:hover { filter: none; opacity: 1; }
.detail { border-top-width: 2px; }

/* 文中の大小: 目立たせるところだけ大きく */
.m-msg { display: grid; gap: 0.15rem; }
.m-head { font-size: 1rem; font-weight: 700; }
.m-head strong { font-family: var(--num); font-size: 1.75rem; font-weight: 800; margin: 0 0.1em; }
.m-rest { font-size: 0.8125rem; color: var(--sub); line-height: 1.6; }
.answer { font-size: 1.125rem; font-weight: 600; }

/* 表示の切り替え（ラジオ） */
.theme { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin: 0; padding: 0; }
.theme legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.theme label { position: relative; display: grid; place-items: center; min-height: 44px; min-width: 44px; padding: 0 0.75rem; font-size: 0.8125rem; font-weight: 700; color: var(--sub); cursor: pointer; }
.theme label + label { border-left: 1px solid var(--line); }
.theme input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.theme label:has(input:checked) { background: var(--ink); color: var(--paper); }
.theme label:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: -3px; }

/* アカウント */
.account { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.75rem; margin: 0.5rem 0 0; font-size: 0.8125rem; color: var(--sub); }
.account[hidden] { display: none; }
.acc-b { min-height: 44px; padding: 0 0.9rem; border: 1px solid var(--line); border-radius: 8px; background: none; color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }
.acc-b:hover { background: var(--hit); }
.foot a { color: inherit; }

/* 画面の切り替え（元とり／統計） */
.views { display: flex; gap: 1.5rem; border-bottom: 1px solid var(--line); margin: 0.5rem 0 0.75rem; }
.vtab { min-height: 44px; padding: 0 0.1rem; border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px; background: none; color: var(--sub); font: inherit; font-size: 1rem; font-weight: 700; cursor: pointer; }
.vtab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.vtab:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
/* 統計 */
.stats { padding: 0.5rem 0 1rem; }
.st-lock { color: var(--sub); max-width: 36em; }
.st-head { font-size: 1rem; font-weight: 700; margin: 0 0 0.5rem; }
.st-head strong { font-family: var(--num); font-size: 2.25rem; font-weight: 800; margin: 0 0.1em; }
.ok { color: var(--ok); } .ng { color: var(--ng); }
.schart { display: block; width: 100%; max-width: 34rem; height: auto; margin: 0.5rem 0 1rem; }
.sc-zero { stroke: var(--axis); stroke-width: 1; }
.sc-up { fill: var(--ok); } .sc-down { fill: var(--ng); }
.sc-l, .sc-v { fill: var(--sub); font-size: 10px; font-family: var(--num); }
.st-table { border-collapse: collapse; width: 100%; max-width: 34rem; font-size: 0.9375rem; margin-bottom: 0.75rem; }
.st-table th, .st-table td { text-align: left; padding: 0.4rem 0.5rem 0.4rem 0; border-bottom: 1px solid var(--line); font-weight: 500; }
.st-table thead th { font-size: 0.8125rem; color: var(--sub); font-weight: 700; }
.st-table td:last-child, .st-table thead th:last-child { text-align: right; font-family: var(--num); font-weight: 800; }

/* 設定 */
.set-h { font-size: 1.125rem; margin: 1.25rem 0 0.25rem; }
.set-list { list-style: none; margin: 0.25rem 0 0; padding: 0; max-width: 34rem; }
.set-list li { display: flex; align-items: center; gap: 0.75rem; min-height: 52px; border-bottom: 1px solid var(--line); }
.set-name { flex: 1; font-weight: 700; line-height: 1.4; }
.set-name small { display: block; font-weight: 500; color: var(--sub); font-size: 0.8125rem; }
.sw { position: relative; display: inline-block; width: 52px; height: 44px; flex: none; }
.sw-in { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.sw-ui { position: absolute; left: 0; top: 10px; width: 52px; height: 24px; border-radius: 12px; background: var(--axis); transition: background 0.15s; }
.sw-ui::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--paper); transition: transform 0.15s; }
.sw-in:checked + .sw-ui { background: var(--ok); }
.sw-in:checked + .sw-ui::after { transform: translateX(28px); }
.sw-in:focus-visible + .sw-ui { outline: 3px solid var(--accent); outline-offset: 2px; }
.set-form { display: grid; gap: 0.6rem; max-width: 22rem; margin-top: 0.5rem; }
.set-form label { display: grid; gap: 0.2rem; font-size: 0.875rem; font-weight: 700; }
.set-form input, .set-form select { min-height: 44px; padding: 0 0.6rem; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); font: inherit; font-weight: 500; }
.set-add { justify-self: start; background: var(--ink); color: var(--paper); border-color: var(--ink); }
.set-add:hover { background: var(--ink); opacity: 0.88; }

/* サービス名を読みやすく */
.card { width: 6.75rem; }
.name { font-size: 0.9375rem; font-weight: 800; max-width: 6.25rem; line-height: 1.25; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; text-align: center; overflow: hidden; }
.card[aria-pressed="true"] .name { font-size: 1rem; }
.plan { font-size: 0.8125rem; max-width: 6.25rem; }
.detail h2 { font-size: 1.5rem; font-weight: 800; color: var(--ink); line-height: 1.3; }
.detail h2 small, .detail .dhead h2 { letter-spacing: 0; }
.name { overflow-wrap: break-word; word-break: normal; }

/* 設定: 2つのスイッチ（表示／契約中） */
.sw { width: 3.4rem; height: auto; min-height: 44px; display: grid; justify-items: center; align-content: center; gap: 0; }
.sw-ui { position: relative; top: 0; left: 0; flex: none; width: 44px; }
.sw-ui::after { transition: transform 0.15s; }
.sw-in:checked + .sw-ui::after { transform: translateX(20px); }
.sw-cap { font-size: 0.6875rem; font-weight: 700; color: var(--sub); line-height: 1.2; margin-top: 2px; }
.set-list li { padding: 0.25rem 0; flex-wrap: nowrap; }

/* 共有画像 */
.sum-share { margin-left: auto; }
.share-dlg { width: min(46rem, 94vw); padding: 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); }
.share-dlg::backdrop { background: rgba(0, 0, 0, 0.55); }
.share-cv { display: block; width: 100%; height: auto; border-radius: 6px; margin: 0.5rem 0; }
.share-act { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* カードの大きさをそろえる（いちばん高いものに合わせる） */
.cards { align-items: stretch; }
.cards li { display: flex; }
.card { height: 100%; align-content: start; }

/* 記録ボタンを押しやすく（高さ56px、幅は広め） */
.detail .k-btn { min-height: 56px; min-width: 68px; padding: 0.25rem 0.9rem; font-size: 1.125rem; }
.k-btns { gap: 0.5rem; }
.kind { padding: 0.6rem 0; }
@media (max-width: 30rem) {
  .kind { grid-template-columns: 1fr auto; row-gap: 0.5rem; }
  .k-btns { grid-column: 1 / -1; }
  .detail .k-btn { flex: 1; }
}

/* お好みのサブスクの色 */
.color-pick { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.color-pick legend { font-size: 0.875rem; font-weight: 700; padding: 0; margin-bottom: 0.2rem; }
.cp { position: relative; width: 44px; height: 44px; border-radius: 50%; cursor: pointer; display: block; }
.cp input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.cp:has(input:checked) { box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--ink); }
.cp:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 4px; }
.swatch-b { width: 44px; height: 44px; flex: none; border: 0; border-radius: 50%; cursor: pointer; }
.swatch-b:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* 色選びをわかりやすく: 「色」ボタン→パレットが開く。選んだ色にチェック */
.color-b { display: inline-flex; align-items: center; gap: 0.4rem; }
.color-b .dot { width: 18px; height: 18px; border-radius: 50%; display: inline-block; }
.set-list li.has-pick { flex-wrap: wrap; }
.row-pick { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0.25rem 0 0.6rem; }
.row-pick[hidden] { display: none; }
button.cp { border: 0; padding: 0; position: relative; }
.cp:has(input:checked)::after, .cp[aria-pressed="true"]::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 1.25rem; pointer-events: none; }
.cp[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--ink); }

/* ロゴ画像（黒1色。ダークモードでは白に反転） */
.top { align-items: center; }
.brand { line-height: 0; }
.logo { display: block; height: 1.75rem; width: auto; }
@media (min-width: 640px) { .logo { height: 2.1rem; } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo { filter: invert(1); } }
:root[data-theme="dark"] .logo { filter: invert(1); }

/* 空の状態（小さな線画つき） */
.empty { display: flex; align-items: center; gap: 1rem; padding: 0.75rem 0; color: var(--sub); }
.empty p { margin: 0; font-size: 0.9375rem; line-height: 1.7; max-width: 32em; }
.empty-art { flex: none; color: var(--ink); opacity: 0.55; }
.sum-empty.empty { padding: 0.75rem 0; }

/* 「月1,790円」は途中で折り返さない */
.dprice { white-space: nowrap; margin-left: 0.4em; }
