/* Kurvendiskussion online – oeffentliche Seite (responsiv, ohne Framework) */

:root {
  --blau: #0b5f8a;
  --blau-dunkel: #08496a;
  --blau-hell: #e8f2f8;
  --rot: #be0000;
  --text: #1d2730;
  --text-leise: #5b6b78;
  --linie: #dbe4eb;
  --grund: #f4f7fa;
  --karte: #fff;
  --radius: 14px;
  --schatten: 0 1px 2px rgba(16, 40, 60, .06), 0 4px 16px rgba(16, 40, 60, .06);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--grund);
}

a { color: var(--blau); }
a:hover { color: var(--blau-dunkel); }

code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }

.rahmen { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* Kopf */
.kopf { background: var(--karte); border-bottom: 1px solid var(--linie); position: sticky; top: 0; z-index: 10; }
.kopf-innen { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; }
.marke { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-size: 1.1rem; letter-spacing: -.01em; }
.marke b { color: var(--blau); font-weight: 700; }
.marke-bild { width: 34px; height: 34px; flex: none; border-radius: 8px; }
.navi { display: flex; gap: 4px; }
.navi a { padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--text-leise); font-size: .95rem; }
.navi a:hover { background: var(--blau-hell); color: var(--blau); }

/* Inhalt */
.inhalt { flex: 1; padding-top: 28px; padding-bottom: 48px; }

h1, h2 { line-height: 1.2; letter-spacing: -.015em; }
h1 { font-size: clamp(1.9rem, 4.5vw, 2.7rem); margin: 0 0 10px; }
h2 { font-size: 1.25rem; margin: 0 0 14px; }
h2.klein { font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-leise); margin: 28px 0 10px; }

.lead { font-size: 1.12rem; color: var(--text-leise); max-width: 46rem; margin: 0 0 24px; }
.hinweis { color: var(--text-leise); font-size: .875rem; margin: 16px 0 0; }

.karte { background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius); box-shadow: var(--schatten); padding: 24px; }
.karte + .karte, .karte-eingabe { margin-bottom: 20px; }

/* Startseite */
.start { max-width: 760px; }
.raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-top: 40px; }
.kachel { background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius); padding: 22px 24px; }
.liste-haken { list-style: none; margin: 0; padding: 0; }
.liste-haken li { position: relative; padding: 5px 0 5px 28px; }
.liste-haken li::before { content: ""; position: absolute; left: 4px; top: 11px; width: 12px; height: 7px; border: solid var(--blau); border-width: 0 0 2.5px 2.5px; transform: rotate(-45deg); }
.syntax { border-collapse: collapse; width: 100%; }
.syntax td { padding: 7px 0; border-bottom: 1px solid var(--linie); vertical-align: top; }
.syntax tr:last-child td { border-bottom: 0; }
.syntax td:first-child { padding-right: 16px; white-space: nowrap; }
.syntax td:last-child { color: var(--text-leise); }

.beispiele { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.beispiele a { display: flex; flex-direction: column; padding: 8px 14px; background: var(--karte); border: 1px solid var(--linie); border-radius: 10px; text-decoration: none; color: var(--text); transition: border-color .15s, box-shadow .15s; }
.beispiele a:hover { border-color: var(--blau); box-shadow: 0 0 0 3px var(--blau-hell); }
.beispiele small { color: var(--text-leise); font-size: .78rem; }

/* Eingabe */
.eingabe { display: flex; flex-direction: column; gap: 14px; }
.feld { display: flex; align-items: center; border: 2px solid var(--linie); border-radius: 12px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.feld:focus-within { border-color: var(--blau); box-shadow: 0 0 0 4px var(--blau-hell); }
.fx { padding: 0 4px 0 16px; font: italic 1.25rem/1 Georgia, "Times New Roman", serif; color: var(--text-leise); white-space: nowrap; }
.feld input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; padding: 14px 16px 14px 6px; font: 1.25rem/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--text); }
.eingabe-zeile { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }

