/* Familienfreundliche Oberfläche, auf bestehenden Komponenten aufgebaut. */
:root{--bg:#f7f5ee;--panel:#fffefa;--ink:#193f35;--text:#263e37;--muted:#5c7068;--soft:#e8f0e7;--line:#dce4d9;--accent:#24664e;--accent2:#174a3a;--radius:20px}
body{font-size:16px}.sidebar{background:#163d34}.brand-icon{background:#f8e5c9;color:#174839}.topbar{background:#fffefa}.panel{background:#fffefa;box-shadow:0 10px 32px #173d3410}.page-head h1{font-size:clamp(30px,3.4vw,46px);letter-spacing:-.035em}.lead{font-size:16px}.btn,.nav-link{min-height:44px}.nav-link[data-family-open]{background:#f4e2c6;color:#173d34;font-weight:800;margin-bottom:8px}.nav-link[data-family-open]:hover{background:#ffeacb;color:#173d34}.btn-primary{background:#205f49}.eyebrow{color:#5f6e39}.footer{background:#fffefa}
@media(max-width:650px){.page-head h1{font-size:30px}.panel{padding:20px}.mobile-bottom-nav{background:#fffefa}}
.shell[hidden],.mobile-bottom-nav[hidden],#more-sheet[hidden]{display:none!important}
.review-disclosure{margin:18px 38px 0;padding:12px 16px;border:1px solid #dbc996;border-radius:12px;background:#fff7df;color:#503f1e;font-size:.9rem}@media(max-width:650px){.review-disclosure{margin:12px 16px 0}}

/* Ergebnisgruppen belegen die ganze Breite; nur die Karten darin bilden ein Raster. */
#filtered-cards{display:block;min-width:0}
#filtered-cards .sf-result-group{min-width:0;margin-bottom:24px}
.school-card .tag{max-width:100%;overflow-wrap:anywhere}
@media(max-width:420px){
 .school-card .l-mini{display:block}
 .school-card .l-mini em{display:inline-block;max-width:100%;white-space:normal;overflow-wrap:anywhere;margin-bottom:4px}
}

/* Schulstufen und gemeinsame Navigation */
.brand[data-compass-home],
.nav-link[data-stage-switch],
.nav-link[data-area-link] {
  text-decoration: none;
}

.brand[data-compass-home] {
  color: inherit;
  width: fit-content;
  border-radius: 10px;
  padding-block-end: 16px;
}

.compass-stage-link {
  display: grid;
  gap: 2px;
  padding-block: 8px;
  border: 1px solid #74958955;
  margin-bottom: 6px;
  line-height: 1.25;
}

.compass-stage-link small {
  color: #c7ded1;
  font-weight: 500;
}

.compass-stage-link[aria-current="true"],
.compass-stage-link[aria-current="page"],
.nav-link[data-area-link][aria-current="page"] {
  color: #fff;
  background: #2e6551;
}

.compass-stage-link[aria-current="true"],
.compass-stage-link[aria-current="page"] {
  border-color: #a5cbb5;
}

.compass-area-links {
  margin-top: 22px;
}

.compass-mobile-header,
body[data-compass-stage="home"] .compass-area-links,
body[data-compass-stage="home"] .compass-secondary-tools,
body[data-compass-stage="home"] .review-disclosure,
body[data-compass-stage="home"] .mobile-bottom-nav,
body[data-compass-stage="grundschule"] .compass-secondary-tools,
body[data-compass-stage="grundschule"] .review-disclosure {
  display: none;
}

[data-compass-home]:focus-visible,
[data-stage-switch]:focus-visible,
[data-area-link]:focus-visible,
.compass-stage-card:focus-visible,
.compass-mobile-header button:focus-visible {
  outline: 3px solid #5685af;
  outline-offset: 3px;
}

.sidebar :focus-visible {
  outline-color: #ffd79d;
}

.compass-start {
  max-width: 1040px;
  margin: clamp(9px, 4vw, 48px) auto 0;
}

.compass-start h1 {
  color: var(--ink);
  font-size: clamp(1.9rem, 4.8vw, 4.2rem);
  line-height: 1.03;
  letter-spacing: -.045em;
  margin: 0;
}

.compass-start > p {
  max-width: 52ch;
  color: var(--muted);
  margin: 12px 0 0;
}

.compass-start-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(12px, 2vw, 24px);
  margin: clamp(18px, 4vw, 38px) 0 20px;
}

.compass-stage-card {
  --stage-surface: #e6efe7;
  --stage-border: #b8d2bf;
  --stage-accent: #1a634b;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  min-height: 220px;
  color: var(--ink);
  border: 1px solid var(--stage-border);
  background: var(--stage-surface);
  border-radius: 22px;
  padding: clamp(16px, 3vw, 32px);
  text-decoration: none;
  box-shadow: 0 5px 18px #173d3410;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.compass-stage-card[href*="/grundschule/"] {
  --stage-surface: #fbecda;
  --stage-border: #e5c6a2;
  --stage-accent: #764421;
}

.compass-stage-card:hover {
  border-color: var(--stage-accent);
  box-shadow: 0 8px 24px #173d3422;
}

.compass-stage-card h2 {
  color: inherit;
  font-size: clamp(1.35rem, 3vw, 2.2rem);
  line-height: 1.12;
  letter-spacing: -.025em;
  margin: 6px 0;
}

.compass-stage-card p {
  margin: 4px 0 10px;
  line-height: 1.4;
}

.compass-stage-card small,
.compass-stage-card .eyebrow {
  color: var(--stage-accent);
  font-weight: 750;
}

.compass-stage-card .compass-card-action {
  margin-top: auto;
  color: var(--stage-accent);
  font-weight: 800;
}

.compass-start a:not(.compass-stage-card) {
  color: var(--accent2);
}

body[data-compass-stage="grundschule"] .fam-school-list {
  align-items: start;
}

body[data-compass-stage="grundschule"] .fam-card,
body[data-compass-stage="grundschule"] .fam-claim {
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 930px) {
  .sidebar,
  .topbar > .location-title,
  .topbar > .top-right,
  .topbar > .mobile-menu,
  .compass-mobile-header [data-stage-switch],
  body[data-compass-stage="home"] #more-toggle,
  body[data-compass-stage="grundschule"] #more-toggle {
    display: none !important;
  }

  .topbar {
    height: auto;
    padding: 10px 14px;
  }

  .compass-mobile-header {
    display: grid;
    width: 100%;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    column-gap: 8px;
    line-height: 1.25;
  }

  .compass-mobile-brand {
    color: var(--ink);
    width: fit-content;
    padding-block: 6px;
    font-size: .84rem;
    font-weight: 750;
    text-decoration-thickness: 1px;
    text-underline-offset: .2em;
  }

  .compass-mobile-header > strong {
    grid-column: 1;
    grid-row: 2;
    color: var(--ink);
    font-size: .92rem;
    letter-spacing: -.015em;
  }

  .compass-mobile-header [data-stage-switch] {
    grid-column: 2;
    grid-row: 1 / 3;
    align-items: center;
    min-height: 44px;
    color: var(--accent2);
    font-size: .77rem;
    font-weight: 750;
    text-underline-offset: .18em;
    padding-inline: 3px;
  }

  body[data-compass-stage="grundschule"] .compass-mobile-header [data-stage-switch="weiterfuehrend"],
  body[data-compass-stage="weiterfuehrend"] .compass-mobile-header [data-stage-switch="grundschule"] {
    display: inline-flex !important;
  }

  .compass-mobile-header #more-toggle {
    grid-column: 3;
    grid-row: 1 / 3;
    min-width: 44px;
    min-height: 44px;
    border: 1px solid var(--line);
    background: var(--soft);
    color: var(--accent2);
    border-radius: 10px;
  }

  .mobile-bottom-nav {
    position: fixed;
    inset: auto 0 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    padding: 4px 7px max(6px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: var(--panel);
    box-shadow: 0 -4px 18px #123a2b12;
    z-index: 60;
  }

  .mobile-bottom-nav a {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 47px;
    gap: 2px;
    color: var(--accent2);
    font-size: .76rem;
    line-height: 1.16;
    font-weight: 700;
    border-radius: 9px;
    text-decoration: none;
  }

  .mobile-bottom-nav .tab-symbol {
    font-size: 1.2rem;
    line-height: 1;
  }

  .mobile-bottom-nav a[aria-current="page"] {
    background: var(--soft);
    box-shadow: inset 0 -3px var(--accent);
    font-weight: 850;
  }

  body:not([data-compass-stage="home"]) .footer {
    padding-bottom: 80px;
  }
}

@media (max-width: 650px) {
  .compass-start-grid {
    grid-template-columns: 1fr;
  }

  .compass-stage-card {
    min-height: 0;
    border-radius: 16px;
  }

  body[data-compass-stage="home"] .main {
    padding-bottom: 30px !important;
  }
}

.compass-stage-card > span:first-child {
  font-size: .8rem;
  font-weight: 750;
  color: var(--stage-accent);
}

.compass-stage-card > span:last-child {
  margin-top: auto;
  font-weight: 750;
  color: var(--stage-accent);
}

.compass-start .page-head {
  margin-bottom: 0;
}

#main .fam-shell[data-primary-view],
#main [data-primary-view] > .fam-shell {
  max-width: none;
  padding: 0;
}

#main [data-primary-view] .fam-school-list {
  max-height: none;
  overflow: visible;
}

#main [data-primary-view] .fam-field {
  min-width: 0;
}

