/* vizitcard.de — modernes, schlankes UI (kein Build-Step) */
:root {
  --bg: #f7f7f9;
  --surface: #ffffff;
  --text: #18181b;
  --muted: #6b7280;
  --border: #e5e7eb;
  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --danger: #dc2626;
  --success: #16a34a;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.05);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.3rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.mt { margin-top: 1rem; }
.mt2 { margin-top: 2rem; }
.mb { margin-bottom: 1rem; }
.row { display: flex; gap: 1rem; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 0; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }

/* Container */
.container { max-width: 1280px; margin: 0 auto; padding: 0 1.5rem; }
.narrow { max-width: 460px; margin: 0 auto; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .65rem 1.1rem; border-radius: 10px; border: 1px solid transparent;
  background: var(--primary); color: #fff; font-weight: 600; font-size: .95rem;
  cursor: pointer; transition: background .15s, transform .05s; text-decoration: none;
}
.btn:hover { background: var(--primary-hover); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn.secondary:hover { background: #f3f4f6; }
.btn.danger { background: var(--danger); }
.btn.ghost { background: transparent; color: var(--primary); }
.btn.sm { padding: .4rem .7rem; font-size: .85rem; }
.btn.full { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Cards / surfaces */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem;
}
.card + .card { margin-top: 1rem; }

/* Forms */
label { display: block; font-weight: 600; font-size: .9rem; margin: 0 0 .35rem; }
input, select, textarea {
  width: 100%; padding: .6rem .75rem; border: 1px solid var(--border);
  border-radius: 9px; font-size: .95rem; font-family: inherit; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: 0; border-color: var(--primary); }
textarea { resize: vertical; min-height: 90px; }
.field { margin-bottom: 1rem; }

/* Bio Rich-Text-Editor */
.bio-toolbar {
  display: flex; align-items: center; gap: 1px;
  padding: 4px 6px; background: var(--bg);
  border: 1px solid var(--border); border-bottom: none;
  border-radius: 9px 9px 0 0;
}
.bio-toolbar button {
  width: 30px; height: 28px; border: none; background: transparent;
  border-radius: 5px; cursor: pointer; font-size: .85rem; font-family: inherit;
  color: var(--text); display: flex; align-items: center; justify-content: center;
  transition: background .1s; padding: 0; line-height: 1;
}
.bio-toolbar button:hover { background: var(--border); }
.bio-toolbar button.bio-tb-active { background: #dbeafe; color: var(--primary); }
.bio-toolbar .bio-tb-sep { width: 1px; height: 18px; background: var(--border); margin: 0 3px; flex-shrink: 0; }
.bio-editor {
  width: 100%; min-height: 90px; padding: .6rem .75rem;
  border: 1px solid var(--border); border-radius: 0 0 9px 9px;
  font-size: .95rem; font-family: inherit; background: #fff; color: var(--text);
  outline: none; box-sizing: border-box; line-height: 1.55;
}
.bio-editor:focus { outline: 2px solid var(--primary); border-color: var(--primary); outline-offset: 0; }
.bio-editor:empty::before { content: attr(data-placeholder); color: #9ca3af; pointer-events: none; display: block; }
.checkbox { display: flex; align-items: flex-start; gap: .5rem; }
.checkbox input { width: auto; margin-top: .25rem; }
.checkbox label { font-weight: 400; margin: 0; }

/* Alerts */
.alert { padding: .8rem 1rem; border-radius: 10px; margin-bottom: 1rem; font-size: .92rem; }
.alert.success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert.error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert.info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* Getönte Hinweis-Karten (Downgrade-/Limit-Hinweise) — Dark-Tönungen im Dark-Block */
.card.tint-red   { border: 1px solid #fca5a5; background: #fff5f5; }
.card.tint-amber { border: 1px solid #f6c56f; background: #fff8ec; }

/* Benachrichtigungs-Einblendungen (Glocke: offene Zahlungen, Abo, NFC-Fund …)
   Akzentfarbe pro Typ über --nc; Icon-Bubble links, Aktionen rechts. */
.notice {
  --nc: var(--primary);
  display: flex; align-items: center; gap: .8rem; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--nc);
  border-radius: 12px; padding: .75rem .9rem; margin-bottom: .7rem; box-shadow: var(--shadow);
  font-size: .92rem;
}
.notice.amber  { --nc: #d97706; }
.notice.purple { --nc: #8b5cf6; }
.notice.green  { --nc: var(--success); }
.notice.red    { --nc: var(--danger); }
.notice-ico {
  flex: none; width: 2.3rem; height: 2.3rem; border-radius: 10px; font-size: 1rem;
  display: inline-flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--nc) 13%, var(--surface)); color: var(--nc);
}
.notice-txt { flex: 1; min-width: min(16rem, 100%); }
.notice-txt > strong { display: block; letter-spacing: -.01em; }
.notice-txt .notice-body { color: var(--muted); font-size: .85rem; margin-top: .1rem; }
.notice-actions { flex: none; display: flex; align-items: center; gap: .35rem; margin-left: auto; }
.notice-actions form { margin: 0; }
/* Dezenter "Gelesen"-Button (✕) statt klobigem OK-Button */
.notice-x {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.1rem; height: 2.1rem; border-radius: 9px; border: none; background: none;
  color: var(--muted); font-size: .95rem; cursor: pointer; transition: background .15s, color .15s;
}
.notice-x:hover { background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--text); }
/* Sammelaktion unter mehreren Einblendungen */
.notice-readall { text-align: right; margin: -.2rem 0 .8rem; }
.notice-readall button {
  background: none; border: none; cursor: pointer; color: var(--muted);
  font-size: .8rem; padding: .2rem .4rem; border-radius: 7px;
}
.notice-readall button:hover { color: var(--text); background: color-mix(in srgb, var(--text) 7%, transparent); }
@media (max-width: 640px) {
  .notice-actions { margin-left: auto; }
  .notice .btn.sm { padding: .5rem .8rem; }
}

/* Badges */
.badge { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 600; background: #eff6ff; color: var(--primary); }
.badge.gray   { background: #f3f4f6; color: var(--muted); }
.badge.green  { background: #ecfdf5; color: #065f46; }
.badge.red    { background: #fef2f2; color: #991b1b; }
.badge.amber  { background: #fffbeb; color: #92400e; }
.badge.blue   { background: #dbeafe; color: #1d4ed8; }
.badge.purple { background: #ede9fe; color: #6d28d9; }
.badge.orange { background: #ffedd5; color: #c2410c; }
.badge.sm     { font-size: .68rem; padding: .1rem .4rem; }
/* Zähler-Kreis: weiße Zahl auf Rot (z. B. neue Termine/Leads) */
.badge-count  { display: inline-flex; align-items: center; justify-content: center; min-width: 1.2rem; height: 1.2rem; padding: 0 .3rem; border-radius: 999px; background: #dc2626; color: #fff; font-size: .7rem; font-weight: 700; line-height: 1; }

/* Top navigation (dashboard) */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.topbar .container { display: flex; align-items: center; justify-content: space-between; height: 76px; }
.brand { font-weight: 800; font-size: 1.2rem; color: #2d2d2d; letter-spacing: -.03em; font-style: normal; }
.brand span { color: var(--primary); font-style: normal; }
.brand em { color: #1a1a1a; font-style: normal; }
/* flex:none — Logo darf im Flex-Header nie zusammengedrückt werden (mobil sonst unsichtbar) */
.brand-img { display: flex; align-items: center; text-decoration: none; flex: none; color: #0b0b0d; }
.brand-img img { height: 64px; width: auto; display: block; }
[data-theme="dark"] .brand-img img { filter: brightness(0) invert(1); }
/* Inline-SVG-Wortmarke (_logo.php): Schwarzanteile via currentColor, „card" bleibt blau */
.brand-img svg.vz-logo { height: 24px; width: auto; display: block; }
[data-theme="dark"] .brand-img { color: #fff; }
[data-theme="dark"] .vz-logo .vz-logo__c { fill: #6684ff; }
.nav { display: flex; gap: .25rem; align-items: center; }
.nav a { padding: .45rem .7rem; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: .9rem; }
.nav a:hover, .nav a.active { background: #f3f4f6; color: var(--text); text-decoration: none; }
.nav a.btn { color: #fff; }
.nav a.btn:hover { color: #fff; background: var(--primary-hover); }

/* Layout with sidebar */
.layout { display: grid; grid-template-columns: 220px 1fr; gap: 1.5rem; padding: 1.5rem 0; }
.sidebar { display: flex; flex-direction: column; gap: .15rem; }
.sidebar a, .sidebar .nav-soon {
  display: flex; align-items: center; gap: .65rem;
  padding: .6rem .7rem; border-radius: 10px;
  color: var(--muted); font-weight: 600; font-size: .92rem; line-height: 1.25;
}
.sidebar a > i, .sidebar .nav-soon > i { width: 1.15rem; text-align: center; font-size: .95rem; flex: none; opacity: .8; }
.sidebar a:hover, .sidebar a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); text-decoration: none; }
.sidebar a.active > i { color: var(--primary); opacity: 1; }
.sidebar a.locked { opacity: .72; }
.sidebar .nav-soon { cursor: default; opacity: .65; }
.sidebar .badge-soon, .sidebar .badge-plan { margin-left: auto; flex: none; }
.sidebar .sep { height: 1px; background: var(--border); margin: .5rem .3rem; }

/* Untere Menügruppe (Agentur & Whitelabel, API): sitzt direkt über dem Konto-Button */
.sidebar-bottom { margin-top: auto; display: flex; flex-direction: column; gap: .15rem; }

/* Generisches Modal/Overlay (öffnen via [data-modal-open="#id"], schließen via [data-modal-close]) */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  display: none; align-items: center; justify-content: center;
  background: rgba(15, 17, 22, .55); backdrop-filter: blur(2px);
  padding: 1rem;
}
.modal-overlay.open { display: flex; }
.modal-panel {
  background: var(--surface, #fff); border-radius: 14px;
  width: 100%; max-width: 580px; max-height: 90vh; overflow: auto;
  padding: 1.3rem 1.5rem; box-shadow: 0 20px 60px rgba(0, 0, 0, .28);
  position: relative;
}
.modal-panel h2 { margin-top: 0; }
.modal-close {
  position: absolute; top: .7rem; right: .8rem;
  background: none; border: none; cursor: pointer;
  font-size: 1.3rem; line-height: 1; color: var(--muted); padding: .3rem;
}
.modal-close:hover { color: var(--text); }

/* Konto-Footer (alles rund ums Nutzerkonto, unten in der Sidebar) */
.sidebar-account { margin-top: auto; position: relative; padding-top: .6rem; }
/* Wenn eine untere Menügruppe existiert, übernimmt sie das Nach-unten-Schieben */
.sidebar-bottom ~ .sidebar-account { margin-top: 0; }
.account-btn {
  display: flex; align-items: center; gap: .6rem; width: 100%;
  padding: .5rem .55rem; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; text-align: left; font-family: inherit;
}
.account-btn:hover { background: #f9fafb; }
.account-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary); color: #fff; font-weight: 700; font-size: .95rem;
}
.account-info { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.account-name { font-weight: 700; font-size: .86rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-plan { display: flex; align-items: center; gap: .3rem; font-size: .74rem; font-weight: 600; color: var(--primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-plan > i { font-size: .68rem; opacity: .9; }
.account-chevron { margin-left: auto; flex: none; color: var(--muted); font-size: .8rem; transition: transform .15s; }
.account-btn[aria-expanded="true"] .account-chevron { transform: rotate(180deg); }

.account-menu {
  display: none; position: absolute; bottom: calc(100% + .35rem); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow); padding: .35rem; flex-direction: column; gap: .1rem; z-index: 40;
}
.account-menu.open { display: flex; }
.account-menu a, .account-menu button {
  display: flex; align-items: center; gap: .6rem; width: 100%;
  padding: .6rem .6rem; border-radius: 9px; border: none; background: none;
  color: var(--muted); font-weight: 600; font-size: .9rem; cursor: pointer; text-align: left; font-family: inherit;
}
.account-menu a:hover, .account-menu button:hover { background: #f3f4f6; color: var(--text); text-decoration: none; }
.account-menu a > i, .account-menu button > i { width: 1.1rem; text-align: center; opacity: .8; flex: none; }
.account-menu form { margin: 0; }
.account-menu .account-logout { color: var(--danger); }
.account-menu .account-logout:hover { background: #fef2f2; color: var(--danger); }
.account-menu-sep { height: 1px; background: var(--border); margin: .3rem .2rem; }

/* Grid of cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem; box-shadow: var(--shadow); transition: transform .1s; }
.tile:hover { transform: translateY(-2px); }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .65rem .5rem; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }

/* Code-Blöcke (API-Doku etc.) — themefähig statt hartkodiertem Grau */
.codeblock {
  background: #f3f4f6; border: 1px solid var(--border); border-radius: 10px;
  padding: .85rem 1rem; overflow-x: auto; -webkit-overflow-scrolling: touch;
  font-size: .82rem; line-height: 1.6; margin: 0;
}
.codeblock + .codeblock { margin-top: .75rem; }
:root[data-theme="dark"] .codeblock { background: #12151b; }
/* Kopfzeile über einem Code-Block: Beschriftung links, Kopieren-Button rechts */
.code-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin: 1rem 0 .4rem; }
.code-head h3, .code-head .l { margin: 0; font-size: .95rem; }
/* Einmalige Key-Anzeige: monospaced Box mit Kopieren-Button */
.key-reveal { display: flex; align-items: center; gap: .5rem; margin-top: .5rem; flex-wrap: wrap; }
.key-reveal code {
  flex: 1; min-width: 200px; word-break: break-all; font-size: .95rem;
  background: rgba(255,255,255,.6); border: 1px dashed currentColor;
  border-radius: 8px; padding: .5rem .65rem;
}
:root[data-theme="dark"] .key-reveal code { background: rgba(0,0,0,.25); }

/* Stat tiles */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; box-shadow: var(--shadow); }
.stat .n { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; }
.stat .l { color: var(--muted); font-size: .85rem; }

/* Pricing */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 1rem; }
.plan { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.plan.featured { border-color: var(--primary); border-width: 2px; }
.plan .price { font-size: 2rem; font-weight: 800; margin: .5rem 0; }
.plan ul { list-style: none; padding: 0; margin: 1rem 0; flex: 1; }
.plan li { padding: .3rem 0; font-size: .9rem; border-bottom: 1px solid var(--border); }

/* QR-Template-Picker (im Modal) */
.qr-tpl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: .65rem;
  margin-top: .5rem;
}
.qr-tpl-card {
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: .5rem;
  cursor: pointer;
  transition: border-color .12s, box-shadow .12s;
  background: var(--surface);
  user-select: none;
  text-align: center;
}
.qr-tpl-card:hover:not(.qr-tpl-locked) { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(29,78,216,.12); }
.qr-tpl-selected { border-color: var(--primary) !important; box-shadow: 0 0 0 3px rgba(29,78,216,.18) !important; }
.qr-tpl-locked { opacity: .45; cursor: not-allowed; filter: grayscale(.4); }
.qr-tpl-preview {
  background: var(--tpl-bg, #fff);
  border-radius: 6px;
  overflow: hidden;
  padding: 6px;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.qr-tpl-mock { flex: 1; display: flex; align-items: center; justify-content: center; }
.qr-tpl-mock svg { width: 100%; height: auto; max-height: 56px; }
.qr-tpl-label {
  font-size: .5rem; font-weight: 800; letter-spacing: .06em;
  text-align: center; padding: 3px 2px 2px; color: #fff;
  border-radius: 0 0 3px 3px; margin: 2px -6px -6px;
}
.qr-tpl-name {
  font-size: .7rem; font-weight: 600; color: var(--text);
  margin-top: .3rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.qr-tpl-badges { display: flex; flex-wrap: wrap; gap: .2rem; justify-content: center; margin-top: .2rem; }

/* Premium-Upload-Placeholder (Karte anlegen) */
.premium-preview-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.premium-preview-field { flex: 1; min-width: 140px; }
.premium-preview-field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .4rem; }
.badge-premium { display: inline-block; padding: .1rem .4rem; border-radius: 999px; font-size: .68rem; font-weight: 700; background: #dbeafe; color: #1d4ed8; vertical-align: middle; margin-left: .25rem; }
/* Kennzeichnung neu eingeführter Funktionen (Badge „NEU!") */
.badge-neu { display: inline-block; padding: .1rem .45rem; border-radius: 999px; font-size: .66rem; font-weight: 800; letter-spacing: .04em; background: linear-gradient(90deg, #f43f5e, #d946ef); color: #fff; vertical-align: middle; margin-left: .3rem; white-space: nowrap; }
.premium-upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  height: 80px;
  border: 2px dashed var(--border);
  border-radius: 10px;
  background: #f9fafb;
  color: var(--muted);
  font-size: 1.5rem;
}
.premium-upload-placeholder .muted.small { font-size: .78rem; }

.fa-icon-grid {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,.12);
  max-height: 220px;
  overflow-y: auto;
  padding: .4rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
  gap: .25rem;
}
.fa-icon-grid button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, border-color .15s;
}
.fa-icon-grid button:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.fa-icon-grid .fa-grid-empty { grid-column: 1/-1; padding: .5rem; text-align: center; color: var(--muted); font-size: .85rem; }

/* Block 1: Passwort-Toggle */
.pw-wrap { position: relative; }
.pw-wrap input[type="password"],
.pw-wrap input[type="text"] { padding-right: 2.8rem; }
.pw-toggle {
  position: absolute; right: .55rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; font-size: 1.1rem;
  color: var(--muted); padding: .2rem; line-height: 1;
}
.pw-toggle:hover { color: var(--text); }

/* Block 4: Alert close button */
.alert { position: relative; padding-right: 2.5rem; }
.alert-close {
  position: absolute; right: .6rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; font-size: 1.1rem;
  color: inherit; opacity: .6; line-height: 1; padding: .2rem .4rem;
}
.alert-close:hover { opacity: 1; }

/* Block 5: Hamburger-Button */
.hamburger {
  display: none;
  flex-direction: column; justify-content: center; gap: 5px;
  width: 40px; height: 40px;
  background: none; border: 1px solid var(--border); border-radius: 8px;
  cursor: pointer; padding: 8px;
}
.hamburger span {
  display: block; height: 2px; background: var(--text);
  border-radius: 2px; transition: transform .2s, opacity .2s;
}
.hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Block 6: Editor 2-Spalten + Phone-Frame */
.editor-grid { display: grid; grid-template-columns: 1fr 340px; gap: 1.5rem; align-items: start; }
.editor-form  { min-width: 0; }
.preview-pane { position: sticky; top: 90px; }
.phone-frame {
  background: #111; border-radius: 36px; padding: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,.35);
  aspect-ratio: 9/19;
  overflow: hidden;
  display: flex; flex-direction: column;
}
.phone-frame iframe {
  flex: 1; border: none; border-radius: 28px;
  width: 100%; height: 100%;
  background: #fff;
}
.preview-toggle { display: none; }

@media (max-width: 760px) {
  /* Kein horizontales Seiten-Panning: zu breite Inhalte werden geclippt (breite
     Tabellen etc. scrollen in ihren eigenen Wrappern) — fixe Elemente wie der
     Vorschau-Button im Editor bleiben so dauerhaft im Sichtbereich */
  html, body { overflow-x: clip; }
  .layout { grid-template-columns: 1fr; }
  /* Topbar kompakt: kleineres Logo + engere Nav, damit alles nebeneinander passt */
  .topbar .container { gap: .5rem; padding: 0 1rem; }
  .brand-img img { height: 44px; }
  .brand-img svg.vz-logo { height: 18px; }
  .nav { gap: .1rem; }
  .nav a { padding: .4rem .5rem; font-size: .85rem; }
  /* Sekundäre Anker-Links (z. B. Funktionen/Preise) mobil ausblenden */
  .nav a.nav-sec { display: none; }
  /* 16px verhindert den Auto-Zoom von iOS Safari beim Fokussieren von Eingabefeldern */
  input, select, textarea { font-size: 16px; }
  /* Breite Tabellen (Leads, Buchungen, Admin) horizontal wischbar statt Seiten-Overflow */
  .card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  /* Seitenköpfe (Titel + Aktionen) umbrechen statt überlaufen */
  .spread { flex-wrap: wrap; }
  .sidebar {
    display: none;
    position: absolute;
    top: 76px; left: 0; right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 14px 30px rgba(0,0,0,.14);
    flex-direction: column;
    gap: .1rem;
    padding: .6rem;
    z-index: 30;
    /* Lange Menüs (Admin) im Ausklapp-Menü scrollbar statt unerreichbar */
    max-height: calc(100dvh - 76px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .sidebar.open { display: flex; }
  /* Komfortable Tap-Ziele im mobilen Menü */
  .sidebar a, .sidebar .nav-soon { padding: .85rem .8rem; font-size: 1rem; border-radius: 12px; }
  .sidebar a > i, .sidebar .nav-soon > i { width: 1.3rem; font-size: 1.05rem; }
  .hamburger { display: flex; }
  .nav .label { display: none; }
  .qr-tpl-grid { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
  /* Block 6 mobil */
  .editor-grid { grid-template-columns: 1fr; }
  .preview-pane { position: static; }
  .phone-frame { aspect-ratio: 9/16; max-width: 360px; margin: 0 auto; }
  .preview-toggle { display: block; }
}

@media (min-width: 761px) {
  /* Sidebar bleibt beim Scrollen stehen → Konto-Footer immer sichtbar */
  .sidebar {
    display: flex !important;
    position: sticky;
    top: 76px;
    align-self: start;
    /* volle sichtbare Höhe abzüglich Topbar (76px) und Layout-Padding (2× 1.5rem),
       damit der Konto-Footer auch ohne Scrollen im Viewport bleibt */
    height: calc(100vh - 76px - 3rem);
    /* Viele Menüpunkte (Admin-Bereich): scrollen statt quetschen/abschneiden.
       KEIN overscroll-behavior:contain — das würde das Seiten-Scrollen blockieren,
       sobald die Maus über der (nicht überlangen) Sidebar steht. */
    overflow-y: auto;
  }
  /* Menüpunkte nie vertikal zusammenstauchen (flex-shrink im Spaltenlayout) */
  .sidebar > a, .sidebar .sep, .sidebar .nav-soon, .sidebar-bottom { flex: none; }
  /* Konto-Footer klebt beim Menü-Scrollen sichtbar am unteren Rand */
  .sidebar-account { position: sticky; bottom: 0; background: var(--bg); }
  /* Admin-Menü: kompaktere Zeilen, damit alle Punkte auf normale Bildschirme passen */
  .sidebar.admin a, .sidebar.admin .nav-soon { padding: .42rem .7rem; font-size: .88rem; }
  .sidebar.admin .sep { margin: .3rem .3rem; }
}

/* =====================================================================
   Dark Mode
   Aktiviert über <html data-theme="dark"> (Toggle in der Topbar, per
   localStorage gemerkt; Default folgt der System-Einstellung). Basis-
   Komponenten (.card/.tile/.topbar/Tabellen) nutzen bereits Variablen —
   hier nur die Variablen-Overrides plus die wenigen hart kodierten Stellen.
   ===================================================================== */
:root[data-theme="dark"] {
  --bg: #0f1115;
  --surface: #171a21;
  --text: #e6e8ee;
  --muted: #9aa2ae;
  --border: #2a2f3a;
  --primary: #60a5fa;
  --primary-hover: #93c5fd;
  --danger: #f2555a;
  --success: #34d399;
  --shadow: 0 1px 3px rgba(0,0,0,.5), 0 8px 24px rgba(0,0,0,.4);
}
:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea { background: #12151b; color: var(--text); border-color: var(--border); }
:root[data-theme="dark"] input::placeholder,
:root[data-theme="dark"] textarea::placeholder { color: #6b7280; }
:root[data-theme="dark"] .btn.secondary { background: var(--surface); color: var(--text); }
:root[data-theme="dark"] .btn.secondary:hover { background: #232833; }
:root[data-theme="dark"] .nav a:hover,
:root[data-theme="dark"] .nav a.active,
:root[data-theme="dark"] .account-menu a:hover,
:root[data-theme="dark"] .account-menu button:hover { background: #232833; }
:root[data-theme="dark"] .account-btn:hover { background: #1e222b; }
:root[data-theme="dark"] .account-menu .account-logout:hover { background: #2a1416; }
:root[data-theme="dark"] .bio-toolbar button.bio-tb-active { background: #26304d; color: #bfdbfe; }
:root[data-theme="dark"] .premium-upload-placeholder { background: #12151b; }
:root[data-theme="dark"] .brand em { color: var(--text); }

/* Alerts (dunkle Tönungen) */
:root[data-theme="dark"] .alert.success { background: #0e2a1f; color: #6ee7b7; border-color: #14532d; }
:root[data-theme="dark"] .alert.error   { background: #2a1416; color: #fca5a5; border-color: #7f1d1d; }
:root[data-theme="dark"] .alert.info    { background: #0e1f38; color: #93c5fd; border-color: #1e3a8a; }

/* Getönte Hinweis-Karten (dunkle Tönungen) */
:root[data-theme="dark"] .card.tint-red   { border-color: #7f1d1d; background: #2a1416; }
:root[data-theme="dark"] .card.tint-amber { border-color: #78571a; background: #2a2113; }

/* Badges (dunkle Tönungen) */
:root[data-theme="dark"] .badge         { background: #1e2740; color: #93c5fd; }
:root[data-theme="dark"] .badge.gray    { background: #242833; color: var(--muted); }
:root[data-theme="dark"] .badge.green   { background: #0e2a1f; color: #6ee7b7; }
:root[data-theme="dark"] .badge.red     { background: #2a1416; color: #fca5a5; }
:root[data-theme="dark"] .badge.amber   { background: #2a2113; color: #fcd34d; }
:root[data-theme="dark"] .badge.blue    { background: #0e1f38; color: #93c5fd; }
:root[data-theme="dark"] .badge.purple  { background: #221a3a; color: #c4b5fd; }
:root[data-theme="dark"] .badge.orange  { background: #2a1a10; color: #fdba74; }
:root[data-theme="dark"] .badge-premium { background: #0e1f38; color: #93c5fd; }

/* Theme-Umschalter (Topbar) */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px; cursor: pointer;
  background: transparent; border: 1px solid var(--border); color: var(--text);
  font-size: 1rem; line-height: 1; flex: none;
}
.theme-toggle:hover { background: var(--surface); }
.theme-toggle .tt-sun { display: none; }
.theme-toggle .tt-moon { display: inline; }
:root[data-theme="dark"] .theme-toggle .tt-sun { display: inline; }
:root[data-theme="dark"] .theme-toggle .tt-moon { display: none; }

/* Sprachumschalter DE/EN (Topbar, Footer, öffentliche Karte) */
.lang-switch {
  display: inline-flex; align-items: center; gap: .15rem; flex: none;
  border: 1px solid var(--border); border-radius: 999px; padding: .14rem .3rem;
  font-size: .78rem; font-weight: 700; line-height: 1;
}
.lang-switch a { padding: .22rem .45rem; border-radius: 999px; color: inherit; opacity: .55; text-decoration: none; }
.lang-switch a:hover { opacity: .85; text-decoration: none; }
.lang-switch a.active { opacity: 1; background: var(--bg); }
.nav .lang-switch a { font-size: inherit; font-weight: inherit; }
.lang-switch.inline { vertical-align: middle; }

/* =====================================================================
   Sendungsverfolgung — Fortschrittsleiste + Ereignis-Verlauf
   Wird im Admin (/admin/shipments) und im Kundenportal
   (/dashboard/shipments) verwendet. Farben ausschließlich über die
   Theme-Variablen, damit der Dark Mode automatisch mitgeht.
   ===================================================================== */
.ship-steps { display: flex; align-items: flex-start; gap: 0; margin: .9rem 0 .4rem; }
.ship-steps .st { flex: 1; text-align: center; position: relative; font-size: .74rem; color: var(--muted); min-width: 0; }
/* Verbindungslinie zwischen den Punkten */
.ship-steps .st::before {
  content: ""; position: absolute; top: 9px; left: -50%; width: 100%; height: 2px;
  background: var(--border);
}
.ship-steps .st:first-child::before { display: none; }
.ship-steps .st .dot {
  position: relative; z-index: 1; display: block; width: 20px; height: 20px; margin: 0 auto .35rem;
  border-radius: 50%; background: var(--surface); border: 2px solid var(--border);
}
.ship-steps .st.done { color: var(--text); font-weight: 600; }
.ship-steps .st.done .dot { background: var(--primary); border-color: var(--primary); }
.ship-steps .st.done::before { background: var(--primary); }
.ship-steps .st .lbl { display: block; overflow-wrap: anywhere; }
/* Sonderfall (Problem/Rücksendung): Leiste in Rot statt Fortschritt */
.ship-steps.alert .st.done .dot { background: var(--danger); border-color: var(--danger); }
.ship-steps.alert .st.done::before { background: var(--danger); }

.ship-log { list-style: none; margin: .6rem 0 0; padding: 0 0 0 1.1rem; border-left: 2px solid var(--border); }
.ship-log li { position: relative; padding: 0 0 .75rem; font-size: .88rem; }
.ship-log li:last-child { padding-bottom: 0; }
.ship-log li::before {
  content: ""; position: absolute; left: -1.45rem; top: .45rem;
  width: 8px; height: 8px; border-radius: 50%; background: var(--border);
}
.ship-log li.now::before { background: var(--primary); box-shadow: 0 0 0 3px rgba(29,78,216,.15); }
.ship-log .t { display: block; font-size: .76rem; color: var(--muted); }
.ship-log .where { color: var(--muted); }

@media (max-width: 520px) {
  .ship-steps .st { font-size: .68rem; }
}
