/* Farben aus trading-hub/app/globals.css (.dark) übernommen */
:root {
  --bg: oklch(0.145 0.003 260);
  --fg: oklch(0.955 0.002 260);
  --card: oklch(0.185 0.004 260);
  --pop: oklch(0.215 0.005 260);
  --sec: oklch(0.235 0.004 260);
  --muted: oklch(0.68 0.008 260);
  --border: oklch(1 0 0 / 7%);
  --input: oklch(1 0 0 / 12%);
  --brand: oklch(0.74 0.12 180);
  --brand-soft: oklch(0.74 0.12 180 / 12%);
  --brand-fg: oklch(0.16 0.003 260);
  --gut: oklch(0.75 0.17 150);
  --schlecht: #f53c41;
  --warn: oklch(0.78 0.11 75);
  --r: 0.625rem;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); }
body {
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; font-weight: 600; }
h1 { font-size: 1.4rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }
.leise { color: var(--muted); font-size: .9em; }
.zahl { font-variant-numeric: tabular-nums; }

/* Rahmen */
.rahmen { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
nav.seite {
  background: oklch(0.16 0.003 260); border-right: 1px solid var(--border);
  padding: 1rem .75rem; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
nav.seite .marke { display: flex; align-items: center; gap: .5rem; font-weight: 650; padding: 0 .5rem 1rem; }
nav.seite .marke img { width: 26px; height: 26px; }
nav.seite a {
  display: flex; justify-content: space-between; align-items: center; gap: .5rem;
  padding: .5rem .65rem; border-radius: var(--r); color: var(--fg); text-decoration: none; margin-bottom: 2px;
}
nav.seite a:hover { background: var(--sec); }
nav.seite a.aktiv { background: var(--brand-soft); color: var(--brand); }
nav.seite .abschnitt { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; padding: 1rem .65rem .35rem; }
.marke-zahl { background: var(--brand); color: var(--brand-fg); border-radius: 999px; font-size: .75rem; padding: 0 .45rem; font-weight: 600; }
main { padding: 1.5rem 2rem 4rem; max-width: 960px; width: 100%; }
.sync { position: fixed; right: 1rem; bottom: 1rem; font-size: .8rem; color: var(--muted); background: var(--pop); border: 1px solid var(--border); padding: .25rem .6rem; border-radius: 999px; }
.sync.fehler { color: var(--warn); }

/* Bausteine */
.karte { background: var(--card); border: 1px solid var(--border); border-radius: calc(var(--r) * 1.4); padding: 1.1rem 1.25rem; margin-bottom: 1rem; }
.raster { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.kachel { background: var(--card); border: 1px solid var(--border); border-radius: calc(var(--r) * 1.4); padding: 1rem 1.1rem; }
.kachel .wert { font-size: 1.8rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.kachel .titel { color: var(--muted); font-size: .85rem; }
.zeile { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.zeile.ende { justify-content: flex-end; }
.zeile.zwischen { justify-content: space-between; }
.stapel > * + * { margin-top: .75rem; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1rem 0; }

button, .knopf {
  font: inherit; border: 1px solid var(--input); background: var(--sec); color: var(--fg);
  padding: .5rem .9rem; border-radius: var(--r); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: .35rem;
  min-height: 40px;
}
button:hover { background: var(--pop); }
button.haupt { background: var(--brand); color: var(--brand-fg); border-color: transparent; font-weight: 600; }
button.haupt:hover { filter: brightness(1.08); }
button.gefahr { color: var(--schlecht); }
button.klein { padding: .2rem .55rem; min-height: 30px; font-size: .85rem; }
button:disabled { opacity: .5; cursor: default; }
.raster > button { flex-direction: column; justify-content: center; gap: 0; }
.raster > button br { display: none; }
button.bew0 { border-color: color-mix(in oklch, var(--schlecht) 60%, transparent); }
button.bew1 { border-color: color-mix(in oklch, var(--brand) 70%, transparent); }
button.bew2 { border-color: color-mix(in oklch, var(--gut) 60%, transparent); }
button.gewaehlt { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }

input[type=text], input[type=password], input[type=number], input[type=search], textarea, select {
  font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--input);
  border-radius: var(--r); padding: .55rem .7rem; width: 100%;
}
textarea { min-height: 120px; resize: vertical; }
input:focus, textarea:focus, select:focus, button:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .25rem; }
.feld { margin-bottom: .85rem; }

.hinweis { border-left: 3px solid var(--brand); background: var(--brand-soft); padding: .6rem .8rem; border-radius: 0 var(--r) var(--r) 0; margin-bottom: 1rem; font-size: .92rem; }
.hinweis.warn { border-color: var(--warn); background: oklch(0.78 0.11 75 / 12%); }
.marker { display: inline-block; font-size: .75rem; padding: .05rem .5rem; border-radius: 999px; background: var(--sec); color: var(--muted); }
.marker.brand { background: var(--brand-soft); color: var(--brand); }

/* Lernkarte */
.lernkarte { text-align: center; padding: 2rem 1.25rem; }
.lernkarte .vorne { font-size: 1.7rem; font-weight: 650; margin: .5rem 0 1rem; overflow-wrap: anywhere; }
.lernkarte img { max-width: 100%; max-height: 320px; border-radius: var(--r); margin-bottom: 1rem; }
.loesung { text-align: left; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r); padding: .9rem 1rem; margin-top: 1rem; white-space: pre-wrap; }
.loesung h3 { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.fortschritt { height: 4px; background: var(--sec); border-radius: 999px; overflow: hidden; margin-bottom: 1rem; }
.fortschritt > div { height: 100%; background: var(--brand); transition: width .3s; }

/* Listen */
.liste { list-style: none; padding: 0; margin: 0; }
.liste li { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .65rem 0; border-bottom: 1px solid var(--border); }
.liste li:last-child { border-bottom: 0; }
.liste .text { min-width: 0; overflow-wrap: anywhere; }

/* ABC */
.abc { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; }
.abc .buchst { display: grid; grid-template-columns: 1.6rem 1fr; align-items: center; gap: .35rem; }
.abc .buchst b { color: var(--brand); text-align: center; }
.abc input { padding: .4rem .55rem; }
.uhr { font-size: 2rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.uhr.knapp { color: var(--warn); }
.vergleich { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.abc-zeigen td { padding: .2rem .5rem; vertical-align: top; border-bottom: 1px solid var(--border); }
.abc-zeigen td:first-child { color: var(--brand); font-weight: 600; width: 2rem; }

table.tab { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.tab th, table.tab td { text-align: left; padding: .45rem .5rem; border-bottom: 1px solid var(--border); }
table.tab th { color: var(--muted); font-weight: 500; }
.balken { height: 8px; background: var(--sec); border-radius: 999px; overflow: hidden; min-width: 80px; }
.balken > div { height: 100%; background: var(--brand); }

/* Handy */
.menue-knopf { display: none; }
@media (max-width: 760px) {
  .rahmen { grid-template-columns: 1fr; }
  nav.seite { position: fixed; inset: 0 30% 0 0; z-index: 20; transform: translateX(-100%); transition: transform .2s; height: 100%; }
  nav.seite.offen { transform: none; box-shadow: 0 0 0 100vmax oklch(0 0 0 / 50%); }
  .menue-knopf { display: inline-flex; position: sticky; top: 0; z-index: 10; margin: .5rem; }
  main { padding: .5rem 1rem 4rem; }
  .lernkarte .vorne { font-size: 1.4rem; }
}

/* Anmeldung */
.anmeldung { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.anmeldung .karte { width: 100%; max-width: 360px; }
