/*
 * Lexcade 2026 product shell
 * The legacy stylesheet still owns a few low-level game states. This layer
 * deliberately replaces the information hierarchy and responsive surface.
 */

:root {
  --ink: #16231c;
  --muted: #657168;
  --paper: #f3f5f0;
  --panel: #ffffff;
  --panel-soft: #edf1eb;
  --line: #d7ded6;
  --line-strong: #aab7aa;
  --accent: #e44b3e;
  --accent-dark: #b9362d;
  --blue: #277da5;
  --green: #2c8d63;
  --gold: #dda936;
  --nav: #14221b;
  --nav-soft: #203129;
  --nav-text: #c9d4cc;
  --panel-glass: #ffffff;
  --panel-strong: #ffffff;
  --input-bg: #ffffff;
  --stage-start: #ffffff;
  --stage-end: #ffffff;
  --soft-blue: #e5f2f7;
  --soft-green: #e7f4ed;
  --soft-red: #fbe9e7;
  --success-ink: #216f4e;
  --danger-ink: #aa332b;
  --selection-ink: #1f6787;
  --card-stroke: #d7ded6;
  --shadow: 0 12px 32px rgba(25, 43, 33, 0.09);
  --course-image: url("/assets/worlds/russian.jpg");
}

html[data-theme="dark"] {
  --ink: #eef5ef;
  --muted: #a8b5ab;
  --paper: #101712;
  --panel: #18211b;
  --panel-soft: #202d25;
  --line: #334239;
  --line-strong: #536459;
  --accent: #f26559;
  --accent-dark: #ff8e84;
  --blue: #67b4d7;
  --green: #68c792;
  --gold: #efc461;
  --nav: #0a100c;
  --nav-soft: #17231c;
  --nav-text: #d2ddd5;
  --panel-glass: #18211b;
  --panel-strong: #18211b;
  --input-bg: #111914;
  --stage-start: #18211b;
  --stage-end: #18211b;
  --soft-blue: #19343f;
  --soft-green: #1b3829;
  --soft-red: #412521;
  --success-ink: #8bddaa;
  --danger-ink: #ff9c93;
  --selection-ink: #9bd6ed;
  --card-stroke: #334239;
  --shadow: 0 16px 38px rgba(0, 0, 0, 0.28);
}

html,
body {
  min-width: 320px;
  background: var(--paper);
}

body {
  overflow: hidden;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input,
select {
  letter-spacing: 0;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid var(--selection-ink);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

button {
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background-color 140ms ease,
    color 140ms ease;
}

button:not(:disabled):active {
  transform: translateY(1px);
}

.eyebrow,
.prompt-label,
label,
.stats span,
.metric-card span {
  letter-spacing: 0;
}

.primary-action,
.ghost-button,
.danger-button,
.auth-tab,
.view-tab,
.choice-button,
.theory-segment,
.theory-check-option,
input,
select {
  border-radius: 8px;
}

.primary-action {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
  box-shadow: none;
}

.primary-action:hover {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
}

.ghost-button {
  border-color: var(--line);
  background: var(--panel);
  color: var(--ink);
  box-shadow: none;
}

.ghost-button:hover {
  border-color: var(--line-strong);
  background: var(--panel-soft);
}

/* Auth */
.auth-screen {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: 100dvh;
  padding:
    calc(24px + var(--safe-top))
    calc(24px + var(--safe-right))
    calc(24px + var(--safe-bottom))
    calc(24px + var(--safe-left));
  overflow: auto;
  background: #d9ebe5;
}

.auth-world {
  position: absolute;
  z-index: -3;
  inset: 0;
  background-position: center;
  background-size: cover;
}

.auth-world-russian {
  background-image: url("/assets/worlds/russian.jpg");
}

.auth-world-dutch {
  right: 0;
  left: auto;
  width: 31%;
  border-left: 8px solid rgba(255, 255, 255, 0.74);
  background-image: url("/assets/worlds/dutch.jpg");
  background-position: 58% center;
}

.auth-screen::before {
  position: absolute;
  z-index: -2;
  inset: 0;
  background: rgba(14, 29, 21, 0.18);
  content: "";
}

.auth-panel {
  grid-template-columns: minmax(0, 1fr) minmax(340px, 410px);
  gap: clamp(28px, 6vw, 88px);
  width: min(1160px, 100%);
  max-height: none;
}

.auth-copy {
  align-content: center;
  justify-self: start;
  width: min(620px, 100%);
  padding: clamp(22px, 4vw, 42px);
  border-left: 6px solid var(--accent);
  border-radius: 0 8px 8px 0;
  background: rgba(12, 24, 18, 0.8);
  color: #ffffff;
  box-shadow: 0 18px 48px rgba(9, 18, 13, 0.24);
}

.auth-copy .brand {
  margin: 0 0 18px;
  color: #ffffff;
}

.auth-copy .brand img {
  width: 42px;
  height: 42px;
  border-radius: 8px;
}

.auth-copy .eyebrow {
  color: #ffd06a;
}

.auth-copy h1 {
  max-width: 600px;
  color: #ffffff;
  font-size: clamp(3.6rem, 7vw, 6.6rem);
  line-height: 0.88;
}

.auth-copy p:not(.eyebrow) {
  max-width: 520px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 1.04rem;
}

.auth-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.auth-signals span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 10px 6px 7px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.11);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 850;
}

.auth-signals b {
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 22px;
  border-radius: 5px;
  background: #ffffff;
  color: #18251e;
  font-size: 0.68rem;
}

.account-card {
  align-self: center;
  gap: 16px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  box-shadow: 0 24px 64px rgba(10, 22, 15, 0.25);
  backdrop-filter: blur(18px);
}

.account-heading {
  display: grid;
  gap: 4px;
}

.account-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.65rem;
  line-height: 1.05;
}

.auth-tabs {
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.auth-tab {
  min-height: 44px;
  border: 0;
}

.auth-tab.active {
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 3px 10px rgba(18, 34, 25, 0.09);
}

.field-group {
  gap: 6px;
}

.field-group label {
  color: var(--muted);
  font-size: 0.72rem;
}

.field-group input {
  min-height: 48px;
  border-color: var(--line);
  background: var(--input-bg);
}

.form-note {
  line-height: 1.45;
}

.auth-recovery-action {
  justify-self: center;
  min-height: 36px;
  padding: 4px 8px;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 0.82rem;
  font-weight: 850;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-recovery-action:hover {
  color: var(--ink);
}

#recoveryCode {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  text-transform: uppercase;
}

.auth-legal {
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

/* Product shell */
.app-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  width: 100%;
  max-width: none;
  height: 100dvh;
  padding: 0;
  background: var(--paper);
}

.app-topbar {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 24px;
  min-width: 0;
  min-height: 0;
  padding:
    calc(22px + var(--safe-top))
    14px
    calc(18px + var(--safe-bottom))
    calc(14px + var(--safe-left));
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  background: var(--nav);
  box-shadow: none;
}

.app-topbar .brand {
  min-height: 44px;
  padding: 0 8px;
}

.app-topbar .brand img {
  width: 38px;
  height: 38px;
}

.app-topbar .brand > span {
  display: grid;
  gap: 1px;
  overflow: visible;
  color: #ffffff;
  text-overflow: unset;
}

.app-topbar .brand strong {
  font-size: 1rem;
  line-height: 1;
}

.app-topbar .brand small {
  color: var(--nav-text);
  font-size: 0.68rem;
  font-weight: 750;
}

.view-tabs {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 0;
  background: transparent;
}

.view-tab {
  justify-content: flex-start;
  width: 100%;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--nav-text);
  text-align: left;
}

.view-tab:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
}

.view-tab.active {
  border-color: rgba(255, 255, 255, 0.1);
  background: #ffffff;
  color: #17251d;
  box-shadow: none;
}

.user-area {
  display: grid;
  align-items: stretch;
  gap: 7px;
  width: 100%;
  margin-top: auto;
}

.sync-status {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--nav-text);
  font-size: 0.68rem;
  font-weight: 850;
}

.sync-status[hidden] {
  display: none;
}

.sync-status-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #63d995;
  box-shadow: 0 0 0 3px rgba(99, 217, 149, 0.12);
}

.sync-status[data-state="offline"] .sync-status-dot,
.sync-status[data-state="pending"] .sync-status-dot {
  background: #f3bd55;
  box-shadow: 0 0 0 3px rgba(243, 189, 85, 0.12);
}

.sync-status[data-state="syncing"] .sync-status-dot {
  background: #72b7ff;
  box-shadow: 0 0 0 3px rgba(114, 183, 255, 0.12);
  animation: sync-pulse 1s ease-in-out infinite;
}

.sync-status[data-state="attention"] .sync-status-dot {
  background: #ff6f63;
  box-shadow: 0 0 0 3px rgba(255, 111, 99, 0.12);
}

@keyframes sync-pulse {
  50% {
    opacity: 0.45;
  }
}

.sidebar-label {
  padding: 0 5px;
  color: #839288;
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
}

.user-pill {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  max-width: none;
  min-height: 38px;
  padding: 7px 9px;
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  text-align: left;
  text-overflow: clip;
  white-space: normal;
}

.user-avatar {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 6px;
  background: var(--nav);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 950;
}

