[x-cloak] { display: none !important; }

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

/* Cards */
.card {
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 1px 2px rgb(0 0 0 / .05);
  outline: 1px solid #e2e8f0;
  padding: 1rem;
}
@media (min-width: 640px) { .card { padding: 1.25rem; } }
.dark .card { background: #0f172a; outline-color: #1e293b; }

/* KPI tiles */
.kpi {
  background: #fff;
  border-radius: .75rem;
  box-shadow: 0 1px 2px rgb(0 0 0 / .05);
  outline: 1px solid #e2e8f0;
  padding: .625rem .75rem;
}
.dark .kpi { background: #0f172a; outline-color: #1e293b; }
.kpi-label { font-size: 10px; line-height: 1; text-transform: uppercase; letter-spacing: .05em; color: #64748b; font-weight: 500; }
.dark .kpi-label { color: #94a3b8; }
.kpi-value { font-size: 1.125rem; font-weight: 700; line-height: 1.2; margin-top: .15rem; }
@media (min-width: 640px) { .kpi-value { font-size: 1.5rem; } }
.kpi-sub { font-size: 10px; color: #64748b; margin-top: .15rem; line-height: 1.2; }
.dark .kpi-sub { color: #94a3b8; }

/* Form controls */
.input, .select {
  padding: .375rem .5rem; font-size: .875rem; border-radius: .375rem;
  background: #fff; color: inherit;
  border: 1px solid #cbd5e1;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
  appearance: none;
}
.dark .input, .dark .select { background: #1e293b; border-color: #334155; }
.input:focus, .select:focus { outline: none; border-color: #0ea5e9; box-shadow: 0 0 0 3px rgb(14 165 233 / .25); }

/* Buttons */
.btn-icon {
  padding: .5rem; border-radius: .5rem; color: #475569;
  background: transparent; border: 0; cursor: pointer; transition: background .15s;
  min-width: 40px; min-height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-icon:hover { background: #f1f5f9; }
.btn-icon:disabled { opacity: .5; cursor: not-allowed; }
.dark .btn-icon { color: #cbd5e1; }
.dark .btn-icon:hover { background: #1e293b; }

.btn-primary {
  padding: .5rem .75rem; font-weight: 500; border-radius: .375rem;
  background: #0284c7; color: #fff; border: 0; cursor: pointer; transition: background .15s;
  min-height: 36px;
}
.btn-primary:hover:not(:disabled) { background: #0ea5e9; }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }

.btn-ghost {
  padding: .5rem .75rem; font-size: .875rem; font-weight: 500; border-radius: .375rem;
  background: transparent; color: #475569; border: 0; cursor: pointer; transition: background .15s;
}
.btn-ghost:hover { background: #f1f5f9; }
.dark .btn-ghost { color: #cbd5e1; }
.dark .btn-ghost:hover { background: #1e293b; }

/* Segmented control */
.seg {
  display: inline-flex; padding: 2px; border-radius: .5rem;
  background: #f1f5f9;
  outline: 1px solid #e2e8f0;
}
.dark .seg { background: #1e293b; outline-color: #334155; }
.seg-btn {
  padding: .375rem .625rem;
  border: 0; background: transparent;
  border-radius: .375rem;
  font-size: 12px; font-weight: 500; color: #475569;
  cursor: pointer; transition: all .15s;
  min-height: 32px;
}
.dark .seg-btn { color: #cbd5e1; }
.seg-btn:hover { color: #0f172a; }
.dark .seg-btn:hover { color: #f1f5f9; }
.seg-on {
  background: #fff !important; color: #0284c7 !important;
  box-shadow: 0 1px 2px rgb(0 0 0 / .08);
}
.dark .seg-on { background: #0f172a !important; color: #38bdf8 !important; }

.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 9999px; margin-right: .25rem; }

/* Hour cells */
.hour-cell {
  border-radius: .375rem; padding: .375rem; text-align: center;
  transition: transform .1s; color: #0f172a;
  position: relative;
}
.dark .hour-cell { color: #f8fafc; }
.hour-cell:hover { transform: scale(1.06); }
.hour-cell.is-neg::after {
  content: '◉';
  position: absolute; top: 1px; right: 3px;
  font-size: 8px; color: #fff;
  text-shadow: 0 0 2px rgba(0,0,0,.6);
}

/* Best windows */
.window-row {
  display: flex; align-items: center; gap: .75rem; padding: .5rem;
  border-radius: .5rem; background: #f8fafc;
  min-height: 48px;
}
.dark .window-row { background: rgb(30 41 59 / .5); }
.window-label {
  width: 3rem; text-align: center; background: #fff;
  border-radius: .375rem; padding: .375rem 0;
  outline: 1px solid #e2e8f0;
  flex-shrink: 0;
}
.dark .window-label { background: #0f172a; outline-color: #334155; }

/* Badges */
.badge-ok {
  font-size: 10px; font-weight: 500; padding: 2px 8px; border-radius: 9999px;
  background: #d1fae5; color: #047857;
}
.dark .badge-ok { background: rgb(6 78 59 / .4); color: #6ee7b7; }
.badge-info {
  font-size: 10px; font-weight: 500; padding: 2px 8px; border-radius: 9999px;
  background: #e0f2fe; color: #075985;
}
.dark .badge-info { background: rgb(8 47 73 / .4); color: #7dd3fc; }

/* Heatmap */
.heatmap-table { border-collapse: separate; border-spacing: 2px; margin: 0 auto; }
.heatmap-table th {
  font-size: 10px; font-weight: 500; color: #64748b; text-align: center; padding: 0 .25rem;
}
.dark .heatmap-table th { color: #94a3b8; }
.heatmap-table td {
  width: 30px; height: 22px; font-size: 9px; text-align: center; border-radius: .25rem;
  cursor: pointer; color: #0f172a;
  position: relative;
}
@media (min-width: 640px) {
  .heatmap-table td { width: 36px; height: 26px; font-size: 10px; }
}
.dark .heatmap-table td { color: #f8fafc; }
.heatmap-table td:hover { outline: 2px solid #0ea5e9; }
.heatmap-table td.empty { background: #f1f5f9; cursor: default; color: transparent; }
.dark .heatmap-table td.empty { background: rgb(30 41 59 / .4); }
.heatmap-table td.empty:hover { outline: none; }
.heatmap-table td.is-neg::before {
  content: '◉';
  position: absolute; top: 0; right: 2px;
  font-size: 7px; color: rgba(255,255,255,.95);
  text-shadow: 0 0 2px rgba(0,0,0,.6);
}
.heatmap-table th.row-label {
  text-align: right; padding-right: .5rem; color: #475569; font-weight: 500; min-width: 60px;
  white-space: nowrap;
}
.dark .heatmap-table th.row-label { color: #cbd5e1; }

.pb-safe { padding-bottom: env(safe-area-inset-bottom); }

/* Hero card */
.hero-card {
  background: #fff;
  border-radius: 1rem;
  outline: 1px solid #e2e8f0;
  padding: 1rem 1.25rem;
  box-shadow: 0 1px 2px rgb(0 0 0 / .04);
}
.dark .hero-card { background: #0f172a; outline-color: #1e293b; }
.hero-price {
  font-size: 2.25rem; line-height: 1;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  margin-top: .15rem;
}
@media (min-width: 640px) { .hero-price { font-size: 3rem; } }

/* Negativstrom Banner (kompakt) */
.neg-banner {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 1rem;
  border-radius: .75rem;
  background: linear-gradient(135deg, #d1fae5 0%, #e0f2fe 100%);
  border: 1px solid #6ee7b7;
}
.dark .neg-banner {
  background: linear-gradient(135deg, rgb(6 78 59 / .3) 0%, rgb(8 47 73 / .3) 100%);
  border-color: rgb(6 78 59 / .8);
}
