/* ficom Lizenzen — Portal. Ein kleines eigenes Stylesheet, Farben nur als Tokens. */
:root {
  --bg: #f5f5f7; --surface: #ffffff; --surface-2: #fbfbfd; --surface-3: #f0f0f3; --line: rgba(0,0,0,.08);
  --text: #1d1d1f; --text-2: #6e6e73; --text-3: #86868b;
  --accent: #0071e3; --accent-hover: #0077ed; --accent-soft: rgba(0,113,227,.10); --on-accent: #ffffff;
  --green: #30d158; --green-text: #1f9d45; --green-soft: rgba(48,209,88,.12);
  --yellow: #ffb300; --yellow-soft: rgba(255,179,0,.13);
  --red: #ff3b30; --red-text: #d70015; --red-soft: rgba(255,59,48,.10);
  --grey: #aeaeb2; --sky: #5ac8fa;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.04);
  --shadow-pop: 0 10px 40px rgba(0,0,0,.16);
  --radius: 16px; --radius-s: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --surface: #1c1c1e; --surface-2: #161618; --surface-3: #2c2c2e; --line: rgba(255,255,255,.09);
    --text: #f5f5f7; --text-2: #a1a1a6; --text-3: #8e8e93;
    --accent: #0a84ff; --accent-hover: #409cff; --accent-soft: rgba(10,132,255,.18);
    --green-text: #30d158; --red-text: #ff6961;
    --shadow: none; --shadow-pop: 0 10px 40px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --surface: #1c1c1e; --surface-2: #161618; --surface-3: #2c2c2e; --line: rgba(255,255,255,.09);
  --text: #f5f5f7; --text-2: #a1a1a6; --text-3: #8e8e93;
  --accent: #0a84ff; --accent-hover: #409cff; --accent-soft: rgba(10,132,255,.18);
  --green-text: #30d158; --red-text: #ff6961;
  --shadow: none; --shadow-pop: 0 10px 40px rgba(0,0,0,.6);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; border-radius: 8px; }

/* Rahmen */
.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.seitenleiste { padding: 28px 16px; border-right: 1px solid var(--line); background: var(--surface-2); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.marke { font-weight: 600; font-size: 17px; letter-spacing: -.01em; padding: 0 12px 28px; display: flex; gap: 10px; align-items: center; color: var(--text); }
.marke img { height: 26px; width: auto; display: block; }
.navi a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-s); color: var(--text-2); font-weight: 500; margin-bottom: 2px; }
.navi a:hover { background: var(--surface-3); }
.navi a.active { background: var(--accent-soft); color: var(--accent); }
svg.symbol { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; flex: none; stroke-linecap: round; stroke-linejoin: round; }
.suche svg.symbol { width: 16px; height: 16px; stroke-width: 2; }
.zahl { margin-left: auto; background: var(--accent); color: var(--on-accent); font-size: 12px; border-radius: 10px; padding: 0 7px; font-weight: 600; }
.seitenleiste .unten { margin-top: auto; padding: 0 12px; font-size: 13px; color: var(--text-3); }
main { padding: 28px 40px 60px; max-width: 1180px; width: 100%; }
.kopf { display: flex; align-items: center; gap: 16px; margin-bottom: 32px; }
.suche { flex: 1; max-width: 440px; display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; color: var(--text-3); }
.suche input { flex: 1; border: 0; background: transparent; padding: 9px 0; outline: none; color: var(--text); min-width: 0; }
.suche kbd { white-space: nowrap; font-size: 12px; border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-family: inherit; }
.ich { margin-left: auto; position: relative; }
.ich > button { width: 34px; height: 34px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); font-weight: 600; font-size: 13px; color: var(--text-2); cursor: pointer; }

