/* ATLAS – Farben wie Agent ONE (Off-White, Schwarz, Bronze), Taupe aus dem Logo, Schrift Plus Jakarta Sans. */
:root {
  --bg: #f6f6f3; --card: #ffffff; --ink: #0d0d0d; --muted: #66665f; --line: #e1e1db; --line-soft: #ecebe6;
  --accent: #86683f; --taupe: #b59a85;
  --gain: #2e6b4e; --loss: #a4472f;
  --panel: #0d0d0d; --panel-fg: #f4f4f0; --panel-muted: #a5a59d; --panel-line: #2f2f2b; --panel-accent: #c6a676;
  --danger-bg: #f2b8b5; --danger-fg: #2a0f0d;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r: 6px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.5; font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
h1, h2, p { margin: 0; }
h2 { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
a { color: var(--accent); }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.err { color: var(--loss); font-size: 14px; min-height: 1.2em; }
.msg { font-size: 14px; min-height: 1.2em; color: var(--muted); }
.gain { color: var(--gain); } .loss { color: var(--loss); }

/* Kopfzeile */
.top { position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,.92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top, 0px); }
.top-in { max-width: 1280px; margin: 0 auto; padding: 0 24px; min-height: 66px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; font-size: 20px; font-weight: 600; letter-spacing: .18em; }
.brand img { width: 38px; height: 38px; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs a { padding: 8px 14px; border-radius: 999px; color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 500; }
.tabs a.on { background: var(--ink); color: #fff; }
.conn { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--taupe); }
.dot.off { background: var(--loss); }

.wrap { max-width: 1280px; margin: 0 auto; padding: 28px 24px calc(48px + var(--safe-b)); }
.page { display: flex; flex-direction: column; gap: 24px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 24px 26px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row-end { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; }

/* Hero */
.hero { display: flex; flex-wrap: wrap; gap: 24px; }
.hero-main { flex: 999 1 540px; gap: 18px; }
.hero-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 18px; }
.big { font-size: 60px; font-weight: 500; line-height: 1.05; letter-spacing: -0.02em; }
.stats { display: flex; gap: 28px; font-size: 13px; }
.stats div { display: flex; flex-direction: column; gap: 3px; }
.stats b { font-size: 17px; font-weight: 500; }
#chart { width: 100%; height: 200px; }
.panel { flex: 1 1 290px; background: var(--panel); color: var(--panel-fg); border: 0; gap: 22px; padding: 26px; }
.panel-muted { color: var(--panel-muted); }
.panel-title { font-size: 28px; font-weight: 600; letter-spacing: -0.01em; }
.meter { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.meter-row { display: flex; justify-content: space-between; }
.bar { height: 3px; background: #2d2d2a; }
.bar i { display: block; height: 3px; width: 0; background: var(--panel-accent); transition: width .4s; }
.panel-actions { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }

.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 24px; align-items: start; }
.narrow { max-width: 680px; display: flex; flex-direction: column; gap: 24px; }

.quote { font-size: 17px; line-height: 1.45; color: #3a3a35; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 12px; font-weight: 500; }
.kv { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.notes { font-size: 13px; color: var(--accent); border-top: 1px solid var(--line-soft); padding-top: 10px; }

.item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line-soft); }
.item:last-child { border-bottom: 0; }
.item .sub { font-size: 12px; color: var(--muted); }
.item b { font-weight: 600; }
.amount { font-weight: 600; white-space: nowrap; }
.log { display: flex; gap: 14px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.log:last-child { border-bottom: 0; }
.log .t { color: var(--muted); width: 44px; flex: none; }
.log .x { flex: 1; min-width: 0; }
.empty { color: var(--muted); font-size: 14px; padding: 6px 0; }
.events { max-height: 560px; overflow: auto; }
.ev-warn .x, .ev-error .x { color: var(--loss); }

.limits-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px; padding: 16px 22px; border: 1px solid var(--line); border-radius: var(--r); font-size: 13px; color: var(--muted); }
.limits-strip b { color: var(--ink); }
.limits-strip a { margin-left: auto; font-weight: 600; text-decoration: none; }

/* Formulare */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.field input, .field textarea { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; color: var(--ink); font-size: 16px; }
.field textarea { resize: vertical; min-height: 96px; font-size: 17px; line-height: 1.45; }
.check { display: flex; gap: 10px; align-items: center; font-size: 14px; }
.btn { min-height: 46px; padding: 0 20px; border-radius: 4px; border: 1px solid transparent; font-weight: 600; font-size: 14px; cursor: pointer; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-light { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-ghost-dark { background: transparent; border-color: var(--panel-line); color: var(--panel-fg); }
.btn-danger { background: var(--danger-bg); color: var(--danger-fg); }
.btn-icon { width: 46px; padding: 0; display: grid; place-items: center; background: var(--bg); border-color: var(--line); color: var(--accent); border-radius: 50%; }
.btn-icon.rec { background: var(--danger-bg); color: var(--danger-fg); }
.token { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; font-size: 13px; white-space: pre-wrap; word-break: break-all; margin: 0; }

/* Anmeldung */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 380px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 32px; display: flex; flex-direction: column; gap: 16px; align-items: stretch; text-align: center; }
.login-logo { width: 84px; height: 84px; border-radius: 22px; margin: 0 auto; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.login-card h1 { font-size: 22px; letter-spacing: .2em; font-weight: 600; }
.login-card .field { text-align: left; }

.toast { position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: var(--r); font-size: 14px; z-index: 50; max-width: calc(100% - 32px); }

@media (max-width: 640px) {
  .top-in { padding: 8px 16px; gap: 8px 16px; }
  .tabs { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .conn span:last-child { display: none; }
  .wrap { padding: 18px 14px calc(40px + var(--safe-b)); }
  .card { padding: 18px; }
  .big { font-size: 44px; }
  .stats { gap: 18px; }
  #chart { height: 120px; }
  .limits-strip a { margin-left: 0; }
}
