:root[data-theme="light"] {
  --page: #ffffff;
  --surface: #fafafa;
  --surface-2: #f2f2f2;
  --chip: #e3e3e3;
  --ink: #000000;
  --ink-2: #141414;
  --muted: #6b6b6b;
  --placeholder: #9a9a9a;
  --hairline: rgba(0, 0, 0, 0.12);
  --input-border: #c9c9c9;
  --grid: #ececec;
  --accent: #0b2ded;
  --accent-hover: #0a28d0;
  --c1: #0b2ded;
  --c2: #c8d4e1;
  --c3: #6b6b6b;
  --frost: rgba(255, 255, 255, 0.9);
  --error: #bf2012;
  --band-bg: #000000;
  --band-ink: #ffffff;
  --badge-home-bg: rgba(11, 45, 237, 0.08);
  --badge-home-ink: #0b2ded;
  --badge-ac-bg: rgba(200, 212, 225, 0.45);
  --badge-ac-ink: #384957;
  --badge-dc-bg: #f2f2f2;
  --badge-dc-ink: #444444;
}

:root[data-theme="dark"] {
  --page: #000000;
  --surface: #141414;
  --surface-2: #1e1e1e;
  --chip: #2a2a2a;
  --ink: #ffffff;
  --ink-2: #f2f2f2;
  --muted: #9a9a9a;
  --placeholder: #707070;
  --hairline: rgba(255, 255, 255, 0.16);
  --input-border: #3a3a3a;
  --grid: #222222;
  --accent: #2447f0;
  --accent-hover: #4d66f0;
  --c1: #5c77ff;
  --c2: #56636f;
  --c3: #9a9a9a;
  --frost: rgba(0, 0, 0, 0.85);
  --error: #ff6b5e;
  --band-bg: #ffffff;
  --band-ink: #000000;
  --badge-home-bg: rgba(92, 119, 255, 0.18);
  --badge-home-ink: #8fa2ff;
  --badge-ac-bg: rgba(200, 212, 225, 0.14);
  --badge-ac-ink: #b9c5d1;
  --badge-dc-bg: #1e1e1e;
  --badge-dc-ink: #c9c9c9;
}

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

body {
  background: var(--page);
  color: var(--ink-2);
  font-family: "Volvo Centum", "Helvetica Neue", Helvetica, "Noto Sans", "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.33s, color 0.33s;
}

header {
  position: sticky;
  top: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
  padding: 12px 40px;
  background: var(--frost);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hairline);
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand .logo { height: 22px; width: auto; display: block; }
:root[data-theme="light"] .brand .logo { filter: invert(1); }
.brand .sub { color: var(--ink); font-size: 16px; font-weight: 400; }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs a {
  color: var(--ink);
  font-size: 14px;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 2px;
  transition: background-color 0.2s;
}
.tabs a:hover { background: var(--surface-2); text-decoration: none; }

.header-right { display: flex; align-items: center; gap: 14px; }

button {
  background: var(--accent);
  color: #ffffff;
  border: none;
  border-radius: 9999px;
  min-height: 40px;
  padding: 0 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: background-color 0.33s, color 0.33s, border-color 0.33s;
}
button:hover { background: var(--accent-hover); }
button:disabled { opacity: 0.5; cursor: wait; }

#themeBtn {
  background: var(--surface-2);
  color: var(--ink);
  width: 40px;
  padding: 0;
  font-size: 16px;
}
#themeBtn:hover { background: var(--chip); }

main { flex: 1; padding: 0 40px 40px; max-width: 1296px; width: 100%; margin: 0 auto; }

.loading, .error { text-align: center; padding: 80px 0; color: var(--muted); }
.error { color: var(--error); }

/* Hero */
.hero { padding-top: 64px; }
.eyebrow { color: var(--muted); font-size: 14px; }
.display {
  color: var(--ink);
  font-size: clamp(48px, 7vw, 68px);
  line-height: 1.12;
  font-weight: 400;
  letter-spacing: -0.01em;
  margin: 4px 0 40px;
}
.hero-img { overflow: hidden; max-width: 880px; margin: 0 auto; }
.hero-img img { display: block; width: 100%; height: auto; }

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 64px;
  padding: 32px 0 8px;
}
.hero-meta .item .label { color: var(--muted); font-size: 14px; margin-bottom: 4px; }
.hero-meta .item .value { color: var(--ink); font-size: 16px; }

/* Aktif şarj bandı — sayfa üstü siyah bilgi şeridi */
.banner {
  background: var(--band-bg);
  color: var(--band-ink);
  text-align: center;
  font-size: 14px;
  padding: 14px 40px;
  margin: 0 -40px;
}
.banner strong { font-weight: 600; }
.banner .pulse {
  display: inline-block;
  width: 8px; height: 8px;
  background: currentColor;
  border-radius: 50%;
  margin-right: 8px;
  animation: pulse 1.6s infinite;
}
@keyframes pulse { 50% { opacity: 0.3; } }

