/* ============================================================
   Homöopathie-Suche — Design-System „Herbarium“
   Entwurf: Codex (design/entwuerfe/herbarium), Umsetzung: Claude, 2026-09-05
   Teil 1: Tokens + Basis · Teil 2: Startseite · Teil 3: App-Chrome
   Teil 4: Komponenten des Rechenmoduls (Klassen aus assets/*.js)
   ============================================================ */

:root {
  --paper: #f4f0e5; --paper2: #e8e0cf; --paper3: #f8f5ee; --card: #fffdf8;
  --ink: #20372e; --muted: #58665f; --muted2: #7b8680;
  --moss: #315b49; --deep: #183d31; --deep2: #102b22;
  --gold: #9a6423; --gold-light: #f3e7cf; --terra: #8b472f; --terra-light: #f1ddd3;
  --line: #c9c1ad; --line-soft: #e2dccb; --sage: #d7ddc9; --sage2: #e9ede0; --sand: #dcc39f;
  --danger: #8a332b; --focus: #d48b24; --blue: #3d6478; --blue-light: #e6eef2;
  --g1: #e1e4df; --g1t: #27332e; --g2: #e9c477; --g2t: #34240d; --g3: #739579; --g3t: #10261a;
  --g4: #a9563e; --g4t: #fffaf0; --g5: #6d496f; --g5t: #fffaf0;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Source Sans 3', Arial, sans-serif;
  --shadow: 0 18px 45px #20372e1f; --shadow-sm: 0 2px 8px #20372e14;
  --radius: 2px;
  /* Aliase für ältere Modul-Skripte (var(--green) usw.) */
  --green: var(--moss); --green-dark: var(--deep); --green-light: var(--sage2);
  --amber: var(--gold); --amber-light: var(--gold-light); --amber-bg: var(--paper2);
  --red: var(--terra); --red-light: var(--terra-light);
  --text: var(--ink); --text2: var(--muted); --text3: var(--muted2);
  --border: var(--line-soft); --bg2: var(--paper2);
  --grade1: var(--g1); --grade2: var(--g2); --grade3: var(--g3); --grade4: var(--g4); --grade5: var(--g5);
}

/* ---------- Basis ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); background-color: var(--paper);
  background-image: radial-gradient(#20372e0a .55px, transparent .7px); background-size: 5px 5px;
  font: 16px/1.55 var(--sans); overflow-x: hidden;
}
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { max-width: 100%; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; background: #fff; padding: .7rem; z-index: 100; }
a, button, input, textarea, [tabindex] { outline-offset: 3px; }
:focus-visible { outline: 3px solid var(--focus); }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.06; margin: .45em 0; }
h1 { font-size: clamp(3rem, 6.5vw, 6.7rem); letter-spacing: -.045em; }
h2 { font-size: clamp(2.15rem, 4vw, 4.1rem); letter-spacing: -.03em; }
h3 { font-size: 1.45rem; }
p { max-width: 72ch; }
.eyebrow, .kicker, .section-title > span, .label {
  display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .17em; font-weight: 700; color: var(--gold);
}
.medical-note, .fineprint { font-size: .78rem; color: var(--muted); }
.icon { width: 1.05em; height: 1.05em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.15em; flex-shrink: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 44px;
  padding: .6rem 1rem; border: 1px solid var(--deep); border-radius: var(--radius); text-decoration: none;
  font-weight: 700; font-size: .92rem; background: transparent; color: var(--deep); line-height: 1.2;
  transition: background .15s, color .15s, border-color .15s;
}
.btn:hover { background: var(--sage2); }
.btn.primary, .btn-green { background: var(--deep); color: #fff; border-color: var(--deep); }
.btn.primary:hover, .btn-green:hover { background: var(--moss); border-color: var(--moss); }
.btn.light { border-color: #ffffff99; color: #fff; }
.btn.light:hover { background: #ffffff1c; }
.btn.ghost, .btn-outline { border-color: var(--line); color: var(--ink); background: var(--card); }
.btn-outline:hover { border-color: var(--deep); background: var(--card); }
.btn-blue { background: var(--moss); color: #fff; border-color: var(--moss); }
.btn-blue:hover { background: var(--deep); }
.btn-amber { background: var(--gold); color: #fff; border-color: var(--gold); }
.btn-sm { min-height: 34px; padding: .3rem .7rem; font-size: .82rem; }
.btn[disabled] { opacity: .5; cursor: default; }

/* ---------- Marke ---------- */
.brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; font: 600 1rem/1 var(--serif); color: inherit; }
.brand svg { width: 38px; height: 38px; fill: none; stroke: var(--moss); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.brand span small { display: block; font: 700 .65rem var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--gold); margin-top: .25rem; }

/* ============================================================
   Teil 2: Startseite
   ============================================================ */
