/* schneidewind.cc – gemeinsames Design */
:root {
  color-scheme: light dark;
  --bg: #f5f5f7;
  --card: #ffffff;
  --card-2: #f5f5f7;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --faint: #a1a1a6;
  --line: rgba(0,0,0,.08);
  --grid: #e7e7e7;
  --axis: #c2c2c2;
  --accent: #0071e3;
  --accent-soft: rgba(0,113,227,.10);
  --danger: #e30000;
  --good: #1a8f36;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.05);
  --s1: #257de0; --s2: #f47230; --s3: #00b894; --s4: #f2a600; --s0: #c7c7cc;
  --radius: 20px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --card: #1c1c1e;
    --card-2: #2c2c2e;
    --text: #f5f5f7;
    --muted: #98989d;
    --faint: #636366;
    --line: rgba(255,255,255,.10);
    --grid: #303032;
    --axis: #48484a;
    --accent: #2997ff;
    --accent-soft: rgba(41,151,255,.16);
    --danger: #ff453a;
    --good: #30d158;
    --shadow: none;
    --s1: #338ced; --s2: #e76624; --s3: #00a888; --s4: #d28e05; --s0: #48484a;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 17px/1.47 var(--font);
  letter-spacing: -.022em;
  -webkit-font-smoothing: antialiased;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) calc(env(safe-area-inset-bottom) + 40px) env(safe-area-inset-left);
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
button { font: inherit; letter-spacing: inherit; color: inherit; cursor: pointer; }
.hidden { display: none !important; }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 20px; }
.num { font-variant-numeric: tabular-nums; }

/* Kopfzeile */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 52px; }
.back { display: inline-flex; align-items: center; gap: 2px; font-size: 17px; }
.back svg { width: 12px; height: 20px; }
.textbtn { background: none; border: 0; color: var(--accent); padding: 8px 0; font-size: 17px; }
.demo-pill { font-size: 12px; font-weight: 600; letter-spacing: 0; color: var(--muted);
  border: 1px solid var(--line); border-radius: 99px; padding: 2px 9px; }

.pagehead { padding: 8px 0 20px; }
.eyebrow { font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: -.01em; margin: 0 0 2px; }
h1 { font-size: 40px; line-height: 1.1; font-weight: 700; letter-spacing: -.035em; margin: 0; }
h2 { font-size: 22px; line-height: 1.2; font-weight: 700; letter-spacing: -.028em; margin: 0; }
.sub { color: var(--muted); margin: 6px 0 0; font-size: 17px; }

