/* ─────────────────────────────────────────────────────────────────────────
   Zugbegleiter Serviceportal · Stylesheet
   Übernahme der Optik aus der Vorlage (NX-Rot, dunkles Theme, Barlow)
   Erweitert um: KB-Logo, zentrierter Titel, Admin-Modal mit Tabs, PIN-Maske
   ───────────────────────────────────────────────────────────────────────── */

:root {
  --nx-red:       #E4002B;
  --nx-red-dark:  #b8001f;
  --nx-red-glow:  rgba(228,0,43,0.35);
  --nx-red-soft:  rgba(228,0,43,0.12);
  --bg:           #111114;
  --surface:      #1c1c21;
  --surface2:     #26262d;
  --surface3:     #2f2f38;
  --green:        #2dcc7a;
  --purple:       #7c3aed;
  --text:         #f0f0f2;
  --text-soft:    #b8b9c4;
  --muted:        #6e6f7e;
  --border:       #2e2e38;
  --border-light: #3a3a46;
  --radius:       12px;
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font-display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --font-body:    'Barlow', 'Segoe UI', system-ui, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
html { height: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  height: 100%;
  overflow-x: hidden;
  padding-bottom: calc(70px + var(--safe-bottom));
}
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--nx-red-dark); border-radius: 2px; }

/* ── HEADER (Grid: Logo links · Titel mittig · Info rechts) ──────────────── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 2px solid var(--nx-red);
  padding: calc(var(--safe-top) + 12px) 16px 12px;
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  align-items: center;
  gap: 12px;
}
.header-logo  { justify-self: start; }
.header-right { justify-self: end; }
.header-title-wrap {
  justify-self: center;
  text-align: center;
  line-height: 1.1;
  min-width: 0;
}
.kb-logo-mark {
  width: 36px; height: 36px;
  background: var(--nx-red);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
  flex-shrink: 0;
  box-shadow: 0 0 14px var(--nx-red-glow);
  border: none;
  cursor: pointer;
  transition: transform .12s, box-shadow .15s;
}
.kb-logo-mark:hover  { box-shadow: 0 0 20px var(--nx-red-glow); }
.kb-logo-mark:active { transform: scale(.92); }
.header-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.header-title span { color: var(--nx-red); }
.header-sub {
  font-size: .55rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 2px;
}
.icon-btn {
  width: 36px; height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: var(--surface2);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, transform .12s;
  flex-shrink: 0;
}
.icon-btn:hover  { background: var(--surface3); }
.icon-btn:active { transform: scale(.92); }

@media (min-width: 480px) {
  .header-title { font-size: 1.15rem; }
  .header-sub   { font-size: .58rem; }
}

/* ── SEARCH ─────────────────────────────────────────────────────────────── */
.search-wrap {
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.search-inner { position: relative; }
.search-icon {
  position: absolute; left: 11px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: .85rem;
  pointer-events: none;
}
.search-wrap input {
  width: 100%;
  padding: 9px 14px 9px 34px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: .9rem;
  font-family: var(--font-body);
  outline: none;
  transition: border-color .2s;
}
.search-wrap input:focus {
  border-color: var(--nx-red);
  box-shadow: 0 0 0 2px var(--nx-red-soft);
}
.search-wrap input::placeholder { color: var(--muted); }

/* ── BOTTOM NAV ─────────────────────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  padding-bottom: var(--safe-bottom);
}
.nav-item {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 8px 4px;
  cursor: pointer;
  transition: opacity .15s;
  color: var(--muted);
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  gap: 3px;
  min-width: 0;
  border: none;
  background: none;
  font-family: var(--font-body);
}
.nav-item:active { opacity: .6; }
.nav-item.active { color: var(--nx-red); }
.nav-item.active .nav-icon-wrap {
  background: var(--nx-red-soft);
  border-radius: 8px;
}
.nav-icon-wrap {
  width: 32px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.nav-icon { font-size: 1.1rem; line-height: 1; }
.nav-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* ── CONTENT ─────────────────────────────────────────────────────────────── */
.content {
  padding: 14px 16px;
  max-width: 900px;
  margin: 0 auto;
}
.section { margin-bottom: 24px; }
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.section-title-wrap { display: flex; align-items: center; gap: 7px; }
.section-title-bar {
  width: 3px; height: 14px;
  background: var(--nx-red);
  border-radius: 2px;
}
.section-title {
  font-family: var(--font-display);
  font-size: .8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-soft);
}
.nx-divider {
  height: 2px;
  background: linear-gradient(90deg, var(--nx-red) 0%, transparent 100%);
  border-radius: 2px;
  margin: 0 0 16px;
  opacity: .5;
}
.tab-section { display: none; }
.tab-section.active { display: block; }

