/* DynoBox Customer Panel — motorsport / garage self-service dashboard */

:root {
  /* motorsport / garage tokens (shared with admin) */
  --db-red: #E10600;       /* racing red — primary */
  --db-red-deep: #B80500;
  --db-orange: #FF7A00;    /* boost — secondary accent */
  --db-ink: #0B0B0D;       /* deepest ground */
  --db-carbon: #121216;    /* ground */
  --db-surface: #17181D;   /* cards */
  --db-surface2: #1F2026;  /* raised */
  --db-line: #2C2D33;      /* borders */
  --db-steel: #8B9098;     /* muted text */
  --db-white: #F4F5F7;     /* text */
  --db-yellow: #FFD200;    /* hazard / checker accent, sparing */

  /* semantic aliases mapped onto the palette */
  --bg: var(--db-carbon);
  --bg-soft: var(--db-ink);
  --surface: var(--db-surface);
  --surface-2: var(--db-surface2);
  --border: var(--db-line);
  --text: var(--db-white);
  --muted: var(--db-steel);
  --primary: var(--db-red);
  --primary-soft: rgba(225, 6, 0, 0.14);
  --accent: var(--db-orange);
  --accent-soft: rgba(255, 122, 0, 0.12);
  --danger: #ef4444;
  --ok: #34d399;
  --warn: var(--db-orange);

  --radius: 4px;
  --ch: 12px;              /* card chamfer */
  --ch-sm: 8px;           /* button chamfer */
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.6);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, Consolas, "SF Mono", "Cascadia Code", "Courier New", monospace;
  --cond: "Segoe UI Semibold", "Arial Narrow", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
  background:
    radial-gradient(900px 520px at 88% -12%, rgba(225, 6, 0, 0.12), transparent 60%),
    radial-gradient(720px 440px at -12% 112%, rgba(255, 122, 0, 0.08), transparent 60%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.016) 0 1px, transparent 1px 5px),
    repeating-linear-gradient(-45deg, rgba(0, 0, 0, 0.20) 0 1px, transparent 1px 5px),
    var(--db-carbon);
  color: var(--text);
  font-family: var(--font);
  font-size: 15.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: var(--db-orange); }

button { font: inherit; color: inherit; }

h1, h2, h3, h4 { text-transform: uppercase; letter-spacing: -0.01em; }

/* keyboard focus — orange racing ring */
:focus-visible {
  outline: 2px solid var(--db-orange);
  outline-offset: 2px;
}

/* ---------- brand wordmark ---------- */
.wordmark {
  font-family: var(--cond);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
}
.wm-dyno { color: var(--db-white); }
.wm-box { color: var(--db-red); }
.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  line-height: 0;
}
.logo-mark svg { display: block; }

