:root{
  --grammar-ink:#0f172a;
  --grammar-muted:#64748b;
  --grammar-soft:#f8fafc;
  --grammar-card:#ffffff;
  --grammar-line:rgba(15,23,42,.1);
  --grammar-blue:#2563eb;
  --grammar-cyan:#0891b2;
  --grammar-green:#16a34a;
  --grammar-amber:#d97706;
  --grammar-red:#dc2626;
  --grammar-shadow:0 24px 70px rgba(15,23,42,.1);
}

*{ box-sizing:border-box; }

body.grammar-body{
  margin:0;
  min-height:100vh;
  font-family:Manrope, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color:var(--grammar-ink);
  background:
    linear-gradient(135deg, rgba(239,246,255,.9) 0%, rgba(248,250,252,1) 45%, rgba(236,253,245,.68) 100%);
}

button,
input{
  font:inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible{
  outline:3px solid rgba(37,99,235,.34);
  outline-offset:3px;
}

.grammar-shell{
  width:min(1380px, calc(100% - 32px));
  margin:0 auto;
  padding:24px 0 56px;
}

.grammar-topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin-bottom:20px;
}

.grammar-back,
.grammar-dashboard-link,
.grammar-route-link{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:42px;
  padding:0 14px;
  border-radius:999px;
  color:#0f172a;
  background:rgba(255,255,255,.82);
  border:1px solid rgba(148,163,184,.18);
  text-decoration:none;
  font-size:13px;
  font-weight:900;
  box-shadow:0 14px 34px rgba(15,23,42,.08);
}

.grammar-topbar-title,
.grammar-kicker,
.grammar-stat-label,
.grammar-card-kicker,
.grammar-chip{
  letter-spacing:0;
  text-transform:uppercase;
}

.grammar-topbar-title{
  font-size:13px;
  font-weight:950;
  color:#2563eb;
}

.grammar-app{
  min-height:420px;
}

.grammar-loading-card,
.grammar-hero,
.grammar-panel,
.grammar-card,
.grammar-lesson-header,
.grammar-block{
  border:1px solid rgba(148,163,184,.16);
  background:rgba(255,255,255,.9);
  box-shadow:var(--grammar-shadow);
}

.grammar-loading-card{
  padding:34px;
  border-radius:30px;
}

.grammar-loading-card h1{
  margin:12px 0 0;
  font-size:42px;
  line-height:1;
}

.grammar-loading-card p{
  margin:12px 0 0;
  color:#64748b;
  font-weight:750;
}

.grammar-hero{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(320px,.42fr);
  gap:24px;
  padding:28px;
  border-radius:34px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.94), rgba(239,246,255,.86) 58%, rgba(236,253,245,.7));
  border-color:rgba(191,219,254,.6);
}

.grammar-kicker,
.grammar-chip{
  display:inline-flex;
  align-items:center;
  min-height:30px;
  padding:0 12px;
  border-radius:999px;
  background:rgba(37,99,235,.1);
  color:#1d4ed8;
  font-size:11px;
  font-weight:950;
}

.grammar-title{
  margin:14px 0 0;
  font-size:clamp(38px, 5vw, 68px);
  line-height:.95;
  letter-spacing:0;
}

.grammar-subtitle{
  margin:16px 0 0;
  max-width:830px;
  color:#475569;
  font-size:16px;
  line-height:1.72;
  font-weight:700;
}

.grammar-hero-actions,
.grammar-actions,
.grammar-breadcrumbs,
.grammar-item-actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

.grammar-hero-actions{
  margin-top:22px;
}

.grammar-btn,
.grammar-route-btn,
.grammar-option-btn,
.grammar-letter-cell{
  border:0;
  cursor:pointer;
  text-decoration:none;
  transition:transform .16s ease, box-shadow .16s ease, opacity .16s ease, border-color .16s ease, background .16s ease;
}

.grammar-btn,
.grammar-route-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:44px;
  padding:0 16px;
  border-radius:15px;
  font-size:13px;
  font-weight:950;
}

.grammar-btn:hover,
.grammar-route-btn:hover,
.grammar-card:not(.disabled):hover{
  transform:translateY(-1px);
}

