:root {
  color-scheme: light;
  --navy-950: #07172c;
  --navy-900: #0b1f3a;
  --navy-800: #122b4d;
  --blue-600: #2563eb;
  --blue-500: #3b82f6;
  --blue-100: #eff6ff;
  --ink-950: #0f172a;
  --ink-800: #1e293b;
  --ink-600: #475569;
  --ink-500: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --surface: #ffffff;
  --canvas: #f8fafc;
  --green-700: #15803d;
  --green-100: #dcfce7;
  --amber-700: #b45309;
  --amber-100: #fef3c7;
  --red-700: #b91c1c;
  --red-100: #fee2e2;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 16px rgba(11, 31, 58, 0.08);
  --shadow-lg: 0 12px 36px rgba(11, 31, 58, 0.12);
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink-950);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
}

/* Header */
.app-header {
  background: linear-gradient(135deg, var(--navy-900), var(--navy-950));
  color: #ffffff;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-logo { width: 44px; height: 44px; flex-shrink: 0; }
.brand-title { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: 0.08em; white-space: nowrap; }
.brand-subtitle { margin: 2px 0 0; font-size: 12px; color: #94a3b8; }

.header-badges { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.badge {
  display: inline-flex; align-items: center;
  padding: 5px 12px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700;
  white-space: nowrap;
}
.badge-product {
  background: rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.badge-online { background: #14532d; color: #86efac; }

/* ── PORTAL SHELL & SIDEBAR NAVIGATION (GLIEDERUNG LINKS UNTEREINANDER) ── */
.portal-container {
  display: flex;
  align-items: flex-start;
  gap: 32px;
  width: min(1380px, 95%);
  margin: 28px auto 60px;
  flex: 1;
}

.portal-sidebar {
  width: 290px;
  flex-shrink: 0;
  position: sticky;
  top: 20px;
  background: var(--surface);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-md);
  padding: 20px 16px;
  box-shadow: 0 4px 18px rgba(11, 31, 58, 0.06);
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

.sidebar-header {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.sidebar-eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-500);
  margin-bottom: 3px;
}
.sidebar-title {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
  color: var(--navy-900);
  letter-spacing: -0.01em;
}

.portal-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  padding: 0;
  background: transparent;
  border: none;
  overflow: visible;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid transparent;
  border-left: 4px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-600);
  text-align: left;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
  text-decoration: none;
}
.nav-tab:hover {
  background: #f8fafc;
  color: var(--navy-900);
  border-color: #e2e8f0;
  border-left-color: #94a3b8;
  transform: translateX(2px);
}
.nav-tab.is-active {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
  border-left: 4px solid var(--blue-600);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
}

.tab-icon {
  font-size: 19px;
  line-height: 1;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}

.tab-label {
  font-size: 14px;
  font-weight: 700;
  color: inherit;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.tab-badge {
  background: var(--red-700);
  color: #ffffff;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 800;
  margin-left: auto;
  flex-shrink: 0;
}

/* Sidebar Info & Support Card */
.sidebar-help-box {
  margin-top: 4px;
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sidebar-help-header {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 800;
  color: #14532d;
}
.sidebar-help-icon {
  font-size: 16px;
  line-height: 1;
}
.sidebar-help-box p {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: #166534;
}
.sidebar-help-btn {
  margin-top: 4px;
  background: #15803d;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(21, 128, 61, 0.2);
}
.sidebar-help-btn:hover {
  background: #166534;
  transform: translateY(-1px);
}

/* Main Content */
.portal-content {
  flex: 1;
  min-width: 0;
  margin: 0;
  width: auto;
}
.view-header { margin-bottom: 24px; }
.view-header h2 { margin: 0 0 6px; font-size: 24px; color: var(--navy-900); }
.view-header p { margin: 0; color: var(--ink-600); font-size: 14px; }

/* Video Grid */
.video-grid { display: grid; grid-template-columns: 1fr; gap: 24px; }
.video-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-md); overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: grid; grid-template-columns: minmax(300px, 440px) 1fr;
}
@media (max-width: 940px) {
  .video-card { grid-template-columns: 1fr; }
}
.video-wrapper { position: relative; width: 100%; padding-bottom: 56.25%; background: #000; }
.video-wrapper iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.video-placeholder {
  background: #1e293b; color: #fff;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 28px; text-align: center;
}
.play-icon-large { font-size: 44px; margin-bottom: 8px; }
.video-info {
  padding: 24px 28px;
  display: flex; flex-direction: column; justify-content: center;
}
.video-kicker {
  font-size: 11px; font-weight: 800;
  text-transform: uppercase; color: var(--blue-600);
  letter-spacing: 0.08em; margin-bottom: 4px;
}
.video-info h3 { margin: 0 0 10px; font-size: 19px; color: var(--navy-900); }
.video-info p { margin: 0 0 14px; color: var(--ink-600); font-size: 13.5px; line-height: 1.5; }
.video-checkmarks {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 6px;
  font-size: 12.5px; color: var(--green-700); font-weight: 600;
}

/* FAQ Accordion */
.faq-accordion { display: flex; flex-direction: column; gap: 14px; }
.faq-item {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); overflow: hidden;
}
.faq-item summary {
  padding: 16px 20px; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 15px; font-weight: 700; color: var(--ink-950);
  list-style: none; background: #fff;
  transition: background 0.15s ease;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover { background: #f8fafc; }
.faq-toggle-icon { font-size: 11px; color: var(--ink-500); transition: transform 0.2s ease; }
.faq-item[open] .faq-toggle-icon { transform: rotate(180deg); }
.faq-body {
  padding: 0 20px 20px 20px;
  color: var(--ink-800); font-size: 13.5px; line-height: 1.55;
  border-top: 1px solid var(--line);
}
.solution-box {
  background: #eff6ff; border: 1.5px solid #bfdbfe;
  border-radius: var(--radius-sm); padding: 14px 18px; margin-top: 12px; color: #1e3a8a;
}
.solution-box ol { margin: 8px 0; padding-left: 20px; }
.warning-box {
  background: #fffbeb; border: 1.5px solid #fde68a;
  border-radius: var(--radius-sm); padding: 12px 16px; margin-top: 12px;
  color: #92400e; font-size: 13px;
}
.simple-table { width: 100%; border-collapse: collapse; margin-top: 14px; }
.simple-table th, .simple-table td { padding: 10px 14px; border: 1px solid var(--line); text-align: left; font-size: 13px; }
.simple-table th { background: #f1f5f9; font-weight: 700; }

/* ── Prominentes Auto-Tool Banner (Lenara Sofort-Hilfe) ── */
.auto-tool-banner {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border: 2px solid #86efac;
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin: 16px 0 24px;
  color: #14532d;
  box-shadow: 0 4px 14px rgba(22, 101, 52, 0.1);
}
.auto-tool-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #15803d;
  color: #fff;
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.auto-tool-banner h3 {
  margin: 0 0 8px;
  font-size: 17px;
  color: #052e16;
  font-weight: 800;
}
.auto-tool-banner p {
  margin: 0 0 12px;
  font-size: 13.5px;
  line-height: 1.55;
  color: #166534;
}
.auto-tool-checklist {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px 18px;
  font-size: 13.5px;
  line-height: 1.5;
  color: #14532d;
}
.auto-tool-checklist li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.5;
}
.auto-tool-checklist li .check-icon {
  flex-shrink: 0;
  font-size: 15px;
  margin-top: 1px;
}
.auto-tool-checklist li .check-text {
  flex: 1;
}
.auto-tool-note {
  font-size: 12.5px;
  color: #15803d;
  margin: 0;
  padding-top: 10px;
  border-top: 1px dashed rgba(22, 101, 52, 0.3);
  font-weight: 600;
}

/* ── Erklär-Karten Grid (Verhindert Textüberschneidungen) ── */
.explain-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin: 16px 0 20px;
}
.explain-card {
  background: var(--surface);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.explain-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 800;
  color: var(--navy-900);
  border-bottom: 1.5px solid var(--line);
  padding-bottom: 10px;
  margin-bottom: 4px;
}
.explain-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-800);
}
.explain-card.card-blue { border-top: 4px solid var(--blue-600); }
.explain-card.card-green { border-top: 4px solid #16a34a; }
.explain-card.card-amber { border-top: 4px solid #d97706; }
.explain-card.card-purple { border-top: 4px solid #7c3aed; }

/* ── FAQ Step Guides, Images & Copy Buttons ── */
.faq-section-title {
  margin: 22px 0 8px;
  font-size: 15px;
  font-weight: 800;
  color: var(--navy-900);
  border-bottom: 2px solid var(--blue-100);
  padding-bottom: 6px;
}
.guide-image-container {
  margin: 16px 0;
  text-align: center;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
}
.guide-screenshot {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
  cursor: zoom-in;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: block;
  margin: 0 auto;
}
.guide-screenshot:hover {
  transform: scale(1.01);
  box-shadow: var(--shadow-md);
}
.image-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--ink-500);
  font-weight: 600;
}
.step-list {
  padding-left: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 14px 0;
}
.step-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 13.5px;
  line-height: 1.5;
}
.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--blue-600);
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.step-text {
  flex: 1;
}
.copy-path-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 14px 0;
}
.copy-path-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f1f5f9;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 12px;
  gap: 12px;
  flex-wrap: wrap;
}
.copy-path-code {
  font-family: Consolas, monospace;
  font-size: 12.5px;
  color: #0f172a;
  word-break: break-all;
  flex: 1 1 220px;
  min-width: 0;
}
.copy-path-btn {
  padding: 6px 14px;
  font-size: 11.5px;
  font-weight: 700;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--navy-900);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}