.user-meta {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.user-meta strong {
  overflow: hidden;
  font-size: 0.78rem;
  line-height: 1.08;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-meta small {
  color: #839288;
  font-size: 0.65rem;
  font-weight: 850;
}

.app-topbar .ghost-button {
  width: 100%;
  min-height: 44px;
  border-radius: 8px;
}

.app-view {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  min-height: 0;
  padding:
    calc(20px + var(--safe-top))
    calc(24px + var(--safe-right))
    calc(20px + var(--safe-bottom))
    24px;
}

.play-shell {
  grid-template-rows: 126px auto minmax(0, 1fr);
  gap: 12px;
}

.panel-view {
  gap: 12px;
}

/* Learn */
.learn-banner {
  position: relative;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  min-height: 0;
  padding: 20px;
  overflow: hidden;
  border: 1px solid rgba(20, 34, 27, 0.14);
  border-radius: 8px;
  background-image: var(--course-image);
  background-position: center 48%;
  background-size: cover;
  box-shadow: var(--shadow);
}

.app-shell[data-course="nl"] {
  --course-image: url("/assets/worlds/dutch.jpg");
}

.learn-banner::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: min(56%, 610px);
  background: rgba(12, 26, 18, 0.78);
  content: "";
}

.learn-banner-copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 3px;
  width: min(48%, 520px);
  color: #ffffff;
}

.learn-banner .eyebrow {
  color: #ffd16c;
}

.learn-banner :is(h1, h2) {
  margin: 0;
  color: #ffffff;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 0.92;
}

.learn-banner p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.88rem;
  font-weight: 700;
}

.learn-banner-actions {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 7px;
}

.learn-banner .daily-session-action {
  min-height: 48px;
  padding: 0 20px;
  border-color: #ffffff;
  background: #ffffff;
  color: #16231c;
  white-space: nowrap;
}

.learn-banner .daily-session-action:hover {
  border-color: #ffd16c;
  background: #ffd16c;
}

.learn-banner .daily-home-action {
  min-height: 44px;
  border-color: rgba(255, 255, 255, 0.72);
  background: rgba(10, 24, 17, 0.72);
  color: #ffffff;
}

.toolbar {
  grid-template-columns: minmax(150px, 0.7fr) minmax(160px, 1fr) minmax(150px, 0.85fr) auto;
  align-items: end;
  min-height: 62px;
  padding: 10px 12px;
  border-color: var(--line);
  background: var(--panel);
  box-shadow: none;
}

.quick-practice-copy {
  display: grid;
  gap: 3px;
  align-self: center;
}

.practice-lab-labels {
  display: grid;
  gap: 3px;
}

.practice-lab-labels strong {
  font-size: 0.96rem;
}

.quick-home-action {
  width: 44px;
  min-height: 44px;
  padding: 0;
  background: var(--nav);
  color: #ffffff;
  font-size: 1.1rem;
}

.control-group {
  gap: 4px;
}

.control-group label {
  color: var(--muted);
  font-size: 0.64rem;
}

.toolbar select {
  min-height: 44px;
  border-color: var(--line);
  background: var(--panel-soft);
}

.quick-round-action {
  min-height: 44px;
  background: var(--nav);
  color: #ffffff;
}

.quick-round-action:hover {
  border-color: var(--nav);
  background: var(--nav-soft);
  color: #ffffff;
}

.play-board {
  grid-template-columns: 1fr;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: auto;
  min-height: 48px;
  border-color: var(--line);
  background: var(--panel);
  box-shadow: none;
}

.stats div {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 8px 12px;
  border-right: 1px solid var(--line);
  border-bottom: 0;
  background: transparent;
}

.stats div:first-child {
  background: transparent;
}

.stats div:last-child {
  border-right: 0;
}

.stats span {
  color: var(--muted);
  font-size: 0.66rem;
}

.stats strong {
  font-size: 1.25rem;
}

#playView[data-experience="home"] .stats {
  display: none;
}

#playView[data-experience="home"] .toolbar {
  display: none;
}

#playView[data-experience="home"] {
  grid-template-rows: 126px minmax(0, 1fr);
}

#playView[data-experience="practice-hub"] .toolbar,
#playView[data-experience="practice-hub"] .stats {
  display: none;
}

#playView[data-experience="practice-hub"] {
  grid-template-rows: 74px minmax(0, 1fr);
}

#playView[data-experience="practice-hub"] .play-board {
  grid-template-rows: minmax(0, 1fr);
}

#playView[data-experience="practice-hub"] .learn-banner {
  padding: 12px 16px;
}

#playView[data-experience="practice-hub"] .learn-banner h1 {
  font-size: 1.75rem;
}

#playView[data-experience="practice-hub"] .learn-banner p {
  display: none;
}

#playView[data-experience="practice-hub"] .daily-session-action {
  display: none;
}

#playView[data-experience="practice-hub"] .game-stage {
  border: 0;
  background: transparent;
}

.practice-hub {
  width: min(760px, 100%);
  margin: auto;
}

.practice-hub > header {
  margin-bottom: 12px;
}

.practice-hub > header h2 {
  margin: 2px 0 4px;
  font-size: clamp(1.45rem, 3vw, 2rem);
  letter-spacing: 0;
}

.practice-hub > header p {
  margin: 0;
  color: var(--muted);
}

.practice-hub-list {
  border-block: 1px solid var(--line);
}

.practice-hub-lane {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 78px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--line);
}

.practice-hub-lane:last-child {
  border-bottom: 0;
}

.practice-hub-lane > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.practice-hub-lane span {
  color: var(--blue);
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
}

.practice-hub-lane strong {
  font-size: 1rem;
}

.practice-hub-lane small {
  color: var(--muted);
  font-size: 0.78rem;
}

#playView[data-experience="home"] .play-board {
  grid-template-rows: minmax(0, 1fr);
}

#playView[data-experience="quick"] .learn-banner {
  display: none;
}

#playView[data-experience="quick"] .quick-practice-copy {
  display: flex;
}

#playView[data-experience="quick"] .practice-lab-labels {
  display: none;
}

#playView[data-experience="quick"] {
  grid-template-rows: auto minmax(0, 1fr);
}

#playView[data-experience="daily"] .toolbar,
#playView[data-experience="checkpoint"] .toolbar,
#playView[data-experience="replay"] .toolbar {
  display: none;
}

#playView[data-experience="daily"],
#playView[data-experience="checkpoint"],
#playView[data-experience="replay"] {
  grid-template-rows: 74px minmax(0, 1fr);
}

#playView[data-experience="daily"] .learn-banner,
#playView[data-experience="checkpoint"] .learn-banner,
#playView[data-experience="replay"] .learn-banner {
  padding: 12px 16px;
  background-position: center 44%;
}

#playView[data-experience="daily"] .learn-banner :is(h1, h2),
#playView[data-experience="checkpoint"] .learn-banner :is(h1, h2),
#playView[data-experience="replay"] .learn-banner :is(h1, h2) {
  font-size: 1.75rem;
}

#playView[data-experience="daily"] .learn-banner p,
#playView[data-experience="checkpoint"] .learn-banner p,
#playView[data-experience="replay"] .learn-banner p {
  display: none;
}

#playView[data-experience="daily"] .daily-session-action,
#playView[data-experience="checkpoint"] .daily-session-action {
  min-height: 44px;
  padding: 0 14px;
  font-size: 0.84rem;
}

#playView[data-experience="replay"] .daily-session-action {
  display: none;
}

.game-stage {
  display: grid;
  min-height: 0;
  padding: clamp(14px, 2.4vw, 28px);
  overflow: auto;
  overscroll-behavior: contain;
  border-color: var(--line);
  background: var(--panel);
  box-shadow: none;
}

.game-stage:focus {
  outline: none;
}

.learn-home {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(240px, 0.75fr);
  gap: clamp(18px, 3vw, 36px);
  width: min(980px, 100%);
  height: 100%;
  margin: auto;
  align-items: stretch;
}

.daily-plan {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  padding: 8px 0;
}

.daily-plan-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 2px 0 14px;
  border-bottom: 1px solid var(--line);
}

.daily-plan-header > div {
  display: grid;
  gap: 5px;
}

.daily-plan-header h3 {
  margin: 0;
  font-size: clamp(1.8rem, 3.3vw, 3.2rem);
  line-height: 1;
}

.plan-duration {
  flex: 0 0 auto;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.daily-plan-steps {
  display: grid;
  grid-template-rows: repeat(3, minmax(0, 1fr));
  min-height: 0;
}

.daily-plan-step {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 68px;
}

.daily-plan-step:not(:last-child)::after {
  position: absolute;
  z-index: 0;
  top: calc(50% + 22px);
  bottom: calc(-50% + 22px);
  left: 20px;
  width: 2px;
  background: var(--line);
  content: "";
}

.daily-plan-step > span:last-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.daily-plan-step strong {
  font-size: 1.08rem;
}

.daily-plan-step small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.plan-index {
  position: relative;
  z-index: 1;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 7px;
  background: var(--soft-blue);
  color: var(--blue);
  font-size: 0.7rem;
  font-weight: 950;
}

.daily-plan-step[data-tone="red"] .plan-index {
  background: var(--soft-red);
  color: var(--accent);
}

.daily-plan-step[data-tone="gold"] .plan-index {
  background: color-mix(in srgb, var(--gold) 14%, var(--panel));
  color: var(--gold);
}

.quick-round-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.button-icon {
  display: none;
}

.today-reason span {
  display: grid;
  gap: 3px;
  min-width: 0;
  min-height: 62px;
  align-content: center;
  padding: 9px 10px;
  border-left: 3px solid var(--blue);
  background: var(--panel-soft);
}

.today-reason span:nth-child(2) {
  border-left-color: var(--accent);
}

.today-reason span:nth-child(3) {
  border-left-color: var(--green);
}

.today-reason strong {
  overflow: hidden;
  font-size: 0.86rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.today-reason small {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 750;
}

.memory-glance {
  display: grid;
  align-self: center;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel-soft);
}

.memory-glance-header {
  padding: 12px;
  background: var(--nav);
  color: #ffffff;
}

.memory-glance-header span,
.memory-glance-row span {
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
}

.memory-glance-header strong {
  display: block;
  margin-top: 4px;
  font-size: 1.2rem;
}

.memory-glance-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.memory-glance-row:last-child {
  border-bottom: 0;
}

.memory-glance-row span {
  color: var(--muted);
}

.memory-glance-row strong {
  font-size: 1.08rem;
}

.question-card,
.matching-card,
.round-complete,
.teach-card,
.session-message,
.session-results {
  width: min(860px, 100%);
  min-height: 0;
  margin: auto;
}

.question-card {
  grid-template-rows: minmax(180px, 1fr) auto auto;
  gap: 16px;
}

.question-card:focus {
  outline: none;
}

.prompt-area {
  gap: 9px;
}

.replay-reason {
  justify-self: center;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft-gold);
  color: var(--ink);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.russian-word {
  font-size: clamp(3.4rem, 8vw, 6.8rem);
  line-height: 0.9;
}

.translation-word {
  font-size: 1rem;
}

.sound-button {
  min-height: 44px;
  border-radius: 8px;
  box-shadow: none;
  color: var(--selection-ink);
}

.choices-grid {
  gap: 8px;
}

.choice-button {
  min-height: clamp(58px, 9vh, 78px);
  border-color: var(--line);
  background: var(--panel-soft);
  box-shadow: none;
}

.choice-button:hover {
  border-color: var(--blue);
  background: var(--soft-blue);
}

.spell-form input {
  border-color: var(--line);
  background: var(--panel-soft);
}

.sentence-builder {
  display: grid;
  gap: 10px;
}

.sentence-answer-tray,
.sentence-token-bank {
  display: flex;
  align-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 66px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.sentence-answer-tray {
  background: var(--panel-soft);
  box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--line) 70%, transparent);
}