/* Volvo tarzı büyük spec şeridi */
.spec-band {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px 40px;
  padding: 24px 0 8px;
  margin-bottom: 48px;
}
.spec { border-top: 1px solid var(--hairline); padding-top: 16px; }
.spec .label { color: var(--ink); font-size: 16px; margin-bottom: 20px; }
.spec .value { color: var(--ink); font-size: clamp(40px, 4vw, 52px); line-height: 1.15; font-weight: 400; }
.spec .value .u { font-size: 16px; font-weight: 400; color: var(--muted); margin-left: 6px; }
.spec .detail { color: var(--muted); font-size: 14px; margin-top: 10px; }

.battery-bar {
  height: 4px;
  background: var(--surface-2);
  margin-top: 14px;
  overflow: hidden;
}
.battery-bar div { height: 100%; background: var(--accent); }

/* Bölüm başlığı — kısa siyah çizgi + iki kolon */
section.block { margin-bottom: 72px; }
.section-head {
  border-top: 1px solid var(--hairline);
  position: relative;
  padding-top: 40px;
  margin-bottom: 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 48px;
  align-items: start;
}
.section-head::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 80px;
  height: 2px;
  background: var(--ink);
}
.section-head h2 { color: var(--ink); font-size: 32px; line-height: 1.25; font-weight: 400; }
.section-head p { color: var(--ink-2); font-size: 16px; max-width: 60ch; }
@media (max-width: 800px) { .section-head { grid-template-columns: 1fr; } }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px 40px;
  margin-bottom: 24px;
}

.card {
  background: var(--surface);
  border-radius: 2px;
  padding: 24px;
  margin-bottom: 24px;
  transition: background-color 0.33s;
}

.tile { background: none; border-top: 1px solid var(--hairline); border-radius: 0; padding: 16px 0 0; margin-bottom: 8px; }
.tile .label { color: var(--muted); font-size: 14px; margin-bottom: 10px; }
.tile .value { color: var(--ink); font-size: 28px; font-weight: 400; line-height: 1.2; }
.tile .value .u { font-size: 14px; font-weight: 400; color: var(--muted); margin-left: 4px; }
.tile .detail { color: var(--muted); font-size: 13px; margin-top: 8px; }

.two-col {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
}
.two-col.even { grid-template-columns: 1fr 1fr; }
@media (max-width: 800px) { .two-col, .two-col.even { grid-template-columns: 1fr; } }

#map {
  height: 420px;
  background: var(--surface-2);
  overflow: hidden;
}
.leaflet-container { font: inherit; }
:root[data-theme="dark"] .leaflet-tile { filter: invert(1) hue-rotate(180deg) brightness(0.9) contrast(0.9); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--page); color: var(--ink-2); }
.leaflet-popup-content-wrapper { border-radius: 2px; box-shadow: 0 1px 6px rgba(0,0,0,0.2); }

h2 { color: var(--ink); font-size: 16px; font-weight: 600; margin-bottom: 20px; }
h2 .unit { color: var(--muted); font-weight: 400; font-size: 13px; }

.chart-wrap { height: 260px; position: relative; }
.chart-wrap.donut { height: 210px; }

.legend { display: flex; gap: 18px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.legend span { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); }
.legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.legend i.c1 { background: var(--c1); }
.legend i.c2 { background: var(--c2); }
.legend i.c3 { background: var(--c3); }
.legend i.dot { border-radius: 50%; }
.legend i.ink { background: var(--ink); }
.legend i.zone { background: transparent; border: 1px dashed var(--muted); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; white-space: nowrap; }
th {
  text-align: left;
  color: var(--muted);
  font-weight: 500;
  font-size: 13px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--hairline);
}
td { padding: 12px; border-bottom: 1px solid var(--hairline); color: var(--ink-2); font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: none; }
td.num { text-align: right; }
th.num { text-align: right; }

.badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
}
.badge.home { background: var(--badge-home-bg); color: var(--badge-home-ink); }
.badge.ac { background: var(--badge-ac-bg); color: var(--badge-ac-ink); }
.badge.dc { background: var(--badge-dc-bg); color: var(--badge-dc-ink); }

a { color: inherit; text-decoration: underline; text-underline-offset: 3px; transition: color 0.33s; }
a:hover { color: var(--accent); }