.grammar-btn.primary,
.grammar-route-btn.primary{
  color:#fff;
  background:linear-gradient(135deg,#2563eb,#0891b2);
  box-shadow:0 16px 34px rgba(37,99,235,.2);
}

.grammar-btn.secondary,
.grammar-route-btn.secondary{
  color:#0f172a;
  background:#eaf2ff;
  border:1px solid rgba(37,99,235,.14);
}

.grammar-btn.ghost{
  color:#1d4ed8;
  background:#fff;
  border:1px solid rgba(37,99,235,.14);
}

.grammar-btn:disabled,
.grammar-route-btn:disabled,
.grammar-option-btn:disabled,
.grammar-letter-cell:disabled{
  cursor:not-allowed;
  opacity:.62;
  transform:none;
}

.grammar-stat-grid,
.grammar-hero-panel{
  display:grid;
  gap:14px;
}

.grammar-stat-grid{
  grid-template-columns:repeat(3, minmax(0,1fr));
  margin-top:22px;
}

.grammar-stat-card{
  padding:16px;
  border-radius:24px;
  background:rgba(255,255,255,.74);
  border:1px solid rgba(148,163,184,.18);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.9);
}

.grammar-stat-label{
  color:#64748b;
  font-size:11px;
  font-weight:950;
}

.grammar-stat-value{
  margin-top:8px;
  color:#0f172a;
  font-size:28px;
  line-height:1;
  font-weight:950;
}

.grammar-stat-note{
  margin-top:6px;
  color:#64748b;
  font-size:12px;
  line-height:1.35;
  font-weight:800;
}

.grammar-progress-track{
  height:9px;
  margin-top:12px;
  overflow:hidden;
  border-radius:999px;
  background:#dbeafe;
}

.grammar-progress-track span{
  display:block;
  width:0%;
  height:100%;
  border-radius:inherit;
  background:linear-gradient(90deg,#2563eb,#38bdf8);
  transition:width .24s ease;
}

.grammar-section{
  margin-top:24px;
}

.grammar-section-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:16px;
  margin-bottom:14px;
}

.grammar-section-title{
  margin:0;
  font-size:26px;
  line-height:1.1;
}

.grammar-section-copy{
  margin:8px 0 0;
  color:#64748b;
  font-size:14px;
  line-height:1.55;
  font-weight:750;
}

.grammar-grid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0,1fr));
  gap:16px;
}

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

.grammar-card{
  min-width:0;
  padding:20px;
  border-radius:26px;
  text-align:left;
  color:#0f172a;
}

.grammar-card.disabled{
  opacity:.72;
}

.grammar-card-kicker{
  color:#2563eb;
  font-size:11px;
  font-weight:950;
}

.grammar-card-title{
  margin:10px 0 0;
  color:#0f172a;
  font-size:20px;
  line-height:1.2;
  font-weight:950;
}

.grammar-card-copy{
  margin:9px 0 0;
  color:#64748b;
  font-size:13px;
  line-height:1.55;
  font-weight:750;
}

.grammar-meta-row{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:14px;
}

