/* SGR-Learn – Schüleroberfläche. Alles unter .sgr_learn, damit das Theme nicht beeinflusst wird. */
.sgr_learn {
	--sgr-learn-farbe: #b8141e;
	--sgr-learn-akzent: var(--sgr-learn-farbe);
	--sgr-learn-text: #1c1c1e;
	--sgr-learn-leise: #63666b;
	--sgr-learn-flaeche: #ffffff;
	--sgr-learn-grund: #f4f5f7;
	--sgr-learn-rand: #e4e5e9;
	--sgr-learn-gruen: #1a7f37;
	--sgr-learn-radius: 18px;
	--sgr-learn-schatten: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 14px rgba(16, 24, 40, .06);
	--sgr-learn-schatten-hoch: 0 2px 4px rgba(16, 24, 40, .08), 0 12px 28px rgba(16, 24, 40, .12);
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
	font-size: 18px;
	line-height: 1.45;
	color: var(--sgr-learn-text);
	box-sizing: border-box;
	max-width: 1100px;
	margin: 0 auto;
	-webkit-font-smoothing: antialiased;
}
.sgr_learn *, .sgr_learn *::before, .sgr_learn *::after { box-sizing: inherit; }
.sgr_learn [hidden], .sgr_learn[hidden] { display: none !important; }
.sgr_learn p { margin: 0 0 12px; }

/* ---------- Kopf ---------- */
.sgr_learn_kopf {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px;
	padding: 4px 0 14px; margin: 0 0 18px; border-bottom: 1px solid var(--sgr-learn-rand);
}
.sgr_learn .sgr_learn_titel {
	margin: 0; font-size: calc(1.15 * var(--sgr-r, 16px)); font-weight: 700; letter-spacing: -.01em; line-height: 1.25;
	color: var(--sgr-learn-farbe); display: flex; align-items: center; gap: 10px;
}
.sgr_learn .sgr_learn_titel::before {
	content: ""; width: 10px; height: 26px; border-radius: 5px; background: var(--sgr-learn-farbe); flex: 0 0 auto;
}
.sgr_learn_person { display: flex; gap: 10px; align-items: center; font-size: calc(.9 * var(--sgr-r, 16px)); color: var(--sgr-learn-leise); }
.sgr_learn_avatar {
	width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
	background: var(--sgr-learn-farbe); color: #fff; font-weight: 700; font-size: calc(1 * var(--sgr-r, 16px));
}
.sgr_learn .sgr_learn_abmelden {
	min-height: 40px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--sgr-learn-rand);
	background: var(--sgr-learn-flaeche); color: var(--sgr-learn-text); font: inherit; font-size: calc(.9 * var(--sgr-r, 16px)); cursor: pointer;
}
.sgr_learn .sgr_learn_abmelden:hover { border-color: var(--sgr-learn-farbe); color: var(--sgr-learn-farbe); }
.sgr_learn .sgr_learn_gruss { font-size: calc(1.7 * var(--sgr-r, 16px)); font-weight: 800; letter-spacing: -.02em; margin: 0 0 18px; line-height: 1.2; }

/* ---------- Karten (Anmelden, Kurscode, Meldungen) ---------- */
.sgr_learn_karte {
	max-width: 520px; margin: 20px auto; padding: 30px 26px;
	background: var(--sgr-learn-flaeche); border: 1px solid var(--sgr-learn-rand);
	border-radius: 24px; text-align: center; box-shadow: var(--sgr-learn-schatten);
}
.sgr_learn_start_symbol { font-size: calc(3 * var(--sgr-r, 16px)); line-height: 1; margin-bottom: 10px; }
.sgr_learn .sgr_learn_start_titel { font-size: calc(1.6 * var(--sgr-r, 16px)); font-weight: 800; letter-spacing: -.02em; margin-bottom: 6px; }
.sgr_learn .sgr_learn_start_text { color: var(--sgr-learn-leise); margin-bottom: 20px; }
.sgr_learn .sgr_learn_gross { font-size: calc(1.2 * var(--sgr-r, 16px)); font-weight: 700; margin: 0 0 14px; }
.sgr_learn .sgr_learn_klein { font-size: calc(.9 * var(--sgr-r, 16px)); color: var(--sgr-learn-leise); margin: 10px 0 0; }
.sgr_learn .sgr_learn_leer, .sgr_learn .sgr_learn_unten { text-align: center; color: var(--sgr-learn-leise); margin: 26px 0; }
.sgr_learn_fehler { color: var(--sgr-learn-farbe); font-weight: 600; }