/* ── APP GRID ───────────────────────────────────────────────────────────── */
.app-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
@media (min-width: 600px) { .app-grid { grid-template-columns: repeat(6, 1fr); } }
@media (min-width: 900px) { .app-grid { grid-template-columns: repeat(8, 1fr); } }
.app-tile {
  display: flex; flex-direction: column;
  align-items: center; gap: 5px;
  padding: 12px 6px;
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: background .15s, border-color .15s, transform .12s;
  text-decoration: none;
  color: inherit;
}
.app-tile:hover  { border-color: var(--border-light); background: var(--surface2); }
.app-tile:active { transform: scale(.93); background: var(--surface3); }
.app-tile-icon { font-size: 1.7rem; line-height: 1; }
.app-tile-label {
  font-size: .62rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.2;
  color: var(--text-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  letter-spacing: .2px;
}

/* ── LIST CARDS (Dateien, Links) ─────────────────────────────────────────── */
.list-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 7px;
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  text-decoration: none;
  color: inherit;
}
.list-card:hover  { border-color: var(--border-light); background: var(--surface2); }
.list-card:active { background: var(--surface3); }
.list-card-icon { font-size: 1.4rem; flex-shrink: 0; }
.list-card-body { flex: 1; min-width: 0; }
.list-card-title { font-size: .87rem; font-weight: 700; }
.list-card-sub {
  font-size: .72rem;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-card-badge {
  font-size: .6rem;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 800;
  flex-shrink: 0;
  letter-spacing: .4px;
  text-transform: uppercase;
  background: var(--nx-red-soft);
  color: var(--nx-red);
  border: 1px solid rgba(228,0,43,0.25);
  font-family: var(--font-display);
}

/* ── ACCORDION (Wissen / Rechte) ─────────────────────────────────────────── */
.accordion-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 9px;
  overflow: hidden;
}
.accordion-header {
  padding: 11px 14px;
  display: flex; align-items: center; gap: 10px;
  cursor: pointer;
  user-select: none;
  transition: background .15s;
}
.accordion-card.open .accordion-header { border-bottom: 1px solid var(--border); }
.accordion-header:hover { background: var(--surface2); }
.acc-icon { font-size: 1.4rem; flex-shrink: 0; }
.acc-info { flex: 1; min-width: 0; }
.acc-title { font-size: .9rem; font-weight: 700; }
.acc-sub {
  font-size: .7rem;
  color: var(--muted);
  margin-top: 1px;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.acc-badge {
  font-size: .6rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 5px;
  background: var(--nx-red-soft);
  color: var(--nx-red);
  flex-shrink: 0;
  border: 1px solid rgba(228,0,43,0.25);
  font-family: var(--font-display);
  letter-spacing: .6px;
  text-transform: uppercase;
}
.accordion-chevron {
  font-size: 1.3rem;
  font-weight: 300;
  color: var(--muted);
  transition: transform .25s ease;
  line-height: 1;
  flex-shrink: 0;
}
.accordion-card.open .accordion-chevron {
  transform: rotate(90deg);
  color: var(--text-soft);
}
.accordion-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .28s ease;
}
.accordion-card.open .accordion-body { grid-template-rows: 1fr; }
.accordion-body-inner { overflow: hidden; min-height: 0; }
.accordion-content { padding: 12px 14px 14px; }
.acc-section-label {
  font-size: .63rem;
  font-weight: 800;
  color: var(--nx-red);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin: 12px 0 6px;
  font-family: var(--font-display);
}
.acc-section-label:first-child { margin-top: 0; }
.trow { display: flex; gap: 8px; margin-bottom: 5px; }
.trow-label {
  font-size: .66rem;
  color: var(--muted);
  font-weight: 800;
  min-width: 92px;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding-top: 1px;
}
.trow-val {
  font-size: .78rem;
  color: var(--text);
  line-height: 1.45;
}
.trow-val.green     { color: var(--green);  font-weight: 700; }
.trow-val.highlight { color: var(--nx-red); font-weight: 700; }
.acc-note {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: .8rem;
  line-height: 1.7;
  color: var(--text-soft);
  white-space: pre-wrap;
}
.acc-list { list-style: none; padding: 0; margin: 4px 0; }
.acc-list li {
  font-size: .8rem;
  color: var(--text-soft);
  line-height: 1.55;
  padding: 3px 0 3px 14px;
  position: relative;
}
.acc-list li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--nx-red);
  font-weight: 800;
}
.acc-actions {
  border-top: 1px solid var(--border);
  display: flex;
}
.acc-action-btn {
  flex: 1;
  padding: 9px;
  text-align: center;
  font-size: .71rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  border: none;
  background: none;
  border-right: 1px solid var(--border);
  transition: background .15s, color .15s;
  font-family: var(--font-body);
  text-decoration: none;
  display: block;
}
.acc-action-btn:last-child { border-right: none; }
.acc-action-btn:active     { background: var(--surface2); color: var(--text); }
.acc-action-btn:hover      { background: var(--surface2); color: var(--text); }