.site-head { display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 20; height: 86px; padding: 0 clamp(1.25rem, 5vw, 5rem); border-bottom: 1px solid var(--line); }
.site-head nav { display: flex; align-items: center; gap: 1.7rem; }
.site-head nav a { text-decoration: none; font-size: .85rem; font-weight: 700; }
.nav-cta { border: 1px solid currentColor; padding: .65rem .9rem; border-radius: var(--radius); }
.nav-cta:hover { background: var(--deep); color: #fff; }

.hero { min-height: 720px; padding: clamp(4rem, 8vw, 7.5rem) clamp(1.25rem, 8vw, 8rem) 3rem; position: relative; overflow: hidden; background: radial-gradient(circle at 75% 25%, #fff9e9 0, transparent 38%); }
.hero > *:not(.botanical) { max-width: 760px; position: relative; z-index: 1; }
.hero h1 em { color: var(--moss); font-weight: 400; }
.intro { font: clamp(1.1rem, 1.6vw, 1.35rem)/1.5 var(--serif); max-width: 610px; }
.botanical { position: absolute; right: -1rem; bottom: -5rem; width: min(38vw, 520px); opacity: .5; fill: none; stroke: var(--moss); stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.search-card, .panel, .result-card, .portrait-paper { background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: var(--radius); }
.search-card { margin-top: 2rem; padding: 1rem; }
.search-card label, .field-label { display: block; font-size: .78rem; font-weight: 700; margin-bottom: .4rem; }
.search-row { display: flex; gap: .7rem; }
.search-row textarea, .search-row input, .field { border: 1px solid var(--line); background: var(--paper3); padding: .8rem; min-height: 48px; width: 100%; border-radius: var(--radius); }
.search-row textarea { resize: vertical; min-height: 76px; }
.search-meta { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: .65rem; font-size: .8rem; color: var(--muted); }
.search-meta span { display: inline-flex; align-items: center; gap: .4rem; }
.search-meta a { font-weight: 700; color: var(--deep); }

.section { padding: clamp(4.5rem, 8vw, 8rem) clamp(1.25rem, 8vw, 8rem); }
.steps { background: var(--deep); color: #f9f4e8; }
.steps .section-title > span { color: #e3b271; }
.steps ol { list-style: none; padding: 3rem 0 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 3rem; counter-reset: item; }
.steps li { border-top: 1px solid #ffffff42; padding-top: 1.2rem; }
.steps li:before { counter-increment: item; content: '0' counter(item); color: #e3b271; font-family: var(--serif); }
.steps li b { display: block; font: 400 1.7rem var(--serif); margin: .5rem 0; }
.steps li p { color: #d4ddd7; }
.paths { display: grid; grid-template-columns: 1fr 1fr; padding: 0 clamp(1.25rem, 8vw, 8rem); }
.path { padding: clamp(3rem, 6vw, 6rem); min-height: 410px; }
.consumer { background: var(--sage); }
.professional { background: var(--sand); }
.path a, .remedy-grid a, .article-grid a { font-weight: 700; text-underline-offset: 5px; }
.remedies { background: var(--card); }
.remedy-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); margin-top: 3rem; border: 1px solid var(--line); }
.remedy-grid article { background: var(--card); padding: 1.25rem; position: relative; }
.specimen-no { position: absolute; right: 1.2rem; top: 1.05rem; font: italic .72rem var(--serif); color: var(--muted); }
.plant { height: 160px; background: var(--paper); display: grid; place-items: center; margin-bottom: 1.2rem; border-bottom: 1px solid var(--line); }
.plant svg { width: 145px; height: 135px; fill: none; stroke: var(--moss); stroke-width: 1.35; stroke-linecap: round; stroke-linejoin: round; }
.remedy-grid article > span, .article-grid span { font-size: .68rem; letter-spacing: .11em; text-transform: uppercase; color: var(--muted); }
.remedy-grid p { font-size: .9rem; }
.remedy-grid .all { display: grid; place-items: center; background: var(--paper2); text-align: center; }
.archive { background: var(--terra); color: #fff6e9; display: grid; grid-template-columns: 1fr 1.3fr; gap: 4rem; align-items: end; }
.archive .kicker { color: #ffd19a; }
.archive dl { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; }
.archive dl div { border-top: 1px solid #ffffff57; padding: 1rem 0; }
.archive dt { font: clamp(1.8rem, 3vw, 3.6rem) var(--serif); }
.archive dd { margin: 0; color: #f0dacf; }
.archive a { color: #ffd19a; }
.sources { grid-column: 1/-1; border-top: 1px solid #ffffff57; padding-top: 1rem; }
.article-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; margin-top: 3rem; }
.article-grid article { border-top: 1px solid var(--ink); padding-top: 1.2rem; }
.pro { background: var(--paper2); display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; }
.pro ul { list-style: none; padding: 0; border-top: 1px solid var(--line); }
.pro li { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.pro li b { color: var(--moss); font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; margin-right: .5rem; }
.pro form { grid-column: 1/-1; background: var(--card); padding: 1.5rem; border: 1px solid var(--line); }
.pro form > div { display: flex; }
.pro input { padding: .9rem; border: 1px solid var(--line); flex: 1; min-width: 0; background: var(--paper3); }
.pro form .hp { position: absolute; left: -9999px; }
.form-msg { margin-top: .6rem; font-size: .9rem; color: var(--moss); font-weight: 600; }
.form-msg.err { color: var(--danger); }
.site-foot { background: var(--deep2); color: #dbe4df; padding: 4rem clamp(1.25rem, 8vw, 8rem); display: grid; grid-template-columns: 2fr 1fr 1fr 2fr; gap: 3rem; }
.site-foot b { color: #fff; font-family: var(--serif); }
.site-foot a { display: block; text-decoration: none; margin: .4rem 0; font-size: .88rem; }
.site-foot a:hover { color: #fff; text-decoration: underline; }
.site-foot p { font-size: .9rem; }
.disclaimer { font-size: .76rem; color: #c5d0cb; }
.disclaimer a { display: inline; margin: 0; font-size: inherit; text-decoration: underline; }

/* ============================================================
   Teil 3: App-Chrome (Rechenmodul)
   ============================================================ */
.app-body { padding-bottom: 2rem; }
.app-head { display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 20; min-height: 68px; background: var(--deep2); color: #fff; padding: 0 clamp(1rem, 3vw, 3rem); gap: 1rem; }
.app-head .brand svg { stroke: #e5c58c; }
.app-nav { display: flex; align-items: center; gap: 1.7rem; }
.app-nav a, .app-nav button { text-decoration: none; font-size: .85rem; font-weight: 700; padding: 1.45rem .1rem; border: 0; background: transparent; color: #fff; border-bottom: 3px solid transparent; border-radius: 0; }
.app-nav a.active, .app-nav button.active { color: #f0c887; border-color: #f0c887; }
.app-nav a:hover, .app-nav button:hover { color: #f0c887; }
.app-layout { max-width: 1400px; margin: auto; padding: clamp(1rem, 3vw, 2.5rem); }
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 2rem; margin-bottom: 1.5rem; }
.page-head h1 { font-size: clamp(2.5rem, 5vw, 4.8rem); }
.page-head p { margin-bottom: 0; }
.page-head .eyebrow { margin-bottom: .2rem; }

/* Fall-Leiste (selectedBar): erscheint nur mit Rubriken */
.casebar { display: none; background: var(--deep); color: #fff; padding: 1rem clamp(1rem, 3vw, 2.5rem); border-bottom: 1px solid #ffffff30; }
.casebar.visible { display: block; }
.casebar-inner { max-width: 1400px; margin: auto; display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: 1rem; }
.case-name { font-family: var(--serif); font-size: 1.1rem; border: 0; border-bottom: 1px dashed #ffffff80; padding: .3rem; background: transparent; color: #fff; min-width: 180px; max-width: 260px; }
.case-name:focus { outline: 2px solid var(--focus); }
.case-title { font-size: .68rem; letter-spacing: .15em; text-transform: uppercase; color: #f0c887; font-weight: 700; margin-bottom: .2rem; }
.pills, .selected-pills { display: flex; gap: .45rem; flex-wrap: wrap; }
.case-actions, .selected-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.casebar .btn { border-color: #ffffff99; color: #fff; }
.casebar .btn:hover { background: #ffffff1c; }
.casebar .btn-green { background: #f0c887; color: var(--deep2); border-color: #f0c887; }
.casebar .btn-green:hover { background: #f7d9a4; }

.sel-pill { background: var(--card); color: var(--ink); border: 1px solid var(--line); padding: .45rem .6rem .4rem; font-size: .82rem; max-width: 340px; border-radius: var(--radius); }
.sel-pill.elim { border: 2px solid #d8a08f; }
.sel-pill.grp { border-style: dashed; border-color: #f0c887; background: var(--gold-light); }
.sel-pill-top { display: flex; align-items: flex-start; gap: .5rem; }
.sel-pill-name { font-weight: 600; flex: 1; line-height: 1.3; }
.sel-pill-x { cursor: pointer; font-size: 1.1rem; line-height: 1; color: var(--muted); padding: 0 .1rem; }
.sel-pill-x:hover { color: var(--danger); }
.sel-pill-wlabel { font-size: .7rem; color: var(--muted); margin: .25rem 0; }
.sel-pill-weight { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.sel-pill-wbtn { border: 0; background: var(--paper3); padding: .2rem .7rem; font-size: .8rem; font-weight: 700; color: var(--muted); border-right: 1px solid var(--line); }
.sel-pill-wbtn:last-child { border-right: 0; }
.sel-pill-wbtn:hover { background: var(--sage2); color: var(--ink); }
.sel-pill-wbtn.active { background: var(--gold); color: #fff; }
.sel-pill-tools { display: flex; gap: .6rem; margin-top: .35rem; }
.casebar-toggle { display: none; }
.metafeld-block { margin-top: 1rem; border: 1px solid #D4C9B0; border-radius: var(--radius-lg); background: linear-gradient(135deg, var(--amber-light), var(--green-light)); padding: 0 1rem .6rem; }
.metafeld-block > summary { cursor: pointer; list-style: none; padding: .8rem 0; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--amber); }
.metafeld-block > summary::-webkit-details-marker { display: none; }
.metafeld-block > summary::before { content: '▸'; display: inline-block; margin-right: .5rem; transition: transform .15s; }
.metafeld-block[open] > summary::before { transform: rotate(90deg); }
.metafeld-block .metafeld-hint { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--muted); }
.pill-tool { font-size: .72rem; color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.pill-tool:hover { color: var(--deep); }
.pill-tool.on-elim { color: var(--terra); font-weight: 700; }
.pill-tool.on-grp { color: var(--gold); font-weight: 700; }

/* Panels */
.panel { display: none; padding: 0; margin: 0; background: transparent; border: 0; box-shadow: none; }
.panel.active { display: block; }
.paper { background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); padding: clamp(1rem, 2.5vw, 2rem); margin: 1rem 0; border-radius: var(--radius); }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin: 1rem 0; }
.segmented, .search-lang, .view-toggle { display: inline-flex; border: 1px solid var(--line); background: var(--card); padding: 3px; border-radius: var(--radius); }
.segmented button, .search-lang button, .view-toggle button { border: 0; background: transparent; padding: .45rem .75rem; font-weight: 700; font-size: .85rem; color: var(--muted); border-radius: var(--radius); }
.segmented button.active, .search-lang button.active, .view-toggle button.active { background: var(--deep); color: #fff; }

/* Suchfeld */
.search-wrap { position: relative; display: flex; align-items: center; gap: .7rem; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); padding: 1rem; margin-bottom: 1rem; border-radius: var(--radius); }
.search-icon { position: absolute; left: 1.6rem; color: var(--muted); pointer-events: none; display: flex; }
.search-input { flex: 1; border: 1px solid var(--line); background: var(--paper3); padding: .8rem .8rem .8rem 2.6rem; min-height: 48px; width: 100%; font-size: 1rem; border-radius: var(--radius); }
.search-input:focus { border-color: var(--moss); }
.search-input::placeholder { color: var(--muted2); }
.search-wrap.no-icon .search-input, textarea.search-input { padding-left: .8rem; }
.search-hint { font-size: .85rem; color: var(--muted); margin: 0 0 1rem; }

/* Ergebnis-Karten */
.result-item { background: var(--card); border: 1px solid var(--line); padding: .9rem 1rem; margin-bottom: .6rem; cursor: pointer; transition: border-color .15s, background .15s; border-radius: var(--radius); }
.result-item:hover { border-color: var(--moss); }
.result-item.kb-active { outline: 2px solid var(--deep); outline-offset: 1px; }
.metafeld-details { margin: 0 0 1rem; }
.metafeld-details > summary { cursor: pointer; list-style: none; padding: .7rem .9rem; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--amber); border: 1px solid #D4C9B0; border-radius: var(--radius); background: var(--amber-light); }
.metafeld-details > summary::-webkit-details-marker { display: none; }
.metafeld-details > summary::before { content: '▸'; display: inline-block; margin-right: .5rem; transition: transform .15s; }
.metafeld-details[open] > summary::before { transform: rotate(90deg); }
.metafeld-details[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.metafeld-details .metafeld-hint { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--muted); }
.metafeld-details > div > div:first-child { border-top-left-radius: 0 !important; border-top-right-radius: 0 !important; }
.kb-hint { font-size: .78rem; color: var(--muted); margin: .4rem 0 0; }
@media (hover: none) { .kb-hint { display: none; } }
.result-item.selected { border-color: var(--moss); background: var(--sage2); box-shadow: inset 4px 0 0 var(--moss); }
.result-symptom { font-family: var(--serif); font-size: 1.15rem; line-height: 1.3; }
.result-symptom mark { background: var(--gold-light); color: var(--ink); padding: 0 .1em; }
.result-meta { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .45rem; font-size: .78rem; color: var(--muted); }
.result-pfad { font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-top: .2rem; }
.result-badge, .badge { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .5rem; font-size: .74rem; font-weight: 700; border: 1px solid var(--line); background: var(--paper3); color: var(--ink); border-radius: var(--radius); }
.badge-green { background: var(--sage); border-color: #aebaa4; }
.badge-amber { background: var(--gold-light); border-color: #d9c18f; color: #5b3d14; }
.badge-red { background: var(--terra-light); border-color: #d8a08f; color: var(--terra); }
.badge-blue { background: var(--blue-light); border-color: #b9ccd6; color: var(--blue); }
.sel-badge { color: var(--moss); font-weight: 700; }

/* Karten (card) im Modul */
.card { background: var(--card); border: 1px solid var(--line); padding: 1.25rem 1.4rem; margin-bottom: 1rem; border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-title { font-family: var(--serif); font-size: 1.6rem; line-height: 1.15; margin-bottom: .3rem; }
.card-sub { font-size: .92rem; color: var(--muted); margin-bottom: .9rem; }
.card details summary { list-style: none; }
.card details summary::-webkit-details-marker { display: none; }

/* Zustände */
.loading { text-align: center; padding: 2rem 1rem; color: var(--muted); font-size: .9rem; }
.loading-spinner { width: 27px; height: 27px; border: 3px solid var(--line); border-top-color: var(--moss); border-radius: 50%; margin: 0 auto .5rem; }
.empty { border: 1px dashed var(--line); background: #ffffff60; padding: 1.5rem; text-align: center; color: var(--muted); font-family: var(--serif); font-size: 1.1rem; border-radius: var(--radius); }
.error, .card.error { border-left: 4px solid var(--danger); background: #f5e5df; }

/* Repertorium-Baum */
.breadcrumb, .breadcrumbs { display: flex; flex-wrap: wrap; gap: .4rem; color: var(--muted); font-size: .87rem; margin-bottom: 1rem; }
.breadcrumb a { cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.breadcrumb a:hover { color: var(--deep); }
.breadcrumb-sep { color: var(--line); }
.rubric-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.rubric-card { background: var(--card); padding: 1rem; min-height: 80px; cursor: pointer; position: relative; }
.rubric-card:hover { background: var(--sage2); }
.rubric-card-name { font-family: var(--serif); font-size: 1.15rem; }
.rubric-card-sub { font-size: .78rem; color: var(--muted); margin-top: .2rem; }
.rubric-card-nr { position: absolute; right: 1rem; top: .8rem; font: italic .72rem var(--serif); color: var(--muted); }

/* Mittel-Detail */
.remedy-header { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: flex-start; margin-bottom: 1rem; }
.remedy-title { font-family: var(--serif); font-size: clamp(1.8rem, 3vw, 2.6rem); line-height: 1.05; }
.remedy-latin { font: italic 1rem var(--serif); color: var(--muted); margin-top: .3rem; }
.remedy-section { margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--line-soft); }
.remedy-section-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .15em; font-weight: 700; color: var(--gold); margin-bottom: .6rem; }
.remedy-tag { display: inline-block; padding: .2rem .55rem; margin: 0 .3rem .3rem 0; font-size: .8rem; border: 1px solid var(--line); background: var(--paper3); border-radius: var(--radius); }
.portrait-box { background: var(--paper3); border: 1px solid var(--line-soft); padding: 1.2rem 1.4rem; margin-bottom: 1rem; border-radius: var(--radius); }
.portrait-box .kurz { font: italic 1.1rem/1.6 var(--serif); margin-bottom: 1rem; }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.kv { background: var(--card); border: 1px solid var(--line-soft); padding: .6rem .8rem; }
.kv b { display: block; font-size: .66rem; text-transform: uppercase; letter-spacing: .12em; color: var(--gold); margin-bottom: .2rem; }
.mod-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.mod { padding: .7rem .9rem; border-left: 4px solid var(--line); background: var(--card); font-size: .9rem; }
.mod.worse { border-left-color: var(--terra); }
.mod.better { border-left-color: var(--moss); }
.mod b { display: block; font-size: .66rem; text-transform: uppercase; letter-spacing: .12em; margin-bottom: .3rem; }
.lead { padding: .3rem 0 .3rem .9rem; border-left: 3px solid var(--gold); margin-bottom: .3rem; font-size: .95rem; }

/* Repertorisation – Kontrollen, Liste */
.rep-controls { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: 1rem; }
.rep-controls label { font-size: .8rem; font-weight: 700; color: var(--muted); }
.rep-controls select { border: 1px solid var(--line); background: var(--card); padding: .4rem .6rem; border-radius: var(--radius); }
.rep-result { background: var(--card); border: 1px solid var(--line); padding: .9rem 1rem; margin-bottom: .6rem; cursor: pointer; border-radius: var(--radius); }
.rep-result:hover { border-color: var(--moss); }
.rep-result-header { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.rep-remedy-name { font-family: var(--serif); font-size: 1.2rem; }
.rep-remedy-short { font-size: .8rem; color: var(--muted); margin-left: .4rem; }
.rep-score { font-family: var(--serif); font-size: 1.4rem; }
.rep-bar { height: 8px; background: var(--paper2); margin: .6rem 0 .2rem; }
.rep-bar-fill { display: block; height: 100%; background: var(--moss); }
.rep-detail { display: none; margin-top: .8rem; padding-top: .8rem; border-top: 1px solid var(--line-soft); font-size: .9rem; }
.rep-result.open .rep-detail { display: block; }
.rep-grade, .kt-grade, .grade { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-weight: 700; font-size: .78rem; border: 1px solid #0003; font-family: var(--sans); }
.g1 { background: var(--g1); color: var(--g1t); }
.g2 { background: var(--g2); color: var(--g2t); }
.g3 { background: var(--g3); color: var(--g3t); }
.g4 { background: var(--g4); color: var(--g4t); }
.g5 { background: var(--g5); color: var(--g5t); }
.legend { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin: .8rem 0; font-size: .82rem; color: var(--muted); }

/* Kreuztabelle */
.kt-wrap, .table-shell { overflow-x: auto; border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow); -webkit-overflow-scrolling: touch; border-radius: var(--radius); }
.kt, .data-table, .compare-table { border-collapse: collapse; width: 100%; font-size: .88rem; }
.kt th, .kt td, .data-table th, .data-table td { border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); padding: .55rem .6rem; text-align: center; white-space: nowrap; }
.kt thead th, .data-table thead th { background: var(--deep); color: #fff; position: sticky; top: 0; z-index: 3; vertical-align: bottom; }
.kt th:first-child, .kt td:first-child, .data-table th:first-child, .data-table td:first-child { position: sticky; left: 0; text-align: left; min-width: 240px; max-width: 280px; white-space: normal; z-index: 2; background: var(--card); border-right: 2px solid var(--line); }
.kt thead th:first-child, .data-table thead th:first-child { z-index: 4; background: var(--deep2); }
.kt .kt-remhead { font-weight: 700; cursor: pointer; padding: .3rem .1rem; color: #fff; }
.kt .kt-remhead:hover { color: #f0c887; text-decoration: underline; }
.kt .kt-sumrow td, .kt .kt-covrow td { background: var(--paper2); font-weight: 700; }
.kt .kt-covrow td { font-weight: 600; color: var(--muted); }
.kt tbody tr:hover td { background: var(--sage2); }
.kt .kt-cell-empty { color: var(--line); }
.kt .kt-rublabel { font-weight: 600; }
.kt .kt-rubmeta { font-size: .72rem; color: var(--muted); font-weight: 400; margin-top: .1rem; }

/* Vergleich */
.compare-select { display: flex; flex-wrap: wrap; gap: .45rem; margin: .8rem 0; }
.compare-pill { display: inline-flex; align-items: center; gap: .3rem; border: 1px solid var(--line); background: var(--card); padding: .35rem .6rem; font-size: .85rem; font-weight: 600; border-radius: var(--radius); }
.compare-pill.active { background: var(--deep); color: #fff; border-color: var(--deep); }
.compare-table th, .compare-table td { border-bottom: 1px solid var(--line-soft); padding: .55rem .6rem; text-align: left; vertical-align: top; font-size: .88rem; }
.compare-table thead th { background: var(--deep); color: #fff; position: sticky; top: 0; }
.compare-table th:first-child, .compare-table td:first-child { min-width: 180px; }
.compare-table td:not(:first-child) { text-align: center; }
.compare-table tr:hover td { background: var(--sage2); }
.compare-cat td { background: var(--paper2) !important; font-size: .7rem !important; text-transform: uppercase; letter-spacing: .12em; font-weight: 700; color: var(--gold); }

/* Symptom-Begleiter */
.guide-options { display: grid; gap: .5rem; }
.guide-option { border: 1px solid var(--line); background: var(--card); padding: .7rem .9rem; cursor: pointer; border-radius: var(--radius); }
.guide-option:hover { border-color: var(--moss); }
.guide-option.selected { border-color: var(--deep); background: var(--sage2); }
.guide-opt-text { font-weight: 600; }
.bubble { max-width: 75%; padding: 1rem 1.2rem; margin: 1rem 0; border: 1px solid var(--line); background: var(--card); border-radius: var(--radius); }
.bubble.guide { border-left: 4px solid var(--moss); }
.bubble.user { margin-left: auto; background: var(--sage); }
/* Begleiter: Laien-Weg verbirgt die Profi-Fall-Leiste bis „Profi-Ansicht öffnen“ */
body.laie-flow .casebar, body.laie-flow .fall-widget { display: none !important; }
.guide-steps { display: flex; gap: .4rem; list-style: none; padding: 0; margin: 0 0 1rem; flex-wrap: wrap; }
.guide-steps li { display: inline-flex; align-items: center; gap: .45rem; font-size: .8rem; font-weight: 700; color: var(--muted); padding: .35rem .7rem .35rem .4rem; border: 1px solid var(--line); border-radius: 999px; background: var(--card); }
.guide-steps li span { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--paper3); color: var(--muted); font-size: .75rem; }
.guide-steps li.current { color: var(--deep); border-color: var(--deep); }
.guide-steps li.current span { background: var(--deep); color: #fff; }
.guide-steps li.done { color: var(--moss); }
.guide-steps li.done span { background: var(--sage2); color: var(--deep); }
.laie-topcard { background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--gold); padding: 1.1rem 1.3rem; margin-bottom: .8rem; border-radius: var(--radius); }
.laie-topcard .platz { font-size: .7rem; text-transform: uppercase; letter-spacing: .15em; color: var(--gold); font-weight: 700; }
.laie-topcard .name { font-family: var(--serif); font-size: 1.5rem; margin: .2rem 0 .4rem; }
.laie-topcard .profil { font-size: .95rem; line-height: 1.6; color: var(--muted); }
.potency { background: var(--paper2); border-left: 4px solid var(--gold); padding: 1rem; margin: 1rem 0; }

/* Wissen */
.wissen-article { font-size: 1.05rem; line-height: 1.7; max-width: 72ch; }
.wissen-article h2 { font-size: 1.9rem; margin: 1.6em 0 .4em; }
.wissen-article h3 { font-size: 1.3rem; margin: 1.3em 0 .3em; }
.wissen-article p { margin: 0 0 1em; }
.wissen-article ul, .wissen-article ol { padding-left: 1.4em; margin: 0 0 1em; }
.wissen-article li { margin-bottom: .3em; }
.wissen-article strong { font-weight: 700; }
.wissen-article em { font-style: italic; }

/* Modal Fallverwaltung */
.modal-overlay { display: none; position: fixed; inset: 0; background: #172b245e; z-index: 60; padding: clamp(1rem, 5vw, 4rem) 1rem; overflow-y: auto; }
.modal-overlay.visible { display: block; }
.modal { max-width: 820px; margin: auto; padding: clamp(1rem, 3vw, 2rem); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: var(--radius); }
.modal-title { display: flex; justify-content: space-between; align-items: center; gap: 1rem; font-family: var(--serif); font-size: 2rem; border-bottom: 1px solid var(--line); padding-bottom: .6rem; margin-bottom: 1rem; }
.modal .field-label { margin-top: .8rem; }
.fall-row { display: flex; justify-content: space-between; gap: 1rem; padding: .8rem 0; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.fall-row.aktiv { background: var(--sage2); margin: 0 -.5rem; padding: .8rem .5rem; }
.fall-row-name { font-weight: 700; }
.fall-row-meta { font-size: .8rem; color: var(--muted); }
.fall-row-actions { display: flex; gap: .4rem; flex-wrap: wrap; }

/* Fall-Widget */
.fall-widget { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 30; background: var(--deep); color: #fff; box-shadow: var(--shadow); width: 300px; max-width: calc(100vw - 2rem); border-radius: var(--radius); }
.fall-widget-head { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .75rem 1rem; font-weight: 700; cursor: pointer; }
.fall-widget-head .n { display: inline-grid; place-items: center; background: #f0c887; color: var(--deep); width: 25px; height: 25px; border-radius: 50%; margin-right: .4rem; font-size: .85rem; }
.fall-widget-list { max-height: 240px; overflow-y: auto; border-top: 1px solid #ffffff30; }
.fall-widget-item { display: flex; align-items: center; gap: .5rem; padding: .45rem 1rem; font-size: .82rem; border-bottom: 1px solid #ffffff18; }
.fall-widget-item .w { display: inline-grid; place-items: center; width: 20px; height: 20px; background: var(--gold); color: #fff; font-size: .7rem; font-weight: 700; flex-shrink: 0; }
.fall-widget-item .n { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fall-widget-item .x { cursor: pointer; opacity: .7; }
.fall-widget-item .x:hover { opacity: 1; color: #f0c887; }
.fall-widget-foot { padding: .6rem 1rem .8rem; }
.fall-widget.collapsed .fall-widget-list, .fall-widget.collapsed .fall-widget-foot { display: none; }

/* Hinweisboxen aus dem JS (inline-Styles nutzen var(--blue-light) usw.) */
.note { padding: .7rem 1rem; border: 1px solid var(--line-soft); background: var(--paper3); font-size: .88rem; margin: 1rem 0; border-radius: var(--radius); }
.note.info { background: var(--blue-light); border-color: #b9ccd6; color: var(--blue); }
.note.warn { background: var(--gold-light); border-color: #d9c18f; color: #5b3d14; }
.note.danger { background: var(--terra-light); border-color: #d8a08f; }

/* Mittelporträt-Seite (mittel.php) */
.portrait-hero { display: grid; grid-template-columns: 1.1fr .9fr; min-height: 480px; background: var(--sage); }
.portrait-copy { padding: clamp(2rem, 6vw, 6rem); }
.portrait-copy h1 { font-size: clamp(2.6rem, 6vw, 6rem); }
.portrait-copy .btn { margin-top: .5rem; }
.portrait-art { display: grid; place-items: center; background: var(--paper); border-left: 1px solid var(--line); padding: 2rem; }
.portrait-art svg { width: min(75%, 420px); fill: none; stroke: var(--moss); stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
.portrait-art svg.generic { width: min(45%, 240px); opacity: .55; }
.latin { font: italic 1.3rem var(--serif); margin: .2rem 0; }
.abbr { display: inline-block; border: 1px solid var(--ink); padding: .2rem .55rem; font-weight: 600; }
.portrait-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(270px, 1fr); gap: 3rem; }
.prose { font-size: 1.08rem; }
.prose h2 { font-size: 2rem; margin-top: 2rem; }
.prose p { margin: .5rem 0 1rem; }
.rubric-list { list-style: none; padding: 0; margin: 0; }
.rubric-list li { padding: .6rem 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: .8rem; align-items: center; }
.rubric-list small { display: block; color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; }
.button-row { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }
.remedy-index { columns: 3; column-gap: 2rem; }
.remedy-index a { display: block; text-decoration: none; padding: .25rem 0; border-bottom: 1px solid var(--line-soft); font-size: .95rem; break-inside: avoid; }
.remedy-index a:hover { color: var(--moss); }
.remedy-index a small { color: var(--muted); }
.letter-nav { display: flex; flex-wrap: wrap; gap: .3rem; margin: 1rem 0 2rem; }
.letter-nav a { display: inline-grid; place-items: center; min-width: 34px; height: 34px; border: 1px solid var(--line); text-decoration: none; font-weight: 700; background: var(--card); }
.letter-nav a:hover { background: var(--deep); color: #fff; }

/* Rechtstexte */
.legal { max-width: 760px; margin: 0 auto; padding: clamp(2rem, 6vw, 5rem) clamp(1.25rem, 5vw, 3rem); }
.legal h1 { font-size: clamp(2.4rem, 5vw, 4rem); }
.legal h2 { font-size: .78rem; text-transform: uppercase; letter-spacing: .15em; color: var(--gold); margin: 2rem 0 .4rem; font-family: var(--sans); font-weight: 700; }
.legal p { line-height: 1.65; }
.legal a { color: var(--moss); }

/* ---------- Responsiv ---------- */
@media (max-width: 900px) {
  .site-head nav a:not(.nav-cta) { display: none; }
  .app-body { padding-bottom: 80px; }
  .app-head { min-height: 62px; }
  .app-head > .btn { display: none; }
  .app-nav { position: fixed; left: 0; right: 0; bottom: 0; background: var(--deep2); z-index: 50; display: grid; grid-template-columns: repeat(6, 1fr); gap: 0; border-top: 1px solid #ffffff36; }
  .app-nav a, .app-nav button { text-align: center; padding: .8rem .15rem; font-size: .68rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-bottom: 0; border-top: 3px solid transparent; }
  .app-nav a.active, .app-nav button.active { border-top-color: #f0c887; }
  .casebar-inner { grid-template-columns: 1fr; gap: .6rem; }
  /* Fall-Leiste mobil kompakt: Name + Zähler in einer Zeile, Pills nur auf Wunsch */
  .casebar { padding: .7rem 1rem; }
  .casebar-inner > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
  .casebar .case-title { display: none; }
  .casebar .case-name { flex: 1; min-width: 0; }
  .casebar-toggle { display: inline-flex; align-items: center; gap: .3rem; flex-shrink: 0; border: 1px solid #ffffff99; background: transparent; color: #fff; border-radius: var(--radius); padding: .35rem .6rem; font-size: .78rem; font-weight: 700; }
  .casebar-toggle::after { content: '▾'; }
  .casebar.pills-open .casebar-toggle::after { content: '▴'; }
  .casebar .selected-pills { display: none; }
  .casebar.pills-open .selected-pills { display: flex; }
  .remedy-grid { grid-template-columns: repeat(2, 1fr); }
  .archive { grid-template-columns: 1fr; gap: 2rem; }
  .archive dl { grid-template-columns: repeat(2, 1fr); }
  .sources { grid-column: auto; }
  .portrait-layout { grid-template-columns: 1fr; }
  .remedy-index { columns: 2; }
  .fall-widget { bottom: 72px; }
  .modal-overlay { padding: 1rem .6rem 90px; }
}
@media (max-width: 620px) {
  .site-head { height: 70px; }
  .nav-cta { padding: .5rem; font-size: .76rem; }
  .hero { min-height: 640px; padding-top: 3.2rem; }
  .botanical { display: block; width: 78vw; right: -29vw; bottom: 3rem; opacity: .18; }
  .search-row { display: block; }
  .search-row .btn { width: 100%; margin-top: .6rem; }
  .search-meta { display: block; }
  .search-meta a { display: block; margin-top: .45rem; }
  .steps ol, .paths, .article-grid, .pro, .site-foot { grid-template-columns: 1fr; }
  .paths { padding: 0; }
  .path { min-height: auto; }
  .remedy-grid { grid-template-columns: 1fr; }
  .archive dl { grid-template-columns: 1fr 1fr; }
  .pro form { grid-column: auto; }
  .pro form > div { display: block; }
  .pro input, .pro .btn { width: 100%; }
  .page-head { display: block; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .result-card { grid-template-columns: 1fr; }
  .case-actions .btn, .selected-actions .btn { flex: 1; }
  .bubble { max-width: 92%; }
  .mod-grid { grid-template-columns: 1fr; }
  .portrait-hero { grid-template-columns: 1fr; }
  .portrait-art { border-left: 0; border-top: 1px solid var(--line); min-height: 300px; }
  .kt th:first-child, .kt td:first-child, .data-table th:first-child, .data-table td:first-child { min-width: 170px; max-width: 190px; }
  .app-layout { padding: 1rem; }
  .app-head .brand span { font-size: .85rem; }
  .search-wrap { padding: .7rem; }
  .remedy-index { columns: 1; }
  .rep-result-header { flex-direction: column; }
  .sel-pill { max-width: 100%; }
}
@media (prefers-reduced-motion: no-preference) {
  .loading-spinner, .spinner { animation: spin .9s linear infinite; }
  .botanical { animation: sway 8s ease-in-out infinite alternate; transform-origin: bottom center; }
  @keyframes spin { to { transform: rotate(360deg); } }
  @keyframes sway { to { transform: rotate(.7deg); } }
}
@media print {
  .app-head, .app-nav, .casebar, .fall-widget, .rep-controls, .site-foot, .btn { display: none !important; }
  body { background: #fff; }
  .kt-wrap { overflow: visible; border: 0; box-shadow: none; }
}