.copy-path-btn:hover {
  background: var(--blue-100);
  color: var(--blue-600);
  border-color: #bfdbfe;
}
.copy-path-btn.is-copied {
  background: var(--green-100);
  color: var(--green-700);
  border-color: #86efac;
}
.code-box {
  background: #0f172a;
  color: #38bdf8;
  padding: 12px 16px;
  border-radius: 6px;
  font-family: Consolas, monospace;
  font-size: 12.5px;
  margin: 10px 0;
  white-space: pre;
  overflow-x: auto;
}

/* ── Responsive Tables (Verhindert Textüberlappung) ── */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 14px 0;
  border-radius: var(--radius-sm);
}

/* ── KUNDEN-ZIEL & NUTZEN BOX (Wohin will er? Was bekommt er dafür?) ── */
.goal-benefit-box {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1.5px solid var(--line-strong);
  border-left: 5px solid var(--blue-600);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}
.goal-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.goal-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.goal-pill.target { background: #dbeafe; color: #1e40af; }
.goal-pill.benefit { background: #dcfce7; color: #166534; }
.goal-text {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--navy-900);
  line-height: 1.45;
}

/* ── MODELL-WAHL FÜR CODIEREN (E-SERIE VS F/G-SERIE) ── */
.model-switch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin: 16px 0 24px;
}
.model-switch-card {
  background: var(--surface);
  border: 2px solid var(--line-strong);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: flex-start;
  gap: 14px;
  text-decoration: none;
  color: inherit;
}
.model-switch-card:hover {
  border-color: var(--blue-600);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.12);
  transform: translateY(-2px);
}
.model-switch-card.is-active {
  border-color: var(--blue-600);
  background: #f0f7ff;
}
.model-switch-icon {
  font-size: 32px;
  flex-shrink: 0;
  line-height: 1;
}
.model-switch-title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 800;
  color: var(--navy-900);
}
.model-switch-desc {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-600);
  line-height: 1.4;
}

