/* =========================================================
   Ancomox Kundenportal – Stylesheet
   Farben und Schriften wie auf ancomox.com.
   Alles Wichtige steht in den Variablen am Anfang.
   ========================================================= */

/* Schriften liegen lokal in assets/fonts (SIL Open Font License, siehe OFL-*.txt) –
   es werden keine Schriften von Google-Servern geladen (Datenschutz). */
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("fonts/SpaceGrotesk-Variable.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/JetBrainsMono-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/JetBrainsMono-Medium.woff2") format("woff2");
}

:root {
  --bg: #0A0C12;
  --bg-2: #0F1219;
  --surface: #12151E;
  --surface-2: #181C27;
  --surface-3: #1F2432;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #EEF0F6;
  --text-2: #A7AEBE;
  --text-3: #8B93A7;
  --pink: #E83E8C;
  --pink-2: #EC4D92;
  --pink-deep: #C2185B;
  --violet: #7C6CF6;
  --violet-2: #A06BF5;
  --ok: #38C793;
  --warn: #F2B441;
  --bad: #F0566A;
  --grad: linear-gradient(135deg, #E83E8C, #C2185B);
  --grad-text: linear-gradient(110deg, #EC4D92, #A06BF5, #7C6CF6);
  --grad-line: linear-gradient(90deg, #C2185B, #7C6CF6);
  --font-head: "Space Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-body: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --topbar: rgba(10, 12, 18, 0.9);
  --hover-row: rgba(255, 255, 255, 0.02);
  --neutral-bg: rgba(255, 255, 255, 0.06);
  --ok-text: #9CF0CC; --ok-bg: rgba(56, 199, 147, 0.14);
  --warn-text: #FFD98A; --warn-bg: rgba(242, 180, 65, 0.14);
  --bad-text: #FFB1BA; --bad-bg: rgba(240, 86, 106, 0.14);
  --accent-text: #fff; --accent-bg: rgba(232, 62, 140, 0.22);
  --info-text: #DDD8FF;
  --flash-ok: #C6F5E2; --flash-bad: #FFD2D8;
  --code-text: #D8DEE9;
  --icon-pdf: #FF8A99; --icon-text: #9FB4FF; --icon-table: #7FE0B8; --icon-image: #F2B441; --icon-video: #F0A0FF;
  --shot-empty: rgba(255, 255, 255, 0.28);
  color-scheme: dark;
}

/* Helles Design – Schalter oben rechts, Wahl bleibt im Browser gespeichert */
:root[data-theme="light"] {
  --bg: #F4F5F9;
  --bg-2: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #F3F4F8;
  --surface-3: #E8EAF1;
  --line: rgba(20, 24, 40, 0.09);
  --line-2: rgba(20, 24, 40, 0.18);
  --text: #171A24;
  --text-2: #4B5262;
  --text-3: #6F778A;
  --pink: #D6266F;
  --pink-2: #C2185B;
  --pink-deep: #A3124C;
  --violet: #5F4FD8;
  --violet-2: #7A5CE0;
  --ok: #1F9D6C;
  --warn: #B7791F;
  --bad: #D33B4F;
  --grad-text: linear-gradient(110deg, #C2185B, #7A5CE0, #5F4FD8);
  --shadow: 0 10px 30px rgba(20, 24, 40, 0.10);
  --topbar: rgba(255, 255, 255, 0.88);
  --hover-row: rgba(20, 24, 40, 0.03);
  --neutral-bg: rgba(20, 24, 40, 0.05);
  --ok-text: #146C4A; --ok-bg: rgba(31, 157, 108, 0.12);
  --warn-text: #7A5310; --warn-bg: rgba(183, 121, 31, 0.14);
  --bad-text: #A42535; --bad-bg: rgba(211, 59, 79, 0.12);
  --accent-text: #A3124C; --accent-bg: rgba(214, 38, 111, 0.12);
  --info-text: #3A2E9E;
  --flash-ok: #0F5C3D; --flash-bad: #8A1D2B;
  --code-text: #171A24;
  --icon-pdf: #B02A3A; --icon-text: #3B3FA6; --icon-table: #16704E; --icon-image: #8A5A0A; --icon-video: #7A2E9E;
  --shot-empty: rgba(20, 24, 40, 0.22);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--pink-2); text-decoration: none; }
a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; letter-spacing: -0.01em; margin: 0 0 8px; line-height: 1.2; text-wrap: balance; }
h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p { margin: 0 0 12px; }
small, .small { font-size: 13px; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.mono { font-family: var(--font-mono); font-size: 0.92em; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.grad-text { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--topbar);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar::before { content: ""; display: block; height: 3px; background: var(--grad-line); }
.topbar-inner {
  max-width: 1160px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 16px; min-height: 62px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand:hover { text-decoration: none; color: var(--text); }
.brand img { width: 30px; height: 30px; }
.brand-name { font-family: var(--font-head); font-weight: 700; font-size: 17px; letter-spacing: 0.14em; }
.brand-tag {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--pink-2); border: 1px solid rgba(236, 77, 146, 0.45); border-radius: 999px; padding: 2px 8px;
}
.nav { display: flex; gap: 2px; margin-left: 4px; flex-wrap: nowrap; flex-shrink: 0; }
.nav a {
  color: var(--text-2); padding: 8px 9px; border-radius: 8px; font-weight: 500; font-size: 13.5px; white-space: nowrap;
}
.nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav a.active { color: var(--text); background: var(--surface-2); }
.nav a .count {
  display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 6px; border-radius: 999px;
  background: var(--pink); color: #fff; font-size: 11px; font-weight: 700; text-align: center; line-height: 18px;
}
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.topbar-right .who { color: var(--text-2); font-size: 13px; white-space: nowrap; }
.topbar-right .who strong { color: var(--text); font-weight: 500; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line-2); color: var(--text); border-radius: 8px; padding: 6px 10px; cursor: pointer; }

/* ---------- Layout ---------- */
.page { flex: 1; width: 100%; max-width: 1160px; margin: 0 auto; padding: 28px 20px 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head .eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); margin-bottom: 6px; }
.page-head p { color: var(--text-2); max-width: 64ch; margin: 6px 0 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.grid { display: grid; gap: 18px; }
.grid > *, .stack > * { min-width: 0; } /* Tabellen und lange Wörter dürfen die Spalte nicht aufsprengen – sie scrollen in .tbl */
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-side { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
.stack { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.card-head .more { font-size: 13px; }
.card.accent { border-color: rgba(232, 62, 140, 0.35); background: linear-gradient(180deg, rgba(232, 62, 140, 0.08), transparent 60%), var(--surface); }
.card.soft { background: var(--surface-2); }
.card + .card { margin-top: 0; }

.stat { display: flex; flex-direction: column; gap: 4px; }
.stat .value { font-family: var(--font-head); font-size: 28px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat .label { color: var(--text-2); font-size: 13px; }

/* ---------- Lists / tables ---------- */
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.list > li { padding: 12px 0; border-top: 1px solid var(--line); display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.list > li:first-child { border-top: 0; padding-top: 0; }
.list > li:last-child { padding-bottom: 0; }
.list .main { flex: 1; min-width: 0; }
.list .title { font-weight: 500; }
.list .sub { color: var(--text-2); font-size: 13px; margin-top: 2px; }
.list > li.month { padding: 14px 0 4px; border-top: 0; align-items: baseline; }
.list > li.month + li { border-top: 0; padding-top: 6px; }
.list > li.month:first-child { padding-top: 0; }

.tbl { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 11px 14px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: 0; }
th { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); font-weight: 500; background: var(--surface-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.dim td { color: var(--text-3); }
tbody tr:hover td { background: var(--hover-row); }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; font-size: 14px; margin: 0; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; }

/* ---------- Badges ---------- */
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 18px;
  border: 1px solid transparent; white-space: nowrap; vertical-align: middle;
}
.badge-neutral { color: var(--text-2); background: var(--neutral-bg); border-color: var(--line-2); }
.badge-accent { color: var(--accent-text); background: var(--accent-bg); border-color: rgba(232, 62, 140, 0.5); }
.badge-ok { color: var(--ok-text); background: var(--ok-bg); border-color: rgba(56, 199, 147, 0.45); }
.badge-warn { color: var(--warn-text); background: var(--warn-bg); border-color: rgba(242, 180, 65, 0.45); }
.badge-bad { color: var(--bad-text); background: var(--bad-bg); border-color: rgba(240, 86, 106, 0.45); }
.tag { display: inline-block; font-family: var(--font-mono); font-size: 11px; color: var(--text-2); background: var(--surface-3); border-radius: 6px; padding: 2px 7px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: 9px; font-weight: 600; font-size: 14px; line-height: 1.2;
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); cursor: pointer;
  text-decoration: none; font-family: var(--font-body); transition: transform 0.08s ease, filter 0.15s ease;
}
.btn:hover { text-decoration: none; color: var(--text); filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 6px 18px rgba(232, 62, 140, 0.25); }
.btn-primary:hover { color: #fff; filter: brightness(1.08); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { color: var(--text); background: var(--surface-2); }
.btn-danger { color: var(--bad-text); border-color: rgba(240, 86, 106, 0.45); background: rgba(240, 86, 106, 0.08); }
.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: 0.5; pointer-events: none; }
form.inline { display: inline; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label, label.lbl { font-size: 13px; font-weight: 500; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--text-3); }
.field .err { font-size: 12.5px; color: var(--bad-text); }
.input, select, textarea, input[type="text"], input[type="email"], input[type="password"], input[type="date"], input[type="number"], input[type="url"], input[type="search"], input[type="file"] {
  width: 100%; background: var(--bg-2); color: var(--text); border: 1px solid var(--line-2); border-radius: 8px;
  padding: 10px 12px; font: inherit; font-size: 14px; line-height: 1.35;
}
input:focus, select:focus, textarea:focus { border-color: var(--violet); outline: none; box-shadow: 0 0 0 3px rgba(124, 108, 246, 0.2); }
textarea { min-height: 96px; resize: vertical; }
input[type="file"] { padding: 8px; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--text-2); cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--pink); }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
fieldset { border: 0; padding: 0; margin: 0 0 8px; }
legend { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); margin-bottom: 10px; padding: 0; }

/* ---------- Flash ---------- */
.flash { border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 18px; font-size: 14px; border: 1px solid; display: block; line-height: 1.5; }
.flash-success { border-color: rgba(56, 199, 147, 0.45); background: rgba(56, 199, 147, 0.1); color: var(--flash-ok); }
.flash-error { border-color: rgba(240, 86, 106, 0.45); background: rgba(240, 86, 106, 0.1); color: var(--flash-bad); }
.flash-info { border-color: rgba(124, 108, 246, 0.45); background: rgba(124, 108, 246, 0.1); color: var(--info-text); }
.flash ul { margin: 0; padding-left: 18px; }

.empty { color: var(--text-3); padding: 18px 0; font-size: 14px; }
.empty strong { color: var(--text-2); font-weight: 500; }

/* ---------- Preview ---------- */
.preview-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line-2); border-radius: 9px; overflow: hidden; max-width: 100%; }
.seg button { background: transparent; border: 0; color: var(--text-2); padding: 7px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button.on { background: var(--surface-3); color: var(--text); }
.frame-wrap { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; overflow: auto; }
.frame-shell {
  margin: 0 auto; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: var(--shadow);
  transition: max-width 0.25s ease; max-width: 100%;
  /* So hoch wie der Bildschirm hergibt (Kopf und Leiste abgezogen); die Ecke unten rechts lässt sich ziehen */
  height: clamp(560px, calc(100vh - 250px), 1400px); min-height: 360px;
}
.frame-shell iframe { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.frame-shell:fullscreen { max-width: none !important; border-radius: 0; }
.frame-grip { height: 16px; margin-top: 6px; display: flex; align-items: center; justify-content: center; cursor: ns-resize; touch-action: none; user-select: none; }
.frame-grip span { width: 56px; height: 4px; border-radius: 4px; background: var(--line-2); transition: background 0.15s; }
.frame-grip:hover span, .frame-wrap.resizing .frame-grip span { background: var(--text-3); }
.frame-wrap.resizing iframe { pointer-events: none; }
.frame-note { font-size: 12.5px; color: var(--text-3); margin-top: 8px; }

/* Vorschau-Seite: breiter als der Rest, damit der Desktop-Rahmen Platz hat */
body.wide .topbar-inner, body.wide .page, body.wide .footer-inner { max-width: 1560px; }

/* ---------- Comment thread ---------- */
.thread { display: flex; flex-direction: column; gap: 12px; }
.msg { display: grid; grid-template-columns: 36px 1fr; gap: 12px; }
.msg .avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-head); font-weight: 700; font-size: 13px; background: var(--surface-3); color: var(--text-2);
}
.msg.agency .avatar { background: var(--grad); color: #fff; }
.msg .bubble { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.msg.agency .bubble { border-color: rgba(232, 62, 140, 0.3); }
.msg .attach-img { display: inline-block; margin-top: 8px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line-2); background: #fff; line-height: 0; }
.msg .attach-img img { max-width: 240px; max-height: 180px; display: block; }

/* ---------- Dateien: Vorschaubilder und Symbole ---------- */
.thumb {
  flex: 0 0 auto; width: 96px; height: 72px; border-radius: 8px; overflow: hidden; display: flex; align-items: center; justify-content: center;
  background: var(--surface-3); border: 1px solid var(--line); text-decoration: none; line-height: 0;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
a.thumb:hover { border-color: var(--line-2); text-decoration: none; }
a.thumb:hover img { opacity: 0.88; }
.thumb-sm { width: 48px; height: 36px; border-radius: 6px; }
.ficon { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; font-weight: 500; color: var(--text-2); line-height: 1; }
.thumb-sm.ficon { font-size: 9.5px; letter-spacing: 0.03em; }
.ficon-pdf { color: var(--icon-pdf); background: rgba(240, 86, 106, 0.12); border-color: rgba(240, 86, 106, 0.3); }
.ficon-text { color: var(--icon-text); background: rgba(124, 108, 246, 0.14); border-color: rgba(124, 108, 246, 0.35); }
.ficon-tabelle { color: var(--icon-table); background: rgba(56, 199, 147, 0.12); border-color: rgba(56, 199, 147, 0.3); }
.ficon-bild { color: var(--icon-image); background: rgba(242, 180, 65, 0.12); border-color: rgba(242, 180, 65, 0.3); }
.ficon-video { color: var(--icon-video); background: rgba(200, 96, 240, 0.14); border-color: rgba(200, 96, 240, 0.35); }
.thumb-cell { width: 56px; padding-right: 0 !important; }
.btn .ico { vertical-align: -2px; margin-right: 2px; }
.btn-icon { padding: 6px 8px; line-height: 0; }

/* ---------- Dateien: Ansichtsseite ---------- */
.viewer { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; justify-content: center; align-items: center; min-height: 320px; }
.viewer-bild a { line-height: 0; }
.viewer-bild img { max-width: 100%; max-height: calc(100vh - 270px); min-height: 200px; object-fit: contain; border-radius: 6px; display: block; background: #fff; }
.viewer-video video { max-width: 100%; max-height: calc(100vh - 270px); background: #000; border-radius: 6px; display: block; }
.viewer-pdf, .viewer-text { padding: 0; overflow: hidden; }
.viewer-pdf iframe, .viewer-text iframe { width: 100%; height: calc(100vh - 250px); min-height: 560px; border: 0; background: #fff; display: block; }
.viewer-none { text-align: center; color: var(--text-2); padding: 30px 16px; max-width: 520px; }
.viewer-none .thumb { display: flex; }
.viewer-actions { flex-wrap: wrap; }

/* ---------- Dateien: Galerie ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.gallery.compact { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.tile { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; min-width: 0; }
.tile:hover { border-color: rgba(124, 108, 246, 0.6); }
.tile-media { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; background: var(--surface-3); overflow: hidden; text-decoration: none; position: relative; }
.tile-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.35s ease; }
.tile:hover .tile-media img { transform: scale(1.03); }
.tile-media .tile-ext { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.08em; color: var(--text-2); padding: 8px 12px; border-radius: 8px; border: 1px solid transparent; }
.tile-video { background: #14121a; }
.tile-video .tile-play { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; background: rgba(255, 255, 255, 0.92); color: #14121a; display: flex; align-items: center; justify-content: center; font-size: 17px; padding-left: 4px; }
.tile-video .tile-ext { position: absolute; right: 8px; bottom: 6px; font-size: 10.5px; color: var(--text-3); padding: 0; }
.tile-body { display: flex; align-items: center; gap: 6px; padding: 8px 6px 8px 10px; }
.tile-title { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-dl { flex: 0 0 auto; color: var(--text-3); padding: 5px 6px; border-radius: 6px; line-height: 0; }
.tile-dl:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.tile-sub { padding: 0 10px 8px; font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }
.linkish:hover { color: var(--text); }
.list.files > li { align-items: center; }
.list.files .main { min-width: 180px; } /* Text nie zusammenquetschen – die Knöpfe rutschen lieber in die nächste Zeile */
.list.files .title { display: block; }

/* ---------- Upload: Ablagefläche ---------- */
.dropzone {
  position: relative; border: 1.5px dashed var(--line-2); border-radius: 10px; background: var(--bg-2);
  padding: 22px 16px; text-align: center; transition: border-color 0.15s, background 0.15s;
}
.dropzone .dz-text { display: none; color: var(--text-2); font-size: 14px; line-height: 1.5; pointer-events: none; }
.dropzone .dz-text strong { color: var(--text); font-weight: 500; }
.dropzone input[type="file"] { display: block; margin: 0 auto; width: auto; max-width: 100%; }
.dropzone.js { cursor: pointer; }
.dropzone.js .dz-text { display: block; }
.dropzone.js input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; margin: 0; padding: 0; }
.dropzone.over, .dropzone:focus-within { border-color: var(--pink-2); background: rgba(232, 62, 140, 0.06); }
.dz-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.dz-list li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.dz-list li.bad { border-color: rgba(240, 86, 106, 0.5); }
.dz-list .dz-thumb { flex: 0 0 auto; width: 44px; height: 34px; border-radius: 5px; overflow: hidden; background: var(--surface-3); display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 9.5px; color: var(--text-3); }
.dz-list .dz-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dz-list .dz-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dz-list .dz-size { color: var(--text-3); white-space: nowrap; }
.dz-list li.bad .dz-size { color: var(--bad-text); }
.dz-list .dz-remove { background: none; border: 0; color: var(--text-3); font-size: 18px; line-height: 1; cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.dz-list .dz-remove:hover { color: var(--text); background: var(--surface-3); }
.dz-list li.dz-sum { background: transparent; border: 0; color: var(--text-2); padding: 2px 8px; justify-content: space-between; }
.dz-list .dz-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.dz-list .dz-title { padding: 5px 8px; font-size: 13px; border-radius: 6px; }
.dz-list .dz-meta { color: var(--text-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dz-list .dz-meta.bad { color: var(--bad-text); }
.dz-progress { margin-top: 12px; }
.dz-progress .bar { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.dz-progress .bar span { display: block; height: 100%; width: 0; background: var(--grad); transition: width 0.15s linear; }
.dz-progress .dz-status { display: block; margin-top: 6px; font-size: 12.5px; color: var(--text-2); }
.msg .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12.5px; color: var(--text-3); margin-bottom: 4px; }
.msg .meta strong { color: var(--text); font-weight: 600; }
.msg .body p:last-child { margin-bottom: 0; }
.msg.resolved .bubble { opacity: 0.75; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 10px 1fr; gap: 12px; padding: 7px 0; font-size: 13.5px; }
.timeline li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--violet); margin-top: 6px; }
.timeline .when { color: var(--text-3); font-size: 12px; }

/* ---------- Variant cards ---------- */
.variants { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.variant {
  display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: var(--surface-2); color: var(--text); text-decoration: none; position: relative;
}
.variant:hover { text-decoration: none; border-color: rgba(124, 108, 246, 0.6); color: var(--text); }
.variant.chosen { border-color: rgba(56, 199, 147, 0.5); }
/* Vorschaubild der Startseite – oben angeschnitten, wie ein Blick auf den Bildschirm */
.variant .shot { display: block; aspect-ratio: 16 / 10; background: var(--surface-3); border-bottom: 1px solid var(--line); }
.variant .shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; transition: transform 0.35s ease; }
.variant:hover .shot img { transform: scale(1.03); }
.variant .shot.empty { display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, rgba(232, 62, 140, 0.16), rgba(124, 108, 246, 0.16)), var(--surface-3); }
.variant .shot.empty span { font-family: var(--font-head); font-size: 44px; font-weight: 700; color: var(--shot-empty); }
.variant .body { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 16px; flex: 1; }
.variant .name { font-family: var(--font-head); font-weight: 600; font-size: 16px; }
.variant .desc { color: var(--text-2); font-size: 13.5px; }
.variant .foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; font-size: 12.5px; color: var(--text-3); }

/* Vorschaubild im Admin */
.thumb-wide { width: 104px; height: 65px; }
.thumb-wide img { object-position: top; }
.thumb-wide.ficon { font-size: 10px; letter-spacing: 0.02em; text-align: center; }
.shot-box {
  position: relative; aspect-ratio: 16 / 10; border-radius: 8px; overflow: hidden; background: var(--surface-3);
  border: 1.5px dashed var(--line-2); display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.shot-box:not(.empty) { border-style: solid; border-color: var(--line); }
.shot-box:hover, .shot-box:focus, .shot-box.over { border-color: var(--pink-2); box-shadow: 0 0 0 3px rgba(232, 62, 140, 0.18); outline: none; }
.shot-box img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.shot-box.empty { background: linear-gradient(135deg, rgba(232, 62, 140, 0.12), rgba(124, 108, 246, 0.12)), var(--surface-3); }
.shot-empty { display: flex; flex-direction: column; gap: 6px; align-items: center; text-align: center; padding: 16px 22px; color: var(--text-3); font-size: 12.5px; line-height: 1.45; }
.shot-empty strong { color: var(--text-2); font-weight: 500; font-size: 14px; }
.shot-empty .mono, .shot-overlay .mono { display: inline-block; padding: 0 5px; border: 1px solid var(--line-2); border-radius: 4px; font-size: 11px; background: var(--surface-2); color: var(--text-2); }
.shot-overlay {
  position: absolute; inset: auto 0 0 0; padding: 8px 10px; font-size: 12px; text-align: center; color: #fff;
  background: linear-gradient(180deg, rgba(10, 12, 18, 0), rgba(10, 12, 18, 0.85)); opacity: 0; transition: opacity 0.15s; pointer-events: none;
}
.shot-box:not(.empty):hover .shot-overlay, .shot-box:not(.empty):focus .shot-overlay, .shot-box:not(.empty).over .shot-overlay { opacity: 1; }

/* ---------- Code ---------- */
pre.code {
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 12px 14px;
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.55; overflow-x: auto; margin: 0; color: var(--code-text); white-space: pre;
}
.copy-wrap { position: relative; }
.copy-wrap pre.code { padding-right: 96px; }
.copy-wrap .copy { position: absolute; top: 8px; right: 8px; }

/* ---------- Auth ---------- */
.auth-page { flex: 1; display: grid; place-items: center; padding: 40px 20px; background: radial-gradient(ellipse at top, rgba(124, 108, 246, 0.16), rgba(232, 62, 140, 0.06) 45%, transparent 70%), var(--bg); }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .brand { justify-content: center; margin-bottom: 22px; }
.auth-card .card { padding: 26px; }
.auth-card h1 { font-size: 22px; margin-bottom: 4px; }
.auth-card .lead { color: var(--text-2); font-size: 14px; margin-bottom: 18px; }
.auth-foot { text-align: center; font-size: 13px; color: var(--text-3); margin-top: 16px; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 18px 20px; font-size: 12.5px; color: var(--text-3); }
.footer-inner { max-width: 1160px; margin: 0 auto; display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between; }
.footer a { color: var(--text-2); }
.footer .theme-toggle { margin-left: 8px; }

/* ---------- Tabs (anchor nav) ---------- */
.subnav { display: flex; gap: 4px; flex-wrap: wrap; margin: 0 0 18px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.subnav a { color: var(--text-2); padding: 6px 10px; border-radius: 7px; font-size: 13.5px; }
.subnav a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }

details.box { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); padding: 0 14px; }
details.box summary { cursor: pointer; padding: 10px 0; font-weight: 500; }
details.box[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 10px; }
details.box > *:not(summary) { margin-bottom: 12px; }


/* ---------- 1.6.0: Schalter hell/dunkel ---------- */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0;
  border: 1px solid var(--line-2); border-radius: 9px; background: transparent; color: var(--text-2); cursor: pointer;
}
.theme-toggle:hover { color: var(--text); background: var(--surface-2); }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .ico-sun { display: none; }
:root[data-theme="light"] .theme-toggle .ico-sun { display: block; }
:root[data-theme="light"] .theme-toggle .ico-moon { display: none; }

/* ---------- 1.6.0: Kundenlogo im Kopf, Kundenansicht-Balken ---------- */
.cust-logo { display: inline-flex; align-items: center; background: #fff; border-radius: 7px; padding: 3px 7px; line-height: 0; border: 1px solid var(--line-2); }
.cust-logo img { max-height: 26px; max-width: 120px; width: auto; height: auto; display: block; }
.viewas {
  position: sticky; top: 65px; z-index: 40; display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
  padding: 8px 16px; font-size: 13.5px; background: rgba(124, 108, 246, 0.16); border-bottom: 1px solid rgba(124, 108, 246, 0.45); color: var(--text);
  backdrop-filter: blur(8px);
}
.viewas strong { font-weight: 600; }

/* ---------- 1.6.0: Suche in der Admin-Leiste ---------- */
.nav .nav-profile { display: none; } /* „Profil“ steht rechts als Knopf – im Handy-Menü als Eintrag */
/* Lupe in der Leiste; das Feld klappt beim Klick nach links über die Menüpunkte auf */
.topsearch { position: relative; width: 34px; height: 34px; margin-left: 6px; order: 99; flex: 0 0 auto; }
.topsearch input {
  position: absolute; right: 0; top: 0; height: 34px; width: 34px; padding: 6px 8px 6px 30px; font-size: 13px; border-radius: 9px; cursor: pointer;
  background: var(--surface-2) no-repeat 9px center; z-index: 2; transition: width 0.18s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238B93A7' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
  background-size: 14px 14px;
}
.topsearch input::placeholder { color: transparent; }
.topsearch input:focus, .topsearch input:not(:placeholder-shown) { width: 250px; cursor: text; }
.topsearch input:focus::placeholder { color: var(--text-3); }
.topsearch input::-webkit-search-cancel-button { -webkit-appearance: none; }

/* ---------- 1.6.0: Ansprechpartner ---------- */
.contact { display: flex; gap: 14px; align-items: flex-start; }
.contact .avatar {
  flex: 0 0 auto; width: 60px; height: 60px; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  background: var(--grad); color: #fff; font-family: var(--font-head); font-weight: 700; font-size: 20px; border: 2px solid var(--surface-3);
}
.contact .avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.contact .name { font-family: var(--font-head); font-weight: 600; font-size: 16px; line-height: 1.2; }
.contact .role { color: var(--text-2); font-size: 13px; margin-top: 2px; }
.contact .hours { color: var(--text-3); font-size: 12.5px; margin-top: 8px; }
.contact-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.contact-links a { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); text-decoration: none; }
.contact-links a:hover { border-color: var(--pink-2); color: var(--text); text-decoration: none; }
.contact-links svg { width: 14px; height: 14px; }

/* ---------- 1.6.0: Aufgaben („Was wir von Ihnen brauchen“) ---------- */
.tasks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.task { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); }
.task:first-child { border-top: 0; padding-top: 0; }
.task:last-child { padding-bottom: 0; }
.task .mark { flex: 0 0 auto; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%; border: 2px solid var(--line-2); display: grid; place-items: center; color: #fff; }
.task .mark svg { width: 12px; height: 12px; display: none; }
.task.done .mark { background: var(--ok); border-color: var(--ok); }
.task.done .mark svg { display: block; }
.task.overdue .mark { border-color: var(--bad); }
.task .body { flex: 1; min-width: 0; }
.task .title { font-weight: 500; }
.task.done .title { color: var(--text-3); text-decoration: line-through; }
.task .meta { color: var(--text-2); font-size: 13px; margin-top: 2px; }
.task .meta .due { font-weight: 500; }
.task.overdue .meta .due { color: var(--bad-text); }
.task .note { color: var(--text-2); font-size: 13.5px; margin-top: 4px; white-space: pre-line; }
.task .actions { flex-wrap: wrap; justify-content: flex-end; }
.task form.done-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.task form.done-form input[type="text"] { width: 180px; padding: 6px 9px; font-size: 13px; }
.card.tasks-card { border-color: rgba(124, 108, 246, 0.45); background: linear-gradient(180deg, rgba(124, 108, 246, 0.10), transparent 60%), var(--surface); }
.pill-new { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 999px; background: var(--pink); color: #fff; font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; line-height: 16px; text-transform: uppercase; vertical-align: 2px; }
.timeline li.is-new::before { background: var(--pink); box-shadow: 0 0 0 3px rgba(232, 62, 140, 0.2); }
.timeline .items { color: var(--text-2); font-size: 12.5px; margin-top: 2px; }

.inline-details { display: inline-block; }
.inline-details > summary { list-style: none; display: inline-flex; }
.inline-details > summary::-webkit-details-marker { display: none; }
.inline-details[open] { width: 100%; }

/* ---------- 1.6.0: Leerzustände ---------- */
.empty-state { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border: 1px dashed var(--line-2); border-radius: 10px; color: var(--text-2); font-size: 14px; }
.empty-state .ico { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; color: var(--text-3); }
.empty-state .ico svg { width: 18px; height: 18px; }
.empty-state strong { color: var(--text); font-weight: 500; display: block; margin-bottom: 1px; }

/* ---------- 1.6.0: Verfügbarkeit und Verlauf ---------- */
.uptime { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin: 4px 0 12px; }
.uptime .stat { padding: 10px 12px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); }
.uptime .stat .value { font-size: 20px; }
.uptime .stat .label { font-size: 12px; }
.spark { display: block; width: 100%; height: 46px; }
.spark rect { rx: 1.5; }
.spark .up { fill: var(--ok); opacity: 0.75; }
.spark .down { fill: var(--bad); }
.spark-note { display: flex; justify-content: space-between; gap: 8px; color: var(--text-3); font-size: 12px; margin-top: 4px; }

/* ---------- 1.6.0: Abnahme ---------- */
.card.acceptance { border-color: rgba(56, 199, 147, 0.5); background: linear-gradient(180deg, rgba(56, 199, 147, 0.10), transparent 60%), var(--surface); }
.card.acceptance .check { font-size: 15px; color: var(--text); }
.done-stamp { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 9px; background: var(--ok-bg); color: var(--ok-text); font-weight: 600; }
.done-stamp svg { width: 16px; height: 16px; }

/* ---------- 1.6.0: Suchergebnisse ---------- */
.search-groups h2 { margin-top: 18px; }

/* ---------- Responsive ---------- */
@media (max-width: 1320px) {
  .topbar-right .who { display: none; }
}
@media (max-width: 1400px) {
  .nav a { padding: 8px 7px; font-size: 13px; }
}
@media (max-width: 1100px) {
  .brand-tag { display: none; }
  .nav a { padding: 8px 6px; font-size: 12.5px; }
}
@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4, .grid-side { grid-template-columns: 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--bg-2); border-bottom: 1px solid var(--line); padding: 8px 12px 12px; flex-direction: column; box-shadow: var(--shadow); }
  .nav.open { display: flex; }
  .nav a { padding: 11px 12px; font-size: 15px; }
  .nav-toggle { display: inline-block; order: 3; }
  .topbar-right .who { display: none; }
  .topbar-right { gap: 8px; }
  .nav .nav-profile { display: block; }
  .nav .topsearch { display: block; order: -1; margin: 4px 0 8px; width: 100%; height: auto; }
  .nav .topsearch input, .nav .topsearch input:focus { position: static; width: 100%; height: 40px; cursor: text; }
  .nav .topsearch input::placeholder { color: var(--text-3); }
  .frame-shell { height: 62vh; }
  .viewas { top: 62px; }
}
@media (max-width: 560px) {
  body { font-size: 14.5px; }
  .page { padding: 18px 14px 48px; }
  h1 { font-size: 24px; }
  .card { padding: 16px 14px; }
  th, td { padding: 9px 10px; }
  .brand-tag { display: none; }
  .brand img { width: 26px; height: 26px; }
  .topbar-inner { padding: 0 12px; gap: 8px; min-height: 58px; }
  .topbar-right .btn-ghost { display: none; } /* „Profil“ steckt im Menü */
  .cust-logo { display: none; }
  .page-head { margin-bottom: 16px; }
  .page-head .actions { width: 100%; }
  .list > li > .actions { width: 100%; }
  .list > li > .main { flex: 1 1 190px; }
  .thumb-wide { width: 88px; height: 55px; }
  .variants { grid-template-columns: 1fr; }
  .gallery, .gallery.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .task { flex-wrap: wrap; }
  .task .actions { width: 100%; justify-content: flex-start; padding-left: 34px; }
  .task form.done-form input[type="text"] { width: 100%; }
  .contact .avatar { width: 52px; height: 52px; font-size: 17px; }
  .uptime .stat .value { font-size: 18px; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dt { margin-top: 6px; }
  .kv dd + dt { margin-top: 8px; }
  .viewas { top: 58px; font-size: 13px; }
  .btn { padding: 10px 14px; }
  .btn-sm { padding: 7px 11px; }
}
@media print {
  .topbar, .footer, .btn, .nav { display: none !important; }
  body { background: #fff; color: #000; }
  .card { border-color: #ccc; }
}

/* Breiten-Schalter auf sehr schmalen Bildschirmen ausblenden (dort gibt es nur eine Breite) */
@media (max-width: 560px) {
  .preview-bar .seg { display: none; }
  .frame-shell { max-width: 100% !important; }
}
.flash a { color: inherit; text-decoration: underline; }
