.grammar { --g-ink:#253b32; --g-muted:#5f6d60; --g-line:#dfe4d8; --g-soft:#edf1e8; --g-paper:#fffefb; min-width:0; color:var(--g-ink) }
.grammar-header { background:var(--g-paper); border-bottom:1px solid var(--g-line) }
.grammar-header-inner { min-height:56px; max-width:1270px; padding:0 34px; margin:auto; display:flex; align-items:center; justify-content:space-between; gap:14px }
.grammar-home-link { color:var(--g-ink); font-size:15px; font-weight:650; text-decoration:none }
.grammar-home-link:hover { text-decoration:underline; text-underline-offset:3px }
.grammar-return,.grammar-saved { color:var(--green); border:1px solid #d8dfd1; background:var(--g-paper); border-radius:7px; text-decoration:none; padding:9px 12px; font-size:13px; white-space:nowrap }
.grammar-return:hover,.grammar-saved:hover,.grammar-saved[aria-current=page] { background:var(--g-soft) }
.grammar-shell { display:grid; grid-template-columns:208px minmax(0,1fr); gap:38px; max-width:1270px; margin:auto; padding:32px 34px 64px }
.grammar-aside { padding-top:5px; align-self:start; position:sticky; top:24px }
.grammar-aside-label { color:var(--g-muted); margin:0 0 10px 10px; font-size:12px; letter-spacing:.09em }
.grammar-nav { display:grid; gap:3px }
.grammar-nav a { display:flex; align-items:baseline; gap:9px; color:var(--g-ink); border:1px solid transparent; border-radius:7px; text-decoration:none; font-size:14px; line-height:1.45; padding:9px 10px }
.grammar-nav a:hover,.grammar-nav a[aria-current] { background:var(--g-soft); border-color:#dde5d7 }
.grammar-nav .grammar-index { font-size:11px; font-weight:400 }
.grammar-main:focus { outline:none }
.grammar-tools { display:flex; gap:10px; align-items:center; margin-bottom:22px }
.grammar-search { display:flex; flex:1; align-items:center; gap:9px; min-width:0; padding:0 11px; background:var(--g-paper); border:1px solid #d8dfd1; border-radius:7px }
.grammar-search:focus-within { border-color:#759476; outline:2px solid #c7d7c6 }
.grammar-search svg { width:19px; height:19px; flex:none; stroke:var(--g-muted); fill:none; stroke-width:1.6; stroke-linecap:round }
.grammar-search input { width:100%; min-width:0; min-height:38px; border:0; background:transparent; color:inherit; outline:none; font-size:14px }
.grammar-search input:focus-visible { outline:none }
.grammar h1,.grammar h2,.grammar h3 { text-wrap:balance; letter-spacing:0 }
.grammar h1 { margin:0; font:650 clamp(27px,4vw,40px)/1.25 "Microsoft YaHei","Segoe UI",system-ui,sans-serif }
.grammar h2 { margin:0; font-size:19px; line-height:1.4 }
.grammar h3 { margin:0; font-size:15px; line-height:1.5 }
.grammar p { line-height:1.7 }
.grammar-lead { max-width:59ch; margin:9px 0 0; color:var(--g-muted); font-size:15px }
.grammar-first-steps { background:var(--g-soft); border:1px solid var(--g-line); border-radius:9px; padding:15px 18px }
.grammar-first-steps p,.grammar-gloss-hint { margin:6px 0 0; color:var(--g-muted); font-size:13px }
.grammar-first-steps ol { display:flex; flex-wrap:wrap; gap:5px 28px; margin:8px 0 0; padding-left:1.25em; font-size:14px; line-height:1.55 }
.grammar-first-steps a,.grammar-beginner-link { text-underline-offset:3px }
.grammar-section-title { margin:24px 0 12px; display:flex; flex-wrap:wrap; align-items:baseline; justify-content:space-between; gap:6px }
.grammar-section-title span,.grammar-count { color:var(--g-muted); font-size:12px }
.grammar-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px }
.grammar-card { display:block; text-decoration:none; color:inherit; padding:16px 17px; background:var(--g-paper); border:1px solid var(--g-line); border-radius:10px }
.grammar-card:hover,.grammar-rows a:hover { border-color:#a9bca4; background:#fafcf7 }
.grammar-index { font:600 13px/1.4 Georgia,serif; color:#4e7557; font-variant-numeric:tabular-nums }
.grammar-card .grammar-index { display:inline-block; padding:3px 7px; margin-bottom:8px; border-radius:4px; background:var(--g-soft) }
.grammar-card p { margin:5px 0 0; font-size:13px; color:var(--g-muted) }
.grammar-crumbs { margin:0 0 14px; display:flex; flex-wrap:wrap; gap:5px 9px; align-items:baseline; font-size:13px; color:var(--g-muted) }
.grammar-crumbs a,.grammar-related a { text-underline-offset:3px }
.grammar-page-heading { padding:5px 0 16px }
.grammar-rows { display:grid; gap:7px; padding:0; margin:6px 0 0; list-style:none }
.grammar-rows a { display:grid; grid-template-columns:32px minmax(0,1fr) auto; gap:10px; align-items:center; color:inherit; text-decoration:none; background:var(--g-paper); border:1px solid var(--g-line); border-radius:8px; padding:11px 13px }
.grammar-rows strong { display:block; font-size:15px; line-height:1.4 }
.grammar-rows small { display:block; margin-top:3px; color:var(--g-muted); font-size:13px; line-height:1.45 }
.grammar-arrow { color:#517356 }
.grammar-contents { background:var(--g-soft); border:1px solid #dbe4d6; border-radius:10px; padding:16px clamp(12px,2.4vw,22px); margin:0 0 16px }
.grammar-contents-head,.grammar-lesson-head,.grammar-detail-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px }
.grammar-contents ol { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px 16px; margin:11px 0 0; padding:0; list-style:none }
.grammar-contents a { font-size:14px; line-height:1.55; text-underline-offset:3px }
.grammar-contents a .grammar-index { margin-right:3px }
.grammar-chapter { background:var(--g-paper); border:1px solid var(--g-line); border-radius:12px }
.grammar-lesson { padding:clamp(17px,3.4vw,29px); scroll-margin-top:18px }
.grammar-lesson + .grammar-lesson { border-top:2px solid var(--g-line) }
.grammar-lesson h2 { font-size:clamp(20px,3vw,26px); text-wrap:pretty }
.grammar-lesson h2 .grammar-index { vertical-align:middle; font-size:.66em; margin-right:5px }
.grammar-lesson-actions { display:flex; align-items:center; gap:9px; flex:none }
.grammar-lesson-actions a { font-size:12px; text-underline-offset:3px }
.grammar-explanation { max-width:80ch; margin:10px 0 0; font-size:15px }
.grammar-explanation [lang=es],.grammar-table [lang=es] { color:#284d3a }
.grammar-beginner { margin:13px 0 16px; padding:13px 15px; border:1px solid #dde7d9; border-radius:8px; background:#f4f7f1 }
.grammar-beginner h3 { color:var(--green) }
.grammar-beginner p { margin:5px 0 0; font-size:14px }
.grammar-beginner-example { display:flex; align-items:center; justify-content:space-between; gap:8px; margin:8px 0; padding:8px 0; border-block:1px solid #e0e7da }
.grammar-beginner-sentence { font-size:17px; line-height:1.6; color:#284d3a }
.grammar-beginner-link { display:inline-block; margin-top:7px; font-size:12px }
.grammar-term { color:var(--g-muted); font:17px/1.45 Georgia,serif; margin:6px 0 0 }
.grammar-bookmark { flex:none; padding:7px 9px; background:var(--g-paper); border:1px solid #d8dfd1; border-radius:7px; font-size:13px }
.grammar-bookmark[aria-pressed=true] { background:var(--g-soft); border-color:#a9bca4 }
.grammar-rule-list { margin:8px 0 0; padding-left:1.3em; font-size:15px; line-height:1.75 }
.grammar-rule-list li+li { margin-top:4px }
.grammar-table-wrap { overflow:auto; margin:16px 0 0; border:1px solid var(--g-line); border-radius:8px }
.grammar-table-wrap:focus-visible { outline:2px solid #759476; outline-offset:2px }
.grammar-table { width:100%; min-width:26rem; border-collapse:collapse; font-size:14px; line-height:1.6 }
.grammar-table-wide { min-width:30rem }
.grammar-table caption { text-align:left; font-weight:700; padding:10px 12px; background:#e6eee2; color:#254a37 }
.grammar-table th,.grammar-table td { vertical-align:top; text-align:left; padding:9px 11px; border-bottom:1px solid var(--g-line); overflow-wrap:anywhere }
.grammar-table thead th { font-size:13px; background:#f1f5ef; color:#3f5849 }
.grammar-table tbody th { font-weight:650 }
.grammar-table tbody tr:nth-child(even) { background:#f8faf6 }
.grammar-table tbody tr:last-child > * { border-bottom:0 }
.grammar-table:not(.grammar-table-wide) tbody th { width:22% }
.grammar-detail .grammar-table tbody th { width:50% }
.grammar-sentence { display:flex; align-items:center; gap:6px; justify-content:space-between; font-size:15px }
.grammar-translation { display:block; margin-top:2px; color:var(--g-muted); font-size:13px }
.grammar-gloss-token { display:inline; color:inherit; background:none; border:0; border-radius:2px; padding:0; font:inherit; text-align:left; text-decoration:underline dotted #7b9681; text-underline-offset:3px; cursor:help; white-space:normal }
.grammar-gloss-token:hover,.grammar-gloss-token:focus-visible { background:#e3eddf; text-decoration-color:currentColor }
.grammar-gloss-token:focus-visible { outline-offset:2px }
.grammar-gloss-tip { position:fixed; top:0; left:0; z-index:80; width:max-content; max-width:min(280px,calc(100vw - 16px)); padding:7px 10px; border:1px solid #335542; border-radius:6px; color:#fffefb; background:#254a37; box-shadow:0 3px 9px #182b213b; font-size:13px; line-height:1.5; overflow-wrap:anywhere; pointer-events:none }
.grammar-speed { color:var(--g-muted); font-size:12px; white-space:nowrap }
.grammar-speed select { margin-left:5px; padding:3px 4px; border:1px solid #d8dfd1; border-radius:4px; background:var(--g-paper); color:var(--g-ink) }
.grammar-play { display:inline-grid; place-items:center; width:31px; height:31px; flex:none; border:1px solid #dce4d7; background:var(--g-paper); border-radius:7px; color:var(--green) }
.grammar-play:hover,.grammar-play[aria-pressed=true] { background:var(--g-soft) }
.grammar-play svg { width:17px; height:17px }
.grammar-audio-status { position:fixed; right:20px; bottom:16px; z-index:5; max-width:min(340px,calc(100% - 40px)); background:#fff6e7; border:1px solid #dfc6a1; padding:9px 13px; border-radius:7px; color:#734e25; font-size:13px }
.grammar-contrast { padding:12px 15px; border-radius:8px; background:#f8f5eb; border:1px solid #e9e2ce }
.grammar-detail-list { margin-top:22px }
.grammar-detail-list h3 { margin-bottom:6px; color:var(--g-muted) }
.grammar-detail { border-top:1px solid var(--g-line); scroll-margin-top:18px }
.grammar-detail summary { color:var(--green); cursor:pointer; font-size:14px; line-height:1.55; padding:8px 0 }
.grammar-detail[open] summary { font-weight:650 }
.grammar-detail-body { padding:5px 0 16px; font-size:14px }
.grammar-related { display:flex; flex-wrap:wrap; gap:7px 16px; margin:8px 0 0; font-size:14px }
.grammar-empty { color:var(--g-muted); font-size:14px }
.grammar-reference { margin-top:24px; color:var(--g-muted); font-size:12px }
.grammar .skip-link { left:12px }
@media (max-width:820px) {
  .grammar-shell { grid-template-columns:174px minmax(0,1fr); padding:24px 20px 46px; gap:22px }
  .grammar-header-inner { padding:0 20px }
}
@media (max-width:620px) {
  .grammar-header-inner { min-height:54px; padding:0 14px }
  .grammar-shell { display:block; padding:16px 12px 40px }
  .grammar-aside { display:none }
  .grammar-grid { grid-template-columns:1fr }
  .grammar-return,.grammar-saved { padding:8px; font-size:12px }
  .grammar-search { padding:0 7px; gap:5px }
  .grammar-search input { font-size:13px }
  .grammar-contents ol { grid-template-columns:1fr }
  .grammar-lesson { padding:15px 12px }
  .grammar-lesson-head { flex-wrap:wrap }
  .grammar-lesson-actions { margin-left:auto }
  .grammar-table th,.grammar-table td { padding:8px }
}
