/* AbOnlinEnglish Grammar hub (/grammar) — same tokens as gr-lesson.css */
:root {
  --navy: #10243e; --navy-2: #1c3a5e; --orange: #e8792c; --orange-d: #c8601a;
  --bg: #faf8f4; --surface: #fff; --surface-2: #f4f2ee; --line: #e4e0d8; --line-2: #d2ccc1;
  --text: #1b2330; --text-2: #4a5566; --text-3: #6b7585;
  --ok: #177a45; --ok-bg: #e8f6ee; --rev: #b85510; --rev-bg: #fdf0e4;
  --A1: #177a45; --A2: #147a72; --B1: #1f5fa6; --B2: #5b35a0; --C1: #b85510;
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "Outfit", "Segoe UI", system-ui, -apple-system, sans-serif;
  --wrap: 1080px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1621; --surface: #151f2d; --surface-2: #1b2636; --line: #273447; --line-2: #34445b;
    --text: #eef2f7; --text-2: #b7c2d1; --text-3: #8e9bb0; --ok: #5cc98d; --ok-bg: #173226; --rev: #f0a15e; --rev-bg: #3a2616;
    --A1: #5cc98d; --A2: #4fc2b8; --B1: #7fb2ec; --B2: #b79af0; --C1: #f0a15e;
  }
}
*, *::before, *::after { box-sizing: border-box; }
body.hb { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-body); font-size: 17px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
.hb a { color: inherit; }
.hb :focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 6px; }
.hb-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hb-skip { position: absolute; left: -999px; top: 0; background: var(--navy); color: #fff; padding: 10px 16px; z-index: 50; }
.hb-skip:focus { left: 0; }
.hb-wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

/* brand bar (same as lessons) */
.hb-brand { background: var(--navy); color: #fff; }
.hb-brand-in { max-width: var(--wrap); margin: 0 auto; padding: 8px 20px; display: flex; align-items: center; gap: 14px; }
.hb-home { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; min-width: 0; }
.hb-home img { width: 40px; height: 40px; border-radius: 50%; background: #fff; flex: none; }
.hb-name { font-weight: 700; letter-spacing: .06em; font-size: .8rem; line-height: 1.2; }
.hb-name small { display: block; font-weight: 500; letter-spacing: .04em; color: #b8c8dc; font-size: .72rem; }
.hb-links { margin-left: auto; display: flex; gap: 18px; font-size: .9rem; }
.hb-links a { color: #d9e4f1; text-decoration: none; font-weight: 600; }
.hb-links a:hover { color: #fff; text-decoration: underline; }

/* header */
.hb-top { padding: 22px 0 28px; }
.hb-crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; padding: 0; font-size: .85rem; color: var(--text-3); }
.hb-crumbs li:not(:last-child)::after { content: "›"; margin-left: 6px; }
.hb-crumbs a { color: var(--text-3); text-decoration: none; }
.hb-crumbs a:hover { text-decoration: underline; color: var(--text); }
.hb-eyebrow { margin: 0 0 4px; font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--orange-d); }
.hb h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(2.1rem, 4.4vw, 3rem); line-height: 1.08; margin: 0 0 10px; color: var(--navy); }
@media (prefers-color-scheme: dark) { .hb h1 { color: var(--text); } }
.hb-lead { margin: 0; max-width: 64ch; color: var(--text-2); }

/* level path A1 -> C1 : one connected strip */
.hb-path { margin-top: 22px; }
.hb-path ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.hb-path li + li { border-left: 1px solid var(--line); }
.hb-step { position: relative; display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; padding: 14px 16px 16px; text-decoration: none; height: 100%; transition: background .15s; }
.hb-step:hover { background: var(--surface-2); }
.hb-step-code { grid-row: span 2; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; color: #fff; font-size: .95rem; }
.hb-step-name { font-weight: 600; line-height: 1.2; }
.hb-step-n { font-size: .82rem; color: var(--text-3); line-height: 1.2; }
.hb-bar { grid-column: 1 / -1; margin-top: 10px; height: 4px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.hb-bar span { display: block; height: 100%; width: 0; border-radius: 4px; }
.hb-step[aria-current] { background: var(--surface-2); box-shadow: inset 0 -3px 0 var(--orange); }
.hb-step[aria-current] .hb-step-name::after { content: " · buradasın"; font-weight: 500; color: var(--text-3); font-size: .82rem; }
.hb-step-A1 .hb-step-code, .hb-step-A1 .hb-bar span { background: var(--A1); }
.hb-step-A2 .hb-step-code, .hb-step-A2 .hb-bar span { background: var(--A2); }
.hb-step-B1 .hb-step-code, .hb-step-B1 .hb-bar span { background: var(--B1); }
.hb-step-B2 .hb-step-code, .hb-step-B2 .hb-bar span { background: var(--B2); }
.hb-step-C1 .hb-step-code, .hb-step-C1 .hb-bar span { background: var(--C1); }
@media (prefers-color-scheme: dark) { .hb-step-code { color: #0f1621; } }
@media (max-width: 820px) {
  .hb-path ol { grid-template-columns: 1fr; }
  .hb-path li + li { border-left: 0; border-top: 1px solid var(--line); }
  .hb-step { grid-template-columns: auto 1fr auto; padding: 10px 14px; }
  .hb-step-code { grid-row: auto; width: 36px; height: 36px; }
  .hb-step-n { grid-column: 3; grid-row: 1; }
  .hb-bar { display: none; }
}

/* sticky tools bar */
.hb-bar-sticky { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.hb-tools { display: flex; align-items: center; gap: 12px; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
.hb-search { flex: 1 1 260px; }
.hb-search input { width: 100%; font: inherit; font-size: 1rem; padding: 10px 14px 10px 40px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%236b7585' stroke-width='2'%3E%3Ccircle cx='7.5' cy='7.5' r='6'/%3E%3Cline x1='12' y1='12' x2='17' y2='17'/%3E%3C/svg%3E") 13px center no-repeat; color: var(--text); }
.hb-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.hb-chips button { font: inherit; font-size: .9rem; font-weight: 600; padding: 7px 14px; min-height: 40px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2); cursor: pointer; }
.hb-chips button:hover { border-color: var(--navy-2); color: var(--text); }
.hb-chips button[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.hb-jump { position: relative; }
.hb-jump summary { list-style: none; cursor: pointer; font-weight: 600; font-size: .9rem; padding: 8px 14px; min-height: 40px; display: flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); }
.hb-jump summary::-webkit-details-marker { display: none; }
.hb-jump summary::after { content: "▾"; font-size: .8rem; color: var(--text-3); }
.hb-jump-list { position: absolute; right: 0; top: calc(100% + 6px); width: 300px; max-height: 60vh; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 14px 34px rgba(16,36,62,.16); padding: 6px; display: flex; flex-direction: column; }
.hb-jump-list a { padding: 8px 12px; border-radius: 8px; text-decoration: none; font-size: .95rem; }
.hb-jump-list a:hover { background: var(--surface-2); }
@media (max-width: 560px) { .hb-jump-list { right: auto; left: 0; width: min(300px, calc(100vw - 40px)); } .hb-chips button { padding: 6px 11px; } }

/* continue box */
.hb-continue { margin-top: 22px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--orange); border-radius: 14px; padding: 14px 18px; }
.hb-continue h2 { font-family: var(--font-body); font-size: 1rem; margin: 0 0 6px; }
.hb-continue ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.hb-continue a { display: inline-block; text-decoration: none; font-size: .92rem; font-weight: 600; padding: 6px 12px; border-radius: 999px; background: var(--rev-bg); color: var(--rev); }
.hb-empty { margin: 24px 0; color: var(--text-2); }

/* groups */
.hb-group { margin-top: 30px; scroll-margin-top: 80px; }
.hb-gh { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; padding-bottom: 10px; border-bottom: 2px solid var(--navy); }
@media (prefers-color-scheme: dark) { .hb-gh { border-bottom-color: var(--line-2); } }
.hb-gh h2 { font-family: var(--font-display); font-weight: 700; font-size: 1.75rem; line-height: 1.1; margin: 0; color: var(--navy); }
@media (prefers-color-scheme: dark) { .hb-gh h2 { color: var(--text); } }
.hb-gtr { color: var(--text-2); font-weight: 500; }
.hb-gc { margin-left: auto; font-size: .85rem; color: var(--text-3); }
.hb-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; column-gap: 28px; }
@media (max-width: 760px) { .hb-list { grid-template-columns: 1fr; } }
.hb-list li { border-bottom: 1px solid var(--line); }
.hb-list a { display: flex; align-items: center; gap: 12px; padding: 11px 6px; text-decoration: none; border-radius: 8px; }
.hb-list a:hover { background: var(--surface); }
.hb-list a:hover .hb-en { color: var(--orange-d); }
.hb-lvl { flex: none; width: 34px; text-align: center; font-size: .75rem; font-weight: 700; padding: 3px 0; border-radius: 6px; border: 1.5px solid currentColor; }
.hb-lvl-A1 { color: var(--A1); } .hb-lvl-A2 { color: var(--A2); } .hb-lvl-B1 { color: var(--B1); } .hb-lvl-B2 { color: var(--B2); } .hb-lvl-C1 { color: var(--C1); }
.hb-t { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.hb-en { font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.hb-tr { font-size: .88rem; color: var(--text-3); line-height: 1.3; }
.hb-st { flex: none; font-size: .75rem; font-weight: 700; border-radius: 999px; }
.hb-st:not(:empty) { padding: 2px 9px; }
.hb-st[data-s="done"] { background: var(--ok-bg); color: var(--ok); }
.hb-st[data-s="review"] { background: var(--rev-bg); color: var(--rev); }
.hb-st[data-s="started"] { background: var(--surface-2); color: var(--text-3); }
.hb-list li[hidden], .hb-group[hidden] { display: none; }

/* level-to-level nav (level pages) */
.hb-lvnav { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-top: 36px; }
.hb-lvnav a { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; text-decoration: none; font-weight: 600; }
.hb-lvnav a:hover { border-color: var(--orange); }
.hb-lvnav small { font-weight: 500; color: var(--text-3); font-size: .8rem; }
.hb-lvnav-next { text-align: right; }

/* footer */
.hb-foot { margin-top: 56px; background: var(--navy); color: #b8c8dc; font-size: .88rem; }
.hb-foot-in { max-width: var(--wrap); margin: 0 auto; padding: 22px 20px; display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }
.hb-foot a { color: #e3ebf5; }
@media (max-width: 560px) { .hb-hide-sm { display: none; } .hb-name { font-size: .72rem; } body.hb { font-size: 16px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print { .hb-bar-sticky, .hb-brand, .hb-foot, .hb-continue { display: none !important; } }
.hb-hint { margin: 12px 0 0; font-size: .92rem; color: var(--text-3); }
.hb-hint a { color: var(--orange-d); font-weight: 600; }
@media (max-width: 560px) {
  .hb-bar-sticky { position: static; backdrop-filter: none; }
  .hb-tools { gap: 10px; }
  .hb-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; flex: 1 1 0; min-width: 0; }
  .hb-chips::-webkit-scrollbar { display: none; }
  .hb-chips button { flex: none; }
  .hb-jump summary { padding: 6px 12px; }
  .hb-jump-list { right: 0; left: auto; }
}