.sentence-token-bank {
  background: transparent;
}

.sentence-token-bank:empty {
  display: none;
}

.sentence-placeholder {
  width: 100%;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  text-align: center;
}

.sentence-token {
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-weight: 850;
  box-shadow: 0 2px 0 var(--line);
  cursor: pointer;
}

.sentence-token:hover {
  border-color: var(--blue);
}

.sentence-token.is-selected {
  border-color: color-mix(in srgb, var(--blue) 58%, var(--line));
  background: var(--soft-blue);
  box-shadow: none;
}

.sentence-token:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--blue) 48%, transparent);
  outline-offset: 2px;
}

.sentence-token:disabled {
  cursor: default;
  opacity: 0.68;
}

.feedback {
  font-size: 0.9rem;
}

.teach-card {
  grid-template-rows: minmax(0, 1fr) auto auto auto;
}

.teach-main {
  gap: 8px;
}

.teach-term {
  font-size: clamp(3.4rem, 7vw, 6.2rem);
}

.teach-facts span {
  border-radius: 6px;
  background: var(--panel-soft);
}

.teach-example {
  max-width: 560px;
  padding: 10px 12px;
  border-left: 3px solid var(--gold);
  background: var(--panel-soft);
  text-align: left;
}

.teach-actions {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.matching-board {
  gap: 8px;
}

.match-card {
  border-color: var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.round-complete h2 {
  font-size: clamp(2.5rem, 6vw, 4.6rem);
}

.session-result-metrics {
  border-color: var(--line);
}

.session-result-metrics div {
  border-color: var(--line);
}

.session-results {
  place-content: center stretch;
  gap: 10px;
  max-height: 100%;
  overflow: auto;
  padding: 2px;
}

.session-result-hero {
  display: grid;
  justify-items: center;
  gap: 5px;
}

.session-result-hero h2 {
  font-size: 2rem;
}

.session-result-seal {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid color-mix(in srgb, var(--green) 52%, var(--line));
  border-radius: 50%;
  background: color-mix(in srgb, var(--green) 12%, var(--panel));
  color: var(--green);
  font-size: 1.35rem;
  font-weight: 950;
}

html:not([data-motion="reduced"]) .session-result-seal {
  animation: result-seal-arrive 360ms cubic-bezier(0.2, 0.85, 0.35, 1);
}

@keyframes result-seal-arrive {
  from {
    opacity: 0;
    transform: translateY(5px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.session-outcome-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: min(620px, 100%);
  border-block: 1px solid var(--line);
}

.session-outcome-grid div {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 10px 7px;
  border-right: 1px solid var(--line);
}

.session-outcome-grid div:last-child {
  border-right: 0;
}

.session-outcome-grid strong {
  font-size: 1.45rem;
}

.session-outcome-grid span {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  line-height: 1.15;
  text-transform: uppercase;
}

.session-result-highlights {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  width: min(680px, 100%);
}

.session-result-word {
  display: grid;
  min-width: 0;
  padding: 7px 9px;
  border-left: 3px solid var(--accent);
  background: var(--panel-soft);
  text-align: left;
}

.session-result-word[data-kind="repaired"] {
  border-left-color: var(--green);
}

.session-result-word[data-kind="new"] {
  border-left-color: var(--gold);
}

.session-result-word[data-kind="review"] {
  border-left-color: var(--accent);
}

.session-result-word span,
.session-result-word small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-result-word span {
  text-transform: uppercase;
}

.session-result-word strong {
  overflow: hidden;
  font-size: 0.94rem;
  line-height: 1.1;
  overflow-wrap: anywhere;
  white-space: normal;
}

.session-result-evidence {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px 14px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
}

.session-result-skills,
.session-result-goal {
  font-size: 0.74rem;
  font-weight: 800;
}

.session-result-goal {
  color: var(--ink) !important;
}

.session-result-actions {
  align-items: center;
}

.session-result-actions .primary-action,
.session-result-actions .ghost-button {
  min-width: 132px;
}

/* Theory */
.theory-heading,
.panel-heading,
.friend-search {
  min-height: 76px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: none;
}

.theory-heading :is(h1, h2),
.panel-heading :is(h1, h2) {
  color: var(--ink);
  font-size: clamp(1.8rem, 3vw, 2.6rem);
}

.theory-segments {
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.theory-segment {
  border: 0;
  min-height: 44px;
}

.theory-segment.active {
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(17, 35, 24, 0.08);
}

.theory-workspace {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: none;
}

.theory-browser {
  background: var(--panel-soft);
}

.theory-search input {
  border-color: var(--line);
}

.theory-list-item {
  border-color: transparent;
  border-radius: 8px;
  background: transparent;
}

.theory-list-item:hover {
  background: var(--panel);
}

.theory-list-item.selected {
  border-color: var(--line);
  background: var(--panel);
  box-shadow: 0 5px 16px rgba(18, 38, 25, 0.07);
}

.theory-list-index {
  border-radius: 7px;
  background: var(--nav);
}

.theory-detail {
  background: var(--panel);
}

.theory-hero {
  border-left: 5px solid var(--blue);
  background: var(--soft-blue);
}

.theory-hero h2 {
  font-size: clamp(2.25rem, 5vw, 4.4rem);
}

.theory-highlights {
  background: var(--panel-soft);
}

.theory-highlights div,
.theory-example,
.theory-check-option {
  border-radius: 8px;
  background: var(--panel);
}

.theory-trap {
  border-left: 5px solid var(--accent);
  background: var(--soft-red);
}

.theory-check {
  background: var(--panel-soft);
}

.theory-check-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.theory-application-strength {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

/* Progress */
.dashboard-grid,
.friends-grid,
.settings-grid {
  gap: 10px;
}

.dashboard-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-content: start;
  padding: 0 1px 2px;
}

.metric-card,
.list-card,
.mini-card,
.friend-search {
  border-color: var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: none;
}

.metric-card {
  grid-column: span 3;
  position: relative;
  min-height: 124px;
  padding: 16px;
  overflow: hidden;
  border-top: 4px solid var(--blue);
}

.metric-card:nth-child(2) {
  border-top-color: var(--green);
}

.metric-card:nth-child(3) {
  border-top-color: var(--gold);
}

.metric-card:nth-child(4) {
  border-top-color: var(--line-strong);
}

.metric-card strong {
  font-size: clamp(2rem, 4vw, 3.4rem);
}

.metric-card small {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 750;
}

.dashboard-grid .list-card {
  grid-column: span 6;
  min-height: 150px;
}

.dashboard-grid .list-card.wide {
  grid-column: span 12;
  min-height: 130px;
}

.list-card {
  padding: 16px;
}

.list-card h3 {
  font-size: 1.05rem;
}

.list-card li {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.list-card li:last-child {
  border-bottom: 0;
}

.list-card li span {
  white-space: normal;
}

.category-progress-list li {
  display: grid;
  grid-template-columns: minmax(100px, 0.6fr) minmax(120px, 1.4fr) auto;
}

.progress-track {
  width: 100%;
  height: 7px;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 999px;
  appearance: none;
  background: var(--panel-soft);
}

.progress-track::-webkit-progress-bar {
  border-radius: inherit;
  background: var(--panel-soft);
}

.progress-track::-webkit-progress-value {
  border-radius: inherit;
  background: var(--green);
}

.progress-track::-moz-progress-bar {
  border-radius: inherit;
  background: var(--green);
}

/* Friends */
.friends-grid {
  grid-template-rows: auto minmax(0, 1fr);
}

.friend-search {
  align-items: center;
}

.friend-search > label {
  color: var(--ink);
  font-size: 1rem;
  text-transform: none;
}

.inline-form input {
  border-color: var(--line);
  background: var(--panel-soft);
}

.friends-stage {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.friends-stage .list-card {
  min-height: 170px;
}

.person-row {
  display: grid !important;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 10px !important;
}

.person-avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--nav);
  color: #ffffff;
  font-weight: 950;
}

/* Settings */
.settings-grid {
  grid-template-columns: minmax(320px, 1.5fr) minmax(220px, 1fr);
  grid-template-rows: minmax(172px, auto) minmax(196px, auto);
  grid-auto-rows: max-content;
  align-content: start;
}

.settings-preferences {
  grid-row: span 2;
}

.settings-world-preview {
  min-height: 132px;
  margin: -16px -16px 6px;
  border-bottom: 1px solid var(--line);
  background-image: var(--course-image);
  background-position: center;
  background-size: cover;
}

.settings-card {
  gap: 12px;
}

.settings-feedback {
  min-height: 196px;
}

.settings-goal {
  min-height: 172px;
}

.settings-offline {
  min-height: 164px;
}

.settings-account {
  min-height: 280px;
}

.settings-legal {
  min-height: 194px;
}

.settings-status {
  min-height: 40px;
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.45;
}

.settings-offline progress {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border: 0;
  border-radius: 4px;
  accent-color: var(--accent);
}

.settings-offline progress[hidden] {
  display: none;
}

.settings-sync-summary > .sync-status-dot {
  width: 10px;
  height: 10px;
}

.settings-sync-summary > .sync-status-dot[data-state="synced"] {
  background: var(--green);
}

.settings-sync-summary > .sync-status-dot[data-state="offline"],
.settings-sync-summary > .sync-status-dot[data-state="pending"] {
  background: var(--gold);
}

.settings-sync-summary > .sync-status-dot[data-state="attention"] {
  background: var(--accent);
}

.settings-sync-summary > .sync-status-dot[data-state="syncing"] {
  background: var(--blue);
}

.settings-account,
.settings-legal {
  min-height: 0;
}

.practice-summary {
  grid-column: 1 / -1;
}

@media (min-width: 1250px) {
  .settings-grid {
    grid-template-columns:
      minmax(340px, 1.5fr)
      minmax(220px, 1fr)
      minmax(220px, 1fr);
    grid-template-rows: 196px auto 194px;
  }

  .settings-preferences {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .settings-goal {
    grid-column: 2;
    grid-row: 1;
  }

  .settings-feedback {
    grid-column: 3;
    grid-row: 1;
  }

  .settings-offline {
    grid-column: 2;
    grid-row: 2;
  }

  .settings-account {
    grid-column: 3;
    grid-row: 2 / span 2;
  }

  .settings-legal {
    grid-column: 1;
    grid-row: 3;
  }

  .practice-summary {
    align-self: start;
    grid-column: 2;
    grid-row: 3;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .practice-summary .practice-metrics span {
    display: grid;
    align-content: center;
    justify-content: start;
    gap: 0;
    padding: 7px;
    font-size: 0.68rem;
  }
}

.settings-row {
  min-height: 58px;
  border-bottom: 1px solid var(--line);
}

.settings-row select {
  min-height: 44px;
}

.settings-row:last-child {
  border-bottom: 0;
}

.settings-toggle-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.settings-toggle-row:last-child {
  border-bottom: 0;
}

.settings-toggle-row > span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.settings-toggle-row strong {
  color: var(--ink);
  font-size: 0.86rem;
}

.settings-toggle-row small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.35;
}

.settings-toggle-row input {
  position: relative;
  width: 44px;
  height: 24px;
  min-height: 24px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  appearance: none;
  background: var(--panel-soft);
  cursor: pointer;
}

.settings-toggle-row input::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--muted);
  content: "";
  transition: transform 150ms ease, background-color 150ms ease;
}

.settings-toggle-row input:checked {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 22%, var(--panel));
}

.settings-toggle-row input:checked::after {
  background: var(--accent);
  transform: translateX(20px);
}

.settings-toggle-row input:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent);
  outline-offset: 2px;
}

.settings-link-list a {
  border-color: var(--line);
  background: var(--panel-soft);
}

.confirm-dialog {
  max-height: calc(100dvh - 28px - var(--safe-top) - var(--safe-bottom));
  overflow: auto;
  border-color: var(--line);
  border-radius: 8px;
  overscroll-behavior: contain;
}

.recovery-codes-dialog {
  width: min(600px, calc(100% - 28px));
}

.recovery-codes-surface {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.recovery-codes-surface h2,
.recovery-codes-surface p {
  margin: 0;
}

.recovery-codes-surface > p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.5;
}

.recovery-code-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.recovery-code {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

.recovery-code:nth-child(odd) {
  border-right: 1px solid var(--line);
}

.recovery-code:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.recovery-code span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  text-align: right;
}

.recovery-code code {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
}

.recovery-confirmation {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 8px 10px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.8rem;
  line-height: 1.35;
  text-transform: none;
}

.recovery-confirmation input {
  width: 22px;
  height: 22px;
  min-height: 22px;
  margin: 0;
  padding: 0;
  accent-color: var(--accent);
}

/* Tablet shell */
@media (max-width: 1040px) {
  .app-shell {
    grid-template-columns: 184px minmax(0, 1fr);
  }

  .app-topbar {
    padding-right: 10px;
    padding-left: 10px;
  }

  .app-view {
    padding-right: 16px;
    padding-left: 16px;
  }

  .learn-banner::before {
    width: 64%;
  }

  .learn-banner-copy {
    width: 57%;
  }

  .toolbar {
    grid-template-columns: minmax(130px, 0.75fr) minmax(140px, 1fr) minmax(130px, 0.8fr) auto;
  }
}

/* Mobile and compact tablet */
@media (max-width: 780px) {
  #playView[data-experience="home"] {
    grid-template-rows: 96px minmax(0, 1fr);
  }

  .auth-screen {
    padding:
      calc(12px + var(--safe-top))
      calc(12px + var(--safe-right))
      calc(12px + var(--safe-bottom))
      calc(12px + var(--safe-left));
  }

  .auth-world-dutch {
    display: none;
  }

  .auth-world-russian {
    background-position: 55% center;
  }

  .auth-panel {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    width: min(480px, 100%);
    margin: auto;
  }

  .auth-copy {
    gap: 8px;
    width: 100%;
    padding: 16px;
    border-left-width: 4px;
  }

  .auth-copy .brand {
    margin-bottom: 2px;
  }

  .auth-copy .brand img {
    width: 34px;
    height: 34px;
  }

  .auth-copy h1 {
    font-size: clamp(2.35rem, 12vw, 4.2rem);
  }

  .auth-copy p:not(.eyebrow) {
    display: none;
  }

  .auth-signals span:nth-child(3) {
    display: none;
  }

  .account-card {
    padding: 15px;
    backdrop-filter: none;
  }

  .account-heading h2 {
    font-size: 1.35rem;
  }

  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 0;
    padding: 0 0 calc(64px + var(--safe-bottom));
  }

  .app-topbar {
    grid-column: 1;
    grid-row: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-height: calc(58px + var(--safe-top));
    padding:
      calc(8px + var(--safe-top))
      calc(10px + var(--safe-right))
      8px
      calc(10px + var(--safe-left));
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .app-topbar .brand {
    min-height: 44px;
    padding: 0;
  }

  .app-topbar .brand img {
    width: 32px;
    height: 32px;
  }

  .app-topbar .brand small {
    display: none;
  }

  .view-tabs {
    position: fixed;
    z-index: 30;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    gap: 2px;
    width: 100%;
    min-height: calc(58px + var(--safe-bottom));
    padding:
      6px
      calc(6px + var(--safe-right))
      calc(6px + var(--safe-bottom))
      calc(6px + var(--safe-left));
    border-top: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 0;
    background: var(--nav);
    box-shadow: 0 -8px 24px rgba(7, 16, 10, 0.22);
  }

  .view-tab {
    flex: 1;
    justify-content: center;
    min-height: 44px;
    padding: 0 3px;
    font-size: 0.68rem;
    text-align: center;
  }

  .user-area {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: auto;
    margin: 0;
  }

  .sync-status {
    justify-content: center;
    width: 36px;
    min-height: 44px;
    padding: 0;
  }

  .sync-status > span:last-child {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .sidebar-label,
  .app-topbar #logoutButton {
    display: none;
  }

  .user-pill {
    grid-template-columns: 30px;
    width: 44px;
    max-width: 44px;
    min-height: 44px;
    padding: 2px;
    font-size: 0.75rem;
  }

  .user-meta {
    display: none;
  }

  .app-topbar #installButton {
    width: auto;
    min-height: 44px;
    padding: 0 9px;
  }

  .app-view {
    grid-column: 1;
    grid-row: 2;
    padding: 9px;
  }

  .play-shell {
    grid-template-rows: 96px auto minmax(0, 1fr);
    gap: 8px;
  }

  .learn-banner {
    padding: 12px;
    background-position: center;
  }

  .learn-banner::before {
    width: 72%;
  }

  .learn-banner-copy {
    width: 62%;
  }

  .learn-banner :is(h1, h2) {
    font-size: 1.7rem;
  }

  .learn-banner p {
    display: none;
  }

  .learn-banner .daily-session-action {
    min-height: 44px;
    padding: 0 10px;
    font-size: 0.78rem;
  }

  .toolbar {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    min-height: 56px;
    gap: 6px;
    padding: 7px;
  }

  .quick-practice-copy {
    display: none;
  }

  #playView[data-experience="quick"] .toolbar {
    grid-template-columns: 40px minmax(0, 1fr) minmax(0, 1fr) auto;
  }

  #playView[data-experience="quick"] .quick-practice-copy {
    display: flex;
  }

  .toolbar .control-group label {
    display: none;
  }

  .toolbar select,
  .toolbar .quick-round-action {
    min-height: 44px;
  }

  .play-board {
    gap: 6px;
  }

  .stats {
    min-height: 42px;
  }

  .stats div {
    min-height: 42px;
    gap: 5px;
    padding: 5px;
  }

  .stats span {
    font-size: 0.58rem;
  }

  .stats strong {
    font-size: 1rem;
  }

  #playView[data-experience="daily"],
  #playView[data-experience="checkpoint"],
  #playView[data-experience="replay"] {
    grid-template-rows: 56px minmax(0, 1fr);
  }

  #playView[data-experience="daily"] .learn-banner,
  #playView[data-experience="checkpoint"] .learn-banner,
  #playView[data-experience="replay"] .learn-banner {
    padding: 8px 10px;
  }

  #playView[data-experience="daily"] .learn-banner::before,
  #playView[data-experience="checkpoint"] .learn-banner::before,
  #playView[data-experience="replay"] .learn-banner::before {
    width: 66%;
  }

  #playView[data-experience="daily"] .learn-banner .eyebrow,
  #playView[data-experience="checkpoint"] .learn-banner .eyebrow,
  #playView[data-experience="replay"] .learn-banner .eyebrow {
    display: none;
  }

  #playView[data-experience="daily"] .learn-banner :is(h1, h2),
  #playView[data-experience="checkpoint"] .learn-banner :is(h1, h2),
  #playView[data-experience="replay"] .learn-banner :is(h1, h2) {
    font-size: 1.3rem;
  }

  #playView[data-experience="daily"] .learn-banner-actions,
  #playView[data-experience="checkpoint"] .learn-banner-actions,
  #playView[data-experience="replay"] .learn-banner-actions {
    gap: 4px;
  }

  #playView[data-experience="daily"] .daily-home-action,
  #playView[data-experience="checkpoint"] .daily-home-action,
  #playView[data-experience="replay"] .daily-home-action {
    width: 44px;
    min-height: 44px;
    padding: 0;
    overflow: hidden;
    color: transparent;
    font-size: 0;
  }

  #playView[data-experience="daily"] .daily-home-action::before,
  #playView[data-experience="checkpoint"] .daily-home-action::before,
  #playView[data-experience="replay"] .daily-home-action::before {
    color: #ffffff;
    content: "\2190";
    font-size: 1rem;
  }

  .game-stage {
    padding: 10px;
  }

  .learn-home {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 10px;
    align-content: stretch;
  }

  .daily-plan {
    padding: 2px 2px 0;
  }

  .daily-plan-header {
    padding-bottom: 8px;
  }

  .daily-plan-header h3 {
    font-size: clamp(1.45rem, 7vw, 2rem);
  }

  .daily-plan-step {
    min-height: 54px;
  }

  .theory-hero h2 {
    font-size: clamp(1.85rem, 8vw, 2.7rem);
    line-height: 1;
  }

  .metric-card {
    min-height: 94px;
  }

  .metric-card strong {
    font-size: 2rem;
  }

  .today-reason span {
    min-height: 54px;
    padding: 7px 8px;
  }

  .memory-glance {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .memory-glance-header {
    grid-column: 1 / -1;
    padding: 9px 10px;
  }

  .memory-glance-row {
    display: grid;
    gap: 3px;
    min-height: 54px;
    padding: 7px 8px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .memory-glance-row:last-child {
    border-right: 0;
  }

  .question-card {
    grid-template-rows: minmax(110px, 1fr) auto auto;
    gap: 9px;
  }

  .russian-word {
    font-size: clamp(2.55rem, 15vw, 4.6rem);
  }

  .choices-grid {
    gap: 7px;
  }

  .choice-button {
    min-height: 52px;
  }

  .theory-heading,
  .panel-heading,
  .friend-search {
    min-height: 62px;
    padding: 10px 11px;
  }

  .theory-heading {
    grid-template-columns: 1fr;
  }

  .theory-heading-copy {
    display: none;
  }

  .theory-segments {
    width: 100%;
  }

  .theory-workspace {
    grid-template-columns: 1fr;
  }

  .theory-list-item {
    background: var(--panel);
  }

  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-card {
    grid-column: span 1;
    min-height: 106px;
  }

  .dashboard-grid .list-card,
  .dashboard-grid .list-card.wide {
    grid-column: 1 / -1;
    min-height: 124px;
  }

  .friends-stage {
    grid-template-columns: 1fr;
  }

  .settings-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    grid-auto-rows: max-content;
    align-content: start;
  }

  .settings-grid .list-card,
  .settings-preferences,
  .settings-account,
  .settings-legal,
  .practice-summary {
    grid-column: 1;
    grid-row: auto;
    overflow: visible;
  }

  .settings-preferences {
    min-height: 286px;
  }

  .settings-world-preview {
    min-height: 96px;
  }

  .settings-account {
    min-height: 0;
  }

  .recovery-codes-surface {
    gap: 10px;
    padding: 12px;
  }
}

