/* Philharmonie. Formsprache: vollflächige Farbbänder je Projekt, darunter fast schwarze Datenflächen, fette schmale Überschriften,
   flache Kacheln mit kleinen Radien, Mono für Zahlen. Schriften liegen lokal (SIL Open Font License), keine Fremdanfragen. */
@font-face { font-family: "Sofia Sans"; src: url(/fonts/sofia-sans.woff2) format("woff2"); font-weight: 400 800; font-display: swap; }
@font-face { font-family: "Sofia Sans SC"; src: url(/fonts/sofia-sans-semi-condensed.woff2) format("woff2"); font-weight: 600 800; font-display: swap; }
@font-face { font-family: "Martian Mono"; src: url(/fonts/martian-mono.woff2) format("woff2"); font-weight: 400 600; font-display: swap; }

:root {
  color-scheme: dark;
  --g0: #0E1113; --g1: #171B1E; --g2: #22272B; --g3: #2C3236; --rule: #2A3034; --rule2: #3C444A;
  --text: #F2F4F5; --muted: #B5BCC2; --dim: #98A0A7;
  --ok: #6EE787; --warn: #FFA657; --crit: #FF6B70; --idle: #98A0A7;
  --c-wb: #1f9fb8; --c-svibe: #e0558a; --c-memexa: #8d74ee;
  /* Band: Fläche, Schrift darauf, Linie darauf */
  --band: #5FD6BF; --on: #06202C; --on-soft: rgba(6, 32, 44, .74); --on-line: rgba(6, 32, 44, .28); --on-fill: rgba(6, 32, 44, .1);
  --pc: var(--muted);
  --f-display: "Sofia Sans SC", "Arial Narrow", Arial, sans-serif;
  --f-body: "Sofia Sans", Arial, "Liberation Sans", sans-serif;
  --f-mono: "Martian Mono", ui-monospace, Menlo, monospace;
  --r: 10px; --r1: 6px; --gut: 16px;
}
body[data-scope="wb"] { --band: #55C4F5; --pc: var(--c-wb); }
body[data-scope="svibe"] { --pc: var(--c-svibe); --band: #FF8FB4; --on: #2A0716; --on-soft: rgba(42, 7, 22, .76); --on-line: rgba(42, 7, 22, .28); --on-fill: rgba(42, 7, 22, .1); }
body[data-scope="memexa"] { --pc: var(--c-memexa); --band: #5B66F0; --on: #FFFFFF; --on-soft: rgba(255, 255, 255, .86); --on-line: rgba(255, 255, 255, .36); --on-fill: rgba(255, 255, 255, .14); }
.p-wb { --pc: var(--c-wb); --pb: #55C4F5; --po: #06202C; } .p-svibe { --pc: var(--c-svibe); --pb: #FF8FB4; --po: #2A0716; } .p-memexa { --pc: var(--c-memexa); --pb: #5B66F0; --po: #fff; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--g0); color: var(--text); font: 400 16px/1.45 var(--f-body); }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 800; letter-spacing: -.02em; line-height: 1; text-wrap: balance; }
h2 { font-size: 26px; }
h3 { font-size: 19px; font-weight: 700; letter-spacing: -.012em; line-height: 1.15; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.band :focus-visible { outline-color: var(--on); }
.muted { color: var(--muted); } .dim { color: var(--dim); }
.num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.small { font-size: 14px; } .micro { font-size: 12px; }
.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding-left: max(var(--gut), env(safe-area-inset-left)); padding-right: max(var(--gut), env(safe-area-inset-right)); }
.wm { display: inline-flex; align-items: baseline; text-decoration: none; white-space: nowrap; line-height: 1; font-family: var(--f-display); }
.wm b { font-weight: 800; letter-spacing: -.01em; } .wm i { font-style: normal; font-weight: 600; opacity: .78; }
.eyebrow { font: 500 12px/1.2 var(--f-mono); text-transform: uppercase; letter-spacing: .06em; }

/* Knöpfe */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 14px; border: 1.5px solid var(--rule2); border-radius: var(--r1); background: none; font-weight: 600; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--text); }
.btn.solid { background: var(--text); color: var(--g0); border-color: var(--text); }
.btn.danger { color: var(--crit); }
.btn.sm { min-height: 34px; padding: 4px 11px; font-size: 14px; }
.band .btn { border-color: var(--on-line); color: var(--on); } .band .btn:hover { border-color: var(--on); }
.ghost { background: none; border: 0; padding: 6px 4px; font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; color: var(--on); }

/* Anmeldung */
.login { min-height: 100dvh; display: grid; grid-template-rows: auto 1fr; }
.login-band { background: var(--band); color: var(--on); padding: clamp(28px, 8vw, 88px) var(--gut) clamp(24px, 5vw, 56px); display: grid; gap: 12px; justify-items: start; }
.login-band > * { width: 100%; max-width: 760px; margin: 0 auto; }
.login-band h1 { font-size: clamp(54px, 15vw, 132px); letter-spacing: -.03em; }
.lead { font-size: clamp(18px, 2.4vw, 23px); font-weight: 500; max-width: 30em; }
.login-card { width: calc(100% - 2 * var(--gut)); max-width: 420px; margin: clamp(20px, 5vw, 48px) auto; display: grid; gap: 14px; align-content: start; }
label { display: grid; gap: 5px; font-size: 14px; font-weight: 600; color: var(--muted); }
input, select, textarea { width: 100%; padding: 11px 12px; border: 1.5px solid var(--rule2); border-radius: var(--r1); background: var(--g1); color: var(--text); font-size: 16px; font-weight: 400; }
input:focus, select:focus, textarea:focus { border-color: var(--text); outline: none; }
input.code { font-family: var(--f-mono); letter-spacing: .3em; }
.error { color: var(--crit); border: 1.5px solid var(--crit); padding: 8px 12px; border-radius: var(--r1); font-size: 15px; }
.fine { font-size: 13px; color: var(--dim); }

/* Band: Kopfzeile und Held */
.band { background: var(--band); color: var(--on); }
.bar { display: flex; align-items: center; gap: 8px 18px; flex-wrap: wrap; padding-top: max(10px, env(safe-area-inset-top)); padding-bottom: 8px; }
.bar > .wm { font-size: 24px; margin-right: 6px; }
.scopes { display: flex; gap: 4px; order: 3; flex: 1 0 100%; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gut)); padding: 2px var(--gut); }
.scopes::-webkit-scrollbar { display: none; }
.scopes a { padding: 7px 12px; border-radius: var(--r1); text-decoration: none; font-weight: 600; white-space: nowrap; min-height: 36px; display: inline-flex; align-items: center; gap: 7px; }
.scopes a:hover { background: var(--on-fill); }
.scopes a[aria-current="page"] { background: var(--on); color: var(--band); }
.bar-end { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.seg { display: inline-flex; border: 1.5px solid var(--on-line); border-radius: var(--r1); overflow: hidden; }
.seg button { border: 0; background: none; padding: 4px 9px; min-height: 32px; font: 500 12px var(--f-mono); color: var(--on); white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--on); color: var(--band); }
.badge { display: inline-flex; align-items: center; gap: 7px; min-height: 35px; padding: 4px 10px; border: 1.5px solid var(--on-line); border-radius: var(--r1); font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.badge .bt { display: none; }
#logout { display: none; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--idle); flex: none; display: inline-block; }
.dot.ok { background: #1B8F45; } .dot.warn { background: #C96A00; } .dot.crit { background: #D2222D; }
body[data-scope="memexa"] .band .dot.ok { background: #8DF5A4; } body[data-scope="memexa"] .band .dot.warn { background: #FFC27A; } body[data-scope="memexa"] .band .dot.crit { background: #FFB0B3; }
.view .dot.ok, dialog .dot.ok { background: var(--ok); } .view .dot.warn { background: var(--warn); } .view .dot.crit { background: var(--crit); }
.hero { padding-top: clamp(14px, 3vw, 34px); padding-bottom: clamp(18px, 3vw, 34px); display: grid; gap: 14px; }
.hero h1 { font-size: clamp(46px, 13vw, 118px); letter-spacing: -.03em; overflow-wrap: anywhere; }
.hero .lead { color: var(--on-soft); }
.hero.compact { gap: 8px; padding-top: 10px; padding-bottom: 14px; }
.hero.compact h1 { font-size: clamp(34px, 7vw, 58px); }
.hero.compact .lead, .hero.compact .links, .hero.compact .eyebrow { display: none; }
.hero.compact .hkpi .v { font-size: clamp(24px, 5vw, 34px); } .hero.compact .hkpi .v.none { font-size: 16px; padding: 4px 0; } .hero.compact .hkpi .d { display: none; }
.hkpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1.5px solid var(--on); margin-top: 6px; }
.hkpi { padding: 10px 10px 10px 0; border-bottom: 1.5px solid var(--on-line); min-width: 0; display: grid; gap: 2px; align-content: start; }
.hkpi:nth-child(odd) { border-right: 1.5px solid var(--on-line); } .hkpi:nth-child(even) { padding-left: 12px; }
.hkpi .l { font: 500 11px/1.25 var(--f-mono); text-transform: uppercase; letter-spacing: .05em; color: var(--on-soft); }
.hkpi .v { font: 800 clamp(34px, 9vw, 60px)/1 var(--f-display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.hkpi .v.none { font-size: 22px; font-weight: 700; padding: 6px 0; color: var(--on-soft); }
.hkpi .d { font-size: 13px; font-weight: 600; color: var(--on-soft); }
.links { display: flex; flex-wrap: wrap; gap: 6px; }
.links .btn { min-height: 32px; padding: 3px 10px; font-size: 14px; }
.links .btn::after { content: "↗"; font-family: var(--f-mono); font-size: 11px; opacity: .7; }

/* Bereichs-Reiter: am Handy unten, am Desktop unter dem Band */
.tabs { position: fixed; inset: auto 0 0 0; z-index: 6; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--g1); border-top: 1.5px solid var(--rule2); padding-bottom: env(safe-area-inset-bottom); }
.tabs a { display: grid; justify-items: center; align-content: center; gap: 3px; min-height: 56px; padding: 6px 1px; font-size: 11px; font-weight: 600; color: var(--dim); text-decoration: none; }
.tabs a[aria-current="page"] { color: var(--on); background: var(--band); }
.tabs svg { width: 21px; height: 21px; }
.view { padding-top: 22px; padding-bottom: calc(92px + env(safe-area-inset-bottom)); display: grid; gap: 16px; }

/* Kacheln */
.panel { background: var(--g1); border: 1px solid var(--rule); border-radius: var(--r); padding: 16px; display: grid; gap: 14px; min-width: 0; align-content: start; }
.panel > header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; }
.panel > header a { font-size: 14px; font-weight: 600; white-space: nowrap; }
.grid { display: grid; gap: 16px; }
.empty { padding: 14px; border: 1.5px dashed var(--rule2); border-radius: var(--r1); color: var(--muted); font-size: 15px; }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.kpi { display: grid; gap: 1px; min-width: 0; align-content: start; }
.kpi .l { font: 500 11px/1.3 var(--f-mono); text-transform: uppercase; letter-spacing: .05em; color: var(--dim); }
.kpi .v { font: 800 34px/1.05 var(--f-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .v.none { font-size: 17px; font-weight: 600; color: var(--dim); padding: 7px 0; letter-spacing: 0; }
.delta { font-size: 13px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.delta.up { color: var(--ok); } .delta.down { color: var(--crit); }
.band .delta.up, .band .delta.down { color: var(--on); }

/* Projektkarten in der Gesamtübersicht */
.pcard { border-radius: var(--r); overflow: hidden; border: 1px solid var(--rule); background: var(--g1); display: grid; min-width: 0; align-content: start; }
.pcard > a.top { background: var(--pb); color: var(--po); padding: 14px 16px 12px; text-decoration: none; display: grid; gap: 4px; }
.pcard > a.top h2 { font-size: clamp(34px, 7vw, 46px); letter-spacing: -.03em; }
.pcard > a.top .row { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; }
.pcard .body { padding: 16px; display: grid; gap: 14px; }
.spark { width: 100%; height: 40px; display: block; }
.spark path { fill: none; stroke: var(--pc); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.next { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 10px; align-items: baseline; padding-top: 12px; border-top: 1px solid var(--rule); }
.next > :first-child { grid-column: 1 / -1; }
.next b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Listen */
.list { display: grid; }
.item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--rule); text-decoration: none; }
.item:first-child { border-top: 0; padding-top: 0; }
.item .t { font-weight: 600; overflow-wrap: anywhere; } .item .d { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.ico { width: 22px; height: 22px; border-radius: 4px; display: grid; place-items: center; font: 600 12px var(--f-mono); background: var(--g2); color: var(--dim); flex: none; }
.ico.ok { background: var(--ok); color: #0B2412; } .ico.warn { background: var(--warn); color: #2B1500; } .ico.crit { background: var(--crit); color: #2B0003; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 4px; font: 500 11px/1.5 var(--f-mono); text-transform: uppercase; letter-spacing: .04em; background: var(--g2); color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--ok); color: #0B2412; } .pill.warn { background: var(--warn); color: #2B1500; } .pill.crit { background: var(--crit); color: #2B0003; }
.tag { display: inline-block; padding: 1px 7px; border-radius: 4px; font-size: 12px; font-weight: 600; background: var(--g2); color: var(--muted); white-space: nowrap; }
.tag.p { background: var(--pb); color: var(--po); }
.tag.st-published { color: var(--ok); } .tag.st-failed, .tag.st-partly { color: var(--crit); } .tag.st-due { color: var(--warn); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1.5px solid var(--rule2); background: none; padding: 4px 11px; border-radius: var(--r1); font-size: 14px; font-weight: 600; min-height: 34px; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.chip[aria-current="true"] { background: var(--text); color: var(--g0); border-color: var(--text); }
.head { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; justify-content: space-between; }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; }

/* Diagramme */
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .gridl { stroke: var(--rule); stroke-width: 1; }
.chart text { fill: var(--dim); font: 500 10px var(--f-mono); }
.chart .ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .pt { stroke: var(--g1); stroke-width: 2; }
.s-wb { stroke: var(--c-wb); } .s-svibe { stroke: var(--c-svibe); } .s-memexa { stroke: var(--c-memexa); }
.f-wb { fill: var(--c-wb); } .f-svibe { fill: var(--c-svibe); } .f-memexa { fill: var(--c-memexa); }
.chart .cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; font-weight: 600; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 12px; height: 12px; border-radius: 3px; background: var(--pc); flex: none; display: inline-block; }
.tip { position: fixed; z-index: 20; pointer-events: none; background: var(--text); color: var(--g0); padding: 8px 10px; border-radius: var(--r1); font-size: 13px; line-height: 1.45; max-width: 260px; }
.tip b { font-weight: 700; } .tip .r { display: flex; justify-content: space-between; gap: 14px; }

/* Tabellen */
.tablewrap { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; padding: 9px 12px 9px 0; border-top: 1px solid var(--rule); vertical-align: top; }
th { border-top: 0; font: 500 11px/1.3 var(--f-mono); text-transform: uppercase; letter-spacing: .05em; color: var(--dim); white-space: nowrap; }
th a { text-decoration: none; } th[aria-sort] a { color: var(--text); }
td.n, th.n { text-align: right; white-space: nowrap; padding-right: 0; padding-left: 12px; }
td.n { font: 500 13px/1.6 var(--f-mono); letter-spacing: -.02em; }
td .mbar { display: block; height: 4px; border-radius: 2px; background: var(--pc); margin-top: 5px; min-width: 2px; }
th.n + th:not(.n), td.n + td:not(.n) { padding-left: 16px; }
td.title { min-width: 210px; } td.title a { font-weight: 600; text-decoration: none; } td.title a:hover { text-decoration: underline; }
td .meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
td .spark { width: 90px; height: 22px; display: inline-block; vertical-align: middle; }

/* Redaktionsplan */
.daygroup { display: grid; gap: 8px; }
.dayhead { display: flex; align-items: baseline; gap: 8px; font: 700 17px var(--f-display); padding-top: 4px; }
.dayhead.today { color: var(--band); }
.entry { display: grid; grid-template-columns: 4px 50px minmax(0, 1fr); gap: 10px; align-items: start; background: var(--g1); border: 1px solid var(--rule); border-radius: var(--r1); padding: 10px 12px 10px 0; text-align: left; width: 100%; text-decoration: none; }
.entry:hover { border-color: var(--rule2); }
.entry .stripe { align-self: stretch; background: var(--pc); border-radius: 0 3px 3px 0; }
.entry .time { font: 500 12px/1.7 var(--f-mono); }
.entry .t { font-weight: 600; overflow-wrap: anywhere; display: block; }
.entry .meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.entry.past .t, .entry.past .time { color: var(--muted); }
.week { display: none; }

/* Funnel */
.fstep { display: grid; gap: 4px; padding: 8px 0; }
.frow { display: flex; justify-content: space-between; gap: 10px; font-weight: 600; }
.fbar { height: 22px; border-radius: 0 4px 4px 0; background: var(--pc); min-width: 3px; }
.fbar.none { background: repeating-linear-gradient(135deg, var(--rule2) 0 6px, transparent 6px 12px); width: 100%; border-radius: 4px; }
.fconv { font-size: 13px; color: var(--muted); }

/* Dialog */
dialog { border: 1.5px solid var(--rule2); border-radius: var(--r); background: var(--g1); color: var(--text); padding: 18px; width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); }
dialog::backdrop { background: rgba(5, 7, 9, .7); }
dialog form, dialog .detail { display: grid; gap: 14px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; border: 1.5px solid var(--rule2); border-radius: var(--r1); padding: 10px 12px; margin: 0; }
.checks label { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 400; color: var(--text); }
.checks input { width: auto; }
.steprow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

@media (min-width: 640px) {
  .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cols { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
  .cols .kpis, .pcard .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hkpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hkpi, .hkpi:nth-child(even) { padding-left: 14px; border-right: 1.5px solid var(--on-line); } .hkpi:first-child { padding-left: 0; } .hkpi:last-child { border-right: 0; }
  .badge .bt { display: inline; } .badge .bn { display: none; }
}
@media (min-width: 900px) {
  :root { --gut: 28px; }
  .scopes { order: 0; flex: 0 1 auto; margin: 0; padding: 0; }
  #logout { display: inline; }
  .tabs { position: sticky; inset: 0 auto auto auto; top: 0; display: flex; gap: 2px; padding: 0 max(28px, calc((100vw - 1240px) / 2 + 28px)); border-top: 0; border-bottom: 1.5px solid var(--rule); background: var(--g0); }
  .tabs a { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 14px; font-size: 16px; border-bottom: 3px solid transparent; margin-bottom: -1.5px; }
  .tabs a[aria-current="page"] { background: none; color: var(--text); border-bottom-color: var(--band); }
  .tabs svg { width: 18px; height: 18px; }
  .view { padding-top: 26px; padding-bottom: 64px; }
  .week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
  .week .col { display: grid; gap: 6px; align-content: start; min-width: 0; }
  .week .entry { grid-template-columns: 4px minmax(0, 1fr); padding: 8px 8px 8px 0; font-size: 14px; }
  .week .entry .time, .week .entry .body { grid-column: 2; }
  .agenda.has-week { display: none; }
}
@media (prefers-reduced-motion: no-preference) { .btn, .chip, .scopes a, .seg button, .entry { transition: background-color .12s, color .12s, border-color .12s; } }