/* ---------- Knöpfe ---------- */
.sgr_learn .sgr_learn_knopf {
	display: inline-flex; align-items: center; justify-content: center;
	min-height: 50px; padding: 12px 26px; margin: 8px 0 0;
	border: 0; border-radius: 14px; background: var(--sgr-learn-farbe); color: #fff;
	font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
	box-shadow: 0 6px 16px rgba(184, 20, 30, .28);
	transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.sgr_learn .sgr_learn_knopf:hover { filter: brightness(1.06); transform: translateY(-1px); }
.sgr_learn .sgr_learn_knopf:active { transform: translateY(0) scale(.98); }
.sgr_learn .sgr_learn_knopf_gross { min-height: 58px; font-size: calc(1.12 * var(--sgr-r, 16px)); width: 100%; max-width: 360px; }
.sgr_learn .sgr_learn_knopf:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; transform: none; }
.sgr_learn a:focus-visible, .sgr_learn button:focus-visible, .sgr_learn input:focus-visible {
	outline: 3px solid #1c1c1e; outline-offset: 3px;
}
.sgr_learn .sgr_learn_link {
	background: none; border: 0; padding: 8px 4px; font: inherit; color: var(--sgr-learn-farbe);
	text-decoration: underline; text-underline-offset: 3px; cursor: pointer; min-height: 40px;
}

/* ---------- Formularfelder ---------- */
.sgr_learn_feld { display: block; text-align: left; margin: 0 0 14px; border: 0; padding: 0; }
.sgr_learn_feld > span, .sgr_learn_feld legend { display: block; font-size: calc(.95 * var(--sgr-r, 16px)); margin-bottom: 6px; color: var(--sgr-learn-leise); }
.sgr_learn_feld input:not([type=checkbox]) {
	width: 100%; min-height: 52px; padding: 10px 16px; font: inherit; font-size: calc(1.1 * var(--sgr-r, 16px));
	border: 2px solid var(--sgr-learn-rand); border-radius: 14px; background: #fff; color: var(--sgr-learn-text);
	transition: border-color .12s ease, box-shadow .12s ease;
}
.sgr_learn_feld input:focus { border-color: var(--sgr-learn-farbe); outline: none; box-shadow: 0 0 0 4px rgba(184, 20, 30, .14); }
.sgr_learn_code_eingabe { text-align: center; text-transform: uppercase; letter-spacing: .3em; font-family: ui-monospace, Consolas, monospace !important; font-size: calc(1.6 * var(--sgr-r, 16px)) !important; font-weight: 700; }
.sgr_learn_haken { display: flex; gap: 10px; align-items: center; min-height: 40px; }
.sgr_learn_haken input { width: 22px; height: 22px; accent-color: var(--sgr-learn-farbe); }