@media (max-width: 520px) {
  #playView[data-experience="home"] {
    grid-template-rows: 86px minmax(0, 1fr);
  }

  .account-heading .eyebrow {
    display: none;
  }

  .auth-tabs {
    margin-top: -2px;
  }

  .recovery-code-grid {
    grid-template-columns: 1fr;
  }

  .recovery-code,
  .recovery-code:nth-child(odd),
  .recovery-code:nth-last-child(-n + 2) {
    min-height: 34px;
    padding: 4px 8px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .recovery-code:last-child {
    border-bottom: 0;
  }

  .recovery-code code {
    font-size: 0.76rem;
  }

  .play-shell {
    grid-template-rows: 86px auto minmax(0, 1fr);
  }

  .learn-banner {
    padding: 10px;
  }

  .learn-banner-copy {
    width: 58%;
  }

  .learn-banner .eyebrow {
    font-size: 0.6rem;
  }

  .learn-banner :is(h1, h2) {
    font-size: 1.45rem;
  }

  .learn-banner .daily-session-action {
    width: 104px;
    white-space: normal;
  }

  .quick-round-action .button-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .quick-round-action .button-icon {
    display: inline;
    font-size: 0.86rem;
  }

  .quick-round-action {
    width: 44px;
    padding: 0;
  }

  .daily-plan-header h3 {
    font-size: 1.45rem;
  }

  .daily-plan-step {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 9px;
  }

  .plan-index {
    width: 38px;
    height: 38px;
  }

  .daily-plan-step:not(:last-child)::after {
    top: calc(50% + 20px);
    bottom: calc(-50% + 20px);
    left: 18px;
  }

  .daily-plan-step small {
    font-size: 0.68rem;
  }

  .today-reason {
    gap: 4px;
  }

  .today-reason span {
    border-left-width: 2px;
  }

  .today-reason strong {
    font-size: 0.75rem;
  }

  .today-reason small {
    font-size: 0.61rem;
  }

  .memory-glance-header strong {
    font-size: 1rem;
  }

  .memory-glance-row strong {
    font-size: 0.95rem;
  }

  .metric-card,
  .list-card,
  .mini-card {
    padding: 12px;
  }

  .panel-heading :is(h1, h2) {
    font-size: 1.75rem;
    line-height: 1.05;
  }

  .category-progress-list li {
    grid-template-columns: minmax(86px, 0.65fr) minmax(76px, 1fr) auto;
  }

  .settings-world-preview {
    margin: -12px -12px 4px;
  }

  .session-result-highlights {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .session-results {
    gap: 7px;
  }

  .session-result-hero h2 {
    font-size: 1.65rem;
  }

  .session-result-seal {
    display: none;
  }
}

@media (max-width: 360px) {
  .user-pill {
    max-width: 44px;
  }

  .view-tab {
    font-size: 0.62rem;
  }

  .learn-banner-copy {
    width: 54%;
  }

  .learn-banner .daily-session-action {
    width: 96px;
    padding: 0 7px;
    font-size: 0.72rem;
  }

  .toolbar {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.86fr) 88px;
  }

  .today-reason small {
    display: none;
  }
}

