:root {
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --surface-alt: #F1F5F9;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;
  --text: #0F172A;
  --text-muted: #475569;
  --cta: #047857;
  --cta-hover: #065F46;
  --cta-secondary-bg: #0F172A;
  --cta-secondary-hover: #1E293B;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  --max-width: 1080px;

  --eu-a: #00843D;
  --eu-b: #4FB848;
  --eu-c: #B6D300;
  --eu-d: #FFED00;
  --eu-e: #FBB900;
  --eu-f: #EC6608;
  --eu-g: #E30613;
}

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

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

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--text);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.num, td.num, th.num {
  font-variant-numeric: tabular-nums;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
}

main {
  flex: 1 0 auto;
  padding: 24px 0 64px;
}

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

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--eu-a);
  color: #FFFFFF;
  font-size: 0.85rem;
  font-weight: 800;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.main-nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 6px 2px;
}

.main-nav a:hover {
  color: var(--text);
  text-decoration: none;
}

/* Inline SVG Flag Switcher */
.flag-switcher {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface-alt);
  padding: 4px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.flag-btn {
  appearance: none;
  border: 1.5px solid transparent;
  background: transparent;
  padding: 4px;
  border-radius: 5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 28px;
  transition: border-color 0.12s ease, background-color 0.12s ease;
}

.flag-btn:hover {
  background: var(--surface);
}

.flag-btn.is-active {
  background: var(--surface);
  border-color: var(--text);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
}

.flag-btn svg {
  display: block;
  width: 22px;
  height: 15px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.12);
}

/* Search Box */
.header-search-wrap {
  width: 100%;
  padding-bottom: 12px;
}

.search-box {
  position: relative;
  width: 100%;
}

.search-input {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px 10px 40px;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  outline: none;
}

.search-input:focus {
  background: var(--surface);
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
  z-index: 60;
  max-height: 360px;
  overflow-y: auto;
  display: none;
}

.search-results.is-open {
  display: block;
}

.search-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}

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

.search-item:hover {
  background: var(--bg);
  text-decoration: none;
}

.search-item-title {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text);
}

.search-item-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.search-empty {
  padding: 12px 14px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Cards & Typography */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

h1 {
  font-size: 1.65rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}

h2 {
  font-size: 1.2rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
}

h3 {
  font-size: 1.02rem;
  margin: 0 0 6px;
}

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

.small {
  font-size: 0.85rem;
}

/* Breadcrumbs */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.breadcrumbs a {
  color: var(--text-muted);
}

.breadcrumbs a:hover {
  color: var(--text);
}

/* EU Energy Class Badges */
.eu-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  padding: 0 7px;
  border-radius: 4px;
  font-weight: 800;
  font-size: 0.82rem;
  color: #FFFFFF;
  line-height: 1;
}

.eu-badge--A { background: var(--eu-a); }
.eu-badge--B { background: var(--eu-b); }
.eu-badge--C { background: var(--eu-c); color: var(--text); }
.eu-badge--D { background: var(--eu-d); color: var(--text); }
.eu-badge--E { background: var(--eu-e); color: var(--text); }
.eu-badge--F { background: var(--eu-f); }
.eu-badge--G { background: var(--eu-g); }

.eu-label-arrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.eu-label-arrow svg {
  display: block;
  width: 68px;
  height: 36px;
}

/* Hero Home */
.home-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 20px;
  margin-bottom: 24px;
}

.home-hero h1 {
  font-size: 1.85rem;
  max-width: 720px;
}

.home-hero p {
  color: var(--text-muted);
  max-width: 660px;
  margin: 0 0 18px;
}

.home-hero .search-box {
  max-width: 580px;
}

/* Category Grid */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.cat-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  transition: border-color 0.15s ease;
}

.cat-card:hover {
  border-color: var(--text);
  text-decoration: none;
}

.cat-card-title {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.cat-card-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

/* Model Page Hero */
.model-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}

