/* PULS — monitoring dashboard. Mobile first; the desktop layout is the add-on. */
:root {
  --bg: #05070d;
  --bg2: #080c16;
  --glass: rgba(255, 255, 255, .035);
  --glass2: rgba(255, 255, 255, .055);
  --line: rgba(255, 255, 255, .08);
  --line2: rgba(255, 255, 255, .14);
  --txt: #e8eefb;
  --dim: #7f8da8;
  --dimmer: #55617a;
  --cyan: #22d3ee;
  --violet: #a78bfa;
  --up: #34d399;
  --down: #fb7185;
  --warn: #fbbf24;
  --r: 18px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0; background: var(--bg); color: var(--txt);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px; line-height: 1.45; overscroll-behavior-y: none;
}
body { min-height: 100dvh; position: relative; overflow-x: hidden; }

/* ambient field — slow, cheap, no per-frame JS */
body::before {
  content: ""; position: fixed; inset: -30%; z-index: -2; pointer-events: none;
  background:
    radial-gradient(42% 32% at 18% 12%, rgba(34, 211, 238, .16), transparent 65%),
    radial-gradient(38% 30% at 84% 22%, rgba(167, 139, 250, .15), transparent 68%),
    radial-gradient(46% 36% at 50% 96%, rgba(52, 211, 153, .09), transparent 70%);
  filter: blur(26px); animation: drift 24s ease-in-out infinite alternate;
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .38;
  background-image: linear-gradient(var(--line) 1px, transparent 1px),
                    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 50% 22%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(circle at 50% 22%, #000 0%, transparent 78%);
}
@keyframes drift {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to   { transform: translate3d(3%, 2%, 0) scale(1.08); }
}

.wrap { max-width: 720px; margin: 0 auto; padding: 14px 14px calc(30px + var(--safe-b)); }

/* ---------------------------------------------------------------- header */
.top { display: flex; align-items: center; gap: 10px; padding: 6px 2px 16px; }
.mark { display: flex; align-items: baseline; gap: 8px; }
.mark b {
  font-size: 19px; font-weight: 800; letter-spacing: .22em;
  background: linear-gradient(92deg, var(--cyan), var(--violet));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.mark span { font-size: 10.5px; color: var(--dimmer); letter-spacing: .16em; text-transform: uppercase; }
.spacer { flex: 1; }

.pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px;
  border: 1px solid var(--line2); border-radius: 999px; background: var(--glass);
  font-size: 11.5px; color: var(--dim); backdrop-filter: blur(10px); white-space: nowrap;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--up); position: relative; }
.dot::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  background: inherit; opacity: .35; animation: ping 2s cubic-bezier(0,0,.2,1) infinite;
}
@keyframes ping { 0% { transform: scale(.6); opacity: .5 } 80%,100% { transform: scale(2.1); opacity: 0 } }
.dot.warn { background: var(--warn) } .dot.bad { background: var(--down) }

.iconbtn {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px;
  border: 1px solid var(--line2); background: var(--glass); color: var(--dim);
  cursor: pointer; font-size: 14px; transition: .18s;
}
.iconbtn:active { transform: scale(.93); background: var(--glass2); }

/* ------------------------------------------------------------------ cards */
.card {
  background: linear-gradient(168deg, var(--glass2), var(--glass));
  border: 1px solid var(--line); border-radius: var(--r);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  padding: 16px; margin-bottom: 12px; position: relative; overflow: hidden;
}
.card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.22), transparent);
}
.card h3 {
  margin: 0 0 12px; font-size: 10.5px; font-weight: 600; letter-spacing: .16em;
  text-transform: uppercase; color: var(--dimmer);
  display: flex; align-items: center; gap: 8px;
}
.card h3 .tag {
  margin-left: auto; font-size: 10px; letter-spacing: .04em; color: var(--dim);
  text-transform: none; padding: 2px 8px; border: 1px solid var(--line);
  border-radius: 999px; background: rgba(0,0,0,.2);
}