/* Fahrgastrechte = lila */
.fgr-card {
  background: var(--surface);
  border: 1px solid rgba(124,58,237,0.25);
  border-left: 3px solid var(--purple);
  border-radius: var(--radius);
  margin-bottom: 9px;
  overflow: hidden;
}
.fgr-card.open .accordion-header { border-bottom: 1px solid rgba(124,58,237,0.15); }
.fgr-badge {
  font-size: .6rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 5px;
  background: rgba(124,58,237,0.2);
  color: #c4a3ff;
  flex-shrink: 0;
  border: 1px solid rgba(124,58,237,0.35);
  font-family: var(--font-display);
  letter-spacing: .6px;
  text-transform: uppercase;
}
.fgr-card .accordion-chevron { color: rgba(196,163,255,0.45); }
.fgr-card.open .accordion-chevron { color: #c4a3ff; }
.fgr-card .acc-section-label { color: #c4a3ff; }
.fgr-card .acc-list li::before { color: #c4a3ff; }
.fgr-card .trow-val.highlight { color: #c4a3ff; }
.fgr-card .acc-actions { border-top: 1px solid rgba(124,58,237,0.15); }
.fgr-card .acc-action-btn { border-right: 1px solid rgba(124,58,237,0.15); }
.fgr-card .acc-action-btn:last-child { border-right: none; }

/* ── VERBUND-FILTER ──────────────────────────────────────────────────────── */
.verbund-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 12px;
  scrollbar-width: none;
}
.verbund-scroll::-webkit-scrollbar { display: none; }
.verbund-chip {
  padding: 5px 14px;
  border-radius: 6px;
  font-size: .72rem;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid var(--border-light);
  background: var(--surface);
  color: var(--muted);
  transition: background .2s, color .2s, border-color .2s;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: .5px;
  font-family: var(--font-display);
}
.verbund-chip.active { color: #fff; border-color: transparent; }

/* ── ANSAGEN ─────────────────────────────────────────────────────────────── */
.ansagen-info {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--nx-red);
  border-radius: var(--radius);
  padding: 11px 14px;
  margin-bottom: 14px;
  font-size: .82rem;
  line-height: 1.6;
  color: var(--text-soft);
}
.ansagen-info strong {
  color: var(--nx-red);
  font-family: var(--font-display);
  letter-spacing: .5px;
}
.ansagen-provider-line {
  margin-top: 6px;
  font-size: .72rem;
  color: var(--muted);
  font-family: var(--font-display);
  letter-spacing: .5px;
}
.ansagen-provider-line span { color: var(--nx-red); font-weight: 800; }
.kw-label {
  font-family: var(--font-display);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.kw-scroll {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 14px;
}
.kw-chip {
  padding: 5px 13px;
  border-radius: 6px;
  font-size: .72rem;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid var(--border-light);
  background: var(--surface);
  color: var(--muted);
  transition: background .15s, color .15s;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: .4px;
}
.kw-chip.selected {
  background: var(--nx-red-soft);
  color: var(--nx-red);
  border-color: rgba(228,0,43,0.4);
}
.ansagen-input-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 10px;
}
.ansagen-textarea {
  width: 100%;
  padding: 12px 14px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-body);
  font-size: .87rem;
  resize: none;
  min-height: 72px;
}
.ansagen-textarea::placeholder { color: var(--muted); }
.ansagen-input-footer {
  border-top: 1px solid var(--border);
  padding: 8px 10px;
  display: flex; align-items: center; justify-content: space-between;
}
.ansagen-sub { font-size: .68rem; color: var(--muted); }
.btn-generate {
  background: var(--nx-red);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-family: var(--font-display);
  font-size: .85rem;
  font-weight: 800;
  letter-spacing: .5px;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background .15s, transform .12s;
}
.btn-generate:active   { transform: scale(.95); background: var(--nx-red-dark); }
.btn-generate:disabled { opacity: .45; cursor: not-allowed; }
.ansagen-loading {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  font-size: .82rem;
  color: var(--muted);
}
.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(228,0,43,0.25);
  border-top-color: var(--nx-red);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.ansagen-output {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--nx-red);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 10px;
}
.ansagen-output.visible { display: block; }
.ansagen-output-header {
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.ansagen-output-label {
  font-size: .63rem;
  font-weight: 800;
  color: var(--nx-red);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-family: var(--font-display);
}
.copy-btn {
  font-size: .7rem;
  font-weight: 700;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 5px;
  transition: background .15s, color .15s;
  font-family: var(--font-body);
}
.copy-btn:active { background: var(--surface2); color: var(--text); }
.ansagen-output-text {
  padding: 12px 14px;
  font-size: .85rem;
  line-height: 1.75;
  color: var(--text);
  white-space: pre-wrap;
}
.history-label {
  font-family: var(--font-display);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  margin: 16px 0 8px;
}
.history-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 7px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.history-item:hover { background: var(--surface2); border-color: var(--border-light); }
.history-meta {
  font-size: .65rem;
  color: var(--muted);
  margin-bottom: 4px;
  display: flex; gap: 8px; align-items: center;
}
.history-meta .h-tag {
  color: var(--nx-red);
  font-weight: 800;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: .4px;
}
.history-text {
  font-size: .8rem;
  color: var(--text-soft);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.api-hint {
  background: var(--surface);
  border: 1px solid rgba(228,0,43,0.3);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-top: 10px;
  font-size: .8rem;
  color: var(--muted);
  line-height: 1.6;
  display: none;
}

/* ── MODALS ─────────────────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  z-index: 200;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(8px);
  align-items: flex-end;
  justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface);
  width: 100%;
  max-width: 600px;
  border-radius: 20px 20px 0 0;
  padding: 10px 20px 30px;
  max-height: 92vh;
  overflow-y: auto;
  animation: slideUp .22s ease;
}
.modal-narrow { max-width: 420px; }
.modal-large {
  max-width: 900px;
  padding: 10px 0 30px;
}
.modal-large .admin-tabs,
.modal-large .admin-body,
.modal-large .admin-header { padding-left: 20px; padding-right: 20px; }
@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.modal-handle {
  width: 40px; height: 4px;
  background: var(--border-light);
  border-radius: 2px;
  margin: 0 auto 16px;
}
.modal h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: .5px;
  margin-bottom: 16px;
  color: var(--text);
}
.modal-actions {
  display: flex; gap: 10px;
  margin-top: 18px;
}
.btn {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  font-size: .88rem;
  font-weight: 700;
  font-family: var(--font-display);
  letter-spacing: .5px;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  transition: background .15s, transform .12s;
}
.btn:active     { transform: scale(.97); }
.btn-primary    { background: var(--nx-red); color: #fff; }
.btn-primary:active { background: var(--nx-red-dark); }
.btn-ghost      { background: var(--surface2); color: var(--muted); border: 1px solid var(--border-light); }
.btn-ghost:active { background: var(--surface3); color: var(--text); }
.btn-danger     { background: rgba(228,0,43,0.1); color: #ff4466; border: 1px solid rgba(228,0,43,0.25); }
.btn-danger:active { background: rgba(228,0,43,0.2); }
.btn-success    { background: rgba(45,204,122,0.1); color: var(--green); border: 1px solid rgba(45,204,122,0.3); }

/* Forms */
.form-group { margin-bottom: 12px; }
.form-group label {
  display: block;
  font-size: .7rem;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: 5px;
  font-family: var(--font-display);
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: .87rem;
  font-family: var(--font-body);
  outline: none;
  transition: border-color .2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--nx-red); }
.form-group textarea {
  resize: vertical;
  min-height: 80px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: .8rem;
}
.form-group textarea.normal-text {
  font-family: var(--font-body);
  font-size: .87rem;
}
.form-group select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236e6f7e' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.form-row.three { grid-template-columns: 1fr 1fr 1fr; }
.form-section-label {
  font-size: .65rem;
  font-weight: 800;
  color: var(--nx-red);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin: 14px 0 10px;
  font-family: var(--font-display);
  border-top: 1px solid var(--border);
  padding-top: 14px;
}
.form-section-label:first-child {
  margin-top: 0;
  border-top: none;
  padding-top: 0;
}
.form-help {
  font-size: .72rem;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.5;
}

/* PIN-Input speziell */
#pin-input {
  text-align: center;
  letter-spacing: 8px;
  font-size: 1.4rem;
  font-family: 'Consolas', monospace;
  padding: 14px;
}
.pin-error {
  font-size: .8rem;
  color: var(--nx-red);
  text-align: center;
  margin-top: 4px;
}

/* IMPRESSUM */
.imp-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: .5px;
  margin-bottom: 14px;
}
.imp-line {
  font-size: .85rem;
  line-height: 1.9;
  color: var(--text-soft);
}
.imp-line a { color: var(--nx-red); text-decoration: none; }
.imp-disclaimer {
  margin-top: 14px;
  padding: 12px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: .75rem;
  color: var(--muted);
  line-height: 1.6;
}

