/* Oracle — hell, ruhig, ohne Effekte. Eine Akzentfarbe für Aktionen,
   Grün/Rot nur für Gewinn/Verlust. Hierarchie über Größe und Weißraum. */

@font-face {
  font-family: "Source Serif 4";
  src: url("/static/fonts/source-serif-4-600.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("/static/fonts/source-serif-4-700.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}

:root {
  --grund: #f7f5f0;
  --flaeche: #ffffff;
  --leiste: #efece5;
  --linie: #e2ded5;
  --linie-stark: #c9c4b8;
  --rahmen-feld: #8f897d;    /* Eingabefelder: mind. 3:1 gegen Weiß */
  --text: #1d1c1a;
  --text-2: #57534c;
  --text-3: #68635a;
  --akzent: #9a3412;          /* gebranntes Orange — nur für Aktionen und aktive Navigation */
  --akzent-hell: #f6e7df;
  --plus: #15803d;
  --minus: #b91c1c;
  --warn-grund: #fbf3dc;
  --warn-linie: #e6d29a;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--grund); color: var(--text); font-family: var(--sans);
  font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--akzent); }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 600; letter-spacing: -0.005em; }
h1 { font-size: 1.9rem; line-height: 1.2; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 10px; }
[hidden] { display: none !important; }
.zahl, td.num, .wert { font-variant-numeric: tabular-nums; }

/* ── Rahmen ─────────────────────────────────────────────────────────────── */
#app { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
#app.ohne-leiste { grid-template-columns: minmax(0, 1fr); }
#leiste { background: var(--leiste); border-right: 1px solid var(--linie); position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; padding: 22px 14px; }
.leiste-kopf { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 22px; }
.marke { font-family: var(--serif); font-weight: 700; font-size: 1.45rem; color: var(--text); text-decoration: none; }
.menu-knopf { display: none; }
#hauptnav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
#hauptnav > a { color: var(--text-2); text-decoration: none; padding: 9px 12px; border-radius: 6px; font-size: 0.98rem; }
#hauptnav > a:hover { background: #e6e2d9; color: var(--text); }
#hauptnav > a.aktiv { background: var(--flaeche); color: var(--text); font-weight: 600; box-shadow: inset 0 0 0 1px var(--linie); }
.leiste-fuss { margin-top: auto; padding: 14px 12px 0; border-top: 1px solid var(--linie); display: flex;
  justify-content: space-between; align-items: center; font-size: 0.9rem; color: var(--text-3); }

main { padding: 36px 44px 64px; max-width: 1080px; width: 100%; min-width: 0; }
.kopf { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.kopf p { margin: 6px 0 0; color: var(--text-2); }
.zurueck { display: inline-block; margin-bottom: 8px; font-size: 0.92rem; text-decoration: none; }
.leise { color: var(--text-3); font-size: 0.9rem; }
.abschnitt { margin-top: 34px; }
.abschnitt > h2 { margin-bottom: 12px; }
.abschnitt-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }

.block { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 8px; padding: 20px 22px; min-width: 0; overflow-x: auto; }
.zwei { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 20px; align-items: start; }