/* ------------------------------------------------------------------- hero */
.hero { text-align: center; padding: 26px 16px 20px; }
.hero .label { font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--dimmer); }
.hero .days {
  font-size: clamp(52px, 17vw, 82px); font-weight: 800; letter-spacing: -.035em;
  line-height: 1; margin: 10px 0 2px; font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #fff, #9fb4d8);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 46px rgba(34,211,238,.22);
}
.hero .unit { font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--dim); }
.hero .usdt { margin-top: 12px; font-size: 15px; color: var(--dim); font-variant-numeric: tabular-nums; }
.hero .usdt b { color: var(--txt); font-weight: 650; }
.deltas { display: flex; justify-content: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.chip {
  font-size: 11.5px; padding: 5px 11px; border-radius: 999px; font-variant-numeric: tabular-nums;
  border: 1px solid var(--line2); background: rgba(0,0,0,.24); color: var(--dim);
}
.chip b { font-weight: 650; }
.chip.up { color: var(--up); border-color: rgba(52,211,153,.32); background: rgba(52,211,153,.09) }
.chip.down { color: var(--down); border-color: rgba(251,113,133,.32); background: rgba(251,113,133,.09) }

/* ------------------------------------------------------------------ chart */
.chartbox { position: relative; height: 168px; margin: -2px -4px 0; }
.chartbox svg { width: 100%; height: 100%; display: block; overflow: visible; }
.spark-line { fill: none; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.range { display: flex; gap: 6px; margin-top: 10px; }
.range button {
  flex: 1; padding: 7px 0; font-size: 11.5px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--line); background: rgba(0,0,0,.2); color: var(--dim);
  font-family: inherit; transition: .16s;
}
.range button.on { color: var(--txt); border-color: rgba(34,211,238,.45); background: rgba(34,211,238,.1); }
.empty { display: grid; place-items: center; height: 100%; color: var(--dimmer); font-size: 12.5px; text-align: center; padding: 0 20px; }

/* ------------------------------------------------------------------- grid */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { padding: 12px 13px; border: 1px solid var(--line); border-radius: 13px; background: rgba(0,0,0,.2); }
.stat .k { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--dimmer); }
.stat .v { font-size: 19px; font-weight: 700; margin-top: 3px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat .s { font-size: 11px; color: var(--dim); margin-top: 1px; }
.v.up { color: var(--up) } .v.down { color: var(--down) } .v.warn { color: var(--warn) }

/* ------------------------------------------------------------------ meter */
.meter { height: 7px; border-radius: 99px; background: rgba(255,255,255,.07); overflow: hidden; margin-top: 9px; position: relative; }
.meter i { display: block; height: 100%; border-radius: 99px; transition: width .7s cubic-bezier(.22,1,.36,1); }
.meter .mark2 { position: absolute; top: -3px; width: 2px; height: 13px; background: rgba(255,255,255,.4); border-radius: 2px; }
.legend { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--dimmer); margin-top: 6px; }

