/* ══ Einstellungen im aktuellen Stellio-Design (Vorschau vorschau/einstellungen, 10.11.2026) ══
   Aufbau nach der Recherche (docs/ziele/2026-11-einstellungen/recherche.md):
   - Desktop: links eine Seitenleiste mit den Gruppen (Sprungmarken), rechts Kopf-Karte und
     Gruppen mit begrenzter Breite.
   - Handy (bis 900px): Kopf-Karte und eine Uebersichtsliste (Icon, Gruppe, aktueller Wert);
     Tippen oeffnet die Gruppe als Unterseite mit Zurueck-Knopf (settings.js stOpenGroup).
   Zeilen wie iOS bzw. Google-Konto: Icon, Titel, Wert, Pfeil oder Schalter.
   Nur Aufbau und Aussehen - alle Knoepfe rufen die bisherigen Funktionen auf. Farben: home-neu.css. */

#page-settings { --st-radius: 20px; --st-ico: 36px; --st-line: rgba(222, 210, 197, .75); }
#page-settings .st-head-title {
  margin: 4px 0 22px; font-family: var(--font-title); font-weight: 700; font-size: 32px; line-height: 1.15;
  color: var(--hn-text); letter-spacing: -0.01em;
}

/* ── Raster ──────────────────────────────────────────────────────────────── */
.st-layout {
  display: grid; grid-template-columns: 236px minmax(0, 720px); gap: 0 36px; align-items: start;
  grid-template-areas: "nav hero" "nav main";
}
.st-hero { grid-area: hero; }
.st-nav { grid-area: nav; }
.st-main { grid-area: main; min-width: 0; }

