:root {
  --ink: #172033;
  --muted: #657086;
  --paper: #f5f7fb;
  --surface: #ffffff;
  --line: #dfe5ef;
  --blue: #2457d6;
  --blue-dark: #173a91;
  --aqua: #12a7a1;
  --yellow: #ffd75e;
  --radius: 20px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

.training-hero { padding: clamp(4rem, 9vw, 8rem) 0; background: linear-gradient(135deg, #102a43, #173f5f 58%, #1f6f78); color: #fff; }
.training-hero h1 { max-width: 900px; margin: .2rem 0 1rem; font-size: clamp(2.6rem, 7vw, 5.5rem); line-height: .94; }
.training-hero p { max-width: 720px; font-size: 1.1rem; line-height: 1.7; }
.training-jumps { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
.training-jumps a { padding: .8rem 1.2rem; border: 1px solid rgba(255,255,255,.45); border-radius: 999px; color: #fff; text-decoration: none; font-weight: 700; }
.training-jumps a:hover { background: #fff; color: #173f5f; }
.training-group:nth-of-type(odd) { background: #f4f7f9; }
.training-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 1rem; }
.training-card { display: flex; min-height: 190px; flex-direction: column; padding: 1.5rem; border: 1px solid #d9e2ec; border-radius: 18px; background: #fff; color: inherit; text-decoration: none; box-shadow: 0 8px 24px rgba(16,42,67,.06); transition: transform .2s ease, box-shadow .2s ease; }
.training-card:hover { transform: translateY(-3px); box-shadow: 0 14px 32px rgba(16,42,67,.12); }
.training-card h3 { margin: .45rem 0 1.4rem; font-size: 1.2rem; line-height: 1.35; }
.training-card .card-link { margin-top: auto; }
.training-group { scroll-margin-top: 5rem; }
.reading-source { margin-bottom: 2rem; padding: clamp(1.25rem, 3vw, 2rem); overflow-x: auto; border: 1px solid #d9e2ec; border-radius: 18px; background: #fff; box-shadow: 0 8px 24px rgba(16,42,67,.06); line-height: 1.65; }
.reading-source > p:first-of-type { margin-top: 0; }
.reading-source table { width: 100%; min-width: 680px; border-collapse: collapse; }
.reading-source td { width: 50%; padding: 1rem; vertical-align: top; border: 1px solid #d9e2ec; }
.reading-source img { display: block; max-width: 100%; height: auto; margin: 1rem auto; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-size: 1rem; line-height: 1.65; background: var(--paper); }
a { color: inherit; }
img { max-width: 100%; }

.skip-link { position: absolute; left: -999px; top: 0; z-index: 20; padding: .7rem 1rem; background: #fff; }
.skip-link:focus { left: 1rem; top: 1rem; }
.shell { width: min(1120px, calc(100% - 2rem)); margin-inline: auto; }

.site-header { position: sticky; top: 0; z-index: 10; border-bottom: 1px solid rgba(223,229,239,.9); background: rgba(255,255,255,.94); backdrop-filter: blur(14px); }
.header-inner { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.brand { display: inline-flex; align-items: center; gap: .75rem; color: var(--ink); font-weight: 850; text-decoration: none; letter-spacing: -.02em; }
.brand-mark { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 13px; color: #fff; background: linear-gradient(135deg, var(--blue), var(--aqua)); box-shadow: 0 8px 22px rgba(36,87,214,.2); }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; }
.nav a { padding: .55rem .75rem; border-radius: 10px; color: #3d485e; font-size: .92rem; font-weight: 700; text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--blue-dark); background: #edf2ff; }
.nav a[href="/informatik/"] { color: #9aa3b3; background: transparent; opacity: .62; pointer-events: none; cursor: not-allowed; }

.hero { position: relative; overflow: visible; padding: clamp(.75rem, 1.5vw, 1.25rem) 0 0; background: radial-gradient(circle at 88% 12%, rgba(18,167,161,.2), transparent 30rem), radial-gradient(circle at 12% 0%, rgba(36,87,214,.16), transparent 28rem), var(--surface); }
.hero-layout { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(300px, .72fr); align-items: center; gap: clamp(2rem, 5vw, 4.5rem); }
.hero-content { position: relative; z-index: 2; }
.eyebrow { margin: 0 0 1rem; color: var(--blue); font-size: .82rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, h3 { line-height: 1.12; letter-spacing: -.035em; }
h1 { max-width: 820px; margin: 0; font-size: clamp(2.35rem, 6vw, 4.8rem); }
.home-title { max-width: none; white-space: nowrap; font-size: clamp(1.9rem, 5.4vw, 4.4rem); }
.hero-copy { max-width: 720px; margin: 1.05rem 0 0; color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.3rem); }
.hero-link { display: inline-flex; align-items: center; gap: .65rem; margin-top: 1.35rem; color: var(--blue-dark); font-weight: 850; text-decoration: none; }
.hero-link span { display: grid; width: 2rem; height: 2rem; place-items: center; border-radius: 50%; color: #fff; background: var(--blue); transition: transform .18s ease; }
.hero-link:hover span { transform: translateY(3px); }
.hero-visual { position: relative; z-index: 11; isolation: isolate; align-self: stretch; min-height: 330px; display: grid; align-items: end; justify-items: center; margin: 0; }
.hero-portrait-wrap { position: absolute; inset: auto 0 0; display: grid; justify-items: center; align-items: end; }
.hero-portrait-wrap img { width: min(275px, 100%); max-height: 360px; display: block; object-fit: contain; object-position: center bottom; filter: drop-shadow(0 24px 30px rgba(23,32,51,.18)); }
.hero-shape { position: absolute; z-index: -1; display: block; }
.hero-shape-one { width: 145px; height: 145px; right: 28px; top: 24px; border-radius: 38px; background: var(--yellow); transform: rotate(18deg); }
.hero-shape-two { width: 105px; height: 105px; left: -22px; bottom: 16px; border-radius: 50%; background: linear-gradient(135deg, var(--aqua), #73dfd9); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }
.button { display: inline-flex; min-height: 48px; align-items: center; justify-content: center; padding: .75rem 1.1rem; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); font-weight: 800; text-decoration: none; }
.button.primary { border-color: var(--blue); color: #fff; background: var(--blue); }
.button:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(29,45,80,.12); }

.section { padding: 4.5rem 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 1.7rem; }
.section-head h2 { margin: 0; font-size: clamp(1.9rem, 4vw, 3rem); }
.section-head p { max-width: 560px; margin: 0; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.card { min-height: 235px; display: flex; flex-direction: column; padding: 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); color: inherit; background: var(--surface); box-shadow: 0 14px 40px rgba(35,51,84,.06); text-decoration: none; }
.card-clickable { cursor: pointer; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.card-clickable:hover { transform: translateY(-3px); border-color: #c8d5f2; box-shadow: 0 20px 48px rgba(35,51,84,.13); }
.card-clickable:focus-visible { outline: 3px solid rgba(36,87,214,.35); outline-offset: 3px; }
.card-kicker { color: var(--blue); font-size: .78rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.card h2, .card h3 { margin: .55rem 0 .5rem; font-size: 1.55rem; }
.grid > .card h3 { margin-top: 0; color: var(--blue); }
.card p { margin: 0 0 1.5rem; color: var(--muted); }
.card-link { margin-top: auto; color: var(--blue-dark); font-weight: 850; text-decoration: none; }
.card-link:hover { text-decoration: underline; }
.card.featured { color: #fff; border-color: transparent; background: linear-gradient(145deg, #111735, #25347c); }
.grid > .card.featured h3 { color: #fff; }
.card.featured .card-kicker, .card.featured p, .card.featured .card-link { color: #e6ebff; }
.card-disabled { color: #8b94a5; border-color: #e4e8ef; background: #eef1f5; box-shadow: none; filter: grayscale(.35); }
.card-disabled .card-kicker, .card-disabled p, .card-disabled .card-link { color: #939cab; }
.card-disabled .card-link { text-decoration: none; }

.page-head { padding: 4rem 0 2.5rem; background: #fff; }
.page-head h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); }
.page-head p { max-width: 720px; color: var(--muted); font-size: 1.15rem; }
.filters { display: flex; flex-wrap: wrap; gap: .65rem; margin: 1.5rem 0 2rem; }
.filter { padding: .55rem .8rem; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: #40506b; font: inherit; font-weight: 750; cursor: pointer; }
.filter[aria-pressed="true"] { color: #fff; border-color: var(--blue); background: var(--blue); }
.empty-note { padding: 2rem; border: 1px dashed #bbc5d6; border-radius: var(--radius); color: var(--muted); background: rgba(255,255,255,.55); }
.topic-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.topic { padding: 1.35rem; border: 1px solid var(--line); border-radius: 16px; color: inherit; background: #fff; text-decoration: none; }
.topic-clickable, a.topic { cursor: pointer; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.topic-clickable:hover, a.topic:hover { transform: translateY(-3px); border-color: #c8d5f2; box-shadow: 0 16px 38px rgba(35,51,84,.11); }
.topic-clickable:focus-visible, a.topic:focus-visible { outline: 3px solid rgba(36,87,214,.35); outline-offset: 3px; }
.topic h2 { margin: 0 0 .4rem; font-size: 1.3rem; }
.topic p { margin: 0; color: var(--muted); }
.topic-disabled { color: #8b94a5; border-color: #e4e8ef; background: #eef1f5; box-shadow: none; filter: grayscale(.35); }
.topic-disabled p { color: #939cab; }
.topic-label { margin-bottom: .35rem !important; color: #087d78 !important; font-size: .75rem; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.if-topic { border-color: #b8e7e3; background: linear-gradient(145deg, #fff, #effbf9); }
.tenses-topic { border-color: #c7d4fa; background: linear-gradient(145deg, #fff, #f1f4ff); }
.grammar-topic { border-color: #bddfdc; background: linear-gradient(145deg, #fff, #eff9f8); }
.grammar-hero { background: radial-gradient(circle at 86% 12%, rgba(80,223,207,.2), transparent 25rem), linear-gradient(135deg, #101c36, #203a61); }
.grammar-hero .eyebrow { color: #67e7d8; }
.grammar-categories { align-items: stretch; }
.grammar-category { min-height: 250px; }
.grammar-category p { margin-bottom: 1.5rem; }
.if-grammar-card { border-top: 5px solid #2ec4b6; }
.tenses-grammar-card { border-top: 5px solid #536be8; }
.textwork-hero { padding: clamp(3rem, 7vw, 5.5rem) 0 3.5rem; color: #fff; background: radial-gradient(circle at 86% 12%, rgba(255,215,94,.2), transparent 25rem), linear-gradient(135deg, #172033, #243b72); }
.textwork-hero .eyebrow { color: #ffd75e; }
.textwork-hero h1 { max-width: 900px; }
.textwork-hero p:last-child { max-width: 700px; color: #d8e2f4; font-size: 1.12rem; }
.textwork-back { display: inline-block; margin-bottom: 1.5rem; color: #e9effc; font-weight: 800; text-decoration: none; }
.textwork-categories { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; }
.textwork-category, .textwork-entry { display: flex; flex-direction: column; padding: 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); color: inherit; background: #fff; box-shadow: 0 14px 40px rgba(35,51,84,.06); text-decoration: none; transition: transform .18s ease, box-shadow .18s ease; }
.textwork-category { min-height: 220px; }
.textwork-category:hover, .textwork-entry:hover { transform: translateY(-3px); box-shadow: 0 20px 46px rgba(35,51,84,.12); }
.textwork-category h2, .textwork-entry h2 { margin: .55rem 0; font-size: 1.55rem; }
.textwork-category p { margin: 0; color: var(--muted); }
.textwork-category strong, .textwork-entry strong { margin-top: auto; color: var(--blue-dark); }
.textwork-entries { display: grid; gap: .85rem; }
.textwork-entry { min-height: 155px; flex-direction: row; align-items: end; justify-content: space-between; gap: 1.5rem; }
.interactive-badge { display: inline-block; margin-left: .6rem; padding: .2rem .55rem; border-radius: 999px; color: #075d59; background: #d8f6f3; font-size: .72rem; font-weight: 900; text-transform: uppercase; }
.lesson-article { max-width: 820px; padding: clamp(1.4rem,4vw,2.6rem); border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: 0 14px 40px rgba(35,51,84,.06); font-size: 1.05rem; }
.lesson-article > :first-child { margin-top: 0; }
.lesson-article > :last-child { margin-bottom: 0; }
.lesson-article p, .lesson-article li, .lesson-article dd { line-height: 1.75; }
.lesson-article dt { margin-top: 1.25rem; font-weight: 850; }
.lesson-article dd { margin: .35rem 0 0 1.25rem; color: #44506a; }
.lesson-article .h5p-local { margin: 1.5rem 0; }
.legal-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: clamp(1.5rem, 5vw, 4rem); align-items: start; }
.legal-nav { position: sticky; top: 98px; display: grid; gap: .35rem; padding: 1.2rem; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.legal-nav strong { margin-bottom: .35rem; font-size: .82rem; letter-spacing: .07em; text-transform: uppercase; }
.legal-nav a { padding: .45rem 0; color: var(--blue-dark); font-weight: 750; text-decoration: none; }
.legal-nav a:hover { text-decoration: underline; }
.legal-article { min-width: 0; padding: clamp(1.4rem, 4vw, 2.8rem); border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: 0 14px 40px rgba(35,51,84,.06); }
.legal-article section { scroll-margin-top: 100px; }
.legal-article section + section { margin-top: 3.5rem; padding-top: 3.5rem; border-top: 1px solid var(--line); }
.legal-article h2 { margin: .2rem 0 1.5rem; font-size: clamp(1.8rem, 4vw, 2.6rem); }
.legal-article h3 { margin: 2rem 0 .55rem; font-size: 1.15rem; letter-spacing: -.015em; }
.legal-article p { margin: 0 0 1.15rem; color: #44506a; line-height: 1.8; }
.legal-article a { color: var(--blue-dark); }
.legal-article address { margin-bottom: 1.4rem; padding: 1.1rem 1.25rem; border-left: 4px solid var(--aqua); border-radius: 0 12px 12px 0; background: #f1fbfa; font-style: normal; line-height: 1.8; }
.legal-kicker { margin: 0 !important; color: var(--blue) !important; font-size: .78rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.legal-date { margin: 3rem 0 0 !important; padding-top: 1.25rem; border-top: 1px solid var(--line); color: var(--muted) !important; font-size: .9rem; }
.site-footer { margin-top: 3rem; padding: 2.5rem 0; border-top: 1px solid var(--line); color: var(--muted); background: #fff; }
.footer-inner { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer-inner a { color: var(--ink); }

@media (max-width: 820px) {
  .header-inner { align-items: flex-start; flex-direction: column; padding: .8rem 0; }
  .nav { width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: .2rem; }
  .nav a { white-space: nowrap; }
  .hero { overflow: hidden; }
  .hero-layout { grid-template-columns: 1fr; gap: 1rem; }
  .hero-content { max-width: 680px; }
  .hero-visual { z-index: auto; width: min(560px, 100%); min-height: 285px; justify-self: center; }
  .hero-portrait-wrap { position: static; }
  .hero-portrait-wrap img { max-height: 310px; }
  .grid { grid-template-columns: 1fr; }
  .topic-list { grid-template-columns: 1fr; }
  .textwork-categories { grid-template-columns: 1fr; }
  .textwork-entry { align-items: flex-start; flex-direction: column; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .legal-layout { grid-template-columns: 1fr; }
  .legal-nav { position: static; }
}

@media (max-width: 520px) {
  .hero { padding: 1.35rem 0 0; }
  .hero-layout { gap: .35rem; }
  .hero-visual { min-height: 235px; }
  .hero-portrait-wrap img { max-height: 250px; }
  .hero-shape-one { width: 100px; height: 100px; right: 14px; top: 18px; }
  .hero-shape-two { width: 75px; height: 75px; left: 8px; bottom: 10px; }
}

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

/* GSW / Erdkunde */
.gsw-hero { background: radial-gradient(circle at 82% 18%, rgba(255,211,92,.25), transparent 26rem), linear-gradient(135deg,#183b34,#236656 58%,#248578); }
.gsw-hero .eyebrow, .geography-hero .eyebrow { color: #8ff0d5; }
.geography-hero { background: radial-gradient(circle at 85% 12%, rgba(141,226,130,.24), transparent 25rem), linear-gradient(135deg,#19372f,#245f50); }
.training-jumps > span { display:inline-flex; align-items:center; gap:.45rem; padding:.8rem 1.2rem; border:1px solid rgba(255,255,255,.2); border-radius:999px; color:rgba(255,255,255,.55); font-weight:800; }
.training-jumps small { padding:.12rem .38rem; border-radius:999px; background:rgba(255,255,255,.1); font-size:.62rem; letter-spacing:.06em; text-transform:uppercase; }
.gsw-card, .geography-card { border-top:5px solid #21a179; }
.germany-head { background:radial-gradient(circle at 80% 10%,rgba(48,184,140,.15),transparent 24rem),#fff; }

/* Bundesländer board app */
.geo-exercise-page { --geo-navy:#12243b; --geo-green:#16785d; --geo-mint:#dff6ec; --geo-yellow:#ffd66b; color:#183047; background:#edf2ef; }
.geo-shell { width:min(1280px,calc(100% - 2rem)); margin-inline:auto; }
.exercise-bar { position:sticky; top:0; z-index:50; color:#fff; background:#10283a; box-shadow:0 8px 24px rgba(12,34,47,.18); }
.exercise-bar-inner { width:min(1320px,calc(100% - 2rem)); min-height:68px; display:flex; align-items:center; justify-content:space-between; gap:1rem; margin:auto; }
.exercise-brand { display:inline-flex; align-items:center; gap:.7rem; color:#fff; text-decoration:none; }
.exercise-brand span { display:grid; width:38px; height:38px; place-items:center; border-radius:12px; color:#123246; background:#86e0c3; font-weight:950; }
.exercise-bar-label { color:#a9c7d3; font-size:.78rem; font-weight:900; letter-spacing:.13em; text-transform:uppercase; }
.exercise-exit { padding:.55rem .8rem; border-radius:9px; color:#dce9ed; font-size:.86rem; font-weight:800; text-decoration:none; }
.exercise-exit:hover { background:rgba(255,255,255,.09); }
.geo-intro { padding:clamp(2rem,4vw,3.7rem) 0 1.6rem; background:linear-gradient(180deg,#f8fbf9,#edf2ef); }
.geo-kicker { margin:0 0 .45rem; color:#16785d; font-size:.72rem; font-weight:950; letter-spacing:.14em; text-transform:uppercase; }
.geo-intro h1 { max-width:none; font-size:clamp(2.4rem,5vw,4.7rem); }
.geo-intro > .geo-shell > p:nth-of-type(2) { max-width:800px; margin:.9rem 0 1.4rem; color:#587083; font-size:1.05rem; }
.board-mode-picker { display:grid; grid-template-columns:repeat(3,1fr); gap:.7rem; margin:1.4rem 0; padding:.55rem; border:1px solid #d3e0dc; border-radius:17px; background:#fff; box-shadow:0 12px 32px rgba(25,57,52,.08); }
.board-mode-picker button { min-height:58px; display:flex; align-items:center; justify-content:center; gap:.65rem; padding:.75rem 1rem; border:0; border-radius:12px; color:#526777; background:transparent; font:inherit; font-weight:900; cursor:pointer; }
.board-mode-picker button span { display:grid; width:30px; height:30px; place-items:center; border-radius:8px; background:#e8eeeb; font-size:.72rem; }
.board-mode-picker button[aria-selected="true"] { color:#fff; background:#173d4b; box-shadow:0 7px 18px rgba(20,54,68,.2); }
.board-mode-picker button[aria-selected="true"] span { color:#123246; background:#87e2c4; }
.progress-summary { display:flex; align-items:center; gap:1rem; color:#506777; font-size:.85rem; font-weight:800; }
.progress-track { width:min(340px,45vw); height:8px; overflow:hidden; border-radius:99px; background:#d6e1dd; }
.progress-track i { display:block; width:0; height:100%; border-radius:inherit; background:linear-gradient(90deg,#21a179,#77d7b3); transition:width .3s ease; }
.exercise-section { padding:1.2rem 0 3.5rem; scroll-margin-top:78px; }
.geo-exercise-page[data-mode="karte"] #hauptstaedte,.geo-exercise-page[data-mode="karte"] #nachbarn,.geo-exercise-page[data-mode="hauptstaedte"] #karte,.geo-exercise-page[data-mode="hauptstaedte"] #nachbarn,.geo-exercise-page[data-mode="nachbarn"] #karte,.geo-exercise-page[data-mode="nachbarn"] #hauptstaedte { display:none; }
.exercise-heading { display:flex; align-items:end; justify-content:space-between; gap:2rem; margin-bottom:1rem; }
.exercise-heading > div { position:relative; padding-left:4.2rem; }
.exercise-heading h2 { margin:0; font-size:clamp(1.7rem,3vw,2.7rem); }
.exercise-heading > p { max-width:520px; margin:0; color:#5b6d7a; }
.step-number { position:absolute; left:0; top:0; color:#b9c9c3; font-size:2.6rem; font-weight:950; line-height:1; }
.map-workspace,.neighbor-workspace { display:grid; grid-template-columns:minmax(0,1.25fr) minmax(300px,.75fr); gap:1rem; align-items:stretch; }
.germany-map,.neighbor-map,.term-panel,.match-card { border:1px solid #cfdcd8; border-radius:22px; background:#fff; box-shadow:0 18px 50px rgba(24,56,49,.1); }
.germany-map { position:relative; min-height:690px; display:grid; place-items:center; overflow:hidden; background:radial-gradient(circle,#fff 25%,#e7f2ec 100%); }
.germany-map > img { width:min(570px,90%); max-height:660px; object-fit:contain; }
.map-target { position:absolute; left:var(--x); top:var(--y); min-width:34px; min-height:34px; max-width:150px; padding:.35rem .55rem; border:2px solid #173d4b; border-radius:999px; color:#173d4b; background:rgba(255,255,255,.92); box-shadow:0 3px 10px rgba(17,44,55,.2); font:800 .7rem/1.1 inherit; transform:translate(-50%,-50%); cursor:pointer; }
.map-target::before { content:"?"; }
.map-target.is-correct::before { content:none; }
.map-target.is-correct { color:#fff; border-color:#16785d; background:#16785d; }
.map-target.city-dot { min-width:26px; min-height:26px; }
/* Align map markers to the rendered portrait image, not the wider board frame. */
.map-target[data-answer="Schleswig-Holstein"] { left:48%!important; top:13%!important; }
.map-target[data-answer="Hamburg"] { left:46%!important; top:20%!important; }
.map-target[data-answer="Mecklenburg-Vorpommern"] { left:62%!important; top:18%!important; }
.map-target[data-answer="Bremen"] { left:36%!important; top:27%!important; }
.map-target[data-answer="Niedersachsen"] { left:43%!important; top:34%!important; }
.map-target[data-answer="Brandenburg"] { left:67%!important; top:36%!important; }
.map-target[data-answer="Berlin"] { left:68%!important; top:33%!important; }
.map-target[data-answer="Sachsen-Anhalt"] { left:55%!important; top:42%!important; }
.map-target[data-answer="Nordrhein-Westfalen"] { left:29%!important; top:46%!important; }
.map-target[data-answer="Hessen"] { left:42%!important; top:54%!important; }
.map-target[data-answer="Thüringen"] { left:54%!important; top:53%!important; }
.map-target[data-answer="Sachsen"] { left:69%!important; top:55%!important; }
.map-target[data-answer="Rheinland-Pfalz"] { left:30%!important; top:66%!important; }
.map-target[data-answer="Saarland"] { left:23%!important; top:70%!important; }
.map-target[data-answer="Baden-Württemberg"] { left:41%!important; top:83%!important; }
.map-target[data-answer="Bayern"] { left:61%!important; top:82%!important; }
.term-panel,.match-card { padding:1.3rem; }
.panel-top { display:flex; align-items:center; justify-content:space-between; gap:1rem; margin-bottom:.8rem; }
.panel-top h3,.panel-top p { margin:0; }
.score-pill { padding:.4rem .7rem; border-radius:999px; color:#173d4b; background:#dff6ec; font-size:.82rem; font-weight:900; white-space:nowrap; }
.selection-hint,#capital-hint { min-height:2.7em; margin:.5rem 0 1rem; color:#60737e; font-size:.88rem; }
.success-text { color:#087354!important; font-weight:850; }
.chip-bank { display:flex; flex-wrap:wrap; gap:.5rem; align-content:flex-start; }
.drag-chip,.match-option { padding:.58rem .75rem; border:1px solid #cdd9d5; border-radius:10px; color:#294454; background:#f8fbfa; font:inherit; font-size:.84rem; font-weight:800; cursor:grab; }
.drag-chip:hover,.match-option:hover,.drag-chip.is-selected,.match-option.is-selected { color:#fff; border-color:#173d4b; background:#173d4b; }
.reset-button { margin-top:1.2rem; padding:.65rem .85rem; border:1px solid #c7d5d0; border-radius:9px; color:#405967; background:#fff; font:inherit; font-size:.8rem; font-weight:850; cursor:pointer; }
.is-wrong { animation:geo-shake .42s ease; border-color:#d94e4e!important; background:#fff0f0!important; }
@keyframes geo-shake { 25%{transform:translate(-54%,-50%)} 75%{transform:translate(-46%,-50%)} }
.match-card { min-height:540px; }
.match-columns { display:grid; grid-template-columns:1fr 1fr; gap:1rem; }
.match-columns h3 { margin:.5rem 0 .75rem; color:#547080; font-size:.8rem; letter-spacing:.09em; text-transform:uppercase; }
.match-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.45rem; }
.match-option { width:100%; min-height:45px; cursor:pointer; }
.match-option.is-correct { color:#0a684e; border-color:#7cccb1; background:#dcf5eb; }
.match-option.is-wrong { transform:none; }
.neighbor-map { position:relative; min-height:650px; overflow:hidden; background:radial-gradient(circle at 50% 50%,#dfeee8,#f9fbfa 60%); }
.germany-silhouette { position:absolute; inset:12% 26% 10%; display:grid; place-items:center; opacity:.42; filter:saturate(.2); }
.germany-silhouette img { width:100%; height:100%; object-fit:contain; }
.neighbor-target { position:absolute; min-width:115px; min-height:48px; padding:.45rem .65rem; border:2px dashed #7c9990; border-radius:12px; color:#587069; background:rgba(255,255,255,.92); font:800 .74rem/1.15 inherit; cursor:pointer; }
.neighbor-target span { display:block; font-size:.63rem; font-weight:700; opacity:.75; }
.neighbor-target.is-correct { color:#fff; border-style:solid; border-color:#16785d; background:#16785d; }
.n-denmark{top:4%;left:50%;transform:translateX(-50%)}.n-poland{top:21%;right:3%}.n-czechia{top:44%;right:2%}.n-austria{right:13%;bottom:4%}.n-switzerland{left:45%;bottom:2%;transform:translateX(-50%)}.n-france{left:3%;bottom:13%}.n-luxembourg{left:1%;top:56%}.n-belgium{left:2%;top:39%}.n-netherlands{left:5%;top:19%}
.neighbor-target.is-wrong { transform:none; }
.n-denmark.is-wrong,.n-switzerland.is-wrong{transform:translateX(-50%)}

@media (max-width:900px){.board-mode-picker{grid-template-columns:1fr}.map-workspace,.neighbor-workspace{grid-template-columns:1fr}.germany-map{min-height:620px}.exercise-heading{align-items:flex-start;flex-direction:column}.match-list{grid-template-columns:1fr}}
@media (max-width:600px){.exercise-bar-label{display:none}.exercise-exit{font-size:0}.exercise-exit::after{content:"Beenden";font-size:.82rem}.geo-shell{width:min(100% - 1rem,1280px)}.germany-map{min-height:520px}.map-target{min-width:28px;min-height:28px;padding:.25rem;font-size:.58rem}.match-columns{gap:.5rem}.neighbor-map{min-height:560px}.neighbor-target{min-width:90px;font-size:.66rem}.exercise-heading>div{padding-left:3.3rem}.step-number{font-size:2rem}}

/* Single-screen classroom board: keep the map coordinates above untouched. */
.geo-exercise-page { height:100dvh; overflow:hidden; }
.geo-exercise-page .exercise-bar-inner { min-height:52px; }
.geo-exercise-page .exercise-brand span { width:34px; height:34px; border-radius:10px; }
.geo-exercise-page #inhalt { height:calc(100dvh - 52px); display:flex; min-height:0; flex-direction:column; overflow:hidden; }
.geo-exercise-page .geo-intro { flex:0 0 auto; padding:.55rem 0; border-bottom:1px solid #d4e0dc; }
.geo-exercise-page .geo-intro .geo-shell { display:grid; grid-template-columns:auto minmax(420px,700px) auto; align-items:center; gap:1rem; }
.geo-exercise-page .geo-intro .geo-kicker,
.geo-exercise-page .geo-intro > .geo-shell > p:nth-of-type(2) { display:none; }
.geo-exercise-page .geo-intro h1 { font-size:clamp(1.05rem,1.7vw,1.45rem); white-space:nowrap; }
.geo-exercise-page .board-mode-picker { grid-template-columns:repeat(3,1fr); gap:.3rem; margin:0; padding:.3rem; border-radius:12px; box-shadow:none; }
.geo-exercise-page .board-mode-picker button { min-height:38px; gap:.4rem; padding:.35rem .55rem; border-radius:9px; font-size:.78rem; }
.geo-exercise-page .board-mode-picker button span { width:23px; height:23px; border-radius:6px; font-size:.62rem; }
.geo-exercise-page .progress-summary { justify-self:end; gap:.55rem; font-size:.75rem; }
.geo-exercise-page .progress-track { width:100px; height:6px; }
.geo-exercise-page .exercise-section { flex:1 1 auto; min-height:0; padding:.6rem 0 .75rem; overflow:hidden; }
.geo-exercise-page .exercise-section > .geo-shell { height:100%; display:flex; min-height:0; flex-direction:column; }
.geo-exercise-page .exercise-heading { flex:0 0 auto; align-items:center; gap:1.25rem; margin-bottom:.45rem; }
.geo-exercise-page .exercise-heading > div { padding-left:2.9rem; }
.geo-exercise-page .step-number { font-size:1.8rem; }
.geo-exercise-page .exercise-heading .geo-kicker { display:none; }
.geo-exercise-page .exercise-heading h2 { font-size:clamp(1.15rem,2vw,1.65rem); }
.geo-exercise-page .exercise-heading > p { max-width:620px; font-size:.82rem; line-height:1.35; }
.geo-exercise-page .map-workspace,
.geo-exercise-page .neighbor-workspace { flex:1 1 auto; min-height:0; }
.geo-exercise-page .germany-map,
.geo-exercise-page .neighbor-map { min-height:0; height:100%; }
.geo-exercise-page .germany-map > img { width:auto; height:96%; max-width:90%; max-height:96%; }
.geo-exercise-page .germany-map-stage { position:relative; width:min(90%,calc((100dvh - 180px) * .64)); height:auto; max-height:96%; aspect-ratio:2/3; }
.geo-exercise-page .germany-map-stage > img { display:block; width:100%; height:100%; object-fit:contain; }
.geo-exercise-page .germany-map-stage .map-target[data-answer="Schleswig-Holstein"] { left:49%!important; top:11%!important; }
.geo-exercise-page .germany-map-stage .map-target[data-answer="Hamburg"] { left:47%!important; top:23%!important; }
.geo-exercise-page .germany-map-stage .map-target[data-answer="Mecklenburg-Vorpommern"] { left:66%!important; top:16%!important; }
.geo-exercise-page .germany-map-stage .map-target[data-answer="Bremen"] { left:34%!important; top:26%!important; }
.geo-exercise-page .germany-map-stage .map-target[data-answer="Niedersachsen"] { left:43%!important; top:33%!important; }
.geo-exercise-page .germany-map-stage .map-target[data-answer="Brandenburg"] { left:73%!important; top:35%!important; }
.geo-exercise-page .germany-map-stage .map-target[data-answer="Berlin"] { left:74%!important; top:32%!important; }
.geo-exercise-page .germany-map-stage .map-target[data-answer="Sachsen-Anhalt"] { left:58%!important; top:41%!important; }
.geo-exercise-page .germany-map-stage .map-target[data-answer="Nordrhein-Westfalen"] { left:25%!important; top:46%!important; }
.geo-exercise-page .germany-map-stage .map-target[data-answer="Hessen"] { left:39%!important; top:54%!important; }
.geo-exercise-page .germany-map-stage .map-target[data-answer="Thüringen"] { left:56%!important; top:53%!important; }
.geo-exercise-page .germany-map-stage .map-target[data-answer="Sachsen"] { left:75%!important; top:55%!important; }
.geo-exercise-page .germany-map-stage .map-target[data-answer="Rheinland-Pfalz"] { left:23%!important; top:67%!important; }
.geo-exercise-page .germany-map-stage .map-target[data-answer="Saarland"] { left:14%!important; top:71%!important; }
.geo-exercise-page .germany-map-stage .map-target[data-answer="Baden-Württemberg"] { left:40%!important; top:84%!important; }
.geo-exercise-page .germany-map-stage .map-target[data-answer="Bayern"] { left:65%!important; top:83%!important; }
.geo-exercise-page .term-panel,
.geo-exercise-page .match-card { min-height:0; height:100%; padding:1rem; overflow:auto; }
.geo-exercise-page .match-card { flex:1 1 auto; }
.geo-exercise-page .match-option { min-height:36px; padding:.38rem .55rem; font-size:.76rem; }
.geo-exercise-page .match-list { gap:.3rem; }
.geo-exercise-page .match-columns h3 { margin:.25rem 0 .45rem; }
.geo-exercise-page .selection-hint,
.geo-exercise-page #capital-hint { min-height:auto; margin:.25rem 0 .65rem; font-size:.78rem; }
.geo-exercise-page .drag-chip { padding:.42rem .58rem; font-size:.76rem; }
.geo-exercise-page .reset-button { margin-top:.7rem; padding:.48rem .65rem; }
.geo-exercise-page .site-footer { display:none; }

@media (max-width:900px) {
  .geo-exercise-page { overflow:auto; }
  .geo-exercise-page #inhalt { height:auto; min-height:calc(100dvh - 52px); overflow:visible; }
  .geo-exercise-page .geo-intro .geo-shell { grid-template-columns:1fr; gap:.45rem; }
  .geo-exercise-page .geo-intro h1 { display:none; }
  .geo-exercise-page .progress-summary { display:none; }
  .geo-exercise-page .exercise-section { min-height:calc(100dvh - 112px); overflow:visible; }
  .geo-exercise-page .map-workspace,
  .geo-exercise-page .neighbor-workspace { grid-template-columns:1fr 300px; }
  .geo-exercise-page .germany-map,
  .geo-exercise-page .neighbor-map { min-height:0; }
}

/* Tenses timeline */
.tenses-page { --t-navy: #101932; --t-paper: #f1f4f8; --t-ink: #152039; --t-muted: #667188; min-height: 100vh; color: var(--t-ink); background: var(--t-paper); }
.tenses-appbar { color: #fff; background: var(--t-navy); }
.tenses-appbar-inner { width: min(1320px, calc(100% - 2rem)); min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-inline: auto; }
.tenses-brand { display: inline-flex; align-items: center; gap: .7rem; color: #fff; text-decoration: none; }
.tenses-brand > span { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 50%; color: var(--t-navy); background: #fff; font: 900 1.3rem Georgia, serif; }
.tenses-brand strong { font-size: 1rem; letter-spacing: -.015em; }
.tenses-exit { padding: .5rem .75rem; border-radius: 9px; color: #cdd7ee; font-size: .88rem; font-weight: 800; text-decoration: none; }
.tenses-exit:hover { color: #fff; background: rgba(255,255,255,.08); }
.tenses-main { width: min(1320px, calc(100% - 2rem)); margin-inline: auto; }
.tenses-intro { display: grid; grid-template-columns: 1.25fr .75fr; align-items: end; gap: clamp(2rem, 7vw, 7rem); padding: clamp(2.3rem, 5vw, 4.6rem) 0 2rem; }
.tenses-kicker, .board-overline { margin: 0 0 .55rem; color: #4964d8; font-size: .72rem; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.tenses-intro h1 { max-width: none; font-size: clamp(2.8rem, 6vw, 5.8rem); letter-spacing: -.055em; }
.tenses-intro > p { max-width: 570px; margin: 0 0 .65rem; color: var(--t-muted); font-size: clamp(1rem, 1.7vw, 1.16rem); }
.timeline-board { overflow: hidden; border: 1px solid #d8dfeb; border-radius: 24px; background: #fff; box-shadow: 0 22px 65px rgba(33,45,76,.11); }
.board-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; padding: 1.3rem 1.5rem 1.15rem; border-bottom: 1px solid #e1e6ee; }
.board-heading h2 { margin: 0; font-size: clamp(1.45rem, 3vw, 2.15rem); }
.board-actions-compact { display: flex; gap: .45rem; }
.board-mini-button { min-height: 38px; padding: .45rem .75rem; border: 1px solid #d8dfeb; border-radius: 9px; color: #46536b; background: #f7f9fc; font: inherit; font-size: .8rem; font-weight: 850; cursor: pointer; }
.board-mini-button:hover { color: #fff; border-color: var(--t-navy); background: var(--t-navy); }
.timeline-scroll { overflow-x: auto; outline-offset: -3px; }
.timeline { --active-rows: 1; position: relative; min-width: 900px; min-height: max(400px, calc(104px + var(--active-rows) * 58px)); overflow: hidden; transition: min-height .25s ease; }
.time-zones { position: absolute; inset: 0 0 46px; display: grid; grid-template-columns: 42% 16% 42%; }
.zone { position: relative; padding: 1rem 1.25rem; }
.zone span { color: rgba(21,32,57,.5); font-size: .72rem; font-weight: 950; letter-spacing: .16em; text-transform: uppercase; }
.zone-past { background: #f1e7e2; }
.zone-present { text-align: center; background: #dcefeb; }
.zone-future { text-align: right; background: #e6e7f5; }
.now-line { position: absolute; z-index: 2; top: 0; bottom: 46px; left: 50%; width: 2px; background: #101932; }
.now-line::before { content: ""; position: absolute; left: 50%; bottom: -7px; width: 12px; height: 12px; border-radius: 50%; background: #101932; transform: translateX(-50%); }
.now-line span { position: absolute; top: 14px; left: 50%; padding: .18rem .45rem; border-radius: 5px; color: #fff; background: #101932; font-size: .62rem; font-weight: 950; letter-spacing: .12em; transform: translateX(-50%); }
.tense-bars { position: absolute; z-index: 3; inset: 72px 0 48px; }
.tense-bar { position: absolute; top: calc(var(--bar-row) * 58px); left: var(--bar-left); width: var(--bar-width); height: 46px; display: flex; align-items: center; gap: .5rem; padding: .45rem .75rem; overflow: hidden; border: 0; border-radius: 9px; color: #fff; background: var(--bar-color); box-shadow: 0 6px 14px rgba(33,45,76,.16); text-align: left; font: inherit; cursor: pointer; animation: bar-in .3s ease both; }
.tense-bar::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); pointer-events: none; }
.tense-bar:hover { filter: brightness(.93); transform: translateY(-1px); }
.tense-bar:focus-visible { outline: 3px solid #101932; outline-offset: 3px; }
.tense-bar span { overflow: hidden; font-size: .82rem; font-weight: 950; text-overflow: ellipsis; white-space: nowrap; }
.tense-bar small { margin-left: auto; overflow: hidden; font-size: .64rem; font-weight: 750; opacity: .83; text-overflow: ellipsis; white-space: nowrap; }
.tense-bar.simple-past small, .tense-bar.simple-present small, .tense-bar.present-progressive small { display: none; }
.past-progressive { background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.12) 0 8px, transparent 8px 16px); }
.present-perfect::after, .going-to-future::after { border-right: 4px solid rgba(255,255,255,.85); }
.simple-present { background-image: repeating-linear-gradient(90deg, transparent 0 8px, rgba(255,255,255,.18) 8px 11px); }
.timeline-empty { position: absolute; z-index: 2; inset: 72px 0 46px; display: grid; place-content: center; justify-items: center; color: #6d7584; text-align: center; }
.timeline-empty[hidden] { display: none; }
.timeline-empty .empty-arrow { font-size: 2rem; line-height: 1; }
.timeline-empty strong { color: #2f3b51; font-size: 1.15rem; }
.timeline-empty small { margin-top: .25rem; }
.timeline-axis { position: absolute; z-index: 4; right: 0; bottom: 0; left: 0; height: 46px; display: flex; align-items: center; padding: 0 1.2rem; background: #fff; }
.timeline-axis span { flex: 1; height: 2px; background: #8791a5; }
.timeline-axis span:last-child::after { content: ""; float: right; width: 9px; height: 9px; border-top: 2px solid #8791a5; border-right: 2px solid #8791a5; transform: translateY(-4px) rotate(45deg); }
.timeline-axis i { width: 9px; height: 9px; margin: 0 2px; border-radius: 50%; background: #101932; }
.example-panel { position: relative; grid-template-columns: 7px 1fr auto; gap: 1.25rem; align-items: center; margin: 0; padding: 1.3rem 1.5rem; border-top: 1px solid #e1e6ee; background: #fff; }
.example-panel:not([hidden]) { display: grid; }
.example-accent { align-self: stretch; min-height: 76px; border-radius: 99px; }
.example-panel p { margin: 0; }
.example-panel > div:nth-child(2) > p:first-child { color: #68748a; font-size: .7rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.example-panel blockquote { margin: .15rem 0 .3rem; font-size: clamp(1.15rem, 2.5vw, 1.6rem); font-weight: 850; letter-spacing: -.02em; }
.example-panel .example-note { color: #667188; font-size: .88rem; }
.example-panel button { align-self: start; width: 34px; height: 34px; border: 0; border-radius: 50%; color: #536078; background: #eef1f6; font: 400 1.4rem/1 inherit; cursor: pointer; }
.tense-picker { padding: clamp(3rem, 6vw, 5.2rem) 0; }
.picker-heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 1.4rem; }
.picker-heading h2 { margin: 0; font-size: clamp(2rem, 4vw, 3.5rem); }
.picker-heading > p { margin: 0 0 .35rem; color: #6a7588; font-weight: 750; }
.picker-count { display: inline-grid; width: 2rem; height: 2rem; place-items: center; margin-right: .3rem; border-radius: 50%; color: #fff; background: var(--t-navy); }
.tense-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; }
.tense-option { min-height: 82px; display: flex; align-items: center; gap: .8rem; padding: .9rem; border: 1px solid #d9e0e9; border-radius: 13px; color: #26324a; background: #fff; text-align: left; font: inherit; cursor: pointer; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.tense-option:hover { transform: translateY(-2px); border-color: var(--tense-color); box-shadow: 0 10px 25px rgba(33,45,76,.08); }
.tense-option[aria-pressed="true"] { border-color: var(--tense-color); box-shadow: inset 4px 0 var(--tense-color), 0 10px 25px rgba(33,45,76,.08); }
.tense-check { flex: 0 0 28px; display: grid; width: 28px; height: 28px; place-items: center; border: 2px solid #cbd2dd; border-radius: 8px; color: transparent; background: #f8fafc; font-weight: 950; }
.tense-option[aria-pressed="true"] .tense-check { color: #fff; border-color: var(--tense-color); background: var(--tense-color); }
.tense-option strong, .tense-option small { display: block; }
.tense-option strong { font-size: .92rem; line-height: 1.2; }
.tense-option small { margin-top: .25rem; color: #748096; font-size: .69rem; line-height: 1.25; }
.picker-hint { margin: 1rem 0 0; color: #707b8e; font-size: .85rem; }
.tenses-footer { width: min(1320px, calc(100% - 2rem)); display: flex; justify-content: space-between; gap: 1rem; margin: 0 auto; padding: 1.5rem 0 2.5rem; border-top: 1px solid #d7dee8; color: #768195; font-size: .8rem; }
@keyframes bar-in { from { opacity: 0; transform: scaleX(.82); transform-origin: left; } }

@media (max-width: 900px) {
  .tenses-intro { grid-template-columns: 1fr; gap: 1rem; }
  .tense-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .tenses-main, .tenses-appbar-inner, .tenses-footer { width: min(100% - 1.2rem, 1320px); }
  .tenses-appbar-inner { min-height: 60px; }
  .tenses-brand strong { display: none; }
  .tenses-intro { padding-top: 2rem; }
  .board-heading, .picker-heading { align-items: flex-start; flex-direction: column; }
  .board-heading { padding: 1.1rem; }
  .board-actions-compact { width: 100%; }
  .board-mini-button { flex: 1; }
  .tense-options { grid-template-columns: 1fr; }
  .example-panel { padding: 1rem; }
  .tenses-footer { flex-direction: column; }
}

/* If Clauses learning lab */
.if-page { --if-navy: #101c36; --if-ink: #15213b; --if-cyan: #50dfcf; --if-cyan-dark: #087d78; --if-orange: #ffad57; --if-lime: #c9ef62; --if-soft: #eef5f8; color: var(--if-ink); background: #f4f7f9; }
.if-hero { padding: clamp(2rem, 5vw, 4.5rem) 0; color: #fff; background: radial-gradient(circle at 78% 20%, rgba(80,223,207,.18), transparent 24rem), linear-gradient(135deg, #0c1730, #17294b); }
.if-hero-grid { display: grid; grid-template-columns: 1.4fr .6fr; gap: clamp(2rem, 6vw, 5rem); align-items: end; }
.if-hero .eyebrow { margin-bottom: .7rem; color: var(--if-cyan); }
.if-hero h1 { max-width: none; color: #fff; font-size: clamp(2.8rem, 7.5vw, 6.2rem); }
.if-hero p:last-child { max-width: 680px; margin: 1rem 0 0; color: #cbd8e9; font-size: 1.12rem; }
.if-back { display: inline-block; margin-bottom: 1.8rem; color: #dce8f6; font-weight: 800; text-decoration: none; }
.if-back::before { content: "← "; }
.lesson-jumps { display: grid; gap: .5rem; }
.lesson-jumps a { display: grid; grid-template-columns: 2.6rem 1fr; align-items: center; padding: .8rem 1rem; border: 1px solid rgba(255,255,255,.16); border-radius: 12px; color: #fff; font-weight: 800; text-decoration: none; background: rgba(255,255,255,.05); }
.lesson-jumps a:hover { border-color: var(--if-cyan); background: rgba(80,223,207,.09); }
.lesson-jumps span { color: var(--if-cyan); font-size: .78rem; letter-spacing: .08em; }
.if-section { padding: clamp(3.5rem, 7vw, 6rem) 0; scroll-margin-top: 70px; }
.if-section-head { display: flex; justify-content: space-between; align-items: end; gap: 2rem; margin-bottom: 2rem; }
.if-section-head h2 { margin: 0; font-size: clamp(2rem, 5vw, 3.6rem); }
.if-section-head > p { max-width: 510px; margin: 0; color: var(--muted); }
.section-number { margin: 0 0 .55rem; color: var(--if-cyan-dark); font-size: .78rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.teacher-controls { display: grid; grid-template-columns: auto 1fr auto; gap: 1.2rem; align-items: end; margin-bottom: 1rem; }
.teacher-controls fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.teacher-controls legend { margin-bottom: .35rem; color: #526078; font-size: .78rem; font-weight: 850; text-transform: uppercase; letter-spacing: .06em; }
.segmented { display: flex; flex-wrap: wrap; gap: .35rem; }
.segmented button, .board-button, .generate-button, .exercise-tabs button, .check-button, .next-button { min-height: 44px; border: 0; border-radius: 10px; padding: .65rem .9rem; font: inherit; font-weight: 850; cursor: pointer; }
.segmented button { color: #46546c; background: #e6ebf0; }
.segmented button[aria-pressed="true"] { color: #fff; background: var(--if-navy); }
.generate-button { min-width: 150px; color: #092524; background: var(--if-cyan); box-shadow: 0 9px 22px rgba(25,157,149,.18); }
.generate-button span { display: inline-block; margin-right: .3rem; font-size: 1.3rem; line-height: 0; }
.sentence-board { position: relative; isolation: isolate; overflow: hidden; min-height: 370px; padding: clamp(1.5rem, 4vw, 3rem); border-radius: 24px; color: #fff; background: radial-gradient(circle at 90% 0, rgba(80,223,207,.14), transparent 23rem), var(--if-navy); box-shadow: 0 24px 70px rgba(15,28,53,.2); }
.board-top { display: flex; justify-content: space-between; color: #9db0c9; font-size: .73rem; font-weight: 900; letter-spacing: .12em; }
.sentence { position: relative; z-index: 1; max-width: 1050px; margin: clamp(2.3rem, 7vw, 5rem) 0 2.3rem; font-size: clamp(2rem, 5vw, 4.4rem); font-weight: 800; line-height: 1.16; letter-spacing: -.04em; }
.sentence-board.show-tenses .sentence .if-part { text-decoration: underline; text-decoration-color: var(--if-cyan); text-decoration-thickness: .12em; text-underline-offset: .13em; }
.sentence-board.show-tenses .sentence .main-part { text-decoration: underline; text-decoration-color: var(--if-orange); text-decoration-thickness: .12em; text-underline-offset: .13em; }
.reveal-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.25fr .75fr; gap: .75rem; margin: 0 0 1.5rem; }
.reveal-card { padding: .85rem 1rem; border: 1px solid rgba(255,255,255,.15); border-radius: 12px; background: rgba(255,255,255,.07); }
.reveal-card span { display: block; color: #9db0c9; font-size: .7rem; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.reveal-card strong { display: block; margin-top: .15rem; color: #eef6ff; font-size: 1rem; }
.tense-card strong { display: flex; gap: .5rem; align-items: center; }
.tense-card i { width: 9px; height: 9px; border-radius: 50%; background: var(--if-cyan); }
.tense-card i:nth-of-type(2) { background: var(--if-orange); }
.tense-card em { color: #8393aa; font-style: normal; }
.board-actions { position: relative; z-index: 3; display: flex; flex-wrap: wrap; gap: .55rem; }
.board-button { color: #dce8f6; border: 1px solid #40516e; background: #22314c; }
.board-button:hover, .board-button[aria-pressed="true"] { color: #0f2930; border-color: var(--if-cyan); background: var(--if-cyan); }
.clear-button { color: #172239; background: #fff; }
#pen-canvas { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; pointer-events: none; touch-action: none; }
.sentence-board.pen-active #pen-canvas { pointer-events: auto; cursor: crosshair; }
.board-hint { display: flex; flex-wrap: wrap; gap: .45rem .7rem; align-items: center; margin: 1rem .4rem 0; color: #68768a; font-size: .85rem; }
.board-hint > span:last-child { margin-left: auto; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; }
.if-dot { background: var(--if-cyan); } .main-dot { background: var(--if-orange); }
.overview-section { background: #fff; }
.type-table { overflow: hidden; border: 1px solid #dbe3e9; border-radius: 20px; }
.table-row { display: grid; grid-template-columns: 100px 1fr 1.1fr 1fr; width: 100%; text-align: left; }
.table-head { color: #6c7888; background: #edf2f5; font-size: .78rem; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; }
.table-head > div { padding: .8rem 1rem; }
.type-row { align-items: stretch; padding: 0; border: 0; border-top: 1px solid #e1e7eb; color: inherit; background: #fff; cursor: pointer; }
.type-row > span { min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: .2rem; padding: 1.3rem 1rem; border-left: 1px solid #e1e7eb; }
.type-row > span:first-child { border-left: 0; }
.type-row:hover, .type-row.active { background: #f5fffd; }
.type-row.active { box-shadow: inset 5px 0 var(--if-cyan); }
.type-badge { align-items: center !important; font-size: 2.8rem; font-weight: 950; }
.type-row small { display: none; color: #708096; font-size: .7rem; font-weight: 900; text-transform: uppercase; }
.type-row strong { font-size: 1.08rem; line-height: 1.25; }
.type-row em { color: #536177; font-size: .9rem; font-style: normal; line-height: 1.4; }
.type-row mark { padding: .03rem .15rem; color: inherit; background: #d7f8f2; }
.type-1 { color: #087d78; }.type-2 { color: #d26928; }.type-3 { color: #6852a8; }
.memory-line { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; padding: 1rem 1.2rem; border-radius: 12px; background: var(--if-navy); color: #d9e5f3; }
.memory-line span { color: var(--if-cyan); font-weight: 900; }.memory-line strong { color: #fff; }
.practice-section { background: #eaf0f3; }
.practice-level { display: grid; gap: .3rem; }
.practice-level label { color: #647085; font-size: .75rem; font-weight: 850; text-transform: uppercase; }
.practice-level select { min-height: 44px; padding: .6rem 2.2rem .6rem .8rem; border: 1px solid #ccd7df; border-radius: 10px; color: var(--if-ink); background: #fff; font: inherit; font-weight: 800; }
.exercise-tabs { display: flex; gap: .5rem; margin-bottom: 1rem; }
.exercise-tabs button { color: #556278; background: #dbe4e9; }
.exercise-tabs button[aria-selected="true"] { color: #fff; background: var(--if-navy); }
.exercise-card { overflow: hidden; border-radius: 22px; background: #fff; box-shadow: 0 18px 50px rgba(31,48,71,.1); }
.exercise-top { display: flex; justify-content: space-between; padding: 1rem 1.4rem; border-bottom: 1px solid #e4e9ed; color: #6b778a; font-size: .75rem; font-weight: 900; letter-spacing: .07em; }
#exercise-content { min-height: 270px; display: grid; align-content: center; padding: clamp(1.5rem, 5vw, 3.5rem); }
.exercise-prompt { margin: 0 0 1.2rem; color: #576579; font-weight: 750; }
.word-bank, .answer-zone { display: flex; flex-wrap: wrap; gap: .55rem; min-height: 62px; padding: .7rem; border-radius: 12px; }
.word-bank { background: #f0f4f6; }
.answer-zone { margin-top: .8rem; border: 2px dashed #b9c8d2; background: #fafcfd; }
.word-chip { padding: .65rem .8rem; border: 1px solid #cbd5dc; border-radius: 9px; color: var(--if-ink); background: #fff; font: inherit; font-weight: 800; cursor: grab; box-shadow: 0 3px 8px rgba(30,47,68,.07); }
.word-chip:active { cursor: grabbing; }.word-chip.selected { outline: 3px solid var(--if-cyan); }.drag-over { border-color: var(--if-cyan-dark); background: #effbf9; }
.gap-sentence { font-size: clamp(1.35rem, 4vw, 2.3rem); font-weight: 800; line-height: 1.5; }
.gap-input { width: min(230px, 45vw); padding: .25rem .45rem; border: 0; border-bottom: 3px solid #90a1b1; color: var(--if-ink); background: #eef3f5; font: inherit; font-weight: 850; text-align: center; }
.gap-input:focus { outline: 3px solid rgba(80,223,207,.35); border-color: var(--if-cyan-dark); }
.sort-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; margin-top: 1.5rem; }
.sort-option { padding: 1rem; border: 2px solid #d6dfe5; border-radius: 12px; color: #33425a; background: #fff; font: inherit; font-weight: 900; cursor: pointer; }
.sort-option[aria-pressed="true"] { border-color: var(--if-cyan-dark); background: #eafffb; }
.exercise-footer { display: flex; align-items: center; gap: .8rem; padding: 1rem 1.4rem; border-top: 1px solid #e4e9ed; background: #f8fafb; }
.exercise-footer p { flex: 1; margin: 0; color: #59677b; }
.exercise-footer p.correct { color: #087b56; font-weight: 850; }.exercise-footer p.incorrect { color: #a3402e; font-weight: 850; }
.exercise-footer p.revealed { color: #4c3e86; font-weight: 850; }
.solution-button { min-height: 44px; padding: .65rem .9rem; border: 1px solid #bfcbd5; border-radius: 10px; color: #33425a; background: #fff; font: inherit; font-weight: 850; cursor: pointer; }
.solution-button:hover { border-color: #6852a8; background: #f3f0ff; }
.check-button { color: #092524; background: var(--if-cyan); }.next-button { color: #fff; background: var(--if-navy); }
@media (max-width: 820px) {
  .if-hero-grid, .reveal-grid { grid-template-columns: 1fr; }
  .lesson-jumps { grid-template-columns: repeat(3, 1fr); }
  .lesson-jumps a { grid-template-columns: 1fr; gap: .15rem; }
  .teacher-controls { grid-template-columns: 1fr; }
  .generate-button { width: 100%; }
  .if-section-head { align-items: flex-start; flex-direction: column; }
  .table-head { display: none; }
  .type-table { display: grid; gap: .8rem; overflow: visible; border: 0; }
  .table-row.type-row { grid-template-columns: 64px 1fr; border: 1px solid #dbe3e9; border-radius: 15px; overflow: hidden; }
  .type-row > span { border: 0; border-top: 1px solid #e1e7eb; }
  .type-row > span:nth-child(n+2) { grid-column: 2; }
  .type-row > span:nth-child(2) { border-top: 0; }
  .type-badge { grid-row: 1 / 4; grid-column: 1 !important; padding: .7rem !important; border-right: 1px solid #e1e7eb !important; }
  .type-row small { display: block; }
}
@media (max-width: 560px) {
  .lesson-jumps { grid-template-columns: 1fr; }
  .if-hero p:last-child { font-size: 1rem; }
  .sentence-board { border-radius: 16px; }
  .sentence { margin-top: 2.5rem; }
  .board-hint > span:last-child { width: 100%; margin-left: 0; }
  .exercise-tabs { display: grid; grid-template-columns: 1fr; }
  .sort-options { grid-template-columns: 1fr; }
  .exercise-footer { align-items: stretch; flex-direction: column; }
  .exercise-footer button { width: 100%; }
}

/* If Clauses app shell */
.if-appbar { position: sticky; top: 0; z-index: 30; color: #fff; background: #101c36; box-shadow: 0 2px 16px rgba(10,20,40,.16); }
.if-appbar-inner { width: min(1480px, calc(100% - 2rem)); min-height: 68px; display: flex; align-items: center; gap: 2rem; margin-inline: auto; }
.if-app-brand { display: inline-flex; align-items: center; gap: .7rem; color: #fff; text-decoration: none; }
.if-app-brand span { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 11px; color: #10213a; background: var(--if-cyan); font-weight: 950; }
.if-app-brand strong { font-size: 1.08rem; }
.if-app-nav { display: flex; align-self: stretch; margin-left: auto; }
.if-app-nav a { display: flex; align-items: center; padding: 0 1rem; border-bottom: 3px solid transparent; color: #b9c8dc; font-weight: 800; text-decoration: none; }
.if-app-nav a:hover, .if-app-nav a[aria-current="page"] { color: #fff; border-color: var(--if-cyan); background: rgba(255,255,255,.05); }
.if-home-button { display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid #40516e; border-radius: 10px; color: #fff; font-size: 1.25rem; text-decoration: none; }
.if-exit { margin-left: auto; color: #d3dfed; font-weight: 750; text-decoration: none; }
.if-exit::before { content: "← "; }
.if-app-home { min-height: 100vh; display: flex; flex-direction: column; background: radial-gradient(circle at 84% 16%, rgba(80,223,207,.13), transparent 28rem), #edf3f6; }
.app-home-main { width: min(1260px, calc(100% - 2rem)); flex: 1; margin: 0 auto; padding: clamp(3rem, 7vw, 6.5rem) 0 4rem; }
.app-welcome { display: grid; grid-template-columns: 1.25fr .75fr; align-items: end; gap: 3rem; margin-bottom: 3rem; }
.app-welcome h1 { margin: 0; color: var(--if-navy); font-size: clamp(3.1rem, 7.5vw, 6.2rem); }
.app-welcome p:last-child { max-width: 680px; margin: 1rem 0 0; color: #5d6d82; font-size: 1.15rem; }
.formula-strip { display: flex; align-items: center; justify-content: center; gap: 1rem; padding: 1.2rem; border: 1px solid #d8e2e8; border-radius: 16px; background: rgba(255,255,255,.78); box-shadow: 0 14px 36px rgba(32,49,72,.07); }
.formula-strip span { padding: .55rem .8rem; border-radius: 8px; font-weight: 900; background: #d9f8f3; }
.formula-strip span:last-child { background: #fff0df; }
.formula-strip b { color: #6d7b8e; font-size: 1.35rem; }
.app-menu { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1.2rem; }
.app-menu-card { position: relative; min-height: 355px; display: flex; flex-direction: column; padding: 1.7rem; overflow: hidden; border: 1px solid #d9e2e8; border-radius: 22px; color: var(--if-ink); background: #fff; box-shadow: 0 18px 50px rgba(31,48,71,.08); text-decoration: none; transition: transform .18s ease, box-shadow .18s ease; }
.app-menu-card::after { content: ""; position: absolute; inset: auto -50px -70px auto; width: 180px; height: 180px; border-radius: 50%; opacity: .18; background: var(--card-accent); }
.app-menu-card:hover { transform: translateY(-6px); box-shadow: 0 26px 60px rgba(31,48,71,.14); }
.examples-card { --card-accent: var(--if-cyan); }.overview-card { --card-accent: var(--if-orange); }.practice-card { --card-accent: var(--if-lime); }
.app-card-number { color: #728095; font-size: .75rem; font-weight: 900; letter-spacing: .1em; }
.app-card-icon { width: 70px; height: 70px; display: grid; place-items: center; margin: 2rem 0 1.5rem; border-radius: 18px; color: #10213a; background: color-mix(in srgb, var(--card-accent) 35%, white); font-size: 1.25rem; font-weight: 950; }
.app-menu-card h2 { margin: 0 0 .7rem; font-size: 2rem; }
.app-menu-card p { margin: 0 0 1.5rem; color: #68768a; }
.app-menu-card > strong { margin-top: auto; color: #14223c; }
.app-home-footer { display: flex; justify-content: space-between; gap: 1rem; padding: 1.2rem max(1rem, calc((100% - 1260px)/2)); border-top: 1px solid #d9e2e8; color: #68768a; background: rgba(255,255,255,.55); font-size: .85rem; }
.if-workspace-page { min-height: 100vh; background: #eef3f6; }
.workspace-shell { width: min(1480px, calc(100% - 2rem)); display: grid; grid-template-columns: minmax(0,1fr) 290px; gap: 1.25rem; margin: 0 auto; padding: 1.4rem 0 2.5rem; }
.workspace-main { min-width: 0; }
.workspace-title { min-height: 90px; display: flex; align-items: end; justify-content: space-between; gap: 1.5rem; margin-bottom: 1rem; }
.workspace-title h1 { margin: 0; color: var(--if-navy); font-size: clamp(2rem,4vw,3.4rem); }
.workspace-title p:not(.section-number) { max-width: 420px; margin: 0 0 .5rem; color: #68768a; }
.teacher-toolbox { position: sticky; top: 86px; align-self: start; display: grid; gap: 1.15rem; padding: 1.2rem; border: 1px solid #d7e1e7; border-radius: 18px; background: #fff; box-shadow: 0 14px 40px rgba(31,48,71,.08); }
.toolbox-heading { display: grid; padding-bottom: .85rem; border-bottom: 1px solid #e4eaee; }
.toolbox-heading span, .tool-label, .teacher-toolbox legend { color: #788597; font-size: .7rem; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.toolbox-heading strong { font-size: 1.15rem; }
.teacher-toolbox fieldset { margin: 0; padding: 0; border: 0; }
.teacher-toolbox legend { margin-bottom: .45rem; }
.tool-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: .4rem; }.tool-grid.two { grid-template-columns: repeat(2,1fr); }
.tool-grid button, .tool-stack button, .tool-toggle, .clear-annotation, .reset-score { min-height: 41px; padding: .55rem .65rem; border: 1px solid #d8e1e7; border-radius: 9px; color: #48576d; background: #f4f7f9; font: inherit; font-size: .88rem; font-weight: 850; cursor: pointer; }
.tool-grid button[aria-pressed="true"], .tool-stack button[aria-pressed="true"], .tool-toggle[aria-pressed="true"] { color: #fff; border-color: var(--if-navy); background: var(--if-navy); }
.tool-stack { display: grid; gap: .4rem; }.tool-stack button { text-align: left; }
.toolbox-group { display: grid; gap: .45rem; }.tool-label { display: block; }
.pen-tools { padding-top: 1rem; border-top: 1px solid #e4eaee; }
.pen-colors { display: flex; gap: .5rem; }
.pen-colors button { width: 31px; height: 31px; border: 3px solid #fff; border-radius: 50%; background: var(--pen); box-shadow: 0 0 0 1px #ccd7df; cursor: pointer; }
.pen-colors button:nth-child(1){--pen:#c9ef62}.pen-colors button:nth-child(2){--pen:#ffad57}.pen-colors button:nth-child(3){--pen:#50dfcf}.pen-colors button.active{box-shadow:0 0 0 3px #24334d;}
.clear-annotation, .reset-score { color: #6a4550; background: #fff; }
.classroom-canvas { position: relative; isolation: isolate; }
.annotation-canvas { position: absolute; inset: 0; z-index: 10; width: 100%; height: 100%; pointer-events: none; touch-action: none; }
.classroom-canvas.pen-active .annotation-canvas { pointer-events: auto; cursor: crosshair; }
.if-workspace-page .sentence-board { min-height: calc(100vh - 200px); display: flex; flex-direction: column; justify-content: center; }
.if-workspace-page .sentence { margin: 3rem 0; }
.board-key { position: absolute; left: 2.5rem; bottom: 1.5rem; display: flex; gap: 1.2rem; color: #b7c5d8; font-size: .82rem; }
.board-key span { display: flex; align-items: center; gap: .4rem; }.board-key i { width: 9px; height: 9px; border-radius: 50%; }.if-key{background:var(--if-cyan)}.main-key{background:var(--if-orange)}
.overview-canvas { padding: 1rem; border-radius: 20px; background: #fff; box-shadow: 0 14px 40px rgba(31,48,71,.08); }
.type-row.dimmed { opacity: .25; }.overview-canvas.hide-examples .type-row em { visibility: hidden; }.overview-canvas.hide-rules .type-row > span:last-child { visibility: hidden; }
.overview-canvas [hidden] { display: none !important; }
.overview-empty { min-height: 430px; display: grid; place-content: center; gap: .35rem; padding: 2rem; text-align: center; color: #657489; }
.overview-empty strong { color: var(--if-navy); font-size: 1.45rem; }
.overview-canvas .tense-content, .overview-canvas .example-content, .overview-canvas .rule-content { visibility: hidden; }
.overview-canvas.show-tenses .tense-content, .overview-canvas.show-examples .example-content, .overview-canvas.show-rules .rule-content { visibility: visible; }
.overview-canvas.empty-overview .type-table { display: none; }
.score-pill { padding: .55rem .85rem; border-radius: 999px; color: #fff; background: var(--if-navy); font-size: .85rem; font-weight: 850; }
.if-workspace-page .exercise-card { min-height: calc(100vh - 200px); display: flex; flex-direction: column; }
.if-workspace-page #exercise-content { flex: 1; }
.exercise-empty { display: grid; place-items: center; gap: .35rem; color: #657489; text-align: center; }
.exercise-empty strong { color: var(--if-navy); font-size: 1.3rem; }
.gap-label { display: grid; gap: .5rem; width: min(420px,100%); margin-top: 1.4rem; color: #68768a; font-size: .8rem; font-weight: 850; text-transform: uppercase; }
.gap-label .gap-input { width: 100%; text-align: left; text-transform: none; }
.verb-hint { color: #6d7b8e; font-size: .72em; font-weight: 750; white-space: nowrap; }
@media (max-width: 980px) {
  .workspace-shell { grid-template-columns: 1fr; }
  .teacher-toolbox { position: static; grid-row: 1; grid-template-columns: repeat(3,minmax(0,1fr)); align-items: start; }
  .toolbox-heading { grid-column: 1/-1; }
  .pen-tools { padding-top: 0; border-top: 0; }
  .app-menu { grid-template-columns: 1fr; }
  .app-menu-card { min-height: 250px; }
  .app-card-icon { margin: 1.2rem 0 1rem; }
}
@media (max-width: 720px) {
  .if-appbar-inner { gap: .7rem; }
  .if-app-brand strong { display: none; }
  .if-app-nav { flex: 1; overflow-x: auto; }
  .if-app-nav a { padding: 0 .7rem; white-space: nowrap; font-size: .82rem; }
  .app-welcome { grid-template-columns: 1fr; gap: 1.5rem; }
  .formula-strip { justify-content: flex-start; }
  .teacher-toolbox { grid-template-columns: 1fr 1fr; }
  .toolbox-heading { grid-column: 1/-1; }
  .workspace-title { align-items: flex-start; flex-direction: column; }
  .workspace-title .generate-button { width: 100%; }
  .if-workspace-page .sentence-board, .if-workspace-page .exercise-card { min-height: 520px; }
}
@media (max-width: 500px) {
  .teacher-toolbox { grid-template-columns: 1fr; }
  .app-home-footer { flex-direction: column; }
  .if-exit { font-size: .8rem; }
}

/* Viewport-fitted classroom mode */
.if-workspace-page { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
.if-workspace-page .if-appbar-inner { min-height: 58px; }
.if-workspace-page .if-app-brand span { width: 38px; height: 38px; }
.workspace-shell { height: calc(100vh - 58px); height: calc(100dvh - 58px); grid-template-columns: minmax(0,1fr) 238px; gap: .8rem; padding: .7rem 0; overflow: hidden; }
.workspace-main { min-height: 0; display: grid; grid-template-rows: auto minmax(0,1fr); }
.workspace-title { min-height: 62px; margin-bottom: .55rem; }
.workspace-title h1 { font-size: clamp(1.8rem, 3.2vw, 2.8rem); }
.workspace-title .section-number { margin-bottom: .2rem; }
.teacher-toolbox { top: 66px; max-height: calc(100dvh - 72px); gap: .7rem; padding: .85rem; border-radius: 14px; overflow-y: auto; }
.toolbox-heading { padding-bottom: .55rem; }
.toolbox-heading strong { font-size: 1rem; }
.tool-grid button, .tool-stack button, .tool-toggle, .clear-annotation, .reset-score { min-height: 34px; padding: .38rem .45rem; font-size: .78rem; }
.teacher-toolbox legend { margin-bottom: .25rem; }
.toolbox-group { gap: .3rem; }
.pen-tools { padding-top: .65rem; }
.pen-colors button { width: 25px; height: 25px; }
.if-workspace-page .sentence-board, .if-workspace-page .exercise-card, .if-workspace-page .overview-canvas { min-height: 0; height: 100%; overflow: hidden; }
.if-workspace-page .sentence-board { display: grid; grid-template-rows: auto 35% minmax(0,1fr); align-content: stretch; justify-content: stretch; padding: clamp(1.2rem, 3vh, 2.2rem); }
.if-workspace-page .board-top { grid-row: 1; }
.if-workspace-page .sentence { grid-row: 2; align-self: center; width: 100%; margin: 0; font-size: clamp(1.8rem, min(5vw, 7vh), 4rem); white-space: nowrap; }
.if-workspace-page .reveal-grid { grid-row: 3; align-self: start; min-height: 82px; margin: clamp(.25rem, 1.5vh, .8rem) 0 0; }
.if-workspace-page .board-key { left: 1.5rem; bottom: 1rem; }
.if-workspace-page .exercise-card { display: grid; grid-template-rows: auto minmax(0,1fr) auto; }
.if-workspace-page #exercise-content { min-height: 0; padding: clamp(1rem, 3vh, 2.2rem); overflow: hidden; }
.if-workspace-page .gap-sentence { font-size: clamp(1.15rem, min(3.2vw, 4.2vh), 2rem); }
.if-workspace-page .word-bank, .if-workspace-page .answer-zone { min-height: 50px; padding: .5rem; }
.if-workspace-page .word-chip { padding: .45rem .6rem; }
.if-workspace-page .exercise-footer { padding: .7rem 1rem; }
.if-workspace-page .overview-canvas { overflow: auto; }
.if-workspace-page .overview-empty { min-height: 100%; }
.if-workspace-page .type-row > span { padding: clamp(.55rem, 1.5vh, 1rem) .75rem; }

@media (max-width: 980px) {
  .workspace-shell { grid-template-columns: 1fr; grid-template-rows: auto minmax(0,1fr); gap: .55rem; }
  .workspace-main { grid-row: 2; min-height: 0; }
  .teacher-toolbox { position: static; grid-row: 1; display: flex; align-items: end; gap: .6rem; max-width: 100%; max-height: 112px; padding: .55rem .65rem; overflow-x: auto; overflow-y: hidden; }
  .toolbox-heading { display: none; }
  .teacher-toolbox fieldset, .teacher-toolbox > .toolbox-group { flex: 0 0 auto; min-width: 180px; }
  .teacher-toolbox > .reset-score { flex: 0 0 auto; }
  .teacher-toolbox .pen-tools { min-width: 310px; display: grid; grid-template-columns: auto auto auto; align-items: end; padding: 0 0 0 .65rem; border-top: 0; border-left: 1px solid #e4eaee; }
  .teacher-toolbox .pen-tools .tool-label { grid-column: 1/-1; }
  .workspace-title { min-height: 50px; }
  .workspace-title h1 { font-size: clamp(1.55rem, 4vw, 2.2rem); }
  .workspace-title p:not(.section-number) { font-size: .82rem; }
  .if-workspace-page .sentence-board, .if-workspace-page .exercise-card { min-height: 0; }
  .if-workspace-page .sentence-board { grid-template-rows: auto 48% minmax(0,1fr); }
  .if-workspace-page .sentence.mobile-split { line-height: 1.12; white-space: normal; }
  .if-workspace-page .sentence.mobile-split .if-part,
  .if-workspace-page .sentence.mobile-split .main-part { display: block; width: max-content; max-width: 100%; white-space: nowrap; }
  .if-workspace-page .sentence.mobile-split .main-part { margin-top: .22em; }
}

@media (max-height: 700px) {
  .if-workspace-page .if-appbar-inner { min-height: 50px; }
  .workspace-shell { height: calc(100vh - 50px); height: calc(100dvh - 50px); padding: .45rem 0; }
  .workspace-title { min-height: 44px; margin-bottom: .35rem; }
  .workspace-title h1 { font-size: 1.7rem; }
  .workspace-title .section-number, .workspace-title > p { display: none; }
  .teacher-toolbox { gap: .45rem; padding: .55rem; }
  .if-workspace-page .sentence { margin: 1rem 0; }
  .if-workspace-page .reveal-card { padding: .55rem .7rem; }
  .if-workspace-page .exercise-top, .if-workspace-page .exercise-footer { padding: .55rem .8rem; }
}

/* Mobile exercises: allow the full activity and toolbox to scroll naturally. */
@media (max-width: 720px) {
  .if-workspace-page.exercise-workspace-page {
    height: auto;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
  }
  .exercise-workspace-page .workspace-shell {
    height: auto;
    min-height: calc(100vh - 58px);
    min-height: calc(100dvh - 58px);
    display: flex;
    flex-direction: column;
    gap: .8rem;
    padding: .7rem 0 2rem;
    overflow: visible;
  }
  .exercise-workspace-page .workspace-main {
    order: 2;
    display: block;
    overflow: visible;
  }
  .exercise-workspace-page .teacher-toolbox {
    order: 1;
    position: static;
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    width: 100%;
    max-height: none;
    overflow: visible;
  }
  .exercise-workspace-page .teacher-toolbox fieldset,
  .exercise-workspace-page .teacher-toolbox > .toolbox-group {
    min-width: 0;
  }
  .exercise-workspace-page .teacher-toolbox .pen-tools {
    min-width: 0;
    display: grid;
    grid-template-columns: 1fr auto;
    padding: .65rem 0 0;
    border-top: 1px solid #e4eaee;
    border-left: 0;
  }
  .exercise-workspace-page .teacher-toolbox .pen-tools .tool-label,
  .exercise-workspace-page .teacher-toolbox .pen-tools .clear-annotation {
    grid-column: 1 / -1;
  }
  .exercise-workspace-page .workspace-title {
    min-height: 0;
    margin: .4rem 0 .7rem;
  }
  .exercise-workspace-page .exercise-card {
    height: auto;
    min-height: 0;
    overflow: hidden;
  }
  .exercise-workspace-page #exercise-content {
    min-height: 280px;
    padding: 1.2rem;
    overflow: visible;
  }
  .exercise-workspace-page .word-bank,
  .exercise-workspace-page .answer-zone {
    min-height: 68px;
  }
}

/* Hamilton learning project */
.hamilton-site { --gold: #c89b3c; --hamilton-dark: #12100d; }
.hamilton-hero { padding: clamp(3rem, 7vw, 6rem) 0; color: #fff; background: radial-gradient(circle at 75% 20%, rgba(200,155,60,.2), transparent 25rem), linear-gradient(135deg, #11100e, #272016); }
.hamilton-hero-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(240px, .5fr); align-items: center; gap: clamp(2rem, 6vw, 6rem); }
.hamilton-hero h1 { color: #fff; font-size: clamp(3.3rem, 8vw, 6.5rem); text-transform: uppercase; }
.hamilton-hero p:not(.eyebrow) { max-width: 680px; color: #e6dcc8; font-size: 1.18rem; }
.hamilton-hero img { width: min(330px, 100%); justify-self: end; border: 1px solid rgba(255,255,255,.18); box-shadow: 0 30px 70px rgba(0,0,0,.45); transform: rotate(2deg); }
.hamilton-site .eyebrow { color: var(--gold); }
.hamilton-tracks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.hamilton-track { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: .8rem; min-height: 70px; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: 14px; background: #fff; text-decoration: none; }
.hamilton-track:hover { border-color: var(--gold); transform: translateY(-1px); box-shadow: 0 9px 24px rgba(42,32,14,.1); }
.hamilton-track > span { color: var(--gold); font-size: .8rem; font-weight: 900; }
.hamilton-track strong { line-height: 1.25; }
.hamilton-track small { color: var(--muted); font-size: .76rem; white-space: nowrap; }
.hamilton-dark { color: #fff; background: var(--hamilton-dark); }
.hamilton-dark .section-head p { color: #b9ae9c; }
.hamilton-dark .hamilton-track { color: #fff; border-color: #40382c; background: #201c16; }
.hamilton-dark .hamilton-track small { color: #b9ae9c; }
.hamilton-head { padding: 3rem 0; color: #fff; background: linear-gradient(135deg, #12100d, #312719); }
.hamilton-head h1 { max-width: 850px; font-size: clamp(2.3rem, 6vw, 4.2rem); }
.hamilton-back { display: inline-block; margin-bottom: 2rem; color: #e9c978; font-weight: 800; }
.hamilton-intro { display: grid; grid-template-columns: minmax(0, 1fr) 220px; align-items: center; gap: 2rem; margin-top: 2rem; }
.hamilton-quote { margin: 0; padding: 1.5rem 0 1.5rem 1.5rem; border-left: 4px solid var(--gold); font-size: clamp(1.15rem, 3vw, 1.7rem); }
.hamilton-quote p { margin: 0 0 .7rem; }
.hamilton-quote cite { color: #d1c6b5; font-size: .9rem; }
.hamilton-portrait { max-height: 290px; justify-self: end; border-radius: 8px; object-fit: cover; box-shadow: 0 18px 45px rgba(0,0,0,.35); }
.hamilton-content { max-width: 900px; }
.hamilton-lyrics { margin-bottom: 2rem; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.hamilton-lyrics summary { padding: 1rem 1.2rem; color: var(--ink); font-size: 1.1rem; font-weight: 850; cursor: pointer; }
.lyrics-text { max-height: 560px; overflow-y: auto; padding: 0 1.25rem 1.5rem; color: #3e4655; line-height: 1.7; }
.h5p-stack { display: grid; gap: 1.25rem; }
.h5p-card { overflow: hidden; padding: 1.25rem; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.h5p-card h2 { margin: .35rem 0 1rem; font-size: 1.35rem; }
.h5p-card iframe { width: 100%; border: 0; border-radius: 10px; background: #f4f5f8; }
.h5p-local { min-height: 160px; }
.h5p-error { padding: 1rem; border-radius: 10px; background: #fff2f2; color: #8b1f1f; }
.h5p-note { margin: .8rem 0 0; color: var(--muted); font-size: .82rem; }
.h5p-download { margin-left: .35rem; color: var(--blue); font-weight: 800; }
.lesson-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2rem; }
.lesson-nav a { padding: .7rem 1rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-weight: 800; text-decoration: none; }

@media (max-width: 760px) {
  .hamilton-hero-grid, .hamilton-intro { grid-template-columns: 1fr; }
  .hamilton-hero img, .hamilton-portrait { justify-self: start; }
  .hamilton-tracks { grid-template-columns: 1fr; }
  .hamilton-track { grid-template-columns: 34px minmax(0,1fr); }
  .hamilton-track small { grid-column: 2; }
}

/* Tenses: complete classroom board in one viewport */
.tenses-page { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
.tenses-appbar-inner { min-height: 54px; }
.tenses-brand > span { width: 32px; height: 32px; }
.tenses-main { height: calc(100vh - 54px); height: calc(100dvh - 54px); display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: clamp(.45rem, 1.3vh, .8rem); padding: clamp(.45rem, 1.3vh, .8rem) 0; overflow: hidden; }
.tenses-main .timeline-board { position: relative; min-height: 0; display: flex; flex-direction: column; border-radius: 18px; }
.tenses-main .board-heading { flex: 0 0 auto; padding: clamp(.6rem, 1.5vh, .85rem) 1rem; }
.tenses-main .board-overline { display: none; }
.tenses-main .board-heading h2 { font-size: clamp(1.2rem, 2.5vw, 1.7rem); }
.tenses-main .timeline-scroll { min-height: 0; flex: 1; overflow: hidden; }
.tenses-main .timeline { width: 100%; min-width: 0; min-height: 100%; height: 100%; }
.tenses-main .time-zones, .tenses-main .now-line { bottom: 34px; }
.tenses-main .zone { padding: .7rem .8rem; }
.tenses-main .tense-bars { inset: 45px 0 36px; }
.tenses-main .tense-bar { top: calc(var(--bar-row) * min(5.1vh, 40px)); height: min(4.35vh, 34px); min-height: 24px; padding: .25rem .55rem; border-radius: 7px; }
.tenses-main .tense-bar span { font-size: clamp(.62rem, 1.15vw, .76rem); }
.tenses-main .tense-bar small { font-size: clamp(.5rem, .85vw, .6rem); }
.tenses-main .timeline-axis { height: 34px; padding: 0 .8rem; }
.tenses-main .timeline-empty { inset: 45px 0 34px; }
.tenses-main .example-panel { position: absolute; z-index: 8; right: .8rem; bottom: 42px; left: .8rem; padding: .7rem .85rem; border: 1px solid #dce2eb; border-radius: 12px; box-shadow: 0 12px 35px rgba(24,34,58,.18); }
.tenses-main .example-accent { min-height: 48px; }
.tenses-main .example-panel blockquote { margin: .05rem 0 .1rem; font-size: clamp(.9rem, 2vw, 1.2rem); }
.tenses-main .example-panel .example-note { font-size: .72rem; line-height: 1.35; }
.tenses-main .example-panel .example-signals { margin-top: .28rem; color: #4f5b71; font-size: .72rem; line-height: 1.3; }
.tenses-main .example-panel .example-signals strong { color: #253149; }
.tenses-main .tense-picker { padding: 0; }
.tenses-main .picker-heading { align-items: center; margin: 0 0 .4rem; }
.tenses-main .picker-heading h2 { margin: 0; font-size: clamp(1rem, 2.2vw, 1.35rem); }
.tenses-main .picker-heading > p { margin: 0; font-size: .75rem; }
.tenses-main .picker-count { width: 1.55rem; height: 1.55rem; }
.tenses-main .tense-options { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .4rem; }
.tenses-main .tense-option { min-height: 48px; gap: .5rem; padding: .4rem .55rem; border-radius: 9px; }
.tenses-main .tense-check { flex-basis: 22px; width: 22px; height: 22px; border-radius: 6px; font-size: .72rem; }
.tenses-main .tense-option strong { font-size: clamp(.66rem, 1.2vw, .8rem); }
.tenses-main .tense-option small { margin-top: .05rem; font-size: clamp(.52rem, .85vw, .62rem); }

@media (max-width: 620px) {
  .tenses-appbar-inner { min-height: 48px; }
  .tenses-main { height: calc(100vh - 48px); height: calc(100dvh - 48px); }
  .tenses-main .board-heading { align-items: center; flex-direction: row; padding: .5rem .65rem; }
  .tenses-main .board-actions-compact { width: auto; }
  .tenses-main .board-mini-button { min-height: 32px; padding: .3rem .45rem; font-size: .68rem; }
  .tenses-main .tense-options { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tenses-main .tense-option { min-width: 0; justify-content: center; padding: .3rem; }
  .tenses-main .tense-check { display: none; }
  .tenses-main .tense-option strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tenses-main .tense-option small { display: none; }
  .tenses-main .picker-heading { flex-direction: row; }
  .tenses-main .zone span { font-size: .55rem; }
  .tenses-main .tense-bar { padding-inline: .3rem; }
  .tenses-main .tense-bar small { display: none; }
}

@media (max-height: 650px) {
  .tenses-main .tense-bar { top: calc(var(--bar-row) * 31px); height: 27px; }
  .tenses-main .tense-option { min-height: 40px; }
  .tenses-main .tense-option small { display: none; }
}

/* Two-line tense bars */
.tenses-main .tense-bar { top: calc(var(--bar-row) * min(5.8vh, 50px)); height: min(5.2vh, 44px); min-height: 36px; flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; padding: .3rem .6rem; }
.tenses-main .tense-bar span, .tenses-main .tense-bar small { width: 100%; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tenses-main .tense-bar small, .tenses-main .tense-bar.simple-past small, .tenses-main .tense-bar.simple-present small, .tenses-main .tense-bar.present-progressive small { display: block; }

@media (max-width: 620px) {
  .tenses-main .tense-bar small { display: block; font-size: .48rem; }
}

@media (max-height: 650px) {
  .tenses-main .tense-bar { top: calc(var(--bar-row) * 37px); height: 34px; min-height: 34px; }
}

/* GSW topic cards use the same three-column width as the other subject pages. */
.gsw-exercise-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
.geography-entry { border-left:5px solid #21a179; }
.geography-entry p { margin:.35rem 0 0; color:var(--muted); }
.geography-topic { border-color:#b8e3d4; background:linear-gradient(145deg,#fff,#effaf6); }
@media (max-width:900px) { .gsw-exercise-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:600px) { .gsw-exercise-grid { grid-template-columns:1fr; } }
