#nav-wrap .nav{grid-template-columns:repeat(3,minmax(0,1fr))}
#nav-wrap .nav-indicator{width:calc((100% - 12px)/3)}
.grammar-heading{padding:29px 0 20px}
.grammar-heading .eyebrow{margin:0 0 8px;color:var(--accent)}
.grammar-heading h1{font-size:clamp(29px,8.2vw,44px);font-weight:550;line-height:1.2;letter-spacing:-.04em;margin:0;outline:none}
.grammar-heading>p:last-child:not(.eyebrow){max-width:36ch;margin:10px 0 0;color:var(--muted);font-size:14px;line-height:1.6}
.grammar-tabs,.grammar-switch{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;padding:4px;background:var(--surface);border:1px solid var(--line);border-radius:15px}
.grammar-switch{grid-template-columns:repeat(4,minmax(0,1fr))}
.grammar-tabs button,.grammar-switch button{border:0;border-radius:11px;min-height:44px;padding:4px;background:none;font-size:13px;font-weight:650;transition:background .18s,color .18s,transform .18s}
.grammar-tabs button:active,.grammar-switch button:active,.grammar-pill:active{transform:scale(.97)}
.grammar-tabs button[aria-pressed=true],.grammar-switch button[aria-pressed=true]{color:var(--accent);background:var(--paper)}
.grammar-tabs small{margin-left:3px;color:var(--muted);font:13px var(--serif)}
.grammar-chapter{margin-top:26px}
.grammar-chapter-head{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin:0 0 10px}
.grammar-chapter-head h2,.grammar-demo h2,.grammar-option-list h2{margin:0;font-size:18px;font-weight:650}
.grammar-chapter-head span{font:16px var(--serif);color:var(--muted)}
.grammar-topic-list,.grammar-option-list,.grammar-practice-list{display:grid;gap:9px}
.grammar-topic,.grammar-resume,.grammar-question,.grammar-demo,.grammar-option-list>div,.grammar-practice-list{background:var(--paper);border:1px solid var(--line);border-radius:19px}
.grammar-topic{position:relative;padding:15px 15px 9px}
.grammar-topic h3{margin:0 0 2px;font-size:16px;font-weight:650}
.grammar-featured{border-color:color-mix(in srgb,var(--accent) 40%,var(--line))}
.grammar-topic-copy p{margin:6px 0;color:var(--muted);font-size:13px;line-height:1.5}
.grammar-topic-copy .grammar-es{margin:0;font:16px/1.3 var(--serif)}
.grammar-status{color:var(--accent);font-size:11px}
.grammar-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.grammar-pill,.grammar-link{min-height:44px;border:0;background:none;color:var(--accent);font-size:13px;font-weight:600;padding:4px 10px;touch-action:manipulation}
.grammar-pill{border-radius:12px;background:var(--accent-soft);transition:transform .18s}
.grammar-resume{margin-top:16px;padding:14px;display:flex;align-items:center;justify-content:space-between;gap:10px;background:var(--accent-soft)}
.grammar-resume strong,.grammar-resume small{display:block;margin-top:5px}
.grammar-resume small,.grammar-sources,.grammar-context,.grammar-meter{font-size:13px;color:var(--muted)}
.grammar-resume .grammar-pill{background:var(--paper);flex-shrink:0}
.grammar-review{margin:10px 0 0}
.grammar-practice-list{margin-top:13px;gap:0;padding:0 13px}
.grammar-practice-list>button,.grammar-result-row{min-height:54px;display:flex;align-items:center;justify-content:space-between;gap:8px;border:0;border-bottom:1px solid var(--line);background:none;text-align:left;padding:10px 0}
.grammar-practice-list>button:last-child,.grammar-result-row:last-child{border-bottom:0}
.grammar-practice-list small{display:block;color:var(--muted);margin-top:4px}
.grammar-toolbar{padding-top:8px}
.grammar-toolbar button{padding-left:0}
.grammar-toolbar+.grammar-heading{padding-top:13px}
.grammar-lesson{display:grid;gap:16px}
.grammar-prose,.grammar-note p{margin:0;font-size:15px;line-height:1.75}
.grammar-note{border-left:2px solid var(--accent);border-radius:0 12px 12px 0;padding:12px;background:var(--accent-soft)}
.grammar-note h2{margin:0 0 4px;color:var(--accent);font-size:14px}
.grammar-examples{padding:0 13px;background:var(--paper);border:1px solid var(--line);border-radius:15px}
.grammar-examples>div{padding:12px 0}
.grammar-examples>div+div{border-top:1px solid var(--line)}
.grammar-examples p{margin:0 0 4px;font:19px/1.35 var(--serif)}
.grammar-examples small{font-size:13px;color:var(--muted)}
.grammar-demo{padding:12px;box-shadow:var(--shadow)}
.grammar-demo h2{margin:1px 0 12px}
.grammar-table{width:100%;table-layout:fixed;border-collapse:collapse;font-size:13px;text-align:left}
.grammar-table td,.grammar-table th{padding:8px 5px;overflow-wrap:anywhere;border-bottom:1px solid var(--line)}
.grammar-table thead th{color:var(--muted);font-size:12px;font-weight:600}
.grammar-morph{margin-top:8px;font-size:12px}
.grammar-morph th,.grammar-morph td{padding:0 3px}
.grammar-morph thead th{padding:8px 3px}
.grammar-morph thead th:first-child{width:25%}
.grammar-morph button{display:block;width:100%;min-width:0;min-height:44px;padding:0;border:0;background:none;text-align:left;font-weight:500;font-size:12px}
.grammar-morph td button{font:clamp(12px,4vw,19px)/1.25 var(--serif);white-space:nowrap}
.grammar-highlight{background:var(--accent-soft)}
.grammar-ending,.grammar-formula strong{color:var(--accent);font-weight:700}
.grammar-formula{display:grid;gap:4px;margin-top:12px;padding:10px 12px;border-radius:11px;background:var(--surface);font:17px/1.35 var(--serif)}
.grammar-formula small{font:12px/1.35 var(--sans);color:var(--muted)}
.grammar-formula span[aria-hidden=true]{color:var(--muted);margin:0 3px}
.grammar-lesson-actions,.grammar-sources{margin-top:18px}
.grammar-sources a{color:var(--accent)}
.grammar-option-list>div{padding:14px}
.grammar-option-list h2{margin-bottom:8px}
.grammar-meter{display:flex;align-items:center;justify-content:space-between;gap:8px}
.grammar-progress{margin:9px 0 15px}
.grammar-progress i{background:var(--accent);height:100%}
.grammar-question{padding:16px;box-shadow:var(--shadow);animation:rise .2s ease-out}
.grammar-question h2{font-size:clamp(22px,7vw,35px);margin:6px 0 14px;line-height:1.2;overflow-wrap:anywhere}
.grammar-context{margin:0}
.grammar-question label{font-size:13px;font-weight:600;display:block;margin-bottom:6px}
.grammar-question input{width:100%;min-height:48px;font-size:18px;border:1px solid var(--line);border-radius:12px;padding:8px 10px;background:var(--bg);color:var(--ink)}
.grammar-accents{display:flex;flex-wrap:wrap;gap:2px;margin:4px -2px 9px}
.grammar-accents button{flex:1;min-width:34px;padding:4px}
.grammar-feedback{border-radius:12px;padding:12px;background:var(--accent-soft);font-size:14px;line-height:1.5;overflow-wrap:anywhere}
.grammar-feedback.grammar-correct{background:color-mix(in srgb,var(--green) 12%,var(--paper))}
.grammar-feedback p{margin:5px 0 0}
.grammar-feedback b{font:600 20px var(--serif)}
.grammar-advance{margin-top:13px}
.grammar-result-row{flex-wrap:wrap;font-size:14px;overflow-wrap:anywhere}
#grammar-page{animation-duration:.2s}
@media(prefers-reduced-motion:reduce){#grammar-page,.grammar-question{animation:none!important}.grammar-tabs button,.grammar-switch button,.grammar-pill{transition:none}}
.grammar-forms-details{background:var(--paper);border:1px solid var(--line);border-radius:12px;padding:0 9px}
.grammar-forms-details summary{cursor:pointer;padding:12px 2px;min-height:44px;color:var(--accent);font-size:14px;font-weight:600}
@media(pointer:coarse){body:has(#grammar-answer:focus) #nav-wrap{visibility:hidden;pointer-events:none}}
:root:not([data-theme=dark]) #grammar-page{--muted:#766f67}
[data-theme=dark] #grammar-page .primary{color:var(--bg)}
