/* Zen Maru Gothic — 自前配信（アプリで使う文字だけに絞った woff2）。
   外部CDNを使わないため、訪問者のIP・UAが第三者に渡らない。
   収録外の文字が来た場合は system-ui にフォールバックする。 */
@font-face{font-family:'Zen Maru Gothic';font-style:normal;font-weight:400;font-display:swap;
  src:url('./assets/fonts/zen-maru-gothic-400.woff2') format('woff2')}
@font-face{font-family:'Zen Maru Gothic';font-style:normal;font-weight:500;font-display:swap;
  src:url('./assets/fonts/zen-maru-gothic-500.woff2') format('woff2')}
@font-face{font-family:'Zen Maru Gothic';font-style:normal;font-weight:700;font-display:swap;
  src:url('./assets/fonts/zen-maru-gothic-700.woff2') format('woff2')}


/* =========================================================
   Mochi MCI — スタイル
   MOCHI CARE の oklch トークン・Zen Maru Gothic・朱アクセントを継承
   ========================================================= */
:root {
  /* 文字サイズ（3段階切替は data-fontsize 属性で倍率を変える） */
  --fs: 1;
  --text-xs: calc(var(--fs) * clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem));
  --text-sm: calc(var(--fs) * clamp(0.875rem, 0.8rem + 0.35vw, 1rem));
  --text-base: calc(var(--fs) * clamp(1rem, 0.95rem + 0.3vw, 1.15rem));
  --text-lg: calc(var(--fs) * clamp(1.125rem, 1rem + 0.5vw, 1.4rem));
  --text-xl: calc(var(--fs) * clamp(1.4rem, 1.15rem + 1vw, 2rem));
  --text-2xl: calc(var(--fs) * clamp(1.75rem, 1.3rem + 1.6vw, 2.6rem));

  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem; --space-4: 1rem;
  --space-5: 1.25rem; --space-6: 1.5rem; --space-8: 2rem; --space-10: 2.5rem;
  --space-12: 3rem; --space-16: 4rem;

  --r-sm: 10px; --r-md: 18px; --r-lg: 28px; --r-full: 999px;
  --font-body: 'Zen Maru Gothic', system-ui, sans-serif;
  --maxw: 940px;
}
html[data-fontsize='m'] { --fs: 1.14; }
html[data-fontsize='l'] { --fs: 1.3; }

:root, [data-theme='light'] {
  --bg: oklch(97.5% 0.008 85);
  --surface: oklch(100% 0 0);
  --surface-2: oklch(96% 0.01 85);
  --line: oklch(89% 0.012 85);
  --ink: oklch(28% 0.015 60);
  --ink-2: oklch(50% 0.012 70);
  --accent: oklch(60% 0.17 25);
  --accent-soft: oklch(94% 0.04 30);
  --good: oklch(60% 0.11 165);
  --warn: oklch(72% 0.13 75);
  --info: oklch(58% 0.11 250);
  --shadow: 0 1px 2px rgba(40,32,24,.05), 0 12px 32px -12px rgba(40,32,24,.18);
}
[data-theme='dark'] {
  --bg: oklch(21% 0.012 70);
  --surface: oklch(25.5% 0.014 70);
  --surface-2: oklch(29% 0.014 70);
  --line: oklch(35% 0.014 70);
  --ink: oklch(94% 0.008 85);
  --ink-2: oklch(74% 0.012 85);
  --accent: oklch(68% 0.16 26);
  --accent-soft: oklch(33% 0.05 28);
  --good: oklch(72% 0.11 165);
  --warn: oklch(78% 0.12 78);
  --info: oklch(72% 0.1 250);
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 16px 40px -14px rgba(0,0,0,.6);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background:
    radial-gradient(1100px 620px at 88% -12%, var(--accent-soft), transparent 62%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-wrap: anywhere;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.3; }
p { margin: 0 0 var(--space-3); }
p:last-child { margin-bottom: 0; }
b, strong { font-weight: 700; }
a { color: var(--accent); }

/* ---------- topbar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-4) clamp(var(--space-4), 3vw, var(--space-8));
  flex-wrap: wrap;
  max-width: var(--maxw); margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: var(--space-3); cursor: pointer; user-select: none; }
.logo { width: 42px; height: 42px; color: var(--accent); flex: none; }


/* ヘッダーのモチ顔 */
.mochi-badge { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
@media (max-width: 480px) { .mochi-badge { width: 34px; height: 34px; } }

/* 起動中の画面（モチがふわりと待っている） */
.boot-panel { display: grid; place-items: center; gap: var(--space-3); padding: var(--space-10) var(--space-5); }
.boot-mochi { width: 120px; height: 120px; border-radius: 24%; animation: bootFloat 2.6s ease-in-out infinite; }
@keyframes bootFloat { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-7px) } }
@media (prefers-reduced-motion: reduce) { .boot-mochi { animation: none; } }

/* 医療機関向けサマリのレターヘッド */
.print-letterhead {
  display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-4);
  padding-bottom: var(--space-3); margin-bottom: var(--space-4);
  border-bottom: 2px solid var(--accent);
}
.print-letterhead .print-brand { font-size: var(--text-xl, 1.5rem); letter-spacing: .04em; color: var(--accent); }
.print-letterhead .print-sub { font-size: var(--text-xs); color: var(--ink-2); text-align: right; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: var(--text-lg); letter-spacing: .04em; }
.brand-text span { font-size: var(--text-xs); color: var(--ink-2); }
.topbar-actions { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; }

