/* ohana おしごと整理室（仮称） v4
   方向：スマホのアプリとして作る。色と動きは MOTION ATLAS（動きの図鑑）のアプリ画面にそろえる
   （紺 #0A1633・青 #2A5BFF・夕日 #E8572E・紙 #F6F7FA、角は丸く、イージングは cubic-bezier(.22,1,.36,1)）。
   使う動き：サークルリビール／スライドトランジション／スティッキーヘッダー／タブの印／セグメントコントロール／
   ボトムシート／プレスフィードバック／リップル／チェックボックスの線／プログレスバーとリング／
   サクセスチェックマーク／カウントアップ／スタッガー／ラインリビール／スクロールリビール／紙吹雪／スナックバー。
   入力欄と表の数字は動かさない。動きを減らす設定の端末では止める。 */

:root {
  /* 暗い画面。文字は白、面は濃い灰色、目印の色は朱色（コーラルレッド）。書類の紙だけは白のまま。 */
  --bg: #141414;
  --ink: #ffffff;
  --ink-2: #e5e5e5;
  --sub: #b3b3b3;
  --label: #8c8c8c;
  --line: #333333;
  --line-2: #595959;
  --paper: #141414;
  --surface: #1f1f1f;
  --card: #2a2a2a;
  --hover: #333333;
  --solid: #ffffff;
  --on-solid: #141414;
  --blue: #ff5a36;
  --blue-ink: #ff8266;
  --blue-soft: rgba(255, 90, 54, 0.18);
  --sun: #ffb020;
  --sun-soft: rgba(255, 176, 32, 0.16);
  --mint: #46d369;
  --mint-soft: rgba(70, 211, 105, 0.16);
  --amber: #ffb020;
  --amber-soft: rgba(255, 176, 32, 0.16);
  --grape: #b39dff;
  --grape-soft: rgba(179, 157, 255, 0.18);
  --stop: #ff5c5c;
  --stop-soft: rgba(255, 92, 92, 0.16);
  --r-s: 6px;
  --r: 8px;
  --r-l: 10px;
  --nav-w: 0px;
  --aside-w: 400px;
  --top-h: 68px;
  --tab-h: 66px;
  --shadow-1: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 14px 36px rgba(0, 0, 0, 0.7);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --font: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", system-ui, sans-serif;
  --num: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", "Hiragino Sans", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Hiragino Sans", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top-h) + 16px); -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.7;
  -webkit-font-smoothing: antialiased; letter-spacing: 0.02em;
  display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr); grid-template-rows: var(--top-h) 1fr;
  grid-template-areas: "nav top" "nav main"; min-height: 100dvh;
}
body.has-doc { grid-template-columns: var(--nav-w) minmax(0, 1fr) var(--aside-w); grid-template-areas: "nav top top" "nav main aside"; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote, fieldset, pre { margin: 0; padding: 0; }
ul, ol { list-style: none; }
fieldset { border: 0; min-width: 0; }
a { color: var(--blue); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
table { border-collapse: collapse; width: 100%; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.muted { color: var(--sub); }
.nowrap { white-space: nowrap; }
.en { font-family: var(--num); font-weight: 800; letter-spacing: 0.12em; font-size: 11px; }
:focus-visible { outline: 3px solid rgba(42, 91, 255, 0.45); outline-offset: 2px; border-radius: 10px; }
main:focus, h1:focus { outline: none; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 60; background: var(--solid); color: #fff; padding: 10px 16px; border-radius: 12px; }
.skip:focus { top: 8px; }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes grow-y { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes pop { 0% { transform: scale(0.5); } 60% { transform: scale(1.14); } 100% { transform: scale(1); } }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(0.75); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes line-reveal { from { clip-path: inset(0 0 100% 0); transform: translateY(0.45em); } to { clip-path: inset(-12% 0 -12% 0); transform: none; } }
@keyframes push-fwd { from { opacity: 0; transform: translateX(42px); } to { opacity: 1; transform: none; } }
@keyframes push-back { from { opacity: 0; transform: translateX(-42px); } to { opacity: 1; transform: none; } }
@keyframes ripple { to { transform: scale(1); opacity: 0; } }
@keyframes sheet { from { transform: translateY(100%); } to { transform: none; } }
@keyframes dlg { from { opacity: 0; transform: translateY(16px) scale(0.97); } to { opacity: 1; transform: none; } }

/* =========================================================
   アプリの枠：左のサイドバー（広い画面）／下のタブ（スマホ）
   ========================================================= */
.nav {
  grid-area: nav; position: sticky; top: 0; align-self: start; height: 100dvh; padding: 16px 14px;
  display: flex; flex-direction: column; gap: 18px; background: var(--surface); border-right: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 800; min-height: 44px; }
.brand-mark { width: 32px; height: 32px; flex: none; filter: drop-shadow(0 4px 10px rgba(42, 91, 255, 0.3)); }
.nav .nav-brand { padding: 4px 8px 14px; border-bottom: 1px solid var(--line); }
.nav-brand .brand-mark { width: 40px; height: 40px; }
.brand-text { display: grid; line-height: 1.25; }
.brand-sub { font-size: 10.5px; font-weight: 800; letter-spacing: 0.18em; color: var(--blue); text-transform: uppercase; }
.nav-brand .brand-name { font-size: 16px; }
.brand-tag { font-size: 10.5px; font-weight: 700; color: var(--sub); border: 1px solid var(--line-2); border-radius: 6px; padding: 0 6px; line-height: 1.7; margin-left: auto; }
.tabbar { position: relative; display: grid; gap: 4px; flex: 1; align-content: start; }
.tabbar a, .nav-sub { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 14px; border-radius: 14px; color: var(--sub); text-decoration: none; font-weight: 700; transition: color 240ms ease; }
.tabbar svg, .nav-sub svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; transition: transform 300ms var(--spring); }
.tabbar a:hover, .nav-sub:hover { color: var(--ink); }
.tabbar a.on { color: var(--blue-ink); }
.tabbar a.on svg { transform: scale(1.1); }
.nav-sub.on { color: var(--blue-ink); background: var(--blue-soft); }
/* 選んだタブの後ろの面が、次のタブまで滑って動く（タブの図鑑の下線と同じ考え方） */
.tab-ind { position: absolute; left: 0; top: 0; width: var(--w, 0); height: var(--h, 0); transform: translate(var(--x, 0), var(--y, 0)); background: var(--blue-soft); border-radius: 14px; pointer-events: none; transition: transform 420ms var(--ease), width 420ms var(--ease), height 420ms var(--ease), opacity 200ms ease; opacity: 0; z-index: 0; }

/* 上のバー：大きな見出しが隠れると、小さな見出しが出る（スティッキーヘッダー） */
.topbar { grid-area: top; position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 28px; background: transparent; transition: box-shadow 240ms ease, background-color 240ms ease; }
@supports (backdrop-filter: blur(12px)) { .topbar { backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px); background: transparent; } }
.topbar.is-shadow { box-shadow: 0 1px 0 var(--line); }
.topbar .brand { display: none; }
.bar-title { flex: 1; min-width: 0; font-weight: 800; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transform: translateY(8px); transition: opacity 260ms ease, transform 320ms var(--ease); }
.topbar.is-titled .bar-title { opacity: 1; transform: none; }
.save-status { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--sub); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px 5px 10px; white-space: nowrap; }
.save-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); flex: none; }
.save-status.saving .dot { background: var(--blue); animation: pulse 900ms ease-in-out infinite; }
.save-status.failed, .save-status.conflict { color: var(--stop); border-color: #f2b9b2; white-space: normal; border-radius: 14px; }
.save-status.failed .dot, .save-status.conflict .dot { background: var(--stop); }
.link-btn { background: none; border: 0; padding: 4px 2px; color: var(--blue); text-decoration: underline; cursor: pointer; min-height: 32px; font-weight: 700; }

/* =========================================================
   本文と画面の切り替え
   ========================================================= */
main { grid-area: main; min-width: 0; padding: 12px 36px 0; position: relative; }
.page { max-width: 760px; margin: 0 auto; padding-bottom: 110px; }
.page.wide { max-width: 1080px; }
.page.home { max-width: 940px; }
.page > * { animation: rise 460ms var(--ease) both; }
.page > *:nth-child(2) { animation-delay: 50ms; }
.page > *:nth-child(3) { animation-delay: 100ms; }
.page > *:nth-child(4) { animation-delay: 150ms; }
.page > *:nth-child(n+5) { animation-delay: 200ms; }
.case-body > * { animation: push-fwd 420ms var(--ease) both; }
.case-body > *:nth-child(2) { animation-delay: 30ms; }
.case-body > *:nth-child(3) { animation-delay: 60ms; }
.case-body > *:nth-child(4) { animation-delay: 90ms; }
.case-body > *:nth-child(n+5) { animation-delay: 120ms; }
main[data-dir="back"] .case-body > * { animation-name: push-back; }
.page > .case-body, .page > .case-foot, .page.still > *, .page.still .case-body > * { animation: none; }
h1 { font-size: 32px; line-height: 1.3; font-weight: 800; letter-spacing: 0.01em; margin-bottom: 10px; text-wrap: balance; }
.page h1, .case-body h1 { animation: line-reveal 640ms var(--ease) both; }
h2 { font-size: 20px; line-height: 1.5; font-weight: 800; margin: 38px 0 12px; }
h3 { font-size: 16px; font-weight: 800; margin: 26px 0 10px; }
h4 { font-size: 12.5px; font-weight: 800; margin: 16px 0 6px; color: var(--sub); letter-spacing: 0.06em; }
.lead { color: var(--sub); margin-bottom: 24px; max-width: 40em; font-size: 16px; }
.lead.small { margin-bottom: 10px; font-size: 15px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 800; color: var(--blue); margin-bottom: 8px; letter-spacing: 0.06em; }
.crumb { font-size: 13px; color: var(--sub); margin-bottom: 12px; }
.crumb a { color: var(--sub); }

/* =========================================================
   ボタン：押すと沈む（プレスフィードバック）＋押した所から波紋（リップル）
   ========================================================= */
.btn {
  position: relative; overflow: hidden; isolation: isolate; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  font-weight: 700; font-size: 15px; line-height: 1.3; text-decoration: none; cursor: pointer; text-align: center; user-select: none;
  transition: transform 120ms ease-out, background-color 200ms ease, box-shadow 200ms ease, border-color 200ms ease, opacity 200ms ease;
}
.btn:hover { background: var(--hover); border-color: var(--ink-2); }
.btn:active { transform: scale(0.96); }
.btn svg { transition: transform 260ms var(--spring); }
.btn:hover svg { transform: translateX(3px); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 8px 20px rgba(42, 91, 255, 0.32); }
.btn.primary:hover { background: var(--blue-ink); border-color: var(--blue-ink); box-shadow: 0 12px 26px rgba(42, 91, 255, 0.38); }
.btn.danger { background: var(--stop); border-color: var(--stop); color: #fff; }
.btn.ghost-danger { color: var(--stop); border-color: #f2c4be; margin-right: auto; }
.btn.small { min-height: 38px; padding: 0 14px; font-size: 14px; border-radius: 11px; }
.btn[disabled], .btn[data-busy] { opacity: 0.55; cursor: default; transform: none; }
.icon-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; border: 0; background: var(--paper); border-radius: 50%; cursor: pointer; color: var(--sub); transition: background-color 160ms ease, transform 120ms ease-out; }
.icon-btn:hover { background: var(--line); color: var(--ink); }
.icon-btn:active { transform: scale(0.9); }
.ripple { position: absolute; border-radius: 50%; pointer-events: none; background: currentColor; opacity: 0.18; transform: scale(0); animation: ripple 620ms ease-out forwards; z-index: -1; }
.btn.primary .ripple { background: #fff; opacity: 0.35; }

/* =========================================================
   入力
   ========================================================= */
.field { display: grid; gap: 6px; margin: 0 0 18px; min-width: 0; align-content: start; }
.field > label, .choices > legend, .seg > legend { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tag-opt, .tag-req { font-size: 11px; font-weight: 700; border-radius: 6px; padding: 0 7px; line-height: 1.8; }
.tag-opt { color: var(--sub); background: var(--card); }
.tag-req { color: #fff; background: var(--sun); }
.input { width: 100%; min-height: 50px; padding: 11px 14px; border: 1.5px solid var(--line-2); border-radius: var(--r-s); background: var(--surface); font-size: 16px; line-height: 1.5; appearance: none; -webkit-appearance: none; transition: border-color 160ms ease, box-shadow 160ms ease; }
.input:hover { border-color: var(--line-2); }
.input:focus-visible { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(42, 91, 255, 0.16); border-radius: var(--r-s); }
select.input { padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235c6785' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; }
textarea.input { resize: vertical; min-height: 90px; }
input[type="file"].input { padding: 11px 12px; }
.input[aria-invalid="true"] { border-color: var(--stop); box-shadow: 0 0 0 4px rgba(210, 59, 42, 0.12); }
.input::placeholder { color: var(--label); }
.field-hint { font-size: 13px; color: var(--sub); line-height: 1.65; }
.field-error { font-size: 14px; color: var(--stop); font-weight: 700; animation: rise 260ms var(--ease) both; }
.q-error { margin: 4px 0 14px; }

/* 選択肢：大きな押せるカード。上から順に出て（スタッガー）、選ぶと線でチェックが描かれる */
.choices { display: grid; gap: 10px; margin: 0 0 18px; }
.choices > legend { margin-bottom: 8px; padding: 0; }
.choices.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choices.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choices > .choice { animation: rise 460ms var(--ease) both; }
.choices > .choice:nth-of-type(1) { animation-delay: 80ms; }
.choices > .choice:nth-of-type(2) { animation-delay: 130ms; }
.choices > .choice:nth-of-type(3) { animation-delay: 180ms; }
.choices > .choice:nth-of-type(4) { animation-delay: 230ms; }
.choices > .choice:nth-of-type(5) { animation-delay: 280ms; }
.choices > .choice:nth-of-type(n+6) { animation-delay: 320ms; }
.page.still .choices > .choice, .dlg .choices > .choice { animation: none; }
.choice { position: relative; display: flex; align-items: center; gap: 14px; min-height: 62px; padding: 14px 16px; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r); cursor: pointer; box-shadow: 0 1px 2px rgba(10, 22, 51, 0.04); transition: transform 140ms ease-out, border-color 200ms ease, background-color 200ms ease, box-shadow 200ms ease; }
.choice:hover { border-color: var(--line-2); box-shadow: var(--shadow-1); }
.choice:active { transform: scale(0.98); }
.choice:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); box-shadow: 0 0 0 1px var(--blue) inset, 0 8px 20px rgba(42, 91, 255, 0.12); }
.choice:has(input:focus-visible) { outline: 3px solid rgba(42, 91, 255, 0.45); outline-offset: 2px; }
.choice input { appearance: none; -webkit-appearance: none; flex: none; width: 26px; height: 26px; margin: 0; border: 2px solid var(--line-2); background: var(--surface); border-radius: 50%; display: grid; place-items: center; cursor: pointer; transition: background-color 200ms ease, border-color 200ms ease; }
.choice input[type="checkbox"] { border-radius: 8px; }
.choice input::after { content: ""; width: 12px; height: 7px; border-left: 2.8px solid #fff; border-bottom: 2.8px solid #fff; transform: translateY(-1.5px) rotate(-45deg) scale(0); transition: transform 260ms var(--spring); }
.choice input:checked { background: var(--blue); border-color: var(--blue); animation: pop 300ms var(--ease); }
.choice input:checked::after { transform: translateY(-1.5px) rotate(-45deg) scale(1); }
.choice input:focus-visible { outline: none; }
.choice-body { display: grid; gap: 2px; min-width: 0; }
.choice-label { font-weight: 700; line-height: 1.5; }
.choice-hint { font-size: 13px; color: var(--sub); line-height: 1.6; }
.choice.compact { min-height: 50px; padding: 11px 14px; border-radius: 14px; }
.choice.compact .choice-label { font-weight: 600; font-size: 15px; }
.choice.compact input { width: 22px; height: 22px; }
.choice.para { align-items: flex-start; }
.choice.para .para-text { white-space: pre-wrap; font-size: 14.5px; line-height: 1.75; overflow-wrap: anywhere; }

/* セグメントコントロール：白い印が選んだ所まで滑る */
.seg { margin: 0 0 18px; }
.seg > legend { margin-bottom: 6px; }
.seg-row { position: relative; display: inline-flex; flex-wrap: wrap; padding: 4px; background: var(--card); border-radius: 14px; max-width: 100%; }
.seg-row input { position: absolute; opacity: 0; pointer-events: none; }
.seg-row label { position: relative; z-index: 1; min-height: 40px; padding: 0 16px; display: inline-flex; align-items: center; border-radius: 10px; font-size: 14px; font-weight: 700; color: var(--sub); cursor: pointer; transition: color 220ms ease; }
.seg-row label:hover { color: var(--ink); }
.seg-row input:checked + label { color: var(--ink); }
.seg-row input:focus-visible + label { outline: 3px solid rgba(42, 91, 255, 0.45); outline-offset: 1px; }
.seg-ind { position: absolute; left: 0; top: 0; z-index: 0; width: var(--w, 0); height: var(--h, 0); transform: translate(var(--x, 0), var(--y, 0)); background: var(--surface); border-radius: 10px; box-shadow: 0 1px 3px rgba(10, 22, 51, 0.14), 0 4px 10px rgba(10, 22, 51, 0.06); transition: transform 360ms var(--ease), width 360ms var(--ease), height 360ms var(--ease), opacity 160ms ease; opacity: 0; pointer-events: none; }

.check-line { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 10px 0; font-size: 15px; cursor: pointer; }
.check-line input { width: 22px; height: 22px; margin-top: 2px; flex: none; accent-color: var(--blue); }
.month-picker { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.month-picker .input { width: auto; min-width: 116px; }
.mp-label { font-size: 14px; font-weight: 700; }
.period-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-bottom: 14px; }
.period-sep { color: var(--sub); font-size: 14px; }
.quick-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 12px; font-size: 14px; }
.q-control { margin-bottom: 8px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.row-between > h3, .row-between > p { margin: 0; }
.row-end { display: flex; align-items: flex-end; justify-content: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.row-end .field { flex: 1 1 240px; margin-bottom: 0; }
.row-start { display: flex; gap: 12px; flex-wrap: wrap; margin: 12px 0 18px; }

/* =========================================================
   補足・注意・バッジ
   ========================================================= */
.advice { position: relative; margin: 24px 0 0; padding: 14px 16px 14px 52px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.advice::before { content: "?"; position: absolute; left: 14px; top: 14px; width: 26px; height: 26px; border-radius: 50%; background: var(--blue-soft); color: var(--blue); font-weight: 800; font-size: 14px; display: grid; place-items: center; }
.advice-title { font-size: 13px; font-weight: 800; color: var(--ink); margin-bottom: 2px; }
.advice p { font-size: 14.5px; color: var(--ink-2); }
.callout { padding: 14px 16px; border-radius: var(--r); background: var(--card); margin: 0 0 20px; font-size: 15px; display: grid; gap: 6px; justify-items: start; animation: rise 360ms var(--ease) both; }
.callout-title { font-weight: 800; }
.callout ul, .plain { list-style: disc; padding-left: 1.3em; display: grid; gap: 4px; }
.callout.warn { background: var(--amber-soft); color: var(--ink); }
.callout.hold { background: var(--card); }
.callout.inline { margin: 8px 0 0; font-size: 14px; }
.plain.small { font-size: 13px; color: var(--sub); }
.badge { display: inline-flex; align-items: center; font-size: 12px; font-weight: 800; line-height: 1; padding: 6px 10px; border-radius: 999px; background: var(--card); color: var(--ink-2); white-space: nowrap; }
.badge.ok { background: var(--mint-soft); color: var(--mint); }
.badge.warn { background: var(--amber-soft); color: var(--amber); }
.badge.stop { background: var(--stop-soft); color: var(--stop); }
.badge.info, .badge.in { background: var(--blue-soft); color: var(--blue-ink); }
.badge.out { background: var(--sun-soft); color: var(--blue-ink); }
.badge.hold, .badge.transfer { background: var(--card); color: var(--ink-2); }
.empty { padding: 34px 20px; text-align: center; color: var(--sub); background: var(--surface); border: 1.5px dashed var(--line-2); border-radius: var(--r-l); display: grid; gap: 14px; justify-items: center; }

/* =========================================================
   ホーム
   ========================================================= */
.hero { padding: 14px 0 4px; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 800; letter-spacing: 0.06em; color: var(--blue); margin-bottom: 12px; }
.hero-eyebrow .brand-tag { margin-left: 0; }
.home-title { font-size: clamp(34px, 5vw, 50px); line-height: 1.2; margin-bottom: 12px; }
.hero .lead { font-size: 17px; margin-bottom: 28px; }

.first { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 20px 22px 22px; margin-bottom: 22px; box-shadow: var(--shadow-1); }
.first-title { display: flex; align-items: baseline; gap: 12px; font-weight: 800; margin-bottom: 14px; }
.first-title .en { color: var(--sun); }
.first-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.first-steps li { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; font-size: 14px; color: var(--sub); line-height: 1.7; animation: rise 520ms var(--ease) both; }
.first-steps li:nth-child(2) { animation-delay: 110ms; }
.first-steps li:nth-child(3) { animation-delay: 220ms; }
.first-steps strong { display: block; color: var(--ink); font-size: 15.5px; }
.first-n { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 12px; background: var(--solid); color: #fff; font-family: var(--num); font-weight: 800; }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.tiles > li { animation: rise 560ms var(--ease) both; animation-delay: calc(120ms + var(--i, 0) * 70ms); perspective: 900px; }
.tile {
  --t: var(--blue); --ts: var(--blue-soft); --g1: #4c7dff; --g2: #1a3fd1;
  position: relative; width: 100%; height: 100%; min-height: 210px; display: grid; grid-template-columns: minmax(0, 1fr) 104px; grid-template-rows: auto 1fr auto; gap: 8px 14px;
  padding: 20px 18px 18px 20px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); cursor: pointer; overflow: hidden;
  box-shadow: var(--shadow-1); transition: transform 380ms var(--ease), box-shadow 380ms ease, border-color 300ms ease;
}
.tile-B { --t: var(--mint); --ts: var(--mint-soft); --g1: #2fcf8f; --g2: #0d8a59; }
.tile-C { --t: var(--sun); --ts: var(--sun-soft); --g1: #ff8a5b; --g2: #d9431c; }
.tile-D { --t: var(--grape); --ts: var(--grape-soft); --g1: #a17bff; --g2: #6236e0; }
.tile::before { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: var(--ts); transition: transform 600ms var(--ease); }
.tile:hover, .tile:focus-visible { transform: translateY(-6px); box-shadow: var(--shadow-2); border-color: transparent; }
.tile:hover::before, .tile:focus-visible::before { transform: scale(1.25); }
.tile:active { transform: translateY(-2px) scale(0.98); transition-duration: 120ms; }
.tile.picked { box-shadow: 0 0 0 3px var(--t), var(--shadow-1); }
.app-icon { position: relative; grid-column: 1; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; color: #fff; background: linear-gradient(145deg, var(--g1), var(--g2)); box-shadow: 0 8px 18px color-mix(in srgb, var(--g2) 35%, transparent); transition: transform 420ms var(--spring); }
.app-icon svg { stroke-width: 1.9; }
.tile:hover .app-icon, .tile:focus-visible .app-icon { transform: scale(1.08) rotate(-4deg); }
.tile-body { position: relative; grid-column: 1; display: grid; gap: 4px; align-content: start; justify-items: start; }
.tile-label { font-size: 19px; font-weight: 800; line-height: 1.4; }
.tile-hint { font-size: 13.5px; color: var(--sub); line-height: 1.65; }
.tile-go { position: relative; grid-column: 1; display: inline-flex; align-items: center; gap: 4px; justify-self: start; font-size: 14px; font-weight: 800; color: var(--t); background: var(--ts); border-radius: 999px; padding: 6px 12px 6px 14px; }
.tile-go svg { transition: transform 300ms var(--spring); }
.tile:hover .tile-go svg { transform: translateX(4px); }
.tile .art { position: relative; grid-column: 2; grid-row: 1 / 4; align-self: center; width: 104px; height: 104px; transition: transform 500ms var(--ease); }
.tile:hover .art, .tile:focus-visible .art { transform: translateY(-6px) rotate(-4deg) scale(1.04); }

/* 絵：出来上がる書類。線が1本ずつ書き込まれる */
.art { --t: var(--blue); }
.art .a-sheet { fill: #fff; stroke: #d8deea; stroke-width: 1.5; }
.art .a-line { stroke: #d8deea; stroke-width: 4; stroke-linecap: round; transform-box: fill-box; transform-origin: left center; animation: grow-x 520ms var(--ease) both; animation-delay: calc(420ms + var(--i, 0) * 80ms); }
.art .a-line.strong { stroke: var(--t); }
.art .a-line.num { stroke: var(--t); opacity: 0.4; }
.art .a-axis { stroke: #d8deea; stroke-width: 2; stroke-linecap: round; }
.art .a-bar { fill: var(--t); opacity: 0.35; transform-box: fill-box; transform-origin: center bottom; animation: grow-y 620ms var(--spring) both; animation-delay: calc(460ms + var(--i, 0) * 90ms); }
.art .a-bar.hot { opacity: 1; }
.art .a-mark { fill: var(--t); opacity: 0.2; transform-box: fill-box; transform-origin: left center; animation: grow-x 520ms var(--ease) 780ms both; }
.art .a-seal { fill: none; stroke: var(--t); stroke-width: 2.5; }
.art .a-seal.big { fill: var(--sun); stroke: none; transform-box: fill-box; transform-origin: center; animation: pop 460ms var(--spring) 720ms both; }
.art .a-check { fill: none; stroke: var(--t); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw 420ms ease-out 920ms forwards; }
.art .a-check.white, .art-D .a-check { stroke: #fff; stroke-width: 3.5; }
.art .a-flow { fill: none; stroke: var(--t); opacity: 0.45; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 200; stroke-dashoffset: 200; animation: draw 820ms ease-out 440ms forwards; }
.art .a-node { fill: #fff; stroke: var(--t); stroke-width: 2.5; }
.art .a-node.ai { fill: var(--grape-soft); }
.art .a-node.me { fill: var(--t); stroke: none; }
.tile-A .art { --t: var(--blue); }
.tile-B .art { --t: var(--mint); }
.tile-C .art { --t: var(--sun); }
.tile-D .art { --t: var(--grape); }

.feature { position: relative; display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 8px 26px; align-items: center; margin-top: 16px; padding: 28px 30px; border-radius: var(--r-l); color: #e8edfa; overflow: hidden; background: radial-gradient(80% 140% at 100% 0%, #2a5bff 0%, rgba(42, 91, 255, 0) 60%), radial-gradient(60% 90% at 0% 100%, rgba(232, 87, 46, 0.45) 0%, rgba(232, 87, 46, 0) 70%), var(--ink); box-shadow: var(--shadow-2); }
.feature h2 { margin: 0 0 6px; font-size: 26px; color: #fff; }
.feature p { color: #c3cbe0; font-size: 15px; margin-bottom: 14px; max-width: 34em; }
.feature .art { --t: #fff; width: 150px; height: 150px; filter: drop-shadow(0 16px 24px rgba(0, 0, 0, 0.35)); transform: rotate(-6deg); animation: float 5s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: rotate(-6deg) translateY(0); } 50% { transform: rotate(-4deg) translateY(-8px); } }
.feature .art .a-line.strong { stroke: var(--blue); }
.feature .btn.primary { background: #fff; color: var(--ink); border-color: #fff; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25); }
.feature .btn.primary:hover { background: #eef2ff; }
.feature .btn.primary .ripple { background: var(--blue); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.chip { position: relative; overflow: hidden; display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 700; text-decoration: none; cursor: pointer; transition: transform 140ms ease-out, background-color 200ms ease, border-color 200ms ease, color 200ms ease; }
.chip:hover { border-color: var(--blue); color: var(--blue-ink); }
.chip:active { transform: scale(0.94); }
.chip.on { background: var(--solid); border-color: var(--ink); color: #fff; }
.chip.quick { background: var(--blue-soft); border-color: transparent; color: var(--blue-ink); }
.feature .chip.quick { background: rgba(255, 255, 255, 0.1); color: #fff; border-color: rgba(255, 255, 255, 0.24); }
.feature .chip.quick:hover { background: #fff; color: var(--ink); }

.minis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.mini { position: relative; overflow: hidden; width: 100%; height: 100%; display: flex; align-items: center; gap: 14px; padding: 16px 18px; min-height: 86px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); color: var(--ink); text-decoration: none; cursor: pointer; box-shadow: var(--shadow-1); transition: transform 300ms var(--ease), box-shadow 300ms ease; }
.mini:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.mini:active { transform: scale(0.98); }
.mini > svg:last-child { color: var(--label); flex: none; transition: transform 300ms var(--spring); }
.mini:hover > svg:last-child { transform: translateX(4px); color: var(--blue); }
.mini-icon { width: 48px; height: 48px; flex: none; display: grid; place-items: center; border-radius: 15px; background: var(--amber-soft); color: var(--amber); }
.minis li:first-child .mini-icon { background: var(--grape-soft); color: var(--grape); }
.mini-body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.mini-label { font-weight: 800; }
.mini-hint { font-size: 13.5px; color: var(--sub); line-height: 1.6; }

.resume { margin-bottom: 20px; }
.resume-card { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; background: var(--solid); color: #fff; border-radius: var(--r-l); padding: 20px 22px; box-shadow: var(--shadow-2); }
.resume-card::before { content: ""; position: absolute; right: -80px; top: -120px; width: 280px; height: 280px; border-radius: 50%; background: radial-gradient(circle, rgba(42, 91, 255, 0.75), rgba(42, 91, 255, 0) 70%); }
.resume-card > * { position: relative; }
.resume-card .eyebrow { color: #9fb7ff; margin-bottom: 4px; }
.resume-title { font-size: 18px; font-weight: 800; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.resume-sub { font-size: 13.5px; color: #b8c2da; }
.resume-card .btn.primary { background: #fff; color: var(--ink); border-color: #fff; box-shadow: none; }
.resume-card .btn.primary .ripple { background: var(--blue); }
.resume-more { margin-top: 10px; display: flex; gap: 10px; flex-wrap: wrap; font-size: 14px; color: var(--sub); }
.home-note { margin-top: 30px; font-size: 13px; color: var(--sub); }
.deadline-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; margin-top: 12px; }

/* =========================================================
   作業の画面（質問・手順）
   ========================================================= */
.case-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 22px; }
.case-head .crumb { margin: 0; flex: 1 1 100%; }
.phases { display: flex; flex-wrap: wrap; gap: 6px 0; font-size: 12.5px; color: var(--sub); }
.phases li { position: relative; display: inline-flex; align-items: center; gap: 7px; padding: 4px 26px 4px 0; font-weight: 700; }
.phases li:not(:last-child)::after { content: ""; position: absolute; right: 6px; top: 50%; width: 14px; height: 2px; border-radius: 2px; background: var(--line-2); }
.phases li.past:not(:last-child)::after { background: var(--blue); }
.ph-n { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--card); color: var(--sub); font-size: 12px; font-weight: 800; font-family: var(--num); }
.phases li.past .ph-n { background: var(--blue-soft); color: var(--blue-ink); }
.phases li.now { color: var(--ink); }
.phases li.now .ph-n { background: var(--blue); color: #fff; box-shadow: 0 0 0 4px rgba(42, 91, 255, 0.2); animation: pop 360ms var(--spring) 120ms both; }
.doc-open { display: none; }
.case-body h1 { font-size: 30px; }

/* 進み具合：前の位置から伸びるバー */
.qprog-wrap { margin-bottom: 22px; }
.qprog-label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; font-size: 13px; color: var(--sub); margin-bottom: 8px; }
.qprog-label .en { color: var(--blue); }
.qprog { height: 8px; background: var(--hover); border-radius: 999px; overflow: hidden; }
.qprog-fill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--blue), #6f93ff); transform-origin: left center; transform: scaleX(var(--to)); animation: qprog 760ms var(--ease) both; }
@keyframes qprog { from { transform: scaleX(var(--from)); } to { transform: scaleX(var(--to)); } }

/* この画面ですること */
.coach { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 18px 20px 16px; margin: 0 0 24px; box-shadow: var(--shadow-1); }
.coach-title { display: flex; align-items: baseline; gap: 12px; font-weight: 800; font-size: 14.5px; margin-bottom: 10px; }
.coach-title .en { color: var(--sun); }
.coach ol { counter-reset: coach; display: grid; gap: 8px; }
.coach li { counter-increment: coach; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; font-size: 14.5px; animation: rise 460ms var(--ease) both; }
.coach li:nth-child(1) { animation-delay: 220ms; }
.coach li:nth-child(2) { animation-delay: 300ms; }
.coach li:nth-child(3) { animation-delay: 380ms; }
.coach li::before { content: counter(coach); font-family: var(--num); font-weight: 800; font-size: 13px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 9px; background: var(--blue-soft); color: var(--blue-ink); }

/* 下の操作バー：アプリの画面下に固定されたボタン */
.case-foot { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: flex-end; gap: 10px; margin-top: 32px; padding: 14px 0 calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(to bottom, rgba(20, 20, 20, 0), var(--paper) 28%); }
.case-foot > :first-child { margin-right: auto; }
.case-foot .btn.primary { min-width: 140px; }
.skip-wrap { display: grid; justify-items: end; gap: 3px; }
.skip-note { font-size: 11.5px; color: var(--sub); max-width: 22em; text-align: right; line-height: 1.5; }

/* 今日の手順：進み具合の輪（プログレスリング） */
.plan-hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.plan-count { font-size: 14px; color: var(--sub); font-weight: 700; margin-bottom: 18px; }
.ring { position: relative; width: 96px; height: 96px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 10; }
.ring .bg { stroke: var(--hover); }
.ring .fg { stroke: var(--blue); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: calc(100 - var(--v)); animation: ring 1100ms var(--ease) 200ms both; }
@keyframes ring { from { stroke-dashoffset: 100; } }
.ring b { position: absolute; inset: 0; display: grid; place-content: center; font-family: var(--num); font-size: 24px; font-weight: 800; text-align: center; line-height: 1; }
.ring small { font-size: 12px; margin-left: 1px; color: var(--sub); }
.plan-list { display: grid; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); margin-bottom: 22px; overflow: hidden; box-shadow: var(--shadow-1); }
.plan-list > li { display: flex; align-items: flex-start; gap: 14px; padding: 18px 20px; transition: background-color 160ms ease; animation: rise 460ms var(--ease) both; }
.plan-list > li:nth-child(2) { animation-delay: 70ms; }
.plan-list > li:nth-child(3) { animation-delay: 140ms; }
.plan-list > li:nth-child(n+4) { animation-delay: 210ms; }
.plan-list > li:hover { background: var(--hover); }
.plan-list > li + li { border-top: 1px solid var(--line); }
.plan-list > li > div { flex: 1; min-width: 0; }
.plan-n { width: 32px; height: 32px; flex: none; border-radius: 11px; display: grid; place-items: center; background: var(--blue-soft); font-size: 13px; font-weight: 800; color: var(--blue-ink); font-family: var(--num); }
.plan-list li.done .plan-n { background: var(--mint); color: #fff; }
.plan-title { font-weight: 800; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.plan-title a { color: var(--ink); text-decoration: none; }
.plan-title a:hover { color: var(--blue); }
.plan-reason { font-size: 14px; color: var(--sub); }
.answers { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 4px 20px; }
.answers summary, .export-details summary, details > summary { cursor: pointer; min-height: 48px; display: flex; align-items: center; font-weight: 700; font-size: 15px; }
.answer-list > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.answer-list dt { color: var(--sub); }
.answers .field-hint { padding: 10px 0 12px; }

/* =========================================================
   取引
   ========================================================= */
.quick-add { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 20px 22px 16px; margin-bottom: 26px; box-shadow: var(--shadow-1); }
.quick-add h3 { margin-top: 0; }
.qa-grid { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 0 16px; }
.qa-grid .seg { grid-column: 1 / -1; }
.qa-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.qa-foot .field-hint { flex: 1 1 260px; }
.tx-tools { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 0 20px; align-items: start; }
.tx-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.tx-bar-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.tx-count { font-size: 14px; color: var(--sub); font-variant-numeric: tabular-nums; font-weight: 700; }
.tx-table { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; border-collapse: separate; border-spacing: 0; font-size: 14.5px; box-shadow: var(--shadow-1); }
.tx-table th { text-align: left; font-size: 12px; font-weight: 700; color: var(--sub); padding: 11px 13px; background: var(--hover); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tx-table td { padding: 13px; border-top: 1px solid var(--line); vertical-align: top; }
.tx-table tbody tr { transition: background-color 140ms ease; animation: rise 380ms var(--ease) both; }
.tx-table tbody tr:hover { background: var(--hover); }
.tx-table tbody tr:first-child td { border-top: 0; }
.tx-table .num, .doc-table .num, .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tx-table td.num { font-family: var(--num); font-weight: 700; }
.tx-desc { min-width: 140px; overflow-wrap: anywhere; font-weight: 700; }
.tx-sub { display: block; font-size: 12.5px; color: var(--sub); line-height: 1.5; font-weight: 400; }
.tx-sub.warn { color: var(--amber); }
.tx-act { text-align: right; white-space: nowrap; }
.tx-table tr.is-excluded td { color: var(--label); }
.tx-table .badge + .badge { margin-left: 4px; }
.suggest { position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: 6px; padding: 5px 6px 5px 10px; border-radius: 12px; border: 1.5px dashed #9db5ff; background: var(--blue-soft); color: var(--blue-ink); font-size: 12.5px; font-weight: 700; cursor: pointer; text-align: left; transition: transform 140ms ease-out, border-color 200ms ease; }
.suggest:hover { border-color: var(--blue); }
.suggest:active { transform: scale(0.96); }
.suggest-go { background: var(--blue); color: #fff; border-radius: 8px; padding: 3px 8px; margin-left: 4px; white-space: nowrap; }
.dup-panel { margin-top: 28px; }
.dup-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; margin-bottom: 10px; display: grid; gap: 10px; }
.dup-reason { font-size: 14px; color: var(--sub); }
.dup-row { display: grid; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.dup-info { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.dup-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.dup-card .seg { margin: 0; }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 8px; }
.stat { position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 18px 20px; min-width: 0; box-shadow: var(--shadow-1); animation: rise 480ms var(--ease) both; }
.stat:nth-child(2) { animation-delay: 70ms; }
.stat:nth-child(3) { animation-delay: 140ms; }
.stat::before { content: ""; position: absolute; right: -30px; top: -30px; width: 96px; height: 96px; border-radius: 50%; background: var(--blue-soft); }
.stat:nth-child(2)::before { background: var(--sun-soft); }
.stat:nth-child(3)::before { background: var(--mint-soft); }
.stat > * { position: relative; }
.stat-label { font-size: 13px; color: var(--sub); font-weight: 700; }
.stat-value { font-family: var(--num); font-size: 30px; font-weight: 800; line-height: 1.35; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.stat-sub { font-size: 13px; color: var(--sub); }
.three { display: grid; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); margin-bottom: 18px; box-shadow: var(--shadow-1); counter-reset: three; overflow: hidden; }
.three li { display: grid; grid-template-columns: 11em minmax(0, 1fr); gap: 14px; padding: 16px 20px; animation: rise 460ms var(--ease) both; }
.three li:nth-child(2) { animation-delay: 90ms; }
.three li:nth-child(3) { animation-delay: 180ms; }
.three li + li { border-top: 1px solid var(--line); }
.three strong { font-size: 14px; color: var(--ink); display: flex; align-items: baseline; gap: 8px; }
.three strong::before { counter-increment: three; content: counter(three); font-family: var(--num); width: 24px; height: 24px; flex: none; border-radius: 8px; background: var(--blue); color: #fff; display: inline-grid; place-items: center; font-size: 12px; }

/* グラフ：棒が左から伸びる。数字は動かさない */
.bars { display: grid; gap: 12px; margin: 4px 0 16px; }
.bars li { display: grid; grid-template-columns: minmax(96px, 40%) minmax(40px, 1fr) auto; align-items: center; gap: 12px; font-size: 14px; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.bar-pick { background: none; border: 0; padding: 4px 0; text-align: left; color: var(--blue); text-decoration: underline; cursor: pointer; min-height: 32px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.bar-track { height: 12px; border-radius: 999px; background: var(--card); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--blue), #7b9bff); transform-origin: left center; animation: grow-x 780ms var(--ease) both; }
.bars li:nth-child(2) .bar-fill { animation-delay: 70ms; }
.bars li:nth-child(3) .bar-fill { animation-delay: 140ms; }
.bars li:nth-child(n+4) .bar-fill { animation-delay: 210ms; }
.bar-fill.muted { background: var(--line-2); }
.bar-value { font-family: var(--num); font-variant-numeric: tabular-nums; font-weight: 800; white-space: nowrap; }
.doc .bar-fill { animation: none; }
.chart-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 20px 22px; margin-bottom: 16px; min-width: 0; box-shadow: var(--shadow-1); }
.chart-card h2 { margin: 0 0 12px; font-size: 16px; }
.chart-card h3 { margin-top: 8px; font-size: 14px; color: var(--sub); }
.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.chart-card .chart-grid { gap: 28px; }
.mchart { width: 100%; height: auto; display: block; }
.mchart .axis { stroke: var(--line); stroke-width: 1; }
.mchart rect { transform-box: fill-box; transform-origin: center bottom; animation: grow-y 760ms var(--spring) both; }
.mchart .bar-in { fill: var(--blue); }
.mchart .bar-out { fill: var(--sun); }
.mchart .tick { font-size: 12px; fill: var(--sub); }
.mchart .none { font-size: 11px; fill: var(--label); }
.mchart-wrap figcaption { display: flex; gap: 18px; font-size: 13px; color: var(--sub); margin-top: 6px; }
.key::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; background: var(--blue); }
.key.out::before { background: var(--sun); }

/* =========================================================
   契約・手順
   ========================================================= */
.contract-text { font-size: 15px; line-height: 1.8; min-height: 320px; }
.mask-preview { max-height: 360px; overflow: auto; }
.point-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 20px 22px 6px; margin-bottom: 16px; box-shadow: var(--shadow-1); }
.point-card h3 { margin: 0; font-size: 19px; }
.point-card .choice { background: var(--surface); }
.q-picker { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 4px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.tag-list li { display: inline-flex; align-items: center; gap: 4px; background: var(--card); border-radius: 999px; padding: 2px 4px 2px 14px; font-size: 14px; font-weight: 600; animation: pop 300ms var(--spring) both; }
.tag-x { width: 32px; height: 32px; border: 0; background: none; cursor: pointer; font-size: 16px; color: var(--sub); border-radius: 50%; }
.tag-x:hover { background: var(--hover); }
.date-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px 6px; margin-bottom: 12px; }
.date-raw { display: flex; gap: 8px; flex-wrap: wrap; }
.date-ctx { font-size: 13.5px; color: var(--sub); margin: 4px 0 10px; overflow-wrap: anywhere; }
.task-list { display: grid; gap: 8px; margin: 14px 0 16px; }
.task-list li { display: grid; grid-template-columns: 30px minmax(0, 1fr) 220px auto; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; animation: rise 380ms var(--ease) both; }
.task-n { font-weight: 800; color: var(--blue); text-align: center; font-family: var(--num); }
.task-acts { display: inline-flex; gap: 6px; }

/* =========================================================
   経費チェック
   ========================================================= */
.kamoku { display: grid; gap: 26px; }
.k-target { font-size: 15px; background: var(--paper); border-radius: var(--r-s); padding: 10px 14px; }
.k-step h3 { margin-top: 0; display: flex; align-items: center; gap: 10px; font-size: 18px; }
.k-n { width: 30px; height: 30px; border-radius: 10px; background: var(--solid); color: #fff; display: inline-grid; place-items: center; font-family: var(--num); font-size: 14px; }
.k-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: 300px; overflow: auto; padding: 4px; margin: -4px; }
.k-card { border: 1.5px solid var(--line); border-radius: var(--r-l); padding: 22px 24px; background: var(--surface); display: grid; gap: 4px; animation: rise 420ms var(--ease) both; box-shadow: var(--shadow-1); }
.k-card.ok { border-color: #8fdcbb; background: linear-gradient(180deg, var(--mint-soft) 0, #fff 120px); }
.k-card.warn { border-color: #f1cd8a; background: linear-gradient(180deg, var(--amber-soft) 0, #fff 120px); }
.k-card.stop { border-color: #f1aea6; background: linear-gradient(180deg, var(--stop-soft) 0, #fff 120px); }
.k-card.info { border-color: #a9bdff; background: linear-gradient(180deg, var(--blue-soft) 0, #fff 120px); }
.k-answer { font-size: 25px; font-weight: 800; line-height: 1.4; margin-bottom: 4px; animation: line-reveal 560ms var(--ease) both; }
.k-card.ok .k-answer { color: var(--mint); }
.k-card.warn .k-answer { color: var(--amber); }
.k-card.stop .k-answer { color: var(--stop); }
.k-card.info .k-answer { color: var(--blue-ink); }
.k-card ul { list-style: disc; padding-left: 1.3em; font-size: 15px; display: grid; gap: 4px; }
.k-card ul.links { list-style: none; padding: 0; }
.k-acc { display: grid; margin-top: 10px; }
.k-acc-label { font-size: 13px; color: var(--sub); font-weight: 700; }
.k-acc strong { font-size: 22px; line-height: 1.4; }
.k-card .choices { margin: 12px 0 0; }
.keihi-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 28px 28px 22px; box-shadow: var(--shadow-1); }
.keihi-panel .k-items { max-height: 260px; }
.keihi-acts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.judge-inline { margin-bottom: 12px; font-size: 14px; }
.editor-block { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 16px 0 0; margin: 4px 0 18px; }
.editor-block h3 { margin: 0; }
.source-line { font-size: 13px; color: var(--sub); overflow-wrap: anywhere; padding-top: 10px; border-top: 1px solid var(--line); }
.links { display: grid; gap: 6px; font-size: 14.5px; margin-bottom: 14px; }
.csv-summary { background: var(--paper); border-radius: var(--r); padding: 14px 16px; font-size: 15px; }
tr.is-head td { color: var(--sub); background: var(--hover); }

/* =========================================================
   書類（右に出来上がっていく紙）
   ========================================================= */
.aside { grid-area: aside; display: none; position: sticky; top: var(--top-h); align-self: start; height: calc(100dvh - var(--top-h)); padding: 6px 24px 22px 4px; flex-direction: column; min-width: 0; }
body.has-doc .aside { display: flex; animation: fade 320ms ease both; }
.aside-head { display: flex; align-items: center; justify-content: space-between; }
.aside-title { font-size: 12.5px; font-weight: 800; color: var(--blue); letter-spacing: 0.06em; }
.aside-note { font-size: 12.5px; color: var(--sub); margin: 2px 0 12px; }
.doc-close { display: none; }
.doc-scrim { display: none; }
.doc { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 30px 26px; font-size: 13.5px; line-height: 1.7; overflow: auto; flex: 1; min-height: 0; overscroll-behavior: contain; box-shadow: var(--shadow-2); }
.doc-main { font-size: 15px; padding: 40px 44px 46px; overflow: visible; margin-top: 8px; box-shadow: var(--shadow-1); }
.doc-title { font-size: 1.5em; line-height: 1.4; margin: 0 0 12px; font-weight: 800; }
.doc-meta { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 16px; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 14px; font-size: 0.93em; }
.doc-meta dt { color: var(--sub); }
.doc-h { font-size: 1.04em; margin: 22px 0 8px; padding-left: 10px; border-left: 4px solid var(--blue); line-height: 1.4; font-weight: 800; border-radius: 2px; }
.doc-p, .doc-note, .doc-list, .doc-kv, .doc-quote, .doc-code, .doc-empty, .doc-table-wrap, .doc .bars { margin-bottom: 10px; position: relative; }
.doc-note { background: var(--paper); border-radius: var(--r-s); padding: 10px 12px; font-size: 0.95em; }
.doc-empty { color: var(--sub); }
.doc-kv > div { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.doc-kv dt { color: var(--sub); flex: none; max-width: 46%; }
.doc-kv dd { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.doc-list { list-style: disc; padding-left: 1.3em; display: grid; gap: 4px; }
ol.doc-list { list-style: decimal; }
.doc-list.check { list-style: none; padding-left: 0; }
.doc-list.check li { padding-left: 1.7em; position: relative; }
.doc-list.check li::before { content: ""; position: absolute; left: 0; top: 0.36em; width: 0.95em; height: 0.95em; border: 1.5px solid #9aa4bb; border-radius: 4px; }
.doc-quote figcaption { font-size: 0.86em; font-weight: 800; color: var(--blue); }
.doc-quote blockquote { border-left: 3px solid var(--line-2); padding-left: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.doc-code { font-family: var(--mono); font-size: 0.92em; line-height: 1.65; background: var(--paper); border-radius: var(--r-s); padding: 12px 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.doc-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-s); }
.doc-table { font-size: 0.93em; }
.doc-table th { text-align: left; font-weight: 700; color: var(--sub); background: var(--hover); padding: 7px 9px; white-space: nowrap; font-size: 0.92em; }
.doc-table td { padding: 7px 9px; border-top: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; min-width: 3.5em; }
.doc .bars li { font-size: 0.95em; gap: 8px; grid-template-columns: minmax(70px, 34%) minmax(30px, 1fr) auto; }
/* 変わった所に、蛍光ペンのような色が走って消える（文字と位置は動かさない） */
.changed::after { content: ""; position: absolute; inset: -4px -8px; border-radius: 8px; background: linear-gradient(90deg, rgba(42, 91, 255, 0.5), rgba(232, 87, 46, 0.4)); opacity: 0; pointer-events: none; transform-origin: left center; animation: mark 1500ms ease-out both; }
@keyframes mark { 0% { opacity: 0.5; transform: scaleX(0); } 25% { opacity: 0.4; transform: scaleX(1); } 100% { opacity: 0; transform: scaleX(1); } }

/* =========================================================
   結果：完了のチェック（サクセスチェックマーク）＋紙吹雪
   ========================================================= */
.success { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.success svg { width: 58px; height: 58px; flex: none; animation: pop 340ms var(--spring) 1100ms both; }
.success circle { fill: var(--mint-soft); stroke: var(--mint); stroke-width: 4; stroke-dasharray: 1; stroke-dashoffset: 1; transform: rotate(-90deg); transform-origin: center; animation: draw 700ms cubic-bezier(0.65, 0, 0.35, 1) 200ms forwards; }
.success path { fill: none; stroke: var(--mint); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 380ms ease-out 760ms forwards; }
.success p { font-weight: 800; color: var(--mint); animation: rise 360ms var(--ease) 1100ms both; }
.export { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 20px 22px 8px; margin-bottom: 14px; box-shadow: var(--shadow-1); }
.export-primary, .export-more { display: flex; flex-wrap: wrap; gap: 10px; }
.export-more { padding: 4px 0 12px; }
.export-details { margin-top: 10px; border-top: 1px solid var(--line); }
.export-log { font-size: 14px; padding-bottom: 8px; }
.result-notes { list-style: disc; padding-left: 1.3em; font-size: 13.5px; color: var(--sub); display: grid; gap: 4px; margin-bottom: 18px; }
.result-edit { font-size: 14px; color: var(--sub); margin-top: 16px; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 2147483646; overflow: hidden; }
.confetti i { position: absolute; top: -20px; left: var(--x); width: var(--s); height: calc(var(--s) * 0.5); border-radius: 2px; background: var(--blue); animation: confetti 2200ms cubic-bezier(0.2, 0.6, 0.4, 1) var(--d) both; }
.confetti i:nth-child(3n + 1) { background: var(--sun); }
.confetti i:nth-child(4n + 2) { background: var(--mint); }
.confetti i.k { background: #ffc23c; }
@keyframes confetti { from { transform: translateY(0) rotate(0deg); opacity: 1; } to { transform: translateY(105vh) rotate(var(--r)); opacity: 0.9; } }

/* =========================================================
   記録・使い方
   ========================================================= */
.tabs { position: relative; display: inline-flex; padding: 4px; background: var(--card); border-radius: 14px; margin-bottom: 24px; }
.tabs a { min-height: 42px; padding: 0 22px; display: inline-flex; align-items: center; border-radius: 10px; font-size: 15px; font-weight: 700; color: var(--sub); text-decoration: none; transition: background-color 220ms ease, color 220ms ease, box-shadow 220ms ease; }
.tabs a.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(10, 22, 51, 0.14), 0 4px 10px rgba(10, 22, 51, 0.06); }
.filter-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
.case-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; box-shadow: var(--shadow-1); }
.case-list li { display: flex; align-items: center; gap: 12px; padding: 6px 16px 6px 0; transition: background-color 140ms ease; animation: rise 380ms var(--ease) both; }
.case-list li:hover { background: var(--hover); }
.case-list li + li { border-top: 1px solid var(--line); }
.case-link { flex: 1; min-width: 0; display: grid; gap: 2px; padding: 12px 0 12px 20px; color: var(--ink); text-decoration: none; min-height: 60px; }
.case-title { font-weight: 800; }
.case-sub { font-size: 13px; color: var(--sub); }
.guide-sec { margin-bottom: 8px; }
.guide-sec ul, .guide-steps { list-style: disc; padding-left: 1.3em; display: grid; gap: 6px; margin-bottom: 12px; }
.guide-steps { list-style: decimal; }
.guide-sec ul.links { list-style: none; padding: 0; }
.guide-sec p { margin-bottom: 10px; }

/* スクロールリビール（入ったら一度だけ） */
.rv { opacity: 0; transform: translateY(26px); transition: opacity 700ms var(--ease), transform 700ms var(--ease); }
.rv.rv-in { opacity: 1; transform: none; }

/* =========================================================
   サポート（フローティングボタン）・シート・スナックバー
   ========================================================= */
.support-btn { position: fixed; right: 22px; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 30; overflow: hidden; display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 20px 0 16px; border: 0; border-radius: 999px; background: var(--solid); color: #fff; font-weight: 800; font-size: 14.5px; cursor: pointer; box-shadow: 0 12px 28px rgba(10, 22, 51, 0.32); transition: transform 300ms var(--spring), box-shadow 300ms ease; }
.support-btn svg { width: 22px; height: 22px; fill: none; stroke: #9fb7ff; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.support-btn:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 18px 34px rgba(10, 22, 51, 0.36); }
.support-btn:active { transform: scale(0.94); }
.support-btn .ripple { background: #fff; opacity: 0.3; }
body.has-doc .support-btn { right: calc(var(--aside-w) + 22px); }
.support section + section { margin-top: 20px; }
.support h3 { margin: 0 0 8px; font-size: 15px; color: var(--blue); }
.support-links { display: flex; flex-wrap: wrap; gap: 8px; }
.gloss { border-top: 1px solid var(--line); }
.gloss p { font-size: 14.5px; padding: 0 0 12px; animation: rise 300ms var(--ease) both; }

.dlg { border: 0; border-radius: var(--r-l); padding: 0; width: min(580px, calc(100vw - 32px)); max-height: min(88dvh, 880px); background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px rgba(10, 22, 51, 0.34); overflow: hidden; }
.dlg[open] { display: flex; flex-direction: column; animation: dlg 300ms var(--ease) both; }
.dlg.wide { width: min(860px, calc(100vw - 32px)); }
.dlg::backdrop { background: rgba(10, 22, 51, 0.45); animation: fade 240ms ease both; }
.dlg-grip { display: none; }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 14px 14px 24px; border-bottom: 1px solid var(--line); }
.dlg-head h2 { margin: 0; font-size: 19px; }
.dlg-body { padding: 22px 24px 8px; overflow: auto; flex: 1; min-height: 0; overscroll-behavior: contain; }
.dlg-text { margin-bottom: 16px; }
.dlg-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 14px 24px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translate(-50%, 24px); z-index: 2147483647; max-width: min(540px, calc(100vw - 32px)); background: var(--solid); color: #fff; padding: 14px 20px 14px 48px; border-radius: 16px; font-size: 14.5px; line-height: 1.55; opacity: 0; pointer-events: none; transition: opacity 240ms ease, transform 360ms var(--spring); box-shadow: 0 16px 36px rgba(10, 22, 51, 0.32); }
.toast::before { content: ""; position: absolute; left: 16px; top: 50%; width: 20px; height: 20px; margin-top: -10px; border-radius: 50%; background: var(--mint); }
.toast::after { content: ""; position: absolute; left: 22px; top: 50%; width: 8px; height: 5px; margin-top: -4px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* =========================================================
   幅が足りないとき：書類は横から出るパネルに
   ========================================================= */
@media (max-width: 1279px) {
  body.has-doc { grid-template-columns: var(--nav-w) minmax(0, 1fr); grid-template-areas: "nav top" "nav main"; }
  body.has-doc .aside { display: flex; position: fixed; z-index: 40; top: 0; right: 0; bottom: 0; height: auto; width: min(460px, 100vw); padding: 16px; background: var(--paper); box-shadow: -18px 0 50px rgba(10, 22, 51, 0.22); transform: translateX(104%); visibility: hidden; animation: none; transition: transform 360ms var(--ease), visibility 0s linear 360ms; }
  body.show-doc .aside { transform: none; visibility: visible; transition: transform 360ms var(--ease); }
  body.show-doc .doc-scrim { display: block; position: fixed; inset: 0; z-index: 39; background: rgba(10, 22, 51, 0.4); animation: fade 220ms ease both; }
  .doc-open, .doc-close { display: inline-flex; }
  body.has-doc .support-btn { right: 22px; }
}

/* =========================================================
   スマホ：下にタブバー、上に大きな見出し、ダイアログは下から出るシート
   ========================================================= */
@media (max-width: 880px) {
  body, body.has-doc { grid-template-columns: minmax(0, 1fr); grid-template-rows: var(--top-h) 1fr; grid-template-areas: "top" "main"; }
  .topbar { padding: 0 16px; }
  .topbar .brand { display: inline-flex; }
  .topbar .brand-name { font-size: 15px; }
  .topbar .brand-mark { width: 30px; height: 30px; }
  .topbar.is-titled .brand-name { display: none; }
  .bar-title { text-align: center; }
  .save-status { font-size: 11.5px; padding: 4px 10px 4px 8px; }
  .nav { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 35; height: auto; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); flex-direction: row; gap: 0; border-right: 0; border-top: 1px solid var(--line); background: rgba(20, 20, 20, 0.92); transition: transform 360ms var(--ease); }
  @supports (backdrop-filter: blur(12px)) { .nav { backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px); background: rgba(20, 20, 20, 0.82); } }
  .nav .nav-brand, .nav-sub { display: none; }
  .tabbar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; width: 100%; }
  .tabbar a { flex-direction: column; justify-content: center; gap: 2px; min-height: 54px; padding: 4px 2px; font-size: 11px; border-radius: 14px; text-align: center; }
  .tabbar a svg { width: 24px; height: 24px; }
  .tabbar a.on svg { transform: translateY(-1px) scale(1.12); }
  body.in-flow .nav { transform: translateY(110%); }
  main { padding: 10px 16px 0; }
  .page { padding-bottom: calc(var(--tab-h) + 60px); }
  body.in-flow .page { padding-bottom: 40px; }
  h1 { font-size: 27px; }
  .case-body h1 { font-size: 25px; }
  .home-title { font-size: 34px; }
  .choices.cols-2, .choices.cols-3, .grid-2, .grid-3, .chart-grid, .filter-row, .deadline-list, .k-items, .tx-tools, .qa-grid, .tiles, .minis, .first-steps { grid-template-columns: minmax(0, 1fr); }
  .tile { min-height: 0; grid-template-columns: minmax(0, 1fr) 84px; padding: 18px 14px 16px 18px; }
  .tile .art { width: 84px; height: 84px; }
  .tile-label { font-size: 17.5px; }
  .feature { grid-template-columns: minmax(0, 1fr); padding: 24px 20px; }
  .feature .art { width: 96px; height: 96px; }
  .feature h2 { font-size: 22px; }
  .stats { grid-template-columns: minmax(0, 1fr); }
  .stat-value { font-size: 26px; }
  .three li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .answer-list > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .doc-main { padding: 26px 18px 30px; }
  .keihi-panel { padding: 20px 16px 16px; }
  .plan-hero .ring { width: 76px; height: 76px; }
  .ring b { font-size: 19px; }
  .case-foot { align-items: stretch; }
  .case-foot .btn { flex: 1 1 auto; }
  .case-foot > :first-child { flex: 0 0 auto; }
  .skip-wrap { flex: 1 1 100%; justify-items: stretch; order: 3; }
  .skip-note { text-align: left; max-width: none; }
  .task-list li { grid-template-columns: 30px minmax(0, 1fr); }
  .task-list li select, .task-acts { grid-column: 2; }
  .support-btn { right: 14px; bottom: calc(var(--tab-h) + 20px + env(safe-area-inset-bottom)); width: 52px; padding: 0; justify-content: center; }
  body.in-flow .support-btn { bottom: calc(150px + env(safe-area-inset-bottom)); }
  .support-btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .toast { bottom: calc(var(--tab-h) + 24px + env(safe-area-inset-bottom)); }
  body.in-flow .toast { bottom: calc(110px + env(safe-area-inset-bottom)); }
  /* ボトムシート：下から出て、つまみを下へ引くと閉じる */
  .dlg, .dlg.wide { width: 100vw; max-width: 100vw; max-height: calc(var(--vvh, 100dvh) - 24px); margin: auto 0 0; border-radius: 26px 26px 0 0; }
  .dlg[open] { animation: sheet 420ms var(--ease) both; }
  .dlg-grip { display: block; flex: none; height: 26px; cursor: grab; touch-action: none; position: relative; }
  .dlg-grip::before { content: ""; position: absolute; left: 50%; top: 10px; width: 40px; height: 5px; margin-left: -20px; border-radius: 999px; background: var(--line-2); }
  .dlg-head { padding-top: 0; }
  .dlg-foot .btn { flex: 1 1 auto; }
  .btn.ghost-danger { flex: 1 1 100%; margin: 0; }
  /* 取引の表は、1件ずつのカードにする（横スクロールさせない） */
  .tx-table, .tx-table tbody, .tx-table tr, .tx-table td { display: block; width: 100%; }
  .tx-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .tx-table tr { padding: 14px 16px; border-top: 1px solid var(--line); }
  .tx-table tbody tr:first-child { border-top: 0; }
  .tx-table td { border: 0; padding: 3px 0; display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: space-between; align-items: baseline; text-align: right; }
  .tx-table td::before { content: attr(data-label); color: var(--sub); font-size: 12.5px; flex: none; text-align: left; font-family: var(--font); font-weight: 400; }
  .tx-table td .tx-sub { flex: 1 1 100%; text-align: right; }
  .tx-table td.tx-desc { display: block; text-align: left; font-weight: 800; }
  .tx-table td.tx-desc .tx-sub { text-align: left; }
  .tx-table td.tx-desc::before, .tx-table td.tx-act::before { display: none; }
  .tx-table td.tx-act { justify-content: flex-end; padding-top: 8px; }
}

/* 動きを減らす設定の人には、移動する演出を出さない */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .rv { opacity: 1; transform: none; }
  .changed::after { animation: none; opacity: 0.12; transform: none; }
}

@media print {
  .topbar, .nav, .aside, .case-foot, .export, .toast, .case-head, .result-notes, .result-edit, .support-btn, .success { display: none !important; }
  body { display: block; background: #fff; }
  main { padding: 0; }
  .doc-main { border: 0; padding: 0; box-shadow: none; }
}
/* サイドバーの名前を1行に収める（「仮称」はホームの見出しの上に出している） */
.nav-brand .brand-tag { display: none; }
.nav-brand .brand-name { white-space: nowrap; }
/* スマホで作業中は、サポートを右上に置く（下の操作ボタンや入力欄に重ねない） */
@media (max-width: 880px) {
  body.in-flow .support-btn { top: calc(10px + env(safe-area-inset-top)); bottom: auto; width: 40px; min-height: 40px; height: 40px; box-shadow: 0 6px 16px rgba(10, 22, 51, 0.25); }
  body.in-flow .topbar { padding-right: 64px; }
}
.brand-name { white-space: nowrap; }
@media (max-width: 880px) { body.in-flow .topbar .brand-name { display: none; } }
/* お知らせの横幅が半分に縮まないように／輪の中の「%」を数字の横に並べる */
.toast { width: max-content; }
.ring b { display: flex; align-items: baseline; justify-content: center; place-content: initial; align-content: center; flex-wrap: nowrap; }
.ring b { align-items: center; }

/* =====================================================================
   v5：暗い画面のデザイン。
   ・主ボタンは白い面に黒い文字、ほかのボタンは半透明の灰色（押すと少し沈む）
   ・ホームは「大きな帯」と「横に流れるカードの列」。カードは少し遅れて大きくなる
   ・上のバーは、スクロールすると黒くなる
   ・書類の紙だけは白のまま（PDFと同じ見え方にするため）
   ===================================================================== */
html { background: var(--bg); color-scheme: dark; }
body { background: var(--bg); letter-spacing: 0.01em; grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "main"; }
body.has-doc { grid-template-columns: minmax(0, 1fr) var(--aside-w); grid-template-areas: "top top" "main aside"; }
a { color: var(--ink); }
:focus-visible { outline: 3px solid var(--t-solid); outline-offset: 2px; }

/* ---- 上のバー：左に名前とメニュー、右に保存の状態 ---- */
.topbar { padding: 0 4vw; background: linear-gradient(to bottom, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0)); backdrop-filter: none; -webkit-backdrop-filter: none; transition: background-color 400ms ease; }
.topbar.is-shadow { background-color: var(--bg); box-shadow: none; }
.topbar .brand { display: inline-flex; color: var(--t-text); }
.brand-mark { filter: none; }
.bar-title { display: none; }
.save-status { background: rgba(var(--t-ink-rgb), 0.08); border-color: transparent; color: var(--sub); }
.nav { position: fixed; top: 0; left: calc(4vw + 190px); right: auto; z-index: 21; height: var(--top-h); padding: 0; flex-direction: row; align-items: center; gap: 4px; background: none; border: 0; }
.nav .nav-brand { display: none; }
.tabbar { display: flex; gap: 2px; flex: none; }
.tabbar a, .nav-sub { min-height: 40px; padding: 0 12px; font-size: 14.5px; font-weight: 500; color: var(--ink-2); border-radius: 6px; gap: 0; }
.tabbar a svg, .nav-sub svg { display: none; }
.tabbar a:hover, .nav-sub:hover { color: var(--sub); }
.tabbar a.on, .nav-sub.on { color: var(--t-text); font-weight: 800; background: none; }
.tab-ind { top: auto; bottom: 2px; height: 3px; width: calc(var(--w, 0px) - 24px); transform: translate(calc(var(--x, 0px) + 12px), 0); background: var(--blue); border-radius: 3px; }

/* ---- 本文 ---- */
main { padding: 8px 4vw 0; }
.page { max-width: 820px; }
.page.wide { max-width: 1180px; }
.page.home { max-width: none; }
.lead { color: var(--sub); }
.eyebrow { color: var(--blue-ink); }
.crumb, .crumb a { color: var(--label); }

/* ---- ボタン ---- */
.btn { min-height: 46px; padding: 0 22px; border: 0; border-radius: 6px; background: rgba(109, 109, 110, 0.7); color: var(--t-text); font-weight: 800; font-size: 15.5px; letter-spacing: 0.02em; box-shadow: none; transition: transform 120ms ease-out, background-color 200ms ease, opacity 200ms ease; }
.btn:hover { background: rgba(109, 109, 110, 0.4); border: 0; }
.btn:active { transform: scale(0.96); }
.btn svg { transition: transform 240ms var(--spring); }
.btn:hover svg { transform: scale(1.12); }
.btn.primary { background: var(--t-solid); color: var(--t-on-solid); box-shadow: none; }
.btn.primary:hover { background: rgba(var(--t-ink-rgb), 0.75); box-shadow: none; }
.btn.primary svg { fill: currentColor; }
.btn.primary .ripple { background: #141414; opacity: 0.2; }
.btn.big { min-height: 54px; padding: 0 30px; font-size: 18px; border-radius: 6px; }
.btn.small { min-height: 38px; padding: 0 14px; font-size: 14px; border-radius: 4px; background: rgba(109, 109, 110, 0.5); }
.btn.danger { background: #e5352b; color: #fff; }
.btn.danger:hover { background: #c22a22; }
.btn.ghost-danger { background: transparent; color: var(--stop); box-shadow: inset 0 0 0 1px rgba(255, 92, 92, 0.5); }
.btn.ghost-danger:hover { background: var(--stop-soft); }
.icon-btn { background: rgba(var(--t-ink-rgb), 0.1); color: var(--t-text); }
.icon-btn:hover { background: rgba(var(--t-ink-rgb), 0.2); color: var(--t-text); }
.link-btn { color: var(--t-text); }

/* ---- 入力 ---- */
.input { background: var(--t-card-2); border: 1px solid var(--t-line-2); color: var(--t-text); border-radius: 4px; }
.input:hover { border-color: var(--t-mute); }
.input:focus-visible { border-color: var(--t-solid); box-shadow: 0 0 0 2px var(--t-solid); border-radius: 4px; }
select.input { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E"); }
.input[aria-invalid="true"] { border-color: var(--stop); box-shadow: 0 0 0 2px var(--stop); }
.tag-opt { background: var(--t-chip); color: var(--ink-2); }
.tag-req { background: var(--blue); color: #fff; }
.choice { background: var(--card); border: 2px solid transparent; border-radius: 8px; box-shadow: none; }
.choice:hover { background: var(--t-card-2); border-color: var(--t-line-2); box-shadow: none; }
.choice:has(input:checked) { background: var(--t-card-2); border-color: var(--t-solid); box-shadow: none; }
.choice input { background: transparent; border-color: var(--t-mute); }
.choice input::after { border-color: var(--t-on-solid); }
.choice input:checked { background: var(--t-solid); border-color: var(--t-solid); }
.point-card .choice { background: var(--t-card-2); }
.seg-row { background: var(--t-card-2); border-radius: 6px; }
.seg-row label { border-radius: 4px; color: var(--sub); }
.seg-row input:checked + label { color: var(--t-on-solid); }
.seg-ind { background: var(--t-solid); border-radius: 4px; box-shadow: none; }
.check-line input { accent-color: var(--t-solid); }
.advice { background: var(--surface); border: 0; border-left: 3px solid var(--blue); border-radius: 4px; }
.advice-title { color: var(--t-text); }
.advice p { color: var(--ink-2); }
.callout { background: var(--card); border-radius: 6px; }
.callout.warn { background: var(--amber-soft); box-shadow: inset 3px 0 0 var(--amber); }
.badge { border-radius: 3px; background: var(--t-chip); color: var(--t-text); }
.badge.info, .badge.in { background: var(--blue); color: #fff; }
.badge.out { background: var(--t-chip); color: var(--t-text); }
.badge.ok { background: var(--mint-soft); color: var(--mint); }
.badge.warn { background: var(--amber-soft); color: var(--amber); }
.empty { background: var(--surface); border-color: var(--t-chip); border-radius: 8px; }
.brand-tag { color: var(--sub); border-color: var(--t-line-2); background: transparent; }

/* ---- ホーム：大きな帯 ---- */
.page.home > * { animation: none; }
.billboard { position: relative; margin: 0 -4vw 8px; padding: 64px 4vw 56px; min-height: 420px; display: flex; align-items: flex-end; overflow: hidden; background: radial-gradient(70% 120% at 85% 20%, rgba(255, 90, 54, 0.5) 0%, rgba(255, 90, 54, 0) 60%), radial-gradient(60% 100% at 60% 100%, rgba(120, 80, 255, 0.35) 0%, rgba(120, 80, 255, 0) 70%), linear-gradient(120deg, var(--t-hero-a) 0%, var(--t-hero-b) 100%); }
.billboard::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 120px; background: linear-gradient(to bottom, rgba(var(--t-bg-rgb), 0), var(--bg)); pointer-events: none; }
.bb-body { position: relative; z-index: 1; max-width: 620px; }
.bb-body > * { animation: rise 700ms var(--ease) both; }
.bb-body > *:nth-child(2) { animation: line-reveal 800ms var(--ease) 80ms both; }
.bb-body > *:nth-child(3) { animation-delay: 220ms; }
.bb-body > *:nth-child(4) { animation-delay: 320ms; }
.hero-eyebrow { color: var(--t-text); opacity: 0.85; }
.home-title { font-size: clamp(38px, 5.4vw, 64px); line-height: 1.15; margin-bottom: 14px; text-shadow: 0 2px 20px rgba(0, 0, 0, 0.45); }
.billboard .lead { color: var(--t-text); font-size: 18px; margin-bottom: 22px; max-width: 30em; text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5); }
.bb-acts { display: flex; flex-wrap: wrap; gap: 12px; }
.bb-art { position: absolute; right: 4vw; top: 50%; width: min(46vw, 560px); height: 320px; transform: translateY(-50%); }
.bb-art .art { position: absolute; width: 230px; height: 230px; filter: drop-shadow(0 24px 40px rgba(0, 0, 0, 0.55)); animation: bb-in 900ms var(--ease) both, bb-float 7s ease-in-out 900ms infinite; }
.bb-art .art:nth-child(1) { right: 300px; top: 70px; --rot: -10deg; --t: #46d369; animation-delay: 120ms, 1000ms; }
.bb-art .art:nth-child(2) { right: 140px; top: 20px; --rot: 4deg; --t: #ff5a36; z-index: 1; animation-delay: 240ms, 1100ms; }
.bb-art .art:nth-child(3) { right: 0; top: 90px; --rot: 12deg; --t: #b39dff; animation-delay: 360ms, 1200ms; }
@keyframes bb-in { from { opacity: 0; transform: translateY(60px) rotate(0deg) scale(0.9); } to { opacity: 1; transform: rotate(var(--rot)); } }
@keyframes bb-float { 0%, 100% { transform: rotate(var(--rot)) translateY(0); } 50% { transform: rotate(var(--rot)) translateY(-10px); } }

/* ---- ホーム：横に流れる列 ---- */
.row-sec { margin: 0 -4vw 26px; animation: rise 600ms var(--ease) 300ms both; }
.row-sec + .row-sec { animation-delay: 380ms; }
.row-title { margin: 0 4vw 10px; font-size: 21px; font-weight: 800; display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.row-note { font-size: 13.5px; font-weight: 500; color: var(--sub); }
.row { display: grid; grid-auto-flow: column; gap: 8px; overflow-x: auto; overflow-y: visible; padding: 18px 4vw 26px; margin: -18px 0 -26px; scroll-snap-type: x proximity; scroll-padding-left: 4vw; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.row::-webkit-scrollbar { display: none; }
.row > li { scroll-snap-align: start; animation: none; }
.tiles { grid-template-columns: none; grid-auto-columns: minmax(250px, 1fr); }
.tiles > li { animation: rise 600ms var(--ease) both; animation-delay: calc(340ms + var(--i, 0) * 80ms); perspective: none; }
/* カード：少し遅れて大きくなり、影が付く */
.tile { --g1: #ff5a36; --g2: #7a1f0f; --t: #fff; min-height: 232px; grid-template-columns: minmax(0, 1fr); grid-template-rows: 1fr auto auto; gap: 6px; padding: 16px 16px 14px; border: 0; border-radius: 6px; color: #fff; background: linear-gradient(150deg, var(--g1) 0%, var(--g2) 100%); box-shadow: none; transition: transform 320ms var(--ease) 60ms, box-shadow 320ms ease 60ms; }
.tile-A { --g1: #ff6a3d; --g2: #6e1a0c; }
.tile-B { --g1: #2bbd72; --g2: #0b3d26; }
.tile-C { --g1: #4a7dff; --g2: #121f52; }
.tile-D { --g1: #9a6bff; --g2: #2a1560; }
.tile::before { right: auto; left: 0; top: auto; bottom: 0; width: 100%; height: 72%; border-radius: 0; background: linear-gradient(to top, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0)); transform: none; }
.tile:hover, .tile:focus-visible { transform: scale(1.07); box-shadow: var(--shadow-2); z-index: 3; }
.tile:hover::before, .tile:focus-visible::before { transform: none; }
.tile:active { transform: scale(1.02); transition-delay: 0s; }
.tile.picked { box-shadow: 0 0 0 3px #fff; }
.tile .art { --t: #fff; grid-column: 1; grid-row: 1; justify-self: end; align-self: start; width: 116px; height: 116px; opacity: 0.95; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.35)); }
.tile:hover .art, .tile:focus-visible .art { transform: translateY(-4px) rotate(-5deg) scale(1.06); }
.tile .art .a-line.strong, .tile .art .a-check, .tile .art .a-seal, .tile .art .a-flow, .tile .art .a-node { stroke: var(--g2); }
.tile .art .a-bar, .tile .art .a-node.me, .tile .art .a-mark { fill: var(--g1); }
.tile .art .a-check.white, .tile .art-D .a-check { stroke: #fff; }
.tile-body { grid-column: 1; grid-row: 2; }
.tile-label { font-size: 20px; color: #fff; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5); }
.tile-hint { color: rgba(255, 255, 255, 0.86); font-size: 13.5px; }
.tile-go { grid-row: 3; background: #fff; color: #141414; border-radius: 4px; padding: 7px 14px 7px 10px; font-size: 14px; gap: 6px; margin-top: 6px; }
.tile-go svg { fill: currentColor; }
.tile:hover .tile-go svg { transform: scale(1.15); }
.app-icon { background: linear-gradient(145deg, var(--g1), var(--g2)); border-radius: 8px; box-shadow: none; width: 40px; height: 40px; }

.conts { grid-auto-columns: minmax(270px, 320px); }
.cont { position: relative; display: grid; gap: 6px; height: 100%; min-height: 150px; padding: 14px 16px 22px; border-radius: 6px; background: var(--card); color: var(--t-text); text-decoration: none; overflow: hidden; transition: transform 320ms var(--ease) 60ms, box-shadow 320ms ease 60ms, background-color 200ms ease; }
.cont:hover, .cont:focus-visible { transform: scale(1.05); box-shadow: var(--shadow-2); background: var(--t-card-2); z-index: 3; }
.cont:active { transform: scale(0.99); transition-delay: 0s; }
.cont-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cont-title { font-weight: 800; font-size: 17px; line-height: 1.45; }
.cont-sub { font-size: 13.5px; color: var(--sub); }
/* 進み具合の線（途中の作業は、ここまで進んだかが下の線で分かる） */
.cont-bar { position: absolute; left: 16px; right: 16px; bottom: 10px; height: 4px; background: #595959; border-radius: 2px; overflow: hidden; }
.cont-bar i { display: block; height: 100%; background: var(--blue); transform-origin: left center; transform: scaleX(var(--v)); animation: grow-x 900ms var(--ease) 500ms backwards; }

.kcards { grid-auto-columns: minmax(150px, 172px); }
.kcard { display: grid; gap: 8px; align-content: space-between; height: 100%; min-height: 128px; padding: 14px; border-radius: 6px; background: var(--card); color: var(--t-text); text-decoration: none; transition: transform 300ms var(--ease) 60ms, box-shadow 300ms ease 60ms, background-color 200ms ease; }
.kcard:hover, .kcard:focus-visible { transform: scale(1.08); background: var(--t-card-2); box-shadow: var(--shadow-2); z-index: 3; }
.kcard:active { transform: scale(1); transition-delay: 0s; }
.kcard-yen { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--blue-soft); color: var(--blue-ink); transition: transform 320ms var(--spring); }
.kcard:hover .kcard-yen { transform: rotate(-12deg) scale(1.12); }
.kcard-label { font-weight: 800; font-size: 16.5px; line-height: 1.4; }
.kcard-go { font-size: 12.5px; color: var(--sub); }
.kcard.more { background: transparent; box-shadow: inset 0 0 0 1.5px var(--t-line-2); }

.minis { margin: 0 4vw; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mini { background: var(--card); border: 0; border-radius: 6px; color: var(--t-text); box-shadow: none; }
.mini:hover { transform: scale(1.02); background: var(--t-card-2); box-shadow: var(--shadow-1); }
.mini-icon, .minis li:first-child .mini-icon { background: rgba(var(--t-ink-rgb), 0.1); color: var(--t-text); border-radius: 50%; }
.mini-hint { color: var(--sub); }
.mini > svg:last-child { color: var(--label); }
.mini:hover > svg:last-child { color: var(--t-text); }
.first { margin: 0 4vw 30px; background: var(--surface); border: 0; border-radius: 8px; box-shadow: none; }
.first-title .en { color: var(--blue-ink); }
.first-steps li { color: var(--sub); }
.first-steps strong { color: var(--t-text); }
.first-n { background: var(--t-solid); color: var(--t-on-solid); border-radius: 4px; }
.home-note { margin: 34px 4vw 0; color: var(--label); }

/* ---- 作業の画面 ---- */
.phases li { color: var(--label); }
.phases li.now { color: var(--t-text); }
.ph-n { background: var(--t-chip); color: var(--sub); }
.phases li.past .ph-n { background: var(--t-line-2); color: var(--t-text); }
.phases li.past:not(:last-child)::after { background: var(--blue); }
.phases li:not(:last-child)::after { background: var(--t-chip); }
.phases li.now .ph-n { background: var(--blue); color: var(--t-text); box-shadow: 0 0 0 4px var(--blue-soft); }
.qprog { background: var(--t-chip); height: 4px; border-radius: 2px; }
.qprog-fill { background: var(--blue); border-radius: 2px; }
.qprog-label .en { color: var(--blue-ink); }
.coach { background: var(--surface); border: 0; border-radius: 8px; box-shadow: none; }
.coach-title .en { color: var(--blue-ink); }
.coach li::before { background: var(--t-chip); color: var(--t-text); border-radius: 4px; }
.case-foot { background: linear-gradient(to bottom, rgba(var(--t-bg-rgb), 0), var(--bg) 30%); }
.ring .bg { stroke: var(--t-chip); }
.ring .fg { stroke: var(--blue); }
.plan-list, .answers, .quick-add, .three, .chart-card, .point-card, .export, .case-list, .keihi-panel, .date-card, .dup-card, .task-list li, .stat { background: var(--surface); border: 0; border-radius: 8px; box-shadow: none; }
.plan-list > li + li, .three li + li, .case-list li + li, .answer-list > div, .dup-row, .q-picker, .editor-block, .source-line, .export-details, .gloss { border-color: var(--t-card-2); }
.plan-list > li:hover, .case-list li:hover { background: var(--t-card); }
.plan-n { background: var(--t-chip); color: var(--t-text); border-radius: 4px; }
.plan-list li.done .plan-n { background: var(--mint); color: #141414; }
.plan-title a, .case-link { color: var(--t-text); }
.plan-title a:hover { color: var(--blue-ink); }
.tx-table { background: var(--surface); border: 0; border-radius: 8px; box-shadow: none; }
.tx-table th { background: var(--t-card); border-color: var(--t-card-2); color: var(--sub); }
.tx-table td { border-color: var(--t-card-2); }
.tx-table tbody tr:hover { background: var(--t-card); }
.suggest { border-color: rgba(255, 130, 102, 0.6); background: var(--blue-soft); color: var(--t-text); }
.suggest-go { background: var(--t-solid); color: var(--t-on-solid); border-radius: 3px; }
.stat::before, .stat:nth-child(2)::before, .stat:nth-child(3)::before { right: auto; left: 0; top: 0; width: 100%; height: 3px; border-radius: 0; background: var(--blue); transform-origin: left center; animation: grow-x 900ms var(--ease) 200ms both; }
.stat:nth-child(2)::before { background: var(--grape); }
.stat:nth-child(3)::before { background: var(--mint); }
.three strong { color: var(--t-text); }
.three strong::before { background: var(--t-solid); color: var(--t-on-solid); border-radius: 4px; }
.bar-track { background: var(--t-chip); }
.bar-fill { background: linear-gradient(90deg, var(--blue), #ff8f73); }
.bar-fill.muted { background: var(--t-mute); }
.bar-pick { color: var(--t-text); }
.mchart .axis { stroke: var(--t-chip); }
.mchart .bar-in { fill: var(--t-solid); }
.mchart .bar-out { fill: var(--blue); }
.key::before { background: var(--t-solid); }
.key.out::before { background: var(--blue); }
.tag-list li { background: var(--t-chip); }
.k-n { background: var(--t-solid); color: var(--t-on-solid); border-radius: 4px; }
.k-card { background: var(--card); border: 0; border-radius: 8px; box-shadow: inset 0 4px 0 var(--t-line-2); }
.k-card.ok { background: linear-gradient(180deg, rgba(70, 211, 105, 0.2) 0, var(--card) 130px); box-shadow: inset 0 4px 0 var(--mint); }
.k-card.warn { background: linear-gradient(180deg, rgba(255, 176, 32, 0.2) 0, var(--card) 130px); box-shadow: inset 0 4px 0 var(--amber); }
.k-card.stop { background: linear-gradient(180deg, rgba(255, 92, 92, 0.2) 0, var(--card) 130px); box-shadow: inset 0 4px 0 var(--stop); }
.k-card.info { background: linear-gradient(180deg, rgba(var(--t-ink-rgb), 0.12) 0, var(--card) 130px); box-shadow: inset 0 4px 0 var(--t-solid); }
.k-card.info .k-answer { color: var(--t-text); }
.k-target, .csv-summary { background: var(--card); border-radius: 6px; }
.chip { background: transparent; border: 1.5px solid var(--t-line-2); color: var(--t-text); border-radius: 999px; }
.chip:hover { border-color: var(--t-solid); color: var(--t-text); background: rgba(var(--t-ink-rgb), 0.08); }
.chip.on { background: var(--t-solid); border-color: var(--t-solid); color: var(--t-on-solid); }
.chip.quick { background: rgba(var(--t-ink-rgb), 0.1); border-color: transparent; color: var(--t-text); }
.chip.quick:hover { background: rgba(var(--t-ink-rgb), 0.22); }
.tabs { background: var(--t-card-2); border-radius: 6px; }
.tabs a { border-radius: 4px; color: var(--sub); }
.tabs a.on { background: var(--t-solid); color: var(--t-on-solid); box-shadow: none; }
.success circle { fill: var(--mint-soft); }

/* ---- 書類：ここだけ白い紙 ---- */
.doc, .art { --ink: #141414; --sub: #5c6785; --line: #e3e7f0; --line-2: #c9d0de; --paper: #f4f5f8; --hover: #eef0f5; --card: #eef0f5; --surface: #fff; }
.doc { background: #fff; color: #141414; border: 0; border-radius: 4px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6); }
.doc a { color: #1a3fd1; }
.doc-h { border-left-color: var(--blue); }
.doc-table th { background: #f4f5f8; }
.doc .bar-track { background: #e3e7f0; }
.doc .bar-fill { background: #141414; }
.doc .bar-fill.muted { background: #9aa4bb; }
.aside-title { color: var(--blue-ink); }

/* ---- 重なる物 ---- */
.support-btn { background: var(--t-solid); color: var(--t-on-solid); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6); border-radius: 999px; }
.support-btn svg { stroke: var(--t-on-solid); }
.support-btn .ripple { background: #141414; opacity: 0.2; }
.support h3 { color: var(--blue-ink); }
.dlg { background: var(--t-surface); color: var(--t-text); border-radius: 8px; box-shadow: 0 30px 90px rgba(0, 0, 0, 0.8); }
.dlg::backdrop { background: rgba(0, 0, 0, 0.72); }
.dlg-head, .dlg-foot { border-color: var(--t-card-2); }
.dlg-foot { background: var(--t-surface); }
.toast { background: var(--t-solid); color: var(--t-on-solid); border-radius: 6px; font-weight: 700; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7); }
.toast::after { border-color: var(--t-on-solid); }
.confetti i { background: var(--blue); }

@media (max-width: 1279px) {
  body.has-doc { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "main"; }
  body.has-doc .aside { background: var(--t-surface); }
}

/* =====================================================================
   スマホ：指で押しやすい大きさと、読みやすい文字の大きさ
   ===================================================================== */
@media (max-width: 880px) {
  body { font-size: 17px; line-height: 1.75; }
  .topbar { padding: 0 16px; background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0)); }
  .nav { position: fixed; left: 0; right: 0; top: auto; bottom: 0; height: auto; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: rgba(var(--t-bg-rgb), 0.96); border-top: 1px solid var(--t-card); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .tabbar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; gap: 0; }
  .tabbar a { min-height: 56px; padding: 4px 2px; font-size: 12px; font-weight: 600; color: var(--label); gap: 3px; }
  .tabbar a svg { display: block; width: 26px; height: 26px; }
  .tabbar a.on { color: var(--t-text); }
  .tab-ind { top: 0; bottom: auto; height: 3px; width: 32px; transform: translate(calc(var(--x, 0px) + var(--w, 0px) / 2 - 16px), -6px); }
  main { padding: 6px 16px 0; }
  h1 { font-size: 28px; line-height: 1.35; }
  .case-body h1 { font-size: 26px; }
  .lead { font-size: 16.5px; }
  .field-hint, .choice-hint, .plan-reason, .tile-hint, .mini-hint, .cont-sub { font-size: 14.5px; }
  .field > label, .choices > legend, .seg > legend { font-size: 15.5px; }
  .btn { min-height: 54px; font-size: 17px; padding: 0 20px; }
  .btn.small { min-height: 44px; font-size: 15px; padding: 0 14px; }
  .btn.big { min-height: 56px; font-size: 18px; flex: 1 1 auto; }
  .input { min-height: 56px; font-size: 17px; }
  .choice { min-height: 68px; padding: 16px; gap: 14px; }
  .choice-label { font-size: 17px; }
  .choice input { width: 28px; height: 28px; }
  .choice.compact { min-height: 56px; }
  .choice.compact .choice-label { font-size: 16px; }
  .seg-row { display: flex; width: 100%; }
  .seg-row label { flex: 1 1 auto; justify-content: center; min-height: 48px; font-size: 15.5px; padding: 0 10px; }
  .check-line { font-size: 16.5px; min-height: 52px; }
  .check-line input { width: 26px; height: 26px; }
  .chip { min-height: 46px; font-size: 15.5px; padding: 0 18px; }
  .badge { font-size: 12.5px; padding: 6px 9px; }
  .billboard { margin: 0 -16px 4px; padding: 30px 16px 40px; min-height: 0; display: block; }
  .bb-art { position: relative; right: auto; top: auto; transform: none; width: 100%; height: 190px; margin-bottom: 6px; }
  .bb-art .art { width: 150px; height: 150px; }
  .bb-art .art:nth-child(1) { right: auto; left: 2%; top: 30px; }
  .bb-art .art:nth-child(2) { right: auto; left: 50%; margin-left: -75px; top: 6px; }
  .bb-art .art:nth-child(3) { right: 2%; top: 36px; }
  .home-title { font-size: 38px; }
  .billboard .lead { font-size: 17px; }
  .row-sec { margin: 0 -16px 22px; }
  .row-title { margin: 0 16px 8px; font-size: 20px; }
  .row { padding: 12px 16px 20px; margin: -12px 0 -20px; scroll-padding-left: 16px; scroll-snap-type: x mandatory; gap: 10px; }
  /* 次のカードが少し見えるようにして、横に動かせることを伝える */
  .tiles { grid-template-columns: none; grid-auto-columns: 78vw; }
  .conts { grid-auto-columns: 78vw; }
  .kcards { grid-auto-columns: 40vw; }
  .tile { min-height: 236px; padding: 16px; grid-template-columns: minmax(0, 1fr); }
  .tile .art { width: 110px; height: 110px; }
  .tile-label { font-size: 21px; }
  .tile-go { font-size: 15.5px; padding: 10px 18px 10px 14px; }
  .tile:hover, .cont:hover, .kcard:hover { transform: none; box-shadow: none; }
  .tile:active, .cont:active, .kcard:active { transform: scale(0.97); }
  .kcard { min-height: 136px; }
  .kcard-label { font-size: 17px; }
  .kcard-go { font-size: 13.5px; }
  .minis, .first, .home-note { margin-left: 16px; margin-right: 16px; }
  .minis { grid-template-columns: minmax(0, 1fr); }
  .mini { min-height: 88px; }
  .mini-label { font-size: 17px; }
  .qprog-label { font-size: 14px; }
  .coach li { font-size: 16px; }
  .plan-title { font-size: 17px; }
  .tx-table { font-size: 16px; }
  .tx-table td::before { font-size: 13.5px; }
  .doc { font-size: 14.5px; }
  .doc-main { font-size: 15.5px; }
  .dlg, .dlg.wide { border-radius: 14px 14px 0 0; }
  .dlg-grip::before { background: var(--t-line-2); }
  .dlg-head h2 { font-size: 20px; }
  .toast { font-size: 15.5px; width: auto; left: 16px; right: 16px; max-width: none; transform: translateY(24px); }
  .toast.show { transform: none; }
  .support-btn { width: 56px; min-height: 56px; }
  body.in-flow .support-btn { width: 44px; min-height: 44px; height: 44px; }
  body.in-flow .topbar { padding-right: 70px; }
}

/* スクロールしたら、上のバーを黒い面にする（スマホでも） */
.topbar.is-shadow { background: var(--bg); }
@media (max-width: 880px) { .topbar.is-shadow { background: var(--bg); } }

/* =====================================================================
   v6：文字をやわらかく（丸ゴシック）、入力欄と主ボタンまわりの枠をガラスのように
   ===================================================================== */
:root {
  --font: ui-rounded, "Hiragino Maru Gothic ProN", "Zen Maru Gothic", "M PLUS Rounded 1c", "Kosugi Maru", "BIZ UDPGothic", -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
  --num: ui-rounded, "SF Pro Rounded", "Hiragino Maru Gothic ProN", -apple-system, "Hiragino Sans", system-ui, sans-serif;
  --glass: linear-gradient(180deg, rgba(var(--t-ink-rgb), 0.075), rgba(var(--t-ink-rgb), 0.025));
  --hair: rgba(var(--t-ink-rgb), 0.12);
  --ring: linear-gradient(120deg, #ff7a52, #ff4d8d 45%, #9d8bff);
}
body { letter-spacing: 0.03em; font-weight: 400; }
h1, h2, h3, .tile-label, .cont-title, .kcard-label, .mini-label, .plan-title, .choice-label, .btn, .row-title { font-weight: 700; }
h1 { letter-spacing: 0.02em; }
.home-title { font-weight: 700; letter-spacing: 0.02em; }

/* ---- 入力欄：ガラスの面。選ぶと、ふちに色の光が回る ---- */
.input {
  min-height: 54px; padding: 12px 16px; border-radius: 16px; border: 1.5px solid transparent; color: var(--t-text);
  background: linear-gradient(var(--t-surface), var(--t-surface)) padding-box, linear-gradient(180deg, rgba(var(--t-ink-rgb), 0.26), rgba(var(--t-ink-rgb), 0.08)) border-box;
  box-shadow: inset 0 1px 0 rgba(var(--t-ink-rgb), 0.06), 0 6px 18px rgba(0, 0, 0, 0.28);
  transition: box-shadow 260ms ease, background 260ms ease;
}
.input:hover { border-color: transparent; background: linear-gradient(var(--t-surface), var(--t-surface)) padding-box, linear-gradient(180deg, rgba(var(--t-ink-rgb), 0.4), rgba(var(--t-ink-rgb), 0.14)) border-box; }
.input:focus-visible { outline: none; border-color: transparent; border-radius: 16px; background: linear-gradient(var(--t-surface), var(--t-surface)) padding-box, var(--ring) border-box; box-shadow: 0 0 0 4px rgba(255, 90, 54, 0.16), 0 10px 30px rgba(255, 77, 141, 0.22); }
.input[aria-invalid="true"] { background: linear-gradient(var(--t-surface), var(--t-surface)) padding-box, linear-gradient(120deg, #ff5c5c, #ff8a5c) border-box; box-shadow: 0 0 0 4px rgba(255, 92, 92, 0.16); }
.input::placeholder { color: var(--t-mute); }
select.input { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") right 14px center / 18px no-repeat padding-box, linear-gradient(#232323, #1c1c1c) padding-box, linear-gradient(180deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.08)) border-box; }
select.input:focus-visible { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") right 14px center / 18px no-repeat padding-box, linear-gradient(#262626, #1e1e1e) padding-box, var(--ring) border-box; }
.field > label { color: var(--ink-2); letter-spacing: 0.04em; }
.tag-opt, .tag-req { border-radius: 999px; padding: 0 9px; }

/* ---- 主ボタン：白い丸い面に、色の光の輪。光の帯が横切る ---- */
.btn { border-radius: 999px; background: rgba(var(--t-ink-rgb), 0.1); box-shadow: inset 0 0 0 1px rgba(var(--t-ink-rgb), 0.22); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.btn:hover { background: rgba(var(--t-ink-rgb), 0.18); box-shadow: inset 0 0 0 1px rgba(var(--t-ink-rgb), 0.5); }
.btn.small { border-radius: 999px; background: rgba(var(--t-ink-rgb), 0.08); }
.btn.primary { background: var(--t-solid); color: var(--t-on-solid); box-shadow: 0 0 0 1.5px rgba(var(--t-ink-rgb), 0.9), 0 0 0 5px rgba(255, 90, 54, 0.22), 0 14px 34px rgba(255, 77, 141, 0.3); }
.btn.primary:hover { background: var(--t-solid); box-shadow: 0 0 0 1.5px var(--t-solid), 0 0 0 7px rgba(255, 90, 54, 0.3), 0 18px 44px rgba(255, 77, 141, 0.42); }
.btn.primary::before { content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 46%; background: linear-gradient(100deg, rgba(var(--t-ink-rgb), 0), rgba(255, 122, 82, 0.35), rgba(157, 139, 255, 0.3), rgba(var(--t-ink-rgb), 0)); transform: skewX(-18deg); pointer-events: none; animation: sheen 3.6s ease-in-out 1.2s infinite; }
@keyframes sheen { 0% { left: -60%; } 38%, 100% { left: 130%; } }
.btn.primary.big { padding: 0 34px; }
.btn.danger { background: #e5352b; box-shadow: none; }
.btn.ghost-danger { background: transparent; }
.tile-go { border-radius: 999px; }
.support-btn { box-shadow: 0 0 0 5px rgba(var(--t-ink-rgb), 0.12), 0 12px 30px rgba(0, 0, 0, 0.6); }

/* ---- 主ボタンを載せる下の枠：浮いたガラスの台 ---- */
.case-foot { margin-top: 36px; bottom: 12px; padding: 12px 14px; border-radius: 26px; background: rgba(var(--t-bg-rgb), 0.72); box-shadow: inset 0 0 0 1px var(--hair), 0 20px 50px rgba(0, 0, 0, 0.6); backdrop-filter: saturate(1.4) blur(18px); -webkit-backdrop-filter: saturate(1.4) blur(18px); align-items: center; }
.skip-note { color: var(--label); }

/* ---- 面：うすいガラスと細い光のふち ---- */
.choice { border-radius: 18px; border: 1.5px solid transparent; background: linear-gradient(var(--t-surface), var(--t-surface)) padding-box, linear-gradient(180deg, rgba(var(--t-ink-rgb), 0.16), rgba(var(--t-ink-rgb), 0.05)) border-box; }
.choice:hover { border-color: transparent; background: linear-gradient(var(--t-card), var(--t-surface)) padding-box, linear-gradient(180deg, rgba(var(--t-ink-rgb), 0.34), rgba(var(--t-ink-rgb), 0.1)) border-box; }
.choice:has(input:checked) { border-color: transparent; background: linear-gradient(var(--t-card), var(--t-card)) padding-box, var(--ring) border-box; box-shadow: 0 10px 30px rgba(255, 77, 141, 0.18); }
.choice input:checked { background: var(--t-solid); border-color: var(--t-solid); }
.choice.compact { border-radius: 14px; }
.point-card .choice { background: linear-gradient(var(--t-card), var(--t-surface)) padding-box, linear-gradient(180deg, rgba(var(--t-ink-rgb), 0.16), rgba(var(--t-ink-rgb), 0.05)) border-box; }
.plan-list, .answers, .quick-add, .three, .chart-card, .point-card, .export, .case-list, .keihi-panel, .date-card, .dup-card, .task-list li, .stat, .coach, .first, .tx-table, .k-card, .cont, .kcard, .mini, .advice, .callout, .empty {
  border-radius: 20px; box-shadow: inset 0 0 0 1px var(--hair);
}
.plan-list, .answers, .quick-add, .three, .chart-card, .point-card, .export, .case-list, .keihi-panel, .date-card, .dup-card, .task-list li, .stat, .coach, .first, .cont, .kcard, .mini { background: var(--glass), var(--t-surface); }
.advice { border-left: 0; box-shadow: inset 0 0 0 1px var(--hair), inset 3px 0 0 var(--blue); }
.k-card { box-shadow: inset 0 0 0 1px var(--hair), inset 0 4px 0 var(--t-line-2); }
.k-card.ok { box-shadow: inset 0 0 0 1px rgba(70, 211, 105, 0.35), inset 0 4px 0 var(--mint); }
.k-card.warn { box-shadow: inset 0 0 0 1px rgba(255, 176, 32, 0.35), inset 0 4px 0 var(--amber); }
.k-card.stop { box-shadow: inset 0 0 0 1px rgba(255, 92, 92, 0.35), inset 0 4px 0 var(--stop); }
.tile { border-radius: 20px; }
.seg-row, .tabs { border-radius: 999px; padding: 5px; background: rgba(var(--t-ink-rgb), 0.08); box-shadow: inset 0 0 0 1px var(--hair); }
.seg-row label, .tabs a, .seg-ind { border-radius: 999px; }
.badge { border-radius: 999px; }
.dlg { border-radius: 26px; box-shadow: inset 0 0 0 1px var(--hair), 0 30px 90px rgba(0, 0, 0, 0.8); }
.toast { border-radius: 999px; }
.doc { border-radius: 10px; }
.qprog, .qprog-fill, .cont-bar { border-radius: 999px; }
.qprog-fill, .cont-bar i, .tab-ind { background: var(--ring); }
.kcard-yen, .mini-icon { box-shadow: inset 0 0 0 1px var(--hair); }

@media (max-width: 880px) {
  .input { min-height: 58px; font-size: 17px; border-radius: 18px; }
  .case-foot { bottom: 8px; padding: 10px; border-radius: 24px; gap: 8px; }
  .dlg, .dlg.wide { border-radius: 26px 26px 0 0; }
  .toast { border-radius: 20px; }
}
@media (prefers-reduced-motion: reduce) { .btn.primary::before { display: none; } }
.btn.big, .btn.primary, .btn.small { border-radius: 999px; }
/* 下のタブの後ろに、本文が透けて見えないようにする */
@media (max-width: 880px) { .nav { background: var(--t-bar) !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; } }

/* 控えの案内（月が替わって最初に開いたとき、ホームに1回だけ出す） */
.backup-card { display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin: 0 0 30px; padding: 18px 22px; border-radius: 20px; background: linear-gradient(var(--t-surface), var(--t-surface)) padding-box, var(--ring) border-box; border: 1.5px solid transparent; animation: rise 600ms var(--ease) 200ms both; }
.backup-title { font-weight: 700; font-size: 18px; }
.backup-text { font-size: 14.5px; color: var(--sub); max-width: 38em; }
.backup-acts { display: flex; gap: 10px; flex-wrap: wrap; }
.backup-sec { padding: 20px 22px; border-radius: 20px; background: var(--glass), var(--t-surface); box-shadow: inset 0 0 0 1px var(--hair); margin-bottom: 20px; }
.backup-sec h2 { margin-top: 0; }
@media (max-width: 880px) {
  .backup-card { padding: 18px 16px; }
  .backup-acts { width: 100%; }
  .backup-acts .btn { flex: 1 1 auto; }
  .backup-text { font-size: 15.5px; }
}

/* 資料置き場 */
.filter-row.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin: 10px 0 18px; }
.file-grid.slim { grid-template-columns: minmax(0, 1fr); }
.file-card { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; padding: 12px; border-radius: 20px; background: var(--glass), var(--t-surface); box-shadow: inset 0 0 0 1px var(--hair); animation: rise 420ms var(--ease) both; }
.file-thumb { width: 96px; height: 96px; padding: 0; border: 0; border-radius: 14px; overflow: hidden; background: var(--t-card-2); cursor: pointer; display: grid; place-items: center; transition: transform 200ms var(--ease); }
.file-thumb:hover { transform: scale(1.04); }
.file-thumb:active { transform: scale(0.96); }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.file-kind { font-family: var(--num); font-weight: 700; font-size: 15px; letter-spacing: 0.08em; color: #fff; padding: 6px 10px; border-radius: 8px; background: var(--ring); }
.file-body { display: grid; gap: 6px; min-width: 0; align-content: start; }
.file-name { font-weight: 700; overflow-wrap: anywhere; line-height: 1.45; }
.file-meta { font-size: 13px; color: var(--sub); }
.file-body .input { min-height: 44px; padding: 8px 12px; font-size: 15px; border-radius: 12px; }
.file-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.file-view img { display: block; max-width: 100%; max-height: 70dvh; margin: 0 auto; border-radius: 12px; }
.tx-files h3 { margin-bottom: 10px; }
.tx-files { padding-bottom: 8px; }
@media (max-width: 880px) {
  .file-grid { grid-template-columns: minmax(0, 1fr); }
  .filter-row.two { grid-template-columns: minmax(0, 1fr); }
  .file-card { grid-template-columns: 84px minmax(0, 1fr); }
  .file-thumb { width: 84px; height: 84px; }
  .file-body .input { min-height: 50px; font-size: 16px; }
  .file-meta { font-size: 14px; }
  .minis { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 881px) { .minis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* =====================================================================
   v7：となりの事務さん（ロゴと、自転車をこぐキャラクター）
   こぐ動き：体が小さく上下し、少し前に傾く。後ろに土けむり、横に風の線、下を道が流れる。
   ===================================================================== */
.brand-logo { height: 44px; width: auto; display: block; filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5)); transition: transform 300ms var(--spring); }
.brand:hover .brand-logo { transform: scale(1.06) rotate(-2deg); }
.nav { left: calc(4vw + 130px); }

.rider { position: relative; width: min(100%, 420px); aspect-ratio: 1000 / 720; margin: 0 auto; }
.rider-img { position: absolute; left: 0; top: 0; width: 100%; height: auto; transform-origin: 50% 90%; animation: pedal 300ms ease-in-out infinite alternate; filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.35)); }
@keyframes pedal { from { transform: translateY(0) rotate(-1.4deg); } to { transform: translateY(-2.2%) rotate(1.2deg); } }
/* 道：点線が右から左へ流れる */
.rider-road { position: absolute; left: -6%; right: -6%; bottom: 1%; height: 5px; border-radius: 999px; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.85) 0 34px, rgba(255, 255, 255, 0) 34px 68px); animation: road 520ms linear infinite; opacity: 0.7; -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent); mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent); }
@keyframes road { to { background-position: -68px 0; } }
/* 風の線 */
.rider-lines i { position: absolute; left: -8%; height: 4px; border-radius: 999px; background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.9)); animation: wind 700ms linear infinite; }
.rider-lines i:nth-child(1) { top: 24%; width: 22%; }
.rider-lines i:nth-child(2) { top: 46%; width: 16%; animation-delay: 230ms; }
.rider-lines i:nth-child(3) { top: 66%; width: 26%; animation-delay: 460ms; }
@keyframes wind { 0% { transform: translateX(60%); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateX(-120%); opacity: 0; } }
/* 土けむり */
.rider-puffs i { position: absolute; left: 6%; bottom: 8%; width: 9%; aspect-ratio: 1; border-radius: 50%; background: #f1e3cf; animation: puff 900ms ease-out infinite; }
.rider-puffs i:nth-child(2) { animation-delay: 300ms; bottom: 13%; }
.rider-puffs i:nth-child(3) { animation-delay: 600ms; bottom: 5%; }
@keyframes puff { 0% { transform: translate(60%, 0) scale(0.3); opacity: 0.95; } 100% { transform: translate(-190%, -70%) scale(1.5); opacity: 0; } }

/* 開いたときの最初の画面 */
.splash { position: fixed; inset: 0; z-index: 2147483600; display: grid; align-content: center; justify-items: center; gap: 6px; padding: 24px; overflow: hidden; background: radial-gradient(80% 60% at 50% 40%, #fff3d8 0%, #ffe2b8 55%, #ffc98f 100%); transition: opacity 480ms ease, transform 520ms var(--ease); }
.splash.out { opacity: 0; transform: scale(1.06); pointer-events: none; }
.splash.skip { transition: none; display: none; }
.splash-logo { width: min(74vw, 420px); height: auto; animation: logo-in 700ms var(--spring) both; }
@keyframes logo-in { from { opacity: 0; transform: translateY(24px) scale(0.7) rotate(-6deg); } to { opacity: 1; transform: none; } }
.splash .rider { width: min(78vw, 400px); animation: ride-in 900ms var(--ease) 200ms both; }
@keyframes ride-in { from { transform: translateX(-120vw); } to { transform: none; } }
.splash .rider-road { background: repeating-linear-gradient(90deg, #0b1b3a 0 34px, rgba(11, 27, 58, 0) 34px 68px); opacity: 0.55; }
.splash .rider-lines i { background: linear-gradient(90deg, rgba(11, 27, 58, 0), rgba(11, 27, 58, 0.55)); }
.splash .rider-puffs i { background: #fff; }
.splash .rider-img { filter: drop-shadow(0 16px 18px rgba(120, 70, 20, 0.28)); }
.splash-say { margin-top: 8px; font-weight: 700; font-size: 20px; color: #0b1b3a; letter-spacing: 0.08em; animation: rise 500ms var(--ease) 900ms both; }

/* 待っている間の画面（PDFや控えを作っているとき） */
.loader { position: fixed; inset: 0; z-index: 2147483500; display: grid; place-items: center; padding: 24px; background: rgba(10, 10, 10, 0.82); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); animation: fade 220ms ease both; transition: opacity 300ms ease; }
.loader.out { opacity: 0; }
.loader-box { width: min(92vw, 380px); text-align: center; animation: dlg 320ms var(--ease) both; }
.loader .rider { width: min(74vw, 300px); }
.loader-say { margin-top: 10px; font-weight: 700; font-size: 19px; letter-spacing: 0.06em; }
.loader-text { margin-top: 2px; color: var(--sub); font-size: 15.5px; }

/* ホームのいちばん上：右から事務さんが走ってくる */
.bb-art { display: grid; align-items: end; }
.rider.hero { width: 100%; max-width: 520px; margin-left: auto; animation: ride-in-r 1000ms var(--ease) 200ms both; }
@keyframes ride-in-r { from { transform: translateX(-70vw); opacity: 0; } to { transform: none; opacity: 1; } }
.bb-say { position: absolute; right: 2%; top: -4%; z-index: 2; padding: 12px 18px; border-radius: 22px 22px 22px 6px; background: #fff; color: #0b1b3a; font-weight: 700; font-size: 17px; line-height: 1.45; box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45); transform-origin: left bottom; animation: pop 520ms var(--spring) 1100ms both; }
.billboard { background: radial-gradient(70% 120% at 85% 20%, rgba(255, 90, 54, 0.42) 0%, rgba(255, 90, 54, 0) 60%), radial-gradient(60% 100% at 60% 100%, rgba(255, 190, 90, 0.26) 0%, rgba(255, 190, 90, 0) 70%), linear-gradient(120deg, var(--t-hero-a) 0%, var(--t-hero-b) 100%); }
.hero-eyebrow { font-size: 14px; letter-spacing: 0.14em; }

@media (max-width: 880px) {
  .brand-logo { height: 40px; }
  .nav { left: 0; }
  .bb-art { height: auto; margin-bottom: 4px; padding-top: 34px; }
  .rider.hero { max-width: 320px; margin: 0 auto; }
  .bb-say { right: 4%; top: 0; font-size: 15px; padding: 9px 14px; }
  .splash-say { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .rider-img, .rider-road, .rider-lines i, .rider-puffs i { animation: none !important; }
  .rider-lines, .rider-puffs { display: none; }
}
.brand-logo { height: 52px; }
.topbar { height: var(--top-h); }
.rider-puffs i { background: #f6ead8; opacity: 0.9; width: 7%; }
@media (max-width: 880px) { .brand-logo { height: 46px; } }

/* 「もりこぎ」の動画（Higgsfieldで作成）。背景のクリーム色と同じ色の、丸い窓の中で走る */
.rider-film { width: min(78vw, 360px); aspect-ratio: 656 / 480; margin: 0 auto; border-radius: 32px; overflow: hidden; background: #fae8c8; box-shadow: 0 0 0 5px #fff, 0 18px 40px rgba(0, 0, 0, 0.35); animation: pop 520ms var(--spring) 150ms both; }
.rider-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.splash { background: radial-gradient(80% 60% at 50% 45%, #fdf0d6 0%, #fae8c8 50%, #f7cf9a 100%); }
.splash .rider-film { box-shadow: 0 0 0 5px #fff, 0 18px 36px rgba(140, 80, 20, 0.25); }
.loader .rider-film { width: min(70vw, 300px); }
@media (prefers-reduced-motion: reduce) { .rider-film { animation: none; } }

/* =====================================================================
   v8：色の切り替え（ダーク／ライト）と、上のバーで走る事務さん
   色は下の変数だけで決まる。ライトは、ロゴと同じ「クリーム・紺・赤」。
   ===================================================================== */
:root {
  --t-bg: #141414; --t-bg-rgb: 20, 20, 20; --t-bar: #121212; --t-surface: #1c1c1c; --t-card: #2a2a2a; --t-card-2: #333333; --t-chip: #404040;
  --t-line-2: #595959; --t-mute: #8c8c8c; --t-text: #ffffff; --t-ink-rgb: 255, 255, 255; --t-solid: #ffffff; --t-on-solid: #141414;
  --t-hero-a: #1b1b1b; --t-hero-b: #2b1a16; --t-top: rgba(0, 0, 0, 0.75);
}
html[data-theme="light"] {
  color-scheme: light;
  --t-bg: #fbf3e4; --t-bg-rgb: 251, 243, 228; --t-bar: #fffaf0; --t-surface: #ffffff; --t-card: #fff6e6; --t-card-2: #f6ead4; --t-chip: #eee0c6;
  --t-line-2: #c8b894; --t-mute: #8b8778; --t-text: #0b1b3a; --t-ink-rgb: 11, 27, 58; --t-solid: #0b1b3a; --t-on-solid: #ffffff;
  --t-hero-a: #fff3da; --t-hero-b: #ffd7ae; --t-top: rgba(251, 243, 228, 0.9);
  --bg: #fbf3e4; --ink: #0b1b3a; --ink-2: #24324f; --sub: #586074; --label: #8b8778; --line: #eadfc8; --line-2: #c8b894;
  --paper: #fbf3e4; --surface: #ffffff; --card: #fff6e6; --hover: #f6ead4;
  --blue: #e8452e; --blue-ink: #c2371f; --blue-soft: rgba(232, 69, 46, 0.12);
  --mint: #1c8a52; --mint-soft: rgba(28, 138, 82, 0.12); --amber: #a56500; --amber-soft: rgba(214, 138, 0, 0.14); --sun: #a56500; --sun-soft: rgba(214, 138, 0, 0.14);
  --grape: #6b4fd0; --grape-soft: rgba(107, 79, 208, 0.12); --stop: #c7372b; --stop-soft: rgba(199, 55, 43, 0.1);
  --hair: rgba(11, 27, 58, 0.12); --glass: linear-gradient(180deg, #ffffff, #fffaf0);
  --shadow-1: 0 2px 8px rgba(90, 60, 10, 0.1); --shadow-2: 0 14px 36px rgba(90, 60, 10, 0.2);
  --ring: linear-gradient(120deg, #ff7a52, #f0457f 45%, #7e6bf0);
}
html { background: var(--t-bg); }
body { background: var(--t-bg); color: var(--t-text); transition: background-color 400ms ease, color 300ms ease; }
.topbar { background: linear-gradient(to bottom, var(--t-top), rgba(var(--t-bg-rgb), 0)); }
.topbar.is-shadow { background: var(--t-bg); }

/* ライトのときだけ直す所 */
html[data-theme="light"] .tabbar a, html[data-theme="light"] .nav-sub { color: var(--sub); }
html[data-theme="light"] .tabbar a.on, html[data-theme="light"] .nav-sub.on { color: var(--t-text); }
html[data-theme="light"] .home-title, html[data-theme="light"] .billboard .lead, html[data-theme="light"] .hero-eyebrow { color: var(--t-text); text-shadow: none; }
html[data-theme="light"] .billboard { background: radial-gradient(70% 120% at 85% 20%, rgba(255, 138, 92, 0.45) 0%, rgba(255, 138, 92, 0) 60%), radial-gradient(60% 100% at 60% 100%, rgba(255, 205, 120, 0.5) 0%, rgba(255, 205, 120, 0) 70%), linear-gradient(120deg, var(--t-hero-a) 0%, var(--t-hero-b) 100%); }
html[data-theme="light"] .rider-road { background: repeating-linear-gradient(90deg, rgba(11, 27, 58, 0.7) 0 34px, rgba(11, 27, 58, 0) 34px 68px); }
html[data-theme="light"] .rider-lines i { background: linear-gradient(90deg, rgba(11, 27, 58, 0), rgba(11, 27, 58, 0.5)); }
html[data-theme="light"] .rider-puffs i { background: #fff; box-shadow: 0 0 0 1px rgba(11, 27, 58, 0.08); }
html[data-theme="light"] .bb-say { box-shadow: 0 10px 24px rgba(90, 60, 10, 0.22); }
html[data-theme="light"] select.input, html[data-theme="light"] select.input:focus-visible { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230b1b3a' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E"), linear-gradient(#ffffff, #fffaf0), linear-gradient(180deg, rgba(11, 27, 58, 0.3), rgba(11, 27, 58, 0.14)); }
html[data-theme="light"] select.input:focus-visible { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230b1b3a' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E"), linear-gradient(#ffffff, #fffaf0), var(--ring); }
html[data-theme="light"] .input { color: var(--t-text); box-shadow: inset 0 1px 0 #fff, 0 4px 14px rgba(90, 60, 10, 0.08); }
html[data-theme="light"] .btn.primary { box-shadow: 0 0 0 5px rgba(232, 69, 46, 0.16), 0 14px 30px rgba(11, 27, 58, 0.28); }
html[data-theme="light"] .btn { box-shadow: inset 0 0 0 1.5px rgba(11, 27, 58, 0.28); background: rgba(255, 255, 255, 0.7); color: var(--t-text); }
html[data-theme="light"] .btn:hover { background: #fff; box-shadow: inset 0 0 0 1.5px rgba(11, 27, 58, 0.6); }
html[data-theme="light"] .btn.primary, html[data-theme="light"] .btn.primary:hover { background: var(--t-solid); color: var(--t-on-solid); }
html[data-theme="light"] .btn.danger { background: #d8362b; color: #fff; }
html[data-theme="light"] .dlg::backdrop { background: rgba(60, 40, 10, 0.45); }
html[data-theme="light"] .loader { background: rgba(251, 243, 228, 0.92); }
html[data-theme="light"] .loader-say { color: #0b1b3a; }
html[data-theme="light"] .case-foot { background: rgba(255, 255, 255, 0.82); box-shadow: inset 0 0 0 1px var(--hair), 0 16px 40px rgba(90, 60, 10, 0.18); }
html[data-theme="light"] .brand-logo { filter: drop-shadow(0 2px 6px rgba(90, 60, 10, 0.25)); }
html[data-theme="light"] .save-status { background: rgba(255, 255, 255, 0.8); color: var(--sub); box-shadow: inset 0 0 0 1px var(--hair); }
html[data-theme="light"] .cont, html[data-theme="light"] .kcard, html[data-theme="light"] .mini { color: var(--t-text); box-shadow: inset 0 0 0 1px var(--hair), 0 4px 14px rgba(90, 60, 10, 0.06); }
html[data-theme="light"] .k-card.ok { background: linear-gradient(180deg, rgba(28, 138, 82, 0.14) 0, #fff 130px); }
html[data-theme="light"] .k-card.warn { background: linear-gradient(180deg, rgba(214, 138, 0, 0.16) 0, #fff 130px); }
html[data-theme="light"] .k-card.stop { background: linear-gradient(180deg, rgba(199, 55, 43, 0.12) 0, #fff 130px); }
html[data-theme="light"] .k-card.warn .k-answer { color: var(--amber); }
html[data-theme="light"] .doc { box-shadow: 0 16px 40px rgba(90, 60, 10, 0.2); }

/* 色の切り替えボタン（上のバー） */
.theme-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px 0 10px; border: 0; border-radius: 999px; cursor: pointer; font: inherit; font-size: 13px; font-weight: 700; color: var(--t-text); background: rgba(var(--t-ink-rgb), 0.1); box-shadow: inset 0 0 0 1px var(--hair); transition: transform 140ms ease-out, background-color 200ms ease; flex: none; }
.theme-btn:hover { background: rgba(var(--t-ink-rgb), 0.18); }
.theme-btn:active { transform: scale(0.94); }
.theme-dot { width: 22px; height: 22px; border-radius: 50%; background: linear-gradient(135deg, #fbf3e4 50%, #0b1b3a 50%); box-shadow: inset 0 0 0 1.5px rgba(var(--t-ink-rgb), 0.4); transition: transform 500ms var(--spring); }
html[data-theme="light"] .theme-dot { transform: rotate(180deg); }
.topbar { gap: 10px; }
.save-status { margin-left: auto; }

/* 上のバーで、ロゴの横を小さく走る事務さん（じゃまにならない大きさ。押すとホームへ） */
.bar-rider { position: relative; width: 62px; height: 44px; flex: none; margin-left: -4px; }
.bar-rider img { position: absolute; left: 0; bottom: 2px; width: 62px; height: auto; transform-origin: 50% 90%; animation: pedal 300ms ease-in-out infinite alternate; }
.bar-rider::before { content: ""; position: absolute; left: -6px; right: -2px; bottom: 0; height: 2px; border-radius: 2px; background: repeating-linear-gradient(90deg, rgba(var(--t-ink-rgb), 0.55) 0 8px, transparent 8px 16px); animation: road-s 360ms linear infinite; }
.bar-rider::after { content: ""; position: absolute; left: -8px; bottom: 6px; width: 7px; height: 7px; border-radius: 50%; background: rgba(var(--t-ink-rgb), 0.35); animation: puff 800ms ease-out infinite; }
@keyframes road-s { to { background-position: -16px 0; } }
@media (max-width: 880px) {
  .theme-btn span.theme-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .theme-btn { padding: 0; width: 44px; min-height: 44px; justify-content: center; }
  .bar-rider { width: 52px; height: 38px; }
  .bar-rider img { width: 52px; }
  .save-status { font-size: 0; gap: 0; padding: 8px; }
  .save-status .dot { width: 10px; height: 10px; }
  .save-status.failed, .save-status.conflict { font-size: 12px; gap: 8px; }
  html[data-theme="light"] .nav { background: #fffaf0 !important; border-top: 1px solid var(--line); }
  html[data-theme="light"] .tabbar a { color: var(--label); }
  html[data-theme="light"] .tabbar a.on { color: var(--t-text); }
}
@media (prefers-reduced-motion: reduce) { .bar-rider img, .bar-rider::before, .bar-rider::after { animation: none !important; } }
/* 上のバーは、いつも面の色を敷く（スクロール中に下の文字が透けて重ならないように） */
.topbar, .topbar.is-shadow { background: rgba(var(--t-bg-rgb), 0.94); }
@media (max-width: 880px) { .topbar, .topbar.is-shadow { background: rgba(var(--t-bg-rgb), 0.96); } }

/* =====================================================================
   v9：文字を濃く・動きを強く・読み込み画面をしっかり
   ===================================================================== */
/* ---- 文字を濃く、太く ---- */
html[data-theme="light"] { --t-text: #05070d; --t-ink-rgb: 5, 7, 13; --ink: #05070d; --ink-2: #10141f; --sub: #2f3644; --label: #5b6170; --t-solid: #05070d; --t-mute: #5b6170; }
:root { --sub: #d6d6d6; --label: #a6a6a6; --ink-2: #f2f2f2; }
body { font-weight: 500; }
h1, h2, h3, .tile-label, .cont-title, .kcard-label, .mini-label, .plan-title, .choice-label, .btn, .row-title, .home-title, .k-answer, .stat-value, .file-name, .backup-title { font-weight: 800; }
.lead, .choice-hint, .field-hint, .plan-reason, .tile-hint, .mini-hint, .cont-sub, .advice p { font-weight: 500; }
.lead { color: var(--ink-2); }
.field > label, .choices > legend, .seg > legend { color: var(--t-text); font-weight: 800; }

/* ---- 動きを強く：大きく弾んで入り、押すとしっかり沈む ---- */
@keyframes rise { 0% { opacity: 0; transform: translateY(46px) scale(0.94); } 60% { opacity: 1; transform: translateY(-8px) scale(1.015); } 100% { opacity: 1; transform: none; } }
@keyframes push-fwd { 0% { opacity: 0; transform: translateX(110px) scale(0.96); } 62% { opacity: 1; transform: translateX(-10px); } 100% { opacity: 1; transform: none; } }
@keyframes push-back { 0% { opacity: 0; transform: translateX(-110px) scale(0.96); } 62% { opacity: 1; transform: translateX(10px); } 100% { opacity: 1; transform: none; } }
@keyframes line-reveal { 0% { clip-path: inset(0 0 100% 0); transform: translateY(0.9em) rotate(2deg); } 70% { clip-path: inset(-12% 0 -12% 0); transform: translateY(-0.06em) rotate(0deg); } 100% { clip-path: inset(-12% 0 -12% 0); transform: none; } }
@keyframes pop { 0% { transform: scale(0.2); } 55% { transform: scale(1.28); } 75% { transform: scale(0.92); } 100% { transform: scale(1); } }
@keyframes pedal { from { transform: translateY(0) rotate(-3deg); } to { transform: translateY(-5%) rotate(2.6deg); } }
.page > *, .case-body > *, .choices > .choice, .tiles > li, .row-sec, .stat, .coach li, .plan-list > li, .first-steps li { animation-duration: 640ms; }
.btn:active { transform: scale(0.9); }
.btn.primary:hover { transform: translateY(-3px) scale(1.03); }
.btn:hover svg { transform: translateX(4px) scale(1.2); }
.choice:hover { transform: translateY(-3px) scale(1.01); }
.choice:active { transform: scale(0.95); }
.choice:has(input:checked) { animation: chosen 420ms var(--spring); }
@keyframes chosen { 0% { transform: scale(0.96); } 50% { transform: scale(1.035); } 100% { transform: scale(1); } }
.tile:hover, .tile:focus-visible { transform: scale(1.1) rotate(-1.2deg); }
.tile:hover .art, .tile:focus-visible .art { transform: translateY(-10px) rotate(-9deg) scale(1.16); }
.cont:hover, .cont:focus-visible { transform: scale(1.07) rotate(-0.8deg); }
.kcard:hover, .kcard:focus-visible { transform: scale(1.12) rotate(1.5deg); }
.kcard:hover .kcard-yen { transform: rotate(-20deg) scale(1.3); }
.mini:hover { transform: scale(1.04) translateX(6px); }
.chip:hover { transform: translateY(-3px) scale(1.06); }
.rider.hero .rider-img { animation-duration: 240ms; }
.bb-say { animation: pop 620ms var(--spring) 1100ms both, say-shake 2.4s ease-in-out 2s infinite; font-size: 20px; font-weight: 800; }
@keyframes say-shake { 0%, 84%, 100% { transform: rotate(0deg) scale(1); } 88% { transform: rotate(-5deg) scale(1.08); } 92% { transform: rotate(4deg) scale(1.08); } 96% { transform: rotate(-2deg) scale(1.04); } }
.brand-logo { animation: logo-jelly 3.2s ease-in-out 1s infinite; transform-origin: 50% 100%; }
@keyframes logo-jelly { 0%, 80%, 100% { transform: scale(1, 1); } 85% { transform: scale(1.12, 0.88); } 90% { transform: scale(0.94, 1.08); } 95% { transform: scale(1.04, 0.97); } }
.support-btn { animation: float-s 3s ease-in-out infinite; }
@keyframes float-s { 0%, 100% { translate: 0 0; } 50% { translate: 0 -6px; } }
.tab-ind { transition-duration: 560ms; transition-timing-function: var(--spring); }
.toast { transition: opacity 240ms ease, transform 520ms var(--spring); }

/* ---- 読み込み画面：ロゴ・動画・合言葉・進み具合 ---- */
.splash { gap: 14px; }
.splash-logo, .loader-logo { width: min(64vw, 340px); height: auto; transform-origin: 50% 100%; animation: logo-in 800ms var(--spring) both, logo-jelly 1.5s ease-in-out 900ms infinite; }
@keyframes logo-in { 0% { opacity: 0; transform: translateY(-80px) scale(0.4) rotate(-12deg); } 60% { opacity: 1; transform: translateY(10px) scale(1.12) rotate(3deg); } 100% { opacity: 1; transform: none; } }
.splash .rider-film { animation: film-in 900ms var(--spring) 250ms both; }
@keyframes film-in { 0% { opacity: 0; transform: translateX(-110vw) rotate(-10deg); } 70% { opacity: 1; transform: translateX(18px) rotate(2deg); } 100% { opacity: 1; transform: none; } }
.splash-sayimg, .loader-sayimg { width: min(74vw, 380px); height: auto; animation: pop 700ms var(--spring) 900ms both, say-shake 1.4s ease-in-out 1.8s infinite; }
.splash-note { font-weight: 800; font-size: 15px; color: #0b1b3a; letter-spacing: 0.1em; animation: rise 500ms var(--ease) 1200ms both; }
.loader-bar { position: relative; width: min(70vw, 320px); height: 12px; margin: 6px auto 0; border-radius: 999px; background: rgba(11, 27, 58, 0.14); overflow: hidden; box-shadow: inset 0 0 0 2px rgba(11, 27, 58, 0.5); }
.loader-bar i { position: absolute; inset: 0; border-radius: 999px; background: linear-gradient(90deg, #ff7a52, #f0463e); transform-origin: left center; transform: scaleX(0); transition: transform 420ms var(--spring); }
/* 数が分からない間：しま模様が走り続ける（にせの％は出さない） */
.loader-bar.indeterminate i { transform: none; background: repeating-linear-gradient(110deg, #f0463e 0 16px, #ff9a76 16px 32px); background-size: 64px 100%; animation: stripes 500ms linear infinite; }
@keyframes stripes { to { background-position: 64px 0; } }
.loader { background: radial-gradient(80% 60% at 50% 45%, #fdf0d6 0%, #fae8c8 50%, #f7cf9a 100%); backdrop-filter: none; -webkit-backdrop-filter: none; }
html[data-theme="light"] .loader { background: radial-gradient(80% 60% at 50% 45%, #fdf0d6 0%, #fae8c8 50%, #f7cf9a 100%); }
.loader-box { width: min(94vw, 420px); display: grid; justify-items: center; gap: 12px; }
.loader .rider-film { width: min(72vw, 320px); box-shadow: 0 0 0 5px #fff, 0 18px 36px rgba(140, 80, 20, 0.25); }
.loader-text { color: #0b1b3a; font-weight: 800; font-size: 17px; margin: 0; }
.loader-count { color: #0b1b3a; font-family: var(--num); font-weight: 800; font-size: 15px; min-height: 1.4em; margin: 0; }
.splash-say, .loader-say { display: none; }
@media (max-width: 880px) { .bb-say { font-size: 17px; } }
@media (prefers-reduced-motion: reduce) {
  .brand-logo, .support-btn, .bb-say, .splash-logo, .loader-logo, .splash-sayimg, .loader-sayimg, .loader-bar.indeterminate i { animation: none !important; }
}

/* =====================================================================
   v10：ホームの大きい絵を外す／上のバーはゆっくり／モーション技術
   ===================================================================== */
.billboard { min-height: 0; padding-top: 44px; padding-bottom: 44px; display: block; }
.bb-body { max-width: 760px; }
/* 上のバー：ゆっくりこぐ。ロゴのはずみも、たまに1回だけ */
.bar-rider img { animation-duration: 620ms; }
.bar-rider::before { animation-duration: 900ms; }
.bar-rider::after { animation-duration: 1800ms; }
.brand-logo { animation: logo-jelly 7s ease-in-out 2s infinite; }
@media (max-width: 880px) { .billboard { padding-top: 26px; padding-bottom: 32px; } }

/* ---- ビュートランジション：画面の切り替えで、前の画面が流れて次の画面が入る ---- */
@supports (view-transition-name: none) {
  main { view-transition-name: page; }
  .topbar { view-transition-name: bar; }
  .nav { view-transition-name: tabs; }
  ::view-transition-old(page) { animation: vt-out 260ms cubic-bezier(0.4, 0, 1, 1) both; }
  ::view-transition-new(page) { animation: vt-in 520ms cubic-bezier(0.22, 1, 0.36, 1) both; }
  html[data-vt="back"]::view-transition-old(page) { animation-name: vt-out-back; }
  html[data-vt="back"]::view-transition-new(page) { animation-name: vt-in-back; }
  ::view-transition-old(bar), ::view-transition-new(bar), ::view-transition-old(tabs), ::view-transition-new(tabs) { animation: none; }
}
@keyframes vt-out { to { opacity: 0; transform: translateX(-70px) scale(0.97); filter: blur(6px); } }
@keyframes vt-in { from { opacity: 0; transform: translateX(90px) scale(0.97); filter: blur(8px); } }
@keyframes vt-out-back { to { opacity: 0; transform: translateX(70px) scale(0.97); filter: blur(6px); } }
@keyframes vt-in-back { from { opacity: 0; transform: translateX(-90px) scale(0.97); filter: blur(8px); } }

/* ---- ホバーティルト：カードが立体的に傾き、光が動く ---- */
.motion .tile, .motion .cont, .motion .kcard, .motion .mini, .motion .stat, .motion .file-card { transform-style: preserve-3d; }
.motion .is-tilt { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(1.06) !important; transition: transform 90ms ease-out !important; z-index: 4; box-shadow: var(--shadow-2); }
.motion .tile::after, .motion .cont::after, .motion .kcard::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity 240ms ease; background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 55%); mix-blend-mode: soft-light; }
.motion .is-tilt::after { opacity: 1; }
.cont, .kcard { position: relative; overflow: hidden; }

/* ---- カーソルフォロー：ブロックの上を、光がカーソルについてくる ---- */
.motion .choice, .motion .plan-list > li, .motion .coach, .motion .quick-add, .motion .keihi-panel, .motion .point-card, .motion .chart-card, .motion .export, .motion .backup-card, .motion .first { background-attachment: scroll; position: relative; }
.motion .choice::after, .motion .coach::after, .motion .quick-add::after, .motion .keihi-panel::after, .motion .point-card::after, .motion .chart-card::after, .motion .export::after, .motion .first::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity 300ms ease;
  background: radial-gradient(260px circle at var(--sx, 50%) var(--sy, 50%), rgba(255, 110, 70, 0.2), rgba(255, 110, 70, 0) 70%);
}
.motion .choice:hover::after, .motion .coach:hover::after, .motion .quick-add:hover::after, .motion .keihi-panel:hover::after, .motion .point-card:hover::after, .motion .chart-card:hover::after, .motion .export:hover::after, .motion .first:hover::after { opacity: 1; }
.choice > *, .coach > *, .quick-add > *, .keihi-panel > *, .point-card > *, .chart-card > *, .export > *, .first > * { position: relative; z-index: 1; }

/* ---- マグネットボタン＋グラデーションローテート（光る枠が回る） ---- */
@property --spin { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.motion .btn.primary { translate: var(--mx, 0px) var(--my, 0px); transition: translate 260ms var(--spring), transform 140ms ease-out, box-shadow 240ms ease, background-color 200ms ease; }
.btn.primary.big, .case-foot .btn.primary, .export-primary .btn.primary { isolation: isolate; }
.btn.primary.big::after, .case-foot .btn.primary::after { content: ""; position: absolute; inset: -3px; z-index: -1; border-radius: inherit; padding: 3px; background: conic-gradient(from var(--spin), #ff7a52, #f0457f, #9d8bff, #46d369, #ff7a52); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); animation: spin 3.2s linear infinite; transform: none; height: auto; bottom: -3px; }
.btn.primary.big, .case-foot .btn.primary { overflow: visible; }
.btn.primary.big::before, .case-foot .btn.primary::before { border-radius: inherit; }
@keyframes spin { to { --spin: 360deg; } }

/* ---- 入力欄：選ぶと、ふちの光が回る ---- */
.input:focus-visible { background: linear-gradient(var(--t-surface), var(--t-surface)) padding-box, conic-gradient(from var(--spin), #ff7a52, #f0457f, #9d8bff, #ff7a52) border-box; animation: spin 2.4s linear infinite; }

/* ---- スクロールプログレス：どこまで読んだかの線（上のバーの下） ---- */
@supports (animation-timeline: scroll()) {
  .topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--ring); transform-origin: left center; transform: scaleX(0); animation: grow-x linear both; animation-timeline: scroll(root); }
  /* スクロール駆動：列やブロックが、画面に入るにつれて現れる */
  .row-sec, .chart-card, .point-card, .guide-sec, .doc-main { animation: reveal-in linear both; animation-timeline: view(); animation-range: entry 0% entry 42%; }
}
@keyframes reveal-in { from { opacity: 0; transform: translateY(60px) scale(0.95); } to { opacity: 1; transform: none; } }
.topbar { position: sticky; }

@media (prefers-reduced-motion: reduce) {
  .btn.primary.big::after, .case-foot .btn.primary::after, .input:focus-visible { animation: none !important; }
  .topbar::after { display: none; }
}
/* 光る枠はボタンの内側のふちに回す（光の帯や波紋がボタンの外へはみ出さないように） */
.btn.primary.big, .case-foot .btn.primary { overflow: hidden; }
.btn.primary.big::after, .case-foot .btn.primary::after { inset: 0; bottom: 0; z-index: 0; }
.btn.primary > span, .btn.primary > svg { position: relative; z-index: 1; }

/* =====================================================================
   v11：文字を組み直す（端末に入っている、太さのそろった角ゴシック）／選択肢をはっきり
   ===================================================================== */
:root {
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Noto Sans CJK JP", "Yu Gothic UI", "Yu Gothic", "Meiryo", system-ui, sans-serif;
  --num: "Helvetica Neue", "Segoe UI", "Roboto", "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", system-ui, sans-serif;
  /* 文字の段階：小 13 ／ 補足 14 ／ 本文 16 ／ 小見出し 18 ／ 見出し 22 ／ 画面の題 28 */
  --fs-xs: 13px; --fs-s: 14px; --fs-m: 16px; --fs-l: 18px; --fs-xl: 22px; --fs-2xl: 28px;
}
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font-family: var(--font); font-weight: 400; font-size: var(--fs-m); line-height: 1.8; letter-spacing: 0.04em;
  font-kerning: normal; font-synthesis: none; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  line-break: strict; overflow-wrap: anywhere; word-break: normal; text-wrap: pretty;
}
html[data-theme="light"] body { font-weight: 400; }
button, input, select, textarea { font-family: inherit; letter-spacing: inherit; }

/* 見出し：太さは600か700だけ。かなを少し詰め、文節で折り返す */
h1, h2, h3, .home-title, .row-title, .plan-title, .backup-title {
  font-weight: 700; line-height: 1.45; letter-spacing: 0.02em; font-feature-settings: "palt" 1;
  word-break: auto-phrase; text-wrap: balance;
}
h1, .home-title { letter-spacing: 0.01em; line-height: 1.35; }
h1 { font-size: clamp(24px, 3.2vw, 30px); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-l); }
.tile-label, .cont-title, .kcard-label, .mini-label, .choice-label, .btn, .k-answer, .file-name, .first-steps strong {
  font-weight: 600; letter-spacing: 0.03em; font-feature-settings: "palt" 1;
}
.btn { letter-spacing: 0.06em; }
.stat-value, .bar-value, .tx-table td.num, .ring b, .loader-count { font-family: var(--num); font-weight: 600; letter-spacing: 0; font-variant-numeric: tabular-nums lining-nums; }
.lead { font-size: 17px; line-height: 1.85; font-weight: 400; }
.lead, .choice-hint, .field-hint, .plan-reason, .tile-hint, .mini-hint, .cont-sub, .advice p { font-weight: 400; }
.choice-hint, .field-hint, .plan-reason, .tile-hint, .mini-hint, .cont-sub { font-size: var(--fs-s); line-height: 1.7; letter-spacing: 0.03em; }
.field > label, .choices > legend, .seg > legend { font-weight: 600; font-size: 15px; letter-spacing: 0.04em; }
.badge, .first-n, .ph-n, .plan-n, .k-n, .task-n { font-family: var(--num); font-weight: 600; letter-spacing: 0; }
.en { display: none; }
.doc-code { letter-spacing: 0; line-height: 1.75; }
p { margin-block: 0 0.9em; }
@media (max-width: 880px) {
  body { font-size: 16px; line-height: 1.8; }
  h1 { font-size: 24px; }
  .home-title { font-size: clamp(28px, 8.4vw, 34px); }
  .lead { font-size: 16px; }
  .choice-label { font-size: 16.5px; }
}

/* ---- 選択肢：動かさない。選んだものだけ、枠と印ではっきり変える ---- */
.choices > legend { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; width: 100%; }
.choice-mode { font-size: 12.5px; font-weight: 400; color: var(--label); letter-spacing: 0.04em; }
.choice {
  min-height: 64px; padding: 14px 16px; gap: 14px; border-radius: 14px; border: 1.5px solid rgba(var(--t-ink-rgb), 0.16);
  background: var(--t-surface); box-shadow: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition: border-color 160ms ease, background-color 160ms ease;
}
.choice:hover, .choice:active { transform: none; }
@media (hover: hover) { .choice:hover { border-color: rgba(var(--t-ink-rgb), 0.42); background: var(--t-card); } }
.choice:active { background: var(--t-card); }
.choice:has(input:checked) {
  border-color: var(--t-solid); background: var(--t-card); animation: none;
  box-shadow: inset 0 0 0 1.5px var(--t-solid);
}
.choice:has(input:focus-visible) { outline: 3px solid #6f93ff; outline-offset: 3px; }
.choice input { width: 26px; height: 26px; border: 2px solid rgba(var(--t-ink-rgb), 0.45); background: transparent; }
.choice input:checked { background: var(--t-solid); border-color: var(--t-solid); animation: pop 260ms var(--ease); }
.choice:has(input:checked) .choice-label { font-weight: 700; }
.choice.compact { min-height: 54px; border-radius: 12px; }
.point-card .choice { background: var(--t-surface); }
.motion .choice::after { display: none; }
.seg-row label { min-height: 44px; font-weight: 600; }
.seg-row input:checked + label { font-weight: 700; }
.seg-row input:focus-visible + label { outline: 3px solid #6f93ff; outline-offset: 2px; }

/* ---- 「わからない」のボタン：いつでも名前が見える ---- */
.support-btn { animation: none; font-weight: 600; font-size: 15px; letter-spacing: 0.06em; }
@media (max-width: 880px) {
  .support-btn, body.in-flow .support-btn { width: auto; min-height: 48px; height: 48px; padding: 0 16px 0 12px; gap: 6px; }
  .support-btn span { position: static; width: auto; height: auto; overflow: visible; clip-path: none; }
}

/* ---- 「わからない」の相談 ---- */
.stuck-where { font-size: var(--fs-s); color: var(--sub); margin: 0 0 14px; }
.stuck-where strong { color: var(--t-text); font-weight: 600; }
.stuck-answer:not(:empty) { margin: 4px 0 18px; padding: 16px; border-radius: 14px; background: var(--t-card); }
.stuck-answer h3, .stuck-ask h3 { margin: 0 0 8px; font-size: 16px; color: var(--t-text); }
.stuck-answer ul, .stuck-answer ol { margin: 0; padding-left: 1.3em; }
.stuck-answer li + li { margin-top: 6px; }
.stuck-ask { margin: 0 0 20px; padding: 16px; border-radius: 14px; border: 1.5px solid rgba(var(--t-ink-rgb), 0.16); }
.stuck-prompt { max-height: 220px; overflow: auto; margin: 10px 0 12px; font-size: 14px; }
.stuck-ask .row-start { gap: 8px; }

/* ---- 質問画面：下に固定するのは「戻る」「次へ」だけ。おまかせは質問の下に置く ---- */
.skip-wrap { display: grid; justify-items: start; gap: 8px; margin: 22px 0 0; padding: 14px 16px; border-radius: 14px; border: 1.5px dashed rgba(var(--t-ink-rgb), 0.22); }
.skip-note { font-size: var(--fs-s); color: var(--sub); max-width: none; text-align: left; line-height: 1.7; margin: 0; }
@media (max-width: 880px) {
  .skip-wrap { justify-items: stretch; }
  body.in-flow .support-btn { top: calc(8px + env(safe-area-inset-top)); bottom: auto; right: 12px; height: 44px; min-height: 44px; }
  body.in-flow .topbar { padding-right: 150px; }
  body.in-flow .topbar .theme-btn, body.in-flow .topbar .bar-rider { display: none; }
  .case-foot { flex-wrap: nowrap; }
  .case-foot > :first-child { flex: 0 0 auto; }
}

/* 押したときの波紋は、必ず重ねて描く（並びに入ると、選択肢が一瞬ふくらんで次が押せなくなる） */
.ripple, .choice > .ripple, .coach > .ripple, .first > .ripple, .export > .ripple { position: absolute !important; z-index: 0 !important; }
.choice, .chip, .mini { overflow: hidden; }
.choice-mode.alone { display: block; margin: -4px 0 2px; }
.choices > .choice-mode { grid-column: 1 / -1; }
@media (max-width: 880px) {
  .case-foot .btn { min-width: 0; padding-inline: 14px; }
  .case-foot .btn.primary { flex: 1 1 0; min-width: 0; line-height: 1.35; }
  .case-foot { flex-wrap: wrap; }
  .case-foot > :first-child { flex: 0 0 auto; }
}
@media (max-width: 880px) {
  .export-primary { display: grid; gap: 10px; }
  .export-primary .btn { width: 100%; justify-content: center; }
}