/* ---------- generic controls ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 15px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  clip-path: polygon(var(--ch-sm) 0, 100% 0, 100% calc(100% - var(--ch-sm)), calc(100% - var(--ch-sm)) 100%, 0 100%, 0 var(--ch-sm));
  transition: background 0.15s, border-color 0.15s, color 0.15s, filter 0.15s, transform 0.08s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--db-red); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.primary {
  background: linear-gradient(180deg, var(--db-red), var(--db-red-deep));
  border-color: var(--db-red);
  color: #fff;
}
.btn.primary:hover { filter: brightness(1.06) drop-shadow(0 0 10px rgba(225, 6, 0, 0.55)); border-color: var(--db-orange); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: rgba(255, 122, 0, 0.08); }
.btn.danger { border-color: rgba(239, 68, 68, 0.5); color: #fca5a5; }
.btn.danger:hover { border-color: var(--danger); color: #fecaca; }
.btn.small { padding: 4px 10px; font-size: 13px; clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px); }
.btn.block { width: 100%; }
a.btn { text-decoration: none; }

.input {
  width: 100%;
  background: var(--db-ink);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 9px 12px;
  font-size: 15.5px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus { border-color: var(--db-red); box-shadow: 0 0 0 3px rgba(225, 6, 0, 0.22); }
.input.grow { flex: 1; min-width: 0; }
.input.num { width: 92px; text-align: right; font-family: var(--mono); }
select.input { appearance: auto; }

.field { margin-top: 14px; }
.field > label,
.field-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}
.field-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-cols .field { margin-top: 14px; }

input[type="range"] { width: 100%; accent-color: var(--db-red); }
input[type="color"] {
  width: 100%;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--db-ink);
  padding: 3px;
  cursor: pointer;
}

.hint { color: var(--muted); font-size: 13.5px; margin-top: 8px; }
.error { color: #fca5a5; font-size: 14px; margin-top: 8px; font-weight: 600; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 11px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-family: var(--mono);
}
.chip.ok { color: #6ee7b7; border-color: rgba(52, 211, 153, 0.45); background: rgba(52, 211, 153, 0.10); }
.chip.warn { color: var(--db-orange); border-color: rgba(255, 122, 0, 0.45); background: rgba(255, 122, 0, 0.10); }
.chip.err { color: #fca5a5; border-color: rgba(239, 68, 68, 0.45); background: rgba(239, 68, 68, 0.10); }
.chip.cat { color: var(--db-orange); border-color: rgba(255, 122, 0, 0.4); background: rgba(255, 122, 0, 0.09); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

.badge {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  transition: color 0.15s, border-color 0.15s;
}
.badge:hover { color: var(--db-orange); border-color: var(--db-orange); }

.actions-row { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.actions-row.end { justify-content: flex-end; }

/* ---------- auth (register / login) ---------- */
.auth-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 32px 28px 22px;
  clip-path: polygon(var(--ch) 0, 100% 0, 100% calc(100% - var(--ch)), calc(100% - var(--ch)) 100%, 0 100%, 0 var(--ch));
  box-shadow: var(--shadow);
}
.auth-card::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--db-red), var(--db-orange));
}
.auth-brand { display: flex; align-items: center; gap: 12px; justify-content: center; }
.auth-brand h1 { font-size: 30px; }
.auth-brand .wordmark { letter-spacing: 0.02em; }
.auth-sub { text-align: center; color: var(--muted); margin: 10px 0 20px; }

.auth-tabs {
  display: flex;
  gap: 6px;
  background: var(--db-ink);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 18px;
}
.auth-tab {
  flex: 1;
  background: transparent;
  border: none;
  border-radius: 2px;
  color: var(--muted);
  padding: 9px 10px;
  font-weight: 800;
  font-size: 13.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.auth-tab.active { background: var(--primary-soft); color: var(--db-white); box-shadow: inset 0 -2px 0 var(--db-red); }

.auth-card .field-label { margin-top: 14px; }
.auth-card .field-label:first-of-type { margin-top: 0; }
.auth-form .btn.block { margin-top: 18px; }
.auth-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.auth-foot .home-link { font-size: 13.5px; color: var(--muted); text-decoration: none; }
.auth-foot .home-link:hover { color: var(--db-orange); }

/* ---------- app layout ---------- */
#app {
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
  min-height: 100vh;
}
.topbar {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: linear-gradient(180deg, var(--db-surface2), var(--db-surface));
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}
.topbar-title { font-size: 18px; }

.sidebar {
  display: flex;
  flex-direction: column;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.015) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, var(--db-surface2), var(--db-carbon));
  border-right: 1px solid var(--border);
  padding: 20px 14px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.side-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 6px 16px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.side-brand-text { display: flex; flex-direction: column; min-width: 0; }
.side-title { font-size: 19px; }
.side-sub {
  font-size: 13px;
  color: var(--muted);
  font-family: var(--mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 3px;
}

.side-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; margin-top: 10px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  background: transparent;
  border: 1px solid transparent;
  border-left: 2px solid transparent;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--muted);
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.nav-item:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.nav-item.active {
  color: var(--db-white);
  background: linear-gradient(90deg, var(--primary-soft), transparent);
  border-left-color: var(--db-red);
}
.nav-item.active .nav-ico { color: var(--db-red); }
.nav-ico { display: inline-flex; }
.nav-item .nav-lock { margin-left: auto; display: inline-flex; color: var(--muted); opacity: 0.8; }
.nav-item.locked { opacity: 0.7; }
.nav-item .nav-label { flex: 1; }