/* ---------- 部品 ---------- */
.btn {
  font: inherit; font-size: var(--text-sm); font-weight: 500;
  border-radius: var(--r-full); border: 1px solid var(--line);
  min-height: 48px; padding: var(--space-2) var(--space-5);
  background: var(--surface); color: var(--ink);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn.primary { background: var(--accent); border-color: transparent; color: #fff; }
.btn.small { min-height: 40px; font-size: var(--text-xs); padding: var(--space-1) var(--space-4); }
.btn.ghost { background: transparent; }
.btn.big {
  font-size: var(--text-lg); font-weight: 700; min-height: 72px;
  padding: var(--space-4) var(--space-8); border-radius: var(--r-lg);
}
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.dot { width: 8px; height: 8px; border-radius: var(--r-full); background: var(--line); }
.dot.on { background: var(--good); box-shadow: 0 0 0 3px color-mix(in oklab, var(--good) 25%, transparent); }

.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: clamp(var(--space-4), 2.5vw, var(--space-6));
  box-shadow: var(--shadow); margin-bottom: var(--space-5);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); flex-wrap: wrap; }
.panel-head h2 { font-size: var(--text-lg); }
.badge {
  font-size: var(--text-xs); color: var(--ink-2);
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-full); padding: 2px var(--space-3); white-space: nowrap;
}
.badge.accent { color: #fff; background: var(--accent); border-color: transparent; }
.badge.good { color: #fff; background: var(--good); border-color: transparent; }
.muted { color: var(--ink-2); font-size: var(--text-sm); }
.center { text-align: center; }

/* ---------- 画面 ---------- */
main { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(var(--space-4), 3vw, var(--space-8)) var(--space-12); }
.screen { display: none; animation: fade .3s ease; }
.screen.is-active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- モチ（案内役のキャラクター） ---------- */
.mochi-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-4); align-items: center; }
.bot-svg { width: 150px; max-width: 100%; height: auto; }
.bot-img { border-radius: 16%; display: block; }
.bot { display: grid; justify-items: center; gap: var(--space-1); width: 150px; max-width: 100%; }
.bot-caption { font-size: var(--text-xs); color: var(--ink-2); }
.bubble {
  position: relative; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: var(--space-4) var(--space-5);
  font-size: var(--text-base); min-height: 76px; display: flex; align-items: center;
}
.bubble p { margin: 0; }
.bubble-tail {
  position: absolute; left: -8px; top: 50%; width: 16px; height: 16px;
  background: var(--surface-2); border-left: 1px solid var(--line); border-bottom: 1px solid var(--line);
  transform: rotate(45deg) translateY(-50%);
}
.bubble.speak { animation: pop .4s cubic-bezier(.34,1.56,.64,1); }
@keyframes pop { 0% { transform: scale(.97); } 100% { transform: scale(1); } }
@keyframes breathe { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.bot-img { animation: breathe 4.5s ease-in-out infinite; }
.no-anim .bot-img { animation: none; }
@media (prefers-reduced-motion: reduce) { .bot-img { animation: none; } }

/* ---------- ホーム ---------- */
.hero-cta { display: grid; justify-items: center; gap: var(--space-4); margin-top: var(--space-6); }
.ring-row { display: flex; gap: var(--space-3); justify-content: center; flex-wrap: wrap; margin-top: var(--space-2); }
.day-chip {
  width: 52px; height: 52px; border-radius: var(--r-full); display: grid; place-items: center;
  border: 2px solid var(--line); background: var(--surface-2); font-size: var(--text-sm); color: var(--ink-2);
}
.day-chip.done { background: var(--accent); border-color: transparent; color: #fff; font-weight: 700; }
.day-chip.today { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--space-3); }
.stat {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: var(--space-3) var(--space-4);
}
.stat b { display: block; font-size: var(--text-lg); }
.stat span { font-size: var(--text-xs); color: var(--ink-2); }

/* ---------- セッション ---------- */
.session-shell { max-width: 640px; margin: 0 auto; }
.elapsed {
  display: flex; align-items: center; gap: var(--space-2);
  font-size: var(--text-xs); color: var(--ink-2);
}
.elapsed-bar { flex: 1; height: 6px; border-radius: var(--r-full); background: var(--surface-2); overflow: hidden; }
.elapsed-bar i { display: block; height: 100%; width: 0%; background: color-mix(in oklab, var(--accent) 55%, var(--surface-2)); transition: width .5s linear; }
.stage-title { font-size: var(--text-lg); margin-bottom: var(--space-2); }
.prompt { font-size: var(--text-xl); font-weight: 700; text-align: center; margin: var(--space-4) 0; }
.cue-chip {
  display: inline-block; background: var(--accent-soft); color: var(--ink);
  border-radius: var(--r-full); padding: var(--space-1) var(--space-4); font-weight: 700;
}
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--space-3); }
.choice {
  font: inherit; font-size: var(--text-lg); min-height: 72px;
  border-radius: var(--r-md); border: 2px solid var(--line); background: var(--surface);
  color: var(--ink); cursor: pointer; padding: var(--space-3);
  transition: border-color .15s ease, background .15s ease;
}
.choice:hover { border-color: var(--accent); }
.choice:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.choice.sel { border-color: var(--accent); background: var(--accent-soft); font-weight: 700; }
.choice.lock { pointer-events: none; opacity: .5; }
.word-card {
  display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: var(--space-3);
  margin: var(--space-4) 0;
}
.word-card div {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: var(--space-4); text-align: center; font-size: var(--text-lg); font-weight: 700;
}
.svg-stim { width: min(100%, 260px); height: auto; margin: 0 auto; display: block; }
.stim-box { display: grid; place-items: center; min-height: 240px; }
.mst-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3); }
.pal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3); }
.pal-box {
  aspect-ratio: 1; border-radius: var(--r-md); border: 2px solid var(--line);
  background: var(--surface-2); display: grid; place-items: center; cursor: pointer; padding: var(--space-2);
}
.pal-box.open { border-color: var(--accent); }
.pal-box svg { width: 70%; height: auto; }
.face-card { display: grid; justify-items: center; gap: var(--space-2); }
.face-card svg { width: min(100%, 170px); height: auto; }
.face-name { font-size: var(--text-lg); font-weight: 700; }
.fluency-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: var(--space-2); }
.fluency-grid .choice { font-size: var(--text-base); min-height: 56px; }