/* Test-Anmeldung (nur lokal) */
.sgr_learn_test { border: 2px dashed #d9a400; background: #fffdf3; box-shadow: none; }
.sgr_learn .sgr_learn_test_marke { font-size: calc(.8 * var(--sgr-r, 16px)); font-weight: 800; color: #8a6400; text-transform: uppercase; letter-spacing: .06em; margin: 0 0 14px; }

/* ---------- Kursüberschrift und Pfad ---------- */
.sgr_learn .sgr_learn_zurueck { margin: 0 0 6px; font-size: calc(.95 * var(--sgr-r, 16px)); }
.sgr_learn_zurueck a { color: var(--sgr-learn-farbe); text-decoration: none; font-weight: 600; }
.sgr_learn .sgr_learn_kurstitel { margin: 0 0 8px; font-size: calc(1.35 * var(--sgr-r, 16px)); font-weight: 800; letter-spacing: -.01em; color: var(--sgr-learn-text); }
.sgr_learn .sgr_learn_kurstitel a { color: inherit; text-decoration: none; }
.sgr_learn .sgr_learn_kurstitel a::before { content: "← "; color: var(--sgr-learn-farbe); }
.sgr_learn_pfad { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 18px; font-size: calc(.92 * var(--sgr-r, 16px)); }
.sgr_learn_pfad a, .sgr_learn_pfad strong, .sgr_learn_pfad > span:not([aria-hidden]) {
	padding: 5px 12px; border-radius: 999px; background: var(--sgr-learn-grund); text-decoration: none; color: var(--sgr-learn-leise);
}
.sgr_learn_pfad a { color: var(--sgr-learn-farbe); background: #fbeeee; font-weight: 600; }
.sgr_learn_pfad strong { background: var(--sgr-learn-text); color: #fff; }
.sgr_learn_pfad span[aria-hidden] { color: #b0b3b8; }
.sgr_learn .sgr_learn_abschnitt { font-size: calc(.78 * var(--sgr-r, 16px)); font-weight: 800; text-transform: uppercase; letter-spacing: .09em; color: var(--sgr-learn-leise); margin: 22px 0 10px; }

/* ---------- Kacheln ---------- */
.sgr_learn_kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.sgr_learn_kacheln_gross { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.sgr_learn .sgr_learn_kachel {
	position: relative; overflow: hidden;
	display: flex; flex-direction: column; gap: 6px; min-height: 150px; padding: 22px 20px 18px;
	background: var(--sgr-learn-flaeche); border: 1px solid var(--sgr-learn-rand);
	border-radius: var(--sgr-learn-radius); color: var(--sgr-learn-text); text-decoration: none;
	box-shadow: var(--sgr-learn-schatten);
	transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
	-webkit-tap-highlight-color: transparent;
}
.sgr_learn .sgr_learn_kachel::before {
	content: ""; position: absolute; inset: 0 0 auto 0; height: 6px; background: var(--sgr-learn-akzent);
}
.sgr_learn .sgr_learn_kachel:hover { transform: translateY(-3px); box-shadow: var(--sgr-learn-schatten-hoch); }
.sgr_learn .sgr_learn_kachel:active { transform: translateY(-1px) scale(.985); }
.sgr_learn_kachel_symbol { position: relative; width: 52px; height: 52px; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center; font-size: calc(1.7 * var(--sgr-r, 16px)); line-height: 1; margin: 2px 0 6px; }
.sgr_learn_kachel_symbol::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--sgr-learn-akzent); opacity: .12; }
.sgr_learn_kachel_name { font-size: calc(1.12 * var(--sgr-r, 16px)); font-weight: 750; line-height: 1.3; letter-spacing: -.01em; }
.sgr_learn_kachel_info { font-size: calc(.88 * var(--sgr-r, 16px)); color: var(--sgr-learn-leise); }

/* Kurse etwas größer */
.sgr_learn .sgr_learn_kachel_kurs { min-height: 180px; }
/* Schullogo dezent oben rechts in jeder Kachel (liegt im Plugin, wird nicht nachgeladen). */
.sgr_learn .sgr_learn_kachel { isolation: isolate; }
.sgr_learn .sgr_learn_kachel::after {
	content: ""; position: absolute; right: -14px; top: -10px; width: 120px; height: 120px; z-index: -1;
	background: var(--sgr-learn-logo, url("../icons/schullogo.png")) no-repeat center / contain; opacity: var(--sgr-learn-logo-deckung, .1); pointer-events: none;
}
.sgr_learn .sgr_learn_kachel_blatt::after { width: 96px; height: 96px; right: -12px; top: -8px; }
.sgr_learn .sgr_learn_kachel_kurs .sgr_learn_kachel_name { font-size: calc(1.3 * var(--sgr-r, 16px)); }

/* Fortschritt */
.sgr_learn_fortschritt { margin-top: auto; padding-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.sgr_learn_balken { display: block; height: 8px; border-radius: 999px; background: var(--sgr-learn-grund); overflow: hidden; }
.sgr_learn_balken > span { display: block; height: 100%; border-radius: inherit; background: var(--sgr-learn-akzent); transition: width .4s ease; }
.sgr_learn_fortschritt_text { font-size: calc(.82 * var(--sgr-r, 16px)); color: var(--sgr-learn-leise); }

/* Kurskopf und Lernabschnitte (Schüleransicht) */
.sgr_learn_kurskopf { display: flex; align-items: center; gap: 14px; margin: 0 0 18px; }
.sgr_learn .sgr_learn_kurskopf .sgr_learn_kurstitel { margin: 0; }
.sgr_learn .sgr_learn_kurskopf .sgr_learn_kachel_symbol { margin: 0; }
.sgr_learn_abschnitte { display: flex; flex-direction: column; gap: 12px; }
.sgr_learn_ab { background: var(--sgr-learn-flaeche); border: 1px solid var(--sgr-learn-rand); border-left: 6px solid var(--sgr-learn-akzent); border-radius: 0 16px 16px 0; overflow: hidden; }
.sgr_learn_ab_fertig { border-left-color: var(--sgr-learn-gruen); }
.sgr_learn .sgr_learn_ab_kopf {
	display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; width: 100%;
	padding: 16px 18px; border: 0; background: transparent; font: inherit; color: var(--sgr-learn-text);
	text-align: left; cursor: pointer; min-height: 60px;
}
.sgr_learn .sgr_learn_ab_kopf:hover { background: var(--sgr-learn-grund); }
.sgr_learn_ab_titel { flex: 1 1 220px; font-size: calc(1.12 * var(--sgr-r, 16px)); font-weight: 750; }
.sgr_learn_ab_stand { font-size: calc(.85 * var(--sgr-r, 16px)); color: var(--sgr-learn-leise); }
.sgr_learn_ab_fertig .sgr_learn_ab_stand { color: var(--sgr-learn-gruen); font-weight: 700; }
.sgr_learn_ab_pfeil { font-size: calc(1.4 * var(--sgr-r, 16px)); line-height: 1; color: var(--sgr-learn-leise); transition: transform .15s ease; }
.sgr_learn_ab_offen .sgr_learn_ab_pfeil { transform: rotate(180deg); }
.sgr_learn_ab_inhalt { padding: 4px 16px 16px; }

/* Arbeitsblätter */
.sgr_learn .sgr_learn_kachel_blatt { min-height: 130px; padding-right: 46px; }
.sgr_learn_kachel_pfeil {
	position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
	font-size: calc(1.9 * var(--sgr-r, 16px)); line-height: 1; color: #c4c7cc; transition: transform .15s ease, color .15s ease;
}
.sgr_learn .sgr_learn_kachel_blatt:hover .sgr_learn_kachel_pfeil { color: var(--sgr-learn-akzent); transform: translate(3px, -50%); }
.sgr_learn_marke {
	align-self: flex-start; margin-top: auto; font-size: calc(.82 * var(--sgr-r, 16px)); font-weight: 700;
	padding: 4px 12px; border-radius: 999px; background: var(--sgr-learn-grund); color: var(--sgr-learn-leise);
}
.sgr_learn_marke_neu { background: #fbeaea; color: var(--sgr-learn-farbe); }
.sgr_learn_marke_begonnen { background: #e7f6ec; color: var(--sgr-learn-gruen); }
.sgr_learn_marken { margin-top: auto; display: flex; flex-wrap: wrap; gap: 6px; }
.sgr_learn_marken .sgr_learn_marke { margin-top: 0; }
.sgr_learn_marke_offen { background: var(--sgr-learn-grund); color: var(--sgr-learn-leise); }
.sgr_learn_marke_abgegeben { background: #1a7f37; color: #fff; }
.sgr_learn_marke_feedback { background: #fff1c2; color: #6b4b00; }
.sgr_learn_marke_faellig { background: #eef2ff; color: #3730a3; }
.sgr_learn_marke_ueberfaellig { background: #fde8e8; color: #9b1c1c; }
.sgr_learn .sgr_learn_ist_abgegeben::before { background: var(--sgr-learn-gruen); }
.sgr_learn_ab_stand .sgr_learn_marke { padding: 2px 10px; }
.sgr_learn_punkt { color: var(--sgr-learn-farbe); font-size: .8em; vertical-align: middle; }

/* Zähler auf Kurskacheln (neu / Rückmeldung) */
.sgr_learn_zaehler_box { position: absolute; top: 16px; right: 16px; display: flex; gap: 6px; z-index: 1; }
.sgr_learn_zaehler { font-size: calc(.8 * var(--sgr-r, 16px)); font-weight: 800; padding: 4px 10px; border-radius: 999px; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.sgr_learn_zaehler_neu { background: var(--sgr-learn-farbe); color: #fff; }
.sgr_learn_zaehler_feedback { background: #ffd84d; color: #4a3500; }

/* Datenschutzhinweis */
.sgr_learn_datenschutz { max-width: 620px; margin: 0 auto; text-align: left; }
.sgr_learn_datenschutz .sgr_learn_start_symbol, .sgr_learn_datenschutz .sgr_learn_gross { text-align: center; }
.sgr_learn_datenschutz .sgr_learn_knopf { display: block; margin: 18px auto 0; }

/* Leerer Kurs */
.sgr_learn_leer_karte { box-shadow: none; background: var(--sgr-learn-grund); border-style: dashed; }
.sgr_learn .sgr_learn_leer_symbol { font-size: calc(2.6 * var(--sgr-r, 16px)); margin: 0 0 6px; }

/* Meldungen (Fehler, Hinweise, Abmelden) */
.sgr_learn_meldung {
	max-width: 560px; margin: 0 auto 18px; padding: 16px 20px; border-radius: 16px;
	border: 1px solid #cdd9ee; background: #f1f5fc; text-align: center;
}
.sgr_learn .sgr_learn_meldung p { margin: 0 0 8px; }
.sgr_learn_meldung_fehler { background: #fff6dc; border-color: #ecd28a; color: #5c3d00; font-weight: 600; }

@media (max-width: 560px) {
	.sgr_learn { font-size: 17px; }
	.sgr_learn_kacheln, .sgr_learn_kacheln_gross { grid-template-columns: 1fr; gap: 12px; }
	.sgr_learn .sgr_learn_kachel { min-height: 0; }
	.sgr_learn .sgr_learn_kachel_blatt { display: grid; grid-template-columns: 46px 1fr; column-gap: 14px; align-items: center; }
	.sgr_learn .sgr_learn_kachel_blatt .sgr_learn_kachel_symbol { margin: 0; width: 46px; height: 46px; grid-row: span 2; }
	.sgr_learn .sgr_learn_kachel_blatt .sgr_learn_marken { margin-top: 4px; }
	.sgr_learn_karte { padding: 24px 18px; border-radius: 20px; }
	.sgr_learn .sgr_learn_gruss { font-size: calc(1.45 * var(--sgr-r, 16px)); }
	.sgr_learn_person_name { display: none; }
}
@media (prefers-reduced-motion: reduce) {
	.sgr_learn *, .sgr_learn *::before { transition: none !important; }
}

/* ---------- Arbeitsblatt-Ansicht (Vollbild / Vollfenster) ---------- */
html.sgr_learn_offen, html.sgr_learn_offen body { overflow: hidden !important; }
.sgr_learn.sgr_learn_blatt {
	position: fixed; inset: 0; z-index: 2147483000; max-width: none; margin: 0;
	display: flex; flex-direction: column; background: var(--sgr-learn-grund);
	height: 100vh; height: 100dvh;
}
.sgr_learn_leiste {
	display: flex; align-items: center; gap: 8px; padding: 6px 8px;
	padding-top: max(6px, env(safe-area-inset-top));
	background: var(--sgr-learn-farbe); color: #fff; flex: 0 0 auto;
}
.sgr_learn .sgr_learn_leiste_knopf {
	min-height: 44px; min-width: 44px; padding: 8px 14px; border-radius: 12px;
	border: 1px solid rgba(255,255,255,.45); background: rgba(255,255,255,.12); color: #fff;
	font: inherit; font-size: calc(1 * var(--sgr-r, 16px)); font-weight: 600; cursor: pointer;
}
.sgr_learn .sgr_learn_leiste_speichern { background: #fff; color: var(--sgr-learn-farbe); border-color: #fff; }
.sgr_learn_leiste_titel { flex: 1 1 auto; min-width: 0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sgr_learn_status { font-size: calc(.9 * var(--sgr-r, 16px)); white-space: nowrap; padding: 4px 10px; border-radius: 999px; }
.sgr_learn_status_gespeichert { background: rgba(255,255,255,.95); color: var(--sgr-learn-gruen); font-weight: 600; }
.sgr_learn_status_offen, .sgr_learn_status_speichert { background: rgba(255,255,255,.2); }
.sgr_learn_status_fehler { background: #fff3cd; color: #7a4d00; font-weight: 600; white-space: normal; }
.sgr_learn_rahmen { position: relative; flex: 1 1 auto; min-height: 0; background: #fff; }
.sgr_learn_rahmen iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.sgr_learn_rahmen_info { position: absolute; top: 40%; left: 0; right: 0; text-align: center; color: var(--sgr-learn-leise); margin: 0; }
.sgr_learn_blatt:fullscreen { width: 100%; height: 100%; }

@media (max-width: 600px) {
	.sgr_learn_leiste { flex-wrap: wrap; }
	.sgr_learn_leiste_knopf span { display: none; }
	.sgr_learn_leiste_titel { order: 5; flex-basis: 100%; font-size: calc(.95 * var(--sgr-r, 16px)); padding: 0 4px 2px; }
	.sgr_learn_status { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; text-align: center; font-size: calc(.8 * var(--sgr-r, 16px)); }
	.sgr_learn_status_fehler { white-space: nowrap; }
	.sgr_learn .sgr_learn_leiste_knopf { padding: 8px 10px; }
}

/* Abgeben und Rückmeldung im Arbeitsblatt */
.sgr_learn .sgr_learn_leiste_abgeben { background: #1a7f37; border-color: #1a7f37; }
.sgr_learn .sgr_learn_leiste_abgeben.sgr_learn_ist_abgegeben { background: rgba(255,255,255,.95); color: #1a7f37; border-color: #fff; }
.sgr_learn .sgr_learn_leiste_abgeben:disabled { opacity: 1; cursor: default; }
.sgr_learn_rueckmeldung {
	display: flex; gap: 12px; align-items: flex-start; flex: 0 0 auto;
	padding: 12px 16px; background: #fff8db; border-bottom: 1px solid #ecd28a; color: #3d2e00;
	max-height: 35vh; overflow: auto;
}
.sgr_learn_rueckmeldung[hidden] { display: none; }
.sgr_learn_rueckmeldung > div { flex: 1 1 auto; }
.sgr_learn_rueckmeldung_symbol { font-size: calc(1.5 * var(--sgr-r, 16px)); line-height: 1; }
.sgr_learn .sgr_learn_rueckmeldung_titel { margin: 0 0 2px; font-size: calc(.85 * var(--sgr-r, 16px)); font-weight: 800; color: #6b4b00; }
.sgr_learn .sgr_learn_rueckmeldung_text { margin: 0; font-size: calc(1 * var(--sgr-r, 16px)); }
.sgr_learn .sgr_learn_rueckmeldung_zu { border: 0; background: transparent; font-size: calc(1.1 * var(--sgr-r, 16px)); cursor: pointer; color: #6b4b00; min-width: 36px; min-height: 36px; }

/* Umschalter Lehrkraft / Als Schüler (steht hier, damit er schon vor dem Nachladen des Lehrkraft-Teils richtig aussieht) */
.sgr_learn_modus { display: inline-flex; gap: 4px; padding: 4px; margin: 0 0 18px; border-radius: 999px; background: var(--sgr-learn-grund); border: 1px solid var(--sgr-learn-rand); }
.sgr_learn_modus a { padding: 8px 16px; border-radius: 999px; text-decoration: none; color: var(--sgr-learn-leise); font-weight: 600; font-size: calc(.95 * var(--sgr-r, 16px)); }
.sgr_learn_modus a[aria-current] { background: var(--sgr-learn-flaeche); color: var(--sgr-learn-text); box-shadow: var(--sgr-learn-schatten); }

/* ---------- Einstellungen aus dem Backend ---------- */
.sgr_learn.sgr_learn_ohne_logo .sgr_learn_kachel::after { display: none; }

/* Kachelgröße */
.sgr_learn.sgr_learn_groesse_kompakt .sgr_learn_kacheln { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.sgr_learn.sgr_learn_groesse_kompakt .sgr_learn_kachel { min-height: 0; padding: 16px 16px 14px; gap: 4px; }
.sgr_learn.sgr_learn_groesse_kompakt .sgr_learn_kachel_kurs { min-height: 130px; }
.sgr_learn.sgr_learn_groesse_kompakt .sgr_learn_kachel_blatt { min-height: 96px; }
.sgr_learn.sgr_learn_groesse_kompakt .sgr_learn_kachel_symbol { width: 40px; height: 40px; font-size: calc(1.3 * var(--sgr-r, 16px)); border-radius: 12px; }
.sgr_learn.sgr_learn_groesse_kompakt .sgr_learn_kachel::after { width: 84px; height: 84px; }
.sgr_learn.sgr_learn_groesse_gross .sgr_learn_kacheln { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.sgr_learn.sgr_learn_groesse_gross .sgr_learn_kachel { padding: 28px 24px 22px; }
.sgr_learn.sgr_learn_groesse_gross .sgr_learn_kachel_kurs { min-height: 220px; }
.sgr_learn.sgr_learn_groesse_gross .sgr_learn_kachel_blatt { min-height: 160px; }
.sgr_learn.sgr_learn_groesse_gross .sgr_learn_kachel_symbol { width: 64px; height: 64px; font-size: calc(2.1 * var(--sgr-r, 16px)); }
.sgr_learn.sgr_learn_groesse_gross .sgr_learn_kachel::after { width: 150px; height: 150px; }

/* Volle Bildschirmbreite: Breite und Versatz rechnet oberflaeche.js genau aus (ohne Bildlaufleiste). */
.sgr_learn.sgr_learn_voll { max-width: none; }

/* Ecken-Einstellung auch für Abschnitte und Karten */
.sgr_learn .sgr_learn_ab { border-radius: 0 var(--sgr-learn-radius) var(--sgr-learn-radius) 0; }
.sgr_learn .sgr_learn_karte { border-radius: calc(var(--sgr-learn-radius) + 6px); }

/* ---------- Gruppenarbeit ---------- */
.sgr_learn_marke_gruppe { background: #eef2ff; color: #3730a3; }
.sgr_learn .sgr_learn_gruppe { display: inline-flex; align-items: center; gap: 2px; flex: 0 0 auto; padding: 2px 8px 2px 6px; border-radius: 999px; background: rgba(255,255,255,.16); color: #fff; font-size: calc(.82 * var(--sgr-r, 16px)); font-weight: 600; }
.sgr_learn .sgr_learn_gruppe_titel { margin-right: 4px; white-space: nowrap; }
.sgr_learn .sgr_learn_gruppe_person { position: relative; width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: calc(.72 * var(--sgr-r, 16px)); font-weight: 800; color: #fff; border: 2px solid rgba(255,255,255,.85); margin-left: -4px; opacity: .55; }
.sgr_learn .sgr_learn_gruppe_person:first-of-type { margin-left: 0; }
.sgr_learn .sgr_learn_gruppe_da { opacity: 1; }
.sgr_learn .sgr_learn_gruppe_da::after { content: ""; position: absolute; right: -2px; bottom: -2px; width: 8px; height: 8px; border-radius: 50%; background: #22c55e; border: 1.5px solid #fff; }
.sgr_learn .sgr_learn_gruppe_zahl { margin-left: 6px; font-size: calc(.75 * var(--sgr-r, 16px)); opacity: .9; }
@media (max-width: 640px) {
	.sgr_learn .sgr_learn_gruppe_titel span, .sgr_learn .sgr_learn_gruppe_zahl { display: none; }
}

/* ---------- Partnerwahl („Mit wem arbeitest du heute?“) ---------- */
.sgr_learn .sgr_learn_partnerwahl { flex: 1 1 auto; overflow: auto; background: var(--sgr-learn-grund); display: flex; align-items: flex-start; justify-content: center; padding: 28px 16px; }
.sgr_learn .sgr_learn_partnerwahl:not([hidden]) ~ .sgr_learn_rahmen { display: none; }
.sgr_learn .sgr_learn_pw_box { background: #fff; border-radius: 24px; padding: 24px; max-width: 640px; width: 100%; box-shadow: 0 10px 40px rgba(0,0,0,.12); }
.sgr_learn .sgr_learn_pw_titel { font-size: calc(1.45 * var(--sgr-r, 16px)); font-weight: 800; margin: 0 0 6px; }
.sgr_learn .sgr_learn_pw_liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin: 16px 0; }
.sgr_learn .sgr_learn_pw_person { display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px 12px; min-height: 56px; border-radius: 16px; border: 2px solid var(--sgr-learn-rand); background: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.sgr_learn .sgr_learn_pw_person:hover:not(:disabled) { border-color: var(--sgr-learn-farbe); }
.sgr_learn .sgr_learn_pw_person:disabled { opacity: .45; cursor: not-allowed; }
.sgr_learn .sgr_learn_pw_person small { display: block; font-weight: 500; font-size: calc(.78 * var(--sgr-r, 16px)); color: var(--sgr-learn-leise); }
.sgr_learn .sgr_learn_pw_av { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--sgr-learn-farbe); color: #fff; font-weight: 800; }
.sgr_learn .sgr_learn_pw_suche { width: 100%; padding: 12px 14px; border: 2px solid var(--sgr-learn-rand); border-radius: 14px; font: inherit; margin-top: 10px; }
.sgr_learn .sgr_learn_pw_allein { width: 100%; }
.sgr_learn .sgr_learn_pw_knoepfe { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 14px; }

/* Zweitknopf auch für Schüler (Partnerwahl) */
.sgr_learn .sgr_learn_knopf_zweit {
	display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 20px;
	border-radius: 14px; border: 2px solid var(--sgr-learn-rand); background: var(--sgr-learn-flaeche);
	color: var(--sgr-learn-text); font: inherit; font-weight: 700; cursor: pointer; text-decoration: none;
}
.sgr_learn .sgr_learn_knopf_zweit:hover { border-color: var(--sgr-learn-farbe); color: var(--sgr-learn-farbe); }

/* ---------- Schutz vor Theme-Stilen (1.7.2) ---------- */
/* Manche Themes setzen Rahmen, Schatten, feste Höhen und Ränder für alle Eingabefelder. */
.sgr_learn input, .sgr_learn select, .sgr_learn textarea, .sgr_learn button { max-width: 100%; margin: 0; letter-spacing: normal; text-transform: none; }
.sgr_learn input:not([type="checkbox"]):not([type="radio"]), .sgr_learn select, .sgr_learn textarea { height: auto; box-shadow: none; }
