/* DigiUp Statistik. Neutral-Rampe, ein Akzent (Lime), 4-px-Raster. */
:root {
  --lime: #aaff00;
  --bg: #0b0b0b;
  --bg2: #101010;
  --card: #151515;
  --card2: #1b1b1b;
  --line: rgba(242, 242, 242, 0.09);
  --line2: rgba(242, 242, 242, 0.16);
  --fg: #f2f2f2;
  --fg2: #bdbdbd;
  --muted: #8c8c8c;
  --amber: #e8b964;
  --red: #e88a8a;
  --good: #9bd67a;
  --r: 12px;
  --rs: 8px;
  --side: 232px;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); }
body {
  font: 400 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums;
}
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 22px; font-weight: 500; letter-spacing: -0.01em; }
h2 { font-size: 15px; font-weight: 500; }
a { color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; border-radius: 4px; }

/* Anmeldung */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login-box { width: min(360px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 28px; display: grid; gap: 12px; }
.login-box label { font-size: 13px; color: var(--fg2); margin-top: 8px; }
.login-box input { height: 44px; border-radius: var(--rs); border: 1px solid var(--line2); background: var(--bg2); color: var(--fg); padding: 0 12px; font: inherit; font-size: 16px; }
.err { color: var(--red); font-size: 13px; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: 15px; }
.mark { width: 10px; height: 18px; background: var(--lime); border-radius: 2px; display: inline-block; }

/* Gerüst */
.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100dvh; }
.side { position: sticky; top: 0; height: 100dvh; padding: 24px 12px 16px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 24px; background: var(--bg); }
.side .brand { padding: 0 12px; }
.nav { display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; height: 36px; padding: 0 12px; border-radius: var(--rs); text-decoration: none; color: var(--fg2); transition: background-color 0.15s var(--ease), color 0.15s var(--ease); }
.nav a:hover { background: var(--card); color: var(--fg); }
.nav a.on { background: var(--card2); color: var(--fg); box-shadow: inset 2px 0 0 var(--lime); }
.side-foot { margin-top: auto; display: grid; gap: 12px; padding: 0 12px; }
.live { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; min-height: 18px; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.on { background: var(--lime); }
.main { padding: 28px 32px 64px; min-width: 0; max-width: 1440px; }
.top { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.top p { margin-top: 4px; font-size: 13px; }
.view { display: grid; gap: 20px; }

/* Steuerelemente */
.btn { height: 36px; padding: 0 14px; border-radius: var(--rs); border: 1px solid var(--line2); background: transparent; color: var(--fg); font: inherit; cursor: pointer; transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease); }
.btn:hover { background: var(--card2); }
.btn-main { background: var(--lime); border-color: var(--lime); color: #0b0b0b; font-weight: 500; height: 44px; }
.btn-main:hover { background: #bbff33; }
.btn-quiet { border-color: transparent; color: var(--muted); justify-self: start; padding: 0; height: 28px; }
.btn-quiet:hover { background: transparent; color: var(--fg); }
.btn[disabled] { opacity: 0.5; cursor: default; }
.seg { display: inline-flex; border: 1px solid var(--line2); border-radius: var(--rs); padding: 2px; gap: 2px; background: var(--bg2); }
.seg button { height: 30px; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; color: var(--fg2); font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; transition: background-color 0.15s var(--ease), color 0.15s var(--ease); }
.seg button:hover { color: var(--fg); }
.seg button.on { background: var(--card2); color: var(--fg); box-shadow: inset 0 0 0 1px var(--line2); }
.input { height: 36px; border-radius: var(--rs); border: 1px solid var(--line2); background: var(--bg2); color: var(--fg); padding: 0 12px; font: inherit; width: min(320px, 100%); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: space-between; }

/* Flächen */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; min-width: 0; }
.card > h2 { margin-bottom: 4px; }
.card > .hint { color: var(--muted); font-size: 13px; margin-bottom: 16px; max-width: 72ch; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.note { border: 1px solid var(--line2); border-left: 2px solid var(--amber); border-radius: var(--rs); padding: 12px 16px; background: var(--bg2); color: var(--fg2); font-size: 13px; max-width: 90ch; }
.note b { color: var(--fg); font-weight: 500; }
.empty { color: var(--muted); font-size: 13px; padding: 12px 0; }

/* Kennzahlen */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.tile { background: var(--card); padding: 16px 20px; min-width: 0; }
.tile .lab { font-size: 13px; color: var(--fg2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .val { font-size: 26px; font-weight: 500; letter-spacing: -0.01em; margin-top: 4px; line-height: 1.2; }
.tile .cmp { font-size: 12px; color: var(--muted); margin-top: 4px; min-height: 18px; }
.up { color: var(--good); }
.down { color: var(--red); }

/* Diagramm */
.chart { width: 100%; height: 240px; display: block; }
.chart text { fill: var(--muted); font-size: 11px; font-family: inherit; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .l1 { fill: none; stroke: var(--lime); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .a1 { fill: var(--lime); opacity: 0.07; }
.chart .l2 { fill: none; stroke: var(--fg2); stroke-width: 1.5; stroke-dasharray: 3 4; opacity: 0.7; }
.chart .cur { stroke: var(--line2); stroke-width: 1; }
.chart .pt { fill: var(--lime); stroke: var(--bg); stroke-width: 2; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-top: 8px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 14px; height: 2px; background: var(--lime); vertical-align: middle; margin-right: 6px; }
.legend i.n { background: var(--fg2); opacity: 0.7; }
.tip { position: fixed; z-index: 20; pointer-events: none; background: #222; border: 1px solid var(--line2); border-radius: var(--rs); padding: 8px 10px; font-size: 12px; color: var(--fg); white-space: nowrap; }
.tip b { font-weight: 500; }

/* Ranglisten mit Balken */
.rank { display: grid; gap: 2px; }
.rank .it { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; min-height: 36px; padding: 0 12px; border-radius: 6px; text-decoration: none; overflow: hidden; }
.rank a.it:hover { background: var(--card2); }
.rank .bar { position: absolute; inset: 4px auto 4px 0; background: rgba(242, 242, 242, 0.06); border-radius: 4px; width: 0; }
.rank .it.acc .bar { background: rgba(170, 255, 0, 0.16); }
.rank .lab { position: relative; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank .lab small { color: var(--muted); margin-left: 8px; font-size: 12px; }
.rank .v { position: relative; color: var(--fg); }
.rank .v small { color: var(--muted); margin-left: 8px; font-size: 12px; }

/* Tabellen */
.tw { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { text-align: right; padding: 0 10px; height: 40px; white-space: nowrap; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 400; height: 36px; position: sticky; top: 0; background: var(--card); }
th[data-s] { cursor: pointer; user-select: none; }
th[data-s]:hover { color: var(--fg); }
th.sorted { color: var(--fg); }
th:first-child, td:first-child { text-align: left; padding-left: 0; max-width: 340px; overflow: hidden; text-overflow: ellipsis; }
th:last-child, td:last-child { padding-right: 0; }
td.l, th.l { text-align: left; }
tr:last-child td { border-bottom: 0; }
tbody tr.go { cursor: pointer; }
tbody tr.go:hover td { background: var(--card2); }
td .sub { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
td.two { height: 52px; }
.tag { display: inline-block; font-size: 12px; color: var(--fg2); border: 1px solid var(--line2); border-radius: 4px; padding: 0 6px; line-height: 20px; }

/* Trichter */
.funnel { display: grid; gap: 4px; }
.funnel .st { display: grid; grid-template-columns: 200px minmax(0, 1fr) 88px; gap: 12px; align-items: center; min-height: 32px; }
.funnel .track { height: 20px; background: var(--bg2); border-radius: 4px; overflow: hidden; }
.funnel .fill { display: block; height: 100%; background: rgba(242, 242, 242, 0.22); border-radius: 4px; width: 0; min-width: 2px; }
.funnel .st:first-child .fill { background: var(--lime); }
.funnel .n { text-align: right; }
.funnel .n small { color: var(--muted); margin-left: 6px; font-size: 12px; }
.funnel .lab { color: var(--fg2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Absprung je Abschnitt: die Seite von oben nach unten */
.drop { display: grid; gap: 0; }
.drop .sec { display: grid; grid-template-columns: 24px minmax(0, 1fr) 184px; gap: 12px; align-items: center; min-height: 44px; position: relative; }
.drop .rail { align-self: stretch; display: grid; justify-items: center; }
.drop .rail::before { content: ""; width: 1px; background: var(--line2); grid-row: 1; height: 100%; }
.drop .sec:first-child .rail::before { margin-top: 22px; height: calc(100% - 22px); }
.drop .sec:last-child .rail::before { height: 22px; }
.drop .rail::after { content: ""; position: absolute; top: 18px; width: 8px; height: 8px; border-radius: 50%; background: var(--card); border: 1px solid var(--fg2); }
.drop .body { min-width: 0; padding: 6px 0; }
.drop .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drop .track { height: 6px; background: var(--bg2); border-radius: 3px; margin-top: 6px; overflow: hidden; }
.drop .fill { height: 100%; background: var(--fg2); border-radius: 3px; width: 0; }
.drop .sec.worst .fill { background: var(--amber); }
.drop .sec.worst .rail::after { border-color: var(--amber); background: var(--amber); }
.drop .r { text-align: right; font-size: 13px; }
.drop .r small { display: block; color: var(--muted); font-size: 12px; }
.drop .sec.worst .r small { color: var(--amber); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
code { font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--bg2); border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; word-break: break-all; }
.back { color: var(--muted); text-decoration: none; font-size: 13px; }
.back:hover { color: var(--fg); }
.goal { display: grid; gap: 12px; }
.goal .g { display: grid; grid-template-columns: 140px minmax(0, 1fr) 150px; gap: 12px; align-items: center; font-size: 13px; }
.goal .track { height: 8px; background: var(--bg2); border-radius: 4px; overflow: hidden; }
.goal .fill { display: block; height: 100%; background: var(--lime); border-radius: 4px; width: 0; }
.goal .r { text-align: right; color: var(--fg2); }

@media (max-width: 1000px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: sticky; top: 0; z-index: 10; height: auto; flex-direction: column; gap: 8px; padding: 12px 0 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .side .brand { padding: 0 16px; }
  .nav { display: flex; overflow-x: auto; gap: 4px; padding: 0 12px 8px; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { flex: none; height: 36px; white-space: nowrap; }
  .nav a.on { box-shadow: inset 0 -2px 0 var(--lime); }
  .side-foot { display: none; }
  .main { padding: 20px 16px 64px; }
  .top { align-items: flex-start; flex-direction: column; }
  .seg { width: 100%; }
  .seg button { flex: 1; padding: 0 4px; height: 36px; }
  .card { padding: 16px; }
  .tw { margin: 0 -16px; padding: 0 16px; }
  .tile { padding: 12px 16px; }
  .tile .val { font-size: 22px; }
  .chart { height: 200px; }
  .funnel .st { grid-template-columns: 116px minmax(0, 1fr) 72px; gap: 8px; }
  .drop .sec { grid-template-columns: 16px minmax(0, 1fr) 112px; gap: 8px; }
  .goal .g { grid-template-columns: 96px minmax(0, 1fr) 110px; gap: 8px; }
  th:first-child, td:first-child { max-width: 220px; }
  .input { width: 100%; }
}
.card .row .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.card .row .seg::-webkit-scrollbar { display: none; }
@media (max-width: 760px) {
  .card .row .seg { width: 100%; }
  .card .row .seg button { flex: none; padding: 0 10px; }
  .drop .name { white-space: normal; }
  .card .row { align-items: flex-start; }
}
.login-box .btn-quiet { justify-self: center; height: 36px; padding: 0 8px; }

/* Was jetzt tun */
.seg a { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 6px; color: var(--fg2); font-size: 13px; text-decoration: none; white-space: nowrap; }
.seg a:hover { color: var(--fg); }
.seg a.on { background: var(--card2); color: var(--fg); box-shadow: inset 0 0 0 1px var(--line2); }
.tabs { max-width: 100%; overflow-x: auto; scrollbar-width: none; justify-self: start; }
.tabs::-webkit-scrollbar { display: none; }
.small { font-size: 12px; }
h3 { font-size: 15px; font-weight: 500; }
.tasks, .chgs { display: grid; gap: 0; }
.task { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); }
.task:first-child, .chg:first-child { border-top: 0; padding-top: 4px; }
.task .no { width: 28px; height: 28px; border-radius: 50%; background: var(--lime); color: #0b0b0b; font-weight: 600; font-size: 13px; display: grid; place-items: center; }
.task.dim .no { background: var(--card2); color: var(--fg2); box-shadow: inset 0 0 0 1px var(--line2); }
.task .body { display: grid; gap: 6px; justify-items: start; min-width: 0; }
.task p, .chg p { color: var(--fg2); max-width: 78ch; }
.task .est { margin-left: 10px; font-size: 12px; font-weight: 400; color: var(--good); white-space: nowrap; }
.pg { color: var(--fg); text-decoration: none; font-size: 13px; overflow-wrap: anywhere; }
a.pg:hover { text-decoration: underline; }
.pg small { color: var(--muted); margin-left: 8px; }
.note.alarm { border-left-color: var(--red); }
.form { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.form label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); min-width: 0; }
.form .input { width: 100%; min-width: 160px; }
.form .grow { flex: 1 1 240px; }
.form .wide { flex: 1 1 100%; }
.form .btn-main { height: 36px; }
select.input { appearance: none; padding-right: 28px; background-image: linear-gradient(45deg, transparent 50%, var(--fg2) 50%), linear-gradient(135deg, var(--fg2) 50%, transparent 50%); background-position: calc(100% - 15px) 15px, calc(100% - 10px) 15px; background-size: 5px 5px; background-repeat: no-repeat; }
input[type="date"].input { color-scheme: dark; }
.chg { display: grid; gap: 12px; padding: 20px 0; border-top: 1px solid var(--line); justify-items: stretch; }
.chg .row { align-items: flex-start; }
.chg .btn-quiet { justify-self: start; }
.chg .nt { color: var(--fg); }
.verdict { display: grid; gap: 4px; justify-items: end; text-align: right; }
.verdict small { color: var(--muted); font-size: 12px; }
.tag.up { color: var(--good); border-color: var(--good); }
.tag.down { color: var(--red); border-color: var(--red); }
.ba { border: 1px solid var(--line); border-radius: var(--rs); padding: 12px 16px 4px; min-width: 0; overflow-x: auto; }
.bah { font-size: 13px; margin-bottom: 4px; }
.ba th { background: transparent; position: static; }
.spark { display: block; margin-left: auto; }
.spark polyline { fill: none; stroke: var(--fg2); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.reps { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.replist { display: grid; gap: 4px; grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; scrollbar-width: thin; padding-bottom: 4px; }
.replist a { display: grid; gap: 2px; padding: 8px 12px; border-radius: var(--rs); text-decoration: none; color: var(--fg2); }
.replist a:hover { background: var(--card2); }
.replist a.on { background: var(--card2); color: var(--fg); box-shadow: inset 0 -2px 0 var(--lime); }
.replist b { font-weight: 500; }
.replist small { color: var(--muted); font-size: 12px; }
.repframe { width: 100%; height: 600px; border: 0; border-radius: var(--rs); background: #f5f5f3; }
.utm { display: flex; gap: 12px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.utm code { flex: 1 1 320px; padding: 8px 12px; overflow-wrap: anywhere; user-select: all; }
@media (max-width: 760px) {
  .verdict { justify-items: start; text-align: left; }
  .task { grid-template-columns: 28px minmax(0, 1fr); gap: 12px; }
}
.note a { color: var(--fg); }