@media (max-width: 780px) and (max-height: 680px) {
  .auth-screen {
    align-items: start;
  }

  .auth-copy {
    display: none;
  }

  .account-card {
    align-self: start;
  }

  .app-shell {
    padding-bottom: calc(56px + var(--safe-bottom));
  }

  .app-topbar {
    min-height: calc(48px + var(--safe-top));
    padding-top: calc(5px + var(--safe-top));
    padding-bottom: 5px;
  }

  .view-tabs {
    min-height: calc(52px + var(--safe-bottom));
    padding-top: 4px;
  }

  .view-tab {
    min-height: 44px;
  }

  .app-view {
    padding: 6px;
  }

  .play-shell {
    grid-template-rows: 68px auto minmax(0, 1fr);
    gap: 5px;
  }

  .learn-banner {
    padding: 7px 9px;
  }

  .learn-banner :is(h1, h2) {
    font-size: 1.2rem;
  }

  .learn-banner .daily-session-action {
    min-height: 44px;
  }

  .toolbar {
    min-height: 44px;
    padding: 4px;
  }

  .toolbar select,
  .toolbar .quick-round-action {
    min-height: 44px;
  }

  #playView[data-experience="daily"],
  #playView[data-experience="checkpoint"],
  #playView[data-experience="replay"] {
    grid-template-rows: 44px minmax(0, 1fr);
  }

  #playView[data-experience="quick"] {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .stats,
  .stats div {
    min-height: 34px;
  }

  .game-stage {
    padding: 7px;
  }

  .learn-home {
    grid-template-columns: 1fr;
    gap: 7px;
    align-content: start;
  }

  .daily-plan-header h3 {
    font-size: 1.25rem;
  }

  .daily-plan-step {
    min-height: 43px;
  }

  .daily-plan-step small {
    display: none;
  }

  .memory-glance {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .memory-glance-header {
    grid-column: 1 / -1;
  }

  .memory-glance-row {
    display: grid;
    min-height: 40px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .memory-glance-row:last-child {
    border-right: 0;
  }

  .russian-word {
    font-size: 2.2rem;
  }

  .choice-button {
    min-height: 44px;
  }

  .session-result-hero h2 {
    font-size: 1.55rem;
  }

  .session-result-seal {
    display: none;
  }

  .session-result-highlights {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .session-outcome-grid strong {
    font-size: 1.2rem;
  }

  .session-result-actions .primary-action,
  .session-result-actions .ghost-button {
    min-width: 112px;
  }

  .theory-heading,
  .panel-heading,
  .friend-search {
    min-height: 48px;
    padding: 6px 8px;
  }
}

/* Let the desktop route feel like a destination, rather than a small card
   stranded at the top of the fixed-height learning canvas. */
@media (min-width: 781px) and (min-height: 700px) {
  #playView[data-experience="home"] .learn-home {
    align-items: stretch;
  }

  #playView[data-experience="home"] .arcade-world {
    grid-template-rows: clamp(146px, 20vh, 196px) auto 8px minmax(0, 1fr) auto;
    min-height: 0;
  }

  #playView[data-experience="home"] .world-art {
    min-height: clamp(146px, 20vh, 196px);
  }

  #playView[data-experience="home"] .world-nodes {
    align-content: space-evenly;
  }

  #playView[data-experience="home"] .path-memory-glance {
    grid-template-rows: auto 8px auto minmax(0, 1fr) auto;
    align-self: stretch;
  }

  #playView[data-experience="home"] .home-goal-progress {
    align-self: center;
  }

  #playView[data-experience="home"] .memory-lane-grid.compact {
    align-content: stretch;
  }

  #playView[data-experience="home"] .memory-lane-grid.compact .memory-lane {
    min-height: 0;
    align-content: center;
  }
}

