/* ── Accessibility ───────────────────────────────────────────────────────── */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Reset & Base ────────────────────────────────────────────────────────── */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg:         #0F172A;
  --surface:    #1E293B;
  --surface2:   #273548;
  --surface3:   #334155;
  --accent:     #3B82F6;
  --accent-dim: #1D4ED8;
  --text:       #F1F5F9;
  --text-muted: #94A3B8;
  --text-faint: #64748B;
  --border:     #334155;
  --success:    #22C55E;
  --warning:    #F59E0B;
  --danger:     #EF4444;
  --sidebar-w:  200px;
  --header-h:   52px;
  --radius:     8px;
  --font:       -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

html {
  height: 100%;
}

body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Header ─────────────────────────────────────────────────────────────── */

header {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

/* ── Status Badge ────────────────────────────────────────────────────────── */

.new-data-badge {
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--warning);
  background: color-mix(in srgb, var(--warning) 12%, var(--surface2));
  color: var(--warning);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  animation: badge-pulse 2s ease-in-out infinite;
}

.new-data-badge.hidden { display: none; }

@keyframes badge-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.6; }
}

.conditions-toggle {
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font);
}

.conditions-toggle:hover {
  background: var(--surface3);
  color: var(--text);
}

.conditions-toggle.active {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface2));
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface2);
  border: 1px solid var(--border);
  transition: all 0.3s;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-faint);
  flex-shrink: 0;
  transition: background 0.3s;
}

.status-badge.status-ok .status-dot    { background: var(--success); }
.status-badge.status-ok #status-text   { color: var(--success); }
.status-badge.status-loading .status-dot { background: var(--warning); animation: pulse 1s infinite; }
.status-badge.status-error .status-dot  { background: var(--danger); }
.status-badge.status-error #status-text { color: var(--danger); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

/* ── Layout ──────────────────────────────────────────────────────────────── */

.layout {
  display: flex;
  min-height: calc(100vh - var(--header-h));
  align-items: flex-start;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */

#sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
}

.sidebar-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-faint);
  padding: 16px 14px 8px;
}

#location-list {
  list-style: none;
  overflow-y: auto;
  flex: 1;
  padding: 4px 6px;
}

#location-list li {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text-muted);
  font-size: 13px;
  transition: background 0.15s, color 0.15s;
  user-select: none;
}

#location-list li:hover {
  background: var(--surface2);
  color: var(--text);
}

#location-list li.active {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--text);
  font-weight: 500;
}

#location-list li.active::before {
  content: '';
  width: 3px;
  height: 14px;
  background: var(--accent);
  border-radius: 2px;
  flex-shrink: 0;
}

#location-list li:not(.active)::before {
  content: '';
  width: 3px;
  height: 14px;
  flex-shrink: 0;
}

.location-delete {
  margin-left: auto;
  color: var(--text-faint);
  font-size: 16px;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.15s;
  cursor: pointer;
  padding: 0 2px;
}

#location-list li:hover .location-delete { opacity: 1; }
.location-delete:hover { color: var(--danger) !important; }

.add-btn {
  margin: 8px;
  padding: 8px 12px;
  background: transparent;
  color: var(--text-faint);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}

.add-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

/* ── Main Content ────────────────────────────────────────────────────────── */

#content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
  gap: 14px;
  min-width: 0;
}

/* ── Variable Tabs ───────────────────────────────────────────────────────── */

.var-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.var-tab {
  padding: 6px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.var-tab:hover {
  background: var(--surface2);
  color: var(--text);
}

.var-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ── Chart Range Buttons ─────────────────────────────────────────────────── */

.chart-range-btns {
  display: flex;
  gap: 6px;
  padding: 6px 0 2px;
  flex-wrap: wrap;
}

.chart-range-btn {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  color: var(--text-faint);
  background: transparent;
  cursor: pointer;
  transition: color .15s, background .15s, border-color .15s;
  white-space: nowrap;
}
.chart-range-btn:hover { color: var(--text); border-color: var(--text-muted); }
.chart-range-btn.active {
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  border-color: var(--accent);
  color: var(--accent);
}

@media (max-width: 640px) {
  .chart-range-btn { padding: 5px 14px; font-size: 13px; }
}

/* ── Chart Container ─────────────────────────────────────────────────────── */

#chart-container {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  height: 420px;
}

#chart {
  width: 100%;
  height: 100%;
}

.chart-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  font-size: 16px;
  pointer-events: none;
}

.chart-placeholder.hidden { display: none; }

/* ── Chart Vollbild-Button ───────────────────────────────────────────────── */

.chart-fullscreen-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-faint);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: color .15s, background .15s;
  backdrop-filter: blur(4px);
}
.chart-fullscreen-btn:hover { color: var(--text); background: rgba(30, 41, 59, 0.9); }