.side-foot { display: flex; flex-direction: column; gap: 12px; padding-top: 14px; border-top: 1px solid var(--border); }
.side-foot .badge { text-align: center; }
.side-foot-row { display: flex; gap: 8px; justify-content: space-between; }
.side-foot-row .btn { flex: 1; }

.main { padding: 28px 32px 60px; min-width: 0; }

.view { display: none; }
.view.active { display: block; animation: fadeIn 0.18s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; } }

.view-head { margin-bottom: 20px; position: relative; padding-left: 14px; }
.view-head::before {
  content: "";
  position: absolute;
  left: 0; top: 2px; bottom: 2px;
  width: 4px;
  background: linear-gradient(180deg, var(--db-red), var(--db-orange));
}
.view-head h2 { font-size: 23px; font-weight: 900; }
.view-sub { color: var(--muted); margin-top: 4px; }

/* ---------- cards / grids ---------- */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 20px;
  margin-bottom: 18px;
  clip-path: polygon(var(--ch) 0, 100% 0, 100% calc(100% - var(--ch)), calc(100% - var(--ch)) 100%, 0 100%, 0 var(--ch));
}
.card h3 { font-size: 15.5px; margin-bottom: 12px; font-weight: 800; letter-spacing: 0.02em; }
.card h4 { font-size: 14px; }
.card.narrow { max-width: 560px; }
.grid.two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.kv { display: flex; flex-direction: column; gap: 10px; }
.kv-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.kv-row dt { color: var(--muted); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.kv-row dd { font-weight: 600; text-align: right; min-width: 0; }
.key-row { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.key-row code, code.key {
  font-family: var(--mono);
  font-size: 13.5px;
  color: var(--db-orange);
  background: var(--db-ink);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px 8px;
  word-break: break-all;
}

/* ---------- status card (Panom) ---------- */
.status-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.status-icon {
  width: 54px; height: 54px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--db-red);
  border: 1px solid rgba(225, 6, 0, 0.4);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}
.status-icon.ok { color: var(--ok); background: rgba(52, 211, 153, 0.12); border-color: rgba(52, 211, 153, 0.35); }
.status-icon.warn { color: var(--db-orange); background: var(--accent-soft); border-color: rgba(255, 122, 0, 0.4); }
.status-icon.err { color: #fca5a5; background: rgba(239, 68, 68, 0.10); border-color: rgba(239, 68, 68, 0.35); }
.status-text { min-width: 0; }
.status-text h3 { font-size: 18px; margin-bottom: 4px; font-weight: 900; }
.status-text p { color: var(--muted); font-size: 14.5px; text-transform: none; }

.pending-note {
  display: flex; align-items: center; gap: 10px;
  margin-top: 16px;
  background: var(--accent-soft);
  border: 1px dashed rgba(255, 122, 0, 0.45);
  border-radius: var(--radius);
  padding: 12px 14px;
  color: var(--db-orange);
  font-size: 14.5px;
  font-weight: 600;
}

/* ---------- package selection ---------- */
.plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.plan-card {
  position: relative;
  background: var(--db-ink);
  border: 1px solid var(--border);
  padding: 20px;
  cursor: pointer;
  clip-path: polygon(var(--ch) 0, 100% 0, 100% calc(100% - var(--ch)), calc(100% - var(--ch)) 100%, 0 100%, 0 var(--ch));
  transition: border-color 0.15s, transform 0.08s, background 0.15s;
}
.plan-card:hover { border-color: rgba(255, 122, 0, 0.55); }
.plan-card.selected { border-color: var(--db-red); background: var(--primary-soft); }
.plan-card .plan-name { font-weight: 900; font-size: 16px; text-transform: uppercase; letter-spacing: 0.03em; }
.plan-card .plan-price { font-size: 26px; font-weight: 900; margin: 8px 0 2px; font-family: var(--mono); }
.plan-card .plan-price small { font-size: 13.5px; font-weight: 600; color: var(--muted); font-family: var(--font); }
.plan-card .plan-desc { color: var(--muted); font-size: 14px; margin-top: 8px; }
.plan-card .plan-radio {
  position: absolute; top: 16px; right: 16px;
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--border);
}
.plan-card.selected .plan-radio { border-color: var(--db-red); background: radial-gradient(circle, var(--db-red) 45%, transparent 50%); }

.cat-select { margin-top: 18px; }
.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--db-ink);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  user-select: none;
}
.cat-chip:hover { border-color: rgba(255, 122, 0, 0.55); }
.cat-chip.on { border-color: var(--db-orange); background: var(--accent-soft); color: var(--db-orange); }
.cat-chip.base { cursor: default; border-color: rgba(52, 211, 153, 0.45); background: rgba(52, 211, 153, 0.10); color: #6ee7b7; }
.cat-chip .cat-price { font-size: 13px; opacity: 0.85; font-family: var(--mono); }

.total-row {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border);
}
.total-row .total-label { color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.total-row .total-amount { font-size: 28px; font-weight: 900; color: var(--db-red); font-family: var(--mono); }
.total-row .total-amount small { font-size: 14.5px; color: var(--muted); font-weight: 600; font-family: var(--font); }

/* ---------- setup steps ---------- */
.steps { list-style: none; display: flex; flex-direction: column; gap: 14px; counter-reset: step; }
.step {
  display: flex; gap: 14px;
  background: var(--db-ink);
  border: 1px solid var(--border);
  border-left: 3px solid var(--db-red);
  padding: 14px 16px;
}
.step::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  flex: none;
  min-width: 30px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--db-red);
  border: 1px solid rgba(225, 6, 0, 0.4);
  font-weight: 900; font-size: 14.5px; font-family: var(--mono);
  clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px);
}
.step-body { min-width: 0; flex: 1; }
.step-body h4 { font-size: 15px; margin-bottom: 4px; font-weight: 800; }
.step-body p { color: var(--muted); font-size: 14.5px; text-transform: none; }