.story-arcade .practice-hub-header {
  align-items: flex-start;
}

.story-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.story-card {
  text-align: left;
}

.story-card em {
  justify-self: end;
  color: var(--accent, #0d7a5f);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 800;
}

.story-player {
  max-width: 760px;
}

.story-moments {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.story-moment {
  align-items: center;
  background: var(--panel-muted, rgba(0, 0, 0, 0.04));
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 12px;
}

.story-moment div {
  display: grid;
  gap: 3px;
}

.story-moment span,
.story-options small {
  color: var(--muted);
}

.story-options {
  grid-template-columns: 1fr;
}

.story-outcome {
  background: var(--panel-muted, rgba(0, 0, 0, 0.04));
  display: grid;
  gap: 7px;
  margin-top: 14px;
  padding: 14px;
}

.story-outcome p { margin: 0; }

.story-outcome .ghost-button { justify-self: start; }

.sound-studio {
  max-width: 720px;
}

.sound-studio-note,
.sound-studio-prompt span,
.sound-studio-prompt small {
  color: var(--muted);
}

.sound-studio-prompt {
  background: var(--panel-muted, rgba(0, 0, 0, 0.04));
  display: grid;
  gap: 5px;
  margin: 16px 0;
  padding: 18px;
}

.sound-studio-prompt strong {
  font-size: 1.5rem;
}

.sound-studio-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.sound-studio-actions .secondary-action,
.sound-studio-actions .primary-action {
  align-items: center;
  display: inline-flex;
  gap: 7px;
}

.sound-studio-actions svg {
  height: 18px;
  width: 18px;
}

.sound-studio-recording {
  align-items: center;
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.sound-studio-recording audio {
  flex: 1;
  max-width: 430px;
}

@media (max-width: 620px) {
  .sound-studio-actions > * { flex: 1 1 100%; }
  .sound-studio-recording { align-items: stretch; flex-direction: column; }
  .sound-studio-recording audio { max-width: none; width: 100%; }
}

@media (max-width: 620px) {
  .story-grid { grid-template-columns: 1fr; }
}

html[data-motion="reduced"] *,
html[data-motion="reduced"] *::before,
html[data-motion="reduced"] *::after {
  scroll-behavior: auto !important;
  transition-duration: 0.001ms !important;
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Course path and Memory Map */
#playView[data-experience="home"] .game-stage {
  overflow: hidden;
}

.course-path-home {
  display: grid;
  grid-template-rows: auto 8px auto auto;
  align-content: center;
  gap: 12px;
  min-width: 0;
  min-height: 0;
  padding: 4px 0;
}

.arcade-world {
  position: relative;
  --world-accent: var(--blue);
  --world-image: var(--course-image);
  --world-position: center;
  grid-template-rows: 112px auto 8px auto auto;
  align-content: start;
  gap: 10px;
  padding: 0 0 4px;
}

.arcade-world[data-world-position="left"] {
  --world-position: left;
}

.arcade-world[data-world-position="right"] {
  --world-position: right;
}

.arcade-world:is(
  [data-world-motif="food"],
  [data-world-motif="weather"],
  [data-world-motif="service"]
) {
  --world-accent: var(--gold);
}

.arcade-world:is(
  [data-world-motif="health"],
  [data-world-motif="safety"],
  [data-world-motif="social"]
) {
  --world-accent: var(--accent);
}

.arcade-world:is(
  [data-world-motif="home"],
  [data-world-motif="routine"],
  [data-world-motif="planning"]
) {
  --world-accent: var(--green);
}

.world-art {
  position: relative;
  min-height: 112px;
  overflow: hidden;
  border-radius: 8px;
  background-image: var(--world-image);
  background-position: var(--world-position) center;
  background-size: cover;
  box-shadow: inset 0 -4px 0 var(--world-accent);
}

.world-art::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--world-accent) 38%, transparent),
    transparent 70%
  );
  content: "";
}

.world-header .eyebrow {
  color: var(--world-accent);
}

.world-header h3 {
  font-size: 2.35rem;
}

.world-header p {
  max-width: 640px;
  line-height: 1.45;
}

.world-progress-label {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  place-items: center;
  border: 2px solid var(--world-accent);
  border-radius: 50%;
  color: var(--world-accent);
  font-size: 0.76rem;
  font-weight: 950;
}

.arcade-world .course-path-progress::-webkit-progress-value {
  background: var(--world-accent);
}

.arcade-world .course-path-progress::-moz-progress-bar {
  background: var(--world-accent);
}

.world-nodes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.world-nodes .lesson-path-row {
  min-height: 62px;
}

.world-nodes .world-checkpoint {
  grid-column: 1 / -1;
  border-style: dashed;
}

button.world-checkpoint {
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

button.world-checkpoint:hover {
  border-color: var(--blue);
  background: color-mix(in srgb, var(--soft-blue) 76%, var(--panel));
}

button.world-checkpoint:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--blue) 45%, transparent);
  outline-offset: 2px;
}

.arcade-world[data-feedback-motion="world-focus"] .lesson-path-row[data-state="current"] .lesson-path-node {
  animation: world-focus 1.8s ease-in-out infinite;
}

@keyframes world-focus {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}

.course-path-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.course-path-header > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.course-path-header h3,
.course-path-header p {
  margin: 0;
}

.course-path-header h3 {
  overflow-wrap: anywhere;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 0.96;
}

.course-path-header p {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.path-level {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 950;
}

.course-path-progress {
  width: 100%;
  height: 8px;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 999px;
  appearance: none;
  background: var(--panel-soft);
}

.course-path-progress::-webkit-progress-bar {
  border-radius: inherit;
  background: var(--panel-soft);
}

.course-path-progress::-webkit-progress-value {
  border-radius: inherit;
  background: var(--green);
}

.course-path-progress::-moz-progress-bar {
  border-radius: inherit;
  background: var(--green);
}

.lesson-path {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
  min-height: 0;
}

.lesson-path-row {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-width: 0;
  min-height: 58px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.lesson-path-row[data-state="current"] {
  border-color: color-mix(in srgb, var(--blue) 44%, var(--line));
  background: var(--soft-blue);
  box-shadow: inset 4px 0 0 var(--blue);
}

.lesson-path-row[data-state="complete"] {
  background: var(--soft-green);
}

.lesson-path-row[data-state="locked"] {
  color: var(--muted);
}

.lesson-path-node {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: var(--nav);
  color: #ffffff;
  font-size: 0.76rem;
  font-weight: 950;
}

.lesson-path-row[data-state="complete"] .lesson-path-node {
  background: var(--green);
}

.lesson-path-row[data-state="locked"] .lesson-path-node {
  background: var(--line-strong);
}

.lesson-path-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.lesson-path-copy strong {
  overflow: hidden;
  font-size: 0.94rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lesson-path-copy small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 750;
}

.lesson-path-state,
.weak-word-state {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 950;
  text-transform: uppercase;
}

.lesson-path-row[data-state="current"] .lesson-path-state {
  color: var(--blue);
}

.lesson-path-row[data-state="complete"] .lesson-path-state {
  color: var(--green);
}

.course-path-next {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.course-path-next span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
}

.course-path-next strong {
  min-width: 0;
  overflow: hidden;
  font-size: 0.82rem;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.path-empty {
  display: grid;
  min-height: 100px;
  place-items: center;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.path-memory-glance {
  display: grid;
  align-self: center;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel-soft);
}

.path-memory-glance > header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  background: var(--nav);
  color: #ffffff;
}

.path-memory-glance > header > div {
  display: grid;
  gap: 3px;
}

.path-memory-glance > header .eyebrow {
  color: #ffd16c;
}

.path-memory-glance > header strong {
  font-size: 1.12rem;
}

.path-memory-glance > header > span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.68rem;
  font-weight: 850;
}

.memory-lane-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.memory-lane-grid.compact {
  grid-template-columns: 1fr;
  border: 0;
  border-radius: 0;
}

.memory-lane {
  display: grid;
  gap: 4px;
  min-width: 0;
  min-height: 92px;
  align-content: center;
  padding: 12px;
  border-top: 4px solid var(--line-strong);
  border-right: 1px solid var(--line);
}

.memory-lane:last-child {
  border-right: 0;
}

.memory-lane[data-lane="learning"] {
  border-top-color: var(--blue);
}

.memory-lane[data-lane="strong"] {
  border-top-color: var(--green);
}

.memory-lane[data-lane="due"] {
  border-top-color: var(--gold);
}

.memory-lane[data-lane="confused"] {
  border-top-color: var(--accent);
}

.memory-lane span,
.memory-lane small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memory-lane span {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 950;
  text-transform: uppercase;
}

.memory-lane strong {
  font-size: clamp(1.45rem, 3vw, 2.3rem);
  line-height: 1;
}

.memory-lane small {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 700;
}

.memory-lane-grid.compact .memory-lane {
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 44px;
  gap: 10px;
  padding: 8px 11px;
  border-top: 0;
  border-right: 0;
  border-bottom: 1px solid var(--line);
  border-left: 4px solid var(--line-strong);
}

.memory-lane-grid.compact .memory-lane:last-child {
  border-bottom: 0;
}

.memory-lane-grid.compact .memory-lane[data-lane="learning"] {
  border-left-color: var(--blue);
}

.memory-lane-grid.compact .memory-lane[data-lane="strong"] {
  border-left-color: var(--green);
}

.memory-lane-grid.compact .memory-lane[data-lane="due"] {
  border-left-color: var(--gold);
}

.memory-lane-grid.compact .memory-lane[data-lane="confused"] {
  border-left-color: var(--accent);
}

.memory-lane-grid.compact .memory-lane strong {
  font-size: 1.05rem;
}

.memory-map-link {
  min-height: 44px;
  padding: 0 11px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel);
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 950;
}