/* Vollbild-Modus */
#chart-container.fullscreen {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  border-radius: 0 !important;
  border: none !important;
  z-index: 500 !important;
}

/* Variable Pill-Bar im Vollbild */
.chart-var-pills {
  display: none;
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  flex-direction: row;
  gap: 6px;
  z-index: 20;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 6px 10px;
  border-radius: 24px;
  border: 1px solid var(--border);
  max-width: calc(100vw - 32px);
  overflow-x: auto;
  white-space: nowrap;
}
#chart-container.fullscreen .chart-var-pills { display: flex; }

/* Range-Buttons im Vollbild — über den Var-Pills */
.chart-range-btns-fs {
  display: none;
  position: absolute;
  bottom: 68px;
  left: 50%;
  transform: translateX(-50%);
  flex-direction: row;
  gap: 6px;
  z-index: 20;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 5px 10px;
  border-radius: 24px;
  border: 1px solid var(--border);
  max-width: calc(100vw - 32px);
  overflow-x: auto;
  white-space: nowrap;
}
#chart-container.fullscreen .chart-range-btns-fs { display: flex; }

.chart-var-pill {
  font-size: 12px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid transparent;
  color: var(--text-faint);
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s, background .15s;
  flex-shrink: 0;
}
.chart-var-pill:hover { color: var(--text); }
.chart-var-pill.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ── Model Toggles ───────────────────────────────────────────────────────── */

.model-toggles {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.model-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.15s;
  user-select: none;
  white-space: nowrap;
}

.model-toggle:hover {
  background: var(--surface2);
  color: var(--text);
}

.model-toggle.active {
  border-color: var(--model-color, var(--accent));
  color: var(--text);
  background: color-mix(in srgb, var(--model-color, var(--accent)) 12%, var(--surface));
}

.model-toggle .model-swatch {
  width: 20px;
  height: 3px;
  border-radius: 2px;
  background: var(--model-color, var(--accent));
  flex-shrink: 0;
  opacity: 0.5;
  transition: opacity 0.15s;
}

.model-toggle.active .model-swatch { opacity: 1; }

/* EPS band swatch */
.model-toggle.eps-toggle .model-swatch {
  height: 10px;
  border-radius: 3px;
  opacity: 0.25;
}
.model-toggle.eps-toggle.active .model-swatch { opacity: 0.6; }

/* ── Dialog ──────────────────────────────────────────────────────────────── */

.dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  backdrop-filter: blur(4px);
}

.dialog-overlay.hidden { display: none; }

/* ── Help Button ─────────────────────────────────────────────────────────── */

.help-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-faint);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: color .15s, border-color .15s;
}
.help-btn:hover { color: var(--text); border-color: var(--text-muted); }

/* ── Help Modal ──────────────────────────────────────────────────────────── */

.help-dialog-box {
  width: min(600px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  padding: 0;
  gap: 0;
  overflow: hidden;
}

.help-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.help-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.help-close {
  background: none;
  border: none;
  color: var(--text-faint);
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
}
.help-close:hover { color: var(--text); }

.help-body {
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
}

.help-section {
  border-left: 3px solid var(--accent);
  padding-left: 14px;
}

.help-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.help-section p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 4px;
}

.help-section p:last-child { margin-bottom: 0; }

.help-dialog-box .dialog-buttons {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.dialog-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dialog-box h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.dialog-box label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.dialog-box input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--text);
  font-size: 13px;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.15s;
}

.dialog-box input:focus {
  border-color: var(--accent);
}

.dialog-hint {
  font-size: 11px;
  color: var(--text-faint);
}

.dialog-buttons {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 4px;
}

.dialog-buttons button {
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.dialog-buttons button:hover {
  background: var(--surface3);
  color: var(--text);
}

.btn-primary {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #fff !important;
}

.btn-primary:hover {
  background: var(--accent-dim) !important;
  border-color: var(--accent-dim) !important;
}

.btn-primary:disabled {
  background: var(--surface3) !important;
  border-color: var(--border) !important;
  color: var(--text-faint) !important;
  cursor: not-allowed;
}

/* ── Geocoding search ─────────────────────────────────────────────────────── */

.search-input-wrap {
  position: relative;
}

.search-input-wrap input {
  width: 100%;
}

.search-spinner {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  pointer-events: none;
}

@keyframes spin {
  to { transform: translateY(-50%) rotate(360deg); }
}

.add-results {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface2);
  max-height: 180px;
  overflow-y: auto;
  display: none;
}

.add-results:not(:empty) {
  display: block;
}

.add-result-item {
  padding: 9px 12px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  line-height: 1.4;
}

.add-result-item:last-child {
  border-bottom: none;
}

.add-result-item:hover {
  background: var(--surface3);
}

