/* ==========================================================================
   Physik Helferlein - Layout, Navigation und Lern-Bausteine (Stand 2026-11-12)
   Aufbau und Raster wie Mathe Helferlein / Biologie Helferlein, Farbwelt Violett/Orange.
   Schrift: Systemschrift (keine Webfonts, nichts von Dritten).
   ========================================================================== */

:root {
	--brand: #0f5c8c;
	--brand-dark: #0a4466;
	--brand-soft: #e6f0f7;
	--accent: #b45309;
	--accent-soft: #fdf2e4;
	--bg: #f1f5f9;
	--card: #ffffff;
	--text: #16212e;
	--muted: #526070;
	--border: #d2dde8;
	--ok: #1d7a4b;
	--ok-soft: #e7f6ee;
	--warn: #b42318;
	--warn-soft: #fdeceb;
	--sun: #fff7de;
	--radius: 12px;
	--shadow: 0 1px 2px rgba(15, 40, 70, .06), 0 4px 16px rgba(15, 40, 70, .06);

	/* Elementfamilien im Periodensystem */
	--el-alkali: #ffe0d2;
	--el-erdalkali: #ffeec5;
	--el-uebergang: #e3eafb;
	--el-lanthanoid: #f6e0f1;
	--el-actinoid: #fbe1e8;
	--el-metall: #e0efe7;
	--el-halbmetall: #e9f3d3;
	--el-nichtmetall: #d9f2f6;
	--el-halogen: #fbf5c4;
	--el-edelgas: #e9e2fb;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	background-color: var(--bg);
	color: var(--text);
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 17px;
	line-height: 1.6;
}

a { color: var(--brand-dark); }
a:hover { color: var(--brand); }