/* --------------------------------------------------------------- position */
.pos { border: 1px solid var(--line); border-radius: 14px; padding: 12px 13px; margin-bottom: 9px; background: rgba(0,0,0,.22); }
.pos:last-child { margin-bottom: 0 }
.pos .r1 { display: flex; align-items: center; gap: 9px; }
.sym { font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.badge { font-size: 9.5px; font-weight: 700; letter-spacing: .1em; padding: 3px 7px; border-radius: 6px; text-transform: uppercase; }
.badge.long { color: var(--up); background: rgba(52,211,153,.13); border: 1px solid rgba(52,211,153,.3) }
.badge.short { color: var(--down); background: rgba(251,113,133,.13); border: 1px solid rgba(251,113,133,.3) }
.pnl { margin-left: auto; text-align: right; font-variant-numeric: tabular-nums; }
.pnl .a { font-size: 16px; font-weight: 700; letter-spacing: -.02em; }
.pnl .b { font-size: 11px; color: var(--dim); }
.pos .r2 { display: flex; gap: 14px; margin-top: 9px; font-size: 11.5px; color: var(--dim); font-variant-numeric: tabular-nums; flex-wrap: wrap; }
.pos .r2 b { color: var(--txt); font-weight: 600; }

/* ------------------------------------------------------------------- rows */
.row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.row:last-child { border-bottom: 0; padding-bottom: 0 }
.row .t { font-size: 11px; color: var(--dimmer); min-width: 76px; font-variant-numeric: tabular-nums; }
.row .n { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 650; }
.n.up { color: var(--up) } .n.down { color: var(--down) }

.kv { display: flex; justify-content: space-between; padding: 7px 0; font-size: 12.5px; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0 }
.kv span { color: var(--dim) } .kv b { font-weight: 600; font-variant-numeric: tabular-nums; }

.banner { border-radius: 13px; padding: 12px 14px; margin-bottom: 12px; font-size: 13px; border: 1px solid; }
.banner.warn { color: var(--warn); border-color: rgba(251,191,36,.36); background: rgba(251,191,36,.09) }
.banner.bad { color: var(--down); border-color: rgba(251,113,133,.4); background: rgba(251,113,133,.1) }
.banner b { display: block; margin-bottom: 2px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }

.log { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10.5px; color: var(--dimmer);
       line-height: 1.65; max-height: 190px; overflow-y: auto; white-space: pre-wrap; word-break: break-word; }

/* utilities — these exist so generated markup never needs a style attribute,
   which lets the CSP stay strict (no 'unsafe-inline' for styles). */
.c-up { color: var(--up) }
.c-down { color: var(--down) }
.c-dim { color: var(--dimmer) }
.f-tiny { font-size: 9px }
.f-small { font-size: 11.5px }
.slash { color: var(--dimmer); font-size: 14px }
.mt14 { margin-top: 14px }

.muted { color: var(--dimmer); font-size: 12.5px; text-align: center; padding: 14px 0; }
.foot { text-align: center; color: var(--dimmer); font-size: 10.5px; padding: 18px 0 6px; letter-spacing: .04em; }

/* ------------------------------------------------------------------ login */
.loginwrap { min-height: 100dvh; display: grid; place-items: center; padding: 22px; }
.loginbox { width: 100%; max-width: 372px; }
.loginbox .card { padding: 26px 22px; }
.loginbox h1 { font-size: 25px; font-weight: 800; letter-spacing: .2em; margin: 0 0 4px; text-align: center;
  background: linear-gradient(92deg, var(--cyan), var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.loginbox p.sub { text-align: center; color: var(--dimmer); font-size: 11.5px; margin: 0 0 22px; letter-spacing: .1em; text-transform: uppercase; }
label { display: block; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--dimmer); margin: 0 0 6px; }
input {
  width: 100%; padding: 13px 14px; margin-bottom: 14px; font-size: 16px; font-family: inherit;
  color: var(--txt); background: rgba(0,0,0,.3); border: 1px solid var(--line2);
  border-radius: 12px; outline: none; transition: .18s;
}
input:focus { border-color: rgba(34,211,238,.55); box-shadow: 0 0 0 3px rgba(34,211,238,.1); }
button.primary {
  width: 100%; padding: 14px; font-size: 14.5px; font-weight: 650; font-family: inherit;
  color: #04121a; border: 0; border-radius: 12px; cursor: pointer; letter-spacing: .04em;
  background: linear-gradient(96deg, var(--cyan), #6ee7d7); transition: .18s;
}
button.primary:active { transform: scale(.985); filter: brightness(1.08); }
button.primary:disabled { opacity: .55; cursor: default; }
.err { color: var(--down); font-size: 12.5px; text-align: center; margin-top: 12px; min-height: 17px; }
.hide { display: none !important; }

@media (min-width: 700px) {
  .wrap { padding: 22px 20px 40px; }
  .grid2 { grid-template-columns: repeat(4, 1fr); }
  .chartbox { height: 210px; }
}
@media (prefers-reduced-motion: reduce) {
  body::before { animation: none } .dot::after { animation: none }
  * { transition: none !important; }
}

/* ===================================================================
   Strategie-Seite — Schaubilder im selben Design wie das Dashboard.
   SVGs benutzen Klassen statt style-Attributen, damit die CSP streng
   bleiben kann und die Farben dem Theme folgen.
   =================================================================== */
.backlink {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12px;
  color: var(--dim); text-decoration: none; padding: 6px 11px;
  border: 1px solid var(--line2); border-radius: 999px; background: var(--glass);
}
.backlink:active { background: var(--glass2); }

.lead { font-size: 14.5px; color: var(--txt); margin: 0 0 4px; }
.lead + p { color: var(--dim); font-size: 13px; margin: 8px 0 0; }
.card p { font-size: 13px; color: var(--dim); margin: 0 0 10px; line-height: 1.6; }
.card p:last-child { margin-bottom: 0; }
.card p b, .card li b { color: var(--txt); font-weight: 620; }
.card ul { margin: 0 0 10px; padding-left: 18px; }
.card li { font-size: 13px; color: var(--dim); margin-bottom: 6px; line-height: 1.55; }

/* Ablauf: nummerierte Stufen an einer Leitlinie */
.steps { position: relative; padding-left: 34px; }
.steps::before {
  content: ""; position: absolute; left: 12px; top: 6px; bottom: 6px; width: 2px;
  background: linear-gradient(180deg, var(--cyan), var(--violet), rgba(52,211,153,.5));
  opacity: .45; border-radius: 2px;
}
.step { position: relative; padding: 0 0 18px; }
.step:last-child { padding-bottom: 0; }
.step .num {
  position: absolute; left: -34px; top: 0; width: 25px; height: 25px; border-radius: 50%;
  display: grid; place-items: center; font-size: 11px; font-weight: 700;
  color: var(--bg); background: linear-gradient(135deg, var(--cyan), var(--violet));
  box-shadow: 0 0 0 4px var(--bg);
}
.step h4 { margin: 2px 0 4px; font-size: 14px; font-weight: 650; letter-spacing: -.01em; }
.step p { font-size: 12.5px; color: var(--dim); margin: 0; line-height: 1.55; }
.step .meta {
  display: inline-block; margin-top: 6px; font-size: 10.5px; color: var(--cyan);
  border: 1px solid rgba(34,211,238,.3); background: rgba(34,211,238,.08);
  padding: 2px 8px; border-radius: 6px; font-variant-numeric: tabular-nums;
}

/* SVG-Schaubilder */
.fig { margin: 4px -4px 12px; }
.fig svg { width: 100%; height: auto; display: block; }
.fig figcaption { font-size: 11.5px; color: var(--dimmer); margin-top: 8px; line-height: 1.5; }
.s-price { fill: none; stroke: #e8eefb; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.s-chan  { fill: none; stroke: var(--violet); stroke-width: 1.5; stroke-dasharray: 5 4; }
.s-stop  { fill: none; stroke: var(--down); stroke-width: 2; stroke-linejoin: round; }
.s-stop0 { fill: none; stroke: var(--down); stroke-width: 1.5; stroke-dasharray: 4 3; opacity: .75; }
.s-zone  { fill: rgba(52,211,153,.09); }
.s-lab   { fill: var(--dim); font-size: 10px; font-family: ui-monospace, monospace; }
.s-lab-a { fill: var(--cyan); font-size: 10.5px; font-weight: 600; }
.s-lab-r { fill: var(--down); font-size: 10.5px; font-weight: 600; }
.s-lab-g { fill: var(--up); font-size: 10.5px; font-weight: 600; }
.s-dot-in  { fill: var(--cyan); }
.s-dot-out { fill: var(--down); }
.s-grid  { stroke: rgba(255,255,255,.07); stroke-width: 1; }
.s-bar   { fill: var(--cyan); }
.s-bar-w { fill: var(--warn); }
.s-bar-b { fill: var(--down); }
.s-bar-g { fill: var(--up); }
.s-funnel { fill: rgba(34,211,238,.16); stroke: rgba(34,211,238,.45); stroke-width: 1; }
.s-funnel-n { fill: var(--txt); font-size: 12px; font-weight: 700; font-family: ui-monospace, monospace; }
.s-funnel-l { fill: var(--dim); font-size: 10px; }

/* Vergleichstabelle */
.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl th {
  text-align: right; font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--dimmer); font-weight: 600; padding: 0 0 8px; border-bottom: 1px solid var(--line);
}
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.tbl td { padding: 9px 0; border-bottom: 1px solid var(--line); text-align: right;
          font-variant-numeric: tabular-nums; color: var(--dim); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td:first-child { color: var(--txt); font-weight: 600; }
.tbl tr.hi td { color: var(--up); }
.tbl tr.hi td:first-child { color: var(--up); }
.tbl .neg { color: var(--down); }

.note {
  border-left: 2px solid var(--warn); background: rgba(251,191,36,.06);
  padding: 10px 12px; border-radius: 0 10px 10px 0; margin-top: 12px;
}
.note p { color: var(--dim); font-size: 12.5px; margin: 0; }
.note b { color: var(--warn); }

.footlinks { display: flex; justify-content: center; gap: 14px; margin-top: 8px; }
.footlinks a { color: var(--dim); font-size: 11.5px; text-decoration: none; border-bottom: 1px solid var(--line2); padding-bottom: 1px; }
.footlinks a:active { color: var(--cyan); }
