:root {
  color-scheme: light;
  --page: #f3f5ef;
  --surface: #fff;
  --ink: #1b2c23;
  --muted: #52645a;
  --line: #e0e6dd;
  --dark: #1e3328;
  --lime: #d5f47d;
  --green: #345d43;
  --tint: #edf3e7;
  --blue: #e8f1f6;
  --amber: #f8efda;
  --radius: 20px;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink); }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button, summary, input, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #537846; outline-offset: 3px; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.wrap { width: min(1180px, calc(100% - 72px)); margin-inline: auto; }
.site-header { background: #fafbf7; border-bottom: 1px solid var(--line); }
.header-inner { min-height: 69px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; gap: 10px; align-items: center; font-weight: 800; font-size: 21px; letter-spacing: -.055em; }
.brand-auto { color: var(--green); margin-left: 2px; }
.private-badge { display: inline-flex; gap: 6px; align-items: center; color: #375343; padding: 6px 11px; border: 1px solid #dce6d7; border-radius: 100px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.private-badge svg { width: 13px; height: 13px; }

.hero { margin: 29px 0 24px; background: var(--dark); color: #f8fbf3; border-radius: 25px; padding: 35px 37px; display: flex; align-items: center; justify-content: space-between; gap: 30px; position: relative; overflow: hidden; isolation: isolate; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(ellipse at 95% 130%, #42684b 0, transparent 61%), repeating-linear-gradient(125deg, transparent 0 29px, #d5f47d10 29px 30px); mask-image: linear-gradient(90deg, transparent, #000 45%); }
.eyebrow { margin: 0; font-size: 11px; letter-spacing: .13em; font-weight: 750; }
.hero-copy .eyebrow { display: flex; align-items: center; gap: 8px; color: var(--lime); }
.hero-copy .eyebrow span, .live-badge span { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }
h1 { margin: 11px 0 8px; font-size: clamp(35px, 5vw, 59px); line-height: 1.02; letter-spacing: -.055em; text-wrap: balance; }
.hero-copy > p:last-child { color: #dce7da; margin: 0; font-size: 15px; line-height: 1.55; }
.budget-card { flex: 0 0 244px; display: grid; gap: 5px; min-width: 0; border: 1px solid #a2bc9890; background: #233c2e; border-radius: 15px; padding: 15px 18px; }
.budget-card .eyebrow { color: #d9e8d5; }
.budget-card strong { font-size: 24px; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.budget-card strong span { color: var(--lime); }
.budget-note { color: #cbdac9; font-size: 12px; }
.budget-editor { min-width: 0; }
.budget-editor summary { color: var(--lime); cursor: pointer; font-size: 12px; font-weight: 700; padding: 3px 0; }
.budget-editor :focus-visible { outline-color: var(--lime); }
.budget-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 6px 0 8px; }
.budget-fields label { display: grid; gap: 4px; font-size: 12px; font-weight: 650; }
.budget-fields input { width: 100%; min-width: 0; border: 1px solid #d4dfd2; border-radius: 7px; background: #fafbf8; color: var(--ink); font-size: 16px; padding: 5px 7px; }
#budget-error { margin: 0 0 8px; color: #ffdacb; font-size: 12px; }
#budget-form button { min-height: 34px; }

.workspace { display: grid; grid-template-columns: minmax(0, 1.22fr) minmax(0, 1fr); grid-template-areas: "vehicles ranking" "priorities ranking"; grid-template-rows: auto 1fr; gap: 20px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; min-width: 0; box-shadow: 0 3px 6px #20332905; }
.vehicles { grid-area: vehicles; }
.priorities { grid-area: priorities; }
.ranking { grid-area: ranking; }
.panel-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.section-index { color: var(--green); }
h2 { font-size: 25px; line-height: 1.15; letter-spacing: -.04em; margin: 5px 0 0; }
.count { display: inline-flex; background: var(--tint); color: var(--green); min-width: 24px; height: 24px; align-items: center; justify-content: center; padding-inline: 5px; vertical-align: 2px; margin-left: 3px; border-radius: 99px; font-size: 12px; letter-spacing: 0; }
.panel-intro, .weight-note { color: var(--muted); margin: 11px 0 15px; font-size: 13px; line-height: 1.5; }
.primary, .text-button, .remove { font-size: 13px; font-weight: 700; border-radius: 9px; line-height: 1.2; }
.primary { background: var(--lime); color: var(--ink); border: 1px solid #c9e873; padding: 9px 11px; display: inline-flex; align-items: center; gap: 5px; flex: none; white-space: nowrap; min-height: 40px; }
.primary:hover { background: #c6ec64; }
.primary svg { width: 15px; height: 15px; }
.add-long { margin-left: -2px; }
.text-button { background: #f4f6f1; border: 1px solid var(--line); color: var(--green); padding: 8px 10px; min-height: 35px; }
.text-button:hover { background: var(--tint); }
.vehicle-list { display: grid; gap: 10px; }
.vehicle { border: 1px solid var(--line); border-radius: 13px; background: #fafbf8; overflow: clip; }
.vehicle-summary { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 10px; list-style: none; cursor: pointer; padding: 11px; }
.vehicle-summary::-webkit-details-marker { display: none; }
.vehicle-summary:focus-visible { outline-offset: -4px; border-radius: 12px; }
.vehicle-summary:hover { background: #f1f6ed; }
.vehicle-symbol { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 9px; background: #e8f0e2; color: var(--green); }
.vehicle-symbol svg { width: 20px; height: 20px; }
.vehicle:nth-child(even) .vehicle-symbol { background: var(--blue); color: #365965; }
.vehicle-name { display: block; font-size: 14px; font-weight: 760; overflow-wrap: anywhere; }
.vehicle-meta { display: block; margin-top: 2px; font-size: 12px; line-height: 1.5; color: var(--muted); }
.edit { display: flex; align-items: center; gap: 5px; color: var(--green); font-size: 12px; font-weight: 700; }
.edit svg { width: 14px; height: 14px; }
.vehicle[open] .edit svg { transform: rotate(180deg); }
.vehicle-editor { border-top: 1px solid var(--line); padding: 13px; background: #fff; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset + fieldset { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 6px; }
legend { padding: 0; font-size: 12px; font-weight: 750; }
fieldset p { margin: 4px 0 8px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.field { min-width: 0; display: grid; gap: 4px; color: var(--ink); font-size: 12px; font-weight: 650; }
.field.wide { grid-column: 1 / -1; }
.field input, .field textarea { background: #fafbf8; border: 1px solid #d4dfd2; border-radius: 7px; color: var(--ink); padding: 8px 9px; width: 100%; min-height: 39px; font-size: 14px; font-weight: 450; }
.field textarea { resize: vertical; }
.field input:invalid { border-color: #a64136; }
.field input::placeholder { color: #65766b; }
.editor-actions { display: flex; justify-content: flex-end; margin-top: 10px; }
.remove { background: #fff; border: 1px solid #edd9d3; color: #8d4035; padding: 7px 9px; }
.remove:hover { background: #fff2ed; }
.save-info { color: var(--muted); display: flex; align-items: center; gap: 6px; font-size: 12px; margin-top: 13px; }
.save-info svg { width: 14px; height: 14px; }

.weight-controls { display: grid; gap: 7px; }
.weight-row { display: grid; grid-template-columns: 98px minmax(0, 1fr) 32px; align-items: center; gap: 8px; min-height: 30px; }
.weight-row label { font-size: 13px; font-weight: 700; }
.weight-row input { width: 100%; min-width: 0; height: 26px; margin: 0; accent-color: var(--green); cursor: pointer; }
.weight-row output { text-align: right; color: var(--green); font-size: 13px; font-weight: 750; font-variant-numeric: tabular-nums; }
.weight-note { font-size: 12px; margin: 10px 0 0; }

.live-badge { display: inline-flex; gap: 6px; align-items: center; border-radius: 100px; color: #335740; background: var(--tint); font-size: 11px; font-weight: 750; padding: 6px 9px; white-space: nowrap; }
.live-badge span { width: 6px; height: 6px; }
.ranking-results { display: grid; gap: 10px; }
.result { border: 1px solid var(--line); border-radius: 12px; padding: 11px; min-width: 0; }
.result.winner { background: #f4f8ec; border-color: #dbe7cc; }
.result-top { display: flex; align-items: center; gap: 8px; }
.rank-number { width: 29px; height: 29px; display: grid; place-items: center; flex: none; border-radius: 8px; background: #eef1ec; color: var(--green); font-size: 12px; font-weight: 800; }
.winner .rank-number { background: var(--lime); color: var(--ink); }
.result-name { font-size: 14px; font-weight: 760; overflow-wrap: anywhere; }
.result-score { margin-left: auto; padding-left: 4px; display: flex; align-items: baseline; gap: 3px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.result-score strong { font-size: 21px; letter-spacing: -.04em; }
.result-score small { color: var(--muted); font-size: 10px; }
meter { display: block; width: 100%; height: 12px; margin-top: 4px; accent-color: var(--green); }
meter::-webkit-meter-bar { height: 6px; border: 0; background: #e1e9de; }
meter::-webkit-meter-optimum-value { background: #52815d; }
meter::-moz-meter-bar { background: #52815d; }
.breakdown summary, .method summary { cursor: pointer; color: var(--green); font-weight: 730; font-size: 12px; padding: 6px 0 1px; }
.breakdown table { width: 100%; font-size: 11px; border-collapse: collapse; margin-top: 8px; font-variant-numeric: tabular-nums; }
.breakdown th, .breakdown td { padding: 4px 2px; text-align: right; border-top: 1px solid var(--line); white-space: nowrap; }
.breakdown th:first-child { text-align: left; }
.breakdown thead th { color: var(--muted); font-weight: 650; }
.method { border-top: 1px solid var(--line); margin-top: 13px; padding-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.method p { margin: 7px 0 0; }
.method ul { margin: 7px 0 0; padding-left: 17px; }
.method li + li { margin-top: 4px; }
.insight, .empty, .unranked { margin: 0; border-radius: 9px; padding: 8px 10px; color: var(--muted); background: var(--tint); font-size: 12px; line-height: 1.5; }
.insight strong, .unranked strong { color: var(--ink); }
.unranked { background: var(--amber); overflow-wrap: anywhere; }
.unranked ul { margin: 4px 0 0; padding-left: 16px; }
.page-footer { display: flex; justify-content: center; gap: 8px; padding: 19px 0 22px; font-size: 11px; color: var(--muted); }

@media (max-width: 850px) {
  .wrap { width: calc(100% - 36px); }
  .workspace { gap: 12px; }
  .panel { padding: 15px; }
  .hero { padding: 26px; }
  .add-long { display: none; }
}
@media (max-width: 660px) {
  .wrap { width: calc(100% - 24px); }
  .header-inner { min-height: 57px; }
  .hero { margin: 15px 0 12px; border-radius: 17px; padding: 21px 17px; display: grid; gap: 16px; }
  .hero-copy > p:last-child { font-size: 13px; }
  .budget-card { justify-self: start; padding: 8px 11px; max-width: 100%; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 9px; }
  .budget-editor { grid-column: 1 / -1; }
  .budget-card strong { font-size: 16px; }
  .budget-card .eyebrow { font-size: 9px; }
  .budget-note { display: none; }
  .workspace { grid-template-columns: minmax(0, 1fr); grid-template-areas: "vehicles" "priorities" "ranking"; grid-template-rows: auto; }
  .panel { border-radius: 15px; }
  .field input, .field textarea { font-size: 16px; }
}
@media (max-width: 350px) {
  .vehicle-summary { grid-template-columns: minmax(0, 1fr) auto; }
  .vehicle-symbol { display: none; }
}