/* ---------- Kopfzeile ---------- */
.site-header { background: var(--card); border-bottom: 1px solid var(--border); box-shadow: 0 1px 3px rgba(15, 40, 70, .05); }
.site-header__inner {
	max-width: 1280px; margin: 0 auto; padding: 14px 20px;
	display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.site-logo { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; flex: 0 0 auto; }
.site-logo:hover { color: inherit; }
.site-logo__mark {
	width: 44px; height: 44px; border-radius: 10px; flex: 0 0 auto;
	background: linear-gradient(135deg, var(--brand) 0%, var(--accent) 100%); color: #fff;
	display: flex; align-items: center; justify-content: center;
}
.site-logo__name { display: block; font-family: Georgia, "Times New Roman", Times, serif; font-size: 26px; font-weight: 700; line-height: 1.1; color: var(--brand); }
.site-logo__claim { display: block; font-size: 14px; color: var(--muted); }

.header-nav { display: flex; gap: 6px; margin-left: auto; }
.header-nav a { text-decoration: none; color: var(--text); font-weight: 700; font-size: 15px; padding: 8px 12px; border-radius: 8px; white-space: nowrap; }
.header-nav a:hover { background: var(--brand-soft); color: var(--brand-dark); }
.header-nav a.is-active { background: var(--brand); color: #fff; }

.menu-toggle {
	display: none; border: 1px solid var(--border); background: var(--card); border-radius: 10px;
	padding: 10px 14px; font-size: 15px; font-weight: 700; color: var(--text); text-decoration: none;
	align-items: center; gap: 8px;
}
.menu-toggle__bars, .menu-toggle__bars::before, .menu-toggle__bars::after {
	display: block; width: 20px; height: 2px; background: currentColor; border-radius: 2px; position: relative; content: "";
}
.menu-toggle__bars::before { position: absolute; top: -6px; }
.menu-toggle__bars::after { position: absolute; top: 6px; }

/* ---------- Suche ---------- */
.site-search { position: relative; display: flex; flex: 1 1 320px; max-width: 420px; }
.site-search__input {
	flex: 1 1 auto; min-width: 0; font: inherit; font-size: 16px; padding: 9px 12px;
	border: 2px solid var(--border); border-right: 0; border-radius: 10px 0 0 10px; background: #fff; color: var(--text);
}
.site-search__input:focus { outline: none; border-color: var(--brand); }
.site-search__btn {
	display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 0 10px 10px 0; padding: 0 14px;
	background: var(--brand); color: #fff; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer;
}
.site-search__btn:hover { background: var(--brand-dark); }
.site-search__btn svg { width: 18px; height: 18px; }
.site-search__list {
	position: absolute; z-index: 50; top: calc(100% + 4px); left: 0; right: 0; margin: 0; padding: 6px; list-style: none;
	background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 28px rgba(15, 40, 70, .16);
	max-height: 70vh; overflow-y: auto;
}
.site-search__list.is-stale { opacity: .6; }
.site-search__item a { display: block; padding: 7px 10px; border-radius: 8px; text-decoration: none; color: var(--text); }
.site-search__item.is-active a, .site-search__item a:hover { background: var(--brand-soft); }
.site-search__title { display: block; font-weight: 700; color: var(--brand-dark); font-size: 15px; }
.site-search__meta { display: block; font-size: 13px; color: var(--muted); }
.site-search__item.is-all a { font-size: 14px; color: var(--muted); }
.site-search--big { max-width: 560px; flex: none; margin: 14px 0 6px; }
.site-search--big .site-search__input { font-size: 18px; padding: 12px 14px; }
.search-examples p { margin: 0 0 .6em; }
.chip { display: inline-block; margin: 0 4px 6px 0; padding: 3px 11px; border-radius: 999px; border: 1px solid var(--border); text-decoration: none; color: var(--text); font-size: 15px; background: #fff; }
.chip:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }
.search-calc { border: 2px solid var(--brand); border-radius: var(--radius); padding: 14px 18px; margin: 0 0 1.4em; background: linear-gradient(180deg, var(--brand-soft) 0%, #fff 100%); }
.search-calc__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }

/* ---------- Seitenraster ---------- */
.page {
	max-width: 1280px; margin: 0 auto; padding: 20px;
	display: grid; grid-template-columns: 230px minmax(0, 1fr); grid-template-areas: "nav content";
	gap: 20px; align-items: start;
}
.page--ads { grid-template-columns: 230px minmax(0, 1fr) 180px; grid-template-areas: "nav content ads"; }
.page.page--wide { grid-template-columns: minmax(0, 1fr); grid-template-areas: "content"; max-width: 1360px; }
.side-nav { grid-area: nav; }
.content { grid-area: content; min-width: 0; }
.side-ads { grid-area: ads; position: sticky; top: 20px; min-height: 250px; }

@media screen and (max-width: 1100px) {
	.page--ads { grid-template-columns: 220px minmax(0, 1fr); grid-template-areas: "nav content"; }
	.side-ads { display: none; }
	.header-nav a { padding: 8px 8px; }
}
@media screen and (max-width: 980px) {
	.header-nav { display: none; }
}
@media screen and (max-width: 760px) {
	body { font-size: 16px; }
	.page, .page--ads { grid-template-columns: minmax(0, 1fr); grid-template-areas: "content"; padding: 12px; }
	.side-nav { display: none; }
	.menu-toggle { display: inline-flex; }
	.site-header__inner { padding: 10px 12px; flex-wrap: wrap; }
	.site-logo__name { font-size: 22px; }
	.site-logo__mark { width: 38px; height: 38px; }
	.site-logo__claim { font-size: 13px; }
	.site-header .site-search { order: 3; flex: 1 1 100%; max-width: none; }
}

/* ---------- Navigation links ---------- */
.side-nav__group { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; overflow: hidden; }
.side-nav__head { margin: 0; padding: 10px 14px; font-size: 14px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--brand-dark); background: var(--brand-soft); }
.side-nav__head a { color: inherit; text-decoration: none; }
.side-nav__head a:hover { text-decoration: underline; }
.side-nav__group ul { list-style: none; margin: 0; padding: 6px; }
.side-nav a { display: block; padding: 7px 10px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 15px; line-height: 1.35; }
.side-nav a:hover { background: var(--bg); color: var(--brand-dark); }
.side-nav a.is-active { background: var(--brand); color: #fff; font-weight: 700; }
.side-nav a.is-open { font-weight: 700; color: var(--brand-dark); }
.side-nav__sep { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 6px; }
.nav-tag { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 999px; font-size: 11px; font-weight: 700; line-height: 18px; vertical-align: 1px; background: var(--accent-soft); color: var(--accent); }
.side-nav a.is-active .nav-tag { background: #fff; color: var(--brand-dark); }
.grade-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 10px; }
.grade-grid a { display: block; text-align: center; padding: 6px 0; border-radius: 8px; border: 1px solid var(--border); text-decoration: none; color: var(--text); font-weight: 700; font-size: 15px; }
.grade-grid a:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }
.grade-grid a.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- Menü (Smartphone) ---------- */
.mnav { display: none; }
.mnav:target, .mnav.is-open {
	display: block; position: fixed; z-index: 1000; top: 0; right: 0; bottom: 0; width: min(88vw, 400px);
	background: #fff; box-shadow: -8px 0 30px rgba(15, 40, 70, .25); overflow-y: auto; padding: 0 0 30px;
}
.mnav-backdrop { position: fixed; inset: 0; z-index: 999; background: rgba(8, 25, 45, .4); }
.mnav__head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--brand-soft); position: sticky; top: 0; }
.mnav__title { font-weight: 700; color: var(--brand-dark); }
.mnav__close { font-size: 30px; line-height: 1; text-decoration: none; color: var(--text); padding: 0 6px; }
.mnav__list, .mnav ul { list-style: none; margin: 0; padding: 0; }
.mnav__list > li { border-bottom: 1px solid var(--border); }
.mnav a, .mnav summary { display: block; padding: 12px 16px; color: var(--text); text-decoration: none; cursor: pointer; }
.mnav summary { font-weight: 700; }
.mnav details ul a { padding: 9px 16px 9px 30px; font-size: 15px; }
.mnav a.is-active { font-weight: 700; color: var(--brand-dark); background: var(--brand-soft); }
.mnav__grades { display: grid !important; grid-template-columns: repeat(3, 1fr); }
body.mnav-open { overflow: hidden; }

/* ---------- Inhalt ---------- */
.content-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px 36px 32px; }
@media screen and (max-width: 760px) { .content-card { padding: 18px 16px 22px; border-radius: 10px; } }