#main [data-primary-view] .fam-field :is(input, select, textarea) {
  max-width: 100%;
  min-height: 44px;
  font-size: 1rem;
}

#main [data-primary-view] a.btn {
  align-content: center;
  text-decoration: none;
}

@media (max-width: 930px) {
  body[data-compass-stage="home"] .compass-mobile-header > strong {
    display: none;
  }
}

@media (max-width: 650px) {
  #main [data-primary-view] .fam-grid,
  #main [data-primary-view] .fam-school-list {
    grid-template-columns: minmax(0, 1fr);
  }

  #main [data-primary-view] .fam-card {
    padding: 16px;
  }
}

@media print {
  .mobile-bottom-nav {
    display: none !important;
  }
}

/* Ruhiger Einstieg und klarer Entwurfsstatus */
.draft-notice,.orientation-guide{padding:1.5rem;border:1px solid #bdcfc2;border-radius:1rem;background:#e9f3ec;color:#172f28;line-height:1.6}
.draft-notice{margin:0 0 1.5rem}.orientation-guide{margin-top:2rem;background:#fffefa}.orientation-guide h2{color:#123b33}.orientation-guide li{margin-block:.65rem} :focus-visible{outline:3px solid #1f6feb;outline-offset:3px} @media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;transition-duration:.01ms!important}}

.skip-link{position:fixed;z-index:10000;left:1rem;top:1rem;padding:.75rem 1rem;background:#fff;color:#123b33;transform:translateY(-200%);border:2px solid #123b33}.skip-link:focus{transform:none}.footer details{margin-top:1rem}.footer summary{cursor:pointer}.footer p{max-width:70ch;line-height:1.6}html{scroll-padding-top:5rem;scroll-padding-bottom:6rem}
@media (max-width: 240px){
 .compass-mobile-header{display:flex;flex-wrap:wrap;gap:.3rem .6rem}
 .compass-mobile-header > strong{width:100%}
 .compass-mobile-header [data-stage-switch]{white-space:normal}
 .mobile-bottom-nav{position:static;grid-template-columns:repeat(2,minmax(0,1fr))}
 .mobile-bottom-nav a{overflow-wrap:anywhere;text-align:center}
 body:not([data-compass-stage="home"]) .footer{padding-bottom:1rem}
}

/* Bessere Lesbarkeit kleiner Status- und Zusatztexte. */
.risk-chip.neutral{color:#45584e}
.picker-heading small,.map-school-choice small,.calendar-static-note{color:#40564a}
.empty,.small-note,.factstrip-item span,.scenario-option small,.source-card small,.range-field small{color:#40564a}
.school-type-text,.forecast-brief-num span,.forecast-result span{color:#40564a}
.demography-item p,.demography-item small,.history-stat span{color:#40564a}
@media (max-width: 420px){
 .compass-mobile-header{display:flex;flex-wrap:wrap;gap:.25rem .75rem}
 .compass-mobile-brand{width:100%}
 .compass-mobile-header > strong{width:100%}
 .compass-mobile-header [data-stage-switch]{white-space:normal}
 .compass-mobile-header #more-toggle{padding:.5rem .75rem}
}
.map-school-list .map-school-choice{flex-direction:column;align-items:flex-start;justify-content:center;gap:.15rem;overflow-wrap:normal;word-break:normal}
@media (min-width:691px) and (max-width:930px){
 .more-sheet-backdrop:not([hidden]){display:flex!important}
}

.fam-limit-message{margin:.5rem 0;padding:.75rem;border-left:4px solid #815100;background:#fff6df;color:#503600;line-height:1.5}

/* Links bleiben im Fließtext auch ohne Farberkennung unterscheidbar. */
main p a:not(.btn), main li a:not(.btn), main small a:not(.btn), main dd a:not(.btn), .school-preview-body a:not(.btn) {text-decoration:underline;text-underline-offset:.15em}
@media (forced-colors: active) {
  :focus-visible, .sidebar :focus-visible {outline:3px solid Highlight;outline-offset:3px}
  #main:focus-visible > :first-child {outline:3px solid Highlight;outline-offset:4px}
  button[aria-pressed="true"], .filter.selected, .map-school-choice.selected {outline:2px solid Highlight;outline-offset:-4px}
  .school-preview-dialog {border:2px solid CanvasText}
}

.comparison h2{color:var(--ink);font-size:19px;margin:0 0 7px}

.compare-limit-status:not(:empty){padding:10px 12px;border:2px solid #8c4c20;border-radius:8px;color:#50351e;background:#fff7e8}.compare-limit-status:empty{margin:0}

/* Gemeinsame Merkmalszeilen im Schulvergleich */
.compare-table-wrap { overflow-x: auto; margin-top: 14px; }
.compare-table { width: 100%; border-collapse: collapse; table-layout: fixed; background: #fff; }
.compare-table caption { text-align: left; font-weight: 700; color: var(--ink); padding: 8px 0; }
.compare-table th, .compare-table td { padding: 13px; border: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.compare-table thead th, .compare-table tbody th { background: var(--soft); color: var(--ink); }
.compare-table tbody th { width: 15%; }
.compare-table td p { margin: 0 0 8px; }
.compare-cell-source { margin-top: 8px; font-size: 13px; }
.compare-cell-source summary, #compare-picker-details summary, #compare-extra-details summary { cursor: pointer; color: var(--ink); font-weight: 700; }
.compare-cell-source a { overflow-wrap: anywhere; }
@media (max-width: 700px) {
  .compare-table-wrap { overflow: visible; }
  .compare-table, .compare-table tbody, .compare-table tr, .compare-table td, .compare-table tbody th { display: block; width: 100%; }
  .compare-table thead { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
  .compare-table tbody th { width: 100%; }
  .compare-table td::before { content: attr(data-school-name); display: block; color: var(--ink); font-weight: 700; margin-bottom: 5px; }
}

/* Übersicht und Sprungziele im Schulprofil */
.profile-overview dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 10px; margin: 0; }
.profile-overview dl > div { padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); }
.profile-overview dt { font-weight: 700; color: var(--ink); }
.profile-overview dd { margin: 4px 0 0; overflow-wrap: anywhere; }
.profile-overview dd small { display: block; }
.profile-sections { display: flex; flex-wrap: wrap; gap: 8px 15px; padding: 16px 0; }
.profile-sections a { text-decoration: underline; }
.compass-school-profile h2[id], .compass-school-profile h3[id] { scroll-margin-top: 85px; }

/* Suchansicht verdichten und aktive Filter erreichbar halten. */
body[data-view="schools"] .page-head { margin-bottom: 10px; }
body[data-view="schools"] .page-head h1 { font-size: clamp(27px, 2.7vw, 38px); }
body[data-view="schools"] .selection-v8 { margin-top: 6px; margin-bottom: 8px; }
body[data-view="schools"] .school-list-filters { margin: 8px 0; }
body[data-view="schools"] .school-results-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
body[data-view="schools"] .school-results-toolbar p { margin: 8px 0; }
body[data-view="schools"] #active-school-filters { display: flex; flex-wrap: wrap; gap: 6px; }
body[data-view="schools"] .compact-school-actions .fav-btn { min-height: 44px; width: auto; padding: 8px 12px; }
@media (max-width: 690px) {
 body[data-view="schools"] .page-head h1 { font-size: 25px; }
 body[data-view="schools"] .filter-row #school-search { order: initial; }
 body[data-view="schools"] .selection-v8 { margin: 6px 0; }
 body[data-view="schools"] .review-disclosure { margin-top: 6px; padding-top: 7px; padding-bottom: 7px; }
 body[data-view="schools"] .sf-filter-box { margin: 6px 0; }
 body[data-view="schools"] .school-results-toolbar label { display: flex; align-items: center; gap: 5px; }
}

/* Merkzeilen behalten bei schmalen Ansichten lesbare Schulnamen. */
.fav-row { flex-wrap: wrap; }
.fav-row .grow { min-width: min(240px, 100%); overflow-wrap: break-word; }
.fav-row label { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.fav-row .tiny-btn { min-width: 44px; min-height: 44px; }
@media (max-width: 690px) {
 .fav-row .grow { flex-basis: calc(100% - 42px); min-width: 0; }
 .fav-row label { flex-basis: 100%; }
}

.fav-row .btn { min-height: 44px; }
