:root {
  --bg: #0d1117;
  --panel: #151b23;
  --panel-2: #1b232d;
  --line: #263041;
  --text: #e6edf3;
  --muted: #8b98a5;
  --accent: #4c9ffe;
  --accent-2: #38d39f;
  --warn: #f0b429;
  --radius: 10px;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: radial-gradient(1200px 600px at 20% -10%, #17222f 0%, var(--bg) 55%);
  color: var(--text);
  min-height: 100vh;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(13, 17, 23, 0.7);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand { display: flex; gap: 14px; align-items: center; }
.logo {
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 12px; background: linear-gradient(140deg, #1f6feb, #38d39f);
  color: #04121f; font-size: 22px; font-weight: 700;
}
h1 { font-size: 19px; margin: 0; letter-spacing: 0.2px; }
.sub { margin: 2px 0 0; font-size: 12px; color: var(--muted); }

.status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.chip {
  font-size: 12px; padding: 6px 10px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); background: var(--panel);
  white-space: nowrap;
}
.chip.ok { color: var(--accent-2); border-color: #1d4d3d; }
.chip.warn { color: var(--warn); border-color: #4d3f1d; }

main { max-width: 1180px; margin: 0 auto; padding: 26px 24px 80px; display: grid; gap: 22px; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.card h2 { margin: 0 0 16px; font-size: 15px; font-weight: 600; letter-spacing: 0.3px; text-transform: uppercase; color: var(--muted); }

.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--muted); }
.field.wide { grid-column: 1 / -1; }
.field em { font-style: normal; color: #5d6b7a; }

.budget-row { display: flex; align-items: center; gap: 6px; }
input[type="number"], textarea, select {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  border-radius: 8px; padding: 9px 11px; font-size: 14px; font-family: inherit; width: 100%;
}
input[type="number"] { width: 110px; font-variant-numeric: tabular-nums; }
.euro { color: var(--muted); }
input[type="range"] { width: 100%; accent-color: var(--accent); }
textarea { resize: vertical; }

.seg { display: flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button {
  flex: 1; padding: 8px 6px; font-size: 12px; background: transparent; color: var(--muted);
  border: 0; cursor: pointer; font-family: inherit; white-space: nowrap;
}
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: #1f6feb22; color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }

.actions { display: flex; align-items: center; gap: 14px; margin-top: 20px; }
button.primary {
  background: linear-gradient(120deg, #1f6feb, #4c9ffe); color: white; border: 0;
  padding: 11px 22px; border-radius: 9px; font-size: 14px; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
button.primary:disabled { opacity: 0.55; cursor: progress; }
button.ghost {
  background: transparent; color: var(--text); border: 1px solid var(--line);
  padding: 8px 14px; border-radius: 8px; cursor: pointer; font-size: 12px; font-family: inherit;
}
button.ghost:hover { border-color: var(--accent); color: var(--accent); }
.hint { font-size: 12px; color: var(--muted); }

.hidden { display: none !important; }

.result-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.result-head h2 { font-size: 15px; text-transform: uppercase; letter-spacing: 0.3px; color: var(--muted); margin: 0; }
.totals { display: flex; gap: 14px; align-items: baseline; }
.total { font-size: 24px; font-weight: 700; color: var(--accent-2); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); font-size: 12px; }
.small { font-size: 11px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
.parts th, .offers th {
  text-align: left; font-weight: 500; color: var(--muted); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.4px; padding: 8px 10px; border-bottom: 1px solid var(--line);
}
.parts td, .offers td { padding: 10px; border-bottom: 1px solid #1d2530; vertical-align: top; }
.parts tr:last-child td, .offers tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.parts .cat { color: var(--muted); font-size: 12px; width: 130px; }
.parts .model { max-width: 520px; }
.parts .model a { color: var(--text); text-decoration: none; }
.parts .model a:hover { color: var(--accent); }
.parts .reason { color: var(--muted); font-size: 11px; margin-top: 3px; }
.parts .bench { color: var(--accent); font-size: 12px; white-space: nowrap; }
.parts tr.owned td { background: #38d39f10; }
.parts tr.owned td:first-child { box-shadow: inset 3px 0 0 var(--accent-2); }
.parts .badge { margin-left: 8px; vertical-align: middle; }

.warnings { margin: 14px 0 0; padding-left: 18px; color: var(--warn); font-size: 12px; display: grid; gap: 4px; }

.tab-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs button {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--muted);
  padding: 6px 11px; border-radius: 999px; font-size: 12px; cursor: pointer; font-family: inherit;
}
.tabs button.on { color: var(--accent); border-color: #1f6feb66; background: #1f6feb1a; }

.list-controls { display: flex; gap: 10px; margin: 12px 0 10px; }
.list-controls input[type="search"] { flex: 1; }
.list-controls select { width: auto; min-width: 220px; }

.owned-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; }
.owned-row { display: flex; align-items: center; gap: 10px; }
.owned-row label { display: flex; align-items: center; gap: 8px; font-size: 13px; width: 140px; flex-shrink: 0; }
.owned-row input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; }
.owned-row select { flex: 1; font-size: 12px; padding: 6px 8px; }
.owned-row select:disabled { opacity: 0.45; }
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px;
  background: #38d39f22; color: var(--accent-2); border: 1px solid #38d39f55;
}

.table-wrap {
  max-height: 460px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.table-wrap thead th { position: sticky; top: 0; background: var(--panel); z-index: 1; }
.offers td.title { max-width: 480px; }
.offers .specs { color: var(--muted); font-size: 11px; }
.offers .bar { height: 4px; border-radius: 3px; background: var(--accent); }

.log {
  background: #0a0e14; border: 1px solid var(--line); border-radius: 8px;
  padding: 12px; font-size: 12px; line-height: 1.55; max-height: 320px; overflow: auto;
  color: #b7c4d1; margin: 0; white-space: pre-wrap; font-family: ui-monospace, "Cascadia Mono", monospace;
}

.legal { max-width: 78ch; line-height: 1.55; margin: 10px 0 0; }

.site-footer {
  max-width: 1180px; margin: 28px auto 0; padding: 18px 24px 40px;
  border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.6;
}
.site-footer strong { color: var(--fg, #e6edf3); }
.site-footer a { color: var(--accent); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer p { margin: 0 0 8px; }

.page { max-width: 860px; margin: 0 auto; padding: 32px 24px 60px; line-height: 1.65; }
.page h1 { font-size: 24px; margin: 0 0 6px; }
.page h2 { font-size: 15px; margin: 26px 0 8px; color: var(--accent); }
.page p, .page li { font-size: 13.5px; color: #c6d2dd; }
.page ul { padding-left: 20px; }
.page .back { display: inline-block; margin-bottom: 18px; font-size: 12px; color: var(--accent); }

@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr 1fr; }
  header { flex-direction: column; align-items: flex-start; }
  .parts .model { max-width: none; }
}