.memory-map-link:hover,
.memory-map-link:focus-visible {
  background: var(--soft-blue);
}

.memory-home-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.memory-home-actions.has-replay {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.memory-home-actions .memory-map-link {
  border-top: 0;
  border-right: 1px solid var(--line);
}

.replay-home-action {
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  background: var(--panel);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 950;
}

.replay-home-action:hover,
.replay-home-action:focus-visible {
  background: var(--soft-red);
}

.replay-home-action:disabled {
  color: var(--muted);
  cursor: default;
  opacity: 0.65;
}

@media (max-width: 780px) {
  .memory-home-actions.has-replay :is(.memory-map-link, .replay-home-action) {
    min-height: 42px;
    padding: 4px 5px;
    font-size: 0.62rem;
    line-height: 1.1;
    overflow-wrap: anywhere;
  }
}

.memory-map-panel {
  display: grid;
  grid-column: 1 / -1;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  min-height: 170px;
}

.dashboard-grid {
  grid-auto-rows: max-content;
}

.memory-map-panel > header,
.dashboard-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.memory-map-panel > header > div,
.dashboard-section-heading > div {
  display: grid;
  gap: 3px;
}

.memory-map-panel h3,
.dashboard-section-heading h3 {
  margin: 0;
  font-size: 1.15rem;
}

.memory-map-panel > header > strong,
.dashboard-section-heading > strong {
  flex: 0 0 auto;
  color: var(--blue);
  font-size: 1.1rem;
}

.memory-map-panel button.memory-lane {
  width: 100%;
  border-bottom: 0;
  border-left: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.memory-map-panel button.memory-lane:hover,
.memory-map-panel button.memory-lane:focus-visible,
.memory-map-panel button.memory-lane.active {
  background: var(--panel-soft);
}

.memory-map-panel button.memory-lane.active {
  box-shadow: inset 0 -3px 0 var(--blue);
}

.memory-browser {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  min-height: 0;
}

.memory-browser-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.memory-browser-heading small,
.recall-trend-panel footer {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 750;
}

.memory-item-list {
  display: grid;
  max-height: 260px;
  overflow: auto;
  border-block: 1px solid var(--line);
}

.memory-item-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(100px, 0.45fr);
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 8px 4px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.memory-item-row:hover,
.memory-item-row:focus-visible {
  background: var(--panel-soft);
}

.memory-item-row > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.memory-item-row > span:last-child {
  text-align: right;
}

.memory-item-row small,
.memory-item-empty,
.memory-detail-empty {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 750;
}

.memory-item-empty {
  display: grid;
  min-height: 72px;
  place-items: center;
}

.recall-trend-panel {
  grid-column: 1 / -1 !important;
  gap: 12px;
}

.recall-trend {
  display: grid;
  grid-template-columns: repeat(7, minmax(34px, 1fr));
  gap: 6px;
  min-height: 118px;
  align-items: end;
}

.recall-day {
  display: grid;
  justify-items: center;
  gap: 3px;
  min-width: 0;
}

.recall-bar {
  display: flex;
  width: min(28px, 70%);
  height: 74px;
  flex-direction: column-reverse;
  justify-content: flex-start;
  overflow: hidden;
  border-radius: 4px 4px 2px 2px;
  background: var(--panel-soft);
}

.recall-bar-good {
  width: 100%;
  background: var(--green);
}

.recall-bar-missed {
  width: 100%;
  background: var(--gold);
}

.recall-height-0 { height: 0; }
.recall-height-1 { height: 7px; }
.recall-height-2 { height: 14px; }
.recall-height-3 { height: 22px; }
.recall-height-4 { height: 29px; }
.recall-height-5 { height: 36px; }
.recall-height-6 { height: 43px; }
.recall-height-7 { height: 50px; }
.recall-height-8 { height: 58px; }
.recall-height-9 { height: 65px; }
.recall-height-10 { height: 72px; }

.recall-day strong {
  font-size: 0.76rem;
}

.recall-day small {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 850;
}

.memory-detail-dialog {
  width: min(620px, calc(100% - 24px));
  max-height: min(760px, calc(100dvh - 24px));
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.memory-detail-dialog::backdrop {
  background: rgba(9, 11, 15, 0.62);
}

.memory-detail-shell {
  position: relative;
  display: grid;
  gap: 16px;
  max-height: min(760px, calc(100dvh - 24px));
  padding: 22px;
  overflow: auto;
}

.memory-detail-shell section {
  display: grid;
  gap: 10px;
}

.memory-detail-shell h2,
.memory-detail-shell h3,
.memory-detail-shell p {
  margin: 0;
}

.memory-detail-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 3px 12px;
  padding-right: 42px;
}

.memory-detail-header > :not(.audio-icon-button) {
  grid-column: 1;
}

.memory-detail-header h2 {
  font-size: 2rem;
  overflow-wrap: anywhere;
}

.memory-detail-header p {
  color: var(--muted);
  font-weight: 750;
}

.audio-icon-button {
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--blue);
}

.memory-example {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-left: 4px solid var(--gold);
  background: var(--panel-soft);
}

.memory-example span,
.memory-example.empty {
  color: var(--muted);
}

.memory-detail-skills {
  display: grid;
  gap: 8px;
}

.memory-theory-list {
  display: grid;
  gap: 6px;
}

.memory-theory-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--ink);
  text-align: left;
}

.memory-theory-row:hover,
.memory-theory-row:focus-visible {
  border-color: var(--blue);
  background: var(--soft-blue);
}

.memory-theory-row > span:first-child {
  display: grid;
  gap: 2px;
}

.memory-theory-row small,
.memory-theory-row > span:last-child {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
}

.memory-theory-row > span:last-child {
  white-space: nowrap;
}

.memory-skill-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(100px, 0.7fr);
  align-items: center;
  gap: 12px;
}

.memory-skill-row > span {
  display: grid;
}

.memory-skill-row small {
  color: var(--muted);
}

.memory-skill-row progress {
  width: 100%;
}

.memory-practice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.memory-detail-loading {
  display: grid;
  min-height: 180px;
  place-items: center;
  color: var(--muted);
  font-weight: 850;
  text-align: center;
}

.dashboard-grid > .metric-card {
  grid-column: span 4;
}

.course-path-panel {
  grid-column: span 7 !important;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 10px;
}

.course-path-panel footer {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
}

.course-progress-track {
  width: 100%;
}

.dashboard-lessons {
  align-content: start;
}

.weak-words-panel {
  grid-column: span 5 !important;
}

.skill-vector-panel {
  grid-column: 1 / -1 !important;
  display: grid;
  gap: 12px;
}

.skill-vector-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
}

.skill-vector-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.85fr) minmax(80px, 1fr) 40px;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.skill-vector-row > span:first-child {
  display: grid;
  min-width: 0;
}

.skill-vector-row small,
.skill-vector-footer,
.skill-vector-empty {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 750;
}

.skill-vector-track {
  width: 100%;
  height: 7px;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 999px;
  appearance: none;
  background: var(--panel-soft);
}

.skill-vector-track::-webkit-progress-bar {
  border-radius: inherit;
  background: var(--panel-soft);
}

.skill-vector-track::-webkit-progress-value {
  border-radius: inherit;
  background: var(--green);
}

.skill-vector-track::-moz-progress-bar {
  border-radius: inherit;
  background: var(--green);
}

.skill-vector-row > strong {
  text-align: right;
}

.skill-vector-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.weak-word-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.weak-word-row > span:first-child {
  display: grid;
  gap: 2px;
}

.weak-word-row small {
  color: var(--muted);
  font-size: 0.68rem;
}