/* ---------- 結果 ---------- */
.prob-card { display: grid; gap: var(--space-3); }
.prob-bar { position: relative; height: 30px; border-radius: var(--r-full); background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.prob-bar .band { position: absolute; top: 0; bottom: 0; background: color-mix(in oklab, var(--accent) 28%, transparent); }
.prob-bar .pt { position: absolute; top: -4px; bottom: -4px; width: 4px; background: var(--accent); border-radius: 2px; }
.prob-scale { display: flex; justify-content: space-between; font-size: var(--text-xs); color: var(--ink-2); }
.chart-wrap { width: 100%; overflow-x: auto; }
.chart-wrap svg { width: 100%; height: auto; min-width: 300px; }
.legend { display: flex; gap: var(--space-4); flex-wrap: wrap; font-size: var(--text-xs); color: var(--ink-2); }
.legend i { display: inline-block; width: 14px; height: 8px; border-radius: 4px; margin-right: 6px; }
.disclose-grid { display: grid; gap: var(--space-3); }
.next-steps li { margin-bottom: var(--space-2); }

table.data { width: 100%; border-collapse: collapse; font-size: var(--text-xs); }
table.data th, table.data td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; white-space: nowrap; }
/* 説明文が入る縦2列の表は折り返す。横に長い日次表（.table-wrap）は
   これまでどおり横スクロールのままにする。 */
.table-scroll table.data th, .table-scroll table.data td { white-space: normal; overflow-wrap: anywhere; }
.table-scroll table.data th { width: 34%; }
table.data th { color: var(--ink-2); font-weight: 500; position: sticky; top: 0; background: var(--surface); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media print { .table-wrap { overflow: visible; } }
.table-scroll { max-height: 340px; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-md); }

