.grammar-page{margin:0;--gr-rust:#854418;--gr-warm:#f4e9d6;--gr-cover:#dce6d5;--gr-right:#206547;--gr-wrong:#8a3f26}
:root[data-theme=dark] .grammar-page{--gr-rust:#f4c28c;--gr-warm:#453b2c;--gr-cover:#2b4737;--gr-right:#b9dfb5;--gr-wrong:#ffcaab}
.grammar-page *, .grammar-page *::before,.grammar-page *::after{box-sizing:border-box}
.grammar-main{max-width:1040px;padding-top:30px;min-height:65vh}
.grammar-main h1,.grammar-main h2,.grammar-main p{margin:0}
.grammar-main h1{font-size:clamp(36px,5vw,60px);line-height:1.13}
.grammar-main h2{font-size:clamp(21px,3vw,32px);line-height:1.32}
.grammar-main a{color:inherit}
.grammar-main [hidden]{display:none!important}
.gr-route{display:inline-flex;align-items:center;gap:7px;min-height:44px;margin-bottom:13px;color:var(--muted)!important;text-underline-offset:.24em}
.gr-route svg,.gr-button svg,.gr-row>svg,.gr-mode svg{width:20px;height:20px;flex:none}
.gr-hero{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(0,.75fr);align-items:stretch;overflow:hidden;border-radius:18px;background:var(--edition-quiet);min-height:310px}
.gr-hero-copy{padding:clamp(24px,4.6vw,55px);display:flex;align-items:flex-start;flex-direction:column;justify-content:center}
.gr-hero-copy>p{max-width:35ch;margin:14px 0 22px;font-size:clamp(15px,2vw,19px);color:var(--muted)}
.gr-hero-copy small{margin-top:10px;color:var(--muted);font-size:13px}
.gr-hero-art{position:relative;display:grid;place-items:center;background:var(--gr-cover);overflow:hidden;padding:23px}
.gr-hero-art img{height:264px;width:auto;max-width:100%;object-fit:contain;border-radius:5px;box-shadow:0 8px 19px #12261c25}
.gr-button{min-height:48px;display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:10px 19px;border:1px solid var(--line);background:var(--surface);color:var(--ink);border-radius:9px;font:inherit;font-size:15px;font-weight:650;cursor:pointer;text-decoration:none;text-align:center}
.gr-button.primary,.grammar-main a.gr-button.primary{background:var(--edition-action);color:#fff;border-color:var(--edition-action)}
.gr-button:hover:not(:disabled){filter:brightness(.95)}
.gr-button:disabled{opacity:.65;cursor:default}
.gr-modes{display:flex;align-items:stretch;gap:22px;border-bottom:1px solid var(--line);margin-top:30px}
.gr-mode{display:flex;align-items:center;gap:7px;padding:10px 3px;min-height:48px;text-decoration:none;color:var(--muted)!important;border-bottom:3px solid transparent}
.gr-mode[aria-current]{border-color:var(--edition-action);color:var(--ink)!important;font-weight:700}
.gr-directory{padding-top:22px}
.gr-directory-head{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap}
.gr-directory-head p{color:var(--muted);margin-top:5px}
.gr-search{min-height:44px;min-width:0;width:min(100%,290px);font-size:16px;padding:9px 13px;background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:8px}
.gr-search::placeholder{color:var(--muted)}
.gr-groups{display:flex;flex-wrap:wrap;gap:7px;padding:16px 0 8px}
.gr-groups button{min-height:44px;padding:7px 13px;border:1px solid var(--line);background:transparent;color:var(--ink);border-radius:8px;font:inherit;font-size:14px;cursor:pointer}
.gr-groups button[aria-pressed=true]{background:var(--edition-quiet);border-color:var(--edition-action);font-weight:700}
.gr-list{list-style:none;padding:0;margin:8px 0 0;border-top:1px solid var(--line)}
.gr-list li{border-bottom:1px solid var(--line)}
.gr-row{display:grid;grid-template-columns:58px 1fr auto;align-items:center;gap:14px;padding:12px 8px;min-height:64px;text-decoration:none}
.gr-row:hover,.gr-row:focus-visible{background:var(--edition-quiet)}
.gr-number{font-variant-numeric:tabular-nums;font-size:13px;color:var(--gr-rust);font-weight:700;white-space:nowrap}
.gr-row b,.gr-row small{display:block;overflow-wrap:anywhere}
.gr-row small{color:var(--muted);font-size:13px;margin-top:2px}
.gr-row-end{display:flex;align-items:center;gap:8px;color:var(--muted);font-size:12px;white-space:nowrap}
.gr-row-end svg{width:16px;height:16px}
.gr-more{margin-top:15px}
.gr-heading{margin-bottom:19px}
.gr-heading .gr-number{display:inline-block}
.gr-heading p{color:var(--muted);margin-top:7px}
.gr-lesson{display:grid;grid-template-columns:minmax(0,410px) minmax(0,1fr);gap:clamp(22px,5vw,70px);align-items:start}
.gr-player{min-width:0;background:var(--surface);border:1px solid var(--line);border-radius:13px;overflow:hidden}
.gr-screen{width:100%;max-height:66vh;aspect-ratio:9 / 16;display:grid;place-items:center;position:relative;background:#22231e;border:0;padding:0;cursor:pointer}
.gr-screen video{display:block;width:100%;height:100%;min-height:0;object-fit:contain;pointer-events:none}
.gr-screen:focus-visible{outline-offset:-4px}
.gr-controls{padding:9px 12px 11px}
.gr-seek{display:block;min-height:28px;margin:0;width:100%;accent-color:var(--edition-action);cursor:pointer}
.gr-control-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap;color:var(--muted);font-size:13px}
.gr-control-row output{font-variant-numeric:tabular-nums}
.gr-control-row button,.gr-control-row select{min-height:44px}
.gr-control-row select{background:var(--surface);color:var(--ink);font-size:14px;border:1px solid var(--line);border-radius:7px;padding-inline:7px}
.gr-control-row label{margin-left:auto;display:flex;align-items:center;gap:5px}
.gr-media-status{color:var(--muted);font-size:14px;padding:0 12px 10px}
.gr-steps{list-style:none;margin:0;padding:0}
.gr-steps li{display:grid;grid-template-columns:29px 1fr;column-gap:13px;padding:16px 0;border-top:1px solid var(--line)}
.gr-steps li:first-child{padding-top:3px;border-top:0}
.gr-step-index{font-variant-numeric:tabular-nums;color:var(--gr-rust);font-weight:700}
.gr-steps p{color:var(--muted);margin:5px 0 13px}
.gr-handout{margin-top:16px;padding:15px 0;border-top:1px solid var(--line)}
.gr-handout summary{min-height:44px;cursor:pointer;color:var(--muted);padding:9px 0}
.gr-handout-actions,.gr-result-actions{display:flex;flex-wrap:wrap;gap:9px}
.gr-practice{max-width:740px;margin:0 auto}
.gr-exercise,.gr-result{padding:clamp(17px,4vw,34px);background:var(--surface);border:1px solid var(--line);border-radius:12px}
.gr-count{font-size:14px;color:var(--gr-rust);font-variant-numeric:tabular-nums;font-weight:700}
.gr-progress{width:100%;height:7px;display:block;margin:8px 0 20px;accent-color:var(--edition-action)}
.gr-question{border:0;padding:0;margin:0;min-width:0}
.gr-question legend{font-size:17px;font-weight:700;padding:0}
.gr-prompt{font-size:clamp(19px,3vw,26px);line-height:1.55;white-space:pre-line;overflow-wrap:anywhere;margin:8px 0 14px!important}
.gr-hint{color:var(--muted);margin-bottom:13px!important}
.gr-options{display:grid;gap:8px}
.gr-option{min-height:46px;display:flex;align-items:center;gap:11px;padding:9px 12px;background:var(--paper);border:1px solid var(--line);border-radius:8px;cursor:pointer;overflow-wrap:anywhere}
.gr-option:has(input:checked){border-color:var(--edition-action);background:var(--edition-quiet)}
.gr-option input{width:18px;height:18px;flex:none;accent-color:var(--edition-action)}
.gr-answer-label{display:block;margin-bottom:5px;font-size:14px}
.gr-answer{min-height:48px;width:100%;max-width:380px;padding:8px 12px;font:inherit;font-size:17px;background:var(--paper);color:var(--ink);border:1px solid var(--line);border-radius:8px}
.gr-submit{margin-top:15px}
.gr-feedback{margin-top:16px;padding:13px 15px;background:var(--edition-quiet);border-radius:8px}
.gr-feedback[data-correct=false]{background:var(--gr-warm)}
.gr-feedback strong{color:var(--gr-right)}
.gr-feedback[data-correct=false] strong,.gr-error{color:var(--gr-wrong)}
.gr-feedback p{margin-top:4px}
.gr-result p{margin:10px 0 16px;color:var(--muted)}
.gr-loading{padding:23px 0}
@media(max-width:700px){
  .grammar-main{padding-top:12px}
  .gr-hero{grid-template-columns:minmax(0,1fr) 112px;min-height:0;border-radius:12px}
  .gr-hero-copy{padding:19px 10px 19px 15px}
  .gr-hero h1{font-size:clamp(27px,7vw,38px)}
  .gr-hero-copy>p{margin:9px 0 13px;font-size:14px}
  .gr-hero-copy small{font-size:12px}
  .gr-hero-copy .gr-button{min-height:44px;padding:6px 10px;font-size:14px}
  .gr-hero-art{padding:10px 9px}
  .gr-hero-art img{height:auto;width:100%}
  .gr-modes{margin-top:19px}
  .gr-lesson{grid-template-columns:1fr;gap:20px}
  .gr-player{width:100%}
  .gr-screen{max-height:65svh}
  .gr-heading{margin-bottom:13px}
  .gr-row{gap:8px;padding-inline:3px;grid-template-columns:52px 1fr auto}
  .gr-submit>.gr-button,.gr-result-actions .primary{width:100%}
}
@media(max-width:360px){.gr-hero{grid-template-columns:minmax(0,1fr) 91px}.gr-groups button{padding-inline:9px}.gr-control-row{gap:5px}.gr-control-row button{padding-inline:8px}}