@media (max-width: 780px) {
  #playView[data-experience="quick"][data-mode="matching"] .play-board {
    grid-template-rows: auto auto;
    align-content: start;
  }

  #playView[data-experience="quick"][data-mode="matching"] .game-stage {
    align-self: start;
  }

  .matching-card {
    align-self: start;
    margin: 0 auto;
  }

  #playView[data-experience="home"] .game-stage {
    overflow: auto;
  }

  .course-path-home {
    align-content: start;
    gap: 8px;
  }

  .arcade-world {
    grid-template-rows: 86px auto 8px auto auto;
  }

  .world-art {
    min-height: 86px;
  }

  .world-header h3 {
    font-size: 1.75rem;
  }

  .world-header p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .world-nodes {
    grid-template-columns: 1fr;
  }

  .world-nodes .world-checkpoint {
    grid-column: auto;
  }

  .course-path-header h3 {
    font-size: clamp(1.5rem, 7vw, 2.2rem);
  }

  .lesson-path-row {
    min-height: 50px;
  }

  .path-memory-glance {
    align-self: stretch;
  }

  .memory-lane-grid.compact {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .memory-lane-grid.compact .memory-lane {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 3px;
    min-height: 52px;
    padding: 7px 4px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
    border-left: 0;
    border-top: 3px solid var(--line-strong);
    text-align: center;
  }

  .memory-lane-grid.compact .memory-lane[data-lane="learning"] {
    border-top-color: var(--blue);
  }

  .memory-lane-grid.compact .memory-lane[data-lane="strong"] {
    border-top-color: var(--green);
  }

  .memory-lane-grid.compact .memory-lane[data-lane="due"] {
    border-top-color: var(--gold);
  }

  .memory-lane-grid.compact .memory-lane[data-lane="confused"] {
    border-top-color: var(--accent);
  }

  .memory-lane-grid.compact .memory-lane:last-child {
    border-right: 0;
  }

  .memory-lane-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .memory-lane {
    min-height: 78px;
    border-bottom: 1px solid var(--line);
  }

  .dashboard-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .memory-map-panel,
  .skill-vector-panel,
  .course-path-panel,
  .weak-words-panel {
    grid-column: 1 / -1 !important;
  }

  .memory-map-panel {
    min-height: 245px;
  }

  .dashboard-grid > .metric-card {
    grid-column: span 2 !important;
    min-height: 96px;
  }

  .skill-vector-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .sentence-answer-tray,
  .sentence-token-bank {
    gap: 6px;
    min-height: 58px;
    padding: 8px;
  }

  .sentence-token {
    min-height: 40px;
    padding: 7px 10px;
  }

  .course-path-header p,
  .lesson-path-state {
    display: none;
  }

  .lesson-path-row {
    grid-template-columns: 36px minmax(0, 1fr);
    min-height: 46px;
    padding: 5px 7px;
  }

  .lesson-path-node {
    width: 34px;
    height: 34px;
  }

  .course-path-next {
    padding-top: 7px;
  }

  .path-memory-glance > header {
    padding: 8px 10px;
  }

  .memory-map-panel {
    min-height: 300px;
    padding: 12px;
  }

  .memory-lane-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .memory-lane {
    min-height: 70px;
    padding: 9px;
  }

  .memory-lane strong {
    font-size: 1.45rem;
  }

  .memory-browser-heading {
    align-items: start;
    flex-direction: column;
    gap: 2px;
  }

  .memory-item-list {
    max-height: 230px;
  }

  .memory-item-row {
    grid-template-columns: minmax(0, 1fr) 92px;
  }

  .memory-detail-shell {
    padding: 18px 14px;
  }

  .memory-detail-header h2 {
    font-size: 1.65rem;
  }

  .memory-skill-row {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .weak-word-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .weak-word-state {
    display: none;
  }

  .memory-metric small {
    display: none;
  }

  .skill-vector-row {
    grid-template-columns: minmax(88px, 0.85fr) minmax(70px, 1fr) 36px;
    gap: 7px;
  }

  .skill-vector-row small {
    display: none;
  }

  .skill-vector-footer {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 780px) and (max-height: 680px) {
  #playView:is([data-experience="daily"], [data-experience="checkpoint"]) .question-card {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: minmax(110px, 1fr) auto auto;
  }

  #playView:is([data-experience="daily"], [data-experience="checkpoint"]) .question-card > .prompt-area {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  #playView:is([data-experience="daily"], [data-experience="checkpoint"]) .question-card > :is(
    .choices-grid,
    .spell-form,
    .sentence-builder
  ) {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  #playView:is([data-experience="daily"], [data-experience="checkpoint"]) .question-card > .exercise-skip-button {
    grid-column: 1;
    grid-row: 3;
    justify-self: start;
  }

  #playView:is([data-experience="daily"], [data-experience="checkpoint"]) .question-card > .question-footer {
    grid-column: 2;
    grid-row: 3;
  }

  .sentence-question .prompt-area {
    gap: 5px;
  }

  .sentence-question .russian-word {
    font-size: 1.85rem;
    line-height: 0.95;
  }

  .sentence-question .translation-word {
    font-size: 0.82rem;
    line-height: 1.15;
  }

  .sentence-question .sound-button {
    min-height: 44px;
  }

  .sentence-question .sentence-builder {
    gap: 6px;
  }

  .sentence-question .sentence-answer-tray,
  .sentence-question .sentence-token-bank {
    gap: 4px;
    min-height: 50px;
    padding: 6px;
  }

  .sentence-question .sentence-token {
    min-height: 44px;
    padding: 5px 8px;
    font-size: 0.88rem;
  }

  .sentence-question #sentenceCheckButton {
    min-height: 44px;
  }

  .course-path-header h3 {
    font-size: 1.25rem;
  }

  .path-level,
  .course-path-header p,
  .course-path-next {
    display: none;
  }

  .lesson-path-row {
    min-height: 42px;
  }

  .path-memory-glance > header {
    display: none;
  }

  .memory-map-link {
    min-height: 44px;
  }
}

/* Daily goals and humane streaks */
.home-goal-progress,
.daily-rhythm-panel > progress {
  width: 100%;
  overflow: hidden;
  border: 0;
  appearance: none;
  background: var(--panel-soft);
}

.home-goal-progress {
  height: 6px;
  border-radius: 0;
}

.home-goal-progress::-webkit-progress-bar,
.daily-rhythm-panel > progress::-webkit-progress-bar {
  background: var(--panel-soft);
}

.home-goal-progress::-webkit-progress-value,
.daily-rhythm-panel > progress::-webkit-progress-value {
  background: var(--green);
}

.home-goal-progress::-moz-progress-bar,
.daily-rhythm-panel > progress::-moz-progress-bar {
  background: var(--green);
}

.memory-home-summary {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 11px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.memory-home-summary strong {
  font-size: 0.75rem;
}

.memory-home-summary span {
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 800;
}

.goal-segments {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.goal-segments button {
  display: grid;
  place-content: center;
  gap: 2px;
  min-width: 0;
  min-height: 44px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
}

.goal-segments button strong {
  font-size: 0.76rem;
  line-height: 1;
}

.goal-segments button small {
  color: inherit;
  font-size: 0.61rem;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
}

.goal-segments button:hover,
.goal-segments button:focus-visible {
  background: var(--panel);
  color: var(--ink);
}

.goal-segments button.active {
  background: var(--nav);
  color: #ffffff;
}

.goal-segments button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.onboarding-options {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.onboarding-options legend {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
}

.daily-rhythm-panel {
  display: grid;
  grid-column: 1 / -1;
  gap: 12px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--green);
  border-radius: 8px;
  background: var(--panel);
}

.daily-rhythm-panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.daily-rhythm-panel > header > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.daily-rhythm-panel h3,
.daily-rhythm-panel p {
  margin: 0;
}

.daily-rhythm-panel h3 {
  font-size: clamp(1.35rem, 3vw, 2.15rem);
}

.daily-rhythm-panel p,
.daily-rhythm-panel footer {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
}

.daily-streak-stat {
  display: grid;
  min-width: 86px;
  justify-items: end;
}

.daily-streak-stat strong {
  color: var(--green);
  font-size: 2.4rem;
  line-height: 1;
}

.daily-streak-stat span {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
}

.daily-rhythm-panel > progress {
  height: 8px;
  border-radius: 999px;
}

.daily-rhythm-panel > progress::-webkit-progress-bar,
.daily-rhythm-panel > progress::-webkit-progress-value {
  border-radius: inherit;
}

.goal-calendar {
  display: grid;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  gap: 5px;
  min-width: 0;
}

.goal-calendar-day {
  display: grid;
  min-width: 0;
  justify-items: center;
  gap: 5px;
}

.goal-calendar-day small {
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 850;
}

.goal-calendar-day b {
  display: block;
  width: min(22px, 100%);
  aspect-ratio: 1;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
  background: var(--panel-soft);
}

.goal-calendar-day[data-state="complete"] b {
  border-color: var(--green);
  background: var(--green);
}

.goal-calendar-day[data-state="protected"] b {
  border-color: var(--gold);
  background: color-mix(in srgb, var(--gold) 22%, var(--panel));
}

.goal-calendar-day[data-state="active"] b {
  border-color: var(--blue);
  background: var(--soft-blue);
}

.goal-calendar-day[data-today="true"] small {
  color: var(--ink);
}

.goal-calendar-day[data-today="true"] b {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.daily-rhythm-panel footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}

.metric-card.accuracy-metric {
  border-top-color: var(--blue);
}

.metric-card.recalled-metric {
  border-top-color: var(--green);
}

.metric-card.active-days-metric {
  border-top-color: var(--gold);
}

@media (max-width: 780px) {
  .daily-rhythm-panel {
    gap: 10px;
    padding: 12px;
  }

  .goal-calendar {
    gap: 3px;
  }

  .goal-calendar-day b {
    width: min(18px, 100%);
  }
}

@media (max-width: 520px) {
  .daily-rhythm-panel > header {
    align-items: end;
  }

  .daily-rhythm-panel p {
    max-width: 230px;
  }

  .daily-streak-stat {
    min-width: 64px;
  }

  .daily-streak-stat strong {
    font-size: 2rem;
  }

  .daily-rhythm-panel footer {
    display: grid;
    gap: 3px;
  }
}

@media (max-width: 780px) and (max-height: 680px) {
  .path-memory-glance > header.home-goal-header {
    display: flex;
    padding: 6px 9px;
  }

  .memory-home-summary {
    display: none;
  }

  .home-goal-progress {
    height: 4px;
  }
}