/* ---------- フォーム ---------- */
.field { display: grid; gap: var(--space-2); margin-bottom: var(--space-4); }
.field label { font-size: var(--text-sm); color: var(--ink-2); }
input[type='text'], input[type='number'], select, textarea {
  font: inherit; font-size: var(--text-base); color: var(--ink); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--space-3) var(--space-4); min-height: 48px;
  width: 100%;
}
textarea { min-height: 120px; font-size: var(--text-xs); font-family: ui-monospace, monospace; }
.check {
  display: flex; gap: var(--space-3); align-items: flex-start; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-3); cursor: pointer; font-size: var(--text-sm);
}
.check input { width: 24px; height: 24px; flex: none; margin-top: 2px; accent-color: var(--accent); }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-full); padding: 3px; gap: 3px; flex-wrap: wrap; }
.seg button {
  font: inherit; font-size: var(--text-sm); border: none; background: transparent; color: var(--ink-2);
  border-radius: var(--r-full); padding: var(--space-2) var(--space-4); min-height: 42px; cursor: pointer;
}
.seg button.on { background: var(--accent); color: #fff; font-weight: 700; }
.q-block { border-top: 1px dashed var(--line); padding-top: var(--space-4); margin-top: var(--space-4); }
.q-block:first-of-type { border-top: none; margin-top: 0; padding-top: 0; }
.q-text { font-size: var(--text-base); margin-bottom: var(--space-3); }

/* ---------- フッター ---------- */
footer.reg {
  max-width: var(--maxw); margin: 0 auto; padding: var(--space-6) clamp(var(--space-4), 3vw, var(--space-8)) var(--space-10);
  font-size: var(--text-xs); color: var(--ink-2); border-top: 1px dashed var(--line);
}

/* ---------- 印刷（医療機関向けサマリ） ---------- */
@media print {
  body { background: #fff; color: #000; }
  .topbar, footer.reg, .no-print, .screen:not(.is-active) { display: none !important; }
  .panel { box-shadow: none; border: 1px solid #999; break-inside: avoid; }
  main { max-width: none; padding: 0; }
}

/* ---------- 応答 ---------- */
@media (max-width: 620px) {
  .mochi-row { grid-template-columns: 1fr; justify-items: center; }
  .bubble-tail { top: -8px; left: 34px; transform: rotate(135deg); }
  .bot-svg { width: 120px; }
  .word-card { grid-template-columns: 1fr; }
  .mst-keys { grid-template-columns: 1fr; }
  .topbar-actions .btn { font-size: var(--text-xs); padding: var(--space-2) var(--space-3); }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* =========================================================
   v2 追加スタイル
   ========================================================= */

/* ---------- 音声ガイドの解禁ボタン（最初の画面に一度だけ） ---------- */
.voice-gate {
  max-width: var(--maxw); margin: 0 auto var(--space-4);
  padding: var(--space-4) clamp(var(--space-4), 3vw, var(--space-8));
  display: grid; justify-items: center; gap: var(--space-2);
}
/* [hidden] は display 指定に負けるため明示的に打ち消す */
.voice-gate[hidden], .voice-note[hidden] { display: none; }
.voice-gate-btn { width: min(100%, 460px); }
.voice-gate-note { font-size: var(--text-xs); color: var(--ink-2); text-align: center; margin: 0; }
.voice-note {
  max-width: var(--maxw);
  margin: 0 auto var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: var(--surface-2); border: 1px solid var(--line); border-left: 4px solid var(--warn);
  border-radius: var(--r-sm); font-size: var(--text-sm); color: var(--ink);
}
.bubble { padding-bottom: calc(var(--space-4) + 34px); flex-direction: column; align-items: flex-start; gap: var(--space-2); }
.btn.small.replay {
  position: absolute; right: var(--space-3); bottom: var(--space-3);
  min-height: 36px; font-size: var(--text-xs); padding: 0 var(--space-3);
  background: var(--surface); color: var(--ink-2);
}
.scoring .btn.small.replay { display: none; }

/* ---------- タイミング較正：あかりが点く発光 ---------- */
.lamp-pad {
  font: inherit; font-size: var(--text-lg); font-weight: 700; cursor: pointer;
  width: 168px; height: 168px; border-radius: var(--r-full);
  border: 2px solid oklch(38% 0.01 80);
  background: radial-gradient(circle at 38% 32%, oklch(28% 0.012 80), oklch(19% 0.008 80));
  color: oklch(72% 0.02 85);
  display: grid; place-items: center;
  box-shadow: inset 0 2px 10px rgba(0,0,0,.45);
  transition: color .12s ease, border-color .12s ease, background .12s ease, box-shadow .18s ease;
}
.lamp-pad:focus-visible { outline: 3px solid oklch(80% 0.15 85); outline-offset: 4px; }
.lamp-pad.lit {
  background:
    radial-gradient(circle at 50% 45%, oklch(93% 0.10 92) 0%, oklch(85% 0.17 90) 42%, oklch(76% 0.18 72) 78%, oklch(72% 0.19 60) 100%);
  border-color: oklch(78% 0.16 72);
  color: oklch(30% 0.09 60);
  box-shadow:
    0 0 0 6px color-mix(in oklab, oklch(85% 0.17 90) 30%, transparent),
    0 0 28px 10px color-mix(in oklab, oklch(72% 0.19 60) 55%, transparent),
    inset 0 0 22px color-mix(in oklab, oklch(95% 0.09 95) 70%, transparent);
}
.lamp-pad.bloom { animation: lampBloom .5s ease-out; }
@keyframes lampBloom {
  0%   { box-shadow: 0 0 0 10px color-mix(in oklab, oklch(85% 0.17 90) 45%, transparent),
                     0 0 40px 16px color-mix(in oklab, oklch(72% 0.19 60) 60%, transparent); }
  100% { box-shadow: inset 0 2px 10px rgba(0,0,0,.45); }
}
.lamp-dots { display: flex; gap: var(--space-2); justify-content: center; margin-top: var(--space-4); }
.lamp-dots i {
  width: 12px; height: 12px; border-radius: var(--r-full);
  background: oklch(30% 0.01 80); border: 1px solid oklch(40% 0.01 80);
  transition: background .2s ease, box-shadow .2s ease;
}
.lamp-dots i.on {
  background: oklch(85% 0.17 90); border-color: oklch(76% 0.18 72);
  box-shadow: 0 0 8px 2px color-mix(in oklab, oklch(80% 0.18 75) 55%, transparent);
}

/* ---------- L0（適応分岐）の進捗 ---------- */
.remain { font-size: var(--text-sm); color: var(--ink-2); }
.remain b { color: var(--ink); font-size: var(--text-base); }
.stage-note {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: var(--space-3) var(--space-4); font-size: var(--text-sm);
}

/* ---------- あそぶ（たのしむ） ---------- */
.play-banner {
  background: color-mix(in oklab, var(--good) 12%, var(--surface));
  border: 1px solid color-mix(in oklab, var(--good) 35%, var(--line));
  border-radius: var(--r-md); padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
}
.game-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-4); }
.game-card {
  display: grid; gap: var(--space-2); text-align: left;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: var(--space-4); cursor: pointer; font: inherit; color: var(--ink);
  min-height: 150px; align-content: start;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.game-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--accent); }
.game-card:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.game-card .gc-emoji { font-size: 1.9em; line-height: 1; }
.game-card .gc-title { font-size: var(--text-lg); font-weight: 700; }
.game-card .gc-desc { font-size: var(--text-xs); color: var(--ink-2); }
.game-card.suggest { border-color: var(--good); background: color-mix(in oklab, var(--good) 10%, var(--surface-2)); }

.play-ring { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.play-ring .pr {
  width: 44px; height: 44px; border-radius: var(--r-full); display: grid; place-items: center;
  border: 2px dashed var(--line); background: var(--surface-2);
  font-size: var(--text-xs); color: var(--ink-2);
}
.play-ring .pr.on {
  border-style: solid; border-color: transparent;
  background: radial-gradient(circle at 50% 40%, oklch(88% 0.13 95), oklch(78% 0.16 70));
  color: oklch(30% 0.08 60); font-weight: 700;
}

/* 神経衰弱 */
.mem-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-3); max-width: 520px; margin: 0 auto; }
@media (max-width: 520px) { .mem-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.mem-card {
  aspect-ratio: 1; border-radius: var(--r-md); border: 2px solid var(--line);
  background: var(--surface-2); cursor: pointer; display: grid; place-items: center;
  padding: var(--space-2); min-height: 72px;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.mem-card .back { font-size: 1.6em; opacity: .5; }
.mem-card svg { width: 74%; height: auto; }
.mem-card.open { border-color: var(--accent); background: var(--surface); }
.mem-card.matched { border-color: var(--good); background: color-mix(in oklab, var(--good) 14%, var(--surface)); animation: matchPop .45s cubic-bezier(.34,1.56,.64,1); }
@keyframes matchPop { 0% { transform: scale(.9); } 100% { transform: scale(1); } }
.mem-label { font-size: var(--text-xs); color: var(--ink-2); text-align: center; margin-top: 2px; }

/* スライドパズル */
.slide-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  width: min(100%, 360px); margin: 0 auto; background: var(--line); padding: 6px; border-radius: var(--r-md);
}
.slide-tile {
  aspect-ratio: 1; border: none; border-radius: var(--r-sm); cursor: pointer; padding: 0;
  overflow: hidden; background: var(--surface); position: relative;
  transition: transform .12s ease;
}
.slide-tile.empty { background: var(--surface-2); cursor: default; box-shadow: inset 0 0 12px rgba(0,0,0,.12); }
/* 絵は 300% の内側ラッパー span いっぱいに描く（ここで再拡大しない） */
.slide-tile svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.slide-tile.hintable { outline: 3px solid var(--good); outline-offset: -3px; }

/* じゅんばんタッチ */
.corsi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3); width: min(100%, 380px); margin: 0 auto; }
.corsi-tile {
  aspect-ratio: 1; border-radius: var(--r-md); cursor: pointer;
  border: 2px solid oklch(42% 0.012 80);
  background: radial-gradient(circle at 40% 34%, oklch(30% 0.012 80), oklch(21% 0.008 80));
  transition: background .15s ease, box-shadow .2s ease, transform .12s ease;
}
.corsi-tile.lit {
  background: radial-gradient(circle at 50% 42%, oklch(93% 0.10 92), oklch(85% 0.17 90) 45%, oklch(74% 0.19 62));
  box-shadow: 0 0 24px 8px color-mix(in oklab, oklch(78% 0.18 72) 55%, transparent);
}
.corsi-tile.tapped { background: radial-gradient(circle at 50% 42%, oklch(88% 0.12 150), oklch(70% 0.14 160)); }
.corsi-tile.wrong { background: radial-gradient(circle at 50% 42%, oklch(78% 0.06 60), oklch(60% 0.05 60)); }