/* ── Seitenleiste (Desktop) ──────────────────────────────────────────────── */
.st-nav {
  position: sticky; top: 84px; display: flex; flex-direction: column; gap: 2px; padding: 8px;
  background: rgba(251, 248, 242, .72); border: 1px solid rgba(222, 210, 197, .55); border-radius: 22px;
  box-shadow: var(--hn-shadow-sm);
}
.st-nav a {
  display: flex; align-items: center; gap: 11px; min-height: 42px; padding: 7px 10px; border-radius: 13px;
  color: var(--hn-text-2); font: 500 13.5px/1.3 var(--font-body); text-decoration: none;
}
.st-nav a[hidden] { display: none; }
.st-nav-ico { flex: none; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--hn-second); color: var(--hn-text); }
.st-nav-ico svg { width: 15px; height: 15px; }
.st-nav-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.st-nav-sub, .st-nav-chev { display: none; }
.st-nav a:hover { background: var(--hn-second); color: var(--hn-text); }
.st-nav a[aria-current="true"] { background: var(--hn-surface); color: var(--hn-text); font-weight: 600; box-shadow: 0 0 0 1px var(--st-line), var(--hn-shadow-sm); }
.st-nav a[aria-current="true"] .st-nav-ico { background: var(--tint-blue); color: var(--gold-text); }
.st-nav a:focus-visible { outline: 2px solid var(--focus-outline); outline-offset: 2px; }
.st-nav a.st-nav-danger { margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--st-line); border-radius: 0 0 13px 13px; }
.st-nav a.st-nav-danger .st-nav-ico { background: #FBE9E7; color: #B42318; }

/* ── Kopf-Karte ──────────────────────────────────────────────────────────── */
.st-hero {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px 18px; align-items: center;
  padding: 24px 26px; margin-bottom: 30px; background: var(--hn-surface); border-radius: 24px;
  border: 1px solid rgba(222, 210, 197, .55); box-shadow: var(--hn-shadow);
}
.st-avatar {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(180deg, var(--hn-primary), var(--hn-primary-h)); color: #FFFFFF;
  font: 700 26px/1 var(--font-title); box-shadow: 0 0 0 4px var(--hn-second);
}
.st-hero-who { min-width: 0; }
.st-hero-name { font-family: var(--font-title); font-weight: 700; font-size: 23px; line-height: 1.2; color: var(--hn-text); overflow-wrap: anywhere; }
.st-hero-mail { margin-top: 3px; font-size: 13.5px; color: var(--hn-text-2); overflow-wrap: anywhere; }
.st-badge {
  display: inline-flex; align-items: center; margin-top: 9px; padding: 3px 12px; border-radius: 999px;
  font: 600 12px/1.5 var(--font-body); background: var(--hn-second); color: var(--hn-text);
}
.st-badge.is-paid { background: var(--gold-light); color: var(--gold-text); box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .25); }
.st-hero-edit { align-self: start; }
.st-hero-stats { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.st-stat { padding: 12px 14px; border-radius: 14px; background: var(--hn-bg); box-shadow: inset 0 0 0 1px rgba(138, 119, 101, .12); min-width: 0; }
.st-stat b { display: block; font: 700 19px/1.2 var(--font-body); color: var(--hn-text); }
.st-stat span { display: block; font-size: 12px; color: var(--hn-text-2); hyphens: auto; -webkit-hyphens: auto; }
.st-hero-complete { grid-column: 1 / -1; }
.st-hero-complete-head { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 600; color: var(--hn-text); }
.st-hero-complete-track { height: 6px; margin-top: 8px; border-radius: 999px; background: var(--hn-second); overflow: hidden; }
.st-hero-complete-fill { height: 100%; width: 0; border-radius: 999px; background: var(--gold); transition: width .6s ease; }
.st-hero-complete-hint { margin-top: 7px; font-size: 12.5px; color: var(--hn-text-2); }
.st-hero-tags { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.st-hero-tags.hidden { display: none; }
.st-hero-tags-label { font-size: 12px; color: var(--hn-text-2); margin-right: 2px; }
.st-hero-tags-row { display: flex; flex-wrap: wrap; gap: 8px; }
.st-hero-tags-row .profile-mobile-tag { font: 600 12px var(--font-body); padding: 4px 11px; border-radius: 999px; }

/* ── Gruppen ─────────────────────────────────────────────────────────────── */
.st-back { display: none; }
.st-group { margin-bottom: 34px; scroll-margin-top: 84px; }
.st-group[hidden] { display: none; }
.st-group-title {
  margin: 0 0 10px 6px; font-family: var(--font-title); font-weight: 700; font-size: 19px; line-height: 1.3; color: var(--hn-text);
}
.st-group-title:focus { outline: none; }
.st-group-title:focus-visible { outline: 2px solid var(--focus-outline); outline-offset: 3px; border-radius: 6px; }
.st-group-hint { margin: -4px 0 12px 6px; font-size: 13px; line-height: 1.5; color: var(--hn-text-2); }
.st-list {
  background: var(--hn-surface); border-radius: var(--st-radius); border: 1px solid rgba(222, 210, 197, .55);
  box-shadow: var(--hn-shadow-sm); overflow: hidden;
}
.st-list > * + * { border-top: 1px solid var(--st-line); }
.st-list > [hidden] { display: none; }
.st-list > [hidden] + * { border-top: 0; }
.st-list-danger { border-color: rgba(180, 35, 24, .25); }

/* ── Zeilen ──────────────────────────────────────────────────────────────── */
.st-row {
  all: unset; box-sizing: border-box; position: relative; display: grid; width: 100%;
  grid-template-columns: var(--st-ico) minmax(0, 1fr) auto; align-items: center; gap: 14px;
  min-height: 62px; padding: 12px 18px; color: var(--hn-text); text-decoration: none;
}
.st-row[hidden] { display: none; }
button.st-row, a.st-row { cursor: pointer; }
button.st-row:hover, a.st-row:hover { background: rgba(237, 226, 213, .45); }
.st-row:focus-visible { outline: 2px solid var(--focus-outline); outline-offset: -3px; border-radius: 14px; }
.st-ico {
  width: var(--st-ico); height: var(--st-ico); border-radius: 11px; display: grid; place-items: center; flex: none;
  background: var(--hn-second); color: var(--hn-text);
}
.st-ico svg { width: 18px; height: 18px; }
.st-ico.is-blue { background: var(--tint-blue); color: var(--gold-text); }
.st-ico.is-red { background: #FBE9E7; color: #B42318; }
.st-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.st-label { font: 500 14.5px/1.35 var(--font-body); color: var(--hn-text); }
.st-sub { font-size: 12.5px; line-height: 1.45; color: var(--hn-text-2); overflow-wrap: anywhere; }
.st-end { display: flex; align-items: center; justify-content: flex-end; gap: 10px; color: var(--hn-text-2); font-size: 13.5px; min-width: 0; }
.st-value { max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-chev { width: 18px; height: 18px; flex: none; color: var(--hn-text-2); }
.st-row.is-danger .st-label { color: #B42318; font-weight: 600; }

/* Hinweiszeile (unter 18, Mails die immer kommen) */
.st-note { display: flex; align-items: flex-start; gap: 10px; padding: 12px 18px; font-size: 12.5px; line-height: 1.5; color: var(--hn-text-2); background: rgba(247, 243, 236, .7); }
.st-note .st-ico { width: 22px; height: 22px; border-radius: 7px; background: transparent; color: var(--hn-text-2); }
.st-note .st-ico svg { width: 16px; height: 16px; }

/* Bloecke mit Inhalt (Persoenlichkeit, Bewerbungsprofil, Freunde einladen) */
.st-block { padding: 16px 18px 20px; }
.st-block-head { display: grid; grid-template-columns: var(--st-ico) minmax(0, 1fr); gap: 14px; align-items: center; margin-bottom: 12px; }
.st-block-body { padding-left: calc(var(--st-ico) + 14px); min-width: 0; }
.st-block-body > .hint:first-child { margin-top: 0; }
.st-chip-label { font-size: 12px; font-weight: 600; color: var(--hn-text-2); margin: 4px 0 7px; }
.st-chip-label-gap { margin-top: 22px; }
.st-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
#page-settings .referral-link-row { margin-top: 0; }

/* Schalter: echter Knopf mit role="switch" und aria-checked, Trefferflaeche 44px */
#page-settings .st-switch {
  all: unset; box-sizing: border-box; position: relative; flex: none; width: 48px; height: 28px; border-radius: 999px;
  background: #CBBFB1; cursor: pointer; transition: background .18s;
}
#page-settings .st-switch::before { content: ''; position: absolute; inset: -8px -2px; }
#page-settings .st-switch::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #FFFFFF;
  box-shadow: 0 1px 3px rgba(48, 40, 35, .25); transition: transform .18s;
}
#page-settings .st-switch.on { background: var(--gold); }
#page-settings .st-switch.on::after { transform: translateX(20px); }
#page-settings .st-switch:focus-visible { outline: 2px solid var(--focus-outline); outline-offset: 3px; }

/* Auswahl (Sprache) */
.st-select {
  appearance: none; -webkit-appearance: none; height: 40px; width: auto; min-width: 0; padding: 0 36px 0 14px; border-radius: 12px;
  border: 1px solid var(--hn-line); background: var(--hn-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23756B63' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
  font: 500 14px var(--font-body); color: var(--hn-text); cursor: pointer;
}
.st-select:focus-visible { outline: 2px solid var(--focus-outline); outline-offset: 2px; }

/* Pillen-Knoepfe (braun-beige wie Home) */
.st-pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 18px; border-radius: 999px;
  border: none; cursor: pointer; font: 600 13.5px/1.2 var(--font-body); white-space: nowrap;
  background: linear-gradient(180deg, var(--hn-primary), var(--hn-primary-h)); color: #FFFFFF;
  box-shadow: 0 1px 2px rgba(112, 94, 78, .25), 0 8px 18px -10px rgba(112, 94, 78, .65);
}
.st-pill:hover { background: var(--hn-primary-h); }
.st-pill.is-quiet { background: var(--hn-surface); color: var(--hn-text); box-shadow: inset 0 0 0 1px var(--hn-line); }
.st-pill.is-quiet:hover { background: var(--hn-second); }
.st-pill:focus-visible { outline: 2px solid var(--focus-outline); outline-offset: 2px; }
.st-pill.hidden { display: none; }

/* Fuer Lehrpersonen: Inhalt aus klassenraum.js im Listenstil */
#page-settings #settings-teacher-card > .st-teacher-body { padding: 16px 18px 20px; }
#page-settings #settings-teacher-card.kr-tk-collapsed > .st-teacher-body { padding: 0; }
#page-settings .kr-tk-toggle { min-height: 62px; padding: 12px 18px; gap: 14px; font: 500 14.5px/1.35 var(--font-body); }
#page-settings .kr-tk-toggle:hover { background: rgba(237, 226, 213, .45); }
#page-settings .kr-tk-toggle-ico { width: var(--st-ico); height: var(--st-ico); border-radius: 11px; background: var(--hn-second); color: var(--hn-text); }
#page-settings #kr-tk-more { padding: 4px 18px 20px calc(18px + var(--st-ico) + 14px); }
#page-settings .kr-tk-class { border-radius: 14px; background: var(--hn-bg); }

/* Konto loeschen, Stufe 1 */
.st-del-list { margin: 8px 0 14px; padding-left: 20px; font-size: 14px; line-height: 1.7; color: var(--hn-text); }
.st-del-note { margin: 0 0 10px; font-size: 13.5px; color: var(--hn-text-2); }
.st-del-note a { color: var(--gold-text); font-weight: 600; }
.st-del .btn-danger-solid { background: #B42318; border-color: #B42318; color: #FFFFFF; box-shadow: none; }
.st-del .btn-danger-solid:hover { background: #912018; border-color: #912018; }

/* ── Handy / Tablet: Uebersicht + Unterseiten ────────────────────────────── */
@media (max-width: 900px) {
  .st-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "hero" "nav" "main"; }
  .st-nav { position: static; padding: 0; gap: 0; overflow: hidden; background: var(--hn-surface); border-radius: var(--st-radius); }
  .st-nav a { min-height: 62px; padding: 12px 16px; gap: 14px; border-radius: 0; color: var(--hn-text); font-size: 14.5px; }
  .st-nav a + a { border-top: 1px solid var(--st-line); }
  .st-nav a[aria-current="true"] { box-shadow: none; background: transparent; font-weight: 500; }
  .st-nav a[aria-current="true"] .st-nav-ico { background: var(--hn-second); color: var(--hn-text); }
  .st-nav-ico { width: var(--st-ico); height: var(--st-ico); border-radius: 11px; }
  .st-nav-ico svg { width: 18px; height: 18px; }
  .st-nav-sub { display: block; margin-top: 2px; font-size: 12.5px; color: var(--hn-text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .st-nav-sub:empty { display: none; }
  .st-nav-chev { display: block; flex: none; width: 18px; height: 18px; color: var(--hn-text-2); }
  .st-nav a.st-nav-danger { margin-top: 0; padding-top: 12px; border-radius: 0; }
  .st-nav a.st-nav-danger span[data-i18n] { color: #B42318; }

  /* Uebersicht: Gruppen erst als Unterseite zeigen */
  .st-main { display: none; }
  #page-settings.st-sub-open .st-head-title,
  #page-settings.st-sub-open .st-hero,
  #page-settings.st-sub-open .st-nav { display: none; }
  #page-settings.st-sub-open .st-main { display: block; }
  #page-settings.st-sub-open .st-group { display: none; }
  #page-settings.st-sub-open .st-group.is-open { display: block; }
  .st-back {
    all: unset; box-sizing: border-box; display: none; align-items: center; gap: 6px; min-height: 44px; margin: 0 0 6px -6px; padding: 0 10px 0 4px;
    border-radius: 12px; color: var(--hn-text-2); font: 600 14px/1 var(--font-body); cursor: pointer;
  }
  .st-back svg { width: 20px; height: 20px; }
  .st-back:focus-visible { outline: 2px solid var(--focus-outline); }
  #page-settings.st-sub-open .st-back { display: inline-flex; }
  #page-settings.st-sub-open .st-group-title { font-size: 26px; margin: 0 0 14px 2px; }
}
@media (max-width: 600px) {
  #page-settings { --st-ico: 34px; }
  #page-settings .st-head-title { font-size: 28px; margin-bottom: 16px; }
  .st-hero { grid-template-columns: auto minmax(0, 1fr); padding: 20px 18px; gap: 14px; border-radius: 22px; margin-bottom: 20px; }
  .st-avatar { width: 54px; height: 54px; font-size: 22px; }
  .st-hero-name { font-size: 20px; }
  .st-hero-edit { grid-column: 1 / -1; }
  .st-hero-edit .st-pill { width: 100%; }
  .st-stat { padding: 10px 8px; }
  .st-stat b { font-size: 17px; }
  .st-stat span { font-size: 11px; }
  .st-row { padding: 12px 14px; gap: 12px; }
  .st-row-wrap { grid-template-columns: var(--st-ico) minmax(0, 1fr); }
  .st-row-wrap .st-end { grid-column: 1 / -1; justify-content: stretch; }
  .st-row-wrap .st-end .st-pill { flex: 1; }
  .st-value { max-width: 120px; }
  .st-note { padding: 12px 14px; }
  .st-block { padding: 14px 14px 18px; }
  .st-block-body { padding-left: 0; }
  #page-settings #kr-tk-more { padding: 4px 14px 18px; }
  #page-settings .kr-tk-toggle { padding: 12px 14px; gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  #page-settings .st-switch, #page-settings .st-switch::after, .st-hero-complete-fill { transition: none; }
}
#page-settings .referral-stat[hidden] { display: none; }
/* Etwas mehr Breite fuer Seitenleiste + Inhalt (sonst 860px wie die anderen Seiten) */
.content-inner:has(#page-settings.active) { max-width: 1060px; }
