/* ゆなのツール箱 共通スタイル（theme.css の配色トークンを使う） */

.wrap { padding-bottom: 40px; overflow-x: hidden; }

/* ── ヘッダー ── */
.top {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.top-mark { width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: var(--primary-ink); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-family: var(--font-head); font-weight: 700; font-size: 16px; text-decoration: none; }
.top-title { font-size: 13px; font-weight: 700; line-height: 1.3; }
.top-sub { font-size: 10px; color: var(--ink-3); }
.top-btn { margin-left: auto; white-space: nowrap; text-decoration: none; font-size: 11px; font-weight: 700; color: var(--primary); background: var(--primary-soft); padding: 7px 12px; border-radius: 999px; border: none; cursor: pointer; font-family: inherit; }

/* ── 画面の切り替え ── */
.screen { display: none; }
.screen.active { display: block; animation: screenIn .35s ease both; }
@keyframes screenIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ── 表紙 ── */
.fv { position: relative; overflow: hidden; padding: 34px 22px 30px; background: linear-gradient(155deg, var(--hero-from) 0%, var(--hero-to) 100%); color: #fff; }
.fv::before { content: ''; position: absolute; left: -60px; top: -70px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,0.07); }
.fv::after { content: ''; position: absolute; right: -46px; bottom: -64px; width: 230px; height: 230px; border-radius: 50%; border: 30px solid rgba(255,255,255,0.10); }
.fv > * { position: relative; z-index: 1; }
.fv-badge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; background: var(--accent); color: #2b2111; padding: 4px 11px; border-radius: 999px; margin-bottom: 14px; }
.fv-title { font-family: var(--font-head); font-weight: 900; font-size: 33px; line-height: 1.28; margin-bottom: 12px; letter-spacing: 0.01em; }
.fv-title small { display: block; font-size: 17px; font-weight: 700; opacity: .92; margin-bottom: 4px; }
.fv-lead { font-size: 13.5px; line-height: 1.9; opacity: .96; }
.fv-art { margin: 18px auto 4px; display: block; width: 100%; max-width: 300px; height: auto; }
.fv-cta { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; margin-top: 20px; padding: 15px 18px; background: #fff; color: var(--ink); border: none; border-radius: var(--r); font: inherit; font-size: 15px; font-weight: 700; box-shadow: 0 8px 20px rgba(0,0,0,0.14); cursor: pointer; text-align: left; text-decoration: none; animation: nudge 3s ease-in-out 1.2s infinite; }
.fv-cta small { display: block; font-size: 10.5px; font-weight: 500; color: var(--ink-3); }
.fv-cta svg { width: 20px; height: 20px; color: var(--primary); flex-shrink: 0; }
@keyframes nudge { 0%, 88%, 100% { transform: none; } 92% { transform: translateY(-3px); } 96% { transform: translateY(1px); } }
.fv-resume { display: none; margin-top: 10px; text-align: center; }
.fv-resume.show { display: block; }
.fv-resume button { background: none; border: none; color: #fff; opacity: .9; font: inherit; font-size: 12px; text-decoration: underline; cursor: pointer; }
.fv-feats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 18px; list-style: none; }
.fv-feats li { background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.22); border-radius: var(--r-sm); padding: 10px 6px; text-align: center; font-size: 11px; font-weight: 700; line-height: 1.45; }
.fv-feats li b { display: block; font-family: var(--font-head); font-size: 18px; color: #fff3d6; line-height: 1.2; margin-bottom: 2px; }
.byline { padding: 12px 22px; font-size: 11px; color: var(--ink-2); border-bottom: 1px solid var(--line); background: var(--surface); }
.byline b { color: var(--ink); }

/* ── 進み具合 ── */
.prog { padding: 16px 20px 0; }
.prog-meta { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; font-weight: 700; color: var(--ink-3); }
.prog-meta b { font-family: var(--font-head); color: var(--primary); font-size: 14px; }
.prog-cat { font-size: 10.5px; color: var(--primary); background: var(--primary-soft); padding: 2px 10px; border-radius: 999px; }
.prog-track { height: 5px; background: var(--line); border-radius: 999px; margin-top: 8px; overflow: hidden; }
.prog-fill { height: 100%; background: var(--primary); border-radius: 999px; transition: width .3s ease; }

/* ── 入力ページ ── */
.page { padding: 18px 20px 24px; }
.step-label { display: inline-flex; align-items: center; gap: 8px; font-size: 10px; font-weight: 700; letter-spacing: 0.16em; color: var(--primary); margin-bottom: 6px; }
.step-label::before { content: ''; width: 18px; height: 2px; background: var(--primary); }
.page-title { font-family: var(--font-head); font-weight: 700; font-size: 22px; line-height: 1.45; margin-bottom: 8px; }
.page-lead { font-size: 13px; color: var(--ink-2); line-height: 1.8; margin-bottom: 4px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-top: 14px; }
.card-q { font-size: 15px; font-weight: 700; line-height: 1.55; }
.card-hint { font-size: 12px; color: var(--ink-2); line-height: 1.75; margin-top: 4px; }
.card-hint b { color: var(--primary); }

/* 選択肢（ラジオ風） */
.opts { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.opt { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer; background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: var(--r); padding: 13px 14px; color: var(--ink); font: inherit; transition: border-color .12s, background .12s; }
.opt:active, .opt.on { border-color: var(--primary); background: var(--primary-soft); }
.opt-dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-strong); flex-shrink: 0; transition: border .12s; }
.opt.on .opt-dot { border: 6px solid var(--primary); }
.opt.sq .opt-dot { border-radius: 6px; }
.opt.sq.on .opt-dot { border: 2px solid var(--primary); background: var(--primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 11' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1.5 5.5 5 9 12.5 1.5'/%3E%3C/svg%3E") center/12px no-repeat; }
.opt-main { font-size: 14.5px; font-weight: 700; line-height: 1.45; }
.opt-sub { display: block; font-size: 11.5px; color: var(--ink-2); font-weight: 500; margin-top: 1px; }

/* チップ */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { font: inherit; font-size: 12.5px; font-weight: 700; padding: 8px 13px; border-radius: 999px; border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--ink-2); cursor: pointer; }
.chip.on { border-color: var(--primary); background: var(--primary); color: #fff; }

/* 数字・セレクト */
.field { margin-top: 12px; }
.field-l { display: block; font-size: 12px; font-weight: 700; color: var(--ink-2); margin-bottom: 5px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
select, .inp { width: 100%; font: inherit; font-size: 16px; font-weight: 700; color: var(--ink); background: var(--bg); border: 1.5px solid var(--line-strong); border-radius: var(--r-sm); padding: 10px 12px; }
select:focus, .inp:focus { outline: none; border-color: var(--primary); background: var(--surface); }
.inp-wrap { display: flex; align-items: center; gap: 8px; }
.inp-wrap .inp { text-align: right; flex: 1; min-width: 0; }
.inp::placeholder { color: var(--ink-3); opacity: .45; font-weight: 500; }
.unit { font-size: 13px; color: var(--ink-2); font-weight: 700; white-space: nowrap; }
.help { margin-top: 10px; border-top: 1px dashed var(--line-strong); padding-top: 8px; }
.help summary { font-size: 12px; font-weight: 700; color: var(--primary); cursor: pointer; list-style: none; }
.help summary::-webkit-details-marker { display: none; }
.help summary::before { content: '＋ '; }
.help[open] summary::before { content: '－ '; }
.help-body { font-size: 12px; color: var(--ink-2); line-height: 1.8; margin-top: 6px; }
.help-body p + p { margin-top: 6px; }
.help-body b { color: var(--ink); }
.sub-block { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px; margin-top: 10px; }
.sub-block-h { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.mini-btn { font: inherit; font-size: 11px; font-weight: 700; color: var(--ink-3); background: none; border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px 10px; cursor: pointer; }
.add-btn { width: 100%; margin-top: 10px; font: inherit; font-size: 13px; font-weight: 700; color: var(--primary); background: var(--surface); border: 1.5px dashed var(--primary); border-radius: var(--r-sm); padding: 10px; cursor: pointer; }
.add-btn[disabled] { opacity: .4; cursor: default; }

/* 下の固定ボタン */
.navbar { position: sticky; bottom: 0; z-index: 40; display: flex; gap: 10px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 30%); }
.nav-back, .nav-next { font: inherit; font-weight: 700; border-radius: 999px; padding: 14px; cursor: pointer; }
.nav-back { flex: 0 0 96px; background: var(--surface); color: var(--ink-2); border: 1.5px solid var(--line-strong); font-size: 14px; }
.nav-next { flex: 1; background: var(--primary); color: #fff; border: none; font-size: 15px; box-shadow: 0 6px 16px rgba(201,103,122,0.30); }
.nav-next[disabled] { opacity: .45; box-shadow: none; cursor: default; }

/* いまの見込み（上に固定） */
.live { position: sticky; top: 55px; z-index: 30; margin: 0 -20px; padding: 10px 20px; background: color-mix(in srgb, var(--accent-soft) 94%, transparent); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 700; color: var(--ink-2); }
.live b { font-family: var(--font-head); font-size: 19px; color: var(--primary); }

/* ── 結果 ── */
.r-hero { position: relative; overflow: hidden; background: linear-gradient(150deg, var(--hero-from), var(--hero-to)); color: #fff; padding: 28px 22px 26px; text-align: center; }
.r-hero::after { content: ''; position: absolute; right: -50px; top: -60px; width: 190px; height: 190px; border-radius: 50%; border: 26px solid rgba(255,255,255,0.09); }
.r-hero > * { position: relative; z-index: 1; }
.r-hero-l { font-size: 12.5px; font-weight: 700; opacity: .92; letter-spacing: .04em; }
.r-hero-v { font-family: var(--font-head); font-weight: 900; font-size: 46px; line-height: 1.15; margin: 8px 0 4px; }
.r-hero-v small { font-size: 18px; font-weight: 700; }
.r-hero-s { font-size: 12.5px; opacity: .92; line-height: 1.7; }
.r-hero-tag { display: inline-block; margin-top: 12px; background: #fff; color: var(--primary); font-weight: 700; font-size: 13px; padding: 6px 16px; border-radius: 999px; }
.r-body { padding: 4px 20px 0; }
.r-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 16px; margin-top: 16px; }
.r-card h3 { font-family: var(--font-head); font-weight: 700; font-size: 17px; line-height: 1.45; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.r-card h3::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); flex-shrink: 0; }
.r-card .card-hint { margin-bottom: 8px; }
.kv { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 9px 0; border-top: 1px dashed var(--line-strong); font-size: 13px; color: var(--ink-2); }
.kv:first-of-type { border-top: none; }
.kv b { color: var(--ink); font-size: 15px; white-space: nowrap; }
.kv.total { border-top: 1.5px solid var(--ink-3); font-weight: 700; color: var(--ink); }
.kv.total b { color: var(--primary); font-size: 18px; font-family: var(--font-head); }
.kv small { display: block; font-size: 11px; color: var(--ink-3); }
.bar { height: 14px; background: var(--line); border-radius: 999px; overflow: hidden; display: flex; margin-top: 6px; }
.bar i { display: block; height: 100%; transition: width .6s cubic-bezier(.2,.7,.2,1); }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 11px; color: var(--ink-2); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.alert { margin-top: 16px; border-radius: var(--r-sm); padding: 12px 14px; font-size: 12.5px; line-height: 1.8; background: var(--warn-soft); color: var(--ink); }
.alert b { color: var(--warn); }
.tbl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-top: 10px; }
.tbl-scroll .tbl { min-width: 100%; white-space: nowrap; margin: 0; }
.chart svg { display: block; width: 100%; height: auto; }

/* ゆなメモ（theme.css の .yuna をそのまま使う） */
.yuna-face { background: var(--primary); }

/* 次の一歩 */
.next { margin-top: 18px; background: var(--accent-soft); border-radius: var(--r); padding: 20px 18px; text-align: center; }
.next-k { font-size: 10px; font-weight: 700; letter-spacing: .16em; color: var(--accent); }
.next h3 { font-family: var(--font-head); font-size: 18px; line-height: 1.5; margin: 6px 0 8px; }
.next p { font-size: 12.5px; color: var(--ink-2); line-height: 1.85; }
.next-btn { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 14px; padding: 14px; background: var(--primary); color: #fff; border-radius: 999px; text-decoration: none; font-weight: 700; font-size: 14.5px; box-shadow: 0 6px 16px rgba(201,103,122,0.28); }
.next-btn.sub { background: var(--surface); color: var(--primary); border: 1.5px solid var(--primary); box-shadow: none; }
.next-btn svg { width: 18px; height: 18px; }
.retry { display: block; margin: 18px auto 0; font: inherit; font-size: 13px; font-weight: 700; color: var(--ink-2); background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: 999px; padding: 10px 24px; cursor: pointer; }

/* 前提・フッター */
.premise { margin-top: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; }
.premise summary { font-size: 12.5px; font-weight: 700; color: var(--ink-2); cursor: pointer; }
.premise ul { padding-left: 1.2em; margin-top: 8px; font-size: 11.5px; color: var(--ink-2); line-height: 1.85; }
.premise li + li { margin-top: 4px; }
.premise b { color: var(--ink); }
.foot { margin-top: 24px; padding: 20px; text-align: center; font-size: 11px; color: var(--ink-3); line-height: 1.8; }
.foot a { color: var(--ink-2); }
.foot-name { font-family: var(--font-head); font-size: 13px; font-weight: 700; color: var(--ink-2); }

/* 画面に入ったらふわっと */
.js .rv { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s cubic-bezier(.2,.7,.2,1); }
.js .rv.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .screen.active, .fv-cta { animation: none; }
  .js .rv { opacity: 1; transform: none; transition: none; }
}
.hide { display: none !important; }
