/* WhipSize interface palette. Vehicle paint and comparison identities have their own colors. */
:root {
  color-scheme: light;
  --ws-navy: #10294a;
  --ws-blue: #0754cd;
  --ws-sky: #67d4ff;
  --ws-line: #d4e2ef;
  --ws-mist: #eff7ff;
  --ws-text: #425f7c;
  --ws-shadow: 0 12px 34px -22px #124c8d54, 0 2px 5px #13426c08;
  --ink: var(--ws-navy);
  --muted: #506984;
  --line: var(--ws-line);
  --soft: var(--ws-mist);
  --green: #d6efff;
  --accent: var(--ws-blue);
  color: var(--ink);
  background: #f5f9fe;
  accent-color: var(--ws-blue);
  -webkit-text-size-adjust: 100%;
}
body {
  color: var(--ink);
  background: radial-gradient(90% 525px at 100% 0, #dbedff 0, #e9f4ff55 50%, transparent 85%),
              linear-gradient(180deg, #f9fcff, #f4f9ff 54%, #f9fcff);
}
::selection { color: #0a3167; background: #b2e9ff; }
a, .inline-action, .button.text, .sources-link { color: #0755b6; }
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible,
summary:focus-visible, [tabindex="0"]:focus-visible { outline: 3px solid #168cf4; outline-offset: 3px; }
input, select, textarea { color: var(--ink); border-color: #bacfe1; border-radius: 9px; }
input:not([type=range]):not([type=color]):not([type=checkbox]):not(:disabled):hover, select:not(:disabled):hover, textarea:hover { border-color: #759fc9; }
input[type=range], .small-check input { accent-color: var(--ws-blue); }
::placeholder { color: #647c93; opacity: 1; }

/* Color stays concentrated in the masthead and primary actions. */
.app-header {
  position: relative;
  isolation: isolate;
  display: flex;
  height: 74px;
  padding: 0 max(calc((100% - 1530px)/2), clamp(18px, 3.9vw, 64px));
  gap: clamp(16px, 3vw, 52px);
  color: white;
  background: radial-gradient(ellipse at 2% 124%, #0073c7 0, transparent 30%),
              linear-gradient(101deg, #123c82 0, #123b77 37%, #123366 68%, #172f59);
  box-shadow: 0 3px 15px #0a326025;
}
.app-header::after {
  content: ""; position: absolute; inset: auto 0 0; height: 2px; pointer-events: none;
  background: linear-gradient(90deg, #54dbff, #359bff 28%, #608cff 60%, #7dccff);
}
.app-header .brand { flex: 0 0 auto; height: 52px; border-radius: 10px; }
.brand img { display: block; width: clamp(142px, 12.5vw, 176px); height: auto; }
.app-header nav { height: auto; display: flex; align-items: center; gap: clamp(3px, .5vw, 9px); }
.app-header nav a {
  position: relative; display: inline-flex; gap: 7px; align-items: center; justify-content: center;
  min-height: 37px; padding: 9px clamp(9px, .95vw, 16px); border: 1px solid transparent; border-radius: 11px;
  line-height: 1.15; font-weight: 600; color: #e0efff; font-size: .875rem; text-decoration: none;
}
.app-header nav a svg {
  display: block; width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.65;
  stroke-linecap: round; stroke-linejoin: round;
}
.app-header nav a > span { margin: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; }
.app-header .nav-short { display: none; }
.app-header nav a:hover { color: white; background: #ffffff12; }
.app-header nav a.active, .app-header nav a[aria-current="page"] {
  color: #093b82; background: linear-gradient(160deg, #fff, #e4f4ff);
  border-color: #c0eaff; box-shadow: 0 1px 4px #03255536, inset 0 1px white;
}
.header-tools { margin-left: auto; gap: 15px; flex: none; }
.header-help { color: #daeaff; font-size: .79rem; font-weight: 600; }
.header-help:hover, .header-help.active { color: white; }
#account-shortcut { background: #ffffff13; border-color: #ffffff66; border-radius: 99px; }
.app-header :focus-visible { outline-color: #93edff; }
.deal-sticker {
  position: relative; display: grid; align-content: center; gap: 2px; flex: none;
  min-height: 46px; padding: 5px 17px 6px 12px; border: 2px solid #fff9d9;
  border-radius: 9px 10px 13px 8px; white-space: nowrap; text-decoration: none;
  color: #172b43; background: linear-gradient(110deg, #fff4a8, #ffda62);
  transform: rotate(-2deg); box-shadow: 0 2px 0 #ad802f, 0 3px 7px #081b424d;
}
.deal-sticker::after {
  content: ""; position: absolute; bottom: 0; right: 0; width: 9px; height: 9px;
  border-radius: 2px 0 9px 0; background: linear-gradient(135deg, #c69b46 45%, #fff4c2 52%, #ffe297);
}
.deal-caption { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .77rem; font-weight: 650; line-height: 1.1; }
.deal-caption small { padding: 0 3px; border: 1px solid #9a813e; border-radius: 3px; font-size: .65rem; font-weight: 600; }
.deal-sticker strong { font-size: .94rem; font-weight: 750; line-height: 1.12; letter-spacing: -.02em; }
.deal-sticker:is(:hover,:focus-visible) { transform: rotate(0); color: #123665; background: #fff1a0; }
.deal-sticker:focus-visible { outline: 3px solid #93edff; outline-offset: 4px; }
#app { max-width: 1630px; padding: clamp(27px, 3.1vw, 47px) clamp(16px, 3.9vw, 64px) 50px; }
.intro h1, .library h1, .shop-header h1 {
  color: #102b50; font-size: clamp(2rem, 3.45vw, 3.35rem); font-weight: 720;
  line-height: 1.04; letter-spacing: -.055em; text-wrap: balance;
}
.intro p, .compare-intro p { color: var(--ws-text); line-height: 1.5; }
.intro { margin-bottom: clamp(20px, 2vw, 30px); }
.intro-actions { align-items: center; }
.button {
  min-height: 39px; background: #fff; color: #173f69; border: 1px solid #b8cddf; border-radius: 11px;
  font-weight: 650; box-shadow: 0 1px 2px #153d650b;
}
.button:hover { color: #103d76; background: #edf6ff; border-color: #87acd1; }
.button.primary, .button.lime {
  color: white; border-color: #1058c7;
  background: linear-gradient(160deg, #1477ed, #0759cb 72%, #074cb5);
  box-shadow: inset 0 1px 0 #ffffff38, 0 4px 10px -5px #074ba580;
}
.button.primary:hover, .button.lime:hover { color: white; border-color: #074fac; background: linear-gradient(160deg, #0b69db, #084ba8); }
.button.small { min-height: 32px; }
.button.text { min-height: 30px; border-radius: 5px; box-shadow: none; }
.button.text:hover { text-decoration: underline; background: transparent; }
.button.quiet { color: #294e72; border-color: #c7d8e7; }
.button.danger { color: #9e3841; }
.button:active:not(:disabled) { transform: translateY(1px); }
.icon-button { color: #617891; }
.icon-button:hover { background: #e6f1fc; color: #174c86; }

/* Comparison workspace */
.workspace, .info-panel, .lib-card, .lib-empty, .guide-card, .guide-filters, .shop-reference, .shop-controls, .shop-studio, .shop-empty {
  border: 1px solid var(--ws-line); border-radius: 19px; box-shadow: var(--ws-shadow);
}
.workspace { background: white; }
.workspace-top {
  min-height: 68px; padding: 14px clamp(15px, 2vw, 28px);
  background: linear-gradient(112deg, #fff 16%, #f0f8ff); border-bottom: 1px solid var(--ws-line);
}
.workspace-title h2, .plot-heading h3 { color: #163657; }
#compare-settings { display: none; }
.lineup-count { background: #dfedff; border-color: #c1dafa; color: #124da7; }
.collection-controls label, .control-label, .small-check { color: #365574; }
.collection-controls select { background-color: #fff; color: #24486d; border-color: #c3d6e7; }
.controls, .person-bar { border-color: var(--ws-line); background: #fff; }
.controls { padding-inline: clamp(15px, 2vw, 28px); }
.person-bar { background: #f5faff; padding-inline: clamp(15px, 2vw, 28px); color: #32506e; }
.segmented { background: #e9f1f9; border-radius: 10px; padding: 3px; gap: 1px; }
.segmented button { color: #44617d; border-radius: 7px; }
.segmented button.active { background: white; color: #144da0; box-shadow: 0 1px 4px #173d631e; }
.segmented.dark button.active { color: white; background: #1459bd; border-color: #1459bd; box-shadow: 0 1px 3px #17469233; }
.segmented button:hover:not(.active) { background: #d9e8f6; color: #234f7d; }
.chart-scroll { scrollbar-color: #95b9dd #edf5fe; background: white; }
.plot-grid { stroke: #dae7f2; }
.plot-ground { stroke: #7e9cbb; }
.plot-tick, .power-tick, .dimension-tag { fill: #4c6782; }
.vehicle-caption, .power-number, .power-delta { fill: #193c62; }
.estimate-key, .engine-choice, .power-specs .spec-row>span:first-child, .body-match { color: var(--ws-text); }
.horsepower { border-color: var(--ws-line); background: linear-gradient(#f6faff, #fff); }
.car-card { background: white; color: var(--ink); }
.car-card.baseline { background: #f5faff; }
.car-card h3 { color: #163657; }
.car-card .trim, .fine, .caption, .spec-row .spec-name { color: #506b83; }
.card-make { color: #436383; }
.power-specs, .spec-row, .card-driver, .chart-foot, .car-card, .card-actions { border-color: var(--ws-line); }
.tag { background: #e9f1f8; color: #315572; }
.tag.green { color: #114991; border-color: #c8dffa; background: #e1efff; }
.tag.dark { color: #fff; background: #24466b; }
.card-driver { background: #f3f8fd; }
.chart-foot { color: var(--ws-text); background: #f8fbfe; }
.add-card { color: #1256ab; background: #f4faff; border-color: #98bfdf; border-radius: 13px; }
.add-card:hover { color: #094fae; background: #e9f5ff; border-color: #5299d6; }
.plus-circle { color: #1159b3; background: #d6eeff; }
.profile-footer, .profile-footer a { color: #4c6881; }
.profile-footer i { background: #1684dc; }

/* An empty bay establishes the visual purpose before the first car is added. */
.empty-stage {
  position: relative; isolation: isolate; overflow: hidden; text-align: left; align-items: flex-start;
  display: flex; flex-direction: column; justify-content: center; min-height: clamp(255px, 26vw, 365px);
  padding: 42px clamp(24px, 4.4vw, 84px);
  background-color: #e9f5ff;
  background-image: linear-gradient(90deg, #f7fbff 0%, #f7fbffe0 26%, transparent 64%),
                    linear-gradient(#6faaca20 1px, transparent 1px), linear-gradient(90deg, #6faaca20 1px, transparent 1px),
                    linear-gradient(152deg, #f5fbff 16%, #e1f2fd 74%, #daebff);
  background-size: auto, 28px 28px, 28px 28px, auto;
}
.empty-stage::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none; inset: 0 1% 0 39%;
  background: url("./assets/empty-comparison.svg") center/contain no-repeat;
}
.empty-target { display: none; }
.empty-stage h2 { margin: 0 0 6px; color: #183d67; font-size: clamp(1.35rem, 2.2vw, 2.1rem); letter-spacing: -.045em; }
.empty-stage p { margin: 0 0 18px; color: #496683; }

/* Forms and source sheets */
dialog { border-color: #c9daea; border-radius: 20px; color: var(--ink); box-shadow: 0 24px 80px #092c5845; }
dialog::backdrop { background: #112c546e; backdrop-filter: blur(5px); }
.modal-header { background: linear-gradient(118deg, #fff, #f0f7ff); border-color: var(--ws-line); }
.modal-tabs, .modal-footer, .detail-dimensions, .search-result { border-color: var(--ws-line); }
.modal-tabs button { color: #47627d; }
.modal-tabs button.active { color: #104fa9; border-color: #1476de; }
.modal-footer { background: #f8fbff; }
.search-result:not(:disabled):hover { background: #f1f8ff; }
.search-result strong { color: #193c61; }
.search-result small, .result-count, .catalog-prompt { color: #506a84; }
.detail-dimensions, .notice.info, .code, .info-panel.feature { background: var(--ws-mist); color: #1e466c; }
.source-table th { background: #f1f7fd; color: #385774; }
.guide-art, .lib-art { background: radial-gradient(ellipse at 50% 100%, #d0e3f1, #eff8ff 64%, #f8fcff); }
.guide-rank, .quick-specification summary, .result-group summary { color: #1159a9; }
.guide-card { transition: border-color 120ms ease, box-shadow 120ms ease; }
.guide-card:focus-within, .guide-card:hover { border-color: #9dc6ec; box-shadow: 0 6px 20px #285b8819; }
.guide-art { border-bottom: 1px solid #e1edf7; }
.garage-account { color: var(--ink); background: #edf6ff; border: 1px solid #cedeef; border-radius: 15px; }
.garage-account p { color: var(--ws-text); }
#toast { color: white; background: #163962; border: 1px solid #628cb8; border-radius: 12px; }

/* Garage and dealership */
.room { border-color: #bcd3e8; border-radius: 20px; box-shadow: var(--ws-shadow); }
.room:not([data-room-light="night"]):not([data-room-light="studio"]) {
  --room-ink: #173758; --ceiling: #233d58; --ceiling-edge: #6e8ca6; --lamp: #f5fdff;
  --sky-top: #88bfe8; --sky-low: #eeffff; --window-frame: #566f87;
  --floor-far: #adc1ce; --floor-mid: #d4e3eb; --floor-near: #a4bdcf; --floor-shine: #effaff9e;
  --label-bg: #f6fcffed; --label-ink: #153552;
}
.room-header, .room-dealer .room-header {
  background: radial-gradient(ellipse at 0% -100%, #2974bf 0%, transparent 74%),
              linear-gradient(105deg, #163d70, #204e7d 66%, #2a6298);
}
.room-dealer .room-header { background: linear-gradient(105deg, #123568, #155c9f 78%, #2c78ab); }
.library .room-header h1 { color: white; }
.room-header p { color: #d7eeff; }
.room .room-header .lib-button { color: white; border-color: #a9ceef80; background: #092f6166; border-radius: 11px; }
.room .room-header .lib-button.primary { color: #073e86; border-color: #e1f6ff; background: linear-gradient(145deg, #fff, #c4eaff); }
.room-toolbar { color: #284b6b; background: #f4f9fe; border-color: #c1d6e7; }
.room-light-label, .room-light-label select, .room-window-nav a { color: #224768; }
.room-window-nav button { color: #315777; border-color: #bdd3e6; background: white; }
.room-window-nav a span { background: #dfedfa; color: #214a75; }
.room-vehicle-label { border-radius: 9px; }
.room-vacancy > div { color: #163951; background: #f1f9fff2; border-color: #abc2d6; }
.room-vacancy h2 { color: #163b60; }
.room-vacancy p { color: #465e74; }
.lib-default { border-color: #9dc6f0; }
.lib-specs, .lib-costs, .lib-grid .lib-build { background: #f3f8ff; }
.lib-specs, .lib-specs>div+div, .lib-costs, .lib-costs>div+div { border-color: #d8e5f1; }
.lib-identity h2, .lib-identity h3, .lib-section-title, .lib-facts strong, .lib-specs dd { color: #153657; }
.lib-build, .lib-facts p { color: var(--ws-text); }
.library .lib-compare { color: #114e9f; border-color: #b8d5ee; background: #ebf5ff; }
.library .lib-compare:hover { color: #083b80; background: #dbeeff; }
.library .lib-star[aria-pressed="true"] { background: #e2f2ff; color: #1555a8; border-color: #b4d7f3; }
.lib-empty-icon { color: #236dc0; background: #e1f1ff; }

/* Paint studio */
.shop { --studio-line: #d4e2ef; --studio-ink: #143354; --studio-muted: #4a6681; }
.shop-studio { background: #edf6fe; }
.shop-groupline, .shop-selector>span { color: #396485; }
.shop-view { background: #e0edf8; }
.shop-view button[aria-pressed="true"] { color: white; background: #155bc1; }
.shop-stage[data-stage-light="daylight"] { background: radial-gradient(ellipse at 55% 99%, #c4d9e7 0%, #e7f2fb 44%, #f4faff 80%); }
.shop-measures, .shop-coverage { background: #f7fbff; border-color: var(--ws-line); }
.shop-measures dd { color: var(--ink); }
.shop-match-wheel, .shop-patterns button { color: #2d5277; background: #f1f7fc; border-color: #c8dae9; }
.shop-patterns button[aria-pressed="true"] { background: #e2f1ff; border-color: #548fc9; box-shadow: inset 0 0 0 .5px #548fc9; color: #114984; }
.shop-controls section, .shop-controls .shop-save { border-color: var(--ws-line); }
.shop-slider input[type=range] { accent-color: var(--ws-blue); }
.shop-empty { background: linear-gradient(115deg, #eaf5ff, #f9fcff 82%); }
.shop-drop { color: #294f72; background: #f7fbff; border-color: #9bb8d1; }
.shop-colors button[aria-pressed="true"] { outline-color: #1255a0; }
.shop-color-custom, .shop-number, .shop-file-button, .shop-mini { color: #255476; background: #f7fbff; border-color: #bdd3e6; }

@media (max-width: 1280px) {
  .app-header { padding-inline: 19px; gap: 15px; }
  .app-header nav { gap: 2px; }
  .app-header nav a { font-size: .82rem; padding-inline: 8px; gap: 5px; }
  .brand img { width: 143px; }
  .header-tools { gap: 9px; }
}
@media (max-width: 1080px) {
  .app-header { display: grid; height: auto; grid-template-columns: auto 1fr auto; grid-template-rows: 52px auto; gap: 0 12px; padding: 3px 16px 8px; }
  .app-header .brand { grid-area: 1 / 1; justify-self: start; height: 46px; }
  .brand img { width: 135px; }
  .header-tools { grid-area: 1 / 2; }
  .deal-sticker { grid-area: 1 / 3; }
  .app-header nav { grid-area: 2 / 1 / 3 / -1; height: auto; min-width: 0; max-width: 100%; overflow-x: auto; gap: 3px; padding: 2px 0; margin: 0; scrollbar-width: thin; scrollbar-color: #80b1e1 transparent; }
  .app-header nav a { min-height: 32px; padding: 7px 10px; flex-shrink: 0; }
  .header-help { font-size: .76rem; }
}
@media (max-width: 650px) {
  #app { padding: 25px 13px 32px; }
  .app-header nav { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); overflow: visible; }
  .app-header nav a {
    display: flex; flex-direction: column; gap: 3px; min-width: 0; min-height: 43px;
    padding: 4px 0; font-size: .72rem;
  }
  .app-header nav a svg { display: block; width: 15px; height: 15px; }
  .app-header .nav-full { display: none; }
  .app-header .nav-short { display: inline; }
  .intro { align-items: flex-start; flex-wrap: wrap; gap: 14px; }
  .intro h1, .library h1, .shop-header h1 { font-size: 2rem; }
  .intro-actions .button { min-height: 36px; }
  .workspace, .room, .guide-filters { border-radius: 15px; }
  .workspace-top { padding: 13px; }
  .compare-intro:has(.intro-actions) { gap: 10px; margin-bottom: 15px; }
  .compare-intro:has(.intro-actions) p { display: none; }
  .has-lineup .workspace-top {
    display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center;
    min-height: 0; padding: 9px 12px; gap: 6px 8px;
  }
  #compare-settings {
    display: inline-flex; align-items: center; gap: 5px; min-height: 34px; padding: 5px 9px;
    border: 1px solid #b9d2e8; border-radius: 9px; background: white; color: #21517f;
    font-size: .78rem; font-weight: 650;
  }
  #compare-settings svg { width: 16px; height: 16px; }
  #compare-settings[aria-expanded="true"] { color: #10488d; background: #e1f1ff; border-color: #74aadd; }
  .has-lineup .collection-controls { grid-column: 1 / -1; }
  .has-lineup:not(.settings-open) .collection-controls,
  .has-lineup:not(.settings-open) :is(#lineup-align,#lineup-scale,#lineup-units,#lineup-measurements,.controls>.spacer) { display: none; }
  .has-lineup:not(.settings-open) .collection-controls:has([data-action="own"]) { display: flex; }
  .has-lineup:not(.settings-open) .collection-controls label { display: none; }
  .has-lineup .controls {
    display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); align-items: center;
    padding: 8px 10px; gap: 7px;
  }
  .has-lineup .controls>.spacer { display: none; }
  .has-lineup .controls .segmented { width: 100%; min-width: 0; }
  .has-lineup .controls .segmented button {
    flex: 1; min-width: 0; min-height: 32px; padding: 4px; font-size: .77rem; white-space: nowrap;
  }
  .has-lineup .controls .control-label { display: flex; gap: 5px; }
  .has-lineup .controls .control-label select, .has-lineup .controls .control-label input { width: 100%; min-width: 0; }
  .has-lineup #lineup-units { width: auto; justify-self: start; }
  .has-lineup #lineup-units button { min-width: 36px; }
  .empty-stage { align-items: center; text-align: center; min-height: 295px; padding: 135px 16px 30px; }
  .empty-stage::before { inset: 8px 9% auto; height: 132px; }
  .empty-stage p { margin-bottom: 13px; }
  .profile-footer { font-size: .7rem; }
}
@media (max-width: 520px) {
  .app-header { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: 37px auto auto; padding-top: 6px; }
  .app-header .brand { height: 37px; }
  .app-header .header-tools { grid-area: 2 / 1; justify-self: start; margin: 0 0 4px; min-height: 21px; }
  .app-header .header-help { margin: 0; }
  .app-header .deal-sticker { grid-area: 1 / 2 / 3 / 3; justify-self: end; }
  .app-header nav { grid-row: 3; }
}
@media (max-width: 365px) {
  .app-header { padding-inline: 10px; }
  .app-header nav a { padding-inline: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .guide-card { transition: none; }
  .button:active:not(:disabled) { transform: none; }
}