.content h1, .content h2, .content h3, .content h4 { color: var(--text); line-height: 1.25; margin: 1.6em 0 .6em; }
.content h1 { font-size: 30px; margin-top: 0; color: var(--brand-dark); }
.content h2 { font-size: 23px; padding-bottom: 6px; border-bottom: 2px solid var(--brand-soft); }
.content h3 { font-size: 19px; }
.content h4 { font-size: 17px; }
@media screen and (max-width: 760px) { .content h1 { font-size: 25px; } .content h2 { font-size: 21px; } }
.content p, .content ul, .content ol { margin: 0 0 1em; }
.content li { margin-bottom: .3em; }
.lead { font-size: 1.08em; color: var(--muted); }
.content a.dotted, .content a.dotted:visited { text-decoration: none; border-bottom: 1px dotted currentColor; }
.formula-box { background: var(--brand-soft); border-radius: 10px; padding: 12px 18px; margin: 0 0 1.2em; overflow-x: auto; font-size: 1.1em; text-align: center; }
.formula-box .chem { white-space: normal; }
.chem { white-space: nowrap; }
.chem sub, .chem sup { font-size: .72em; line-height: 0; }
.eq { display: block; text-align: center; font-size: 1.12em; margin: .4em 0 .9em; overflow-x: auto; }

