/* ===== Finanz-Engine Basis (gemeinsam für übernommene Rechner-Seiten) ===== */
:root {
  --bg: #0F161D;
  --raise: #1A252F;
  --raise-2: #223040;
  --line: #22303C;
  --line-2: #2E3E4C;
  --text: #DDE4EA;
  --muted: #8496A6;
  --accent: #C9A35A;
  --accent-soft: rgb(201 163 90 / .14);
  --gain: #58B98C;
  --loss: #E06A5F;
  --warn: #E8913A;
  --info: #6E9BD8;
  --violet: #B08AD6;
  --display: "Syne", "Schibsted Grotesk", system-ui, sans-serif;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px; line-height: 1.5;
  color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.gain { color: var(--gain); }
.loss { color: var(--loss); }
.warn { color: var(--warn); }
.muted { color: var(--muted); }
.small { font-size: .8125rem; }
a { color: var(--accent); }

.page { max-width: 1180px; margin: 0 auto; padding: 26px clamp(16px, 3vw, 40px) 96px; container: page / inline-size; }
.hub-link { display: inline-block; margin-bottom: 6px; font-size: .8125rem; color: var(--muted); text-decoration: none; }
.hub-link:hover { color: var(--accent); }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 22px; }
.page-head h1 { margin: 0; font-family: var(--display); font-size: clamp(1.45rem, 1.1rem + 1.1vw, 1.9rem); line-height: 1.15; font-weight: 700; letter-spacing: -.015em; }
.page-head .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; }
.lede { margin: -10px 0 24px; max-width: 72ch; color: var(--muted); }
h2 { margin: 0; font-family: var(--display); font-size: 1.0625rem; font-weight: 700; letter-spacing: -.005em; }
h3 { margin: 0 0 8px; font-size: .875rem; font-weight: 600; color: var(--muted); }
.section { margin-top: 32px; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 16px; margin-bottom: 12px; }
.grid-2 { display: grid; gap: 32px; }
@container page (min-width: 860px) { .grid-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 44px; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 6px;
  background: var(--raise); color: var(--text);
  font: inherit; font-size: .875rem; font-weight: 600; line-height: 1.4; white-space: nowrap; cursor: pointer; text-decoration: none;
}
.btn:hover { border-color: var(--accent); }
.btn:disabled { opacity: .5; cursor: default; border-color: var(--line-2); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #17120A; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-quiet { padding: 3px 8px; border-color: transparent; background: transparent; color: var(--muted); font-weight: 500; }
.btn-quiet:hover { border-color: transparent; color: var(--accent); }
.btn-quiet.danger:hover { color: var(--loss); }

input, select, textarea {
  min-width: 0; min-height: 34px; padding: 6px 9px;
  border: 1px solid var(--line-2); border-radius: 6px;
  background: var(--raise); color: var(--text); font: inherit; font-size: .9rem;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input[type="number"] { font-variant-numeric: tabular-nums; }
input[type="range"] { min-height: 0; padding: 0; accent-color: var(--accent); }
.field { display: grid; gap: 4px; align-content: start; font-size: .8125rem; color: var(--muted); }
.field > input, .field > select, .field > textarea { color: var(--text); width: 100%; }
.field .hint { font-size: .75rem; color: var(--muted); }
.fields { display: grid; gap: 12px 14px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.entry { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 12px; }
.entry .field { flex: 1 1 130px; }
.entry .btn { min-height: 34px; }

/* Herkunft eines vorbelegten Werts (Aktienauswahl / Yahoo) */
.from-stock { border-color: rgb(201 163 90 / .55) !important; }

.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; border-top: 1px solid var(--line); }
.stat { min-width: 0; padding: 11px 16px 11px 0; border-bottom: 1px solid var(--line); }
.stat dt { font-size: .8125rem; color: var(--muted); }
.stat dd { margin: 1px 0 0; font-size: 1.1875rem; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
@container page (min-width: 640px) { .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } .stats.four { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.note {
  margin: 18px 0 0; padding: 12px 14px;
  border: 1px solid var(--line-2); border-left: 3px solid var(--accent); border-radius: 6px;
  font-size: .9rem; white-space: pre-line;
}
.note.is-warn { border-left-color: var(--warn); color: var(--warn); }
.note.is-loss { border-left-color: var(--loss); }

.stock-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px;
  margin: 0 0 22px; padding: 10px 14px;
  border: 1px solid var(--line-2); border-left: 3px solid var(--accent); border-radius: 6px; font-size: .875rem;
}
.stock-bar b { letter-spacing: .02em; }
.stock-bar .btn { margin-left: auto; }

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
.data th { padding: 0 14px 8px 0; border-bottom: 1px solid var(--line); text-align: left; font-size: .78rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.data td { padding: 8px 14px 8px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data th:last-child, .data td:last-child { padding-right: 0; }
.data .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data tfoot td { border-bottom: 0; padding-top: 10px; font-weight: 600; }
.empty { margin: 0; padding: 16px 0; color: var(--muted); }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tab {
  margin-bottom: -1px; padding: 9px 12px;
  border: 0; border-bottom: 2px solid transparent;
  background: none; color: var(--muted);
  font: inherit; font-weight: 600; white-space: nowrap; cursor: pointer;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }

.toast {
  position: fixed; left: 50%; bottom: 18px; z-index: 60; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px;
  max-width: calc(100vw - 32px); padding: 8px 14px;
  border: 1px solid var(--line-2); border-radius: 8px; background: var(--raise-2);
  box-shadow: 0 12px 32px rgb(0 0 0 / .45); font-size: .875rem;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation: none !important; }
}

