/* ==========================================================================
   MIRPET — medical-premium interface (reconstructed)
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
:root {
  --bg: #f3f7f9; --bg-deep: #edf4f6; --surface: #ffffff; --surface-soft: #f8fbfc;
  --ink: #152b33; --ink-soft: #3f5963; --muted: #71858d; --muted-soft: #94a5ab;
  --line: #e3ecef; --line-strong: #d3e2e6;
  --teal-900: #083c4c; --teal-800: #0b4a5e; --teal-700: #0e5a70; --teal-600: #14728a; --teal-500: #1c8c9c;
  --turquoise: #21b6ad; --turquoise-soft: #e5f7f5; --sage: #7fa595; --sage-soft: #edf5f0;
  --blue-soft: #eaf3f8; --danger: #a94e4e; --danger-soft: #fbf0f0; --success: #2e8067; --success-soft: #ecf7f2;
  --amber: #a97a22; --amber-soft: #fbf4e5;
  --shadow-xs: 0 1px 2px rgba(12,48,60,0.04);
  --shadow-sm: 0 4px 16px -6px rgba(12,48,60,0.08), 0 1px 3px rgba(12,48,60,0.03);
  --shadow-md: 0 18px 45px -28px rgba(10,52,65,0.3), 0 2px 8px rgba(10,52,65,0.03);
  --shadow-lg: 0 40px 90px -45px rgba(8,45,58,0.42), 0 4px 16px rgba(8,45,58,0.04);
  --radius-sm: 12px; --radius-md: 18px; --radius-lg: 24px; --radius-xl: 30px;
  --font-sans: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --gutter: clamp(16px, 4vw, 40px);
  --max-width: 1180px;
}
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; font-family: var(--font-sans); font-size: 16px; line-height: 1.5; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body::before { content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none; background: radial-gradient(900px 520px at 12% -8%, rgba(33,182,173,0.075), transparent 65%), radial-gradient(900px 600px at 94% 8%, rgba(20,114,138,0.055), transparent 60%), radial-gradient(800px 500px at 55% 108%, rgba(127,165,149,0.07), transparent 70%); }
::selection { background: rgba(20,114,138,0.18); }
h1,h2,h3,p { margin: 0; }
button,input { font: inherit; }
button { color: inherit; }
a { color: inherit; }
svg { flex: none; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 10px; left: 50%; z-index: 300; transform: translate(-50%, -150%); background: var(--teal-700); color: white; padding: 10px 16px; border-radius: 10px; font-size: 0.85rem; text-decoration: none; transition: transform 0.2s ease; }
.skip-link:focus { transform: translate(-50%, 0); }
:focus-visible { outline: 2.5px solid rgba(20,114,138,0.5); outline-offset: 2px; }
.app-shell { position: relative; z-index: 1; display: flex; min-height: 100vh; min-height: 100dvh; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; border-bottom: 1px solid rgba(216,231,235,0.65); background: rgba(246,250,251,0.84); backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2); }
.topbar__inner { display: flex; width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 13px var(--gutter); align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; min-width: 0; border-radius: 12px; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px; background: white; box-shadow: var(--shadow-sm), inset 0 0 0 1px rgba(14,90,112,0.06); flex: none; }
.brand-mark svg { display: block; border-radius: 10px; }
.brand-text { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.brand-name { font-size: 1.02rem; font-weight: 750; letter-spacing: 0.16em; line-height: 1.1; color: var(--teal-900); }
.brand-sub { font-size: 0.64rem; font-weight: 600; letter-spacing: 0.055em; color: var(--muted); white-space: nowrap; }
.top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; }
.next-pill, .streak-pill { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,0.82); box-shadow: var(--shadow-xs); font-size: 0.78rem; white-space: nowrap; color: var(--ink-soft); transition: border-color 0.2s ease, background 0.2s ease; }
.next-pill .icon { color: var(--teal-600); }
.next-pill__text { color: var(--muted); font-size: 0.72rem; font-weight: 600; }
.next-pill__time { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--teal-800); font-size: 0.8rem; letter-spacing: 0.02em; }
.next-pill.is-off .icon, .next-pill.is-off .next-pill__time { opacity: 0.5; }
.icon-button { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,0.82); color: var(--ink-soft); cursor: pointer; transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease; box-shadow: var(--shadow-xs); }
.icon-button:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); border-color: var(--line-strong); }
.icon-button:active { transform: translateY(0); }
.icon-button--small { width: 32px; height: 32px; border-radius: 10px; }
.layout { display: grid; width: 100%; max-width: var(--max-width); flex: 1; margin: 0 auto; padding: clamp(20px,3.2vw,38px) var(--gutter) 0; grid-template-columns: minmax(240px,280px) minmax(0,1fr) minmax(150px,180px); gap: clamp(12px,1.6vw,20px); align-items: start; }
.stats-column { position: sticky; top: 84px; align-self: start; max-height: calc(100vh - 96px); overflow-y: auto; scrollbar-width: none; }
.stats-column::-webkit-scrollbar { display: none; }
.stats-strip { display: flex; flex-direction: column !important; gap: 6px; }
.stat-card { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-xs); width: 100%; }
.stat-card__icon { width: 28px; height: 28px; border-radius: 8px; }
.stat-value { font-size: 0.85rem; }
.pet-column { display: flex; flex-direction: column; gap: 14px; min-width: 0; position: sticky; top: 84px; align-self: start; max-height: calc(100vh - 96px); overflow-y: auto; scrollbar-width: none; }
.pet-column::-webkit-scrollbar { display: none; }
.study-column { display: flex; flex-direction: column; gap: 14px; min-width: 0; outline: none; }
.eyebrow { margin: 0 0 5px; font-size: 0.64rem; font-weight: 750; letter-spacing: 0.13em; text-transform: uppercase; color: var(--muted); }
.pet-card { position: relative; overflow: hidden; padding: 21px; border: 1px solid rgba(14,90,112,0.09); border-radius: var(--radius-xl); background: linear-gradient(180deg,#ffffff 0%,#f9fcfc 56%,#f1f8f8 100%); box-shadow: var(--shadow-md); }
.pet-card::before { content: ""; position: absolute; inset: -160px -60px auto auto; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(circle, rgba(33,182,173,0.11), transparent 66%); pointer-events: none; }
.pet-card__head { position: relative; z-index: 1; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.pet-card__status { min-width: 0; }
.mood-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 999px; background: var(--sage-soft); color: #336e5d; font-size: 0.69rem; font-weight: 650; letter-spacing: 0.01em; transition: background 0.3s ease, color 0.3s ease; }
.mood-chip__dot { width: 6px; height: 6px; border-radius: 50%; background: #4ba184; box-shadow: 0 0 0 3px rgba(75,161,132,0.1); }
.mood-chip[data-mood="sad"] { background: #f2f6f8; color: #617b84; }
.mood-chip[data-mood="sad"] .mood-chip__dot { background: #8399a0; box-shadow: 0 0 0 3px rgba(131,153,160,0.1); }
.mood-chip[data-mood="sick"], .mood-chip[data-mood="tired"] { background: var(--amber-soft); color: #906b26; }
.mood-chip[data-mood="sick"] .mood-chip__dot, .mood-chip[data-mood="tired"] .mood-chip__dot { background: #c79a45; box-shadow: 0 0 0 3px rgba(199,154,69,0.12); }
.mood-chip[data-mood="critical"] { background: var(--danger-soft); color: #964747; }
.mood-chip[data-mood="critical"] .mood-chip__dot { background: #bd6262; box-shadow: 0 0 0 3px rgba(189,98,98,0.12); }
.mood-chip[data-mood="celebrating"], .mood-chip[data-mood="recovering"] { background: var(--turquoise-soft); color: #1d6d66; }
.level-pill { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border-radius: 9px; background: linear-gradient(160deg, var(--teal-700), var(--teal-800)); color: white; font-size: 0.71rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 0.04em; box-shadow: 0 6px 16px -8px rgba(11,74,94,0.6); white-space: nowrap; }
.pet-stage { position: relative; display: flex; align-items: center; justify-content: center; min-height: 260px; margin: 16px 0 7px; padding: 25px 10px 20px; overflow: hidden; border: 1px solid #deedef; border-radius: 22px; background: linear-gradient(180deg, rgba(255,255,255,0.82), rgba(242,249,250,0.94)), radial-gradient(70% 90% at 50% 0%, rgba(33,182,173,0.07), transparent); isolation: isolate; transition: box-shadow 0.4s ease; }
.pet-stage[data-mood="happy"] { box-shadow: 0 0 40px -10px rgba(33,182,173,0.35); }
.pet-stage[data-mood="sad"] { box-shadow: 0 0 30px -10px rgba(97,123,132,0.25); }
.pet-stage[data-mood="critical"] { box-shadow: 0 0 40px -10px rgba(169,78,78,0.35); }
.pet-stage__glow { position: absolute; top: 24%; left: 50%; width: 235px; height: 195px; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(circle, rgba(33,182,173,0.19), rgba(33,182,173,0) 67%); filter: blur(7px); z-index: 0; transition: opacity 0.4s ease; }
.pet-stage__grain { position: absolute; inset: 0; z-index: 0; opacity: 0.45; background-image: radial-gradient(rgba(14,90,112,0.16) 0.7px, transparent 0.7px); background-size: 15px 15px; -webkit-mask-image: radial-gradient(ellipse 80% 75% at 50% 58%, black, transparent 78%); mask-image: radial-gradient(ellipse 80% 75% at 50% 58%, black, transparent 78%); pointer-events: none; }
.pet-stage__platform { position: absolute; bottom: 17px; left: 50%; width: 44%; height: 22px; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(ellipse, rgba(14,90,112,0.12), rgba(14,90,112,0) 70%); pointer-events: none; }
.pet-sprite { position: relative; z-index: 2; margin: 0 auto; display: block; padding: 0; color: var(--teal-700); font-family: var(--font-mono); font-size: clamp(18px, 2.6vw, 22px); font-weight: 500; line-height: 1.28; letter-spacing: 0.02em; text-align: center; white-space: pre; user-select: none; -webkit-user-select: none; text-shadow: 0 1px 0 rgba(255,255,255,0.9); animation: petBreathe 5.4s ease-in-out infinite; transition: color 0.35s ease; will-change: transform; }
.pet-stage[data-mood="happy"] .pet-sprite { color: #0c7567; }
.pet-stage[data-mood="sad"] .pet-sprite { color: #597b88; }
.pet-stage[data-mood="tired"] .pet-sprite { color: #7c7f68; }
.pet-stage[data-mood="sick"] .pet-sprite { color: #977023; }
.pet-stage[data-mood="critical"] .pet-sprite { color: #a45353; animation: petCritical 2.2s ease-in-out infinite; }
.pet-stage[data-mood="celebrating"] .pet-sprite { color: #0a7f73; }
.pet-fx { position: absolute; top: 13px; left: 50%; z-index: 3; min-height: 14px; transform: translateX(-50%); color: var(--teal-500); font-family: var(--font-mono); font-size: 0.66rem; font-weight: 700; letter-spacing: 0.24em; white-space: nowrap; opacity: 0; pointer-events: none; }
.pet-fx--pulse { animation: petFx 1.6s ease-out both; }
.pet-stage--correct .pet-sprite, .pet-stage--streak .pet-sprite { animation: petJump 0.62s cubic-bezier(0.34,1.56,0.64,1) 3; }
.pet-stage--wrong .pet-sprite { animation: petShake 0.38s ease-in-out 4; }
.pet-stage--levelup .pet-sprite { animation: petJump 0.72s cubic-bezier(0.34,1.56,0.64,1) 4; }
.pet-stage--levelup .pet-stage__glow { animation: glowPulse 1.05s ease-in-out 3; }
.pet-stage--recovery .pet-sprite { animation: petRecover 1.2s ease-in-out 2; }
.pet-identity { display: flex; align-items: center; justify-content: center; gap: 9px; margin-top: 2px; }
.pet-identity h2 { font-size: 1.36rem; font-weight: 720; letter-spacing: -0.02em; line-height: 1.2; color: var(--ink); }
.pet-tier { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 7px; background: var(--sage-soft); color: #4e7868; font-size: 0.64rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.pet-message { min-height: 2.6em; margin: 6px 0 0; text-align: center; font-size: 0.78rem; color: var(--ink-soft); line-height: 1.45; }
.meters { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(218,232,236,0.8); }
.meter__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; font-size: 0.7rem; }
.meter__label { display: inline-flex; align-items: center; gap: 5px; font-weight: 650; color: var(--ink-soft); }
.meter__label .icon { color: var(--teal-600); }
.meter__value { font-size: 0.68rem; font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 600; }
.meter__track { height: 7px; overflow: hidden; border-radius: 999px; background: #e8f0f2; box-shadow: inset 0 1px 2px rgba(14,65,80,0.05); }
.meter__fill { display: block; width: 0; height: 100%; border-radius: inherit; transition: width 0.7s cubic-bezier(0.22,0.8,0.3,1), background 0.3s ease; }
.meter__fill--hunger { background: linear-gradient(90deg, #d97706, #f59e0b); box-shadow: 0 0 8px rgba(245,158,11,0.25); }
.meter__fill--sleep { background: linear-gradient(90deg, #4f46e5, #818cf8); box-shadow: 0 0 8px rgba(129,140,248,0.25); }
.meter__fill--fun { background: linear-gradient(90deg, #db2777, #f472b6); box-shadow: 0 0 8px rgba(244,114,182,0.25); }
.meter__fill--exp { background: linear-gradient(90deg, #14728a, #21b6ad); box-shadow: 0 0 8px rgba(33,182,173,0.2); }
.meter__fill--warn { filter: saturate(1.15); }
.meter__fill--critical { filter: saturate(1.3); animation: pulseCritical 1.4s ease-in-out infinite; }
@keyframes pulseCritical { 0%,100% { opacity: 1; } 50% { opacity: 0.65; } }
.meter--exp { margin-top: 1px; padding-top: 12px; border-top: 1px dashed rgba(218,232,236,0.8); }
.pet-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; justify-content: center; }
.badge-mini { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 7px; background: var(--sage-soft); color: #4e7868; font-size: 0.62rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.badge-mini--locked { background: #f2f6f7; color: var(--muted); }
.aside-note { display: flex; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-xs); }
.aside-note__icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--turquoise-soft); color: var(--teal-700); flex: none; }
.aside-note strong { font-size: 0.8rem; color: var(--ink); }
.aside-note p { font-size: 0.72rem; color: var(--muted); margin-top: 2px; }
.template-notice { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid #dce9ec; border-radius: 14px; background: linear-gradient(90deg, #f4fafb, #eef6f8); }
.template-notice__icon { color: var(--teal-600); flex: none; }
.template-notice__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.template-notice__body strong { font-size: 0.8rem; color: var(--ink); }
.template-notice__body span { font-size: 0.72rem; color: var(--muted); }
.question-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 30px; box-shadow: var(--shadow-md); }
.question-loading { display: flex; align-items: center; gap: 12px; padding: 30px 0; color: var(--muted); }
.spinner { width: 20px; height: 20px; border: 2.5px solid var(--line-strong); border-top-color: var(--teal-600); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.question-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.question-crumb { font-size: 0.72rem; font-weight: 600; color: var(--muted); letter-spacing: 0.02em; }
.favorite-btn { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); color: var(--muted); cursor: pointer; transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease; }
.favorite-btn:hover { transform: translateY(-1px); background: #fff; color: #c98a2f; }
.favorite-btn[aria-pressed="true"] { color: #c98a2f; background: #fff8ec; border-color: #f0d9a8; }
.tag-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
.tag { display: inline-flex; align-items: center; height: 23px; padding: 0 8px; border-radius: 6px; background: #f2f6f7; color: var(--muted); font-size: 0.64rem; font-weight: 650; letter-spacing: 0.025em; white-space: nowrap; }
.tag--new { background: var(--turquoise-soft); color: #23736b; }
.tag--review { background: var(--amber-soft); color: #976e24; }
.tag--exam { background: var(--blue-soft); color: #3b6f83; }
.tag--difficulty-easy { background: var(--success-soft); color: #3c7d68; }
.tag--difficulty-medium { background: var(--amber-soft); color: #92701f; }
.tag--difficulty-hard { background: var(--danger-soft); color: #985353; }
.statement { max-width: 72ch; margin: 18px 0 22px; color: var(--ink); font-size: clamp(1.28rem, 2.1vw, 1.56rem); font-weight: 630; letter-spacing: -0.018em; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; outline: none; }
.clinical { margin-bottom: 23px; padding: 14px 16px 15px; border: 1px solid #e5eef1; border-radius: 16px; background: linear-gradient(180deg, #f9fcfc, #f6fafb); }
.clinical__head { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; cursor: pointer; font-weight: 650; font-size: 0.85rem; color: var(--ink-soft); list-style: none; }
.clinical__head::-webkit-details-marker { display: none; }
.clinical__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
.clinical__item { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 10px; background: #fff; border: 1px solid #e8f0f2; }
.clinical__item span { font-size: 0.62rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.clinical__item strong { font-size: 0.82rem; color: var(--ink); }
.clinical__findings { margin: 10px 0 0; padding-left: 18px; color: var(--ink-soft); font-size: 0.82rem; line-height: 1.5; }
.clinical__notes { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: #fff; border: 1px solid #e8f0f2; font-size: 0.78rem; color: var(--muted); font-style: italic; }
.options-fieldset { border: 0; padding: 0; margin: 0; }
.options { display: flex; flex-direction: column; gap: 9px; }
.option { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 12px; min-height: 58px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); cursor: pointer; transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease; }
.option:hover:not(.is-locked) { transform: translateY(-2px); box-shadow: var(--shadow-sm); border-color: var(--line-strong); background: #fff; }
.option__input { position: absolute; opacity: 0; pointer-events: none; }
.option__letter { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #fff; border: 1px solid var(--line); color: var(--teal-700); font-weight: 750; font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.option__text { font-size: 0.88rem; line-height: 1.45; color: var(--ink); }
.option__badge { font-size: 0.66rem; font-weight: 700; color: var(--muted); padding: 3px 8px; border-radius: 999px; background: #f2f6f7; white-space: nowrap; }
.option.is-locked { cursor: default; }
.option.is-correct { border-color: #8fd6ce; background: #f0fbf9; }
.option.is-correct .option__letter { background: #2e8067; color: #fff; border-color: #2e8067; }
.option.is-correct .option__badge { background: #ecf7f2; color: #2e8067; }
.option.is-wrong { border-color: #e8c7c7; background: #fdf5f5; }
.option.is-wrong .option__letter { background: #a94e4e; color: #fff; border-color: #a94e4e; }
.option.is-wrong .option__badge { background: #fbf0f0; color: #a94e4e; }
.option.is-dim { opacity: 0.55; }
.answer-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 20px; padding-top: 18px; border-top: 1px solid #eef3f4; }
.hint { font-size: 0.72rem; color: var(--muted); line-height: 1.4; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 10px 18px; border: 1px solid transparent; border-radius: 13px; background: transparent; color: var(--ink-soft); font-size: 0.83rem; font-weight: 650; line-height: 1.2; white-space: nowrap; cursor: pointer; transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease, opacity 0.18s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { transform: none; cursor: not-allowed; }
.btn--primary { border-color: transparent; background: linear-gradient(135deg, #14748b 0%, #0c5268 100%); color: #fff; box-shadow: 0 12px 26px -14px rgba(11,74,94,0.65); }
.btn--primary:hover:not(:disabled) { box-shadow: 0 16px 30px -14px rgba(11,74,94,0.7); filter: brightness(1.035); }
.btn--primary:disabled { background: #b9cfd4; color: rgba(255,255,255,0.92); opacity: 1; box-shadow: none; }
.btn--soft { border-color: #dbeaed; background: #eff7f8; color: var(--teal-700); }
.btn--soft:hover { background: #e8f3f5; border-color: #c9e1e6; }
.btn--ghost { border-color: var(--line); background: #fff; color: var(--ink-soft); }
.btn--ghost:hover { background: #fbfdfd; border-color: #d1e3e7; }
.btn--danger-ghost { border-color: #f0d9d9; background: #fdf8f8; color: #9e4f4f; }
.btn--danger-ghost:hover { background: #fbefef; border-color: #e8c7c7; }
.btn--small { min-height: 34px; padding: 7px 11px; border-radius: 10px; font-size: 0.74rem; }
.btn__icon { width: 17px; height: 17px; }
.file-button { position: relative; overflow: hidden; }
.file-button input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.text-button { background: none; border: 0; color: var(--teal-600); font-weight: 650; cursor: pointer; padding: 0; font-size: 0.74rem; }
.text-button:hover { text-decoration: underline; }
.result { margin-top: 22px; padding-top: 22px; border-top: 1px solid #eef3f4; animation: fadeInUp 0.4s ease both; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.result__banner { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; background: linear-gradient(135deg, #f0fbf9, #e8f6f4); }
.result--wrong .result__banner { background: linear-gradient(135deg, #fdf5f5, #fbeaea); }
.result__icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: #fff; color: #2e8067; flex: none; }
.result--wrong .result__icon { color: #a94e4e; }
.result__headline { flex: 1; min-width: 0; }
.result__title { font-size: 0.95rem; font-weight: 720; color: var(--ink); }
.result__subtitle { font-size: 0.76rem; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.result__rewards { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.reward-chip { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: 0.68rem; font-weight: 700; color: var(--ink-soft); }
.reward-chip--xp { background: var(--turquoise-soft); color: #1d6d66; border-color: #bfe8e3; }
.result__answer { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding: 12px 14px; border-radius: 12px; background: var(--surface-soft); border: 1px solid var(--line); }
.answer-letter { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--teal-700); color: #fff; font-weight: 750; font-size: 0.82rem; flex: none; }
.result__section-title { margin: 18px 0 8px; font-size: 0.72rem; font-weight: 750; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.general-explanation { padding: 12px 14px; border-radius: 12px; background: var(--surface-soft); border: 1px solid var(--line); font-size: 0.82rem; line-height: 1.55; color: var(--ink-soft); }
.explain-list { display: flex; flex-direction: column; gap: 8px; }
.explain { padding: 11px 13px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.explain--correct { border-color: #8fd6ce; background: #f0fbf9; }
.explain--selected-wrong { border-color: #e8c7c7; background: #fdf5f5; }
.explain__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.explain__letter { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: var(--surface-soft); border: 1px solid var(--line); font-weight: 750; font-size: 0.72rem; color: var(--teal-700); flex: none; }
.explain__option { flex: 1; min-width: 0; font-size: 0.8rem; color: var(--ink); line-height: 1.4; }
.explain__status { font-size: 0.66rem; font-weight: 700; color: var(--muted); padding: 2px 7px; border-radius: 999px; background: #f2f6f7; white-space: nowrap; }
.explain--correct .explain__status { background: #ecf7f2; color: #2e8067; }
.explain--selected-wrong .explain__status { background: #fbf0f0; color: #a94e4e; }
.explain__text { margin-top: 6px; font-size: 0.78rem; line-height: 1.5; color: var(--ink-soft); padding-left: 32px; }
.explain__text--missing { color: #9aa9ae; font-style: italic; }
.result__source { display: flex; flex-wrap: wrap; gap: 5px 12px; margin-top: 15px; color: var(--muted-soft); font-size: 0.66rem; line-height: 1.5; }
.result__footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 20px; padding-top: 18px; border-top: 1px solid #eef3f4; }
.result__hint { font-size: 0.72rem; color: var(--muted); }
.stats-strip { display: flex; flex-direction: column !important; gap: 6px; }
.stat-card { display: flex; align-items: center; gap: 10px; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-xs); }
.stat-card__icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--blue-soft); color: var(--teal-700); flex: none; }
.stat-card__text { min-width: 0; }
.stat-label { font-size: 0.62rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.stat-value { font-size: 1rem; font-weight: 720; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat-value--small { font-size: 0.74rem; }
.ring { position: relative; width: 42px; height: 42px; border-radius: 50%; background: conic-gradient(var(--turquoise) calc(var(--value, 0) * 1%), var(--line) 0); display: grid; place-items: center; flex: none; }
.ring::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--surface); }
.ring span { position: relative; z-index: 1; font-size: 0.6rem; font-weight: 750; color: var(--teal-800); font-variant-numeric: tabular-nums; }
.ring--large { width: 72px; height: 72px; }
.ring--large span { font-size: 0.85rem; }
.footer { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 24px var(--gutter) 20px; font-size: 0.66rem; color: var(--muted); }
.footer__dot { width: 3px; height: 3px; border-radius: 50%; background: var(--muted-soft); }
.footer__version { color: var(--muted-soft); }
.reminder-banner { position: fixed; top: 74px; left: 50%; transform: translateX(-50%); z-index: 40; display: flex; align-items: center; gap: 10px; width: min(600px, calc(100vw - 28px)); padding: 12px 14px; border: 1px solid #dce9ec; border-radius: 14px; background: #fff; box-shadow: var(--shadow-lg); }
.reminder-banner__icon { color: var(--teal-600); flex: none; }
.reminder-banner__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.reminder-banner__body strong { font-size: 0.8rem; color: var(--ink); }
.reminder-banner__body span { font-size: 0.72rem; color: var(--muted); }
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(8,45,58,0.35); backdrop-filter: blur(4px); }
.modal:not([open]) { display: none; }
.modal__panel { width: min(720px, 100%); max-height: 90vh; overflow: auto; border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-lg); }
.modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 22px 24px 16px; border-bottom: 1px solid var(--line); }
.modal__head h2 { font-size: 1.2rem; color: var(--ink); }
.modal__body { padding: 20px 24px 24px; display: flex; flex-direction: column; gap: 18px; }
.modal__footer { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 24px 20px; border-top: 1px solid var(--line); }
.settings-section { display: flex; flex-direction: column; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.settings-section:last-child { border-bottom: 0; }
.section-heading h3 { font-size: 0.95rem; color: var(--ink); }
.section-heading p { font-size: 0.74rem; color: var(--muted); margin-top: 2px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field span, .field__label { font-size: 0.72rem; font-weight: 650; color: var(--ink-soft); }
.field input, .field select { height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); color: var(--ink); font-size: 0.82rem; }
.field input:focus, .field select:focus { outline: none; border-color: var(--teal-600); box-shadow: 0 0 0 3px rgba(20,114,138,0.12); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; }
.switch-row__text { display: flex; flex-direction: column; gap: 2px; }
.switch-row__text strong { font-size: 0.82rem; color: var(--ink); }
.switch-row__text small { font-size: 0.7rem; color: var(--muted); }
.switch { position: relative; width: 40px; height: 22px; border-radius: 999px; background: var(--line-strong); transition: background 0.2s ease; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 0.2s ease; box-shadow: 0 1px 3px rgba(0,0,0,0.15); }
.switch-row input:checked + .switch { background: var(--teal-600); }
.switch-row input:checked + .switch::after { transform: translateX(18px); }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.permission-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.permission-pill { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px; background: var(--amber-soft); color: #906b26; font-size: 0.7rem; font-weight: 650; }
.permission-pill--granted { background: var(--success-soft); color: var(--success); }
.permission-pill--denied { background: var(--danger-soft); color: var(--danger); }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-soft); color: var(--ink-soft); font-size: 0.72rem; font-weight: 600; cursor: pointer; transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease; }
.chip:hover { background: #fff; border-color: var(--line-strong); }
.chip--active { background: var(--teal-700); color: #fff; border-color: var(--teal-700); }
.day-row { display: flex; gap: 6px; flex-wrap: wrap; }
.day { display: inline-flex; }
.day input { position: absolute; opacity: 0; pointer-events: none; }
.day span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-soft); color: var(--ink-soft); font-size: 0.72rem; font-weight: 600; cursor: pointer; transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease; }
.day input:checked + span { background: var(--teal-700); color: #fff; border-color: var(--teal-700); }
.bank-summary { display: flex; flex-direction: column; gap: 8px; }
.bank-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.bank-row__icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: #fff; color: var(--teal-700); flex: none; }
.bank-row__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.bank-row__text strong { font-size: 0.8rem; color: var(--ink); }
.bank-row__text small { font-size: 0.68rem; color: var(--muted); white-space: normal; }
.bank-row__remove { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--muted); cursor: pointer; }
.bank-row__remove:hover { color: var(--danger); border-color: #e8c7c7; background: #fdf5f5; }
.bank-feedback { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); font-size: 0.78rem; color: var(--ink-soft); }
.bank-feedback--ok { border-color: #bfe8e3; background: #f0fbf9; }
.bank-feedback ul { margin: 6px 0 0; padding-left: 18px; }
.bank-feedback li { margin: 2px 0; font-size: 0.74rem; }
.field-note { font-size: 0.7rem; color: var(--muted); line-height: 1.45; }
.candidate-questions { margin-top: 12px; }
.candidate-list { list-style: none; margin: 8px 0 0; padding: 0; max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.candidate-item { display: flex; flex-direction: column; gap: 2px; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.candidate-item:last-child { border-bottom: 0; }
.candidate-item__title { font-size: 0.78rem; line-height: 1.4; color: var(--ink); }
.candidate-item__meta { font-size: 0.66rem; color: var(--muted); }
.progress-overview { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.overview-stat { display: flex; flex-direction: column; gap: 2px; padding: 10px 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); text-align: center; }
.overview-stat span { font-size: 0.62rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.overview-stat strong { font-size: 1rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.progress-goal { display: flex; align-items: center; gap: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); }
.progress-goal h3 { font-size: 0.9rem; color: var(--ink); }
.progress-goal p { font-size: 0.74rem; color: var(--muted); margin-top: 2px; }
.achievement-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.achievement { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.achievement--unlocked { background: var(--success-soft); border-color: #bfe8e3; }
.achievement__icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: #fff; color: var(--teal-700); flex: none; }
.achievement--unlocked .achievement__icon { color: var(--success); }
.achievement__body { flex: 1; min-width: 0; }
.achievement__title { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 0.8rem; font-weight: 650; color: var(--ink); }
.achievement__check { color: var(--success); }
.achievement__desc { font-size: 0.7rem; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.achievement__progress { height: 5px; border-radius: 999px; background: var(--line); overflow: hidden; margin-top: 8px; }
.achievement__progress span { display: block; height: 100%; background: var(--teal-600); border-radius: inherit; }
.achievement__count { font-size: 0.66rem; color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }
.hierarchy { display: flex; flex-direction: column; gap: 12px; }
.bank-group { border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); padding: 12px; }
.bank-group__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.bank-group__head strong { font-size: 0.82rem; color: var(--ink); }
.bank-group__head span { font-size: 0.7rem; color: var(--muted); }
.tree { display: flex; flex-direction: column; gap: 4px; }
.tree ul { list-style: none; margin: 4px 0 0 14px; padding: 0; }
.tree-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 0.76rem; color: var(--ink-soft); }
.tree-row__name { flex: 1; min-width: 0; }
.tree-row__accuracy { font-size: 0.66rem; color: var(--success); font-weight: 600; }
.tree-row__count { font-size: 0.66rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.tree-empty { font-size: 0.74rem; color: var(--muted); font-style: italic; }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; width: min(360px, calc(100vw - 32px)); }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-lg); animation: toastIn 0.28s ease both; }
.toast--out { animation: toastOut 0.28s ease both; }
.toast__icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--blue-soft); color: var(--teal-700); flex: none; }
.toast--success .toast__icon { background: var(--success-soft); color: var(--success); }
.toast--warning .toast__icon { background: var(--amber-soft); color: var(--amber); }
.toast--error .toast__icon { background: var(--danger-soft); color: var(--danger); }
.toast__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.toast__title { font-size: 0.8rem; font-weight: 650; color: var(--ink); }
.toast__message { font-size: 0.72rem; color: var(--muted); line-height: 1.4; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(10px); } }
.fx-layer { position: fixed; inset: 0; z-index: 150; pointer-events: none; overflow: hidden; }
.confetti { position: absolute; top: -10px; width: 8px; height: 14px; border-radius: 2px; animation: confettiFall 2.6s ease-in both; }
@keyframes confettiFall { 0% { transform: translate3d(0,0,0) rotate(0deg); opacity: 1; } 100% { transform: translate3d(var(--drift,20px), 105vh, 0) rotate(var(--spin,540deg)); opacity: 0; } }
@keyframes petBreathe { 0%,100% { transform: scale(1); } 50% { transform: scale(1.03); } }
@keyframes petCritical { 0%,100% { transform: scale(1) rotate(0deg); } 25% { transform: scale(1.02) rotate(-1deg); } 75% { transform: scale(1.02) rotate(1deg); } }
@keyframes petFx { 0% { opacity: 0; transform: translateX(-50%) translateY(4px); } 20% { opacity: 1; transform: translateX(-50%) translateY(0); } 100% { opacity: 0; transform: translateX(-50%) translateY(-10px); } }
@keyframes petJump { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes petShake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@keyframes petRecover { 0% { transform: scale(0.95); opacity: 0.7; } 100% { transform: scale(1); opacity: 1; } }
@keyframes glowPulse { 0%,100% { opacity: 0.6; transform: translateX(-50%) scale(1); } 50% { opacity: 1; transform: translateX(-50%) scale(1.15); } }
@keyframes sheetIn { from { opacity: 0.6; transform: translateY(100%); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .pet-sprite, .pet-fx { animation: none !important; }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(260px,320px) minmax(0,1fr); gap: 16px; }
  .stats-column { position: static; max-height: none; overflow: visible; grid-column: 1 / -1; }
  .stats-strip { flex-direction: row; flex-wrap: wrap; }
  .stats-strip .stat-card { flex: 1 1 45%; }
  .pet-sprite { font-size: 18px; }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0,1fr); padding-top: 18px; gap: 14px; }
  .pet-column { display: grid; grid-template-columns: minmax(0,1fr); gap: 10px; position: static; max-height: none; overflow: visible; }
  .stats-column { position: static; max-height: none; overflow: visible; }
  .stats-strip { flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .stats-strip .stat-card { flex: 1 1 48%; }
  .aside-note { display: none; }
  .pet-card { display: grid; grid-template-columns: 200px minmax(0,1fr); grid-template-areas: "head head" "stage identity" "stage message" "stage meters" "badges badges"; column-gap: 18px; align-items: center; padding: 18px; }
  .pet-card__head { grid-area: head; margin-bottom: 12px; }
  .pet-stage { grid-area: stage; min-height: 190px; margin: 0; align-self: stretch; }
  .pet-identity { grid-area: identity; justify-content: flex-start; margin: 0; align-self: end; }
  .pet-message { grid-area: message; min-height: 2.4em; margin: 5px 0 0; text-align: left; }
  .meters { grid-area: meters; margin-top: 9px; padding-top: 10px; border-top: 0; align-self: start; }
  .meter--exp { margin-top: 0; padding-top: 0; border-top: 0; }
  .pet-badges { grid-area: badges; justify-content: flex-start; margin-top: 2px; }
  .question-card { padding: 24px; }
  .statement { font-size: clamp(1.2rem, 3.4vw, 1.45rem); }
}
@media (max-width: 680px) {
  .topbar__inner { padding: 10px 15px; gap: 10px; }
  .brand-mark { width: 36px; height: 36px; border-radius: 11px; }
  .brand-mark svg { width: 24px; height: 24px; }
  .brand-name { font-size: 0.94rem; }
  .brand-sub { display: none; }
  .next-pill { height: 36px; padding: 0 10px; gap: 5px; }
  .next-pill__text { display: none; }
  .streak-pill { height: 36px; padding: 0 10px; }
  .streak-pill__label { display: none; }
  .icon-button { width: 36px; height: 36px; border-radius: 11px; }
  .top-actions { gap: 5px; }
  .layout { padding: 14px 14px 0; }
  .pet-card { display: block; padding: 15px; border-radius: 23px; }
  .pet-card__head { margin-bottom: 10px; }
  .pet-stage { min-height: 175px; margin: 0 0 8px; padding: 19px 8px 14px; border-radius: 18px; }
  .pet-sprite { font-size: 16px; line-height: 1.32; }
  .pet-stage__platform { bottom: 12px; }
  .pet-identity { justify-content: center; margin: 3px 0 0; }
  .pet-identity h2 { font-size: 1.18rem; }
  .pet-message { min-height: 0; margin: 4px 0 0; text-align: center; font-size: 0.72rem; }
  .meters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(218,232,236,0.8); }
  .meter--exp { margin: 0; padding: 0; border: 0; }
  .meter__head { display: block; margin-bottom: 5px; }
  .meter__label { display: flex; font-size: 0.61rem; }
  .meter__label .icon { width: 12px; height: 12px; }
  .meter__value { display: block; margin-top: 1px; font-size: 0.59rem; }
  .meter__track { height: 6px; }
  .pet-badges { margin-top: 9px; justify-content: center; }
  .template-notice { flex-wrap: wrap; gap: 8px; padding: 10px 11px; }
  .template-notice__body { flex-basis: calc(100% - 44px); }
  .template-notice .text-button { margin-left: 41px; }
  .template-notice .icon-button--small { order: 2; margin-left: auto; }
  .question-card { padding: 18px; border-radius: 23px; }
  .question-crumb { font-size: 0.68rem; }
  .statement { margin: 14px 0 17px; font-size: 1.2rem; line-height: 1.46; }
  .clinical { margin-bottom: 17px; padding: 12px 13px; }
  .option { min-height: 54px; grid-template-columns: 31px minmax(0,1fr); gap: 11px; padding: 10px 12px; }
  .option__letter { width: 30px; height: 30px; border-radius: 9px; }
  .option__text { font-size: 0.86rem; }
  .option__badge { grid-column: 2; justify-self: start; margin-top: -3px; }
  .answer-bar { flex-direction: column; align-items: stretch; gap: 10px; margin-top: 18px; }
  .hint { text-align: center; order: 2; font-size: 0.66rem; }
  .answer-bar .btn { order: 1; width: 100%; min-height: 47px; }
  .result { margin-top: 22px; padding-top: 22px; }
  .result__banner { flex-wrap: wrap; gap: 10px; padding: 12px; }
  .result__icon { width: 34px; height: 34px; }
  .result__rewards { width: 100%; justify-content: flex-start; margin-left: 0; padding-left: 44px; }
  .result__answer { font-size: 0.78rem; }
  .explain__option { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .explain__text { padding-left: 0; font-size: 0.74rem; }
  .result__footer { flex-direction: column; align-items: stretch; gap: 8px; }
  .result__footer .btn { width: 100%; min-height: 46px; }
  .result__hint { text-align: center; order: 2; }
  .stats-strip { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 7px; }
  .stat-card { padding: 11px; border-radius: 14px; }
  .stat-card__icon { width: 29px; height: 29px; border-radius: 9px; }
  .stat-value { font-size: 0.94rem; }
  .stat-value--small { font-size: 0.71rem; }
  .stat-label { font-size: 0.6rem; }
  .ring { width: 38px; height: 38px; }
  .ring::before { inset: 4px; }
  .ring span { font-size: 0.53rem; }
  .footer { justify-content: center; padding: 20px 14px 18px; font-size: 0.62rem; gap: 6px; }
  .footer__version { display: none; }
  dialog.modal { position: fixed; inset: auto 0 0; width: 100%; max-width: 100%; max-height: 93vh; margin: 0; border-radius: 24px 24px 0 0; }
  .modal[open] .modal__panel { animation: sheetIn 0.32s cubic-bezier(0.2,0.85,0.25,1) both; }
  .modal__panel { max-height: 93vh; border-radius: 24px 24px 0 0; }
  .modal__head { padding: 18px 18px 13px; }
  .modal__body { padding: 0 18px 22px; }
  .modal__footer { padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); }
  .field-grid { grid-template-columns: 1fr; }
  .progress-overview { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .achievement-grid { grid-template-columns: 1fr; }
  .toasts { right: 12px; bottom: 12px; width: calc(100vw - 24px); }
  .reminder-banner { top: 66px; flex-wrap: wrap; gap: 9px; }
  .reminder-banner__body { flex-basis: calc(100% - 50px); }
  .reminder-banner .btn { margin-left: 45px; }
  .reminder-banner .icon-button--small { order: 2; margin-left: auto; }
  .bank-row__text small { white-space: normal; }
  .btn { font-size: 0.79rem; }
  .modal__footer .btn { flex: 1; }
}
@media (max-width: 420px) {
  .brand-name { font-size: 0.88rem; letter-spacing: 0.12em; }
  .next-pill { padding: 0 8px; }
  .next-pill .icon { display: inline-flex; }
  .streak-pill { padding: 0 8px; }
  .top-actions { gap: 4px; }
  .icon-button { width: 34px; height: 34px; }
  .pet-sprite { font-size: 15px; }
  .pet-stage { min-height: 158px; }
  .question-card { padding: 15px; }
  .statement { font-size: 1.12rem; }
  .option__text { font-size: 0.82rem; }
  .stats-strip { grid-template-columns: 1fr 1fr; }
  .stat-card { padding: 9px 10px; gap: 8px; }
  .ring { width: 34px; height: 34px; }
  .ring span { font-size: 0.49rem; }
  .stat-value { font-size: 0.88rem; }
  .stat-value--small { font-size: 0.66rem; }
  .overview-stat { padding: 10px 7px; }
  .overview-stat strong { font-size: 0.97rem; }
  .day span { width: 34px; height: 34px; }
}
/* Dark theme */
html[data-theme="dark"] { --bg: #0b1220; --bg-deep: #0f172a; --surface: #111827; --surface-soft: #1f2937; --ink: #e5e7eb; --ink-soft: #cbd5e1; --muted: #94a3b8; --muted-soft: #64748b; --line: #334155; --line-strong: #475569; }
html[data-theme="dark"] body::before { opacity: 0.25; }
html[data-theme="dark"] .topbar { background: rgba(15,23,42,0.84); border-bottom-color: rgba(51,65,85,0.65); }
html[data-theme="dark"] .pet-card { background: linear-gradient(180deg,#111827 0%,#0f172a 56%,#0b1220 100%); border-color: rgba(51,65,85,0.6); }
html[data-theme="dark"] .question-card, html[data-theme="dark"] .modal__panel, html[data-theme="dark"] .stat-card, html[data-theme="dark"] .overview-stat, html[data-theme="dark"] .achievement { background: var(--surface); border-color: var(--line); }
html[data-theme="dark"] .option { background: #1e293b; border-color: #334155; }
html[data-theme="dark"] .option:hover:not(.is-locked) { background: #273449; }
html[data-theme="dark"] .tag { background: #1f2937; color: var(--muted); }
html[data-theme="dark"] .clinical { background: linear-gradient(180deg,#1e2937,#1a2332); border-color: #334155; }
html[data-theme="dark"] .meter__track { background: #1f2937; }
html[data-theme="dark"] .modal { background: rgba(0,0,0,0.6); }
html[data-theme="dark"] .toast { background: #1e293b; border-color: #334155; color: var(--ink); }
.option.is-selected {
  border-color: var(--teal-600);
  background: #e8f3f5;
  box-shadow: 0 0 0 3px rgba(20,114,138,0.12);
}

.option.is-selected .option__letter {
  background: var(--teal-600);
  color: #fff;
  border-color: var(--teal-600);
}

.option.is-selected .option__badge {
  background: var(--turquoise-soft);
  color: var(--teal-700);
}
.candidate-questions {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.candidate-summary {
  cursor: pointer;
  padding: 10px 12px;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--ink-soft);
  list-style: none;
}

.candidate-summary::-webkit-details-marker {
  display: none;
}

.candidate-questions[open] .candidate-summary {
  border-bottom: 1px solid var(--line);
}