/* Brotkrümel + Klassen */
.pagebar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: -6px 0 18px; font-size: 14px; }
.breadcrumb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 0; }
.breadcrumb li { margin: 0; color: var(--muted); }
.breadcrumb li + li::before { content: "›"; margin: 0 8px; color: #93a4b6; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--brand-dark); text-decoration: underline; }
.grade-chips { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.grade-chip { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--brand-soft); color: var(--brand-dark); text-decoration: none; }
.grade-chip:hover { background: var(--brand); color: #fff; }

/* Kacheln */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin: 0 0 1.4em; }
.tile {
	position: relative; display: block; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px;
	text-decoration: none; color: var(--text); background: var(--card); transition: border-color .15s, box-shadow .15s, transform .15s;
}
a.tile:hover { border-color: var(--brand); box-shadow: var(--shadow); transform: translateY(-1px); color: var(--text); }
.tile__title { display: block; font-weight: 700; color: var(--brand-dark); margin-bottom: 4px; }
.tile__text { display: block; font-size: 15px; color: var(--muted); line-height: 1.45; }
.tile__badge { display: inline-block; margin-bottom: 6px; padding: 0 8px; border-radius: 999px; font-size: 11px; font-weight: 700; line-height: 19px; text-transform: uppercase; letter-spacing: .04em; background: var(--brand-soft); color: var(--brand-dark); }
.tile--werkzeug .tile__badge { background: var(--accent-soft); color: var(--accent); }
.tile--uebung .tile__badge { background: var(--sun); color: #7a5600; }
.tile__meta { display: block; margin-top: 8px; font-size: 13px; color: var(--muted); }
.tile__icon {
	display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 10px; margin-bottom: 8px;
	background: linear-gradient(135deg, var(--brand) 0%, var(--accent) 100%); color: #fff;
}
.related-title { margin-top: 2em !important; }

/* Startseite */
.hero { background: linear-gradient(135deg, var(--brand-soft) 0%, var(--accent-soft) 100%); border-radius: var(--radius); padding: 22px 24px; margin: 0 0 1.6em; }
.hero h1 { margin-bottom: .3em; }
.hero__hint { font-size: 15px; color: var(--muted); margin: 0 !important; }
.stage-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin: 0 0 1.4em; }
.stage { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; background: var(--card); }
.stage__title { margin: 0 0 8px !important; font-weight: 700; color: var(--brand-dark); }
.stage__grades { display: flex; flex-wrap: wrap; gap: 6px; }
.stage__grades a { display: inline-block; min-width: 42px; text-align: center; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border); text-decoration: none; font-weight: 700; color: var(--text); }
.stage__grades a:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 1.2em; padding: 0; list-style: none; }
.chip-row a { display: inline-block; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border); text-decoration: none; color: var(--text); font-size: 15px; }
.chip-row a:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }
.home-pse { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: center; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; margin: 0 0 1.4em; background: #fff; }
.home-pse p { margin: 0 0 .6em; }
.home-pse__cells { display: grid; grid-template-columns: repeat(4, 54px); gap: 5px; }
@media screen and (max-width: 640px) { .home-pse { grid-template-columns: minmax(0, 1fr); } }

/* Lern-Bausteine */
.merke, .beispiel, .tipp, .achtung, .experiment { border-radius: 10px; padding: 12px 16px; margin: 1em 0 1.2em; border: 1px solid; }
.merke { background: var(--sun); border-color: #ecd58e; }
.beispiel { background: #f4f7fb; border-color: var(--border); }
.tipp { background: var(--ok-soft); border-color: #b5e0c8; }
.achtung { background: var(--warn-soft); border-color: #f3c2bd; }
.experiment { background: var(--accent-soft); border-color: #f1cdb5; }
.box-title { margin: 0 0 6px !important; font-weight: 700; font-size: 14px; text-transform: uppercase; letter-spacing: .05em; }
.merke .box-title { color: #7a5600; }
.beispiel .box-title { color: var(--brand-dark); }
.tipp .box-title { color: var(--ok); }
.achtung .box-title { color: var(--warn); }
.experiment .box-title { color: var(--accent); }
.merke > :last-child, .beispiel > :last-child, .tipp > :last-child, .achtung > :last-child, .experiment > :last-child { margin-bottom: 0; }

.info, .warning, .success { position: relative; display: block; margin: 1em 0; padding: 12px 16px 12px 52px; border-radius: 10px; border: 1px solid; line-height: 1.5; }
.info { background: #ecf3fb; border-color: #c4d8ef; }
.warning { background: var(--warn-soft); border-color: #f3c2bd; }
.success { background: var(--ok-soft); border-color: #b5e0c8; }
.info::before, .warning::before, .success::before { position: absolute; left: 14px; top: 12px; width: 26px; height: 26px; border-radius: 50%; color: #fff; font-weight: 700; font-size: 16px; line-height: 26px; text-align: center; }
.info::before { content: "i"; background: #2d6cb0; }
.warning::before { content: "!"; background: var(--warn); }
.success::before { content: "\2713"; background: var(--ok); }
.info p:last-child, .warning p:last-child, .success p:last-child { margin-bottom: 0; }

.wiki-ref { margin-top: 2em; font-size: 15px; color: var(--muted); }
.wiki-ref__label { font-weight: 700; }
a.ext-wiki::after { content: " ↗"; font-size: .85em; }

/* Tabellen */
.table-wrap { overflow-x: auto; margin: 0 0 1.2em; }
table.data { border-collapse: collapse; min-width: 100%; }
table.data th, table.data td { border: 1px solid var(--border); padding: 8px 14px; text-align: left; vertical-align: top; }
table.data th { background: var(--brand-soft); }
table.data.center th, table.data.center td { text-align: center; vertical-align: middle; }
table.data td.num, table.data th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.data tfoot td { font-weight: 700; background: #f5f8fc; }
table.data .hl { background: #fff1c2; font-weight: 700; }

/* Schrittfolgen (Ablauf) */
.flow { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; list-style: none; margin: 0 0 1.2em; padding: 0; }
.flow li { flex: 1 1 140px; margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--brand-soft); border: 1px solid var(--border); font-size: 15px; position: relative; }
.flow li strong { display: block; color: var(--brand-dark); }
.chain { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 1.2em; }
.chain span { padding: 6px 12px; border-radius: 999px; background: var(--brand-soft); border: 1px solid var(--border); font-weight: 700; font-size: 15px; }
.chain i { font-style: normal; color: var(--muted); font-weight: 700; }

/* Abbildungen */
.figure-row { display: flex; flex-wrap: wrap; gap: 18px 28px; align-items: flex-end; justify-content: center; margin: 1em 0 1.4em; }
.figure { margin: 1em 0 1.4em; text-align: center; }
.figure-row .figure { margin: 0; flex: 1 1 260px; }
.figure svg { display: block; margin: 0 auto 6px; max-width: 100%; height: auto; }
.figure figcaption { font-size: 15px; color: var(--muted); }
.figure text { font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }

/* Selbsttest */
.quiz { margin: 0 0 1.6em; }
.quiz__q { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px 14px; margin: 0 0 12px; background: #fbfcfe; }
.quiz__q legend { font-weight: 700; padding: 0 6px; margin-left: -6px; }
.quiz__nr { color: var(--brand); }
.quiz__opts { display: grid; gap: 6px; margin: 6px 0 8px; }
.quiz__opt { display: flex; gap: 8px; align-items: flex-start; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: #fff; cursor: pointer; }
.quiz__opt:hover { border-color: var(--brand); }
.quiz__opt input { margin-top: .35em; flex: 0 0 auto; }
.quiz__opt.is-right { border-color: var(--ok); background: var(--ok-soft); }
.quiz__opt.is-wrong { border-color: var(--warn); background: var(--warn-soft); }
.quiz__why summary { cursor: pointer; color: var(--brand-dark); font-size: 15px; }
.quiz__why p { margin: 6px 0 0 !important; font-size: 15px; }
.quiz__feedback { margin: 4px 0 0 !important; font-weight: 700; font-size: 15px; }
.quiz__feedback.is-right { color: var(--ok); }
.quiz__feedback.is-wrong { color: var(--warn); }
.quiz__score { font-weight: 700; padding: 10px 14px; border-radius: 10px; background: var(--brand-soft); }

/* Werkzeuge (Formulare, Ergebnis, Lösungsweg) */
.tool { border: 1px solid var(--border); border-radius: var(--radius); background: linear-gradient(180deg, var(--brand-soft) 0%, #fff 100%); padding: 16px 18px; margin: 0 0 1.4em; }
.tool__row { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; margin-bottom: 10px; }
.tool__field label { display: block; font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.tool__field--grow { flex: 1 1 320px; }
.tool__help { display: block; font-size: 13px; color: var(--muted); margin-top: 3px; }
.tool__input, .tool__select { font: inherit; font-size: 18px; padding: 8px 12px; border: 2px solid #b6cbe0; border-radius: 10px; background: #fff; color: var(--text); min-width: 0; }
.tool__input { width: 9em; }
.tool__input--wide { width: 100%; font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 17px; }
.tool__select { font-size: 16px; }
.tool__input:focus, .tool__select:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px rgba(15, 92, 140, .2); }
.tool__examples { font-size: 15px; color: var(--muted); margin: 6px 0 0 !important; }
.btn { display: inline-block; border: 0; border-radius: 10px; padding: 10px 18px; background: var(--brand); color: #fff; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--brand-dark); color: #fff; }
.btn--ghost { background: #fff; color: var(--brand-dark); border: 1px solid var(--border); }
.btn--ghost:hover { background: var(--brand-soft); color: var(--brand-dark); }
.result { border: 2px solid var(--brand); border-radius: var(--radius); padding: 14px 18px; margin: 0 0 1.4em; }
.result__title { margin: 0 0 6px !important; font-weight: 700; color: var(--brand-dark); font-size: 14px; text-transform: uppercase; letter-spacing: .05em; }
.result__big { font-size: 1.3em; font-weight: 700; margin: 4px 0; }
.result p:last-child { margin-bottom: 0; }
.steps { list-style: none; counter-reset: step; margin: 0 0 1.4em; padding: 0; }
.step { counter-increment: step; position: relative; padding-left: 44px; margin-bottom: 12px; }
.step::before { content: counter(step); position: absolute; left: 0; top: 10px; width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; text-align: center; line-height: 30px; }
.step__card { border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; overflow-x: auto; }
.step__title { margin: 0 0 4px !important; font-weight: 700; }
.step__text { margin: 0 0 6px !important; }
.step__html table.data { min-width: 0; }
.step__html p { margin: 0 0 .5em; }
.lgs { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 15px; background: #f5f8fc; border-radius: 8px; padding: 8px 12px; margin: 0 0 .6em; white-space: pre-wrap; }

/* Periodensystem */
.pse-wrap { overflow-x: auto; margin: 0 0 1.2em; padding-bottom: 6px; }
.pse { display: grid; grid-template-columns: repeat(18, minmax(46px, 1fr)); gap: 3px; min-width: 900px; }
.pse__el {
	display: flex; flex-direction: column; justify-content: space-between; min-height: 58px; padding: 3px 4px 4px;
	border: 1px solid rgba(15, 40, 70, .14); border-radius: 6px; text-decoration: none; color: var(--text); line-height: 1.1; background: #fff;
}
a.pse__el:hover, a.pse__el.is-active { outline: 3px solid var(--brand); outline-offset: -1px; color: var(--text); z-index: 1; }
.pse__z { font-size: 11px; color: var(--muted); }
.pse__sym { font-size: 19px; font-weight: 700; text-align: center; }
.pse__name { font-size: 9.5px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #34404d; }
.pse__ph { display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--muted); border: 1px dashed var(--border); border-radius: 6px; min-height: 58px; text-align: center; }
.pse__head { font-size: 12px; font-weight: 700; color: var(--muted); text-align: center; align-self: end; padding-bottom: 2px; }
.pse__per { font-size: 12px; font-weight: 700; color: var(--muted); display: flex; align-items: center; justify-content: flex-end; padding-right: 4px; }
.pse__gap { height: 10px; }
.pse__el.el-alkali { background: var(--el-alkali); }
.pse__el.el-erdalkali { background: var(--el-erdalkali); }
.pse__el.el-uebergang { background: var(--el-uebergang); }
.pse__el.el-lanthanoid { background: var(--el-lanthanoid); }
.pse__el.el-actinoid { background: var(--el-actinoid); }
.pse__el.el-metall { background: var(--el-metall); }
.pse__el.el-halbmetall { background: var(--el-halbmetall); }
.pse__el.el-nichtmetall { background: var(--el-nichtmetall); }
.pse__el.el-halogen { background: var(--el-halogen); }
.pse__el.el-edelgas { background: var(--el-edelgas); }
.pse__el.is-dim { opacity: .28; }
.pse-legend { display: flex; flex-wrap: wrap; gap: 6px 8px; margin: 0 0 1em; padding: 0; list-style: none; font-size: 14px; }
.pse-legend a { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 4px; border-radius: 999px; border: 1px solid var(--border); text-decoration: none; color: var(--text); background: #fff; }
.pse-legend a.is-active { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand) inset; }
.pse-legend i { display: inline-block; width: 16px; height: 16px; border-radius: 4px; border: 1px solid rgba(15, 40, 70, .2); }
.pse-legend > li > span { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 4px; border-radius: 999px; border: 1px solid var(--border); background: #fff; }
.pse-views { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0 0 .4em; }
.pse-views__label { font-weight: 700; font-size: 15px; }
.pse-views .chip-row { margin: 0 0 .6em; }
.chip-row a.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.pse-scale { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 1em; font-size: 14px; }
.pse-scale__bar { display: inline-block; width: min(320px, 60vw); height: 14px; border-radius: 7px; border: 1px solid rgba(15, 40, 70, .2); }
.pse-scale__lab { font-weight: 700; }
.pse-scale__note { color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.pse-scale__note i { display: inline-block; width: 14px; height: 14px; border-radius: 3px; border: 1px solid rgba(15, 40, 70, .2); }
.pse__el--heat .pse__z, .pse__el--heat .pse__name { color: inherit; opacity: .85; }
.pse__el--heat .pse__name { font-weight: 600; }
.loesl td { text-align: center; padding: 0; }
.loesl td a { display: block; padding: 6px 10px; text-decoration: none; color: var(--text); font-weight: 700; }
.loesl td a:hover { box-shadow: 0 0 0 2px var(--brand) inset; }
.loesl td.is-active { box-shadow: 0 0 0 3px var(--brand) inset; }
.loesl tbody th { text-align: left; white-space: nowrap; }
.loesl th small { color: var(--muted); font-weight: 400; }
.geraete { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin: 0 0 1em; }
.geraet { margin: 0; padding: 10px 12px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; display: flex; flex-direction: column; align-items: center; text-align: center; }
.geraet svg { width: 100px; height: 120px; }
.geraet figcaption { font-size: 14px; line-height: 1.4; }
.geraet figcaption strong { display: block; font-size: 15.5px; margin: 4px 0 3px; color: var(--brand-dark); }
.geraet figcaption span { color: var(--muted); }
.fg-formel { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; white-space: nowrap; }
.el-card { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 18px; border: 2px solid var(--brand); border-radius: var(--radius); padding: 16px 18px; margin: 0 0 1.4em; }
.el-card__box { border-radius: 10px; padding: 10px 12px; text-align: center; border: 1px solid rgba(15, 40, 70, .15); align-self: start; }
.el-card__box .z { font-size: 15px; text-align: left; color: var(--muted); }
.el-card__box .sym { font-size: 48px; font-weight: 700; line-height: 1.1; }
.el-card__box .name { font-weight: 700; }
.el-card__box .mass { font-size: 14px; color: var(--muted); }
.el-card h2 { margin-top: 0 !important; border: 0 !important; padding: 0 !important; }
.el-card dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; margin: 0 0 .6em; }
.el-card dt { font-weight: 700; color: var(--muted); }
.el-card dd { margin: 0; }
@media screen and (max-width: 640px) { .el-card { grid-template-columns: minmax(0, 1fr); } .el-card__box { max-width: 170px; } }
.shells { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; }

/* Oxidationszahlen über den Symbolen (Stand 2026-11-12) */
.ox { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.05; vertical-align: bottom; }
.ox__n { font-size: .52em; font-weight: 700; color: var(--accent); }
.ox-formula { font-size: 1.5em; line-height: 1.6; }
.ox-part { display: inline-block; margin-right: .9em; white-space: nowrap; }

/* Kästchenschema (Orbitale) */
.orb-boxes { display: flex; flex-wrap: wrap; gap: 10px 16px; margin: 4px 0 6px; }
.orb { text-align: center; }
.orb__boxes { display: flex; }
.orb__box { width: 30px; height: 34px; border: 2px solid var(--brand); margin-left: -2px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; letter-spacing: -3px; background: #fff; color: var(--brand-dark); }
.orb__box:first-child { margin-left: 0; }
.orb__label { font-size: 13px; color: var(--muted); font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; margin-top: 2px; }

/* Mischungskreuz */
.mixcross { display: grid; grid-template-columns: repeat(3, minmax(80px, 150px)); gap: 6px; justify-content: center; margin: 0 0 1.4em; text-align: center; font-weight: 700; }
.mixcross span { padding: 8px 6px; border-radius: 8px; }
.mixcross__w { background: var(--brand-soft); }
.mixcross__z { background: var(--sun); }
.mixcross__p { background: var(--accent-soft); }

/* Übungstrainer (js/ch-ueben.js) */
.drill { border: 2px solid var(--brand); border-radius: var(--radius); padding: 14px 16px 16px; margin: 0 0 1.6em; background: linear-gradient(180deg, var(--brand-soft) 0%, #fff 60%); }
.drill__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 12px; }
.drill__levels, .drill__modes { display: flex; flex-wrap: wrap; gap: 4px; }
.drill__btn { font: inherit; font-size: 14px; font-weight: 700; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--border); background: #fff; color: var(--text); cursor: pointer; }
.drill__btn:hover { border-color: var(--brand); }
.drill__btn.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.drill__score { margin-left: auto; font-weight: 700; font-size: 15px; color: var(--brand-dark); }
.drill__card { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.drill__nr { margin: 0 0 6px !important; font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.drill__task p { margin: 0 0 .7em; }
.drill__eq { font-size: 1.2em; line-height: 2.2; }
.drill__term { white-space: nowrap; }
.drill__op { color: var(--muted); margin: 0 4px; }
.drill__coef { width: 2.2em; font: inherit; font-size: .9em; text-align: center; padding: 2px 4px; margin-right: 3px; border: 2px solid #b6cbe0; border-radius: 6px; }
.drill__coef:focus, .drill__in:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px rgba(15, 92, 140, .2); }
.drill__label { display: inline-block; font-weight: 700; margin: 0 10px 6px 0; }
.drill__in { width: 9em; }
.drill__in--short { width: 5em; }
.drill__in--wide { width: 16em; max-width: 100%; }
.drill__formula { font-size: 1.15em; }
.drill__formula mark, .drill mark { background: var(--sun); color: var(--accent); padding: 0 2px; border-radius: 3px; font-weight: 700; }
.drill__big { font-size: 1.8em; }
.drill__struct { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; white-space: nowrap; }
.drill__struct--big { font-size: 1.25em; overflow-x: auto; }
.drill__struct sub { font-size: .75em; }
.drill__feedback { margin: 10px 0 0 !important; padding: 8px 12px; border-radius: 8px; font-weight: 700; }
.drill__feedback.is-right { background: var(--ok-soft); color: var(--ok); }
.drill__feedback.is-wrong { background: var(--warn-soft); color: var(--warn); }
.drill__feedback.is-partial { background: var(--sun); color: #7a5600; }
.drill__solution { margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: #f5f8fc; border: 1px dashed var(--border); }
.drill__solution p:last-child, .drill__solution ul:last-child { margin-bottom: 0; }
.drill__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.drill-list li { margin-bottom: .5em; }
.drill-list details summary { cursor: pointer; color: var(--brand-dark); }

/* Atom-Baukasten (js/ch-atom.js) */
.atomkit { border: 2px solid var(--brand); border-radius: var(--radius); padding: 14px 16px; margin: 0 0 1.6em; }
.atomkit__controls { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-bottom: 12px; }
.atomkit__ctl { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--border); }
.atomkit__ctl--p { background: #fde4dc; }
.atomkit__ctl--n { background: #eeedf2; }
.atomkit__ctl--e { background: var(--brand-soft); }
.atomkit__label { font-weight: 700; min-width: 6.5em; }
.atomkit__btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); background: #fff; font: inherit; font-size: 20px; font-weight: 700; cursor: pointer; line-height: 1; }
.atomkit__btn:hover { border-color: var(--brand); background: var(--brand-soft); }
.atomkit__val { min-width: 2.2em; text-align: center; font-weight: 700; font-size: 20px; font-variant-numeric: tabular-nums; }
.atomkit__view { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 16px; align-items: start; }
@media screen and (max-width: 700px) { .atomkit__view { grid-template-columns: minmax(0, 1fr); } }
.atomkit__svg svg { max-width: 100%; height: auto; display: block; margin: 0 auto; }
.atomkit__iso { display: flex; align-items: center; gap: 2px; font-weight: 700; margin: 0 0 4px !important; }
.atomkit__nums { display: inline-flex; flex-direction: column; text-align: right; font-size: 18px; line-height: 1.1; }
.atomkit__sym { font-size: 52px; line-height: 1; color: var(--brand-dark); }
.atomkit__q { align-self: flex-start; font-size: 24px; color: var(--accent); }
.atomkit__name { font-weight: 700; font-size: 1.1em; }
.atomkit__good { color: var(--ok); font-weight: 700; }
.atomkit__bad { color: var(--warn); font-weight: 700; }
.atomkit__goals { margin-top: 12px; padding: 10px 14px; border-radius: 10px; background: var(--sun); border: 1px solid #ecd58e; }
.atomkit__goals ol { margin: 0; }
.atomkit__goals li.is-done { color: var(--ok); }
.atomkit__ok { font-weight: 700; color: var(--ok); }

/* Nuklid-Schreibweise (Massenzahl oben, Ordnungszahl unten) */
.nuc { display: inline-flex; flex-direction: column; align-items: flex-end; vertical-align: middle; font-size: .62em; line-height: 1.05; margin-right: 1px; }

/* Stoff-Steckbriefe */
.stoff-formula { display: inline-block; margin-right: 10px; padding: 2px 12px; border-radius: 10px; background: var(--brand-soft); color: var(--brand-dark); font-size: 1.3em; font-weight: 700; }
.stoff-card th { width: 34%; white-space: nowrap; }
.stoff-nav { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; margin: 1.6em 0 .8em; }
.stoff-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.stoff-chip::before { content: none; }

/* Karteikarten */
.stoff-chip.is-active { background: var(--brand); color: #fff; border-color: var(--brand); }
.cards__trainer { margin: 1em 0 1.2em; }
.cards__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.cards__info { margin-left: auto; font-size: 14px; color: var(--muted); }
.cards__progress { height: 6px; border-radius: 3px; background: var(--brand-soft); overflow: hidden; margin-bottom: 12px; }
.cards__progress span { display: block; height: 100%; width: 0; background: var(--brand); transition: width .25s; }
.flashcard { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 10px; width: 100%; min-height: 220px; padding: 26px 22px; border: 2px solid var(--border); border-radius: 18px; background: #fff; box-shadow: var(--shadow); font: inherit; color: var(--text); text-align: center; cursor: pointer; }
.flashcard.is-back { background: #f5f8fc; border-color: var(--brand); }
.flashcard__term { font-size: 1.6em; font-weight: 700; color: var(--brand-dark); }
.flashcard__term--small { font-size: 1.1em; }
.flashcard__def { font-size: 1.08em; line-height: 1.5; max-width: 34em; }
.flashcard__hint { font-size: 13px; color: var(--muted); }
.cards__ctrl { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 12px; }
.cards__end { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.cards__toggle { margin: 4px 0 10px; }
.cards__item { border-bottom: 1px solid var(--border); padding: 8px 2px; }
.cards__item summary { cursor: pointer; font-weight: 700; color: var(--brand-dark); }
.cards__def { margin: 6px 0 2px; }
.cards__more { font-size: 14px; }

/* PDF-Verweise */
.pdf-links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 10px 12px; border-radius: 10px; background: #f5f8fc; border: 1px solid var(--border); }
.pdf-links__label { font-weight: 700; margin-right: 4px; }
.pdf-link { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--border); background: #fff; text-decoration: none; font-size: 15px; font-weight: 700; color: var(--brand-dark); }
.pdf-link::before { content: "PDF"; font-size: 10px; padding: 1px 5px; border-radius: 4px; background: var(--warn); color: #fff; letter-spacing: .03em; }
.pdf-link:hover { border-color: var(--brand); background: var(--brand-soft); }
.tile--pdf .tile__badge { background: var(--warn); color: #fff; }
.pdf-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
a.tile__meta { font-weight: 700; color: var(--brand-dark); text-decoration: none; }
a.tile__meta:hover { text-decoration: underline; }

/* Glossar */
.az { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 1.2em; }
.az a, .az span { display: inline-block; min-width: 32px; text-align: center; padding: 4px 6px; border-radius: 6px; border: 1px solid var(--border); text-decoration: none; font-weight: 700; }
.az span { color: #a8b6c5; border-color: #e2e9f1; }
.glossary dt { font-weight: 700; color: var(--brand-dark); margin-top: 12px; scroll-margin-top: 16px; }
.glossary dd { margin: 2px 0 0; }
.glossary dt:target, .glossary dt:target + dd { background: var(--sun); }

/* GHS-Piktogramme */
.ghs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 0 0 1.4em; }
.ghs { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; align-items: center; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.ghs svg { width: 64px; height: 64px; }
.ghs strong { display: block; }
.ghs span { font-size: 14px; color: var(--muted); line-height: 1.4; display: block; }

/* Werbung */
.ad-h { clear: both; margin: 2.5em 0 .5em; padding-top: .5em; border-top: 1px solid var(--border); min-height: 50px; }
.ad-h--mid { margin: 2em 0; padding-bottom: .5em; border-bottom: 1px solid var(--border); }
.ad-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: .3em; }

/* Fußzeile */
.site-footer { max-width: 1280px; margin: 10px auto 0; padding: 18px 20px 30px; text-align: center; font-size: 14px; color: var(--muted); }
.site-footer a { color: var(--muted); }
.site-footer nav { margin-bottom: 6px; }
.site-footer nav a { margin: 0 8px; }
.footer-areas { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 0; }

/* Barrierefreiheit */
.skip-link { position: absolute; left: -9999px; top: 8px; background: var(--brand); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 10000; }
.skip-link:focus { left: 8px; color: #fff; }
.visually-hidden { position: absolute !important; left: 0; top: 0; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px; }
fieldset { position: relative; min-width: 0; }
:focus-visible { outline: 3px solid #16212e; outline-offset: 2px; box-shadow: 0 0 0 2px #f2b705; }
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

@media print {
	.site-header, .side-nav, .side-ads, .site-footer, .mnav, .pagebar, .related-title, .related-title + .tiles, .wiki-ref, .ad-h, .tool form { display: none !important; }
	body { background: #fff; }
	.page { display: block; padding: 0; }
	.content-card { border: 0; box-shadow: none; padding: 0; }
	.quiz__why { display: none; }
	.pse { min-width: 0; }
}

/* ---------- Physik: Formel-Rechner, Formeln, Größen (Stand 2026-11-12) ---------- */
.qty { white-space: nowrap; }
.eq--box { display: inline-block; padding: 8px 16px; margin: .2em 0 1em; border: 1px solid var(--border); border-left: 4px solid var(--brand); border-radius: 8px; background: #fff; font-size: 1.12em; }
.eq__name { display: block; font-size: 13px; color: var(--muted); }
.tool__formula { margin: 0 0 .8em; font-size: 1.1em; }
.tool__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 16px; margin: 0 0 .8em; }
.tool__grid .tool__field { display: flex; flex-direction: column; gap: 4px; }
.tool__grid .tool__field label { font-weight: 700; font-size: 15px; }
.tool__grid .tool__field.is-result .tool__input { border-color: var(--accent); background: var(--accent-soft); }
.tool__pair { display: flex; gap: 6px; align-items: center; }
.tool__pair .tool__input { flex: 1 1 auto; width: 100%; min-width: 0; }
.tool__pair .tool__select { flex: 0 0 auto; font-size: 16px; padding: 8px 6px; }
.tool__unit { font-weight: 700; color: var(--muted); white-space: nowrap; }
.tool__actions { margin: .2em 0 .6em; }
table.formulas td.formula { white-space: nowrap; font-size: 1.05em; }
@media (max-width: 640px) { table.formulas td.formula { white-space: normal; } }
.r-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 14px; }
/* Smartphone: Hinweis unter den Buttons, Formelsammlung als Karten statt breiter Tabelle (Stand 2026-11-12) */
@media (max-width: 640px) {
	.tool__hint { display: block !important; margin-top: 6px; }
	table.formulas thead { display: none; }
	table.formulas, table.formulas tbody, table.formulas tr, table.formulas th, table.formulas td { display: block; width: auto; }
	table.formulas tr { padding: 10px 12px; border-bottom: 1px solid var(--border); }
	table.formulas tr:nth-child(even) { background: var(--bg); }
	table.formulas th, table.formulas td { border: 0; padding: 2px 0; background: none; }
	table.formulas td.formula { font-size: 1.15em; padding: 4px 0; }
}