.umschalter { display: inline-flex; padding: 4px; background: var(--grund); border: 1px solid var(--linie); border-radius: 11px; }
.umschalter label { position: relative; cursor: pointer; }
.umschalter input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.umschalter span { display: block; padding: 8px 14px; border-radius: 8px; color: var(--text-leise); font-size: .95rem; user-select: none; }
.umschalter input:checked + span { background: #fff; color: var(--blau); font-weight: 600; box-shadow: 0 1px 3px rgba(16, 40, 60, .15); }
.umschalter input:focus-visible + span { outline: 2px solid var(--blau); outline-offset: 1px; }

.knopf { appearance: none; border: 0; border-radius: 11px; padding: 12px 28px; background: var(--blau); color: #fff; font-family: inherit; font-size: 1.05rem; font-weight: 600; line-height: 1.2; cursor: pointer; transition: background .15s; }
.knopf:hover { background: var(--blau-dunkel); }
.knopf:focus-visible { outline: 3px solid var(--blau-hell); outline-offset: 2px; }
.knopf.laedt { opacity: .75; cursor: progress; }

/* Ergebnis */
.ergebnis { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.ergebnis.nur-graph { grid-template-columns: minmax(0, 760px); }
.ergebnis > .karte { margin: 0; }
.ergebnis > .karte:last-child { position: sticky; top: 80px; }

.loesungsweg dl { display: grid; grid-template-columns: minmax(8rem, 13rem) minmax(0, 1fr); margin: 0; }
.loesungsweg dt, .loesungsweg dd { padding: 11px 0; border-bottom: 1px solid var(--linie); margin: 0; }
.loesungsweg dt { color: var(--blau); font-weight: 600; padding-right: 16px; }
.loesungsweg dd { overflow-x: auto; }
.loesungsweg .ganz { grid-column: 1 / -1; }
.loesungsweg dt.ganz { padding-top: 18px; }
.loesungsweg math { font-size: 1.12em; }
#notices { background: #fff8e1; border: 1px solid #f3dd9a; border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-size: .95rem; }

.graph { margin: 0; position: relative; }
.graph img { display: block; width: 100%; height: auto; border: 1px solid var(--linie); border-radius: 10px; transition: opacity .2s; }
.graph.laedt img { opacity: .5; }
.legende { display: flex; gap: 16px; margin-top: 8px; font-size: .9rem; }
.legende span::before { content: ""; display: inline-block; width: 18px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.l-f::before { background: #006699; }
.l-abl::before { background: var(--rot); }
.legende [hidden] { display: none; }
.graph-aktionen { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; justify-content: space-between; margin-top: 12px; }
.schalter { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.schalter input { width: 18px; height: 18px; accent-color: var(--blau); }

.fehler { border-color: #f1c4c4; }
.fehler-text { background: #fdf0f0; border-left: 4px solid var(--rot); border-radius: 6px; padding: 12px 14px; font-weight: 600; }

/* Fuss */
.fuss { border-top: 1px solid var(--linie); background: var(--karte); font-size: .875rem; color: var(--text-leise); }
.fuss-innen { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-top: 18px; padding-bottom: 18px; }
.fuss a { color: var(--text-leise); }
.fuss-innen span:last-child a + a { margin-left: 16px; }

/* Tablet / Handy */
@media (max-width: 900px) {
  .ergebnis { grid-template-columns: minmax(0, 1fr); }
  .ergebnis > .karte:last-child { position: static; }
}

@media (max-width: 560px) {
  .rahmen { padding: 0 14px; }
  .inhalt { padding-top: 18px; }
  .karte { padding: 16px; border-radius: 12px; }
  .navi a[href="/"] { display: none; }
  .marke { font-size: 1rem; }
  .eingabe-zeile { flex-direction: column; align-items: stretch; }
  .umschalter { display: flex; }
  .umschalter label { flex: 1; text-align: center; }
  .knopf { width: 100%; padding: 14px; }
  .fx { font-size: 1.1rem; padding-left: 12px; }
  .feld input { font-size: 1.1rem; padding: 13px 12px 13px 4px; }
  .loesungsweg dl { grid-template-columns: minmax(0, 1fr); }
  .loesungsweg dt { border-bottom: 0; padding-bottom: 2px; }
  .loesungsweg dd { padding-top: 2px; }
  .raster { grid-template-columns: minmax(0, 1fr); margin-top: 28px; }
}

@media print {
  .kopf, .fuss, .karte-eingabe, .graph-aktionen { display: none; }
  body { background: #fff; }
  .karte { box-shadow: none; border: 0; padding: 0; }
  .ergebnis { grid-template-columns: 1fr; }
}