.snippet-block { margin-top: 12px; }
.snippet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.snippet {
  background: #08090C;
  border: 1px solid var(--border);
  border-left: 3px solid var(--db-orange);
  border-radius: var(--radius);
  padding: 14px;
  overflow-x: auto;
}
.snippet code { font-family: var(--mono); font-size: 13.5px; color: #cfe3ef; white-space: pre; }
.download-row { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.download-row .hint { margin-top: 0; }

/* ---------- lock banner (non-active) ---------- */
.lock-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  background: var(--surface);
  border: 1px dashed var(--border);
  padding: 40px 28px;
  color: var(--muted);
  clip-path: polygon(var(--ch) 0, 100% 0, 100% calc(100% - var(--ch)), calc(100% - var(--ch)) 100%, 0 100%, 0 var(--ch));
}
.lock-banner .lock-big {
  width: 56px; height: 56px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--db-orange);
  border: 1px solid rgba(255, 122, 0, 0.35);
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}
.lock-banner h3 { color: var(--text); font-size: 18px; font-weight: 900; }
.lock-banner p { max-width: 440px; font-size: 15px; text-transform: none; }

.locked-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 18px;
  background: var(--db-ink);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  color: var(--muted);
  font-size: 14px;
}
.lock-ico { display: inline-flex; color: var(--db-orange); flex: none; }

/* ---------- website (single domain) ---------- */
.domain-form { margin-bottom: 4px; }
.inline-form { display: flex; gap: 0; align-items: stretch; }
.input-prefix {
  display: inline-flex; align-items: center; padding: 0 12px;
  font-family: var(--mono); font-size: 14.5px; color: var(--muted);
  background: var(--db-ink);
  border: 1px solid var(--border); border-right: 0;
  border-radius: var(--radius) 0 0 var(--radius);
  white-space: nowrap;
}
.inline-form .input { border-radius: 0 var(--radius) var(--radius) 0; }
.domain-covered { margin: 16px 0 4px; }
.domain-covered-label {
  display: block; font-size: 13.5px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 8px;
}
.domain-list { list-style: none; display: flex; flex-direction: column; gap: 8px; margin: 0; }
.domain-list li {
  display: flex; align-items: center; gap: 10px;
  background: var(--db-ink);
  border: 1px solid var(--border);
  border-left: 2px solid var(--db-red);
  border-radius: var(--radius);
  padding: 8px 12px;
}
.domain-list .domain-name { font-family: var(--mono); font-size: 14.5px; }

