:root {
  color-scheme: light dark;
  --bg: #f6f5f1;
  --surface: rgba(255,255,253,.78);
  --surface-solid: #fffefa;
  --surface-soft: #eeede7;
  --ink: #20251f;
  --ink-2: #52584f;
  --muted: #898d84;
  --line: rgba(42,48,39,.095);
  --green: #315b4c;
  --green-2: #477260;
  --green-wash: #e7eee8;
  --gold: #c19a51;
  --red: #b64d49;
  --shadow: 0 18px 52px rgba(47,51,43,.075), 0 2px 10px rgba(47,51,43,.03);
  --shadow-small: 0 6px 22px rgba(47,51,43,.055);
  --radius-xl: 25px;
  --radius-lg: 18px;
  --radius-md: 13px;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--bg);
  color: var(--ink);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111714;
    --surface: rgba(32,39,34,.8);
    --surface-solid: #1c241f;
    --surface-soft: #252d27;
    --ink: #f0f1eb;
    --ink-2: #c1c7bd;
    --muted: #8b958b;
    --line: rgba(233,239,228,.105);
    --green: #93b5a2;
    --green-2: #aac9b6;
    --green-wash: #26372e;
    --gold: #d2ae68;
    --red: #e1857d;
    --shadow: 0 20px 55px rgba(0,0,0,.22), 0 2px 12px rgba(0,0,0,.12);
    --shadow-small: 0 8px 24px rgba(0,0,0,.18);
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; min-width: 320px; min-height: 100vh; min-height: 100dvh; background: var(--bg); color: var(--ink); }
button, select, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, select:focus-visible, input:focus-visible { outline: 3px solid color-mix(in srgb,var(--gold) 65%,transparent); outline-offset: 2px; }
.app-shell { min-height: 100vh; min-height: 100dvh; padding: 0 max(20px,env(safe-area-inset-left)) 28px max(20px,env(safe-area-inset-right)); }
.topbar { height: 82px; max-width: 1500px; margin: 0 auto; padding: 0 9px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; gap: 11px; align-items: center; color: inherit; text-decoration: none; }
.brand-icon { width: 42px; height: 42px; display: inline-flex; }
.brand-icon svg { width: 100%; height: 100%; }
.brand-icon rect { fill: var(--green); }
.brand-icon path { fill: none; stroke: var(--bg); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.brand-copy { display: flex; flex-direction: column; gap: 2px; }
.brand-copy strong { font: 700 16px/1.1 -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif; letter-spacing: -.045em; }
.brand-copy small { color: var(--muted); text-transform: uppercase; letter-spacing: .15em; font-size: 8px; font-weight: 700; }
.topbar-right { display: flex; align-items: center; gap: 13px; }
.save-status { display: inline-flex; gap: 7px; align-items: center; color: var(--muted); font-size: 10px; }
.save-status i { width: 7px; height: 7px; background: #8da68e; border-radius: 50%; box-shadow: 0 0 0 3px color-mix(in srgb,#8da68e 15%,transparent); }
.save-status.pending i { background: var(--gold); }
.save-status.error i { background: var(--red); }
.icon-button { width: 39px; height: 39px; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--ink-2); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); transition: transform .2s, background .2s; }
.icon-button:hover { transform: translateY(-2px); background: var(--surface-solid); }
.icon-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.main-layout { max-width: 1500px; min-height: calc(100vh - 111px); margin: 0 auto; display: grid; grid-template-columns: 185px minmax(0,1fr); gap: clamp(30px,5vw,82px); }
.side-rail { position: sticky; top: 24px; height: calc(100vh - 110px); min-height: 500px; padding: 31px 0 24px 9px; display: flex; flex-direction: column; }
.rail-label { margin: 0 0 13px 13px; color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .16em; }
.nav-item { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; margin: 3px 0; padding: 12px 14px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); text-align: left; font-size: 12px; font-weight: 600; transition: color .2s,background .2s; }
.nav-item:hover { color: var(--ink); background: var(--surface-soft); }
.nav-item.active { color: var(--green); background: var(--green-wash); }
.nav-icon { width: 17px; text-align: center; font-size: 17px; line-height: 1; }
.rail-bottom { margin-top: auto; display: flex; align-items: center; gap: 11px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.rail-mark { display: grid; place-items: center; width: 35px; height: 35px; color: var(--gold); border: 1px solid var(--line); border-radius: 50%; font: 500 15px Georgia,serif; }
.content-area { max-width: 1145px; min-width: 0; padding: 50px 0 50px; }
.view { display: none; animation: show-view .32s ease both; }
.view.active { display: block; }
@keyframes show-view { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.page-heading { min-height: 115px; display: flex; align-items: end; justify-content: space-between; gap: 18px; margin: 0 0 29px; }
.overline { margin: 0 0 9px; color: var(--gold); text-transform: uppercase; letter-spacing: .16em; font-size: 9px; font-weight: 700; }
h1 { margin: 0; font: 600 clamp(31px,3.5vw,48px)/1.11 'Manrope',sans-serif; letter-spacing: -.055em; }
.subheading { margin: 10px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.deck-badge { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: 0 3px 14px rgba(30,40,30,.025); }
.badge-symbol { color: var(--green); font: 400 29px Georgia,serif; }
.deck-badge span:last-child { display: flex; flex-direction: column; gap: 3px; }
.deck-badge strong { color: var(--ink-2); font-size: 9px; letter-spacing: .1em; }
.deck-badge small { color: var(--muted); font-size: 9px; }
.glass-panel { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-small); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.practice-panel { padding: 13px 14px; }
.controls-row { display: flex; align-items: end; gap: 9px; }
.select-field, .custom-range label { display: flex; flex-direction: column; gap: 6px; flex: 1 1 0; min-width: 120px; }
.select-field > span, .custom-range label > span { color: var(--muted); font-size: 8px; text-transform: uppercase; font-weight: 700; letter-spacing: .12em; padding-left: 2px; }
.select-field select, .custom-range input { width: 100%; height: 39px; appearance: none; border: 1px solid var(--line); border-radius: 10px; padding: 0 28px 0 11px; color: var(--ink-2); background: var(--surface-solid); font-size: 10px; font-weight: 550; }
.select-field { position: relative; }
.select-field::after { content: '⌄'; position: absolute; right: 12px; bottom: 8px; color: var(--muted); font-size: 14px; pointer-events: none; }
.custom-range { display: flex; align-items: end; gap: 7px; flex: 0 0 auto; }
.custom-range[hidden] { display: none; }
.custom-range label { min-width: 56px; width: 67px; }
.custom-range input { padding: 0 9px; }
.range-dash { padding-bottom: 10px; color: var(--muted); }
.button { min-height: 42px; border-radius: 11px; padding: 0 15px; border: 1px solid transparent; display: inline-flex; align-items: center; justify-content: center; gap: 9px; font-size: 10px; font-weight: 700; transition: transform .18s,box-shadow .18s,background .18s; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--green); color: #fbfcf8; box-shadow: 0 4px 13px color-mix(in srgb,var(--green) 22%,transparent); }
.button-primary:hover { background: var(--green-2); }
.start-button { flex: 0 0 auto; min-width: 104px; }
.practice-stage { max-width: 660px; margin: 27px auto 0; min-height: 514px; display: flex; align-items: center; flex-direction: column; }
.session-line { width: min(100%,430px); display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 10px; padding: 0 2px; }
.session-line > div { display: flex; align-items: center; gap: 7px; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green-2); }
.session-track { width: min(100%,430px); height: 3px; margin: 10px 0 19px; border-radius: 5px; overflow: hidden; background: var(--surface-soft); }
.session-track > div { width: 0; height: 100%; border-radius: inherit; background: var(--gold); transition: width .3s ease; }
.flashcard { width: min(100%,330px); height: 355px; padding: 0; border: 0; border-radius: var(--radius-xl); background: transparent; color: inherit; perspective: 1100px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.card-inner { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .68s cubic-bezier(.18,.76,.25,1); }
.flashcard.flipped .card-inner { transform: rotateY(180deg); }
.card-face { position: absolute; inset: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; flex-direction: column; border-radius: var(--radius-xl); border: 1px solid rgba(255,255,255,.38); backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.card-front { background: radial-gradient(ellipse at 50% 12%,color-mix(in srgb,var(--green-wash) 90%,transparent),transparent 64%),var(--surface-solid); box-shadow: var(--shadow); }
.card-front::before, .card-back::before { content: ''; position: absolute; inset: 12px; border: 1px solid var(--line); border-radius: 17px; pointer-events: none; }
.card-back { transform: rotateY(180deg); background: radial-gradient(ellipse at 50% 15%,color-mix(in srgb,var(--gold) 13%,transparent),transparent 67%),var(--surface-solid); box-shadow: var(--shadow); }
.corner-mark { position: absolute; top: 30px; left: 31px; color: var(--muted); font: 500 10px 'Manrope',sans-serif; letter-spacing: .15em; }
.face-label { color: var(--muted); text-transform: uppercase; letter-spacing: .17em; font-size: 8px; font-weight: 700; }
.prompt-number { margin-top: 21px; color: var(--green); font: 500 124px/.9 -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif; letter-spacing: -.075em; }
.prompt-card { margin-top: 19px; }
.face-footnote { position: absolute; bottom: 31px; color: var(--muted); font-size: 9px; }
.playing-card { display: inline-flex; align-items: center; justify-content: center; width: 99px; height: 140px; border: 1px solid rgba(30,38,32,.09); border-radius: 11px; background: #fffefa; box-shadow: 0 9px 21px rgba(33,39,32,.1); color: #252a26; font: 500 50px 'Manrope',sans-serif; }
.playing-card .suit { font-size: .76em; padding-left: 2px; }
.playing-card.red { color: #be514e; }
.playing-card.black { color: #222925; }
.prompt-card .playing-card { width: 123px; height: 172px; font-size: 61px; border-radius: 13px; }
.response-number { margin-top: 17px; color: var(--green); font: 500 106px/.95 -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif; letter-spacing: -.07em; }
.response-card { margin-top: 15px; }
.answer-caption { color: var(--muted); font-size: 10px; margin-top: 14px; }
.rating-actions { display: flex; gap: 10px; margin: 20px 0 0; animation: show-view .25s ease both; }
.rating-actions[hidden] { display: none; }
.rating-actions .button { height: 45px; min-width: 130px; border-radius: 13px; }
.button-correct { color: #315b46; background: #e7eee8; border-color: color-mix(in srgb,#315b46 10%,transparent); }
.button-correct:hover { background: #dce9df; }
.button-unknown { color: #865348; background: #f1e9e3; border-color: color-mix(in srgb,#865348 10%,transparent); }
.button-unknown:hover { background: #ecded4; }
@media(prefers-color-scheme:dark) { .button-correct{color:#b8d6c1;background:#27392d}.button-correct:hover{background:#304639}.button-unknown{color:#e5b5a8;background:#3b2d2b}.button-unknown:hover{background:#493531} }
.rating-icon { font-size: 15px; line-height: 1; }
.flip-hint { min-height: 17px; margin-top: 14px; color: var(--muted); font-size: 9px; }
.flip-hint span { padding: 0 4px; color: #bec0b8; }
kbd { border: 1px solid var(--line); border-radius: 4px; padding: 2px 4px; color: var(--muted); font-size: 8px; font-family: inherit; }
.session-message { min-height: 18px; margin-top: 7px; color: var(--muted); font-size: 10px; text-align: center; }
.privacy-footnote { margin: 18px 0 0; text-align: center; color: var(--muted); font-size: 9px; line-height:1.5; }
.privacy-icon { color: var(--green); font-size: 13px; padding-right: 4px; }
.heading-count { color: var(--green); font: 500 26px 'Manrope',sans-serif; white-space: nowrap; }
.heading-count small { color: var(--muted); font: 400 10px 'DM Sans',sans-serif; }
.review-toolbar { margin: 4px 0 12px; padding: 0 5px; display: flex; justify-content: space-between; color: var(--muted); font-size: 8px; letter-spacing: .13em; font-weight: 700; }
.review-grid { display: grid; grid-template-columns: repeat(8,minmax(0,1fr)); gap: 9px; }
.review-tile { position: relative; min-height: 100px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); box-shadow: 0 3px 14px rgba(28,36,29,.025); display: flex; align-items: center; justify-content: center; transition: transform .18s,border-color .18s,box-shadow .18s; }
.review-tile:hover { transform: translateY(-3px); border-color: color-mix(in srgb,var(--gold) 50%,var(--line)); box-shadow: var(--shadow-small); }
.tile-position { position: absolute; top: 9px; left: 10px; color: var(--muted); font: 600 8px 'Manrope',sans-serif; }
.review-tile .playing-card { width: auto; height: auto; border: 0; border-radius: 0; background: transparent; box-shadow: none; font-size: 26px; }
.review-tile .playing-card .suit { font-size: .78em; }
.review-selection { position: sticky; bottom: 75px; width: fit-content; margin: 14px auto 0; padding: 0; font-size: 11px; color: var(--green); }
.review-selection:not(:empty) { padding: 10px 15px; background: var(--surface); border: 1px solid var(--line); border-radius: 99px; box-shadow: var(--shadow-small); }
.review-selection strong { font: 600 13px 'Manrope',sans-serif; padding-right: 6px; }
.streak-badge { display: flex; align-items: center; gap: 10px; padding: 10px 13px; border: 1px solid var(--line); background: var(--surface); border-radius: 14px; }
.streak-badge > span { display: grid; place-items: center; width: 32px; height: 32px; color: var(--gold); border-radius: 50%; background: color-mix(in srgb,var(--gold) 13%,transparent); font-size: 17px; }
.streak-badge small { color: var(--muted); font-size: 8px; line-height: 1.5; }
.streak-badge strong { color: var(--ink-2); font-size: 10px; }
.stat-cards { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-bottom: 20px; }
.metric-card { min-height: 122px; padding: 16px 17px; display: flex; flex-direction: column; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); box-shadow: 0 3px 15px rgba(35,41,34,.025); }
.metric-label { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .12em; font-weight: 700; }
.metric-value { margin-top: 12px; color: var(--green); font: 500 31px/1 -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif; letter-spacing: -.05em; }
.metric-value span { padding-left: 3px; color: var(--muted); font: 400 11px 'DM Sans',sans-serif; letter-spacing: 0; }
.metric-note { margin-top: 8px; color: var(--muted); font-size: 8px; }
.stats-layout { display: grid; grid-template-columns: minmax(270px,.77fr) minmax(0,1.5fr); gap: 14px; align-items: start; }
.hardest-panel,.all-stats-panel { padding: 18px; min-width: 0; }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-title .overline { margin-bottom: 6px; font-size: 7px; }
.panel-title h2,.backup-copy h2 { margin: 0; font: 600 16px/1.25 -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif; letter-spacing: -.04em; }
.text-button { border: 0; padding: 7px 0 7px 7px; background: none; color: var(--green); font-size: 9px; font-weight: 700; white-space: nowrap; }
.text-button span { padding-left: 3px; font-size: 12px; }
.hard-list { display: flex; flex-direction: column; gap: 11px; min-height: 93px; }
.hard-row { display: grid; grid-template-columns: 20px 37px minmax(0,1fr) 27px; align-items: center; gap: 9px; }
.hard-rank { color: var(--muted); font: 500 9px 'Manrope',sans-serif; }
.hard-row .playing-card { width: auto; height: auto; border: 0; border-radius: 0; box-shadow: none; background: transparent; font-size: 20px; }
.hard-row .playing-card .suit { font-size: .8em; }
.difficulty-track { width: 100%; height: 4px; border-radius: 99px; overflow: hidden; background: var(--surface-soft); }
.difficulty-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#789b7d,var(--gold)); }
.difficulty-value { text-align: right; color: var(--ink-2); font-size: 9px; font-variant-numeric: tabular-nums; }
.empty-state { padding: 15px; border-radius: 11px; background: var(--surface-soft); color: var(--muted); font-size: 10px; line-height: 1.6; }
.formula-note { margin: 16px 0 0; color: var(--muted); font-size: 8px; line-height: 1.6; }
.scale-label { color: var(--muted); font-size: 7px; font-weight: 700; letter-spacing: .12em; white-space: nowrap; }
.table-scroll { overflow-x: auto; max-height: 400px; border: 1px solid var(--line); border-radius: 11px; scrollbar-width: thin; }
table { width: 100%; min-width: 465px; border-collapse: collapse; text-align: left; font-size: 9px; }
th { position: sticky; top: 0; z-index: 1; padding: 10px 9px; background: var(--surface-soft); color: var(--muted); font-size: 7px; letter-spacing: .08em; text-transform: uppercase; }
td { padding: 8px 9px; border-top: 1px solid var(--line); color: var(--ink-2); font-variant-numeric: tabular-nums; }
td:first-child { color: var(--muted); }
td:nth-child(2) { font-size: 10px; font-weight: 650; }
.difficulty-cell { display: flex; align-items: center; gap: 7px; min-width: 90px; }
.difficulty-cell .mini-bar { width: 44px; height: 4px; overflow: hidden; border-radius: 99px; background: var(--surface-soft); }
.difficulty-cell .mini-bar span { display: block; height: 100%; border-radius: inherit; background: var(--gold); }
.backup-panel { margin-top: 15px; padding: 16px 18px; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.backup-copy { display: flex; align-items: center; gap: 12px; }
.backup-icon { width: 37px; height: 37px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 12px; background: var(--green-wash); color: var(--green); font-size: 18px; }
.backup-copy h2 { font-size: 12px; }
.backup-copy p { margin: 5px 0 3px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.backup-copy small { color: var(--green); font-size: 8px; }
.backup-actions { display: flex; gap: 7px; flex: 0 0 auto; }
.button-secondary { background: var(--surface-solid); color: var(--ink-2); border-color: var(--line); }
.button-secondary:hover { background: var(--surface-soft); }
.backup-actions .button { min-height: 36px; border-radius: 9px; padding: 0 11px; font-size: 8px; }
.reset-button { display: block; margin: 18px 0 0 auto; padding: 5px 0; border: 0; background: none; color: var(--muted); text-decoration: underline; text-decoration-color: color-mix(in srgb,var(--muted) 35%,transparent); text-underline-offset: 3px; font-size: 8px; }
.reset-button:hover { color: var(--red); }
.mobile-tabbar { display: none; }

@media(max-width:1150px) {
  .app-shell { padding-left: max(15px,env(safe-area-inset-left)); padding-right: max(15px,env(safe-area-inset-right)); }
  .main-layout { grid-template-columns: 150px minmax(0,1fr); gap: 32px; }
  .content-area { padding-top: 40px; }
  .review-grid { grid-template-columns: repeat(7,minmax(0,1fr)); gap: 7px; }
  .review-tile { min-height: 87px; }
  .controls-row { gap: 7px; }
  .select-field,.custom-range label { min-width: 105px; }
}
@media(max-width:850px) {
  .main-layout { grid-template-columns: 1fr; display: block; }
  .side-rail { display: none; }
  .content-area { max-width: 720px; margin: 0 auto; padding: 37px 0 55px; }
  .topbar { height: 69px; }
  .review-grid { grid-template-columns: repeat(6,minmax(0,1fr)); }
  .stats-layout { grid-template-columns: 1fr; }
  .stat-cards { gap: 9px; }
  .metric-card { min-height: 108px; }
}
@media(max-width:600px) {
  .app-shell { padding: 0 14px calc(62px + max(9px,env(safe-area-inset-bottom))); }
  .main-layout { min-height:0; }
  .topbar { height: 60px; padding: 0 2px; }
  .brand { gap: 8px; }
  .brand-icon { width: 35px; height: 35px; }
  .brand-copy strong { font-size: 14px; }
  .brand-copy small { font-size: 7px; }
  .save-status { gap: 6px; font-size: 8px; }
  .save-status i { width: 6px; height: 6px; }
  .topbar-right { gap: 9px; }
  .icon-button { width: 34px; height: 34px; }
  .content-area { padding: 28px 0 25px; }
  .page-heading { min-height: auto; align-items: center; margin-bottom: 20px; }
  .train-heading { align-items: start; flex-direction: column; gap: 13px; }
  .overline { margin-bottom: 7px; font-size: 8px; }
  h1 { font-size: clamp(29px,8vw,38px); }
  .subheading { margin-top: 7px; max-width: 400px; font-size: 11px; }
  .deck-badge { padding: 8px 11px; border-radius: 12px; }
  .badge-symbol { font-size: 22px; }
  .deck-badge strong { font-size: 8px; }
  .deck-badge small { font-size: 8px; }
  .practice-panel { padding: 11px; border-radius: 16px; }
  .controls-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .select-field { min-width: 0; }
  .select-field > span,.custom-range label > span { font-size: 7px; }
  .select-field select { height: 42px; padding-left: 10px; padding-right: 25px; font-size: 11px; border-radius: 11px; }
  .select-field::after { right: 9px; bottom: 8px; }
  .range-field { grid-column: auto; }
  .custom-range { grid-column: 1 / -1; justify-content: start; }
  .custom-range label { flex: 0 0 73px; width: 73px; }
  .custom-range input { height: 34px; }
  .start-button { grid-column: 1 / -1; min-height: 39px; }
  .practice-stage { min-height: 489px; margin-top: 23px; }
  .session-line,.session-track { width: min(100%,370px); }
  .session-line { font-size: 9px; }
  .flashcard { width: min(78vw,305px); height: 325px; }
  .card-face { border-radius: 22px; }
  .card-front::before,.card-back::before { inset: 10px; border-radius: 15px; }
  .prompt-number { font-size: 112px; }
  .prompt-card .playing-card { width: 112px; height: 160px; font-size: 55px; }
  .response-number { font-size: 96px; }
  .rating-actions { width: min(100%,305px); gap: 8px; }
  .rating-actions .button { flex: 1; min-width: 0; height: 44px; }
  .flip-hint { font-size: 8px; margin-top: 12px; }
  .privacy-footnote { margin-top: -14px; font-size: 8px; }
  .mobile-tabbar { position: fixed; z-index: 5; left: 50%; bottom: max(9px,env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(410px,calc(100% - 24px)); height: 62px; padding: 5px 7px; display: grid; grid-template-columns: repeat(3,1fr); border: 1px solid color-mix(in srgb,var(--line) 85%,transparent); border-radius: 21px; background: color-mix(in srgb,var(--surface-solid) 78%,transparent); box-shadow: 0 10px 35px rgba(30,37,30,.14); backdrop-filter: blur(26px) saturate(1.5); -webkit-backdrop-filter: blur(26px) saturate(1.5); }
  .mobile-tab { border: 0; border-radius: 15px; background: none; color: var(--muted); display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 3px; }
  .mobile-tab > span { font-size: 16px; line-height: 1; }
  .mobile-tab small { font-size: 8px; font-weight: 600; }
  .mobile-tab.active { color: var(--green); background: var(--green-wash); }
  .mobile-tab.active small { font-weight: 700; }
  .review-grid { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 7px; }
  .review-tile { min-height: 78px; border-radius: 13px; }
  .review-tile .playing-card { font-size: 23px; }
  .tile-position { top: 7px; left: 8px; font-size: 7px; }
  .review-selection { bottom: 78px; }
  .heading-count { font-size: 20px; }
  .heading-count small { font-size: 8px; }
  .streak-badge { padding: 7px 9px; gap: 7px; }
  .streak-badge > span { width: 27px; height: 27px; font-size: 14px; }
  .streak-badge small { font-size: 7px; }
  .streak-badge strong { font-size: 9px; }
  .stat-cards { grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 11px; }
  .metric-card { min-height: 94px; padding: 12px; border-radius: 14px; }
  .metric-label { font-size: 7px; }
  .metric-value { margin-top: 9px; font-size: 27px; }
  .metric-note { margin-top: 6px; font-size: 7px; }
  .stats-layout { gap: 10px; }
  .hardest-panel,.all-stats-panel { padding: 14px; border-radius: 16px; }
  .panel-title { margin-bottom: 13px; }
  .panel-title h2 { font-size: 15px; }
  .panel-title .overline { font-size: 6px; }
  .text-button { font-size: 8px; }
  .backup-panel { align-items: start; flex-direction: column; gap: 12px; padding: 14px; }
  .backup-copy { align-items: start; }
  .backup-icon { width: 32px; height: 32px; }
  .backup-copy h2 { font-size: 11px; }
  .backup-copy p { font-size: 8px; }
  .backup-actions { width: 100%; }
  .backup-actions .button { flex: 1; }
}
@media(max-width:370px) {
  .app-shell { padding-left: 10px; padding-right: 10px; }
  .save-status span { max-width: 92px; line-height: 1.2; }
  .flashcard { width: min(84vw,290px); height: 309px; }
}
@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after { scroll-behavior: auto!important; animation-duration: .01ms!important; animation-iteration-count: 1!important; transition-duration: .01ms!important; }
}

/* Liquid glass visual pass */
:root {
  --bg: #f2f3fa;
  --surface: rgba(255,255,255,.48);
  --surface-solid: rgba(255,255,255,.82);
  --surface-soft: rgba(232,235,249,.75);
  --ink: #191a2a;
  --ink-2: #505267;
  --muted: #888a9d;
  --line: rgba(255,255,255,.78);
  --green: #5b5be9;
  --green-2: #8670f6;
  --green-wash: rgba(100,96,240,.12);
  --gold: #bddc55;
  --red: #f27672;
  --shadow: 0 24px 70px rgba(61,57,130,.12), 0 5px 18px rgba(60,63,99,.06);
  --shadow-small: 0 10px 32px rgba(61,57,130,.08), inset 0 1px 0 rgba(255,255,255,.72);
}
@media (prefers-color-scheme:dark) {
  :root {
    --bg: #11111d;
    --surface: rgba(34,34,56,.58);
    --surface-solid: rgba(29,29,47,.9);
    --surface-soft: rgba(45,43,72,.72);
    --ink: #f7f6ff;
    --ink-2: #d0cfe2;
    --muted: #9998ae;
    --line: rgba(255,255,255,.13);
    --green: #a7a1ff;
    --green-2: #bba3ff;
    --green-wash: rgba(151,133,255,.16);
    --gold: #d8f16d;
    --red: #ff8983;
    --shadow: 0 25px 80px rgba(0,0,0,.38), 0 4px 18px rgba(0,0,0,.2);
    --shadow-small: 0 11px 34px rgba(0,0,0,.2), inset 0 1px 0 rgba(255,255,255,.1);
  }
}
body {
  background:
    radial-gradient(ellipse at 12% 4%,rgba(255,255,255,.9),transparent 36%),
    radial-gradient(ellipse at 88% 7%,rgba(219,213,255,.63),transparent 35%),
    linear-gradient(145deg,#f7f8fd 1%,var(--bg) 45%,#edf3fb 100%);
}
body::before,body::after { content:"";position:fixed;z-index:-1;pointer-events:none;border-radius:50%;filter:blur(72px);opacity:.45; }
body::before { width:310px;height:310px;top:18vh;left:-150px;background:rgba(112,210,221,.36); }
body::after { width:360px;height:360px;right:-180px;bottom:8vh;background:rgba(165,143,255,.31); }
.app-shell { position:relative;isolation:isolate;padding-top:env(safe-area-inset-top); }
.topbar { position:sticky;top:env(safe-area-inset-top);z-index:4;border-bottom-color:rgba(255,255,255,.52);background:rgba(246,247,252,.48);backdrop-filter:blur(28px) saturate(1.5);-webkit-backdrop-filter:blur(28px) saturate(1.5); }
.brand-icon rect { fill:#5b5be9; }
.brand-icon path { stroke:#fff; }
.brand-icon svg { filter:drop-shadow(0 5px 10px rgba(91,91,233,.22)); }
.brand-copy strong { letter-spacing:-.055em; }
.save-status i { background:#4fcca6;box-shadow:0 0 0 4px rgba(79,204,166,.15); }
.save-status.pending i { background:#e3bd4e;box-shadow:0 0 0 4px rgba(227,189,78,.16); }
.save-status.error i { background:#f27672;box-shadow:0 0 0 4px rgba(242,118,114,.15); }
.icon-button { border-color:rgba(255,255,255,.85);background:rgba(255,255,255,.44);box-shadow:inset 0 1px 0 rgba(255,255,255,.9),0 4px 15px rgba(73,71,129,.06); }
.nav-item.active { color:#5654d9;background:rgba(255,255,255,.58);box-shadow:inset 0 1px 0 white,0 4px 16px rgba(73,71,129,.06); }
.nav-item.active .nav-icon { color:#7467f4; }
.glass-panel { border-color:rgba(255,255,255,.8);background:rgba(255,255,255,.48);box-shadow:var(--shadow-small); }
.practice-panel { padding:11px 12px;background:rgba(255,255,255,.46); }
.select-field select,.custom-range input { border-color:rgba(255,255,255,.9);background:rgba(255,255,255,.72);box-shadow:inset 0 1px 2px rgba(71,76,112,.025),0 3px 10px rgba(62,65,119,.025); }
.select-field select:hover,.custom-range input:hover { border-color:rgba(117,106,242,.28); }
.button-primary { background:linear-gradient(115deg,#625fe9,#8a69f3);box-shadow:0 7px 20px rgba(99,91,230,.27),inset 0 1px 0 rgba(255,255,255,.23); }
.button-primary:hover { background:linear-gradient(115deg,#524fdb,#7959e5);box-shadow:0 9px 24px rgba(99,91,230,.34); }
.practice-stage { position:relative; }
.practice-stage::before { content:"";position:absolute;top:87px;left:50%;width:275px;height:275px;transform:translateX(-50%);border-radius:50%;background:radial-gradient(circle,rgba(127,112,249,.18),rgba(140,125,252,.06) 46%,transparent 72%);filter:blur(13px);pointer-events:none; }
.session-line,.session-track,.flashcard,.rating-actions,.flip-hint,.session-message { position:relative;z-index:1; }
.live-dot { background:#42cda5;box-shadow:0 0 0 4px rgba(66,205,165,.13); }
.session-track { background:rgba(111,108,157,.12); }
.session-track>div { background:linear-gradient(90deg,#9bdc70,#d7e967,#ffc778);box-shadow:0 0 12px rgba(194,220,89,.5); }
.flashcard { filter:drop-shadow(0 24px 28px rgba(68,64,138,.13)); }
.card-face { border-color:rgba(255,255,255,.96); }
.card-front {
  background:
    radial-gradient(ellipse at 8% 2%,rgba(255,255,255,.98),transparent 47%),
    radial-gradient(ellipse at 92% 100%,rgba(198,214,255,.39),transparent 49%),
    linear-gradient(150deg,rgba(255,255,255,.97),rgba(244,246,255,.91));
  box-shadow:inset 0 1px 0 #fff,inset 0 -1px 0 rgba(141,142,192,.12),0 18px 48px rgba(60,62,121,.12);
}
.card-front::before,.card-back::before { border-color:rgba(118,116,179,.1); }
.card-front::after { content:"";position:absolute;top:-35%;left:16%;width:68%;height:72%;border-radius:50%;transform:rotate(-24deg);background:linear-gradient(165deg,rgba(255,255,255,.73),rgba(255,255,255,0) 58%);filter:blur(10px);pointer-events:none; }
.corner-mark { color:#9899ad; }
.face-label { color:#85879b; }
.prompt-number,.response-number { color:#5c5ae5;text-shadow:0 5px 18px rgba(98,91,235,.1); }
.playing-card { border-color:rgba(38,41,69,.07);box-shadow:0 13px 30px rgba(36,40,82,.12),inset 0 1px 0 #fff; }
.card-back {
  border-color:rgba(255,255,255,.56);
  background:
    radial-gradient(ellipse at 18% 0%,rgba(255,255,255,.29),transparent 45%),
    radial-gradient(ellipse at 100% 100%,rgba(194,143,255,.38),transparent 44%),
    linear-gradient(145deg,#6b63ea 0%,#7970ed 48%,#6b75dc 100%);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.42),inset 0 -1px 0 rgba(24,27,104,.12),0 20px 48px rgba(75,67,191,.28);
}
.card-back::before { border-color:rgba(255,255,255,.22); }
.card-back .corner-mark,.card-back .face-label,.card-back .answer-caption { color:rgba(255,255,255,.78); }
.response-number { color:white;text-shadow:0 5px 18px rgba(25,27,104,.2); }
.rating-actions .button { border:1px solid rgba(255,255,255,.8);box-shadow:0 5px 18px rgba(56,62,91,.08),inset 0 1px 0 rgba(255,255,255,.68); }
.button-correct { color:#11745f;background:linear-gradient(145deg,rgba(223,255,239,.95),rgba(186,245,218,.83)); }
.button-correct:hover { background:linear-gradient(145deg,#d5ffea,#aceecb); }
.button-unknown { color:#ac514b;background:linear-gradient(145deg,rgba(255,234,227,.96),rgba(255,204,190,.86)); }
.button-unknown:hover { background:linear-gradient(145deg,#ffe4da,#ffc4b2); }
.privacy-footnote { color:#82869b; }
.review-tile { border-color:rgba(255,255,255,.8);background:rgba(255,255,255,.51);box-shadow:inset 0 1px 0 rgba(255,255,255,.9),0 5px 17px rgba(66,65,125,.04);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px); }
.review-tile:hover { border-color:rgba(111,101,234,.36);box-shadow:inset 0 1px 0 white,0 11px 25px rgba(91,84,212,.13); }
.tile-position { color:#9293a8; }
.streak-badge,.deck-badge { border-color:rgba(255,255,255,.82);background:rgba(255,255,255,.48);box-shadow:inset 0 1px 0 rgba(255,255,255,.8),0 5px 15px rgba(65,68,120,.035);backdrop-filter:blur(15px);-webkit-backdrop-filter:blur(15px); }
.streak-badge>span { color:#8d72ea;background:rgba(140,114,234,.13); }
.metric-card { border-color:rgba(255,255,255,.84);background:rgba(255,255,255,.52);box-shadow:inset 0 1px 0 rgba(255,255,255,.88),0 7px 20px rgba(65,68,120,.04);backdrop-filter:blur(17px);-webkit-backdrop-filter:blur(17px); }
.metric-value { color:#5d5be2; }
.hard-row .difficulty-track,.difficulty-cell .mini-bar { background:rgba(111,108,157,.13); }
.hard-row .difficulty-track span { background:linear-gradient(90deg,#53d3b1,#d3e65d,#ff9e74); }
.difficulty-cell .mini-bar span { background:linear-gradient(90deg,#50cdb1,#f2cb62); }
.backup-icon { color:#655fe7;background:rgba(111,101,234,.12); }
.mobile-tabbar { border-color:rgba(255,255,255,.84);background:rgba(250,250,255,.69);box-shadow:0 15px 42px rgba(52,50,109,.16),inset 0 1px 0 rgba(255,255,255,.94); }
.mobile-tab.active { color:#5b58df;background:rgba(119,108,246,.12);box-shadow:inset 0 1px 0 rgba(255,255,255,.75); }
@media(prefers-color-scheme:dark) {
  body { background:radial-gradient(ellipse at 15% 3%,rgba(93,72,168,.3),transparent 39%),radial-gradient(ellipse at 88% 18%,rgba(38,103,148,.22),transparent 32%),linear-gradient(145deg,#11111d,#151426 52%,#101b24); }
  body::before { background:rgba(90,89,255,.34);opacity:.29; }
  body::after { background:rgba(17,172,193,.35);opacity:.25; }
  .topbar { border-bottom-color:rgba(255,255,255,.08);background:rgba(17,17,29,.55); }
  .glass-panel,.practice-panel,.metric-card,.streak-badge,.deck-badge { border-color:rgba(255,255,255,.13);background:rgba(31,31,51,.58); }
  .icon-button,.mobile-tabbar { border-color:rgba(255,255,255,.15);background:rgba(30,30,50,.7); }
  .nav-item.active { color:#c2bbff;background:rgba(130,116,245,.18);box-shadow:inset 0 1px 0 rgba(255,255,255,.08); }
  .nav-item.active .nav-icon,.backup-icon { color:#b8aaff; }
  .select-field select,.custom-range input { border-color:rgba(255,255,255,.13);background:rgba(20,20,34,.65); }
  .card-front { background:radial-gradient(ellipse at 7% 2%,rgba(255,255,255,.12),transparent 47%),radial-gradient(ellipse at 92% 100%,rgba(118,128,255,.12),transparent 49%),linear-gradient(150deg,#28283e,#222338);box-shadow:inset 0 1px 0 rgba(255,255,255,.18),0 18px 48px rgba(0,0,0,.25); }
  .card-front::before,.card-back::before { border-color:rgba(255,255,255,.11); }
  .card-front::after { background:linear-gradient(165deg,rgba(255,255,255,.18),rgba(255,255,255,0) 58%); }
  .corner-mark,.face-label,.privacy-footnote { color:#a4a4bb; }
  .playing-card { background:#fffefa;color:#252a26; }
  .card-back { background:radial-gradient(ellipse at 18% 0%,rgba(255,255,255,.19),transparent 45%),radial-gradient(ellipse at 100% 100%,rgba(160,104,255,.3),transparent 44%),linear-gradient(145deg,#5654cf,#625bdb 48%,#4d66c9); }
  .review-tile { border-color:rgba(255,255,255,.12);background:rgba(35,35,56,.57);box-shadow:inset 0 1px 0 rgba(255,255,255,.08),0 5px 17px rgba(0,0,0,.12); }
  .review-tile:hover { border-color:rgba(169,157,255,.47); }
  .mobile-tab.active { color:#c0b8ff;background:rgba(139,122,255,.18); }
  .button-correct { color:#b9f1d5;background:linear-gradient(145deg,rgba(34,89,71,.92),rgba(30,73,62,.88));border-color:rgba(255,255,255,.12); }
  .button-unknown { color:#ffc0b3;background:linear-gradient(145deg,rgba(101,54,56,.92),rgba(79,43,51,.9));border-color:rgba(255,255,255,.12); }
}

/* Light canvas and focused trainer */
:root { color-scheme:light; }
body.theme-light {
  color-scheme:light;
  --bg:#f4f6fc;
  --surface:rgba(255,255,255,.5);
  --surface-solid:rgba(255,255,255,.86);
  --surface-soft:rgba(232,236,248,.75);
  --ink:#191a2a;
  --ink-2:#505267;
  --muted:#888a9d;
  --line:rgba(255,255,255,.8);
  --green:#5b5be9;
  --green-2:#8670f6;
  --green-wash:rgba(100,96,240,.12);
  --gold:#bddc55;
  --red:#f27672;
  --shadow:0 24px 70px rgba(61,57,130,.12),0 5px 18px rgba(60,63,99,.06);
  --shadow-small:0 10px 32px rgba(61,57,130,.08),inset 0 1px 0 rgba(255,255,255,.72);
  background:radial-gradient(ellipse at 12% 4%,rgba(255,255,255,.9),transparent 36%),radial-gradient(ellipse at 88% 7%,rgba(219,213,255,.63),transparent 35%),linear-gradient(145deg,#f7f8fd 1%,var(--bg) 45%,#edf3fb 100%);
}
body.theme-light::before { background:rgba(112,210,221,.36); }
body.theme-light::after { background:rgba(165,143,255,.31); }
body.theme-light .topbar { border-bottom-color:rgba(255,255,255,.52);background:rgba(246,247,252,.48); }
body.theme-light .glass-panel,body.theme-light .practice-panel,body.theme-light .metric-card,body.theme-light .streak-badge,body.theme-light .deck-badge { border-color:rgba(255,255,255,.8);background:rgba(255,255,255,.48); }
body.theme-light .icon-button,body.theme-light .mobile-tabbar { border-color:rgba(255,255,255,.84);background:rgba(250,250,255,.69); }
body.theme-light .nav-item.active { color:#5654d9;background:rgba(255,255,255,.58);box-shadow:inset 0 1px 0 white,0 4px 16px rgba(73,71,129,.06); }
body.theme-light .nav-item.active .nav-icon,body.theme-light .backup-icon { color:#655fe7; }
body.theme-light .select-field select,body.theme-light .custom-range input { border-color:rgba(255,255,255,.9);background:rgba(255,255,255,.72); }
body.theme-light .card-front { background:radial-gradient(ellipse at 8% 2%,rgba(255,255,255,.98),transparent 47%),radial-gradient(ellipse at 92% 100%,rgba(198,214,255,.39),transparent 49%),linear-gradient(150deg,rgba(255,255,255,.97),rgba(244,246,255,.91));box-shadow:inset 0 1px 0 #fff,inset 0 -1px 0 rgba(141,142,192,.12),0 18px 48px rgba(60,62,121,.12); }
body.theme-light .card-front::before,body.theme-light .card-back::before { border-color:rgba(118,116,179,.1); }
body.theme-light .card-front::after { background:linear-gradient(165deg,rgba(255,255,255,.73),rgba(255,255,255,0) 58%); }
body.theme-light .corner-mark { color:#9899ad; }
body.theme-light .face-label { color:#85879b; }
body.theme-light .playing-card { background:#fffefa; }
body.theme-light .playing-card.red { color:#be514e; }
body.theme-light .playing-card.black { color:#252a26; }
body.theme-light .card-back { background:radial-gradient(ellipse at 18% 0%,rgba(255,255,255,.29),transparent 45%),radial-gradient(ellipse at 100% 100%,rgba(194,143,255,.38),transparent 44%),linear-gradient(145deg,#6b63ea 0%,#7970ed 48%,#6b75dc 100%); }
body.theme-light .review-tile { border-color:rgba(255,255,255,.8);background:rgba(255,255,255,.51);box-shadow:inset 0 1px 0 rgba(255,255,255,.9),0 5px 17px rgba(66,65,125,.04); }
body.theme-light .mobile-tab.active { color:#5b58df;background:rgba(119,108,246,.12); }
body.theme-light .button-correct { color:#11745f;background:linear-gradient(145deg,rgba(223,255,239,.95),rgba(186,245,218,.83));border-color:rgba(255,255,255,.8); }
body.theme-light .button-unknown { color:#ac514b;background:linear-gradient(145deg,rgba(255,234,227,.96),rgba(255,204,190,.86));border-color:rgba(255,255,255,.8); }
.ready-state { min-height:min(51vh,420px);display:flex;align-items:center;justify-content:center;flex-direction:column;text-align:center;padding:24px 18px; }
.ready-state[hidden] { display:none; }
.ready-orbit { position:relative;width:98px;height:98px;margin-bottom:15px;display:grid;place-items:center;border-radius:50%;background:radial-gradient(circle at 35% 30%,rgba(255,255,255,.98),rgba(222,224,255,.75) 54%,rgba(203,219,255,.55));box-shadow:inset 0 1px 0 white,0 12px 38px rgba(101,93,213,.12);color:#7168e9; }
.ready-orbit::before,.ready-orbit::after { content:"";position:absolute;border:1px solid rgba(114,108,225,.18);border-radius:50%;inset:-9px; }
.ready-orbit::after { inset:-18px;border-color:rgba(114,108,225,.09); }
.ready-orbit>span { font-size:33px; }
.ready-orbit i,.ready-orbit b { position:absolute;font-style:normal;font-weight:400;font-size:17px; }
.ready-orbit i { top:6px;right:2px;color:#fb8279; }
.ready-orbit b { bottom:5px;left:5px;color:#91bf4b; }
.ready-state .overline { margin:10px 0 7px; }
.ready-state h2 { max-width:430px;margin:0;font:600 clamp(21px,2.4vw,29px)/1.2 -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;letter-spacing:-.045em; }
.ready-state>p:last-child { max-width:365px;margin:10px 0 0;color:var(--muted);font-size:11px;line-height:1.6; }
.practice-stage[hidden] { display:none!important; }
.focus-header { display:none; }
.button-end { min-height:42px;padding:0 16px;color:#55566c;border:1px solid rgba(255,255,255,.85);background:rgba(255,255,255,.58);box-shadow:inset 0 1px 0 rgba(255,255,255,.9),0 6px 20px rgba(61,57,130,.08);backdrop-filter:blur(22px);-webkit-backdrop-filter:blur(22px); }
.button-end:hover { background:rgba(255,255,255,.83); }
.end-dot { width:8px;height:8px;border:2px solid #f27672;border-radius:3px; }
html.focus-mode,body.focus-mode { width:100%;height:100%;height:100dvh;min-height:0;overflow:hidden;overscroll-behavior:none; }
body.focus-mode .app-shell { width:100%;height:100%;height:100dvh;min-height:0;padding:0;overflow:hidden; }
body.focus-mode .topbar,body.focus-mode .side-rail,body.focus-mode .mobile-tabbar { display:none!important; }
body.focus-mode .main-layout { display:block;width:100%;height:100%;min-height:0;margin:0; }
body.focus-mode .content-area { width:100%;max-width:none;height:100%;min-height:0;margin:0;padding:0;overflow:hidden; }
body.focus-mode .view.active { width:100%;height:100%;min-height:0;overflow:hidden; }
body.focus-mode .page-heading,body.focus-mode .practice-panel,body.focus-mode .ready-state,body.focus-mode .privacy-footnote { display:none!important; }
body.focus-mode .practice-stage { position:relative;width:100%;height:100%;height:100dvh;min-height:0;max-width:none;margin:0;padding:calc(env(safe-area-inset-top) + 85px) max(20px,env(safe-area-inset-right)) calc(env(safe-area-inset-bottom) + 16px) max(20px,env(safe-area-inset-left));display:flex;justify-content:center;align-items:center; }
body.focus-mode .practice-stage::before { top:50%;width:min(74vw,520px);height:min(70vh,520px);transform:translate(-50%,-50%);background:radial-gradient(circle,rgba(126,111,255,.21),rgba(132,123,250,.07) 48%,transparent 71%); }
body.focus-mode .focus-header { position:absolute;z-index:3;top:calc(env(safe-area-inset-top) + 16px);left:max(20px,env(safe-area-inset-left));right:max(20px,env(safe-area-inset-right));width:min(100% - 40px,860px);margin:0 auto;display:flex;align-items:center;justify-content:space-between; }
body.focus-mode .session-clock { display:flex;flex-direction:column;gap:3px; }
body.focus-mode .session-clock>span { color:#9092a6;font-size:8px;font-weight:700;letter-spacing:.14em; }
body.focus-mode .session-clock strong { color:#41425a;font:600 19px/1 -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;font-variant-numeric:tabular-nums;letter-spacing:-.04em; }
body.focus-mode .button-end { min-height:41px;border-radius:99px;font-size:10px; }
body.focus-mode .session-line,body.focus-mode .session-track { display:none; }
body.focus-mode .flashcard { width:min(76vw,390px);height:min(56vh,475px);height:min(56dvh,475px); }
body.focus-mode .card-face { border-radius:30px; }
body.focus-mode .card-front::before,body.focus-mode .card-back::before { inset:13px;border-radius:19px; }
body.focus-mode .rating-actions { margin-top:18px; }
body.focus-mode .rating-actions .button { min-width:155px;min-height:51px;border-radius:16px;font-size:12px; }
body.focus-mode .flip-hint { margin-top:14px;font-size:10px; }
body.focus-mode .session-message { min-height:15px;margin-top:4px;font-size:9px; }
@media(min-width:851px) {
  .select-field>span,.custom-range label>span { font-size:10px; }
  .select-field select,.custom-range input { height:44px;font-size:12px; }
  .button { font-size:12px; }
  .nav-item { font-size:14px; }
  .subheading { font-size:14px; }
  .deck-badge strong { font-size:10px; }
  .deck-badge small { font-size:11px; }
  .review-toolbar { font-size:9px; }
  .tile-position { font-size:9px; }
  .review-tile .playing-card { font-size:30px; }
  .metric-label { font-size:10px; }
  .metric-note { font-size:9px; }
  .panel-title h2 { font-size:18px; }
  .backup-copy h2 { font-size:14px; }
}
@media(max-width:850px) {
  .ready-state { min-height:min(45vh,360px); }
}
@media(max-width:600px) {
  .ready-state { min-height:calc(55dvh - 20px);padding:18px 13px; }
  .ready-orbit { width:82px;height:82px;margin-bottom:12px; }
  body.focus-mode .practice-stage { padding:calc(env(safe-area-inset-top) + 68px) max(15px,env(safe-area-inset-right)) calc(env(safe-area-inset-bottom) + 10px) max(15px,env(safe-area-inset-left)); }
  body.focus-mode .focus-header { top:calc(env(safe-area-inset-top) + 12px);left:max(15px,env(safe-area-inset-left));right:max(15px,env(safe-area-inset-right));width:auto; }
  body.focus-mode .session-clock>span { font-size:7px; }
  body.focus-mode .session-clock strong { font-size:17px; }
  body.focus-mode .button-end { min-height:38px;padding:0 14px;font-size:9px; }
  body.focus-mode .flashcard { width:min(84vw,370px);height:min(53dvh,430px); }
  body.focus-mode .rating-actions { width:min(84vw,370px);gap:9px;margin-top:14px; }
  body.focus-mode .rating-actions .button { flex:1;min-width:0;min-height:50px;font-size:12px; }
  body.focus-mode .flip-hint { margin-top:11px;font-size:8px; }
}
@media(max-height:520px) {
  body.focus-mode .practice-stage { padding-top:calc(env(safe-area-inset-top) + 57px); }
  body.focus-mode .flashcard { width:min(42vw,360px);height:min(61dvh,310px); }
  body.focus-mode .prompt-number { margin-top:11px;font-size:clamp(70px,18vh,105px); }
  body.focus-mode .prompt-card .playing-card { width:90px;height:125px;font-size:46px; }
  body.focus-mode .response-number { margin-top:9px;font-size:clamp(68px,17vh,94px); }
  body.focus-mode .face-footnote { bottom:22px; }
  body.focus-mode .rating-actions { margin-top:9px; }
  body.focus-mode .rating-actions .button { min-height:42px; }
  body.focus-mode .flip-hint { margin-top:7px; }
}

/* Progress screen refinement and lighter card glyphs */
.author-credit { color:#9294a7;font-size:10px;letter-spacing:.025em; }
.author-credit strong { color:#64667b;font-weight:550; }
.rail-bottom { display:none; }
.playing-card { border-color:transparent!important;background:transparent!important;box-shadow:none!important; }
.playing-card.red { color:#be514e; }
.playing-card.black { color:#252a26; }
.progress-heading { margin:9px 0 22px; }
.progress-heading .overline { margin-bottom:7px;font-size:8px; }
.progress-heading h1 { font-size:clamp(30px,3.2vw,40px); }
.progress-heading .subheading { margin-top:6px;font-size:11px; }
.progress-overview { display:grid;grid-template-columns:minmax(160px,.8fr) 1px minmax(180px,1.2fr);align-items:center;gap:27px;padding:19px 23px;border-radius:19px; }
.overview-primary { display:flex;flex-direction:column;align-items:flex-start; }
.metric-label { color:#85879c;font-size:8px;letter-spacing:.12em; }
.overview-accuracy { margin-top:3px;color:#5d5be2;font:600 44px/.98 -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;letter-spacing:-.06em;font-variant-numeric:tabular-nums; }
.overview-accuracy span { padding-left:3px;font-size:.48em;letter-spacing:-.02em; }
.overview-attempts { margin-top:6px;color:#9294a7;font-size:9px; }
.overview-attempts strong { color:#66697e;font-weight:600; }
.overview-divider { width:1px;height:54px;background:rgba(120,121,161,.15); }
.overview-secondary { display:flex;justify-content:space-between;gap:22px; }
.overview-secondary>div { display:flex;flex-direction:column;gap:8px; }
.overview-secondary>div>span { color:#9294a7;font-size:9px; }
.overview-secondary>div>strong { color:#53556d;font:600 17px/1 -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;letter-spacing:-.035em;font-variant-numeric:tabular-nums; }
.overview-secondary>div>strong span { color:#a3a4b4;font-size:10px;font-weight:500; }
.progress-hardest { margin-top:13px;padding:17px 20px;border-radius:18px; }
.progress-hardest .panel-title { margin-bottom:13px; }
.progress-hardest .panel-title h2 { font-size:15px; }
.progress-hardest .panel-title .overline { font-size:7px; }
.progress-hardest .hard-list { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 22px; }
.progress-hardest .hard-row { grid-template-columns:18px 32px minmax(0,1fr) 25px;gap:8px; }
.progress-hardest .hard-row .playing-card { font-size:18px; }
.progress-hardest .formula-note { margin-top:12px;font-size:8px; }
.difficulty-details { margin-top:13px;padding:0 18px;border-radius:16px;overflow:hidden; }
.difficulty-details summary { min-height:55px;display:flex;align-items:center;justify-content:space-between;gap:12px;list-style:none;cursor:pointer; }
.difficulty-details summary::-webkit-details-marker { display:none; }
.difficulty-details summary>span:first-child { display:flex;flex-direction:column;gap:4px; }
.difficulty-details summary small { color:#9294a7;font-size:7px;font-weight:700;letter-spacing:.13em; }
.difficulty-details summary strong { color:#53556d;font-size:12px;font-weight:600; }
.detail-chevron { color:#9294a7;font-size:17px;transition:transform .2s; }
.difficulty-details[open] .detail-chevron { transform:rotate(180deg); }
.details-content { padding:0 0 15px; }
.details-content>p { margin:0 0 11px;color:#9294a7;font-size:8px;line-height:1.5; }
.difficulty-details .table-scroll { max-height:330px; }
.difficulty-details th { font-size:7px; }
.difficulty-details td { padding-top:7px;padding-bottom:7px; }
.table-card { color:#5d5be2!important;font-weight:650; }
.backup-panel { margin-top:13px;padding:14px 17px;border-radius:16px; }
.backup-copy { gap:10px; }
.backup-icon { width:32px;height:32px;border-radius:10px;font-size:15px; }
.backup-copy h2 { font-size:11px; }
.backup-copy p { margin:4px 0;color:#9294a7;font-size:8px; }
.save-status { display:flex;align-items:center;gap:6px;color:#8b8da1;font-size:8px; }
.save-status i { width:6px;height:6px;box-shadow:0 0 0 3px rgba(79,204,166,.13); }
.save-status span { font-size:8px; }
#backup-message { display:block;margin-top:4px;color:#989aac;font-size:7px; }
.backup-actions .button { min-height:36px;font-size:9px; }
.reset-button { margin-top:11px;font-size:8px; }
body.theme-light .playing-card.red { color:#be514e!important; }
body.theme-light .playing-card.black { color:#252a26!important; }
@media(max-width:850px) {
  .author-credit { font-size:9px; }
  .progress-heading { margin-top:1px; }
  .progress-overview { padding:17px 19px;gap:19px; }
}
@media(max-width:600px) {
  .author-credit { font-size:8px; }
  .author-credit strong { font-weight:600; }
  .progress-heading { margin:2px 0 15px; }
  .progress-heading h1 { font-size:30px; }
  .progress-heading .subheading { font-size:10px; }
  .progress-overview { grid-template-columns:minmax(95px,.82fr) minmax(0,1.18fr);gap:14px;padding:15px 14px;border-radius:17px; }
  .overview-divider { display:none; }
  .metric-label { font-size:7px; }
  .overview-accuracy { font-size:39px; }
  .overview-attempts { margin-top:5px;font-size:8px; }
  .overview-secondary { flex-direction:column;justify-content:center;gap:10px;padding-left:13px;border-left:1px solid rgba(120,121,161,.14); }
  .overview-secondary>div { flex-direction:row;align-items:center;justify-content:space-between;gap:5px; }
  .overview-secondary>div>span { font-size:8px; }
  .overview-secondary>div>strong { font-size:14px; }
  .progress-hardest { margin-top:10px;padding:14px;border-radius:16px; }
  .progress-hardest .panel-title h2 { font-size:14px; }
  .progress-hardest .hard-list { grid-template-columns:1fr;gap:9px; }
  .progress-hardest .hard-row { grid-template-columns:18px 31px minmax(0,1fr) 25px; }
  .progress-hardest .formula-note { margin-top:10px;font-size:7px; }
  .difficulty-details { margin-top:10px;padding:0 14px;border-radius:15px; }
  .difficulty-details summary { min-height:51px; }
  .backup-panel { margin-top:10px;padding:12px; }
  .backup-copy { align-items:center; }
  .backup-copy h2 { font-size:10px; }
  .backup-copy p { font-size:7px; }
  .backup-actions { gap:6px; }
  .backup-actions .button { min-height:38px;font-size:8px; }
  #backup-message { font-size:7px; }
}

/* Comfortable reading and touch targets */
@media(min-width:601px) {
  .author-credit { font-size:12px; }
  .overline,.progress-heading .overline { font-size:10px; }
  .subheading,.progress-heading .subheading { font-size:15px; }
  .select-field>span,.custom-range label>span { font-size:11px; }
  .select-field select,.custom-range input { height:46px;font-size:14px; }
  .button,.text-button { font-size:14px; }
  .reset-button { font-size:11px; }
  .review-toolbar { font-size:10px; }
  .tile-position { font-size:10px; }
  .privacy-footnote { font-size:11px; }
  .ready-state>p:last-child { font-size:13px; }
  .empty-state { font-size:12px; }
  .nav-item { font-size:15px; }
  .face-label { font-size:10px; }
  .face-footnote { font-size:11px; }
  .flip-hint { font-size:12px; }
  .session-message { font-size:11px; }
  .progress-heading .overline { margin-bottom:9px; }
  .progress-heading h1 { font-size:clamp(34px,3.2vw,44px); }
  .progress-overview { padding:23px 27px; }
  .overview-primary .metric-label { font-size:11px; }
  .overview-accuracy { font-size:51px; }
  .overview-attempts { font-size:12px; }
  .overview-secondary>div>span { font-size:12px; }
  .overview-secondary>div>strong { font-size:20px; }
  .progress-hardest { padding:20px 23px; }
  .progress-hardest .panel-title h2 { font-size:20px; }
  .progress-hardest .panel-title .overline { font-size:9px; }
  .text-button { font-size:12px; }
  .progress-hardest .hard-list { gap:15px 25px; }
  .progress-hardest .hard-row { grid-template-columns:22px 38px minmax(0,1fr) 30px;gap:11px; }
  .progress-hardest .hard-row .playing-card { font-size:22px; }
  .progress-hardest .hard-rank,.progress-hardest .difficulty-value { font-size:11px; }
  .progress-hardest .formula-note { font-size:11px; }
  .difficulty-details summary { min-height:62px; }
  .difficulty-details summary small { font-size:9px; }
  .difficulty-details summary strong { font-size:15px; }
  .details-content>p { font-size:11px; }
  .difficulty-details table { font-size:12px; }
  .difficulty-details th { font-size:9px; }
  .difficulty-details td { padding:10px; }
  .backup-copy h2 { font-size:14px; }
  .backup-copy p { font-size:11px; }
  .backup-copy .save-status,.backup-copy .save-status span { font-size:10px; }
  #backup-message { font-size:9px; }
  .backup-actions .button { min-height:42px;font-size:11px; }
}
@media(max-width:600px) {
  .author-credit { font-size:10px; }
  .overline,.progress-heading .overline { font-size:9px; }
  .subheading,.progress-heading .subheading { font-size:12px; }
  .progress-heading { margin-bottom:17px; }
  .progress-heading h1 { font-size:32px; }
  .select-field>span,.custom-range label>span { font-size:9px; }
  .select-field select,.custom-range input { height:44px;font-size:12px; }
  .button { font-size:13px; }
  .mobile-tab small { font-size:10px; }
  .brand-copy small { font-size:8px; }
  .review-toolbar { font-size:9px; }
  .tile-position { font-size:9px; }
  .privacy-footnote { font-size:9px; }
  .ready-state>p:last-child { font-size:12px; }
  .empty-state { font-size:11px; }
  .reset-button { font-size:10px; }
  .face-label { font-size:9px; }
  .face-footnote { font-size:10px; }
  .flip-hint { font-size:10px; }
  .session-message { font-size:10px; }
  .progress-overview { padding:17px 15px; }
  .overview-primary .metric-label { font-size:8px; }
  .overview-accuracy { font-size:42px; }
  .overview-attempts { font-size:9px; }
  .overview-secondary>div>span { font-size:9px; }
  .overview-secondary>div>strong { font-size:15px; }
  .progress-hardest { padding:15px; }
  .progress-hardest .panel-title h2 { font-size:16px; }
  .progress-hardest .panel-title .overline { font-size:10px; }
  .progress-hardest .hard-row { grid-template-columns:20px 34px minmax(0,1fr) 29px;gap:9px; }
  .progress-hardest .hard-row .playing-card { font-size:21px; }
  .progress-hardest .hard-rank,.progress-hardest .difficulty-value { font-size:10px; }
  .progress-hardest .difficulty-track { height:5px; }
  .progress-hardest .formula-note { font-size:9px; }
  .difficulty-details summary { min-height:57px; }
  .difficulty-details summary small { font-size:8px; }
  .difficulty-details summary strong { font-size:14px; }
  .details-content>p { font-size:10px; }
  .difficulty-details table { font-size:11px; }
  .difficulty-details th { font-size:8px; }
  .difficulty-details td { padding:9px; }
  .backup-copy h2 { font-size:12px; }
  .backup-copy p { font-size:9px; }
  .backup-copy .save-status,.backup-copy .save-status span { font-size:9px; }
  #backup-message { font-size:8px; }
  .backup-actions .button { min-height:42px;font-size:10px; }
}
@media(min-width:601px) {
  body.focus-mode .session-clock>span { font-size:10px; }
  body.focus-mode .session-clock strong { font-size:22px; }
  body.focus-mode .button-end { font-size:12px; }
  body.focus-mode .rating-actions .button { font-size:14px; }
  body.focus-mode .flip-hint { font-size:12px; }
  body.focus-mode .session-message { font-size:11px; }
}
@media(max-width:600px) {
  .text-button { font-size:11px; }
  body.focus-mode .session-clock>span { font-size:9px; }
  body.focus-mode .session-clock strong { font-size:19px; }
  body.focus-mode .button-end { font-size:11px; }
  body.focus-mode .rating-actions .button { font-size:13px; }
  body.focus-mode .flip-hint { font-size:10px; }
  body.focus-mode .session-message { font-size:10px; }
}

/* Session goals and post-session summary */
.goal-value-field[hidden] { display:none!important; }
.adaptive-note[hidden] { display:none!important; }
.adaptive-note { margin:10px 2px 0;color:var(--muted);font-size:12px;line-height:1.45; }
.goal-value-field::after { display:none; }
.goal-value-field input { width:100%;height:39px;appearance:textfield;padding:0 11px;border:1px solid var(--line);border-radius:10px;color:var(--ink-2);background:var(--surface-solid);font-size:13px;font-weight:550; }
.goal-value-field input::-webkit-inner-spin-button,.goal-value-field input::-webkit-outer-spin-button { margin:0;appearance:none; }
#ready-description { max-width:460px; }
@media(max-width:1150px) {
  .controls-row { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px; }
  .select-field,.custom-range label { min-width:0; }
  .range-field,.custom-range,.start-button { grid-column:1/-1; }
  .start-button { width:100%; }
}
@media(max-width:600px) {
  .adaptive-note { font-size:11px; }
  .goal-value-field input { height:44px;font-size:14px; }
}
@media(min-width:601px) {
  .goal-value-field input { height:46px;font-size:16px; }
}

/* Larger type throughout for more comfortable reading */
@media(min-width:601px) {
  body { font-size:16px; }
  .nav-item { font-size:16px; }
  .overline,.progress-heading .overline { font-size:11px; }
  .subheading,.progress-heading .subheading { font-size:16px; }
  .select-field>span,.custom-range label>span { font-size:13px; }
  .select-field select,.custom-range input { font-size:16px; }
  .button,.text-button { font-size:15px; }
  .review-toolbar,.tile-position { font-size:12px; }
  .privacy-footnote,.face-footnote { font-size:13px; }
  .face-label { font-size:12px; }
  .progress-heading h1 { font-size:clamp(38px,3.5vw,48px); }
  .metric-label { font-size:12px; }
  .overview-attempts,.overview-secondary>div>span { font-size:13px; }
  .progress-hardest .panel-title .overline { font-size:11px; }
  .progress-hardest .hard-rank,.progress-hardest .difficulty-value { font-size:13px; }
  .progress-hardest .formula-note,.details-content>p { font-size:13px; }
  .difficulty-details summary small { font-size:11px; }
  .difficulty-details summary strong { font-size:17px; }
  .difficulty-details table { font-size:14px; }
  .difficulty-details th { font-size:11px; }
  .backup-copy p { font-size:13px; }
  #backup-message { font-size:11px; }
  .backup-actions .button { font-size:13px; }
}
@media(max-width:600px) {
  .nav-item,.mobile-tab small { font-size:12px; }
  .brand-copy small { font-size:10px; }
  .overline,.progress-heading .overline { font-size:10px; }
  .subheading,.progress-heading .subheading { font-size:13px; }
  .select-field>span,.custom-range label>span { font-size:11px; }
  .select-field select,.custom-range input { font-size:14px; }
  .button { font-size:14px; }
  .text-button { font-size:13px; }
  .review-toolbar,.tile-position { font-size:11px; }
  .privacy-footnote,.face-footnote { font-size:11px; }
  .face-label { font-size:11px; }
  .progress-heading h1 { font-size:34px; }
  .overview-primary .metric-label { font-size:10px; }
  .overview-attempts,.overview-secondary>div>span { font-size:11px; }
  .progress-hardest .panel-title .overline { font-size:10px; }
  .progress-hardest .hard-rank,.progress-hardest .difficulty-value { font-size:12px; }
  .progress-hardest .formula-note,.details-content>p { font-size:11px; }
  .difficulty-details summary small { font-size:10px; }
  .difficulty-details summary strong { font-size:15px; }
  .difficulty-details table { font-size:12px; }
  .difficulty-details th { font-size:10px; }
  .backup-copy p { font-size:11px; }
  #backup-message { font-size:10px; }
  .backup-actions .button { font-size:12px; }
}

/* Session finish celebration and results window */
.session-celebration[hidden] { display:none!important; }
.session-celebration { position:fixed;z-index:20;inset:0;display:grid;place-items:center;overflow:hidden;background:radial-gradient(ellipse at 50% 45%,color-mix(in srgb,var(--green-2) 20%,transparent),transparent 50%),color-mix(in srgb,var(--bg) 84%,transparent);backdrop-filter:blur(24px) saturate(1.3);-webkit-backdrop-filter:blur(24px) saturate(1.3); }
.celebration-glow { position:absolute;width:min(78vw,580px);aspect-ratio:1;border-radius:50%;background:radial-gradient(circle,color-mix(in srgb,var(--green-2) 27%,transparent),transparent 68%);opacity:0;transform:scale(.5); }
.celebration-cards { position:relative;width:178px;height:158px; }
.celebration-cards span { position:absolute;top:13px;left:50%;width:88px;height:126px;display:grid;place-items:center;border:1px solid rgba(255,255,255,.9);border-radius:17px;background:linear-gradient(145deg,#fff 0%,#f5f4ff 100%);box-shadow:0 18px 48px rgba(57,51,123,.18),inset 0 1px 0 white;color:#5b5be9;font:600 42px/1 -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;opacity:0;transform:translate(-50%,42px) rotate(0); }
.celebration-cards span:first-child { color:#e16d83; }
.celebration-cards span:last-child { color:#e3a244; }
.celebration-burst { position:absolute;inset:0;pointer-events:none; }
.celebration-burst i { position:absolute;top:50%;left:50%;color:var(--green-2);font-size:25px;font-style:normal;opacity:0;transform:translate(-50%,-50%) scale(.2); }
.celebration-burst i:nth-child(2n) { color:#f0ad58; }
.celebration-burst i:nth-child(3n) { color:#e77c91; }
.celebration-burst i:nth-child(1) { --burst-x:-164px;--burst-y:-105px; }
.celebration-burst i:nth-child(2) { --burst-x:146px;--burst-y:-123px; }
.celebration-burst i:nth-child(3) { --burst-x:194px;--burst-y:7px; }
.celebration-burst i:nth-child(4) { --burst-x:132px;--burst-y:116px; }
.celebration-burst i:nth-child(5) { --burst-x:-173px;--burst-y:107px; }
.celebration-burst i:nth-child(6) { --burst-x:-205px;--burst-y:8px; }
.celebration-burst i:nth-child(7) { --burst-x:77px;--burst-y:-175px; }
.celebration-burst i:nth-child(8) { --burst-x:-75px;--burst-y:173px; }
.session-celebration>p { position:absolute;top:calc(50% + 115px);margin:0;color:var(--ink);font-size:17px;font-weight:650;letter-spacing:-.025em;opacity:0;transform:translateY(9px); }
.session-celebration.is-active .celebration-glow { animation:celebration-glow 1.15s cubic-bezier(.2,.8,.2,1) forwards; }
.session-celebration.is-active .celebration-cards span { animation:celebration-card .82s cubic-bezier(.2,.85,.2,1) forwards; }
.session-celebration.is-active .celebration-cards span:first-child { animation-delay:.04s; }
.session-celebration.is-active .celebration-cards span:nth-child(2) { animation-delay:.12s; }
.session-celebration.is-active .celebration-cards span:last-child { animation-delay:.2s; }
.session-celebration.is-active .celebration-burst i { animation:celebration-burst .8s cubic-bezier(.17,.67,.37,1) .18s forwards; }
.session-celebration.is-active>p { animation:celebration-label .45s ease-out .55s forwards; }
@keyframes celebration-glow { 35% { opacity:1;transform:scale(1.1); } 100% { opacity:.72;transform:scale(1); } }
@keyframes celebration-card { 65% { opacity:1;transform:translate(-50%,-14px) rotate(var(--card-rotation)); } 100% { opacity:1;transform:translate(-50%,0) rotate(var(--card-rotation)); } }
.celebration-cards span:first-child { --card-rotation:-13deg; }
.celebration-cards span:nth-child(2) { --card-rotation:0deg; }
.celebration-cards span:last-child { --card-rotation:13deg; }
@keyframes celebration-burst { 35% { opacity:1; } 100% { opacity:0;transform:translate(calc(-50% + var(--burst-x)),calc(-50% + var(--burst-y))) scale(1); } }
@keyframes celebration-label { to { opacity:1;transform:translateY(0); } }
.session-results-dialog { width:min(520px,calc(100vw - 32px));max-width:none;max-height:min(88dvh,780px);overflow:auto;margin:auto;padding:26px;border:1px solid var(--line);border-radius:28px;background:var(--surface-solid);color:var(--ink);box-shadow:0 32px 100px rgba(27,25,60,.25),inset 0 1px 0 rgba(255,255,255,.75); }
.session-results-dialog::backdrop { background:rgba(22,23,42,.36);backdrop-filter:blur(13px);-webkit-backdrop-filter:blur(13px); }
.results-head { display:flex;justify-content:space-between;align-items:flex-start;gap:14px; }
.results-head .overline { margin:2px 0 7px;color:var(--green);font-size:10px; }
.results-head h2 { margin:0;color:var(--ink);font:650 32px/1.1 -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;letter-spacing:-.055em; }
.results-subtitle { margin:8px 0 0;color:var(--muted);font-size:13px; }
.results-close { flex:0 0 auto;width:36px;height:36px;border:1px solid var(--line);border-radius:50%;background:var(--surface);color:var(--muted);font-size:24px;line-height:1; }
.results-metrics { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-top:23px; }
.results-metrics>div { min-height:78px;display:flex;flex-direction:column;justify-content:center;gap:8px;padding:12px;border:1px solid var(--line);border-radius:15px;background:var(--surface); }
.results-metrics span,.results-extra span { color:var(--muted);font-size:11px;font-weight:600; }
.results-metrics strong { color:var(--ink);font-size:21px;font-weight:650;letter-spacing:-.04em;font-variant-numeric:tabular-nums; }
.results-extra { display:flex;justify-content:space-between;align-items:center;margin-top:10px;padding:13px 3px;border-bottom:1px solid var(--line); }
.results-extra strong { color:var(--ink-2);font-size:14px;font-variant-numeric:tabular-nums; }
.results-reinforce { margin-top:17px;padding:15px;border-radius:15px;background:var(--green-wash); }
.results-reinforce[hidden] { display:none; }
.results-reinforce h3 { margin:0 0 7px;color:var(--ink);font-size:13px; }
.results-reinforce p { margin:0;color:var(--ink-2);font-size:13px;line-height:1.5; }
.results-actions { display:grid;grid-template-columns:1fr 1fr;gap:9px;margin-top:20px; }
.results-actions .button { min-height:48px;font-size:14px; }
.results-actions .button:disabled { cursor:not-allowed;opacity:.48;transform:none; }
.results-home { grid-column:1/-1;min-height:42px;border:0;background:transparent;color:var(--muted);font-family:inherit;font-size:13px;font-weight:600; }
.results-home:hover { color:var(--green); }
@media(max-width:600px) {
  .session-results-dialog { width:calc(100vw - 24px);max-height:calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 20px);padding:21px 17px;border-radius:25px; }
  .results-head h2 { font-size:28px; }
  .results-subtitle { font-size:12px; }
  .results-metrics { grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin-top:18px; }
  .results-metrics>div { min-height:68px;padding:10px; }
  .results-metrics strong { font-size:20px; }
  .results-extra { padding:11px 3px; }
  .results-actions { grid-template-columns:1fr;gap:7px;margin-top:15px; }
  .results-actions .button { min-height:46px; }
  .results-home { grid-column:auto; }
}
@media(prefers-reduced-motion:reduce) {
  .session-celebration.is-active .celebration-glow,.session-celebration.is-active .celebration-cards span,.session-celebration.is-active .celebration-burst i,.session-celebration.is-active>p { animation-duration:.01ms;animation-delay:0ms; }
}

/* Compact pre-session layout on small screens */
@media(max-width:600px) {
  .content-area { padding-top:18px;padding-bottom:8px; }
  .train-heading { gap:9px;margin-bottom:13px; }
  .train-heading h1 { font-size:clamp(28px,7.2vw,34px);line-height:1.06; }
  .train-heading .subheading { margin-top:5px;font-size:12px; }
  .deck-badge { padding:6px 9px; }
  .practice-panel { padding:9px;border-radius:15px; }
  .controls-row { gap:6px; }
  .range-field { grid-column:auto; }
  .select-field { gap:4px; }
  .select-field>span,.custom-range label>span { font-size:10px; }
  .select-field select,.custom-range input,.goal-value-field input { height:39px;font-size:13px; }
  .select-field::after { bottom:7px; }
  .start-button { min-height:41px; }
  .adaptive-note { margin-top:7px;font-size:10px; }
  .ready-state { min-height:0;padding:13px 10px 0;justify-content:flex-start; }
  .ready-orbit { width:56px;height:56px;margin:18px 0 24px;flex-shrink:0; }
  .ready-orbit>span { font-size:23px; }
  .ready-orbit i,.ready-orbit b { font-size:13px; }
  .ready-state .overline { margin:4px 0 5px; }
  .ready-state h2 { max-width:330px;font-size:clamp(20px,5.8vw,24px);line-height:1.12; }
  .ready-state>p:last-child { max-width:310px;margin:6px 0 0;font-size:11px;line-height:1.4; }
  #view-stats .privacy-footnote { display:block;margin:17px 0 5px;font-size:11px; }
}
@media(max-width:600px) and (max-height:740px) {
  .content-area { padding-top:12px; }
  .train-heading { margin-bottom:10px; }
  .deck-badge { padding:5px 8px; }
  .ready-state { padding-top:9px; }
  .ready-orbit { width:46px;height:46px;margin-bottom:22px; }
  .ready-orbit>span { font-size:20px; }
  .ready-state .overline { margin:2px 0 4px; }
  .ready-state h2 { font-size:20px; }
}
@media(max-width:600px) and (min-height:640px) {
  .content-area { min-height:calc(100dvh - 122px - env(safe-area-inset-top) - max(9px,env(safe-area-inset-bottom)));display:flex;flex-direction:column; }
  .view.active#view-train { display:flex;flex:1;flex-direction:column;min-height:0; }
  #view-train .ready-state { flex:1;justify-content:center; }
}
@media(max-width:600px) and (min-height:640px) {
  .view.active#view-train:has(#goal-value-field:not([hidden])),
  .view.active#view-train:has(#custom-range:not([hidden])),
  .view.active#view-train:has(.adaptive-note:not([hidden])) { display:block; }
}

/* Direction-specific progress and practice priorities */
.difficulty-direction-switch { display:flex;gap:5px;margin:-1px 0 15px;padding:4px;border:1px solid var(--line);border-radius:13px;background:var(--surface-soft); }
.difficulty-direction-switch button { flex:1;min-width:0;min-height:42px;padding:0 10px;border:0;border-radius:9px;background:transparent;color:var(--muted);font-family:inherit;font-size:13px;font-weight:600;line-height:1.2;cursor:pointer;transition:background .18s,color .18s,box-shadow .18s; }
.difficulty-direction-switch button.active,.difficulty-direction-switch button[aria-pressed="true"] { background:var(--surface-solid);color:var(--green);box-shadow:0 2px 9px rgba(45,47,81,.08),inset 0 1px 0 rgba(255,255,255,.8); }
.difficulty-direction-switch button:focus-visible { outline:2px solid color-mix(in srgb,var(--green-2) 65%,transparent);outline-offset:2px; }
@media(max-width:600px) {
  .difficulty-direction-switch { margin-bottom:13px;padding:3px; }
  .difficulty-direction-switch button { min-height:44px;padding:0 5px;font-size:12px; }
}