/* INSTALL BANNER */
.install-banner {
  display: none;
  position: fixed;
  top: calc(var(--safe-top) + 72px);
  left: 12px; right: 12px;
  background: var(--nx-red);
  color: #fff;
  border-radius: 12px;
  padding: 11px 15px;
  z-index: 150;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 30px var(--nx-red-glow);
}
.install-banner.show { display: flex; }
.install-banner-text { flex: 1; font-size: .82rem; font-weight: 600; }
.install-banner-btn {
  padding: 6px 14px;
  border-radius: 6px;
  background: #fff;
  color: var(--nx-red);
  font-weight: 800;
  font-size: .78rem;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--font-display);
  letter-spacing: .3px;
  text-transform: uppercase;
}
.install-banner-close {
  font-size: 1rem;
  cursor: pointer;
  opacity: .75;
  background: none;
  border: none;
  color: #fff;
}

/* EMPTY */
.empty {
  text-align: center;
  padding: 32px 20px;
  color: var(--muted);
  font-size: .86rem;
  border: 1px dashed var(--border-light);
  border-radius: var(--radius);
}
.empty-icon { font-size: 1.8rem; margin-bottom: 8px; }

/* ── ADMIN-MODAL ─────────────────────────────────────────────────────────── */
.admin-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.admin-header h3 { margin-bottom: 0; }
.logout-btn {
  font-size: .7rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 7px;
  background: var(--surface2);
  color: var(--muted);
  border: 1px solid var(--border-light);
  cursor: pointer;
  font-family: var(--font-display);
  letter-spacing: .4px;
  text-transform: uppercase;
}
.logout-btn:hover { color: var(--text); border-color: var(--nx-red); }
.admin-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}
.admin-tabs::-webkit-scrollbar { display: none; }
.adm-tab {
  flex-shrink: 0;
  padding: 8px 12px;
  background: none;
  border: none;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.adm-tab:hover { color: var(--text-soft); }
.adm-tab.active {
  color: var(--nx-red);
  border-bottom-color: var(--nx-red);
}
.admin-body {
  min-height: 300px;
}

.adm-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}
.adm-toolbar .left { font-size: .8rem; color: var(--muted); }
.adm-add-btn {
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--nx-red);
  color: #fff;
  border: none;
  font-family: var(--font-display);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .4px;
  text-transform: uppercase;
  cursor: pointer;
}
.adm-add-btn:active { background: var(--nx-red-dark); }

