/* Strompreis-Radar – visuelle Identität
   Palette: Petrol/Teal als Marke, Lime-Akzent, warme Neutraltöne.
   Mobile-first, Light/Dark via prefers-color-scheme. */

:root {
  --bg: #f2f6f5;
  --surface: #ffffff;
  --surface-2: #e8efed;
  --text: #14282c;
  --text-muted: #5b6f6d;
  --border: #d5e0dd;
  --brand: #0f766e;
  --brand-strong: #0b5c56;
  --accent: #b7c928;
  --good: #16a34a;
  --good-soft: rgba(22, 163, 74, 0.14);
  --bad: #dc2626;
  --bad-soft: rgba(220, 38, 38, 0.12);
  --now: #2563eb;
  --bar: #7fa8a3;
  --bar-muted: #b9cdca;
  --warn-bg: #fdf3d7;
  --warn-border: #e5c85c;
  --info-bg: #e3edfb;
  --info-border: #9db9e4;
  --shadow: 0 1px 2px rgba(20, 40, 44, 0.06), 0 6px 20px rgba(20, 40, 44, 0.07);
  --radius: 14px;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-head: "Sora", "Inter", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1416;
    --surface: #122023;
    --surface-2: #0f1b1d;
    --text: #e4efed;
    --text-muted: #93a8a5;
    --border: #23383b;
    --brand: #2dd4bf;
    --brand-strong: #5eead4;
    --accent: #d3e34a;
    --good: #34d399;
    --good-soft: rgba(52, 211, 153, 0.16);
    --bad: #f87171;
    --bad-soft: rgba(248, 113, 113, 0.14);
    --now: #60a5fa;
    --bar: #3f5d5f;
    --bar-muted: #2b4345;
    --warn-bg: #3a3210;
    --warn-border: #8a7a2c;
    --info-bg: #14283f;
    --info-border: #2f4f77;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
}

h1, h2, h3 {
  font-family: var(--font-head);
  line-height: 1.25;
  margin: 0 0 0.35rem;
}

h1 { font-size: 1.25rem; }
h2 { font-size: 1.1rem; }

p { margin: 0.4rem 0; }

.wrap {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 0 16px;
}

.muted { color: var(--text-muted); }
.small { font-size: 0.82rem; }

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--brand);
  text-decoration: none;
}

.brand-mark { width: 34px; height: 34px; flex: none; }

.brand-text {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}

/* Buttons */
.btn {
  font: inherit;
  font-weight: 600;
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-outline {
  background: transparent;
  border-color: var(--brand);
  color: var(--brand);
}

.btn-outline:hover { background: var(--good-soft); }

.btn-primary {
  background: var(--brand);
  color: var(--bg);
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-block { display: block; width: 100%; margin-top: 0.6rem; }

.linklike {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--brand);
  text-decoration: underline;
  cursor: pointer;
}

/* Banner */
.banner-area { margin-top: 12px; }

.banner {
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 0.9rem;
  border: 1px solid;
}

.banner-warn { background: var(--warn-bg); border-color: var(--warn-border); }
.banner-info { background: var(--info-bg); border-color: var(--info-border); margin-top: 0.8rem; }

/* Cards */
main.wrap { padding-top: 14px; padding-bottom: 28px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 16px;
}

.card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.day-label { margin: 0.2rem 0 0; font-size: 0.9rem; }

/* Tabs */
.day-tabs {
  display: inline-flex;
  background: var(--surface-2);
  border-radius: 999px;
  padding: 3px;
  border: 1px solid var(--border);
}

.tab {
  font: inherit;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 999px;
  padding: 5px 14px;
  cursor: pointer;
}

.tab.is-active {
  background: var(--brand);
  color: var(--bg);
}

.tab:disabled { opacity: 0.45; cursor: not-allowed; }

/* Chart */
.chart-wrap {
  position: relative;
  margin-top: 10px;
  overflow: hidden;
}

#price-chart {
  display: block;
  width: 100%;
  height: 280px;
  touch-action: pan-y;
}

.chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--text);
  color: var(--bg);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.8rem;
  line-height: 1.4;
  white-space: nowrap;
  transform: translate(-50%, 0);
  box-shadow: var(--shadow);
  z-index: 5;
}

.legend {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  padding: 0;
  margin: 10px 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.legend li { display: inline-flex; align-items: center; gap: 6px; }

.dot {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  display: inline-block;
}

.dot-cheap { background: var(--good); }
.dot-exp { background: var(--bad); }
.dot-now { background: var(--now); }

/* Statistik */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 8px;
}

.stat {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.stat-value {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.35rem;
  margin-top: 2px;
}

.stat-sub { font-size: 0.82rem; color: var(--text-muted); }

/* Bester Zeitpunkt */
.best-result { margin-top: 10px; }

.best-box {
  border: 1px solid var(--border);
  border-left: 5px solid var(--good);
  background: var(--good-soft);
  border-radius: 10px;
  padding: 12px 14px;
}

.best-box .best-time {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.15rem;
}

.best-saving { color: var(--good); font-weight: 600; }

/* Formulare */
.field-row { margin: 12px 0; }

.field-row > label { display: block; font-weight: 600; margin-bottom: 4px; font-size: 0.92rem; }

.field-check {
  display: flex;
  align-items: center;
  gap: 10px;
}

.field-check > label { margin: 0; font-weight: 500; }

input[type="number"], select {
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  width: 100%;
  max-width: 260px;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
}

.input-suffix {
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-suffix input { max-width: 130px; }
.input-suffix span { color: var(--text-muted); font-size: 0.9rem; }

/* Werbe-Slot */
.ad-slot {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 14px 16px;
  text-align: center;
  margin-bottom: 16px;
}

.ad-slot-label {
  display: inline-block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 16px 0 24px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-inner nav {
  display: flex;
  gap: 16px;
  margin-top: 6px;
}

/* Modals */
.modal {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  max-width: 480px;
  width: calc(100% - 32px);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

.modal::backdrop { background: rgba(8, 16, 18, 0.55); }

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 4px;
}

.feature-list {
  padding-left: 1.2rem;
  margin: 0.6rem 0;
}

.feature-list li { margin: 0.3rem 0; }

/* Erste-Schritte-Hilfe */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.help-btn {
  inline-size: 2rem; block-size: 2rem; padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font: inherit; font-weight: 700; font-size: 1rem; line-height: 1;
  cursor: pointer; flex: 0 0 auto;
}

.help-btn:hover, .help-btn:focus-visible { color: var(--brand); border-color: var(--brand); }

.tour-intro { color: var(--text-muted); }

.tour-steps { margin: 0 0 1rem; padding-left: 1.25rem; display: grid; gap: 0.6rem; }

.tour-steps li strong { color: var(--brand-strong); }

.know-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
}

.know-box h3 { margin: 0 0 0.5rem; font-size: 0.95rem; }

.know-box ul { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.4rem; }

.know-box li { font-size: 0.9rem; color: var(--text-muted); }

/* Größere Screens */
@media (min-width: 640px) {
  h1 { font-size: 1.45rem; }
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  #price-chart { height: 320px; }
  .card { padding: 20px 22px; }
}