/* 紙ふぶき（あそぶ画面だけ） */
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 50; }
.confetti i {
  position: absolute; width: 10px; height: 14px; border-radius: 2px; top: -20px;
  animation: fall 1.9s linear forwards;
}
@keyframes fall { to { transform: translateY(105vh) rotate(540deg); opacity: .2; } }
.play-toast {
  text-align: center; font-size: var(--text-lg); font-weight: 700; color: var(--ink);
  background: color-mix(in oklab, var(--good) 16%, var(--surface));
  border: 1px solid color-mix(in oklab, var(--good) 40%, var(--line));
  border-radius: var(--r-md); padding: var(--space-3) var(--space-4); margin-top: var(--space-4);
}
.game-controls { display: flex; gap: var(--space-3); flex-wrap: wrap; justify-content: center; margin-top: var(--space-5); }

/* =========================================================
   みちおぼえ（空間ナビゲーション）— nav.js / michi.js
   ========================================================= */
.nav-stage {
  position: relative; display: grid; place-items: center;
  width: min(100%, 340px); margin: 0 auto;
}
.nav-map { width: 100%; height: auto; display: block; border-radius: var(--r-md); }
.nav-map.nav-tap { cursor: crosshair; touch-action: manipulation; }
.nav-map.nav-tap:hover { filter: brightness(1.02); }
.nav-overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.nav-blank {
  aspect-ratio: 1; width: min(100%, 340px);
  border-radius: var(--r-md); border: 2px dashed var(--line);
  background: var(--surface-2); display: grid; place-items: center;
}

/* =========================================================
   おつかい（展望記憶）— pm.js / otsukai.js
   ========================================================= */
.pm-brief {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: var(--space-4); margin-bottom: var(--space-4);
}
.pm-shelf {
  position: relative; border: 2px solid var(--line); border-radius: var(--r-md);
  padding: var(--space-4); background: var(--surface-2);
}
/* 赤いふだ：色だけに頼らず「文字」でも示す（色覚特性への配慮） */
.pm-shelf.tagged { border-color: var(--accent); border-width: 3px; }
.pm-tag {
  position: absolute; top: calc(-1 * var(--space-3)); left: var(--space-4);
  background: var(--accent); color: oklch(99% 0 0);
  font-size: var(--text-xs); font-weight: 700;
  padding: 4px 12px; border-radius: 999px; letter-spacing: .04em;
}
.pm-bell {
  display: block; margin: var(--space-4) auto 0;
  min-width: 96px; min-height: 72px; font-size: 2em; line-height: 1;
  border-radius: var(--r-md); border: 2px solid var(--line);
  background: var(--surface); cursor: pointer;
}
.pm-bell:hover { border-color: var(--accent); transform: translateY(-1px); }
.pm-bell:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.pm-demo { font-size: 3em; text-align: center; margin-top: var(--space-4); }

/* 24時間展望記憶の的：画面の隅に静かに置くだけ。こちらからは促さない。 */
.pm24-slot { position: absolute; top: var(--space-4); right: var(--space-4); z-index: 3; }
.session-shell { position: relative; }
.pm24-target {
  width: 56px; height: 56px; font-size: 1.5em; line-height: 1;
  border-radius: 50%; border: 2px solid var(--line);
  background: var(--surface); cursor: pointer; opacity: .85;
}
.pm24-target:hover { opacity: 1; border-color: var(--accent); }
.pm24-target:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.pm24-slot.done .pm24-target {
  border-color: var(--good); background: color-mix(in oklab, var(--good) 18%, var(--surface));
  cursor: default;
}

@media (max-width: 480px) {
  .pm24-slot { top: var(--space-3); right: var(--space-3); }
  .pm24-target { width: 48px; height: 48px; font-size: 1.25em; }
}

/* ---- SOMI 相当ステージ（医療者向け表示のみ） ---- */
.somi-ladder{display:grid;grid-template-columns:repeat(6,1fr);gap:4px;margin:var(--space-4) 0}
.somi-cell{border:1px solid var(--line);border-radius:8px;padding:8px 4px;text-align:center;
  background:var(--surface);display:flex;flex-direction:column;gap:2px;min-height:64px;justify-content:center}