/* Typografie */
h1:focus { outline: none; }
h1 { font-size: 34px; font-weight: 700; letter-spacing: -.025em; line-height: 1.1; }
h2 { font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
h3 { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.unter { color: var(--text-2); margin-top: 6px; }
.leise { color: var(--text-2); font-size: 13px; }
.kleiner { color: var(--text-3); font-size: 12px; }
.seitenkopf { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.aktionen { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.abschnitt { margin-top: 36px; }
.abschnittskopf { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }

/* Knöpfe */
.knopf { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; background: var(--accent); color: var(--on-accent); font-weight: 600; padding: 10px 18px; border-radius: 980px; cursor: pointer; white-space: nowrap; transition: background .15s; }
.knopf:hover { background: var(--accent-hover); }
.knopf:disabled { opacity: .45; cursor: default; }
.knopf.zart { background: var(--surface); color: var(--text); border: 1px solid var(--line); }
.knopf.zart:hover { background: var(--surface-3); }
.knopf.gefahr { background: var(--red); }
.knopf.klein { padding: 6px 14px; font-size: 13px; }
.knopf.rund { width: 40px; padding: 10px 0; }
.textknopf { border: 0; background: none; color: var(--accent); font-weight: 500; cursor: pointer; padding: 0; }
.textknopf.gefahr { color: var(--red-text); }

/* Karten, Zahlen, Listen */
.raster { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.zwei { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.karte { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); padding: 20px; }
.spalte-stapel > .karte + .karte, .zwei > div > .karte + .karte, .zwei > div > * + .karte { margin-top: 16px; }
.karte > h3 { margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
a.kennzahl { color: inherit; transition: transform .15s; }
a.kennzahl:hover { transform: translateY(-1px); }
.kennzahl .n { font-size: 34px; font-weight: 700; letter-spacing: -.02em; margin-top: 6px; }
.kennzahl .l { color: var(--text-2); font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 7px; }
.punkt { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.punkt.Gruen { background: var(--green); } .punkt.Gelb { background: var(--yellow); } .punkt.Rot { background: var(--red); } .punkt.Grau { background: var(--grey); }
.liste { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; }
.zeile { display: grid; grid-template-columns: minmax(0, 1fr) 110px 90px 130px 16px; align-items: center; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--line); color: inherit; }
.zeile:first-child { border-top: 0; }
a.zeile:hover { background: var(--surface-2); }
.zeile.einfach { grid-template-columns: minmax(0, 1fr) auto; }
.zeile .name { font-weight: 600; display: flex; align-items: center; gap: 10px; min-width: 0; }
.zeile .name > div { min-width: 0; }
.zeile .name .leise { font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zeile .spalte { color: var(--text-2); font-size: 14px; }
.pfeil { color: var(--text-3); }
.leer { padding: 40px 20px; text-align: center; color: var(--text-2); }
.chips { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 980px; padding: 6px 14px; font-size: 13px; font-weight: 500; color: var(--text-2); cursor: pointer; }
.chip.an { background: var(--text); color: var(--bg); border-color: var(--text); }
.blaettern { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; color: var(--text-2); font-size: 13px; }

/* Balken */
.balken { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; display: flex; margin: 14px 0 10px; }
.balken span { display: block; height: 100%; }
.legende { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); }
.legende span { display: inline-flex; align-items: center; gap: 6px; }

/* Schalter, Segmente */
.schalter { width: 44px; height: 26px; border-radius: 13px; background: var(--grey); position: relative; flex: none; border: 0; cursor: pointer; transition: background .2s; }
.schalter::after { content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: left .2s; }
.schalter.an { background: var(--green); }
.schalter.an::after { left: 20px; }
.schalter:disabled { opacity: .5; cursor: default; }
.option { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.option:first-of-type { border-top: 0; }
.option .kleiner { display: block; }
.segmente { display: flex; background: var(--surface-3); border-radius: 12px; padding: 4px; margin-top: 6px; }
.segmente button { flex: 1; text-align: center; font-weight: 500; font-size: 14px; padding: 8px; border-radius: 9px; color: var(--text-2); border: 0; background: none; cursor: pointer; }
.segmente button.an { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.segmente button:disabled { cursor: default; }
.zaehler { display: inline-flex; align-items: center; gap: 4px; }
.zaehler button { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 16px; line-height: 1; }
.zaehler span { min-width: 28px; text-align: center; font-weight: 600; }

/* Cockpit */
.held { display: flex; align-items: center; gap: 18px; min-width: 0; }
.held h1 { overflow-wrap: anywhere; }
.avatar { width: 56px; height: 56px; border-radius: 16px; background: linear-gradient(135deg, #ff9f0a, #ff375f); color: #fff; font-weight: 700; font-size: 22px; display: grid; place-items: center; flex: none; }
.marke-status { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: 13px; padding: 4px 10px; border-radius: 980px; white-space: nowrap; }
.marke-status.Gruen { background: var(--green-soft); color: var(--green-text); }
.marke-status.Gelb { background: var(--yellow-soft); color: var(--text); }
.marke-status.Rot { background: var(--red-soft); color: var(--red-text); }
.marke-status.Grau { background: var(--surface-3); color: var(--text-2); }
.hinweis { margin-top: 12px; font-size: 13px; color: var(--text-2); display: flex; gap: 8px; align-items: flex-start; }
.hinweis .punkt { margin-top: 6px; }
.geraet { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); font-size: 14px; }
.geraet:first-of-type { border-top: 0; }
.geraet .titel { display: flex; align-items: center; gap: 8px; }
.wartet.rot { background: var(--red-soft); }
.wartet { background: var(--yellow-soft); border-radius: 12px; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; font-size: 14px; }
.daten { display: grid; grid-template-columns: 120px minmax(0, 1fr); row-gap: 10px; font-size: 14px; }
.daten dt { color: var(--text-2); }
.daten dd { overflow-wrap: anywhere; }
.code { font: 600 22px/1.2 ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace; letter-spacing: .08em; }
.verlauf { padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.verlauf:first-of-type { border-top: 0; }

/* Formulare */
.feld { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.feld label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.eingabe, .feld input, .feld select, .feld textarea { width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px 12px; outline: none; transition: border-color .15s, box-shadow .15s; }
.eingabe:focus, .feld input:focus, .feld select:focus, .feld textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.feld textarea { min-height: 90px; resize: vertical; }
.felder { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.fehler { background: var(--red-soft); color: var(--red-text); border-radius: var(--radius-s); padding: 10px 14px; font-size: 14px; margin-bottom: 16px; }
.erfolg { background: var(--green-soft); color: var(--green-text); border-radius: var(--radius-s); padding: 10px 14px; font-size: 14px; margin-bottom: 16px; }
.reiter { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.reiter button { border: 0; background: none; padding: 10px 14px; font-weight: 500; color: var(--text-2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.reiter button.an { color: var(--text); border-bottom-color: var(--accent); }

/* Anmeldung */
.anmeldung { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.anmeldung .karte { width: 100%; max-width: 380px; padding: 32px 28px; }
.anmeldung .marke { padding: 0 0 24px; justify-content: center; flex-direction: column; gap: 4px; }
.anmeldung .marke img { height: 58px; margin-bottom: 8px; }
.anmeldung .marke small { font-size: 13px; font-weight: 500; color: var(--text-2); }
.merken { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--text-2); margin: 4px 0 16px; cursor: pointer; }
.anmeldung h1 { font-size: 24px; text-align: center; margin-bottom: 6px; }
.anmeldung .unter { text-align: center; margin-bottom: 24px; }
.anmeldung .knopf { width: 100%; padding: 12px; }
.anmeldung .code-eingabe { text-align: center; font-size: 26px; letter-spacing: .3em; font-weight: 600; }
.qr { display: block; margin: 0 auto 16px; width: 200px; height: 200px; border-radius: 12px; background: #fff; padding: 8px; image-rendering: pixelated; }

/* Dialog, Meldung, Menü */
.schleier { position: fixed; inset: 0; background: rgba(0,0,0,.32); display: grid; place-items: center; padding: 16px; z-index: 50; animation: ein .15s ease-out; }
.dialog { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-pop); padding: 24px; width: 100%; max-width: 440px; }
.dialog h3 { margin-bottom: 8px; }
.dialog .knoepfe { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--text); color: var(--bg); border-radius: 980px; padding: 10px 18px; font-size: 14px; display: flex; gap: 14px; align-items: center; box-shadow: var(--shadow-pop); z-index: 60; animation: ein .2s ease-out; max-width: calc(100vw - 32px); }
.toast.fehler-toast { background: var(--red); color: #fff; }
.toast button { border: 0; background: none; color: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; }
.menue { position: absolute; right: 0; top: calc(100% + 8px); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-pop); padding: 6px; min-width: 220px; z-index: 40; }
.menue button, .menue a { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 9px 12px; border-radius: 9px; cursor: pointer; color: var(--text); font-size: 14px; }
.menue button:hover, .menue a:hover { background: var(--surface-3); }
.menue .gefahr { color: var(--red-text); }
.menue hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.mitte { position: relative; display: inline-block; }
@keyframes ein { from { opacity: 0; } to { opacity: 1; } }

/* Anfragen und Testversionen (Startseite) */
.anfragen { margin-bottom: 28px; }
.abschnittskopf h2 { display: flex; align-items: center; gap: 10px; }
.abschnittskopf h2 .zahl { margin-left: 0; font-size: 13px; }
.zeile.anfrage { grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
.zeile.anfrage .name { align-items: flex-start; }
.zeile.anfrage .name .punkt { margin-top: 7px; }
.zeile .name .leise.frei { white-space: normal; }
.vorschlag { margin-top: 4px; font-size: 13px; font-weight: 500; color: var(--accent); }
.zeile .aktionen { justify-content: flex-end; }
[data-hinweise-erlauben], [data-hinweise-zeige] { display: none; }
:root[data-hinweise="default"] [data-hinweise-erlauben] { display: inline; }
:root[data-hinweise="granted"] [data-hinweise-zeige="granted"], :root[data-hinweise="denied"] [data-hinweise-zeige="denied"],
:root[data-hinweise="nein"] [data-hinweise-zeige="nein"] { display: inline; }

.tabbar { display: none; }

/* Handy */
@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .seitenleiste { display: none; }
  main { padding: 16px 16px 96px; }
  .kopf { margin-bottom: 20px; }
  .suche kbd { display: none; }
  h1 { font-size: 28px; }
  .seitenkopf { flex-direction: column; align-items: flex-start; }
  .raster { grid-template-columns: 1fr 1fr; gap: 12px; }
  .kennzahl .n { font-size: 28px; }
  .zwei, .felder { grid-template-columns: minmax(0, 1fr); }
  .zeile { grid-template-columns: minmax(0, 1fr) auto; padding: 14px 16px; }
  .zeile .weg { display: none; }
  .pfeil { display: none; }
  .tabbar { display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-top: 1px solid var(--line); justify-content: space-around; padding: 8px 0 22px; z-index: 30; }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--text-3); font-weight: 500; }
  .tabbar a.active { color: var(--accent); }
  .tabbar a { position: relative; }
  .tabbar .zahl { position: absolute; top: -4px; left: calc(50% + 6px); margin: 0; font-size: 11px; padding: 0 6px; }
  .zeile.anfrage { grid-template-columns: minmax(0, 1fr); }
  .zeile.anfrage .aktionen { justify-content: flex-start; padding-left: 18px; }
  .tabbar svg.symbol { width: 24px; height: 24px; }
  .toast { bottom: 92px; }
}
