/* Seasonal Edge – gleiche Farben wie die Auswertungsseite (build/template6.html) */
:root {
  color-scheme: light;
  --bg: #f3ede4; --surface-1: #fbf8f3; --surface-2: #f6f0e7; --border: #e6dccd;
  --text-primary: #1f2933; --text-secondary: #4b5563; --text-muted: #6b7280;
  --accent: #2f6fbf; --loss-text: #b3362f; --gain-text: #12764f; --warn: #a3650a;
  --chip: #ede4d6; --shadow: 0 1px 2px rgba(60,40,20,.05), 0 4px 16px rgba(60,40,20,.05);
  --s-kf: #2a78d6; --s-xm: #eb6834; --s-tt: #6b5bd2; --s-bb: #1baf7a; --s-sl: #eda100; --s-eom: #e87ba4; --s-dc: #008300; --s-pt: #8a8f98;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121211; --surface-1: #1a1a19; --surface-2: #20201f; --border: #2c2c2a;
    --text-primary: #f0efec; --text-secondary: #c3c2b7; --text-muted: #8f8e86;
    --accent: #3987e5; --loss-text: #f08a89; --gain-text: #4cc596; --warn: #e0a83a; --chip: #262624;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121211; --surface-1: #1a1a19; --surface-2: #20201f; --border: #2c2c2a;
  --text-primary: #f0efec; --text-secondary: #c3c2b7; --text-muted: #8f8e86;
  --accent: #3987e5; --loss-text: #f08a89; --gain-text: #4cc596; --warn: #e0a83a; --chip: #262624;
  --shadow: none;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text-primary); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px 48px; }

/* Navigation */
.nav { position: sticky; top: 0; z-index: 10; background: var(--surface-1); border-bottom: 1px solid var(--border); }
.nav .wrap { display: flex; align-items: center; gap: 4px 18px; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
.nav .brand { font-weight: 700; color: var(--text-primary); margin-right: 8px; }
.nav a.item { color: var(--text-secondary); padding: 2px 0; border-bottom: 2px solid transparent; }
.nav a.item.on { color: var(--text-primary); border-bottom-color: var(--accent); }
.nav .sp { flex: 1; }
.nav button.theme { background: none; border: 1px solid var(--border); border-radius: 8px; color: var(--text-secondary); padding: 2px 8px; cursor: pointer; }

h1 { font-size: 24px; margin: 24px 0 4px; }
h2 { font-size: 17px; margin: 0 0 10px; }
.sub { color: var(--text-muted); margin: 0 0 18px; }
.muted { color: var(--text-muted); }
.small { font-size: 13px; }

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); margin-bottom: 16px; }
.card { background: var(--surface-1); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; box-shadow: var(--shadow); margin-bottom: 16px; }
.grid .card { margin-bottom: 0; }

.ev { border-left: 4px solid var(--c, var(--accent)); padding: 6px 0 6px 12px; margin: 10px 0; }
.ev .t { font-weight: 600; }
.ev .l { color: var(--text-secondary); font-size: 14px; }
.ev.kauf .t::before { content: "▲ "; color: var(--gain-text); }
.ev.verkauf .t::before { content: "▼ "; color: var(--loss-text); }

.pill { display: inline-block; padding: 1px 8px; border-radius: 99px; background: var(--chip); font-size: 12px; color: var(--text-secondary); white-space: nowrap; }
.pill.ok { background: color-mix(in srgb, var(--gain-text) 15%, transparent); color: var(--gain-text); }
.pill.warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.pill.bad { background: color-mix(in srgb, var(--loss-text) 15%, transparent); color: var(--loss-text); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c); margin-right: 6px; }

.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-weight: 600; color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; border-bottom: 1px solid var(--border); padding: 6px 8px; }
.tbl td { border-bottom: 1px solid var(--border); padding: 7px 8px; vertical-align: top; }
.tbl tr:last-child td { border-bottom: none; }
.tbl .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tfoot td { font-weight: 600; border-top: 1px solid var(--border); }
.scroll { overflow-x: auto; }
.pos { color: var(--gain-text); }
.neg { color: var(--loss-text); }

.flash { background: var(--surface-2); border: 1px solid var(--border); border-left: 4px solid var(--accent); padding: 10px 14px; border-radius: 10px; margin: 16px 0; }
.warnbox { border-left-color: var(--warn); }

form.f { display: grid; gap: 12px 16px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
form.f .full { grid-column: 1 / -1; }
label { display: block; font-size: 13px; color: var(--text-secondary); }
input, select, textarea { width: 100%; margin-top: 4px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); color: var(--text-primary); font: inherit; }
input[type=checkbox] { width: auto; margin: 0 6px 0 0; }
textarea { min-height: 70px; }
.btn { display: inline-block; padding: 8px 14px; border-radius: 9px; border: 1px solid var(--accent); background: var(--accent); color: #fff; font: inherit; cursor: pointer; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.danger { background: transparent; color: var(--loss-text); border-color: var(--loss-text); }
.btn.sm { padding: 3px 10px; font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
pre.mail { white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; font: 13px/1.5 ui-monospace, Consolas, monospace; }
.kpi { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.login { max-width: 360px; margin: 12vh auto; }
@media (max-width: 600px) { h1 { font-size: 21px; } .card { padding: 14px; } .hide-s { display: none; } }

/* ---------- Tablet (iPad mini hoch 744 px) und Handy (iPhone 12 mini 375 px) ---------- */
.wrap { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
.only-s { display: none; }
@media (max-width: 820px) {
  .nav .wrap { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; gap: 16px; }
  .nav .wrap::-webkit-scrollbar { display: none; }
  .nav a.item, .nav .brand { white-space: nowrap; flex: none; }
  .nav .sp { display: none; }
  .hide-m { display: none; }
}
@media (max-width: 600px) {
  body { font-size: 15px; }
  .nav .brand { display: none; }
  .nav a.item { padding: 6px 0; }
  .hide-s { display: none; }
  .only-s { display: initial; }
  .grid { grid-template-columns: 1fr; gap: 12px; }
  .card { border-radius: 12px; }
  .tbl { font-size: 13.5px; }
  .tbl th, .tbl td { padding: 6px 5px; }
  input, select, textarea { font-size: 16px; }   /* iOS zoomt sonst beim Antippen */
  .btn { padding: 10px 14px; }
  .btn.sm { padding: 6px 10px; }
  .kpi { font-size: 20px; }
  h1 { margin-top: 16px; }
  .sub { font-size: 14px; }
}

/* Einstellungen: Einsatz-Tabelle – Eingabe und Einheit sauber in einer Linie */
.tbl.stakes td { vertical-align: middle; }
.tbl.stakes td.stake { white-space: nowrap; }
.tbl.stakes td.stake input { width: 96px; margin: 0; text-align: right; }
.tbl.stakes td.stake .unit { display: inline-block; width: 68px; margin-left: 8px; font-size: 13px; color: var(--text-muted); }
@media (max-width: 600px) { .tbl.stakes td.stake input { width: 76px; } .tbl.stakes td.stake .unit { width: auto; } }