.add-result-item.selected {
  background: color-mix(in srgb, var(--accent) 20%, var(--surface2));
  color: var(--text);
}

.dialog-hint a {
  color: var(--text-faint);
  text-decoration: none;
}

.dialog-hint a:hover {
  text-decoration: underline;
}

/* ── Spread Bar ──────────────────────────────────────────────────────────── */

.spread-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12px;
  flex-shrink: 0;
}

.spread-bar.hidden { display: none; }

.spread-label {
  color: var(--text-faint);
  white-space: nowrap;
  flex-shrink: 0;
}

.spread-slider {
  width: 110px;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.spread-time-label {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 155px;
}

.spread-time-now {
  color: var(--success);
}

.spread-single {
  color: var(--text-faint);
  font-size: 12px;
  flex: 1;
}

.spread-track-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.spread-track {
  position: relative;
  height: 4px;
  background: var(--surface3);
  border-radius: 2px;
  margin: 6px 0;
}

.spread-dot {
  position: absolute;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border: 2px solid var(--surface);
  cursor: default;
  transition: transform 0.2s;
}

.spread-dot:hover { transform: translate(-50%, -50%) scale(1.4); }

.spread-range-labels {
  display: flex;
  justify-content: space-between;
  color: var(--text-faint);
  font-size: 11px;
}

.spread-delta {
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Daily Summary Table ─────────────────────────────────────────────────── */

.daily-summary {
  flex-shrink: 0;
  overflow-x: auto;
}

.daily-summary:empty  { display: none; }
.daily-summary.hidden { display: none; }

.daily-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  white-space: nowrap;
}

.daily-table th,
.daily-table td {
  padding: 7px 12px;
  border: 1px solid var(--border);
  text-align: center;
  vertical-align: middle;
}

.daily-table thead th {
  background: var(--surface2);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.daily-table thead th:first-child {
  text-align: left;
}

.daily-model-name {
  text-align: left !important;
  background: var(--surface) !important;
  white-space: nowrap;
  color: var(--text-muted);
  font-weight: 500;
}

.table-model-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 7px;
  vertical-align: middle;
  flex-shrink: 0;
}

.daily-stat-cell {
  background: var(--surface);
  color: var(--text);
  line-height: 1.7;
}

.daily-stat-cell div { white-space: nowrap; }

.daily-stat-cell .stat-temp  { color: var(--text); font-weight: 500; }
.daily-stat-cell .stat-precip { color: #60A5FA; }
.daily-stat-cell .stat-wind   { color: #94A3B8; }

.daily-table tbody tr:hover .daily-stat-cell,
.daily-table tbody tr:hover .daily-model-name {
  background: var(--surface2) !important;
}

/* ── Conditions Panel ────────────────────────────────────────────────────── */

.conditions-panel {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
  flex-shrink: 0;
}

.conditions-panel:empty { display: none; }
.conditions-panel.hidden { display: none; }

.condition-card {
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  min-width: 230px;
  max-width: 260px;
}

.condition-card-header {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px 7px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.condition-card-header .model-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.condition-card-header .now-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-faint);
  text-transform: none;
  letter-spacing: 0;
}

.condition-card-body {
  display: flex;
  gap: 0;
}

.condition-temp-col {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  border-right: 1px solid var(--border);
  min-width: 90px;
}

.condition-icon {
  font-size: 30px;
  line-height: 1;
  margin-bottom: 6px;
}

.condition-temp {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  white-space: nowrap;
}

.condition-desc {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 4px;
}

.condition-stats {
  flex: 1;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.condition-stat {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.condition-stat-label {
  font-size: 10px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.condition-stat-value {
  font-size: 12px;
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Scrollbar ───────────────────────────────────────────────────────────── */

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* ── Loading state ───────────────────────────────────────────────────────── */

#chart-container.loading::after {
  content: 'Lade Vorhersage…';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  font-size: 14px;
  background: var(--surface);
}

/* ── Site Footer ─────────────────────────────────────────────────────────── */

.site-footer {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-faint);
  flex-wrap: wrap;
}

.footer-link {
  color: var(--text-faint);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-link:hover {
  color: var(--text-muted);
}

/* ── Header Navigation (shared) ─────────────────────────────────────────── */

.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo {
  text-decoration: none;
}

.header-nav-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-faint);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
}

.header-nav-link:hover {
  color: var(--text);
  background: var(--surface2);
}

.header-nav-link.active {
  color: var(--text-muted);
}

/* ── Info Page ───────────────────────────────────────────────────────────── */

.info-wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 48px 28px 96px;
}

.info-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.4px;
  margin-bottom: 12px;
}

.info-lead {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 680px;
  margin-bottom: 48px;
}

.info-section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

/* Model Cards */

.model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(440px, 1fr));
  gap: 16px;
  margin-bottom: 52px;
}