.adm-list {
  display: flex; flex-direction: column;
  gap: 6px;
}
.adm-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.adm-item-icon { font-size: 1.2rem; flex-shrink: 0; }
.adm-item-body { flex: 1; min-width: 0; }
.adm-item-title {
  font-size: .85rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.adm-item-sub {
  font-size: .7rem;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.adm-item-tag {
  font-size: .6rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--nx-red-soft);
  color: var(--nx-red);
  font-family: var(--font-display);
  letter-spacing: .4px;
  text-transform: uppercase;
  flex-shrink: 0;
}
.adm-item-btns { display: flex; gap: 4px; flex-shrink: 0; }
.adm-icon-btn {
  width: 30px; height: 30px;
  border-radius: 7px;
  background: var(--surface2);
  border: 1px solid var(--border-light);
  color: var(--text-soft);
  font-size: .85rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.adm-icon-btn:hover { background: var(--surface3); color: var(--text); }
.adm-icon-btn.del:hover {
  background: rgba(228,0,43,0.15);
  color: #ff4466;
  border-color: rgba(228,0,43,0.4);
}

.adm-form-back {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  background: none;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  color: var(--muted);
  font-size: .75rem;
  cursor: pointer;
  margin-bottom: 12px;
  font-family: var(--font-body);
}
.adm-form-back:hover { color: var(--text); border-color: var(--text-soft); }

/* Files-Verwaltung */
.upload-zone {
  border: 2px dashed var(--border-light);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  margin-bottom: 14px;
  background: var(--bg);
}
.upload-zone.drag { border-color: var(--nx-red); background: var(--nx-red-soft); }
.upload-zone p { font-size: .82rem; color: var(--muted); margin-bottom: 8px; }
.upload-zone label {
  display: inline-block;
  padding: 8px 16px;
  background: var(--nx-red);
  color: #fff;
  border-radius: 7px;
  font-family: var(--font-display);
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .4px;
  text-transform: uppercase;
  cursor: pointer;
}
.upload-zone input[type="file"] { display: none; }

/* Tabellen-Editor für Rechte-Sections */
.section-editor {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  background: var(--bg);
}
.section-editor-head {
  display: flex; gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.section-editor-head select {
  flex: 1;
  padding: 6px 8px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  color: var(--text);
  font-size: .78rem;
}
.section-editor-body { padding: 10px; }

/* TOAST */
#zb-toast {
  position: fixed;
  bottom: calc(82px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface2);
  color: var(--text);
  padding: 10px 20px;
  border-radius: 8px;
  font-size: .84rem;
  font-weight: 700;
  z-index: 500;
  border: 1px solid var(--border-light);
  box-shadow: 0 4px 20px rgba(0,0,0,.5);
  transition: opacity .3s;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
}

/* CONFIRM */
.confirm-msg {
  font-size: .9rem;
  line-height: 1.6;
  color: var(--text-soft);
  padding: 4px 0 8px;
}

/* DESKTOP-Anpassung */
@media (min-width: 768px) {
  body { display: flex; justify-content: center; }
  #app-root { width: 100%; max-width: 900px; box-shadow: 0 0 60px rgba(0,0,0,.6); }
}