.model-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.kpi-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.kpi-box--primary {
  border-color: var(--border-strong);
  background: #F0FDF4;
}

.kpi-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.kpi-value {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--text);
  letter-spacing: -0.02em;
}

.kpi-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Interactive Electricity Price Slider */
.calc-control {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 18px;
}

.calc-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.calc-input-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.calc-number {
  width: 84px;
  min-height: 38px;
  padding: 6px 8px;
  font-size: 0.95rem;
  font-weight: 700;
  text-align: right;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
}

.calc-slider {
  width: 100%;
  height: 28px;
  accent-color: var(--cta);
  cursor: pointer;
}

.calc-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.link-btn {
  background: none;
  border: none;
  padding: 4px 0;
  color: var(--cta);
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
}

/* CTA Buttons */
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--cta);
  color: #FFFFFF;
  flex: 1 1 220px;
}

.btn-primary:hover {
  background: var(--cta-hover);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
  flex: 1 1 180px;
}

.btn-secondary:hover {
  background: var(--surface-alt);
  border-color: var(--text);
}

.btn-sm {
  min-height: 40px;
  padding: 8px 14px;
  font-size: 0.86rem;
}

.cta-disclosure {
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Comparison SVG Box */
.compare-verdict {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 12px;
}

.compare-verdict--good { color: #047857; }
.compare-verdict--bad { color: #B91C1C; }
.compare-verdict--neutral { color: var(--text); }

.compare-svg {
  display: block;
  width: 100%;
  max-width: 560px;
  height: auto;
}

/* Alternatives Grid */
.alt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.alt-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.alt-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.savings-pill {
  display: inline-block;
  background: #DCFCE7;
  color: #166534;
  border: 1px solid #BBF7D0;
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  margin-top: 6px;
}

.alt-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Specs & Category Tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

table.data-table th,
table.data-table td {
  text-align: left;
  padding: 11px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

table.data-table th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  background: var(--bg);
  white-space: nowrap;
}

table.data-table td.spec-key {
  color: var(--text-muted);
  width: 45%;
}

table.data-table td.spec-val {
  font-weight: 600;
}

/* Similar Models Grid */
.similar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.similar-card {
  display: block;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.similar-card:hover {
  border-color: var(--text);
  text-decoration: none;
}

/* Brand Pills */
.brand-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 500;
}

.brand-pill:hover {
  border-color: var(--text);
  text-decoration: none;
}

/* AdSense Reserved Slot (CLS = 0) */
.ad-slot {
  min-height: 100px;
  margin: 18px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-alt);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

/* Mobile Sticky Bottom Bar */
.sticky-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--surface);
  border-top: 1px solid var(--border-strong);
  box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.1);
  padding: 10px 14px;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transform: translateY(110%);
  transition: transform 0.2s ease;
}

.sticky-cta.is-visible {
  transform: translateY(0);
}

.sticky-info {
  min-width: 0;
}

.sticky-model {
  font-weight: 700;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sticky-cost {
  font-size: 0.82rem;
  color: var(--cta);
  font-weight: 700;
}

.sticky-cta .btn {
  min-height: 42px;
  padding: 8px 14px;
  font-size: 0.88rem;
  flex: 0 0 auto;
  white-space: nowrap;
}

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

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 12px;
}

.footer-links a {
  color: var(--text);
  font-weight: 500;
}

/* Desktop Refinements */
@media (min-width: 768px) {
  h1 {
    font-size: 2rem;
  }

  .kpi-value {
    font-size: 2.05rem;
  }

  .card {
    padding: 24px;
  }

  .sticky-cta {
    display: none;
  }

  .site-footer {
    padding-bottom: 32px;
  }

  .header-inner {
    flex-wrap: nowrap;
  }

  .header-search-wrap {
    max-width: 420px;
    padding-bottom: 0;
  }
}

@media (max-width: 520px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .main-nav {
    gap: 10px;
  }

  .main-nav a {
    font-size: 0.84rem;
  }
}