/* Orcaboard Live-Demo.
   Self-contained on purpose: it mirrors the real Orcaboard app, not the marketing
   site, so it loads none of styles.css. Fonts are the same self-hosted files. */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/inter-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/inter-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/inter-500-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/inter-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/inter-600-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/inter-600-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/inter-700-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/inter-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/jetbrains-mono-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/jetbrains-mono-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/jetbrains-mono-500-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/jetbrains-mono-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ============ TOKENS (sampled from the Orcaboard app) ============ */
:root {
  --bg: #F7F9FA;
  --weiss: #FFFFFF;
  --linie: #E8ECEE;
  --rand: #DADEE2;
  --rand-stark: #B9C2CA;
  --text: #051C30;
  --text-wert: #0B2135;
  --grau: #4D5D6D;
  --grau-hell: #697C95;
  --primaer: #1C1D79;
  --primaer-hover: #141560;
  --primaer-hell: #E8E9F7;
  --eis: #A5D8E6;       /* the ice blue of the website */
  --eis-rand: #8CC9DB;
  --eis-tinte: #062A3F; /* ink on ice, as on the website */
  --eis-tinte-2: #24485E;
  --link: #303185;
  --gruen: #00B03C;
  --gruen-hover: #009C35;
  --gruen-dunkel: #00862E;
  --gruen-flaeche: #DEF2E7;
  --gruen-zeile: #E3F5EA;
  --gruen-rand: #B9E7CA;
  --rot: #DC3B3B;         /* special cases: the agent stopped, a person decides */
  --rot-dunkel: #B12A2A;
  --rot-flaeche: #FDEEEE;
  --rot-rand: #F4C9C9;
  --rot-zeile: #FCEDED;
  --vorgemerkt: #D97A00;
  --ki: #B9510C;
  --erp: #5980CC;
  --trichter: rgba(5, 28, 48, 0.06);

  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --ease: cubic-bezier(.4, 0, .2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --schatten-karte: 0 1px 2px rgba(5, 28, 48, 0.05), 0 6px 18px rgba(5, 28, 48, 0.06);
  --schatten-drawer: -18px 0 48px rgba(5, 28, 48, 0.10), 0 0 0 1px rgba(5, 28, 48, 0.07);

  --topbar-h: 56px;
  --fuss-h: 32px;      /* footer with Impressum and Datenschutz; fixed panels end above it */
  --postfach-w: clamp(280px, 25vw, 480px);
  --spalte-w: 250px;   /* set by orcaboard.js from the board width */
  --drawer-w: 760px;   /* set by orcaboard.js: whatever is left beside the open card */
  --genie-w: clamp(320px, 26vw, 440px);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  display: grid;
  grid-template-rows: var(--topbar-h) minmax(0, 1fr) var(--fuss-h);
  grid-template-columns: minmax(0, 1fr); /* never wider than the window */
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, p, ol, ul { margin: 0; }
button, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.mono { font-family: var(--mono); font-size: 0.92em; letter-spacing: -0.01em; }

/* ============ ICONS ============ */
.ic {
  width: 16px; height: 16px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.ic-voll { fill: currentColor; stroke: none; }
.ic-genie { width: 20px; height: 20px; }

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px;
  border: 1px solid var(--rand); border-radius: 6px;
  background: var(--weiss); color: var(--text);
  font-size: 13.5px; font-weight: 500; white-space: nowrap;
  cursor: pointer;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), transform .15s var(--ease), box-shadow .15s var(--ease);
}
.btn:hover { border-color: var(--rand-stark); background: #FBFCFD; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .karte:focus-visible, .mail-eintrag:focus-visible, .neu-kachel:focus-visible,
.link-btn:focus-visible, .zuruecksetzen:focus-visible, .schliessen:focus-visible, .tab:focus-visible,
summary:focus-visible, select:focus-visible {
  outline: 2px solid var(--primaer); outline-offset: 2px;
}
.btn[disabled] { opacity: .5; cursor: default; transform: none; }
.btn-primaer { background: var(--primaer); border-color: var(--primaer); color: #fff; }
.btn-primaer:hover { background: var(--primaer-hover); border-color: var(--primaer-hover); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--grau); }
.btn-ghost:hover { background: var(--linie); border-color: transparent; color: var(--text); }
.btn-gross { height: 42px; padding: 0 16px; font-size: 14px; }
.btn-klein { height: 30px; padding: 0 11px; font-size: 12.5px; gap: 6px; }
.btn-mini { height: 26px; padding: 0 10px; font-size: 12px; border-radius: 5px; }
.btn-gruen {
  height: 42px; padding: 0 18px;
  background: var(--gruen); border-color: var(--gruen); color: #fff;
  font-size: 15px; font-weight: 600;
}
.btn-gruen:hover { background: var(--gruen-hover); border-color: var(--gruen-hover); }
.btn-gruen[disabled] { opacity: 1; background: #8FD9A8; border-color: #8FD9A8; }
.btn-gruen.gesperrt[disabled] { background: #C3CBD3; border-color: #C3CBD3; } /* a special case: nothing to release */

/* ============ TOP BAR ============ */
.topbar {
  position: relative; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  padding: 0 14px 0 18px;
  background: var(--bg);
  border-bottom: 1px solid var(--linie);
}
.topbar-logo { display: block; border-radius: 4px; }
.topbar-logo img { display: block; height: 38px; width: auto; }
.topbar-mandant {
  padding-left: 14px; border-left: 1px solid var(--rand);
  color: var(--grau); font-size: 13.5px; line-height: 20px;
}
.topbar-prozess {
  padding: 6px 12px; border-radius: 6px;
  background: var(--linie); font-size: 13px; font-weight: 600; white-space: nowrap;
}
.topbar-aktionen { margin-left: auto; display: flex; align-items: center; gap: 6px; }
/* the way to a meeting stays on the radar: a calm halo breathes out of the button */
.btn-termin { animation: termin-puls 2.6s var(--ease-out) infinite; }
@keyframes termin-puls {
  0% { box-shadow: 0 0 0 0 rgba(28, 29, 121, .42); }
  70%, 100% { box-shadow: 0 0 0 10px rgba(28, 29, 121, 0); }
}

/* ============ LAYOUT ============ */
.ansicht-tabs { display: none; }
.app {
  display: grid;
  grid-template-columns: var(--postfach-w) minmax(0, 1fr);
  min-height: 0;
}

/* ============ INBOX (provisional design) ============ */
.postfach {
  display: flex; flex-direction: column; min-height: 0;
  background: var(--weiss);
  border-right: 1px solid var(--linie);
}
.postfach-kopf { display: flex; align-items: center; gap: 10px; padding: 22px 20px 2px; }
.postfach-kopf h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.zaehler {
  padding: 2px 8px; border-radius: 999px;
  background: var(--primaer-hell); color: var(--primaer);
  font-size: 11.5px; font-weight: 600;
}
.zaehler:empty { display: none; }
.postfach-ordner { padding: 2px 20px 12px; color: var(--grau-hell); font-size: 12.5px; }
.postfach-liste {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 0 10px 12px;
  border-top: 1px solid var(--linie);
}
.postfach-liste[hidden], .postfach-lesen[hidden] { display: none; }
/* one mail: the row opens it, its own button turns it into an order */
.mail-posten { position: relative; margin-top: 6px; border-radius: 8px; transition: background-color .15s var(--ease); }
.mail-posten:hover { background: var(--bg); }
.mail-posten.aktiv { background: var(--linie); }
.mail-eintrag {
  display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px;
  width: 100%; padding: 12px 12px 54px 10px; /* room for "Auftrag anlegen" below */
  border: 0; border-radius: 8px; background: transparent;
  text-align: left; cursor: pointer;
}
.mail-umwandeln { position: absolute; left: 58px; bottom: 14px; border-color: #C8CAEB; color: var(--primaer); }
.mail-umwandeln:hover { border-color: var(--primaer); background: var(--primaer-hell); }
.mail-umwandeln .ic { width: 14px; height: 14px; stroke-width: 2.2; }
.avatar {
  display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--primaer-hell); color: var(--primaer);
  font-size: 12px; font-weight: 600; letter-spacing: .02em;
}
.mail-inhalt { display: grid; gap: 2px; min-width: 0; }
.mail-zeile1 { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.mail-name { font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-zeit { flex: none; font-family: var(--mono); font-size: 11px; color: var(--grau-hell); }
.mail-betreff { font-size: 13px; color: var(--text-wert); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-vorschau {
  font-size: 12.5px; color: var(--grau-hell); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mail-posten.ungelesen .mail-name, .mail-posten.ungelesen .mail-betreff { font-weight: 600; color: var(--text); }
.mail-posten.ungelesen::before {
  content: ''; position: absolute; left: 3px; top: 26px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--primaer); pointer-events: none;
}
/* all mails turned into orders */
.postfach-leer { display: grid; justify-items: center; gap: 6px; padding: 56px 24px; text-align: center; animation: einblenden .45s var(--ease-out) both; }
.postfach-leer-icon {
  display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 6px;
  border-radius: 50%; background: var(--gruen-flaeche); color: var(--gruen-dunkel);
}
.postfach-leer-icon .ic { width: 20px; height: 20px; stroke-width: 2.2; }
.postfach-leer-titel { color: var(--text); font-size: 14px; font-weight: 600; }
.postfach-leer-text { max-width: 250px; color: var(--grau); font-size: 12.5px; line-height: 1.5; }

.postfach-lesen { flex: 1; min-height: 0; display: flex; flex-direction: column; border-top: 1px solid var(--linie); }
.lesen-kopf { padding: 12px 20px 14px; border-bottom: 1px solid var(--linie); }
.lesen-zurueck { margin-left: -10px; }
.lesen-betreff { margin: 10px 0 12px; font-size: 18px; font-weight: 700; letter-spacing: -0.015em; line-height: 1.3; outline: none; }
.lesen-absender { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; align-items: center; }
.lesen-von { font-size: 13px; min-width: 0; }
.lesen-von strong { font-weight: 600; }
.lesen-adresse { color: var(--grau); overflow-wrap: anywhere; }
.lesen-datum { font-family: var(--mono); font-size: 11px; color: var(--grau-hell); margin-top: 2px; }
.lesen-text {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 16px 20px 20px;
  font-size: 13.5px; line-height: 1.6; color: var(--text-wert);
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.lesen-fuss { display: grid; gap: 8px; padding: 14px 20px 16px; border-top: 1px solid var(--linie); }
.lesen-fuss .btn { width: 100%; }
.postfach-hinweis {
  display: flex; align-items: center;
  padding: 14px 20px;
  border-top: 1px solid var(--linie); color: var(--grau-hell); font-size: 11.5px;
}

/* ============ FOOTER ============ */
.fusszeile {
  position: relative; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 10px 0 18px;
  background: var(--bg);
  border-top: 1px solid var(--linie);
  color: var(--grau); font-size: 12px; white-space: nowrap;
}
.fusszeile-links { display: flex; gap: 2px; }
.fusszeile-links a {
  display: inline-flex; align-items: center; height: 26px; padding: 0 8px; border-radius: 6px;
  transition: color .15s var(--ease), background-color .15s var(--ease);
}
.fusszeile-links a:hover { background: var(--linie); color: var(--text); }
.fusszeile-links a:focus-visible { outline: 2px solid var(--primaer); outline-offset: 1px; }

/* ============ BOARD ============ */
.board { position: relative; min-width: 0; overflow: auto; padding: 26px 24px 96px; } /* room for the floating buttons */
.board-kopf {
  position: sticky; left: 0;
  max-width: calc(100vw - var(--postfach-w) - 48px);
  margin-bottom: 26px;
}
.board-kopf h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.1; }

.spalten {
  display: grid; grid-auto-flow: column; grid-auto-columns: var(--spalte-w);
  gap: 16px; align-items: start; width: max-content;
}
.board.mit-drawer .spalten { padding-right: calc(var(--drawer-w) + 16px); }
.spalte-kopf { display: flex; align-items: baseline; gap: 8px; padding: 0 2px 12px; }
.spalte-kopf h2 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.spalte-nr { font-family: var(--mono); font-size: 11px; color: var(--grau-hell); }
.spalte-icon { align-self: center; width: 15px; height: 15px; color: var(--erp); }
.spalte-karten { display: grid; gap: 10px; }
.spalte-karten:empty { display: none; }
.spalte-leer { padding: 18px 0 10px; text-align: center; font-size: 12px; font-style: italic; color: var(--grau-hell); }
.spalte-leer[hidden] { display: none; }

.karte {
  position: relative; display: block; width: 100%;
  padding: 14px 16px 15px;
  border: 1px solid var(--rand); border-radius: 10px;
  background: var(--weiss); text-align: left; cursor: pointer;
  overflow: hidden;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.karte:hover { border-color: var(--rand-stark); box-shadow: var(--schatten-karte); }
.karte.ausgewaehlt { border-color: var(--text); box-shadow: 0 0 0 1px var(--text), var(--schatten-karte); }
.karte > span { display: block; }
.karte-titel { padding-right: 24px; font-size: 14.5px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.karte-meta { margin-top: 8px; color: #4D6075; font-size: 12px; line-height: 1.65; }
.karte-meta > span { display: block; }
.karte-erp-nr { font-family: var(--mono); font-size: 12px; color: var(--text); }
.karte-status { position: absolute; top: 15px; right: 14px; }
.punkt { display: block; width: 11px; height: 11px; border-radius: 50%; background: var(--gruen); box-shadow: 0 0 0 3px #CFEFDA; }
.erp-haken {
  display: grid; place-items: center; width: 18px; height: 18px; margin: -3px -3px 0 0;
  border-radius: 50%; background: var(--gruen); color: #fff;
}
.erp-haken .ic { width: 12px; height: 12px; stroke-width: 2.6; }
.karte-arbeit {
  display: flex !important; align-items: center; gap: 7px;
  margin-top: 10px; color: var(--primaer); font-size: 12px; font-weight: 500;
}
.karte-arbeit span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* a special case: the dot turns red and blinks until someone looks */
.punkt.problem { background: var(--rot); box-shadow: 0 0 0 3px rgba(220, 59, 59, .2); animation: problem-blinken 1.4s ease-in-out infinite; }
@keyframes problem-blinken {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 3px rgba(220, 59, 59, .22); }
  50% { opacity: .35; box-shadow: 0 0 0 7px rgba(220, 59, 59, 0); }
}
.karte-problem { margin-top: 8px; color: var(--rot-dunkel); font-size: 12px; font-weight: 600; }
.karte-balken {
  position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: var(--primaer); transform-origin: left center;
  animation-name: fuellen; animation-timing-function: linear; animation-fill-mode: both;
}
@keyframes fuellen { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.karte.frisch { animation: bereit 1.4s var(--ease-out); }
@keyframes bereit {
  0% { box-shadow: 0 0 0 0 rgba(0, 176, 60, 0.45); }
  100% { box-shadow: 0 0 0 10px rgba(0, 176, 60, 0); }
}
.karte.ausgewaehlt.frisch { animation: none; }

.spinner {
  display: inline-block; width: 13px; height: 13px; flex: none;
  border: 2px solid var(--primaer-hell); border-top-color: var(--primaer);
  border-radius: 50%; animation: drehen .8s linear infinite;
}
.spinner-gross { width: 18px; height: 18px; }
.btn-gruen .spinner { border-color: rgba(255, 255, 255, .45); border-top-color: #fff; }
@keyframes drehen { to { transform: rotate(360deg); } }

.neu-kachel {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  width: 100%; margin-top: 10px; padding: 18px 12px;
  border: 1.5px dashed var(--rand); border-radius: 10px;
  background: transparent; color: var(--grau); font-size: 13px; cursor: pointer;
  transition: border-color .15s var(--ease), color .15s var(--ease), background-color .15s var(--ease);
}
.neu-kachel:hover { border-color: var(--rand-stark); color: var(--text); background: var(--weiss); }

/* ============ FUNNEL ============ */
.trichter {
  position: fixed; inset: 0; z-index: 15;
  background: var(--trichter);
  clip-path: polygon(0 0, 0 0, 0 0, 0 0);
  opacity: 0; pointer-events: none;
  transition: opacity .25s var(--ease);
}
.trichter.sichtbar { opacity: 1; }
.trichter.deckend { clip-path: none; background: rgba(5, 28, 48, 0.12); }

/* ============ DETAIL PANEL ============ */
.drawer {
  position: fixed; z-index: 20;
  top: calc(var(--topbar-h) + 8px); right: 8px; bottom: calc(var(--fuss-h) + 8px);
  width: var(--drawer-w);
  display: flex; flex-direction: column;
  background: var(--weiss); border-radius: 12px;
  box-shadow: var(--schatten-drawer);
  container-type: inline-size;
  transform: translateX(calc(100% + 32px));
  visibility: hidden;
  transition: transform .5s var(--ease-out), visibility 0s linear .5s;
}
.drawer.offen { transform: none; visibility: visible; transition: transform .5s var(--ease-out), visibility 0s; }

.drawer-kopf { position: relative; padding: 22px 28px 0; }
.drawer-eyebrow { color: #556574; font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
.drawer-titel { margin: 6px 0 4px; padding-right: 200px; font-size: 28px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; outline: none; }
.drawer-aktualisiert { color: var(--grau); font-size: 12px; }
.drawer-aktionen { position: absolute; top: 16px; right: 16px; display: flex; align-items: center; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 8px; border-radius: 4px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
}
.chip-bereit, .chip-erp { background: var(--gruen-flaeche); color: var(--gruen-dunkel); }
.chip-arbeit { background: var(--primaer-hell); color: var(--primaer); }
.chip-arbeit .spinner { width: 10px; height: 10px; border-width: 1.5px; }
.chip-problem { background: var(--rot-flaeche); color: var(--rot-dunkel); }
.schliessen {
  display: grid; place-items: center; width: 32px; height: 32px;
  border: 0; border-radius: 6px; background: transparent; color: var(--grau); cursor: pointer;
  transition: background-color .15s var(--ease), color .15s var(--ease);
}
.schliessen:hover { background: var(--linie); color: var(--text); }
.schliessen .ic { width: 18px; height: 18px; }

.fortschritt { display: flex; gap: 2px; margin-top: 18px; padding: 0; list-style: none; }
.fortschritt-schritt {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 12px 0 18px;
  background: var(--linie); color: #485969;
  font-size: 11.5px; white-space: nowrap; overflow: hidden;
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 0 100%, 9px 50%);
}
.fortschritt-schritt:first-child { padding-left: 10px; border-radius: 3px 0 0 3px; clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 0 100%); }
.fortschritt-schritt:last-child { border-radius: 0 3px 3px 0; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 9px 50%); }
.fortschritt-schritt .nr { flex: none; font-family: var(--mono); font-size: 10.5px; opacity: .85; }
.fortschritt-schritt span { overflow: hidden; text-overflow: ellipsis; }
.fortschritt-schritt.aktiv { background: var(--primaer); color: #fff; font-weight: 600; }
.fortschritt-schritt.erledigt { color: var(--primaer); }
.fortschritt-schritt.erledigt .ic { width: 13px; height: 13px; stroke-width: 2.4; }
.fortschritt-schritt.laeuft {
  background-image: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, .22) 50%, transparent 80%);
  background-size: 200% 100%;
  animation: schimmer 1.4s linear infinite;
}
@keyframes schimmer { from { background-position: 150% 0; } to { background-position: -50% 0; } }
.drawer-trenner { height: 1px; margin-top: 18px; background: var(--linie); }

.drawer-inhalt { flex: 1; min-height: 0; overflow-y: auto; padding: 22px 28px 28px; }
.drawer-inhalt > * { animation: einblenden .45s var(--ease-out) both; }
.drawer-inhalt > :nth-child(2) { animation-delay: .05s; }
.drawer-inhalt > :nth-child(3) { animation-delay: .1s; }
.drawer-inhalt > :nth-child(4) { animation-delay: .15s; }
@keyframes einblenden { from { opacity: 0; transform: translateY(6px); } }

.drawer-fuss { display: grid; gap: 10px; padding: 12px 28px 16px; border-top: 1px solid var(--linie); }
.fuss-zeile { display: flex; gap: 10px; }
.fuss-zeile .btn-gruen { flex: 1; }
.fuss-ende { align-items: center; justify-content: space-between; flex-wrap: wrap; }
.fertig-text { color: var(--grau); font-size: 13px; }
.zuruecksetzen {
  justify-self: start; display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 0; border: 0; background: none; cursor: pointer;
  color: #354858; font-size: 12.5px;
}
.zuruecksetzen:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.zuruecksetzen .ic { width: 14px; height: 14px; }

/* sections */
.abschnitt + .abschnitt, .abschnitt + .validiert, .erfolg + .abschnitt { margin-top: 30px; }
.abschnitt-label {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-bottom: 4px; color: var(--grau);
  font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
}
.legende { display: inline-flex; gap: 14px; color: var(--grau-hell); font-size: 11px; font-weight: 400; letter-spacing: 0; text-transform: none; }
.legende span { display: inline-flex; align-items: center; gap: 4px; }
.abschnitt-titel { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.abschnitt-titel h3 { font-size: 19px; font-weight: 600; letter-spacing: -0.015em; }
.unter-titel { margin: 22px 0 10px; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 8px; border-radius: 4px;
  background: var(--linie); color: #334556;
  font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
}
.tag::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

/* source mail */
.mailkarte { padding: 14px 16px 10px; border: 1px solid var(--rand); border-radius: 8px; background: var(--weiss); }
.mailkarte-kopf { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.mailkarte-betreff { display: inline-flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 600; min-width: 0; }
.mailkarte-betreff .ic { width: 15px; height: 15px; color: var(--grau); }
.mailkarte-datum { flex: none; font-family: var(--mono); font-size: 11px; color: var(--grau); }
.mailkarte-von { margin: 4px 0 10px; color: var(--grau); font-size: 12px; overflow-wrap: anywhere; }
.mailkarte-text {
  position: relative; max-height: 8.2em; overflow: hidden;
  color: var(--text-wert); font-size: 13.5px; line-height: 1.6;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.mailkarte-text::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2.4em;
  background: linear-gradient(rgba(255, 255, 255, 0), #fff);
}
.mailkarte-text.offen { max-height: none; }
.mailkarte-text.offen::after { display: none; }
.link-btn { padding: 6px 0 2px; border: 0; background: none; color: var(--link); font-size: 12px; font-weight: 500; cursor: pointer; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
.mail-aktionen { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; }

/* field boxes */
.boxen { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.box { position: relative; padding: 14px 16px 16px; border: 1px solid var(--rand); border-radius: 8px; }
.box h4 { margin-bottom: 12px; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.box.neu { border-color: var(--gruen-rand); background: linear-gradient(180deg, #F2FBF5, #FFFFFF 70%); }
.box.neu::before {
  /* the agent's trail: a dotted line that runs along the top edge once */
  content: ''; position: absolute; left: 12px; top: -1px; height: 2px; width: 0;
  background: radial-gradient(circle, var(--gruen) 45%, transparent 50%) 0 0 / 9px 2px repeat-x;
  animation: spur 1.1s var(--ease-out) .15s forwards;
}
@keyframes spur {
  0% { width: 0; opacity: 1; }
  70% { width: calc(100% - 24px); opacity: 1; }
  100% { width: calc(100% - 24px); opacity: 0; }
}
.felder { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.feld { min-width: 0; }
.feld.breit { grid-column: 1 / -1; }
.feld-label { margin-bottom: 3px; color: var(--grau); font-size: 11.5px; }
.feld-wert { display: flex; align-items: flex-start; gap: 6px; color: var(--text-wert); font-size: 13.5px; overflow-wrap: anywhere; }
.feld-wert.offen { color: var(--grau-hell); font-style: italic; }
.quelle { display: inline-flex; flex: none; margin-top: 3px; }
.quelle .ic { width: 13px; height: 13px; }
.quelle-ki { color: var(--ki); }
/* the AI marker as a button: a round hover target that takes no more room than the icon */
button.quelle-ki {
  display: inline-grid; place-items: center; width: 21px; height: 21px; margin: -1px -4px -4px; padding: 0;
  border: 0; border-radius: 50%; background: transparent; cursor: help;
  transition: background-color .15s var(--ease);
}
td button.quelle-ki { margin: -4px; }
button.quelle-ki:hover, button.quelle-ki.aktiv { background: rgba(185, 81, 12, 0.13); }
button.quelle-ki:focus-visible { outline: 2px solid var(--primaer); outline-offset: 1px; }
.quelle-erp { color: var(--erp); }
.quelle-offen { color: var(--grau-hell); }

/* tables */
.tabelle-wrap { overflow-x: auto; border: 1px solid var(--rand); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  padding: 9px 12px; border-bottom: 1px solid var(--rand);
  background: var(--bg); color: var(--grau);
  font-size: 11.5px; font-weight: 500; text-align: left; white-space: nowrap;
}
td { padding: 9px 12px; border-bottom: 1px solid var(--linie); vertical-align: middle; color: var(--text-wert); }
tbody tr:last-child td { border-bottom: 0; }
tr.neu td { background: var(--gruen-zeile); }
tbody tr.neu + tr.neu td { border-top: 1px solid rgba(255, 255, 255, .7); }
.zahl { text-align: right; white-space: nowrap; }
td .wert { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
td .quelle { margin-top: 0; }
.zelle-sub { display: block; margin-top: 2px; color: var(--grau); font-size: 11.5px; line-height: 1.35; white-space: normal; }
.status-ok {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  background: rgba(0, 176, 60, .14); color: var(--gruen-dunkel);
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.status-vorgemerkt { color: var(--vorgemerkt); font-size: 12px; font-weight: 600; }
tr.problem td { background: var(--rot-zeile); }
.status-fehlt {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  background: rgba(220, 59, 59, .13); color: var(--rot-dunkel);
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.kein-treffer { color: var(--rot-dunkel); font-size: 13px; font-weight: 600; }
tfoot td { border-top: 1px solid var(--rand); border-bottom: 0; background: var(--bg); font-weight: 600; }

/* already validated data */
.validiert > summary {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 0; list-style: none; cursor: pointer;
  color: var(--grau); font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
}
.validiert > summary::-webkit-details-marker { display: none; }
.validiert > summary .ic { width: 14px; height: 14px; transform: rotate(-90deg); transition: transform .2s var(--ease); }
.validiert[open] > summary .ic { transform: none; }
.validiert-inhalt { margin-top: 14px; }

/* agent at work */
.arbeit { display: grid; gap: 16px; padding: 22px 22px 20px; border: 1px solid var(--rand); border-radius: 10px; }
.arbeit-kopf { display: flex; align-items: center; gap: 12px; font-size: 16px; font-weight: 600; }
.arbeit-liste { display: grid; gap: 10px; padding: 0; list-style: none; }
.arbeit-liste li {
  display: flex; align-items: center; gap: 10px;
  color: var(--text-wert); font-size: 13.5px;
  transition: opacity .35s var(--ease-out), transform .35s var(--ease-out);
}
.arbeit-liste li.wartet { opacity: 0; transform: translateY(4px); }
.arbeit-liste .ic { width: 16px; height: 16px; color: var(--gruen); stroke-width: 2.4; }
.arbeit-liste li.laeuft .ic { display: none; }
.arbeit-liste li:not(.laeuft) .spinner { display: none; }
.skelett { display: grid; gap: 10px; margin-top: 4px; }
.skelett span {
  height: 12px; border-radius: 4px;
  background: linear-gradient(90deg, var(--linie) 25%, #F3F5F7 50%, var(--linie) 75%) 0 0 / 200% 100%;
  animation: schimmer 1.6s linear infinite;
}
.skelett span:nth-child(1) { width: 92%; }
.skelett span:nth-child(2) { width: 76%; }
.skelett span:nth-child(3) { width: 84%; }

/* order created in the ERP */
.erfolg {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; border: 1px solid var(--gruen-rand); border-radius: 10px;
  background: var(--gruen-flaeche);
}
.erfolg-icon {
  display: grid; place-items: center; flex: none;
  width: 34px; height: 34px; border-radius: 50%; background: var(--gruen); color: #fff;
}
.erfolg-icon .ic { width: 18px; height: 18px; stroke-width: 2.6; }
.erfolg strong { display: block; font-size: 15px; font-weight: 600; }
.erfolg div > span { color: var(--grau); font-size: 12.5px; }

/* a special case, on top of the panel */
.sonderfall {
  display: flex; align-items: center; flex-wrap: wrap; gap: 12px 14px;
  margin-bottom: 30px; padding: 14px 16px 14px 18px;
  border: 1px solid var(--rot-rand); border-radius: 10px; background: var(--rot-flaeche);
}
.sonderfall-icon {
  display: grid; place-items: center; flex: none;
  width: 34px; height: 34px; border-radius: 50%; background: var(--rot); color: #fff;
}
.sonderfall-icon .ic { width: 20px; height: 20px; stroke-width: 2.2; }
.sonderfall-text { flex: 1 1 240px; min-width: 0; }
.sonderfall-text strong { display: block; color: var(--rot-dunkel); font-size: 15px; font-weight: 600; }
.sonderfall-text span { color: var(--text-wert); font-size: 12.5px; }
.sonderfall .btn { flex: none; background: var(--weiss); }

/* source mail behind a button (later steps) */
.mail-verweis-zeile { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.mail-verweis-betreff { color: var(--grau); font-size: 12.5px; }
.mail-verweis-inhalt { margin-top: 12px; }
.mail-verweis-inhalt[hidden] { display: none; }
.abschnitt > .mail-verweis > .unter-titel:first-child { margin-top: 0; }

.legende .quelle { margin-top: 0; }

/* the drawer gets narrow on small laptops: stack the field boxes */
@container (max-width: 700px) {
  .boxen { grid-template-columns: minmax(0, 1fr); }
}
@container (max-width: 560px) {
  .drawer-kopf { padding-top: 58px; }
  .drawer-titel { padding-right: 0; }
  .fortschritt-schritt:not(.aktiv) { flex: 0 0 auto; padding-right: 18px; }
  .fortschritt-schritt:not(.aktiv) > span:not(.nr) { display: none; }
  .mailkarte-kopf { flex-direction: column; align-items: flex-start; gap: 2px; }
}

/* ============ ORCA-GENIE ============ */
/* bottom left of the dashboard, its left edge on the line of the "Dashboard" heading */
.genie-knopf {
  position: fixed; z-index: 18; left: calc(var(--postfach-w) + 24px); bottom: calc(var(--fuss-h) + 16px);
  display: grid; place-items: center; width: 58px; height: 58px; padding: 0;
  border: 2px solid #CFE7F2; border-radius: 50%; background: var(--weiss);
  box-shadow: 0 6px 18px rgba(5, 28, 48, 0.16); cursor: pointer;
  transition: left .4s var(--ease-out), border-color .15s var(--ease), box-shadow .15s var(--ease), transform .15s var(--ease);
}
.genie-knopf:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(5, 28, 48, 0.2); }
.genie-knopf:active { transform: none; }
.genie-knopf:focus-visible, .genie-zu:focus-visible { outline: 2px solid var(--primaer); outline-offset: 2px; }
.genie-bild { display: block; object-fit: contain; }
.genie-knopf .genie-bild { width: 44px; height: 44px; }
/* open: where the window would cover it, the button steps right, beside the window */
body.genie-offen .genie-knopf {
  z-index: 46; left: max(calc(var(--postfach-w) + 24px), calc(var(--genie-w) + 22px)); border-color: var(--primaer);
}

/* the speech bubble: in the Genie's own chat colours, its tail on the button.
   Never wider than the strip beside an open detail panel, so the two never meet */
.genie-blase {
  position: fixed; z-index: 19; left: calc(var(--postfach-w) + 24px); bottom: calc(var(--fuss-h) + 88px);
  width: min(280px, calc(var(--spalte-w) + 40px));
  border: 1px solid #C3DCF0; border-radius: 12px; background: #EEF6FC;
  box-shadow: 0 16px 40px rgba(5, 28, 48, 0.16), 0 2px 6px rgba(5, 28, 48, 0.06);
  opacity: 0; transform: translateY(8px) scale(.96); transform-origin: 29px 100%; visibility: hidden;
  transition: opacity .2s var(--ease), transform .2s var(--ease), border-color .15s var(--ease), visibility 0s linear .2s;
}
.genie-blase.sichtbar {
  opacity: 1; transform: none; visibility: visible;
  transition: opacity .3s var(--ease), transform .5s var(--ease-out), border-color .15s var(--ease), visibility 0s;
}
.genie-blase:hover { border-color: #96C3E6; }
.genie-blase:hover .genie-blase-pfeil { border-right-color: #96C3E6; border-bottom-color: #96C3E6; }
.genie-blase-text {
  display: block; width: 100%; padding: 12px 15px 13px; border: 0; border-radius: 12px;
  background: transparent; color: var(--text-wert); font-size: 13.5px; line-height: 1.5; text-align: left; cursor: pointer;
}
.genie-blase-name { display: block; margin-bottom: 2px; padding-right: 26px; color: var(--eis-tinte); font-size: 13px; font-weight: 700; }
.genie-blase-nachricht { display: block; }
.am-stueck { white-space: nowrap; } /* "Live-Betrieb" never breaks at its hyphen */
.genie-blase-zu {
  position: absolute; top: 7px; right: 7px; display: grid; place-items: center; width: 26px; height: 26px; padding: 0;
  border: 0; border-radius: 6px; background: transparent; color: var(--grau); cursor: pointer;
  transition: background-color .15s var(--ease), color .15s var(--ease);
}
.genie-blase-zu:hover { background: rgba(255, 255, 255, 0.8); color: var(--text); }
.genie-blase-zu .ic { width: 14px; height: 14px; }
.genie-blase-text:focus-visible, .genie-blase-zu:focus-visible { outline: 2px solid var(--primaer); outline-offset: 2px; }
.genie-blase-pfeil {
  position: absolute; left: 23px; bottom: -7px; width: 12px; height: 12px;
  border: 1px solid #C3DCF0; border-top-color: transparent; border-left-color: transparent;
  background: #EEF6FC; transform: rotate(45deg); transition: border-color .15s var(--ease);
}
/* while the bubble speaks, the button calls in ice blue */
.genie-knopf.ruft { border-color: var(--eis-rand); animation: genie-ruft 2s var(--ease-out) infinite; }
@keyframes genie-ruft {
  0% { box-shadow: 0 6px 18px rgba(5, 28, 48, 0.16), 0 0 0 0 rgba(165, 216, 230, 0.95); }
  70%, 100% { box-shadow: 0 6px 18px rgba(5, 28, 48, 0.16), 0 0 0 12px rgba(165, 216, 230, 0); }
}

.genie {
  position: fixed; z-index: 45;
  top: calc(var(--topbar-h) + 8px); left: 8px; bottom: calc(var(--fuss-h) + 8px); width: var(--genie-w);
  display: flex; flex-direction: column;
  border: 1px solid var(--rand); border-radius: 14px; background: var(--weiss);
  box-shadow: 0 18px 48px rgba(5, 28, 48, 0.16);
  opacity: 0; transform: translateY(12px) scale(.98); transform-origin: left bottom;
  visibility: hidden;
  transition: opacity .25s var(--ease), transform .4s var(--ease-out), visibility 0s linear .4s;
}
.genie.offen { opacity: 1; transform: none; visibility: visible; transition: opacity .25s var(--ease), transform .4s var(--ease-out), visibility 0s; }
.genie-kopf { display: flex; align-items: center; gap: 12px; padding: 16px 16px 16px 18px; border-bottom: 1px solid var(--linie); }
.genie-avatar {
  display: grid; place-items: center; flex: none; width: 46px; height: 46px;
  border: 2px solid #CFE7F2; border-radius: 50%; background: var(--weiss);
}
.genie-avatar .genie-bild { width: 34px; height: 34px; }
.genie-name { flex: 1; min-width: 0; }
.genie-name h2 { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; outline: none; }
.genie-status { display: flex; align-items: center; gap: 6px; margin-top: 2px; color: var(--grau); font-size: 12.5px; }
.genie-punkt { width: 8px; height: 8px; border-radius: 50%; background: #AEB8C2; }
.genie-zu {
  display: grid; place-items: center; flex: none; width: 38px; height: 38px;
  border: 1.5px solid var(--rand); border-radius: 8px; background: var(--weiss); color: var(--text); cursor: pointer;
  transition: border-color .15s var(--ease);
}
.genie-zu:hover { border-color: var(--primaer); }
.genie-verlauf { flex: 1; min-height: 0; overflow-y: auto; display: grid; align-content: start; gap: 12px; padding: 20px 18px; }
.genie-nachricht, .genie-tippen {
  justify-self: start; padding: 14px 16px;
  border: 1px solid #C3DCF0; border-radius: 4px 12px 12px 12px; background: #EEF6FC;
}
.genie-nachricht { color: var(--text-wert); font-size: 14px; line-height: 1.6; animation: einblenden .45s var(--ease-out) both; }
.genie-tippen { display: none; gap: 5px; }
.genie-verlauf.tippt .genie-tippen { display: inline-flex; }
.genie-nachricht.wartet { display: none; }
/* what the Genie says about a special case, with the way to a meeting */
.genie-fall p { margin-bottom: 12px; }
.genie-fall-kunde { display: block; margin-bottom: 4px; color: var(--rot-dunkel); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.genie-tippen span { width: 6px; height: 6px; border-radius: 50%; background: #7FA6C6; animation: tippen 1s ease-in-out infinite; }
.genie-tippen span:nth-child(2) { animation-delay: .15s; }
.genie-tippen span:nth-child(3) { animation-delay: .3s; }
@keyframes tippen { 0%, 60%, 100% { opacity: .35; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
.genie-eingabe { display: flex; gap: 10px; padding: 14px 16px 16px; border-top: 1px solid var(--linie); }
.genie-eingabe input {
  flex: 1; min-width: 0; height: 44px; padding: 0 14px;
  border: 1px solid var(--rand); border-radius: 8px; background: var(--bg);
  font: inherit; font-size: 14px; cursor: not-allowed;
}
.genie-eingabe input::placeholder { color: var(--grau-hell); }
.genie-senden {
  display: grid; place-items: center; flex: none; width: 44px; height: 44px;
  border: 0; border-radius: 10px; background: #A3AEBA; color: #fff; cursor: not-allowed;
}
.genie-senden .ic { width: 18px; height: 18px; }

/* ============ GUIDED TOUR ============ */
.tour-start {
  position: fixed; z-index: 18; right: 24px; bottom: calc(var(--fuss-h) + 25px); /* centred on the Genie button */
  display: inline-flex; align-items: center; gap: 9px; height: 40px; padding: 0 16px 0 6px;
  border: 1px solid var(--rand); border-radius: 999px; background: var(--weiss); color: var(--text);
  font-size: 13.5px; font-weight: 600; cursor: pointer;
  box-shadow: 0 6px 18px rgba(5, 28, 48, 0.12);
  transition: right .5s var(--ease-out), transform .15s var(--ease), box-shadow .15s var(--ease), background-color .15s var(--ease), border-color .15s var(--ease);
}
/* with a card open beside the board, the button moves left with the panel and stays in sight */
body.panel-daneben .tour-start { right: calc(var(--drawer-w) + 32px); }
.tour-start-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--eis); color: var(--eis-tinte); }
.tour-start-icon .ic { width: 16px; height: 16px; margin-left: 2px; fill: currentColor; stroke: none; }
.tour-start:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(5, 28, 48, 0.16); }
.tour-start:active { transform: none; }
.tour-start:focus-visible { outline: 2px solid var(--primaer); outline-offset: 2px; }
.tour-start[aria-pressed="true"] { background: var(--eis); border-color: var(--eis-rand); color: var(--eis-tinte); }
.tour-start[aria-pressed="true"] .tour-start-icon { background: var(--weiss); }
.tour {
  position: fixed; z-index: 55; left: 0; top: 0;
  width: 300px; max-width: calc(100vw - 20px);
  padding: 13px 16px 14px;
  /* in the ice blue of the website, so it stands out from the white app */
  border: 1px solid var(--eis-rand); border-radius: 12px; background: var(--eis); color: var(--eis-tinte);
  box-shadow: 0 16px 44px rgba(6, 42, 63, 0.26), 0 2px 6px rgba(6, 42, 63, 0.08);
  opacity: 0; visibility: hidden;
  transition: opacity .2s var(--ease), visibility 0s linear .2s;
}
.tour.offen { opacity: 1; visibility: visible; transition: opacity .25s var(--ease), visibility 0s; }
/* while the ORCA-Genie window is open it has the stage: the tour waits and comes back after */
body.genie-offen .tour.offen { opacity: 0; visibility: hidden; transition: opacity .2s var(--ease), visibility 0s linear .2s; }
body.genie-offen .tour-ring.sichtbar { opacity: 0; }
.tour.neu .tour-inhalt { animation: einblenden .4s var(--ease-out) both; }
.tour-kopf { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.tour-zaehler { color: var(--eis-tinte-2); font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.tour-zu {
  display: grid; place-items: center; flex: none; width: 28px; height: 28px; margin: -4px -8px -4px 0;
  border: 0; border-radius: 6px; background: transparent; color: var(--eis-tinte-2); cursor: pointer;
  transition: background-color .15s var(--ease), color .15s var(--ease);
}
.tour-zu:hover { background: rgba(255, 255, 255, 0.45); color: var(--eis-tinte); }
.tour-zu:focus-visible { outline: 2px solid var(--primaer); outline-offset: 1px; }
.tour-titel { margin-bottom: 4px; font-size: 15.5px; font-weight: 600; letter-spacing: -0.01em; outline: none; }
.tour-text { color: var(--eis-tinte); font-size: 13.5px; line-height: 1.55; }
.tour-zusatz {
  display: inline-block; margin-top: 10px; padding: 3px 9px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.6); color: var(--eis-tinte); font-size: 11.5px; font-weight: 600;
}
.tour-fuss { display: flex; align-items: center; justify-content: space-between; min-height: 30px; margin-top: 10px; }
/* back and forward, bottom right; forward does the step, so it carries the weight */
.tour-navigation { display: inline-flex; align-items: center; gap: 6px; }
.tour-nav {
  display: grid; place-items: center; width: 30px; height: 30px; padding: 0;
  border: 1px solid rgba(6, 42, 63, 0.2); border-radius: 8px; background: rgba(255, 255, 255, 0.55); color: var(--eis-tinte);
  cursor: pointer; transition: background-color .15s var(--ease), border-color .15s var(--ease), transform .15s var(--ease), opacity .15s var(--ease);
}
.tour-nav:hover:not([disabled]) { background: var(--weiss); border-color: rgba(6, 42, 63, 0.35); }
.tour-nav:active:not([disabled]) { transform: translateY(1px); }
.tour-nav[disabled] { opacity: .4; cursor: default; }
.tour-nav:focus-visible { outline: 2px solid var(--primaer); outline-offset: 1px; }
.tour-nav .ic { width: 15px; height: 15px; stroke-width: 2.2; }
.tour-nav-vor { border-color: var(--eis-tinte); background: var(--eis-tinte); color: #fff; }
.tour-nav-vor:hover:not([disabled]) { border-color: #0D3C57; background: #0D3C57; }
.tour-punkte { display: inline-flex; align-items: center; gap: 5px; }
.tour-punkte span { width: 6px; height: 6px; border-radius: 3px; background: rgba(6, 42, 63, 0.2); transition: width .3s var(--ease-out), background-color .3s var(--ease); }
.tour-punkte span.erledigt { background: rgba(6, 42, 63, 0.5); }
.tour-punkte span.aktiv { width: 18px; background: var(--eis-tinte); }
/* the arrow: a rotated square showing the two borders that face the target */
.tour-pfeil {
  position: absolute; width: 12px; height: 12px;
  border: 1px solid var(--eis-rand); background: var(--eis); transform: rotate(45deg);
}
.tour:not([data-seite]) .tour-pfeil, .tour[data-seite=""] .tour-pfeil { display: none; }
.tour[data-seite="rechts"] .tour-pfeil { left: -7px; top: calc(var(--pfeil, 24px) - 6px); border-top-color: transparent; border-right-color: transparent; }
.tour[data-seite="links"] .tour-pfeil { right: -7px; top: calc(var(--pfeil, 24px) - 6px); border-bottom-color: transparent; border-left-color: transparent; }
.tour[data-seite="unten"] .tour-pfeil { top: -7px; left: calc(var(--pfeil, 24px) - 6px); border-right-color: transparent; border-bottom-color: transparent; }
.tour[data-seite="oben"] .tour-pfeil { bottom: -7px; left: calc(var(--pfeil, 24px) - 6px); border-top-color: transparent; border-left-color: transparent; }
.tour-ring {
  position: fixed; z-index: 50; left: 0; top: 0; width: 0; height: 0;
  border: 3px solid var(--eis-rand); border-radius: 10px; /* ice blue like the tour card, so the two read as one */
  opacity: 0; pointer-events: none;
  transition: opacity .2s var(--ease);
  animation: ring-puls 1.8s var(--ease-out) infinite;
}
.tour-ring.sichtbar { opacity: 1; }
.tour-ring.ruhig { animation: none; } /* looking back: marks the place, asks for no click */
@keyframes ring-puls {
  0% { box-shadow: 0 0 0 0 rgba(165, 216, 230, 0.95); }
  70%, 100% { box-shadow: 0 0 0 10px rgba(165, 216, 230, 0); }
}

/* ============ WHERE A VALUE COMES FROM ============ */
.herkunft {
  position: fixed; z-index: 48; left: 0; top: 0;
  width: min(400px, calc(100vw - 16px)); max-height: min(460px, calc(100vh - 130px)); overflow-y: auto;
  padding: 16px 18px 14px;
  border: 1px solid var(--rand); border-radius: 12px; background: #F8FAFB;
  box-shadow: 0 18px 48px rgba(5, 28, 48, 0.18), 0 2px 6px rgba(5, 28, 48, 0.06);
  opacity: 0; transform: translateY(4px); visibility: hidden;
  transition: opacity .15s var(--ease), transform .15s var(--ease), visibility 0s linear .15s;
}
.herkunft.offen { opacity: 1; transform: none; visibility: visible; transition: opacity .15s var(--ease), transform .15s var(--ease), visibility 0s; }
.herkunft-quelle { color: var(--grau); font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.herkunft-ki { display: flex; align-items: center; gap: 8px; margin-top: 10px; color: var(--grau); font-size: 13px; }
.herkunft-ki-icon { display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%; background: rgba(185, 81, 12, 0.13); color: var(--ki); }
.herkunft-ki-icon .ic { width: 13px; height: 13px; }
.herkunft-wert { margin-top: 12px; color: var(--text); font-size: 16px; font-weight: 600; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.herkunft-hinweis { margin-top: 2px; color: var(--grau); font-size: 12.5px; }
.herkunft-auszug {
  margin-top: 12px; color: var(--text-wert); font-size: 13px; line-height: 1.6;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.herkunft-auszug mark { padding: 1px 3px; border-radius: 3px; background: #F9D5C5; color: var(--text); }
.herkunft-weg { color: var(--grau-hell); }
.herkunft-fuss { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--rand); color: var(--grau); font-size: 11.5px; line-height: 1.5; }

/* ============ DEMO ACCESS ============ */
/* Until the visitor has left contact details, one layer greys out whatever lies
   behind it: the board stays visible, but colourless and out of reach. It ends
   above the footer, so Impressum and Datenschutz stay reachable. */
.zugang {
  position: fixed; inset: 0 0 var(--fuss-h); z-index: 70;
  display: flex; overflow-y: auto;
  padding: 24px 16px;
  background: rgba(247, 249, 250, 0.5);
  -webkit-backdrop-filter: grayscale(1);
  backdrop-filter: grayscale(1);
  animation: zugang-auf .45s var(--ease) both;
}
.zugang[hidden] { display: none; }
/* on the way out the colour comes back as the layer fades */
.zugang.geht { animation: zugang-zu .4s var(--ease) forwards; pointer-events: none; }
@keyframes zugang-auf { from { opacity: 0; } }
@keyframes zugang-zu { to { opacity: 0; } }
.zugang-karte {
  width: min(440px, 100%);
  margin: auto; /* centred, yet scrollable from the top when taller than the window */
  padding: 28px 28px 22px;
  border: 1px solid var(--rand); border-radius: 16px; background: var(--weiss);
  box-shadow: 0 24px 64px rgba(5, 28, 48, 0.18), 0 2px 8px rgba(5, 28, 48, 0.06);
  animation: einblenden .5s var(--ease-out) .1s both;
}
.zugang-eyebrow { color: var(--primaer); font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.zugang-titel { margin: 6px 0; font-size: 24px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.2; text-wrap: balance; }
.zugang-text { color: var(--grau); font-size: 14px; line-height: 1.55; }
.zugang-form { display: grid; gap: 14px; margin-top: 20px; }
.zugang-feld { display: grid; gap: 6px; }
.zugang-feld label { font-size: 12.5px; font-weight: 500; color: var(--text-wert); }
.zugang-feld input {
  height: 44px; padding: 0 12px;
  border: 1px solid var(--rand-stark); border-radius: 8px; background: var(--weiss);
  font: inherit; font-size: 16px; color: var(--text);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.zugang-feld input:hover { border-color: var(--grau-hell); }
.zugang-feld input:focus { outline: none; border-color: var(--primaer); box-shadow: 0 0 0 3px var(--primaer-hell); }
.zugang-feld input[aria-invalid="true"] { border-color: #C2410C; box-shadow: 0 0 0 3px #FDE7DC; }
/* Flags: Windows has no flag emoji, so this self-hosted font draws them (Twemoji Country
   Flags, MIT; artwork Twemoji, CC BY 4.0, credit in assets/fonts/LICENSE-twemoji-flags.md).
   Only the regional-indicator letters use it, so it is fetched when a flag is first drawn. */
@font-face {
  font-family: 'Flaggen';
  font-display: swap;
  src: url('/assets/fonts/TwemojiCountryFlags.woff2') format('woff2');
  unicode-range: U+1F1E6-1F1FF;
}
/* phone: the country box in front of the number. The real list is the browser's own
   select, laid invisibly over the box, so it opens the way the device expects. */
.zugang-telefon { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; }
.zugang-land { position: relative; display: grid; }
.zugang-land select {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer;
  font-family: 'Flaggen', 'Inter', system-ui, sans-serif;
  font-size: 16px; /* below 16px iOS zooms in on tap */
}
.zugang-land-anzeige {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: 'Flaggen', 'Inter', system-ui, sans-serif;
  height: 44px; padding: 0 12px 0 11px;
  border: 1px solid var(--rand-stark); border-radius: 8px; background: var(--weiss);
  color: var(--text); font-size: 16px; white-space: nowrap; font-variant-numeric: tabular-nums;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.zugang-land-flagge { font-size: 19px; line-height: 1; }
.zugang-land-anzeige::after {
  content: ''; width: 6px; height: 6px; margin: -4px 0 0 3px;
  border: solid var(--grau); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg);
}
.zugang-land:hover .zugang-land-anzeige { border-color: var(--grau-hell); }
.zugang-land select:focus + .zugang-land-anzeige { border-color: var(--primaer); box-shadow: 0 0 0 3px var(--primaer-hell); }
/* what is wrong with a field stands right below it */
.zugang-feld-fehler { color: #B4380B; font-size: 12.5px; line-height: 1.45; animation: einblenden .2s var(--ease-out); }
.zugang-feld-fehler:empty { display: none; }
.zugang-check {
  display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; align-items: start;
  color: var(--grau); font-size: 13px; line-height: 1.5; cursor: pointer;
}
.zugang-check input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--primaer); cursor: pointer; }
.zugang-check input:focus-visible { outline: 2px solid var(--primaer); outline-offset: 2px; }
.zugang-captcha { min-height: 65px; display: grid; align-items: center; }
.zugang-captcha-platz { color: var(--grau-hell); font-size: 12px; }
.zugang-fehler { color: #B4380B; font-size: 13px; line-height: 1.45; }
.zugang-fehler[data-grund="warten"] { color: var(--grau); }
.zugang-fehler:empty { display: none; }
.zugang-los { width: 100%; }
.zugang-los[disabled] { opacity: 1; cursor: progress; }
.zugang-los .spinner { border-color: rgba(255, 255, 255, .35); border-top-color: #fff; }
.zugang-hinweis { color: var(--grau-hell); font-size: 11.5px; line-height: 1.5; }
.zugang-hinweis a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
.zugang-zurueck { display: inline-block; margin-top: 14px; color: var(--grau); font-size: 12.5px; transition: color .15s var(--ease); }
.zugang-zurueck:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.zugang-zurueck:focus-visible, .zugang-hinweis a:focus-visible { outline: 2px solid var(--primaer); outline-offset: 2px; border-radius: 3px; }
@media (max-width: 520px) {
  .zugang { padding: 12px; }
  .zugang-karte { padding: 22px 18px 18px; }
  .zugang-titel { font-size: 21px; }
}

/* ============ TOAST ============ */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--fuss-h) + 24px); z-index: 60;
  max-width: calc(100vw - 32px);
  padding: 11px 16px; border-radius: 8px;
  background: var(--text); color: #fff; font-size: 13.5px;
  box-shadow: 0 10px 30px rgba(5, 28, 48, .25);
  opacity: 0; transform: translate(-50%, 12px); pointer-events: none;
  transition: opacity .2s var(--ease), transform .35s var(--ease-out);
}
.toast.sichtbar { opacity: 1; transform: translate(-50%, 0); }
body.drawer-offen .toast { bottom: calc(var(--fuss-h) + 92px); }
.noscript { position: fixed; inset: auto 16px 16px; padding: 14px 16px; border-radius: 8px; background: var(--text); color: #fff; }

/* ============ SMALL SCREENS ============ */
@media (max-width: 1180px) {
  .nur-breit { display: none; }
}
@media (max-width: 899px) {
  body { grid-template-rows: var(--topbar-h) auto minmax(0, 1fr) var(--fuss-h); }
  .topbar { gap: 10px; padding: 0 10px 0 12px; }
  .topbar-logo img { height: 34px; }
  .ansicht-tabs {
    display: flex; gap: 4px; padding: 8px 12px;
    background: var(--bg); border-bottom: 1px solid var(--linie);
  }
  .tab {
    flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 34px; border: 0; border-radius: 6px; background: transparent;
    color: var(--grau); font-size: 13.5px; font-weight: 500; cursor: pointer;
  }
  .tab[aria-pressed="true"] { background: var(--weiss); color: var(--text); box-shadow: 0 0 0 1px var(--rand); }
  .tab-zahl:not(:empty) {
    padding: 1px 7px; border-radius: 999px; background: var(--primaer); color: #fff; font-size: 11px; font-weight: 600;
  }
  .app { grid-template-columns: minmax(0, 1fr); }
  .postfach, .board { grid-area: 1 / 1; }
  body.zeige-board .postfach { display: none; }
  body.zeige-postfach .board { display: none; }
  .postfach { border-right: 0; }
  .board { padding: 18px 0 28px; scroll-snap-type: x proximity; scroll-padding-left: 16px; }
  .board-kopf { max-width: 100vw; padding: 0 16px; margin-bottom: 16px; }
  .board-kopf h1 { font-size: 24px; }
  .spalten { padding: 0 16px; }
  .spalte { scroll-snap-align: start; }
  .drawer { inset: 0; width: auto; border-radius: 0; z-index: 40; transform: translateY(24px); opacity: 0; transition: transform .35s var(--ease-out), opacity .25s var(--ease), visibility 0s linear .35s; }
  .drawer.offen { transform: none; opacity: 1; transition: transform .35s var(--ease-out), opacity .25s var(--ease), visibility 0s; }
  .drawer-kopf { padding: 58px 16px 0; }
  .drawer-titel { padding-right: 0; font-size: 23px; }
  .drawer-aktionen { top: 10px; right: 10px; }
  .drawer-inhalt { padding: 18px 16px 24px; }
  .drawer-fuss { padding: 10px 16px 14px; }
  .fuss-zeile { flex-wrap: wrap; }
  .fuss-zeile .btn-gruen { order: -1; flex: 1 1 100%; }
  .fuss-zeile .btn-gross:not(.btn-gruen):not(.btn-primaer) { flex: 1; height: 38px; font-size: 13px; }
  .trichter { display: none; }
  body.drawer-offen .toast { bottom: 150px; }
  .tour { left: 10px; right: 10px; width: auto; max-width: none; }
  .genie { top: calc(var(--topbar-h) + 6px); left: 6px; right: 6px; bottom: 6px; width: auto; }
  body.drawer-offen .genie { top: 6px; } /* over a card it covers the card's own close button too */
  .genie-knopf { left: 16px; bottom: calc(var(--fuss-h) + 12px); width: 52px; height: 52px; }
  .genie-blase { left: 16px; bottom: calc(var(--fuss-h) + 76px); width: min(300px, calc(100vw - 32px)); transform-origin: 26px 100%; }
  .genie-blase-pfeil { left: 20px; }
  .tour-start { right: 16px; bottom: calc(var(--fuss-h) + 18px); }
  body.zeige-postfach .genie-knopf, body.zeige-postfach .tour-start { display: none; }
  .genie-knopf .genie-bild { width: 40px; height: 40px; }
  body.genie-offen .genie-knopf, body.drawer-offen .genie-knopf { display: none; }
  .board { padding-bottom: 88px; }
}
@media (max-width: 640px) {
  .topbar-prozess { display: none; }
}
@media (max-width: 380px) {
  .fusszeile { gap: 8px; padding: 0 4px 0 12px; }
  .fusszeile-links a { padding: 0 6px; }
}
/* small phones: the button keeps its place in the bar as "Termin", read out in full */
@media (max-width: 420px) {
  .termin-rest { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (max-width: 520px) {
  .felder { grid-template-columns: minmax(0, 1fr); }
  .mail-aktionen { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
