/* TestLoop：あたたかい紙色＋ティール（メイン）＋コーラル（差し色）。
   ウェブコレ掲載サイトの共通点（生成りの地／メイン1色＋暖色の差し色／ピル型ボタン／英字ラベル付きの見出し／数字のバッジ）をもとにした。 */
:root {
  --ground: #f7f3eb; --card: #ffffff; --ink: #333333; --muted: #6f6a60; --line: #e4dccb; --line2: #cfc5b0;
  --main: #2b8f7c; --main-d: #1f7364; --main-bg: #e6f3ee; --accent: #e0674d; --accent-d: #c9553c; --accent-bg: #fcebe5; --mark: #ffe58a;
  --ok: #2b7a43; --okbg: #e6f3ea; --warn: #94590a; --warnbg: #fdf1d2; --bad: #b3261e; --badbg: #fbe4df; --info: #1f5f93; --infobg: #e5eef6;
  --radius: 15px; --nav-h: 58px;
  --round: 'Hiragino Maru Gothic ProN', 'Hiragino Sans', 'BIZ UDPGothic', 'Yu Gothic UI', 'Meiryo', sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 16px/1.8 'Yu Gothic UI', 'Hiragino Sans', 'Noto Sans JP', 'Meiryo', system-ui, sans-serif; letter-spacing: .02em; }