/* Karten */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card + .card, .section + .section { margin-top: 16px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head .hint { font-size: 14px; color: var(--muted); }
.section-title { font-size: 22px; font-weight: 700; letter-spacing: -.028em; margin: 36px 4px 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }


/* Kennzahlen */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; margin-bottom: 16px; }
.stat { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.stat .label { font-size: 14px; color: var(--muted); font-weight: 500; }
.stat .value { font-size: 34px; font-weight: 600; letter-spacing: -.03em; line-height: 1.15; margin-top: 4px; }
.stat .value small { font-size: 17px; font-weight: 500; color: var(--muted); letter-spacing: -.01em; margin-left: 3px; }
.stat .note { font-size: 13px; color: var(--muted); margin-top: 2px; }
.stat.hero .value { font-size: 52px; }

/* Segment-Steuerung */
.seg { display: inline-flex; background: var(--card-2); border-radius: 10px; padding: 2px; }
.seg button { border: 0; background: none; padding: 5px 14px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--text); }
.seg button.on { background: var(--card); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
@media (prefers-color-scheme: dark) { .seg button.on { background: #636366; } }

/* Diagramm */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .tick { font-size: 11px; fill: var(--muted); letter-spacing: 0; font-variant-numeric: tabular-nums; }
.chart .xlab { font-size: 12px; fill: var(--muted); letter-spacing: 0; }
.chart .xlab.today { fill: var(--text); font-weight: 600; }
.chart .vlab { font-size: 12px; fill: var(--text); font-weight: 600; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart .baseline { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.chart .hit { fill: transparent; }
.chart .col.dim { opacity: .35; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.tip {
  position: absolute; pointer-events: none; z-index: 5; min-width: 120px;
  background: var(--card); color: var(--text); border-radius: 12px; padding: 9px 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,.16); border: 1px solid var(--line);
  font-size: 13px; line-height: 1.4; letter-spacing: 0; transform: translate(-50%, calc(-100% - 10px));
  white-space: nowrap;
}
.tip b { display: block; font-size: 13px; margin-bottom: 3px; }
.tip .r { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.tip .r span { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.tip i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }

/* Listen */
.list { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.daylabel { font-size: 13px; font-weight: 600; color: var(--muted); margin: 22px 6px 8px; display: flex; justify-content: space-between; }
.row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 13px 18px; background: none;
  border: 0; text-align: left; position: relative; }
.row + .row::before { content: ""; position: absolute; top: 0; left: 18px; right: 0; border-top: 1px solid var(--line); }
.row:active { background: var(--card-2); }
.row .t { font-weight: 600; font-variant-numeric: tabular-nums; min-width: 52px; }
.row .grow { flex: 1; min-width: 0; }
.row .meta { color: var(--muted); font-size: 15px; font-variant-numeric: tabular-nums; }
.row .chev { color: var(--faint); font-size: 20px; line-height: 1; }
.chip { display: inline-flex; align-items: center; gap: 7px; font-size: 15px; }
.chip i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.empty { text-align: center; color: var(--muted); padding: 28px 0; font-size: 15px; }
.err { color: var(--danger); }
.more { display: block; margin: 14px auto 0; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 980px;
  background: var(--accent); color: #fff; font-size: 17px; font-weight: 500; padding: 11px 22px; min-height: 44px; }
.btn:disabled { opacity: .45; }
.btn.block { width: 100%; border-radius: 14px; padding: 14px; font-weight: 600; }
.btn.secondary { background: var(--accent-soft); color: var(--accent); }
.btn.plain { background: none; color: var(--accent); }
.btn.danger { background: none; color: var(--danger); }
.btn.danger.armed { background: var(--danger); color: #fff; }
.btn.small { font-size: 15px; padding: 7px 16px; min-height: 36px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Formulare */
.field { margin-top: 16px; }
.field > label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 4px 6px; }
.input { width: 100%; padding: 13px 14px; font: inherit; font-size: 17px; border: 0; border-radius: 12px;
  background: var(--card-2); color: var(--text); min-height: 48px; -webkit-appearance: none; appearance: none; }
.input:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pills button { border: 0; border-radius: 980px; padding: 10px 16px; background: var(--card-2); font-size: 15px; font-weight: 500; display: inline-flex; align-items: center; gap: 7px; }
.pills button i { width: 9px; height: 9px; border-radius: 50%; }
.pills button.on { background: var(--text); color: var(--bg); }
.formerr { color: var(--danger); font-size: 14px; min-height: 20px; margin: 10px 4px 0; text-align: center; }

/* Sheet */
.backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.32); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .25s; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-width: 560px; margin: 0 auto;
  background: var(--card); border-radius: 22px 22px 0 0; padding: 10px 22px calc(env(safe-area-inset-bottom) + 18px);
  transform: translateY(105%); transition: transform .32s cubic-bezier(.32,.72,0,1); max-height: 92vh; overflow: auto; }
@media (min-width: 700px) { .sheet { bottom: 50%; border-radius: 22px; transform: translateY(60%) scale(.96); opacity: 0;
  transition: transform .25s, opacity .2s; } .sheet-open .sheet { transform: translateY(50%); opacity: 1; } }
.sheet::before { content: ""; display: block; width: 36px; height: 5px; border-radius: 3px; background: var(--faint); opacity: .5; margin: 0 auto 14px; }
.sheet-open .backdrop { opacity: 1; pointer-events: auto; }
.sheet-open .sheet { transform: none; }
.sheet h2 { margin-bottom: 4px; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 24px); z-index: 60;
  transform: translate(-50%, 20px); opacity: 0; transition: all .25s; pointer-events: none;
  background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: 980px; font-size: 15px; font-weight: 500;
  display: flex; gap: 14px; align-items: center; box-shadow: 0 6px 24px rgba(0,0,0,.2); }
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast button { background: none; border: 0; color: inherit; font-weight: 700; padding: 0; }

/* Login */
.login { max-width: 400px; margin: 7vh auto 0; text-align: center; }
.login .card { text-align: left; margin-top: 26px; }
.login .logo { width: 64px; height: 64px; border-radius: 16px; margin: 0 auto 14px; display: block; }

/* Ladezustand */
.skeleton { border-radius: var(--radius); background: var(--card); height: 220px; position: relative; overflow: hidden; }
.skeleton::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, var(--card-2), transparent); animation: sk 1.2s infinite; }
@keyframes sk { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.foot { text-align: center; color: var(--faint); font-size: 12px; margin-top: 48px; }

/* Mobil (am Ende, damit es die Grundregeln überschreibt) */
@media (max-width: 640px) {
  .grid2 { grid-template-columns: 1fr; } h1 { font-size: 34px; } .card { padding: 18px; }
  .stats { grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 10px; }
  .stat { padding: 14px 14px; border-radius: 18px; }
  .stat .value { font-size: 28px; }
  .stat.hero .value { font-size: 40px; }
}