/* Ticket Unified Subnav & Panels */
.ticket-subnav {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
  background: var(--surface);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  width: fit-content;
}

.ticket-subnav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-600);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
  text-decoration: none;
}

.ticket-subnav-btn:hover {
  background: #f1f5f9;
  color: var(--navy-900);
}

.ticket-subnav-btn.is-active {
  background: var(--blue-600);
  color: #ffffff;
  border-color: var(--blue-600);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.22);
}

.subnav-icon {
  font-size: 15px;
  line-height: 1;
}

.subnav-badge {
  background: var(--red-700);
  color: #ffffff;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 800;
  margin-left: 4px;
}

.ticket-subnav-btn.is-active .subnav-badge {
  background: #ffffff;
  color: var(--red-700);
}

.ticket-panel[hidden] {
  display: none !important;
}

/* Ticket Form */
.ticket-form-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-md); padding: 32px; box-shadow: var(--shadow-sm);
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.form-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.form-field span { font-size: 13.5px; font-weight: 700; color: var(--ink-950); }
.form-field input, .form-field select, .form-field textarea {
  font: inherit; font-size: 16px;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff; color: var(--ink-950);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  border-color: var(--blue-500); outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}
.form-field small { font-size: 11.5px; color: var(--ink-500); }

.attachments-fieldset {
  min-width: 0;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 18px 20px; margin: 20px 0; background: #fafcff;
}
.attachments-fieldset legend { font-size: 14px; font-weight: 700; color: var(--navy-900); padding: 0 8px; }
.fieldset-desc { margin: 0 0 14px; font-size: 12.5px; color: var(--ink-600); }
.attachment-upload-zone { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.upload-box {
  border: 2px dashed #cbd5e1; border-radius: var(--radius-sm);
  padding: 18px; text-align: center; cursor: pointer; background: #ffffff;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.upload-box:hover { border-color: var(--blue-500); background: #f0f7ff; }
.upload-box:focus-visible { outline: 3px solid var(--blue-500); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.form-error, .form-success { padding: 14px; border-radius: var(--radius-sm); overflow-wrap: anywhere; }
.form-error { background: #fff1f2; color: #991b1b; border: 1px solid #fecaca; }
.form-success { background: #ecfdf5; color: #166534; border: 1px solid #bbf7d0; }
#submit-ticket-btn { min-height: 48px; white-space: normal; }
.attachment-upload-zone, .upload-box { min-width: 0; }
.upload-box p { overflow-wrap: anywhere; }
.upload-icon { font-size: 26px; display: block; margin-bottom: 6px; }
.upload-box strong { display: block; font-size: 13px; color: var(--ink-950); }
.upload-box p { margin: 4px 0 0; font-size: 11px; color: var(--ink-500); }
.attachment-chip {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 14px; background: #ffffff;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: 12.5px; box-shadow: var(--shadow-sm);
}
.chip-icon { font-size: 16px; flex-shrink: 0; }
.chip-info { flex: 1; color: var(--ink-800); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-remove {
  background: transparent; border: none; color: var(--red-700);
  cursor: pointer; font-size: 14px; font-weight: 800; padding: 4px 6px; border-radius: 4px;
}
.chip-remove:hover { background: var(--red-100); }
.upload-box.is-dragover { border-color: var(--blue-600); background: #eff6ff; }

/* History Chat View */
.history-layout {
  display: grid; grid-template-columns: 320px 1fr; gap: 20px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-md); overflow: hidden; min-height: 540px;
}
.history-sidebar {
  border-right: 1px solid var(--line); background: #fbfcfe;
  padding: 14px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto;
}
.history-ticket-card {
  padding: 12px 14px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-sm); text-align: left; cursor: pointer;
  transition: all 0.15s ease; display: flex; flex-direction: column; gap: 4px;
}
.history-ticket-card:hover { border-color: var(--blue-500); }
.history-ticket-card.is-selected, .history-ticket-card.is-active {
  border-color: var(--blue-600); background: var(--blue-100);
}
.history-ticket-card strong { display: block; font-size: 13.5px; color: var(--navy-900); }
.history-card-meta { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--ink-500); }
.history-chat-pane { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.chat-loading, .chat-error {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  flex: 1; color: var(--ink-600); gap: 12px;
}
.chat-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding-bottom: 14px; border-bottom: 1px solid var(--line); gap: 12px;
}
.chat-header h3 { margin: 0 0 4px; font-size: 16px; color: var(--navy-900); }
.chat-header small { font-size: 12px; color: var(--ink-500); }
.status-pill {
  display: inline-flex; align-items: center;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; white-space: nowrap;
}
.status-new { background: #fee2e2; color: #991b1b; }
.status-in-progress { background: #fef3c7; color: #92400e; }
.status-closed { background: #dcfce7; color: #166534; }
.chat-messages {
  display: flex; flex-direction: column; gap: 14px;
  flex: 1; overflow-y: auto; max-height: 420px; padding-right: 8px;
}
.chat-bubble {
  padding: 14px 18px; border-radius: 14px;
  max-width: 82%; font-size: 13.5px; line-height: 1.5;
  display: flex; flex-direction: column; gap: 6px;
}
.chat-bubble.is-support {
  background: #eff6ff; border: 1px solid #bfdbfe;
  align-self: flex-start; border-bottom-left-radius: 4px;
}
.chat-bubble.is-customer {
  background: #f1f5f9; border: 1px solid #cbd5e1;
  align-self: flex-end; border-bottom-right-radius: 4px;
}
.bubble-header { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.bubble-header strong { font-size: 12px; color: var(--navy-900); }
.bubble-header small { font-size: 11px; color: var(--ink-500); }
.bubble-text { margin: 0; white-space: pre-wrap; word-break: break-word; }
.bubble-attachments {
  display: flex; flex-direction: column; gap: 10px;
  margin-top: 8px; padding-top: 8px; border-top: 1px dashed rgba(0,0,0,0.1);
}
.msg-image-thumb { display: inline-flex; flex-direction: column; gap: 4px; cursor: pointer; }
.msg-image-thumb img {
  max-width: 240px; max-height: 160px; border-radius: 6px;
  border: 1px solid var(--line); object-fit: cover; transition: transform 0.15s ease;
}
.msg-image-thumb img:hover { transform: scale(1.02); }
.msg-image-thumb small { font-size: 10.5px; color: var(--ink-600); }
.msg-log-box {
  background: #ffffff; border: 1px solid var(--line-strong);
  border-radius: 6px; padding: 8px 12px; display: flex; flex-direction: column; gap: 6px;
}
.msg-log-header { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 600; color: var(--ink-800); }
.log-pre {
  background: #0f172a; color: #38bdf8; padding: 10px; border-radius: 6px;
  font-family: Consolas, monospace; font-size: 11.5px; max-height: 240px;
  overflow-y: auto; white-space: pre-wrap; word-break: break-all; margin: 4px 0 0;
}
.button-link { background: none; border: none; color: var(--blue-600); font-size: 12px; font-weight: 700; cursor: pointer; padding: 0; text-align: left; }
.button-link:hover { text-decoration: underline; }
.chat-closed-banner {
  padding: 12px 16px; background: #dcfce7; color: #166534;
  border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; text-align: center;
}
.chat-reply-form {
  display: flex; flex-direction: column; gap: 10px;
  border-top: 1px solid var(--line); padding-top: 14px;
}
.reply-textarea {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: #fff; color: var(--ink-950);
  font: inherit; font-size: 16px; line-height: 1.5;
  resize: vertical; min-height: 80px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.reply-textarea:focus { border-color: var(--blue-500); outline: none; box-shadow: 0 0 0 3px rgba(37,99,235,0.14); }
.reply-textarea:disabled { opacity: 0.5; }
.reply-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ── MODERNISIERTE BUTTONS ──────────────────────── */
button, input[type="submit"] { font-family: inherit; cursor: pointer; }
button:disabled { opacity: 0.5; cursor: default; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: 10px;
  font-size: 13.5px; font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
  border-color: #1d4ed8;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35), inset 0 1px 0 rgba(255,255,255,0.15);
  font-weight: 800;
}
.btn-primary:hover {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  box-shadow: 0 6px 18px rgba(37,99,235,0.45);
}
.btn-primary:active { transform: scale(0.97); box-shadow: 0 2px 6px rgba(37,99,235,0.25); }
.btn-primary:disabled { opacity: 0.5; box-shadow: none; }

.btn-secondary {
  background: #fff; color: var(--ink-950);
  border-color: var(--line-strong);
  box-shadow: 0 1px 3px rgba(11,31,58,0.08), inset 0 1px 0 rgba(255,255,255,0.9);
}
.btn-secondary:hover { background: #f8fafc; border-color: #a0aec0; }
.btn-secondary:active { transform: scale(0.97); box-shadow: none; }

.btn-danger {
  background: linear-gradient(135deg, #fff5f5 0%, #fee2e2 100%);
  color: #b91c1c;
  border-color: #fca5a5;
  box-shadow: 0 1px 3px rgba(185,28,28,0.1);
}
.btn-danger:hover { background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%); border-color: #f87171; }
.btn-danger:active { transform: scale(0.97); }

.btn-sm { padding: 8px 16px; font-size: 12.5px; border-radius: 8px; }
.btn-full { width: 100%; }

/* Alerts */
.alert {
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 10px;
}
.alert-success { background: var(--green-100); color: var(--green-700); border: 1px solid #bbf7d0; }
.alert-error { background: var(--red-100); color: var(--red-700); border: 1px solid #fca5a5; }
.alert-info { background: var(--blue-100); color: var(--blue-600); border: 1px solid #bfdbfe; }

/* Toast */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 12px 18px; border-radius: 12px;
  min-width: 220px; max-width: 380px;
  background: #10243d; color: #fff;
  font-size: 13px; font-weight: 600;
  box-shadow: 0 8px 24px rgba(7,18,33,0.35);
  animation: slideIn 0.2s ease;
}
.toast.is-error { background: #7f1d1d; }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* Lightbox Modal Overlay */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(11, 23, 42, 0.94);
  backdrop-filter: blur(8px);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  box-sizing: border-box;
  animation: fadeInLightbox 0.18s ease-out;
}
@keyframes fadeInLightbox {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}
.lightbox-topbar {
  width: 100%;
  max-width: 1200px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
}
.lightbox-title {
  font-weight: 800;
  font-size: 15px;
  color: #ffffff;
  letter-spacing: 0.04em;
}
.lightbox-btn {
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  padding: 8px 18px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.lightbox-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.02);
}
.lightbox-content-box {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 12px;
}
#lightbox-img {
  max-width: 95%;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.75);
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.lightbox-bottombar {
  padding: 6px;
}

/* Empty states */
.empty-state { text-align: center; padding: 48px 24px; color: var(--ink-500); border: 1px dashed var(--line); border-radius: var(--radius-md); }
.empty-state-icon { font-size: 40px; margin-bottom: 12px; display: block; opacity: 0.5; }
.empty-state p { font-size: 14px; color: var(--ink-600); }

/* Spinner */
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--line); border-top-color: var(--blue-600);
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 768px) {
  .app-header { padding: 12px 16px; }
  .portal-nav { padding: 6px 12px; }
  .portal-content { width: 94%; margin: 16px auto; }
  .ticket-form-card { padding: 20px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .ticket-form-card input, .ticket-form-card select, .ticket-form-card textarea, .reply-textarea { font-size: 16px !important; max-width: 100%; min-width: 0; }
  .history-layout { grid-template-columns: 1fr; }
  .history-chat-pane { padding: 14px; }
  .chat-bubble { max-width: 94%; }
  .video-card { grid-template-columns: 1fr; }
  .attachment-upload-zone { grid-template-columns: 1fr; }
}

/* ── SCREENSHOT PREVIEW & FORUM GUIDE ELEMENTS ── */
.guide-image-card {
  margin: 14px 0;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  cursor: pointer;
}
.guide-image-card:hover {
  box-shadow: var(--shadow-md);
  border-color: #3b82f6;
}
.guide-image-preview {
  width: 100%;
  height: auto;
  max-height: 580px;
  object-fit: contain;
  background: #ffffff;
  display: block;
  cursor: zoom-in;
}
.guide-image-caption {
  padding: 10px 14px;
  background: #f8fafc;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-600);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  cursor: pointer;
}
.guide-badge-forum {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.guide-badge-danger {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.guide-badge-success {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.guide-badge-success:hover {
  background: #bbf7d0;
  color: #14532d;
  transform: scale(1.05);
}
.danger-panel {
  background: linear-gradient(135deg, #fff5f5 0%, #fee2e2 100%);
  border: 2px solid #f87171;
  border-radius: var(--radius-md);
  padding: 18px 22px;
  margin: 16px 0;
  color: #7f1d1d;
  box-shadow: 0 4px 14px rgba(185, 28, 28, 0.08);
}
.tip-panel {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border: 2px solid #86efac;
  border-radius: var(--radius-md);
  padding: 18px 22px;
  margin: 16px 0;
  color: #14532d;
  box-shadow: 0 4px 14px rgba(22, 101, 52, 0.08);
}

/* ── SCHNELL-WEGWEISER (HERO NAVIGATION) ── */
.quick-nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin: 20px 0 28px;
}
.quick-nav-card {
  background: var(--surface);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
  text-align: left;
}
.quick-nav-card:hover {
  transform: translateY(-3px);
  border-color: var(--blue-500);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.15);
}
.quick-nav-card.card-blue { border-left: 5px solid var(--blue-600); }
.quick-nav-card.card-green { border-left: 5px solid #16a34a; }
.quick-nav-card.card-amber { border-left: 5px solid #d97706; }
.quick-nav-card.card-purple { border-left: 5px solid #7c3aed; }

.quick-nav-icon { font-size: 32px; margin-bottom: 8px; }
.quick-nav-title { margin: 0 0 6px; font-size: 15.5px; font-weight: 800; color: var(--navy-900); }
.quick-nav-desc { margin: 0 0 14px; font-size: 12.5px; color: var(--ink-600); line-height: 1.45; }
.quick-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  color: var(--blue-600);
}

/* Modul-Karten für glasklare Gliederung */
.module-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.module-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
  color: var(--navy-900);
  display: flex;
  align-items: center;
  gap: 10px;
}
.module-card-desc {
  margin: 0 0 18px;
  color: var(--ink-600);
  font-size: 13.5px;
}

/* ── RESPONSIVE MEDIA QUERIES FÜR GLIEDERUNG & SIDEBAR ── */
@media (max-width: 980px) {
  .portal-container {
    flex-direction: column;
    gap: 20px;
    width: 95%;
    margin: 18px auto 40px;
  }
  .portal-sidebar {
    width: 100%;
    position: static;
    max-height: none;
    padding: 16px;
    box-sizing: border-box;
  }
  .sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
  }
  .portal-nav {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 8px;
  }
  .sidebar-help-box {
    display: none;
  }
}

/* ── SMARTPHONE-OPTIMIERUNG (HORIZONTALE THEMEN-LEISTE, VIDEO SOFORT SICHTBAR) ── */
@media (max-width: 768px) {
  .app-header {
    padding: 10px 14px;
  }
  .brand-logo {
    width: 32px;
    height: 32px;
  }
  .brand-title {
    font-size: 15px;
    letter-spacing: 0.04em;
  }
  .brand-subtitle {
    font-size: 10.5px;
  }
  .header-badges {
    display: none;
  }
  .portal-container {
    width: 100%;
    padding: 0 12px;
    margin: 8px auto 32px;
    gap: 12px;
  }
  .portal-sidebar {
    background: #f8fafc;
    border: none;
    box-shadow: none;
    padding: 4px 0 6px 0;
    margin-bottom: 2px;
    position: sticky;
    top: 0;
    z-index: 40;
    border-bottom: 1px solid var(--line);
  }
  .sidebar-header {
    display: none;
  }
  .portal-nav {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 8px;
    padding: 2px 4px 6px;
    width: 100%;
    box-sizing: border-box;
  }
  .portal-nav::-webkit-scrollbar {
    display: none;
  }
  .nav-tab {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center;
    flex-shrink: 0 !important;
    width: auto !important;
    white-space: nowrap !important;
    padding: 8px 14px;
    font-size: 12.5px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    box-shadow: var(--shadow-sm);
    gap: 6px;
    transform: none !important;
  }
  .nav-tab:hover {
    transform: none !important;
  }
  .nav-tab .tab-icon {
    font-size: 15px;
    width: auto;
  }
  .nav-tab .tab-label {
    font-size: 12.5px;
  }
  .nav-tab.is-active {
    background: var(--blue-600) !important;
    color: #ffffff !important;
    border-color: var(--blue-600) !important;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
  }
  .nav-tab.is-active .tab-icon {
    transform: scale(1.05);
  }
  .nav-tab.is-active .tab-label {
    color: #ffffff !important;
    font-weight: 700;
  }
  .view-header {
    margin-bottom: 12px;
  }
  .view-header h2 {
    font-size: 18.5px;
    line-height: 1.25;
  }
  .view-header p {
    font-size: 13px;
  }
  .video-info {
    padding: 16px;
  }
  .video-info h3 {
    font-size: 16.5px;
  }
  .module-card {
    padding: 16px;
    margin-bottom: 14px;
  }
  .quick-nav-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .subnav-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }
  .subnav-btn {
    flex-shrink: 0;
    white-space: nowrap;
  }
}




/* Nur in der Vorschau */
.vorschau-hinweis {
  background: #b45309;
  color: #ffffff;
  font: 600 13px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
  padding: 8px 14px;
  text-align: center;
}