.price-row { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; margin-top: 16px; }
.price-row label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.price-row .u2 { font-size: 12px; opacity: 0.75; }
.price-row + .price-row { margin-top: 16px; }
.price-row input, .price-row select {
  background: var(--page);
  border: 1px solid var(--input-border);
  border-radius: 2px;
  color: var(--ink);
  padding: 10px 12px;
  width: 120px;
  font-size: 14px;
  font-family: inherit;
  transition: background-color 0.33s, border-color 0.33s;
}
.price-row input::placeholder { color: var(--placeholder); }
.price-row input:focus, .price-row select:focus { outline: none; border-color: var(--ink); }
.price-row select { width: 180px; }
.price-row input:disabled { opacity: 0.6; }
.op-name { display: inline-flex; align-items: center; gap: 10px; }
.op-logo { width: 28px; height: 28px; object-fit: contain; flex: none; background: #fff; border-radius: 4px; padding: 2px; }
.op-badge { display: inline-flex; align-items: center; justify-content: center; color: #111; font-weight: 600; font-size: 13px; }
.op-average td { font-weight: 600; }

.muted { color: var(--muted); }
.small { font-size: 13px; }

footer {
  text-align: center;
  padding: 32px 40px;
  color: var(--muted);
  font-size: 12.8px;
  border-top: 1px solid var(--hairline);
}

@media (max-width: 800px) {
  header, .banner { padding-left: 20px; padding-right: 20px; }
  #lastUpdate { display: none; }
  .banner { margin: 0 -20px; }
  main { padding: 0 20px 20px; }
  .hero { padding-top: 40px; }
  section.block { margin-bottom: 48px; }
}


/* Giriş / kurulum ekranları */
.screen { max-width: 640px; margin: 0 auto; padding: 56px 0; }
.screen p { margin-bottom: 20px; }
.screen-img { width: 100%; height: auto; display: block; margin-bottom: 8px; }
.steps { margin: 0 0 20px 20px; display: grid; gap: 8px; }
.price-row input.wide { width: min(360px, 80vw); }
.error-inline { color: var(--error); font-size: 14px; margin-top: 12px; }

button.ghost { background: var(--surface-2); color: var(--ink); }
button.ghost:hover { background: var(--chip); }
button.danger { background: none; color: var(--error); border: 1px solid var(--error); }
button.danger:hover { background: var(--error); color: #fff; }
button.link { background: none; color: var(--muted); min-height: 0; padding: 0; font-size: 13px; text-decoration: underline; }
#logoutBtn { background: none; color: var(--muted); border: 1px solid var(--hairline); }
#logoutBtn:hover { color: var(--ink); }

/* Forum */
.post-form { display: grid; gap: 12px; }
.post-form input, .post-form textarea {
  background: var(--page);
  border: 1px solid var(--input-border);
  border-radius: 2px;
  color: var(--ink);
  padding: 10px 12px;
  font: inherit;
  font-size: 15px;
  width: 100%;
  resize: vertical;
}
.post-form input:focus, .post-form textarea:focus { outline: none; border-color: var(--ink); }
.post-form button { justify-self: start; }
.topic-row { display: block; width: 100%; text-align: left; background: none; color: inherit; border-radius: 0; border-top: 1px solid var(--hairline); padding: 16px 0; min-height: 0; white-space: normal; }
.topic-row:hover { background: none; color: var(--accent); }
.topic-row strong { display: block; font-size: 17px; font-weight: 500; }
.post { border-top: 1px solid var(--hairline); padding: 16px 0; }
.post .body { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 6px; }
.post h3 { color: var(--ink); font-size: 22px; font-weight: 400; }
.meta { color: var(--muted); font-size: 13px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.admin-badge { background: var(--accent); color: #fff; font-size: 11px; padding: 1px 8px; border-radius: 9999px; }
#backToTopics { margin-bottom: 16px; }

/* Dil seçici ve KVKK onay kutuları */
#langSel {
  background: var(--surface-2);
  color: var(--ink);
  border: none;
  border-radius: 9999px;
  min-height: 40px;
  padding: 0 12px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.check { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.check input { margin-top: 3px; width: 18px; height: 18px; flex: none; accent-color: var(--accent); }
#usernameForm button { margin-top: 8px; }
.legal h2 { font-size: 20px; font-weight: 500; margin: 32px 0 12px; }
.legal ul.steps { list-style: disc; }

/* Dönen ana sayfa görselleri */
.slides { position: relative; aspect-ratio: 16 / 9; overflow: hidden; }
.slides img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.2s ease; }
.slides img.on { opacity: 1; }

/* Giriş ekranındaki KVKK metni */
.kvkk-box { max-height: 280px; overflow-y: auto; border: 1px solid var(--hairline); background: var(--surface); padding: 16px 20px; margin-bottom: 8px; font-size: 14px; }
.kvkk-box .display { font-size: 22px; margin: 0 0 4px; }
.kvkk-box h2 { font-size: 16px; margin: 20px 0 8px; }
.kvkk-box p { margin-bottom: 10px; }
.kvkk-box:focus { outline: 2px solid var(--accent); }
#googleBtn:disabled { cursor: not-allowed; opacity: 0.4; }

/* Forum kuralları */
#forumRules summary { cursor: pointer; font-weight: 500; color: var(--ink); }
#forumRules[open] summary { margin-bottom: 12px; }
#forumRules .kvkk-box { max-height: 320px; }
#rulesBtn:disabled { cursor: not-allowed; opacity: 0.4; }

/* Volvo API yönergesi */
.guide { margin: 24px 0 32px; }
.guide h2 { font-size: 20px; font-weight: 500; }
.guide .steps { margin-bottom: 12px; }
.btn-link { display: inline-block; background: var(--accent); color: #fff; text-decoration: none; border-radius: 9999px; padding: 10px 20px; font-size: 14px; font-weight: 500; }
.btn-link:hover { background: var(--accent-hover); color: #fff; }