/* ---------- vehicle tree ---------- */
.toolbar { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.cat-tabs {
  display: flex; flex-wrap: wrap; gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.cat-tab {
  background: transparent; border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  padding: 8px 15px 9px;
  font-weight: 800; font-size: 13.5px;
  text-transform: uppercase; letter-spacing: 0.05em;
  cursor: pointer; margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}
.cat-tab:hover { color: var(--text); }
.cat-tab.active { color: var(--db-white); border-bottom-color: var(--db-red); }
.tree {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  margin-bottom: 18px;
  min-height: 80px;
}
.tree-empty { color: var(--muted); padding: 18px; text-align: center; }
.tree-node { border-radius: var(--radius); }
.tree-row {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: var(--radius); min-height: 38px;
}
.tree-row:hover { background: rgba(255, 255, 255, 0.035); }
.tree-row.hidden-item { opacity: 0.55; }
.tree-row.hidden-item .node-name { text-decoration: line-through; }
.expander {
  width: 22px; height: 22px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: none; border-radius: var(--radius);
  color: var(--muted); cursor: pointer; font-size: 12px;
  transition: transform 0.15s, color 0.15s;
}
.expander:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.expander.open { transform: rotate(90deg); color: var(--db-red); }
.expander-spacer { width: 22px; flex: none; }
.node-name { font-weight: 700; }
.node-count { color: var(--muted); font-size: 13.5px; font-family: var(--mono); }
.tag {
  font-size: 12px; font-weight: 800; letter-spacing: 0.05em;
  border-radius: 3px; padding: 1px 6px; text-transform: uppercase;
  font-family: var(--mono);
}
.tag.fuel { background: rgba(255, 122, 0, 0.12); color: #ffb066; }
.tag.fuel-diesel { background: rgba(148, 163, 184, 0.14); color: #cbd5e1; }
.tag.fuel-electric { background: rgba(52, 211, 153, 0.14); color: #6ee7b7; }
.tag.fuel-hybrid { background: rgba(52, 211, 153, 0.14); color: #6ee7b7; }
.tag.custom { background: rgba(255, 210, 0, 0.16); color: var(--db-yellow); }
.tag.hidden { background: rgba(239, 68, 68, 0.16); color: #fca5a5; }
.tag.edited { background: rgba(225, 6, 0, 0.18); color: #ff8a84; }
.engine-info { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; flex: 1; }
.engine-stats { color: var(--muted); font-size: 13.5px; font-family: var(--mono); }
.stage-chip {
  font-size: 13px; font-family: var(--mono);
  background: var(--db-ink); border: 1px solid var(--border);
  border-radius: 3px; padding: 1px 7px;
}
.stage-chip .gain { color: var(--ok); }
.row-actions { margin-left: auto; display: flex; gap: 6px; flex: none; }
.tree-children { padding-left: 22px; }
.orphan-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.orphan-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--db-ink); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 7px 12px;
}
.orphan-list code { font-family: var(--mono); font-size: 13.5px; color: var(--muted); word-break: break-all; }

/* ---------- theme editor ---------- */
.theme-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 4fr); gap: 18px; align-items: start; }
.preview-col { display: flex; flex-direction: column; }
.color-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.color-field span {
  display: block; font-size: 13px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px;
}
.iframe-wrap {
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; background: var(--db-ink);
}
.iframe-wrap iframe { display: block; width: 100%; height: 460px; border: 0; }

/* ---------- modal ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(4, 5, 7, 0.74);
  backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 6vh 16px 16px; z-index: 100; overflow-y: auto;
  animation: fadeIn 0.15s ease-out;
}
.modal {
  width: 100%; max-width: 600px;
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow);
  clip-path: polygon(var(--ch) 0, 100% 0, 100% calc(100% - var(--ch)), calc(100% - var(--ch)) 100%, 0 100%, 0 var(--ch));
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.modal-head h3 { font-size: 15.5px; font-weight: 800; letter-spacing: 0.03em; }
.modal-body { padding: 18px 20px 20px; }
.modal-close {
  background: transparent; border: none; color: var(--muted);
  font-size: 20px; line-height: 1; cursor: pointer;
  padding: 4px 8px; border-radius: var(--radius);
}
.modal-close:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.stage-rows { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.stage-row { display: flex; gap: 8px; align-items: center; }
.stage-row .input.name { flex: 1; min-width: 0; }
.stock-line {
  color: var(--muted); font-size: 14px; font-family: var(--mono);
  background: var(--db-ink); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px 12px;
}
.wz-section { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.wz-section:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.wz-section h4 {
  font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--db-orange); margin-bottom: 4px; font-weight: 800;
}
.wz-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.wz-cols-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* ---------- toasts ---------- */
.toasts {
  position: fixed; right: 18px; bottom: 18px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 200; max-width: min(360px, calc(100vw - 36px));
}
.toast {
  background: var(--surface-2); border: 1px solid var(--border);
  border-left: 3px solid var(--ok); border-radius: var(--radius);
  padding: 11px 16px; font-size: 14.5px; font-weight: 600;
  box-shadow: var(--shadow); cursor: pointer;
  animation: toastIn 0.2s ease-out; word-break: break-word;
}
.toast.err { border-left-color: var(--danger); }
.toast.warn { border-left-color: var(--db-orange); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; } }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .theme-grid { grid-template-columns: 1fr; }
  .grid.two { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  #app { grid-template-columns: 1fr; }
  .topbar { display: flex; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 262px;
    z-index: 90; transform: translateX(-105%);
    transition: transform 0.2s ease-out; box-shadow: var(--shadow);
  }
  .sidebar.open { transform: none; }
  .main { padding: 18px 14px 50px; }
  .plan-grid { grid-template-columns: 1fr; }
  .kv-row { flex-direction: column; align-items: flex-start; gap: 2px; }
  .kv-row dd { text-align: left; }
  .row-actions { flex-direction: column; }
  .wz-cols, .wz-cols-3 { grid-template-columns: 1fr; }
  .field-cols { grid-template-columns: 1fr; }
  .stage-row { flex-wrap: wrap; }
}
@media (max-width: 380px) {
  .main { padding: 16px 11px 46px; }
  .card { padding: 16px; }
  .view-head h2 { font-size: 20px; }
  .color-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* ---- detailed setup screen (Kurulum) ---- */
.card-sub { color: var(--muted); font-size: 14.5px; margin: 4px 0 14px; text-transform: none; }
.warn-card { border-color: rgba(225, 6, 0, 0.45); background:
  linear-gradient(180deg, rgba(225, 6, 0, 0.08), rgba(225, 6, 0, 0)) , var(--panel, #131419); }
.warn-card h3 { color: #ff6a4d; }
.method-card { border: 1px solid var(--line, #23242A); border-radius: 8px; padding: 12px; margin-top: 12px; }
.method-head { min-width: 0; }
.method-head h4 { font-size: 15px; font-weight: 800; margin-bottom: 3px; }
.method-desc { color: var(--muted); font-size: 14px; text-transform: none; margin: 0; }
.note-list { list-style: none; margin: 10px 0 0; padding: 0; }
.note-list li { position: relative; padding-left: 16px; margin: 7px 0; color: var(--muted);
  font-size: 14px; line-height: 1.55; text-transform: none; }
.note-list li::before { content: ""; position: absolute; left: 0; top: 8px; width: 6px; height: 6px;
  background: var(--red, #e10600); border-radius: 1px; }
.warn-inline { margin-top: 10px; color: #ffb59f; font-size: 14px; text-transform: none;
  border-left: 3px solid var(--red, #e10600); padding-left: 10px; }

/* açma/kapama satırı — tema seçenekleri (ör. BÜYÜK HARF) */
.switch-row {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 4px 0 14px;
    cursor: pointer;
    font-size: 14.5px;
    color: var(--text);
}

.switch-row input {
    width: 17px;
    height: 17px;
    accent-color: var(--primary);
    cursor: pointer;
    flex: none;
}