.grammar-chip.easy{ background:rgba(22,163,74,.12); color:#166534; }
.grammar-chip.medium{ background:rgba(217,119,6,.13); color:#92400e; }
.grammar-chip.hard{ background:rgba(220,38,38,.12); color:#991b1b; }
.grammar-chip.mmr{ background:#eff6ff; color:#1d4ed8; }
.grammar-chip.locked{ background:#f1f5f9; color:#64748b; }

.grammar-card-progress{
  margin-top:14px;
  color:#334155;
  font-size:12px;
  font-weight:900;
}

.grammar-panel{
  padding:22px;
  border-radius:28px;
}

.grammar-lesson-layout{
  display:grid;
  grid-template-columns:minmax(0,1fr) 320px;
  gap:22px;
  align-items:start;
  margin-top:22px;
}

.grammar-lesson-aside{
  position:sticky;
  top:18px;
}

.grammar-lesson-header,
.grammar-block{
  border-radius:28px;
}

.grammar-lesson-header{
  padding:26px;
  background:
    linear-gradient(135deg,#ffffff 0%,#eff6ff 72%,#ecfdf5 100%);
}

.grammar-lesson-title{
  margin:14px 0 0;
  font-size:clamp(30px, 4vw, 48px);
  line-height:1.02;
  letter-spacing:0;
}

.grammar-lesson-subtitle{
  margin:12px 0 0;
  color:#475569;
  font-size:15px;
  line-height:1.7;
  font-weight:750;
}

.grammar-concept-card{
  margin-top:16px;
  padding:16px;
  border-radius:20px;
  background:rgba(255,255,255,.78);
  border:1px solid rgba(37,99,235,.14);
}

.grammar-concept-card p{
  margin:10px 0 0;
  color:#334155;
  font-size:14px;
  line-height:1.65;
  font-weight:800;
}

.grammar-gate-actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:16px;
}

.grammar-gate-helper{
  margin:10px 0 0;
  color:#92400e;
  font-size:13px;
  line-height:1.45;
  font-weight:900;
}

.grammar-gate-helper.unlocked{
  color:#166534;
}

.grammar-block{
  margin-top:18px;
  padding:24px;
}

.grammar-block h2{
  margin:0;
  font-size:23px;
  line-height:1.15;
}

.grammar-block p,
.grammar-block li{
  color:#334155;
  font-size:15px;
  line-height:1.72;
  font-weight:650;
}

.grammar-block ul,
.grammar-block ol{
  margin:12px 0 0;
  padding-left:22px;
}

.grammar-rule{
  padding:16px;
  border-radius:20px;
  background:#eff6ff;
  border:1px solid rgba(59,130,246,.16);
}

.grammar-rule + .grammar-rule{
  margin-top:12px;
}

.grammar-decision-guide{
  margin-top:16px;
  padding:16px;
  border-radius:20px;
  background:#f8fafc;
  border:1px solid rgba(148,163,184,.18);
}

.grammar-decision-guide ul{
  margin:10px 0 0;
}

.grammar-example-grid{
  display:grid;
  gap:10px;
  margin-top:12px;
}

.grammar-example{
  padding:12px 14px;
  border-radius:16px;
  background:#0f172a;
  color:#e5eefb;
  font-family:"SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size:13px;
  line-height:1.55;
  overflow:auto;
}

.grammar-mistake-list{
  display:grid;
  gap:12px;
  margin-top:16px;
}

.grammar-mistake{
  padding:14px;
  border-radius:18px;
  background:#fff7ed;
  border:1px solid rgba(251,146,60,.2);
}

.grammar-wrong{
  color:#b91c1c;
  font-weight:950;
}

.grammar-right{
  margin-top:6px;
  color:#166534;
  font-weight:950;
}

.grammar-why{
  margin-top:6px;
  color:#64748b;
  font-size:13px;
  line-height:1.5;
  font-weight:750;
}

.grammar-exercise{
  margin-top:18px;
  padding:18px;
  border-radius:22px;
  background:#f8fafc;
  border:1px solid rgba(148,163,184,.16);
}

.grammar-exercise.locked{
  opacity:.78;
}

.grammar-exercise-head{
  display:flex;
  justify-content:space-between;
  gap:14px;
  align-items:flex-start;
  margin-bottom:14px;
}

.grammar-exercise-badges{
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  gap:8px;
}

.grammar-exercise-title{
  margin:0;
  font-size:18px;
  line-height:1.25;
}

.grammar-instruction{
  margin-top:5px;
  color:#475569;
  font-size:14px;
  line-height:1.6;
  font-weight:800;
}

.grammar-retry-note{
  margin-top:8px;
  color:#92400e;
  font-size:13px;
  line-height:1.45;
  font-weight:900;
}

.grammar-word-bank{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin:12px 0 0;
}

.grammar-exercise-status-list{
  display:grid;
  gap:10px;
  margin-top:14px;
}

.grammar-exercise-status-pill{
  display:flex;
  align-items:center;
  gap:8px;
  padding:10px;
  border-radius:16px;
  background:#f8fafc;
  border:1px solid rgba(148,163,184,.14);
  color:#334155;
  font-size:12px;
  line-height:1.35;
  font-weight:850;
}

.grammar-word-chip{
  display:inline-flex;
  align-items:center;
  min-height:30px;
  padding:0 10px;
  border-radius:999px;
  background:#fff;
  border:1px solid rgba(37,99,235,.16);
  color:#1e3a8a;
  font-size:12px;
  font-weight:950;
}

.grammar-exercise-footer{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-top:14px;
  padding-top:14px;
  border-top:1px solid rgba(148,163,184,.16);
}

.grammar-exercise-result{
  min-height:40px;
  display:flex;
  align-items:center;
  padding:9px 12px;
  border-radius:16px;
  background:#eff6ff;
  color:#1e3a8a;
  font-size:13px;
  line-height:1.45;
  font-weight:900;
}

.grammar-exercise-result.ok{
  background:#dcfce7;
  color:#166534;
}

.grammar-exercise-result.bad{
  background:#fee2e2;
  color:#991b1b;
}

.grammar-item{
  margin-top:12px;
  padding:16px;
  border-radius:20px;
  background:#fff;
  border:1px solid rgba(148,163,184,.16);
  transition:border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.grammar-item.solved{
  border-color:rgba(22,163,74,.34);
  background:#f0fdf4;
}

.grammar-item.wrong{
  border-color:rgba(220,38,38,.34);
  background:#fff7f7;
  box-shadow:0 14px 30px rgba(220,38,38,.08);
}

.grammar-item.revealed{
  border-color:rgba(217,119,6,.34);
  background:#fffbeb;
}

.grammar-question-text{
  color:#0f172a;
  font-size:15px;
  line-height:1.65;
  font-weight:850;
}

.grammar-option-row{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:12px;
}

.grammar-option-btn{
  display:inline-flex;
  align-items:center;
  min-height:40px;
  padding:0 12px;
  border-radius:14px;
  background:#eff6ff;
  border:1px solid rgba(37,99,235,.13);
  color:#0f172a;
  font-size:13px;
  font-weight:900;
}

.grammar-option-btn.selected{
  background:#2563eb;
  border-color:#2563eb;
  color:#fff;
}

.grammar-input{
  width:100%;
  max-width:440px;
  min-height:42px;
  margin-top:12px;
  border-radius:14px;
  border:1px solid rgba(148,163,184,.28);
  background:#fff;
  color:#0f172a;
  padding:0 12px;
  font-size:14px;
  font-weight:850;
  outline:none;
}

.grammar-input.correct{
  border-color:rgba(22,163,74,.55);
  background:#f0fdf4;
}

.grammar-input.wrong{
  border-color:rgba(220,38,38,.55);
  background:#fff7f7;
}

.grammar-order-list{
  margin:12px 0 0;
  padding:0;
  list-style:none;
  display:grid;
  gap:8px;
}

.grammar-order-list li{
  display:grid;
  grid-template-columns:32px minmax(0,1fr);
  gap:10px;
  align-items:start;
  padding:10px 12px;
  border-radius:14px;
  background:#f8fafc;
  border:1px solid rgba(148,163,184,.14);
}

.grammar-order-letter{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:26px;
  height:26px;
  border-radius:9px;
  color:#1d4ed8;
  background:#dbeafe;
  font-size:12px;
  font-weight:950;
}

.grammar-order-cells{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:12px;
}

.grammar-letter-cell{
  width:42px;
  height:42px;
  border-radius:14px;
  border:1px solid rgba(148,163,184,.28);
  background:#fff;
  text-align:center;
  color:#0f172a;
  font-size:16px;
  font-weight:950;
  text-transform:lowercase;
}

.grammar-letter-cell[readonly]{
  color:#1d4ed8;
  background:#dbeafe;
}

.grammar-item-actions{
  margin-top:12px;
}

.grammar-feedback{
  margin-top:12px;
  padding:11px 12px;
  border-radius:16px;
  background:#f1f5f9;
  color:#475569;
  font-size:13px;
  line-height:1.55;
  font-weight:800;
}

.grammar-feedback.ok{
  background:#dcfce7;
  color:#166534;
}

.grammar-feedback.bad{
  background:#fee2e2;
  color:#991b1b;
}

.grammar-feedback.reveal{
  background:#fef3c7;
  color:#92400e;
}

.grammar-recap-list{
  display:grid;
  gap:10px;
  margin-top:14px;
}

.grammar-recap-item{
  padding:12px 14px;
  border-radius:16px;
  background:#f8fafc;
  border:1px solid rgba(148,163,184,.14);
  color:#334155;
  font-size:14px;
  line-height:1.55;
  font-weight:850;
}

.grammar-mmr-box{
  margin-top:14px;
  padding:14px;
  border-radius:18px;
  background:linear-gradient(135deg,#eff6ff,#e0f2fe);
  border:1px solid rgba(37,99,235,.16);
  color:#0f172a;
  font-weight:900;
}

.grammar-empty{
  padding:24px;
  border-radius:24px;
  background:rgba(255,255,255,.78);
  border:1px dashed rgba(148,163,184,.34);
  color:#64748b;
  font-weight:800;
}

/* Practice Center theme bridge */
html[data-practice-theme] body.grammar-body{
  --grammar-ink:var(--arena-text);
  --grammar-muted:var(--arena-muted);
  --grammar-soft:var(--arena-card-soft);
  --grammar-card:var(--arena-card-bg);
  --grammar-line:var(--arena-line);
  --grammar-blue:var(--arena-cyan);
  --grammar-cyan:var(--arena-cyan);
  --grammar-green:var(--arena-emerald);
  --grammar-amber:var(--arena-gold);
  --grammar-red:var(--arena-rose);
  --grammar-shadow:var(--arena-shadow);
  color:var(--arena-text);
  background:var(--arena-page-bg) !important;
  position:relative;
}

html[data-practice-theme] body.grammar-body::before{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  background-image:
    linear-gradient(var(--arena-grid-line-a) 1px, transparent 1px),
    linear-gradient(90deg, var(--arena-grid-line-b) 1px, transparent 1px);
  background-size:52px 52px;
  opacity:.72;
  z-index:-1;
}

html[data-practice-theme] .grammar-shell{
  position:relative;
  z-index:1;
}

html[data-practice-theme] .grammar-topbar{
  padding:12px 14px;
  border:1px solid var(--arena-line);
  border-radius:24px;
  background:var(--arena-topbar-bg);
  box-shadow:var(--arena-topbar-shadow);
}

html[data-practice-theme] .grammar-topbar-title{
  color:var(--arena-kicker-text);
}

html[data-practice-theme] .grammar-back,
html[data-practice-theme] .grammar-dashboard-link,
html[data-practice-theme] .grammar-route-link,
html[data-practice-theme] .grammar-btn.secondary,
html[data-practice-theme] .grammar-btn.ghost,
html[data-practice-theme] .grammar-route-btn.secondary{
  color:var(--arena-title-text);
  background:var(--arena-control-bg);
  border:1px solid var(--arena-line);
  box-shadow:none;
}

html[data-practice-theme] .grammar-loading-card,
html[data-practice-theme] .grammar-hero,
html[data-practice-theme] .grammar-panel,
html[data-practice-theme] .grammar-card,
html[data-practice-theme] .grammar-lesson-header,
html[data-practice-theme] .grammar-block{
  color:var(--arena-text);
  border-color:var(--arena-line);
  background:var(--arena-card-bg) !important;
  box-shadow:var(--arena-shadow);
}

html[data-practice-theme] .grammar-hero,
html[data-practice-theme] .grammar-lesson-header{
  background:
    radial-gradient(circle at 90% 0%, color-mix(in srgb, var(--arena-cyan) 16%, transparent), transparent 34%),
    radial-gradient(circle at 0% 10%, color-mix(in srgb, var(--arena-gold) 16%, transparent), transparent 38%),
    var(--arena-card-bg-strong) !important;
}

html[data-practice-theme] .grammar-stat-card,
html[data-practice-theme] .grammar-concept-card,
html[data-practice-theme] .grammar-decision-guide,
html[data-practice-theme] .grammar-exercise,
html[data-practice-theme] .grammar-exercise-status-pill,
html[data-practice-theme] .grammar-item,
html[data-practice-theme] .grammar-recap-item,
html[data-practice-theme] .grammar-empty{
  color:var(--arena-text);
  border-color:var(--arena-line);
  background:var(--arena-card-soft);
  box-shadow:none;
}

html[data-practice-theme] .grammar-title,
html[data-practice-theme] .grammar-section-title,
html[data-practice-theme] .grammar-loading-card h1,
html[data-practice-theme] .grammar-card-title,
html[data-practice-theme] .grammar-stat-value,
html[data-practice-theme] .grammar-lesson-title,
html[data-practice-theme] .grammar-exercise-title,
html[data-practice-theme] .grammar-question-text,
html[data-practice-theme] .grammar-block h2{
  color:var(--arena-title-text);
}

html[data-practice-theme] .grammar-subtitle,
html[data-practice-theme] .grammar-section-copy,
html[data-practice-theme] .grammar-loading-card p,
html[data-practice-theme] .grammar-card-copy,
html[data-practice-theme] .grammar-stat-note,
html[data-practice-theme] .grammar-lesson-subtitle,
html[data-practice-theme] .grammar-instruction,
html[data-practice-theme] .grammar-block p,
html[data-practice-theme] .grammar-block li,
html[data-practice-theme] .grammar-concept-card p,
html[data-practice-theme] .grammar-card-progress,
html[data-practice-theme] .grammar-why,
html[data-practice-theme] .grammar-feedback,
html[data-practice-theme] .grammar-recap-item,
html[data-practice-theme] .grammar-empty{
  color:var(--arena-copy);
}

html[data-practice-theme] .grammar-stat-label,
html[data-practice-theme] .grammar-card-kicker{
  color:var(--arena-muted);
}

html[data-practice-theme] .grammar-kicker,
html[data-practice-theme] .grammar-chip{
  background:var(--arena-kicker-bg);
  color:var(--arena-kicker-text);
  border:1px solid color-mix(in srgb, var(--arena-gold) 22%, transparent);
}

html[data-practice-theme] .grammar-chip.easy{
  background:color-mix(in srgb, var(--arena-emerald) 16%, var(--arena-chip-bg));
  color:color-mix(in srgb, var(--arena-emerald) 78%, var(--arena-title-text));
  border-color:color-mix(in srgb, var(--arena-emerald) 30%, transparent);
}

html[data-practice-theme] .grammar-chip.medium,
html[data-practice-theme] .grammar-chip.mmr{
  background:var(--arena-badge-bg);
  color:color-mix(in srgb, var(--arena-gold) 82%, var(--arena-title-text));
  border-color:color-mix(in srgb, var(--arena-gold) 28%, transparent);
}

html[data-practice-theme] .grammar-chip.hard{
  background:color-mix(in srgb, var(--arena-rose) 15%, var(--arena-chip-bg));
  color:color-mix(in srgb, var(--arena-rose) 76%, var(--arena-title-text));
  border-color:color-mix(in srgb, var(--arena-rose) 28%, transparent);
}

html[data-practice-theme] .grammar-chip.locked{
  background:var(--arena-status-bg);
  color:var(--arena-meta);
  border-color:var(--arena-line);
}

html[data-practice-theme] .grammar-progress-track{
  background:var(--arena-progress-bg);
}

html[data-practice-theme] .grammar-progress-track span{
  background:linear-gradient(90deg,var(--arena-gold),var(--arena-cyan),var(--arena-violet));
  box-shadow:0 0 20px color-mix(in srgb, var(--arena-cyan) 24%, transparent);
}

html[data-practice-theme] .grammar-btn.primary,
html[data-practice-theme] .grammar-route-btn.primary{
  color:#0b1224;
  background:linear-gradient(135deg,var(--arena-gold),var(--arena-gold-2)) !important;
  box-shadow:0 16px 34px color-mix(in srgb, var(--arena-gold) 22%, transparent);
}

html[data-practice-theme] .grammar-btn.primary:hover,
html[data-practice-theme] .grammar-route-btn.primary:hover,
html[data-practice-theme] .grammar-back:hover,
html[data-practice-theme] .grammar-dashboard-link:hover,
html[data-practice-theme] .grammar-route-link:hover{
  border-color:color-mix(in srgb, var(--arena-cyan) 42%, var(--arena-line));
}

html[data-practice-theme] .grammar-rule{
  background:color-mix(in srgb, var(--arena-cyan) 10%, var(--arena-card-soft));
  border-color:color-mix(in srgb, var(--arena-cyan) 24%, var(--arena-line));
}

html[data-practice-theme] .grammar-example{
  background:color-mix(in srgb, var(--arena-bg) 88%, #000);
  color:var(--arena-subtle);
  border:1px solid var(--arena-line);
}

html[data-practice-theme] .grammar-mistake{
  background:color-mix(in srgb, var(--arena-gold) 11%, var(--arena-card-soft));
  border-color:color-mix(in srgb, var(--arena-gold) 24%, var(--arena-line));
}

html[data-practice-theme] .grammar-wrong{
  color:color-mix(in srgb, var(--arena-rose) 78%, var(--arena-title-text));
}

html[data-practice-theme] .grammar-right,
html[data-practice-theme] .grammar-gate-helper.unlocked{
  color:color-mix(in srgb, var(--arena-emerald) 78%, var(--arena-title-text));
}

html[data-practice-theme] .grammar-gate-helper,
html[data-practice-theme] .grammar-retry-note{
  color:color-mix(in srgb, var(--arena-gold) 82%, var(--arena-title-text));
}

html[data-practice-theme] .grammar-word-chip,
html[data-practice-theme] .grammar-option-btn,
html[data-practice-theme] .grammar-order-list li,
html[data-practice-theme] .grammar-letter-cell,
html[data-practice-theme] .grammar-input{
  color:var(--arena-title-text);
  background:var(--arena-control-bg);
  border-color:var(--arena-line);
}

html[data-practice-theme] .grammar-option-btn.selected{
  color:#0b1224;
  background:linear-gradient(135deg,var(--arena-cyan),var(--arena-emerald));
  border-color:transparent;
}

html[data-practice-theme] .grammar-input:focus,
html[data-practice-theme] .grammar-letter-cell:focus{
  border-color:color-mix(in srgb, var(--arena-cyan) 56%, var(--arena-line));
  box-shadow:0 0 0 3px color-mix(in srgb, var(--arena-cyan) 18%, transparent);
}

html[data-practice-theme] .grammar-item.solved,
html[data-practice-theme] .grammar-input.correct,
html[data-practice-theme] .grammar-feedback.ok,
html[data-practice-theme] .grammar-exercise-result.ok{
  background:color-mix(in srgb, var(--arena-emerald) 14%, var(--arena-card-soft));
  color:color-mix(in srgb, var(--arena-emerald) 78%, var(--arena-title-text));
  border-color:color-mix(in srgb, var(--arena-emerald) 32%, var(--arena-line));
}

html[data-practice-theme] .grammar-item.wrong,
html[data-practice-theme] .grammar-input.wrong,
html[data-practice-theme] .grammar-feedback.bad,
html[data-practice-theme] .grammar-exercise-result.bad{
  background:color-mix(in srgb, var(--arena-rose) 12%, var(--arena-card-soft));
  color:color-mix(in srgb, var(--arena-rose) 76%, var(--arena-title-text));
  border-color:color-mix(in srgb, var(--arena-rose) 32%, var(--arena-line));
  box-shadow:none;
}

html[data-practice-theme] .grammar-item.revealed,
html[data-practice-theme] .grammar-feedback.reveal{
  background:color-mix(in srgb, var(--arena-gold) 14%, var(--arena-card-soft));
  color:color-mix(in srgb, var(--arena-gold) 82%, var(--arena-title-text));
  border-color:color-mix(in srgb, var(--arena-gold) 32%, var(--arena-line));
}

html[data-practice-theme] .grammar-order-letter,
html[data-practice-theme] .grammar-letter-cell[readonly]{
  color:color-mix(in srgb, var(--arena-cyan) 80%, var(--arena-title-text));
  background:color-mix(in srgb, var(--arena-cyan) 14%, var(--arena-chip-bg));
}

html[data-practice-theme] .grammar-exercise-footer{
  border-top-color:var(--arena-line);
}

html[data-practice-theme] .grammar-exercise-result,
html[data-practice-theme] .grammar-mmr-box{
  color:var(--arena-title-text);
  background:var(--arena-badge-bg);
  border-color:color-mix(in srgb, var(--arena-cyan) 22%, var(--arena-line));
}

@media (prefers-reduced-motion: reduce){
  *,
  *::before,
  *::after{
    scroll-behavior:auto !important;
    transition:none !important;
    animation:none !important;
  }
}

@media (max-width: 1080px){
  .grammar-grid,
  .grammar-grid.two,
  .grammar-hero,
  .grammar-lesson-layout{
    grid-template-columns:1fr;
  }

  .grammar-lesson-aside{
    position:static;
  }
}

@media (max-width: 760px){
  .grammar-shell{
    width:min(100% - 20px, 100%);
    padding-top:14px;
  }

  .grammar-topbar{
    flex-direction:column;
    align-items:stretch;
  }

  .grammar-back,
  .grammar-dashboard-link{
    width:100%;
  }

  .grammar-hero,
  .grammar-panel,
  .grammar-card,
  .grammar-lesson-header,
  .grammar-block{
    border-radius:22px;
    padding:18px;
  }

  .grammar-stat-grid{
    grid-template-columns:1fr;
  }

  .grammar-section-head,
  .grammar-exercise-head{
    display:grid;
    align-items:start;
  }

  .grammar-exercise-footer{
    flex-direction:column;
    align-items:stretch;
  }

  .grammar-btn,
  .grammar-route-btn{
    width:100%;
  }
}