.model-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--model-color, var(--accent));
  border-radius: var(--radius);
  overflow: hidden;
}

.model-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.model-card-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.model-card-operator {
  font-size: 12px;
  color: var(--text-faint);
  margin-left: auto;
}

.model-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid currentColor;
  white-space: nowrap;
}

.model-badge-det {
  color: #60A5FA;
}

.model-badge-ens {
  color: #F97316;
}

.model-badge-ai {
  color: #14B8A6;
}

.model-card-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.model-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.model-meta-chip {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 11px;
}

.model-meta-chip-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-faint);
}

.model-meta-chip-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.model-description {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.65;
}

/* Comparison Table */

.info-table-wrap {
  overflow-x: auto;
  margin-bottom: 52px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.info-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.info-table th,
.info-table td {
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.info-table tr:last-child td {
  border-bottom: none;
}

.info-table thead th {
  background: var(--surface2);
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.info-table tbody tr:hover td {
  background: var(--surface2);
}

.info-table td:first-child {
  font-weight: 600;
  color: var(--text);
}

.info-table-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
  flex-shrink: 0;
}

.info-table td {
  color: var(--text-muted);
}

.badge-det, .badge-ens, .badge-ai {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 20px;
}

.badge-det { background: color-mix(in srgb, #3B82F6 15%, transparent); color: #60A5FA; }
.badge-ens { background: color-mix(in srgb, #F97316 15%, transparent); color: #FB923C; }
.badge-ai  { background: color-mix(in srgb, #14B8A6 15%, transparent); color: #2DD4BF; }

/* Sources Section */

.sources-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sources-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.sources-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.source-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.source-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.source-detail {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.source-detail a {
  color: var(--accent);
  text-decoration: none;
}

.source-detail a:hover {
  text-decoration: underline;
}

.copyright-notice {
  font-size: 11px;
  color: var(--text-faint);
  line-height: 1.6;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

/* ── Mobile (≤ 640px) ────────────────────────────────────────────────────── */

@media (max-width: 640px) {

  /* Header: wrappable, kompakter */
  header {
    height: auto;
    min-height: var(--header-h);
    padding: 8px 12px;
    gap: 6px;
    flex-wrap: wrap;
  }

  .header-nav-link { display: none; } /* im Footer erreichbar */

  .conditions-toggle,
  .status-badge {
    padding: 4px 9px;
    font-size: 11px;
  }

  /* Sidebar → horizontale Pill-Leiste */
  .layout {
    flex-direction: column;
  }

  #sidebar {
    width: 100%;
    height: auto;
    position: static;
    flex-direction: row;
    align-items: center;
    border-right: none;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    overflow-y: hidden;
    padding: 6px 10px;
    gap: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  #sidebar::-webkit-scrollbar { display: none; }

  .sidebar-title { display: none; }

  #location-list {
    display: flex;
    flex-direction: row;
    flex: none;
    overflow: visible;
    padding: 0;
    gap: 6px;
  }

  #location-list li {
    flex-shrink: 0;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--surface2);
    padding: 5px 12px;
    font-size: 12px;
  }

  #location-list li.active {
    background: color-mix(in srgb, var(--accent) 20%, transparent);
    border-color: var(--accent);
  }

  /* Accent-Bar-Pseudo-Element ausblenden */
  #location-list li::before { display: none !important; }

  /* Löschen-Button immer sichtbar (kein hover auf Touch) */
  @media (hover: none) {
    .location-delete { opacity: 1; }
  }

  .add-btn {
    flex-shrink: 0;
    margin: 0;
    padding: 5px 12px;
    border-radius: 20px;
    white-space: nowrap;
    font-size: 12px;
  }

  /* Content */
  #content {
    padding: 10px 12px;
    gap: 10px;
  }

  /* Chart kürzer */
  #chart-container {
    height: 260px;
  }

  /* Spread-Bar: Slider nimmt volle Zeile ein */
  .spread-bar {
    flex-wrap: wrap;
    gap: 6px 12px;
  }

  .spread-label {
    order: 1;
  }

  .spread-time-label {
    order: 2;
    flex: 1;
    min-width: unset;
  }

  .spread-slider {
    order: 3;
    width: 100%;
  }

  .spread-track-wrap {
    order: 4;
    flex: 1;
    min-width: 0;
  }

  .spread-delta {
    order: 5;
  }

  /* Condition-Cards minimal schmaler */
  .condition-card {
    min-width: 200px;
  }

  /* Dialog: volle Breite */
  .dialog-box {
    width: calc(100vw - 32px);
    margin: 16px;
  }

  /* Footer kompakter */
  .site-footer {
    padding: 12px 16px;
    gap: 10px;
  }
}