/* ── Hinweise ───────────────────────────────────────────────────────────── */
.aufgabe { background: var(--warn-grund); border: 1px solid var(--warn-linie); border-radius: 8px; padding: 12px 16px;
  margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.notiz-text { color: var(--text-2); font-size: 0.93rem; }
.meldung { border: 1px solid var(--linie-stark); border-radius: 8px; padding: 10px 14px; font-size: 0.94rem; background: var(--flaeche); }
.meldung.fehler { border-color: #e7b4b4; background: #fbefef; }
.meldung.ok { border-color: #b7d9c2; background: #eef7f1; }

/* ── Empfehlung ─────────────────────────────────────────────────────────── */
.empfehlung-kopf { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.ticker-gross { font-family: var(--serif); font-size: 2.4rem; font-weight: 700; line-height: 1; }
.satz { font-size: 1.08rem; margin: 14px 0 6px; }
.werte { display: flex; gap: 36px; flex-wrap: wrap; margin-top: 14px; }
.werte .w-titel { color: var(--text-3); font-size: 0.85rem; }
.werte .wert { font-size: 1.35rem; font-weight: 600; }
.einschaetzung { font-weight: 600; white-space: nowrap; }
.einschaetzung::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px;
  vertical-align: 1px; background: currentColor; }
.e-gut { color: var(--plus); }
.e-knapp { color: #a16207; }
.e-nein { color: var(--text-3); }
.plus { color: var(--plus); }
.minus { color: var(--minus); }

/* ── Tabellen ───────────────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; font-size: 0.96rem; }
th { text-align: left; color: var(--text-3); font-weight: 500; font-size: 0.85rem; padding: 8px 10px; border-bottom: 1px solid var(--linie-stark); white-space: nowrap; }
td { padding: 11px 10px; border-bottom: 1px solid var(--linie); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; }
tr.klick { cursor: pointer; }
tr.klick:hover td { background: #faf8f3; }
tr.klick:focus-visible { outline: 2px solid var(--akzent); outline-offset: -2px; }
tr.gewaehlt td { background: var(--akzent-hell); }
.leer { color: var(--text-3); padding: 18px 0; }

/* ── Knöpfe & Formulare ─────────────────────────────────────────────────── */
button, .knopf { font: inherit; font-size: 0.95rem; font-weight: 600; border-radius: 6px; padding: 9px 16px; cursor: pointer;
  border: 1px solid var(--akzent); background: var(--akzent); color: #fff; text-decoration: none; display: inline-flex;
  align-items: center; gap: 6px; line-height: 1.3; }
button:hover, .knopf:hover { background: #7c2a0e; border-color: #7c2a0e; }
button:disabled { opacity: .55; cursor: wait; }
button.zweit, .knopf.zweit { background: var(--flaeche); color: var(--text); border-color: var(--linie-stark); }
button.zweit:hover, .knopf.zweit:hover { background: #f1eee7; }
button.gefahr { background: var(--flaeche); color: var(--minus); border-color: #e2b3b3; }
button.gefahr:hover { background: #fbefef; }
.textknopf { background: none; border: 0; padding: 0; color: var(--akzent); font-weight: 500; }
.textknopf:hover { background: none; text-decoration: underline; }
.knopfreihe { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }

label { display: block; font-size: 0.9rem; color: var(--text-2); margin-bottom: 5px; }
input, select, textarea { font: inherit; font-size: 0.98rem; width: 100%; padding: 9px 11px; border: 1px solid var(--rahmen-feld);
  border-radius: 6px; background: var(--flaeche); color: var(--text); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--akzent); outline-offset: 0; border-color: var(--akzent); }
textarea { min-height: 90px; resize: vertical; }
.feld { margin-bottom: 14px; }
.reihe { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.reihe .feld { flex: 1; min-width: 140px; margin-bottom: 0; }
.formular { max-width: 560px; }
details > summary { cursor: pointer; color: var(--text-2); font-size: 0.93rem; margin: 6px 0; }

/* ── Reiter ─────────────────────────────────────────────────────────────── */
.reiter { display: flex; gap: 2px; border-bottom: 1px solid var(--linie-stark); margin-bottom: 24px; overflow-x: auto; }
.reiter button { background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; color: var(--text-2);
  font-weight: 500; padding: 10px 14px; margin-bottom: -1px; white-space: nowrap; }
.reiter button:hover { background: none; color: var(--text); }
.reiter button.aktiv { color: var(--text); border-bottom-color: var(--akzent); font-weight: 600; }
.wahl { display: inline-flex; border: 1px solid var(--linie-stark); border-radius: 6px; overflow: hidden; }
.wahl button { background: var(--flaeche); color: var(--text-2); border: 0; border-radius: 0; padding: 6px 12px; font-weight: 500; font-size: 0.9rem; }
.wahl button + button { border-left: 1px solid var(--linie-stark); }
.wahl button.aktiv { background: var(--text); color: #fff; }

/* ── Kleinkram ──────────────────────────────────────────────────────────── */
.schritte { margin: 8px 0 14px; padding-left: 22px; }
.schritte li { margin: 8px 0; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 0.92rem; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.status.an::before { background: var(--plus); }
.status.aus::before { background: var(--minus); }
.dienste { list-style: none; margin: 0; padding: 0; }
.dienste li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--linie); }
.dienste li:last-child { border-bottom: 0; }
pre.bericht { font-family: var(--mono); font-size: 0.8rem; color: var(--text-2); white-space: pre-wrap; margin: 0; max-height: 360px; overflow: auto; }
.spanne { position: relative; height: 22px; margin: 18px 0 4px; }
.spanne .achse { position: absolute; top: 10px; left: 0; right: 0; height: 2px; background: var(--linie-stark); }
.spanne .band { position: absolute; top: 6px; height: 10px; background: #e8dfd2; border: 1px solid var(--linie-stark); border-radius: 3px; }
.spanne .med { position: absolute; top: 2px; width: 2px; height: 18px; background: var(--text); }
.spanne .null { position: absolute; top: 0; width: 1px; height: 22px; background: var(--text-3); }
.spanne-text { display: flex; justify-content: space-between; color: var(--text-3); font-size: 0.82rem; flex-wrap: wrap; gap: 4px 10px; }
.diagramm { position: relative; height: 260px; }
.diagramm.klein { height: 190px; }
.news { list-style: none; margin: 0; padding: 0; }
.news li { padding: 9px 0; border-bottom: 1px solid var(--linie); font-size: 0.94rem; }
.news li:last-child { border-bottom: 0; }
.news .q { color: var(--text-3); font-size: 0.82rem; }
.notiz { border-bottom: 1px solid var(--linie); padding: 10px 0; }
.notiz .meta { display: flex; justify-content: space-between; color: var(--text-3); font-size: 0.82rem; margin-bottom: 4px; }
.md p { margin: 0 0 6px; } .md ul { margin: 0 0 6px; padding-left: 20px; }
.md code { font-family: var(--mono); font-size: 0.88em; background: #f1eee7; padding: 1px 4px; border-radius: 3px; }

.lade { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--linie-stark); border-top-color: var(--text);
  border-radius: 50%; animation: drehen .8s linear infinite; vertical-align: -2px; }
@keyframes drehen { to { transform: rotate(360deg); } }
/* ── Meine Aktien ───────────────────────────────────────────────────────── */
.suche { position: relative; max-width: 560px; margin-bottom: 20px; }
.suche label { display: block; margin-bottom: 6px; }
.suche input { width: 100%; }
.treffer { position: absolute; z-index: 30; left: 0; right: 0; top: 100%; margin: 4px 0 0; padding: 4px 0; list-style: none;
  background: var(--flaeche); border: 1px solid var(--linie-stark); border-radius: 8px; box-shadow: 0 8px 24px rgba(29, 28, 26, 0.12);
  max-height: 360px; overflow-y: auto; }
.treffer li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; }
.treffer li + li { border-top: 1px solid var(--linie); }
.treffer a { color: var(--text); text-decoration: none; min-width: 0; }
.treffer a:hover strong { color: var(--akzent); }
.treffer .leise { display: block; font-size: 0.85rem; }
.treffer button { padding: 6px 12px; flex-shrink: 0; }
.spark { display: block; }
.marke-tag { display: inline-block; font-size: 0.8rem; padding: 1px 8px; margin: 2px 4px 2px 0; border: 1px solid var(--linie-stark);
  border-radius: 999px; color: var(--text-2); text-decoration: none; white-space: nowrap; }
.marke-tag:hover { border-color: var(--akzent); color: var(--akzent); }
.notiz-kurz { font-size: 0.9rem; color: var(--text-2); margin-bottom: 2px; }
.gross-kurs { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.gross-kurs .wert { font-size: 2rem; font-weight: 600; }
.gross-kurs span:not(.wert) { font-weight: 600; }
.fakten { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px 24px; margin-top: 16px; }
.fakten .w-titel { color: var(--text-3); font-size: 0.85rem; }
.fakten .wert { font-size: 1.15rem; font-weight: 600; }
.klein { font-size: 0.82rem; line-height: 1.35; }
.verteilung { display: flex; height: 14px; border-radius: 7px; overflow: hidden; margin: 12px 0 6px; background: var(--linie); }
.verteilung span { display: block; min-width: 3px; }
.recherche h3 { margin: 18px 0 6px; }
.recherche ul { margin: 0 0 10px; padding-left: 20px; }
.quellen { padding-left: 22px; margin: 6px 0 0; }
.quellen li { margin-bottom: 6px; }
.quellen .leise { margin-left: 6px; font-size: 0.85rem; }
.kacheln { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.kacheln a { display: flex; justify-content: space-between; gap: 8px; padding: 8px 12px; border: 1px solid var(--linie); border-radius: 6px;
  color: var(--text); text-decoration: none; }
.kacheln a:hover { border-color: var(--linie-stark); }
.kacheln span { white-space: nowrap; }
.login-wahl { display: flex; margin: 14px 0 6px; }
.login-wahl button { flex: 1; }
.vollgas { margin-bottom: 20px; }
.balken { height: 10px; border-radius: 5px; background: var(--linie); overflow: hidden; margin-top: 10px; }
.balken span { display: block; height: 100%; background: var(--akzent); }
.faq details { border-bottom: 1px solid var(--linie); padding: 4px 0; }
.faq details:last-child { border-bottom: 0; }
.faq summary { padding: 10px 0; font-weight: 600; cursor: pointer; }
.faq-antwort { padding: 0 0 12px; color: var(--text-2); }
.faq-antwort strong { color: var(--text); }

@media (prefers-reduced-motion: reduce) { .lade { animation-duration: 3s; } }

#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--text); color: #fff;
  padding: 10px 18px; border-radius: 6px; font-size: 0.94rem; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 50; max-width: 90vw; }
#toast.zeigen { opacity: 1; }
#toast.fehler { background: var(--minus); }

dialog { border: 1px solid var(--linie-stark); border-radius: 8px; padding: 24px; width: min(460px, 92vw); background: var(--flaeche); color: var(--text); }
dialog::backdrop { background: rgba(29, 28, 26, .35); }
dialog h2 { margin-bottom: 16px; }
.fehler-text { color: var(--minus); font-size: 0.92rem; min-height: 1.3em; margin: 4px 0 10px; }

.login-huelle { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login { width: 100%; max-width: 360px; }
.login .marke { display: block; font-size: 2rem; margin-bottom: 4px; }
.login p { color: var(--text-3); margin-bottom: 24px; }
.login button { width: 100%; justify-content: center; padding: 11px; }

.fussnote { margin-top: 48px; padding-top: 14px; border-top: 1px solid var(--linie); color: var(--text-3); font-size: 0.82rem; }

/* ── Mobil ──────────────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  #app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .reiter { flex-wrap: wrap; overflow: visible; }
  #leiste { position: sticky; top: 0; height: auto; padding: 12px 16px; z-index: 20; }
  .leiste-kopf { padding: 0; }
  .menu-knopf { display: inline-flex; background: var(--flaeche); color: var(--text); border-color: var(--linie-stark); padding: 6px 12px; }
  .menu-knopf:hover { background: #f1eee7; }
  #hauptnav { display: none; padding-top: 12px; }
  #leiste.offen #hauptnav { display: flex; }
  main { padding: 24px 18px 48px; }
  .zwei { grid-template-columns: minmax(0, 1fr); }
  h1 { font-size: 1.6rem; }
  .werte { gap: 22px; }
  .ticker-gross { font-size: 2rem; }
  .breit { display: none; }
  /* Breite Tabellen auf dem Handy als gestapelte Einträge */
  table.stapel thead { display: none; }
  table.stapel tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--linie); }
  table.stapel tr:last-child { border-bottom: 0; }
  table.stapel td { display: block; border: 0; padding: 2px 0; text-align: left; white-space: normal; }
  table.stapel td[data-l]::before { content: attr(data-l) ": "; color: var(--text-3); }
  th, td { padding-left: 6px; padding-right: 6px; }
}