.somi-cell b{font-size:var(--text-lg);line-height:1}
.somi-cell span{font-size:10px;line-height:1.25;color:var(--muted)}
.somi-cell.in{background:color-mix(in srgb,var(--accent) 14%,var(--surface));border-color:var(--accent)}
.somi-cell.point{background:var(--accent);border-color:var(--accent)}
.somi-cell.point b,.somi-cell.point span{color:#fff}
@media (max-width:520px){.somi-ladder{grid-template-columns:repeat(3,1fr)}}
.somi-legend{font-size:var(--text-xs);line-height:1.6;margin-top:calc(-1 * var(--space-2))}
/* 貯蔵軸（SOMI 3〜5）は意図して算出しない。空欄ではなく無効帯として見せる */
.somi-cell.off{background:repeating-linear-gradient(135deg,
  color-mix(in srgb,var(--line) 26%,transparent) 0 6px,transparent 6px 12px);
  border-style:dashed;opacity:.62}
.somi-cell.off b,.somi-cell.off span{color:var(--muted)}
/* 較正状態のバッジ。消せない位置に常設する */
.somi-status{margin:var(--space-3) 0;padding:8px 12px;border-radius:8px;
  font-size:var(--text-sm);border:1px solid var(--line)}
.somi-status.warn{background:color-mix(in srgb,#c8811f 12%,var(--surface));border-color:#c8811f}
.somi-status.bad{background:color-mix(in srgb,#b3261e 12%,var(--surface));border-color:#b3261e}
.somi-status.ok{background:color-mix(in srgb,#2e7d52 12%,var(--surface));border-color:#2e7d52}
.somi-refusal{margin:var(--space-4) 0;padding:10px 12px;border:1px dashed var(--line);border-radius:8px}
.somi-refusal summary{cursor:pointer;font-size:var(--text-sm)}
.somi-refusal ul{margin:var(--space-3) 0 0;padding-left:1.2em}
.somi-refusal li{margin-bottom:var(--space-3);line-height:1.7}

/* ===== 立会いモード：大きな操作カード =====
   高齢の利用者が「次に何を押せばよいか」を迷わないよう、
   主要な行動は横並びにせず、全幅の大きな面として縦に積む。 */
.wit-actions { display: grid; gap: var(--space-3); margin-top: var(--space-4); }
.wit-act {
  display: grid; grid-template-columns: 56px 1fr; align-items: center;
  gap: var(--space-4); width: 100%; text-align: left;
  min-height: 84px; padding: var(--space-4) var(--space-5);
  border: 2px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: inherit; cursor: pointer;
  font-family: inherit; transition: transform .12s ease, box-shadow .12s ease;
}
.wit-act:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.wit-act:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.wit-act .ic {
  width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center; font-size: 26px;
  background: color-mix(in oklab, var(--accent) 12%, var(--surface));
}
.wit-act .tx b { display: block; font-size: var(--text-lg); line-height: 1.35; }
.wit-act .tx span { display: block; margin-top: 2px; font-size: var(--text-sm); color: var(--muted); }
.wit-act.primary { background: var(--accent); border-color: transparent; color: #fff; }
.wit-act.primary .ic { background: rgba(255,255,255,.22); }
.wit-act.primary .tx span { color: rgba(255,255,255,.88); }

.wit-rec { border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--space-4); margin-top: var(--space-3); background: var(--surface); }
.wit-rec .ttl { font-size: var(--text-md); font-weight: 700; line-height: 1.4; }
.wit-rec .sub { margin-top: var(--space-1); font-size: var(--text-sm); color: var(--muted); }
.wit-rec .btn { width: 100%; margin-top: var(--space-3); }
.wit-more { margin-top: var(--space-4); }
.wit-more > summary { cursor: pointer; padding: var(--space-3) 0;
  font-size: var(--text-sm); color: var(--muted); list-style: none; }
.wit-more > summary::-webkit-details-marker { display: none; }
.wit-more > summary::before { content: "▸ "; }
.wit-more[open] > summary::before { content: "▾ "; }

/* =========================================================
   言語ごとの書体
   ========================================================= */
html[data-lang="en"] body { line-height: 1.65; }

/* =========================================================
   言語えらび
   ========================================================= */
.lang-wrap { position: relative; }
.lang-pop {
  position: absolute; top: calc(100% + 6px); left: 0; right: auto; z-index: 60;
  background: var(--surface-1, #fff); border: 1px solid var(--line, #e6e0d8);
  border-radius: var(--r-md); box-shadow: 0 10px 30px rgba(0,0,0,.14);
  padding: var(--space-2); display: grid; gap: var(--space-1); min-width: 190px;
}
.lang-pop[hidden] { display: none; }
.lang-pop button {
  display: flex; align-items: center; gap: var(--space-3);
  width: 100%; min-height: 48px; padding: 0 var(--space-3);
  border: 0; background: transparent; border-radius: var(--r-sm);
  font: inherit; font-size: var(--text-base); color: inherit;
  text-align: left; cursor: pointer;
}
.lang-pop button:hover, .lang-pop button:focus-visible { background: var(--surface-2, #f6f3ee); }
.lang-pop button[aria-selected="true"] { font-weight: 700; color: var(--accent, #E4574C); }
.lang-pop .tick { width: 1.2em; flex: none; }

/* ホーム画面に置く言語えらび */
.lang-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--space-2); }
.lang-row button {
  min-height: 56px; border-radius: var(--r-md); border: 1.5px solid var(--line, #e6e0d8);
  background: var(--surface-1, #fff); font: inherit; font-size: var(--text-base);
  cursor: pointer; padding: var(--space-2);
}
.lang-row button[aria-pressed="true"] {
  border-color: var(--accent, #E4574C); color: var(--accent, #E4574C); font-weight: 700;
  background: color-mix(in oklab, var(--accent, #E4574C) 8%, transparent);
}

/* ---------- 数字おぼえ（目の記録つき） ---------- */
.eye-facts { margin: 0 0 var(--space-4); padding-inline-start: 1.2em; display: grid; gap: var(--space-2); }
.eye-preview { position: relative; width: min(100%, 320px); margin: 0 auto var(--space-4); border-radius: var(--r-lg); overflow: hidden; background: #000; aspect-ratio: 3 / 4; }
.eye-preview video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.eye-chip { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); padding: 4px 14px; border-radius: 999px; background: rgba(0,0,0,.6); color: #fff; font-size: var(--text-sm); white-space: nowrap; }
.eye-chip.ok { background: #1f8f4d; }
.eye-detail { margin-top: var(--space-4); }
.eye-detail summary { cursor: pointer; color: var(--muted); }
.eye-detail ul { margin: var(--space-3) 0 0; padding-inline-start: 1.2em; display: grid; gap: var(--space-2); font-size: var(--text-sm); }
/* 測定の画面：全画面の灰色。測定の間、色も配置も変えない。 */
.eye-overlay { position: fixed; inset: 0; z-index: 9999; color: #1c1c1c; font-family: inherit; overflow: hidden; touch-action: manipulation; }
.eye-fix { position: absolute; left: 50%; top: 22%; transform: translate(-50%, -50%); font-size: 44px; line-height: 1; font-weight: 700; color: #2a2a2a; }
.eye-fix.digit { font-size: 64px; }
.eye-msg { position: absolute; left: 6%; right: 6%; top: 36%; text-align: center; font-size: 22px; line-height: 1.6; text-wrap: balance; word-break: auto-phrase; }
.eye-done { position: absolute; left: 50%; bottom: 16%; transform: translateX(-50%); min-width: 60%; min-height: 64px; padding: 0 24px; border: 0; border-radius: 16px; background: #1c1c1c; color: #fff; font: inherit; font-size: 22px; font-weight: 700; }
.eye-quit { position: absolute; right: 12px; bottom: 12px; min-height: 40px; padding: 0 14px; border: 1px solid rgba(0,0,0,.35); border-radius: 10px; background: transparent; color: #2a2a2a; font: inherit; font-size: 14px; }
.eye-pad { position: absolute; left: 50%; top: 47%; transform: translateX(-50%); width: min(88%, 340px); display: grid; gap: 10px; }
.eye-pad-out { min-height: 44px; text-align: center; font-size: 30px; font-weight: 700; letter-spacing: .12em; background: rgba(255,255,255,.35); border-radius: 12px; line-height: 44px; }
.eye-pad-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.eye-pad-grid button, .eye-pad-row button { min-height: 56px; border: 0; border-radius: 12px; background: #f4f4f4; color: #1c1c1c; font: inherit; font-size: 24px; font-weight: 700; }
.eye-pad-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.eye-pad-row button { font-size: 17px; }
.eye-pad-row button.ok { background: #1c1c1c; color: #fff; }
.eye-flash { position: absolute; inset: 0; background: #fff; }
.eye-overlay [hidden] { display: none !important; }

/* 目と薬の質問・記録の送り方 */
.eye-opts { display: grid; gap: var(--space-3); margin-top: var(--space-4); }
.eye-opt { text-align: start; min-height: 56px; }
.eye-opt.sel { border-color: var(--accent); background: color-mix(in oklab, var(--accent) 12%, transparent); font-weight: 700; }
.eye-nav { display: flex; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-5); }
.eye-nav .btn { flex: 1; }
.eye-status { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin: var(--space-2) 0; font-size: var(--text-sm); color: var(--muted); }
.eye-status .btn { flex: none; }
.wit-act.eye-cur { outline: 3px solid var(--accent); outline-offset: 2px; }

/* 思い出す前の予想（0〜n の数を選ぶ） */
.predict-grid { grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); }
.predict-grid .choice { min-height: 60px; font-size: var(--text-lg); font-weight: 700; }

/* 毎日のセッションで、目の記録をしているときの小さな映像 */
.session-shell { position: relative; }
.session-cam { position: absolute; top: 10px; right: 10px; width: 56px; height: 56px; border-radius: 50%; object-fit: cover; transform: scaleX(-1); opacity: .9; background: #000; z-index: 2; pointer-events: none; }

/* カメラの準備を待つ間は、持ち方が分かるように映像を大きく出す */
.session-shell.cam-wait .session-cam { top: auto; bottom: 16px; right: 50%; transform: translateX(50%) scaleX(-1); width: 132px; height: 132px; }
.session-shell.cam-wait .panel { padding-bottom: 170px; }

/* 光への反応：全画面を、暗 → 赤 → 暗 → 青 → 暗 と切り替える。色の切り替えは、じわっと変えずに一度で変える。 */
.light-overlay { position: fixed; inset: 0; z-index: 10000; background: #111111; transition: none; touch-action: none; }
.light-fix { position: absolute; left: 50%; top: 22%; transform: translate(-50%, -50%); font-size: 40px; line-height: 1; font-weight: 700; color: #6a6a6a; }

/* 光と逆を見る課題：暗い灰色の地に、白い点と丸。色は使わない。 */
.gz-overlay { position: fixed; inset: 0; z-index: 10000; color: #fff; overflow: hidden; touch-action: manipulation; font-family: inherit; }
/* 決まりの文は、まんなかの点のすぐ上に置く。点を見たままでも読める近さで、左右の丸が出る高さ（まんなかの横の線）には重ねない。 */
.gz-rule { position: absolute; left: 50%; top: 50%; transform: translate(-50%, calc(-100% - 46px)); width: max-content; max-width: 62vw; text-align: center; font-size: 22px; line-height: 1.4; font-weight: 700; letter-spacing: .04em; color: #ffd166; text-wrap: balance; }
/* まんなかの点：大きな二重丸（白い丸の中に、暗い点）。見つけやすく、見る場所もぶれにくい。 */
.gz-fix { position: absolute; left: 50%; top: 50%; width: 36px; height: 36px; margin: -18px 0 0 -18px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.28); visibility: hidden; }
.gz-fix::after { content: ''; position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: #1d1d1f; }
.gz-fix.on { visibility: visible; }
.gz-target { position: absolute; top: 50%; width: 9vmin; height: 9vmin; min-width: 34px; min-height: 34px; margin-top: -4.5vmin; border-radius: 50%; background: #fff; visibility: hidden; }
.gz-target.l { left: 10%; transform: translateX(-50%); }
.gz-target.r { left: 90%; transform: translateX(-50%); }
.gz-target.on { visibility: visible; }
.gz-guide { position: absolute; top: 50%; width: 11vmin; height: 11vmin; min-width: 42px; min-height: 42px; margin-top: -5.5vmin; border-radius: 50%; border: 3px dashed #ffd166; visibility: hidden; }
.gz-guide.l { left: 10%; transform: translateX(-50%); }
.gz-guide.r { left: 90%; transform: translateX(-50%); }
.gz-guide.on { visibility: visible; }
.gz-guide span { position: absolute; left: 50%; top: 115%; transform: translateX(-50%); white-space: nowrap; font-size: 15px; font-weight: 700; color: #ffd166; }
.gz-guide.l span { left: 0; transform: none; }
.gz-guide.r span { left: auto; right: 0; transform: none; }
.gz-fb { position: absolute; left: 6%; right: 6%; top: 68%; text-align: center; font-size: 20px; line-height: 1.6; min-height: 2em; text-wrap: balance; }
.gz-fb.good { color: #9be7a8; }
.gz-fb.again { color: #ffd9a0; }
.gz-panel { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(92%, 440px); background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.22); border-radius: 18px; padding: 20px 18px; text-align: center; }
.gz-panel h3 { margin: 0 0 12px; font-size: 22px; line-height: 1.5; text-wrap: balance; word-break: auto-phrase; }
.gz-panel p { margin: 12px 0 0; font-size: 17px; line-height: 1.7; color: rgba(255,255,255,.88); }
.gz-diagram { width: 100%; max-width: 340px; height: auto; display: block; margin: 0 auto; }
.gz-btn { margin-top: 18px; min-width: 62%; min-height: 60px; padding: 0 22px; border: 0; border-radius: 16px; background: #ffd166; color: #1d1d1f; font: inherit; font-size: 21px; font-weight: 700; }
.gz-quit { position: absolute; right: 12px; bottom: 12px; min-height: 40px; padding: 0 14px; border: 1px solid rgba(255,255,255,.35); border-radius: 10px; background: transparent; color: rgba(255,255,255,.8); font: inherit; font-size: 14px; }
.gz-overlay [hidden] { display: none !important; }

/* 位置合わせの目印：映像の上に、顔を入れる点線の枠を出す。合うと緑の実線になる。 */
.eye-oval { position: absolute; left: 17%; right: 17%; top: 9%; bottom: 17%; border: 3px dashed rgba(255,255,255,.9); border-radius: 50%; pointer-events: none; box-shadow: 0 0 0 1px rgba(0,0,0,.25); }
.eye-oval.ok { border-style: solid; border-color: #3ddc84; }
/* 結果の「この記録について」 */
.eye-meaning { margin-top: var(--space-4); padding: var(--space-4); border-radius: var(--r-lg); background: color-mix(in oklab, var(--accent) 7%, transparent); border-left: 4px solid var(--accent); }
.eye-meaning b { display: block; margin-bottom: var(--space-2); }
.eye-meaning p { margin: 0 0 var(--space-2); }
.eye-meaning p:last-child { margin-bottom: 0; color: var(--ink-2); font-size: var(--text-sm); }

/* 「この記録について」：何回目か・あと何回かを、丸の数でも見せる */
.eye-meaning .eye-own { color: var(--ink); font-size: inherit; font-weight: 600; }
.eye-meaning .eye-own:empty { display: none; }
.eye-steps { display: flex; gap: 10px; margin: 0 0 var(--space-3); }
.eye-steps span { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--accent); box-sizing: border-box; }
.eye-steps span.on { background: var(--accent); }

/* 4 つの段（ホームと「記録を見る」） */
.stage-act .stage-meta { margin-top: 6px; font-weight: 600; color: var(--muted); }
.stage-act.next { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in oklab, var(--accent) 35%, transparent); }
.stage-act.next .stage-meta { color: var(--accent); }
.stage-act.support { border-style: dashed; }
.stage-rows { display: grid; gap: var(--space-3); margin: var(--space-3) 0 var(--space-4); }
.stage-row { display: grid; grid-template-columns: 44px 1fr; gap: var(--space-3); align-items: start; padding: var(--space-3) var(--space-4); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.stage-row .ic { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; background: color-mix(in oklab, var(--accent) 12%, var(--surface)); }
.stage-row b { display: block; }
.stage-row p { margin: 2px 0 0; }
.stage-row.support { border-style: dashed; }

/* 種類の名前の札：種類ごとの色（js/cuechip.js）。地はうすく、文字は濃いまま。替わったときに小さく 1 回動く。 */
.cue-chip.cue-col {
  background: hsl(var(--cue-h) 82% 80%); color: #1d1a17;
  border: 3px solid hsl(var(--cue-h) 60% 36%);
  animation: cue-pop .28s ease-out 1;
}
@keyframes cue-pop { from { transform: scale(.82); opacity: .4; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .cue-chip.cue-col { animation: none; } }

/* 医療機関向けまとめ：文の入る表（4 つの段の一覧）は折り返す。数値の表は横に流す（.table-wrap）。 */
.clinic-wrap table.data th, .clinic-wrap table.data td { white-space: normal; vertical-align: top; }
.table-wrap { margin: var(--space-2) 0 var(--space-3); }