a { color: var(--info); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--round); font-weight: 700; line-height: 1.5; letter-spacing: .04em; }
h1 { font-size: 1.6rem; margin: .1rem 0 .7rem; }
h2 { font-size: 1.3rem; margin: 1.2rem 0 .5rem; }
h3 { font-size: 1.05rem; margin: 0 0 .3rem; }
ul, ol { padding-left: 1.3em; margin: .4em 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.wrap { max-width: 720px; margin: 0 auto; padding: 8px 18px calc(var(--nav-h) + 44px + env(safe-area-inset-bottom)); }
.muted { color: var(--muted); font-size: .9rem; }
.center { text-align: center; }

/* ---- 英字ラベル＋2色の短い線（見出し） ---- */
.en { font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif; font-size: .74rem; font-weight: 700; letter-spacing: .22em; color: var(--main); text-transform: uppercase; margin: 14px 0 0; line-height: 1.4; }
.rule { display: flex; height: 4px; width: 56px; margin: 6px 0 12px; border-radius: 2px; overflow: hidden; }
.rule::before { content: ''; flex: 2; background: var(--main); }
.rule::after { content: ''; flex: 1; background: var(--accent); }
.ttl h1, .ttl h2 { margin: 2px 0 0; }

/* ---- 上のバー ---- */
.logo { width: 30px; height: 30px; flex: none; }
header.top { background: var(--card); border-bottom: 3px solid var(--main); padding: 11px 18px; position: sticky; top: 0; z-index: 5; }
header.top .row { max-width: 720px; margin: 0 auto; flex-wrap: nowrap; justify-content: space-between; }
header.top .brand { padding-bottom: 3px; font-family: var(--round); font-weight: 800; display: flex; align-items: center; gap: 8px; font-size: 1.15rem; line-height: 1.4; letter-spacing: .04em; color: var(--ink); }
header.top .who { font-size: .8rem; color: var(--main-d); background: var(--main-bg); padding: 3px 12px; border-radius: 50px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 50%; font-weight: 700; }

/* ---- メニュー：スマホは下の固定バー、広い画面は上 ---- */
nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: var(--card); border-top: 1px solid var(--line2); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); }
nav.tabs .in { max-width: 720px; margin: 0 auto; display: flex; gap: 4px; }
nav.tabs button { flex: 1 1 0; min-width: 0; background: none; border: 0; padding: 4px 2px; font: inherit; font-size: .74rem; line-height: 1.3; color: var(--muted); cursor: pointer; min-height: 44px; border-radius: 50px; display: flex; align-items: center; justify-content: center; text-align: center; position: relative; }
nav.tabs button svg { display: none; }
nav.tabs button.on { background: var(--main); color: #fff; font-weight: 700; }
nav.tabs button .dotbadge { margin-left: 3px; min-width: 18px; height: 18px; border-radius: 50%; background: var(--accent); color: #fff; font-size: .68rem; font-weight: 700; display: inline-grid; place-items: center; padding: 0 4px; }
nav.tabs button.on .dotbadge { background: #fff; color: var(--accent-d); }
@media (min-width: 760px) {
  nav.tabs { position: sticky; top: 52px; bottom: auto; border-top: 0; border-bottom: 1px solid var(--line2); padding: 6px 12px; }
  nav.tabs .in { gap: 6px; }
  nav.tabs button { flex: 0 0 auto; padding: 6px 18px; font-size: .95rem; }
  .wrap { padding-bottom: 80px; }
}

/* ---- 部品 ---- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 16px 0; }
.card.soft { background: transparent; border: 2px dashed var(--line2); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1 1 auto; }
.btn { appearance: none; border: 2px solid var(--main); background: var(--main); color: #fff; border-radius: 50px; padding: 9px 22px; font: inherit; font-weight: 700; cursor: pointer; min-height: 46px; letter-spacing: .04em; }
.btn:hover { background: var(--main-d); border-color: var(--main-d); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: var(--card); color: var(--main-d); }
.btn.ghost:hover { background: var(--main-bg); }
.btn.ok { background: var(--accent); border-color: var(--accent); }
.btn.ok:hover { background: var(--accent-d); border-color: var(--accent-d); }
.btn.bad { background: var(--card); color: var(--bad); border-color: var(--bad); }
.btn.bad:hover { background: var(--badbg); }
.btn.small { padding: 4px 14px; min-height: 38px; font-size: .86rem; }
.btn.big { width: 100%; min-height: 58px; font-size: 1.1rem; font-family: var(--round); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.big.ghost[disabled] { opacity: 1; color: var(--ok); border-color: var(--ok); background: var(--okbg); }
.badge { display: inline-block; font-size: .76rem; font-weight: 700; padding: 1px 12px; border-radius: 50px; background: var(--infobg); color: var(--info); line-height: 1.7; }
.badge.ok { background: var(--okbg); color: var(--ok); }
.badge.warn { background: var(--warnbg); color: var(--warn); }
.badge.bad { background: var(--badbg); color: var(--bad); }
.badge.gray { background: #ece7da; color: var(--muted); }
.pill { display: inline-block; font-size: .8rem; font-weight: 700; color: var(--main-d); background: var(--mark); padding: 2px 14px; border-radius: 50px; }

/* 進み具合のバー */
.bar { height: 12px; border-radius: 50px; background: #ece7da; overflow: hidden; margin: 8px 0 4px; }
.bar > i { display: block; height: 100%; border-radius: 50px; background: var(--main); min-width: 12px; }
.bar.warn > i { background: #d98a1f; }
.bar-label { display: flex; justify-content: space-between; font-size: .84rem; color: var(--muted); }

/* スタンプカード（14日） */
.dots { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 12px 0; max-width: 420px; }
.dot { aspect-ratio: 1 / 1; border: 2px dashed var(--line2); border-radius: 50%; font-size: .72rem; display: grid; place-items: center; color: var(--line2); position: relative; background: #fff; font-weight: 700; }
.dot.done { border: 2px solid var(--accent); background: var(--accent-bg); color: transparent; }
.dot.done::after { content: '済'; position: absolute; inset: 0; display: grid; place-items: center; color: var(--accent-d); font-family: var(--round); font-weight: 800; font-size: 1.05rem; transform: rotate(-8deg); }
.dot.done:nth-child(2n)::after { transform: rotate(6deg); }
.dot.today { border: 2px solid var(--main); background: var(--main-bg); color: var(--main-d); }
.dot.miss { border: 2px solid var(--bad); background: var(--badbg); color: var(--bad); }
.dot.future { background: transparent; border-color: var(--line); }

/* 数字のタイル */
.tiles { display: flex; gap: 10px; margin: 10px 0; }
.tile { flex: 1 1 0; padding: 10px 14px; background: var(--ground); border-radius: 12px; text-align: left; }
.tile b { display: block; font-family: var(--round); font-size: 1.7rem; line-height: 1.3; color: var(--ink); }
.tile span { font-size: .78rem; color: var(--muted); }
.tile.ok { background: var(--main-bg); } .tile.ok b { color: var(--main-d); }
.tile.warn { background: var(--warnbg); } .tile.warn b { color: var(--warn); }

.empty { text-align: center; padding: 24px 16px; border: 2px dashed var(--line2); background: transparent; }
.empty svg { display: none; }
.empty p { margin: .3em 0; }

/* フォーム */
label { display: block; font-weight: 700; margin: 14px 0 4px; font-size: .92rem; }
input[type=text], input[type=email], input[type=url], input[type=number], input[type=password], textarea, select { width: 100%; font: inherit; padding: 10px 14px; border: 2px solid var(--line); border-radius: 12px; background: #fff; min-height: 48px; color: var(--ink); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--main); box-shadow: 0 0 0 3px var(--main-bg); }
input[type=checkbox] { width: 18px; height: 18px; vertical-align: -3px; accent-color: var(--main); }
textarea { min-height: 92px; }
.hint { color: var(--muted); font-size: .84rem; margin: 3px 0 0; }
.msg { padding: 10px 14px; margin: 12px 0; font-size: .92rem; border-radius: 12px; }
.msg.info { background: var(--infobg); color: #17466e; }
.msg.warn { background: var(--warnbg); color: #6d4300; }
.msg.ok { background: var(--okbg); color: #1d5a31; }
.msg.bad { background: var(--badbg); color: #7a1912; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: .92rem; }
.kv b { color: var(--muted); font-weight: 600; }
.list-sep { border-top: 1px dashed var(--line2); margin: 12px 0; }
table.t { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.t th, table.t td { border-bottom: 1px solid var(--line); padding: 7px 6px; text-align: left; vertical-align: top; }
table.t th { color: var(--main-d); font-weight: 700; font-size: .8rem; }
.scroll-x { overflow-x: auto; }
pre.copy { background: var(--ground); border-radius: 12px; padding: 12px; white-space: pre-wrap; font: inherit; font-size: .88rem; }

/* ---- モーダル・トースト ---- */
.overlay { position: fixed; inset: 0; background: rgba(51, 45, 36, .5); display: flex; align-items: flex-end; justify-content: center; z-index: 20; }
.modal { background: var(--card); width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; border-radius: 24px 24px 0 0; padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); }
@media (min-width: 640px) { .overlay { align-items: center; } .modal { border-radius: 24px; } }
#toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 20px; border-radius: 50px; font-size: .92rem; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 30; max-width: 92vw; }
#toast.show { opacity: .97; }
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { width: 30px; height: 30px; border: 4px solid var(--line); border-top-color: var(--main); border-radius: 50%; margin: 3rem auto 0; animation: spin .8s linear infinite; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---- ログイン前の画面 ---- */
.lp-top { background: var(--card); border-bottom: 3px solid var(--main); padding: 11px 18px; }
.lp-top .in { max-width: 720px; margin: 0 auto; display: flex; align-items: center; gap: 8px; font-family: var(--round); font-weight: 800; font-size: 1.15rem; letter-spacing: .04em; }
.hero { padding: 26px 18px 30px; background: var(--ground); }
.hero .in { max-width: 720px; margin: 0 auto; display: grid; gap: 8px; }
@media (min-width: 700px) { .hero .in { grid-template-columns: 1.15fr .85fr; align-items: center; gap: 24px; } }
.hero h1 { font-size: 1.65rem; line-height: 1.6; margin: .6rem 0; word-break: keep-all; overflow-wrap: anywhere; }
@media (min-width: 560px) { .hero h1 { font-size: 2rem; } }
.hero h1 em { font-style: normal; background: linear-gradient(transparent 62%, var(--mark) 62%); }
.hero p { margin: .5rem 0; }
.hero .btn { max-width: 400px; }
.art { width: 100%; max-width: 280px; margin: 0 auto; display: block; }
.badges { display: flex; gap: 10px; justify-content: flex-start; margin: 14px 0; }
.badge-round { width: 86px; height: 86px; border-radius: 50%; border: 2.5px solid var(--main); background: var(--card); display: grid; place-content: center; text-align: center; line-height: 1.2; }
.badge-round b { font-family: var(--round); font-size: 1.45rem; color: var(--main-d); }
.badge-round span { font-size: .7rem; color: var(--muted); }
.badge-round:nth-child(2) { border-color: var(--accent); } .badge-round:nth-child(2) b { color: var(--accent-d); }
.badge-round:nth-child(3) { border-color: #d9a400; } .badge-round:nth-child(3) b { color: #8a6a00; }
.entry { display: grid; gap: 14px; margin: 14px 0; }
@media (min-width: 560px) { .entry { grid-template-columns: 1fr 1fr; } }
.entry .card { margin: 0; border-top: 6px solid var(--main); }
.entry .card:nth-child(2) { border-top-color: var(--accent); }
.entry .card h3 { font-size: 1.1rem; }
.steps { list-style: none; padding: 0; margin: 10px 0; counter-reset: s; }
.steps li { counter-increment: s; position: relative; padding: 2px 0 16px 50px; margin: 0; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 36px; height: 36px; border-radius: 50%; background: var(--main); color: #fff; font-family: var(--round); font-weight: 800; display: grid; place-items: center; }
.steps li:nth-child(2)::before { background: var(--accent); } .steps li:nth-child(3)::before { background: #d9a400; }
.checks { list-style: none; padding: 0; }
.checks li { position: relative; padding-left: 1.7em; margin: .5em 0; }
.checks li::before { content: ''; position: absolute; left: 0; top: .5em; width: 1em; height: 1em; border-radius: 50%; background: var(--main-bg); }
.checks li::after { content: ''; position: absolute; left: .3em; top: .68em; width: .45em; height: .24em; border-left: 2.5px solid var(--main-d); border-bottom: 2.5px solid var(--main-d); transform: rotate(-45deg); }
.checks.no li::before { background: #ece7da; }
.checks.no li::after { content: '×'; border: 0; transform: none; left: .22em; top: .08em; width: auto; height: auto; color: var(--muted); font-size: .85em; font-weight: 700; }
.cta-end { padding: 8px 0; text-align: center; }
.cta-end .btn { max-width: 400px; }
.speech { display: inline-block; position: relative; background: var(--mark); color: var(--ink); font-size: .82rem; font-weight: 700; padding: 2px 14px; border-radius: 50px; margin-bottom: 10px; }
.speech::after { content: ''; position: absolute; left: 22px; bottom: -6px; border: 6px solid transparent; border-top-color: var(--mark); border-bottom: 0; }

/* ---- 今日のまとめ ---- */
.today { background: var(--accent-bg); border-color: #f2c7bb; }
.today .big { font-family: var(--round); font-size: 2rem; font-weight: 800; color: var(--accent-d); line-height: 1.2; }
.today.done { background: var(--main-bg); border-color: #b7dccf; } .today.done .big { color: var(--main-d); }
