/* Buyer tools (update 14): vehicle health report, Deal-o-Meter history, running costs, watch price, part-exchange estimate
   (vehicle page), save search + commercial / plant filters (search), alerts (buyer account), work fields (sell).
   Palette as the vehicle page: teal #067b9d / #045f77, ink #102b42, muted #5f7183, rules var(--motorit-tint-line-2, #d7e4ee), soft #f2f8fd. */

/* ---- Shared ---------------------------------------------------------------------------------------------------- */
.motorit-vehicle-v3 .motorit-vehicle__insights { display: grid; gap: var(--mv-gap); margin-top: var(--mv-gap); }
.motorit-vehicle-v3 .motorit-vehicle__insights-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--mv-gap); align-items: stretch; }
.motorit-insight h3 { margin: 0 0 8px; color: var(--mv-ink, #102b42); font-size: 16px; font-weight: 850; line-height: 1.3; }
.motorit-insight .motorit-insight__note { margin: 16px 0 0; color: #52636b; font-size: 13px; line-height: 1.55; }
.motorit-insight .motorit-insight__note a { color: #045f77; font-weight: 750; text-decoration: underline; text-underline-offset: 2px; }
.motorit-insight__stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 16px 0 0; }
.motorit-insight__stats--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } /* no valuation: no "Against the guide" (m30) */
.motorit-insight__stats > div { min-width: 0; padding: 12px 13px; border: 1px solid #dfe8f1; border-radius: 12px; background: #f7fbfe; }
.motorit-insight__stats dt { color: #52636b; font-size: 12px; font-weight: 700; line-height: 1.3; }
.motorit-insight__stats dd { margin: 5px 0 0; color: #102b42; font-size: 15px; font-weight: 850; line-height: 1.3; overflow-wrap: anywhere; }
.motorit-insight__stats dd.is-down { color: #126238; }
.motorit-insight__stats dd.is-up { color: #8a4500; }

/* ---- Health report --------------------------------------------------------------------------------------------- */
.motorit-health__head { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.motorit-health__intro p { margin: 8px 0 0; max-width: 62ch; color: #3d5361; font-size: 15px; line-height: 1.55; }
.motorit-health__score { position: relative; flex: 0 0 auto; display: grid; place-items: center; width: 112px; height: 112px; text-align: center; }
.motorit-health__score svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.motorit-health__score circle { fill: none; stroke-width: 7; }
.motorit-health__score .track { stroke: #e4eff7; }
.motorit-health__score .value { stroke: #067b9d; stroke-linecap: round; }
.motorit-health__score.is-good .value { stroke: #1f8a50; }
.motorit-health__score.is-fair .value { stroke: #c96a00; }
.motorit-health__score.is-poor .value { stroke: #b02020; }
.motorit-health__score strong { position: relative; display: block; margin-top: 14px; color: #102b42; font-size: 32px; font-weight: 900; line-height: 1; }
.motorit-health__score span { position: relative; display: block; margin-top: -26px; color: #3d5361; font-size: 11px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; }
.motorit-health__facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 18px 0 0; }
.motorit-health__facts > div { position: relative; min-width: 0; padding: 13px 14px 13px 16px; border: 1px solid #dfe8f1; border-radius: 12px; background: #fff; overflow: hidden; }
.motorit-health__facts > div::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: #c9d9df; }
.motorit-health__facts > div.is-good::before { background: #1f8a50; }
.motorit-health__facts > div.is-warn::before { background: #c96a00; }
.motorit-health__facts > div.is-bad::before { background: #b02020; }
.motorit-health__facts dt { color: #52636b; font-size: 12px; font-weight: 750; }
.motorit-health__facts dd { margin: 4px 0 0; color: #102b42; font-size: 15px; font-weight: 850; line-height: 1.35; overflow-wrap: anywhere; }
.motorit-health__facts small { display: block; margin-top: 4px; color: #52636b; font-size: 12px; font-weight: 500; line-height: 1.45; }
.motorit-health__why, .motorit-health__notes { margin-top: 18px; padding-top: 16px; border-top: 1px solid #e3eef7; }
.motorit-health__why > p { margin: 0 0 10px; color: #52636b; font-size: 13px; line-height: 1.5; }
.motorit-health__why ul, .motorit-health__notes ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.motorit-health__why li { display: flex; align-items: flex-start; gap: 10px; color: #3d5361; font-size: 14px; line-height: 1.5; }
.motorit-health__why li { margin: 0; padding: 0; text-indent: 0; }
.motorit-health__why li > span:not(.motorit-health__impact) { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.motorit-health__why li strong { color: #102b42; }
/* Update 40: one fixed-width pill for every row (was min-width 38px + padding, so "−30" came out 40px and "−5" 38px and the
   text column started at a different x on each row). Flex-centred, no wrapping, tabular figures, never shrinks; the text
   beside it may wrap but never pushes the pill. */
.motorit-health__impact { flex: 0 0 46px; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; width: 46px; min-width: 46px; height: 24px; margin: 0; padding: 0 4px; border-radius: 999px; background: #e8f6ef; color: #126238; font-size: 12.5px; font-weight: 900; line-height: 1; letter-spacing: 0; white-space: nowrap; font-variant-numeric: tabular-nums; text-indent: 0; position: static; transform: none; }
.motorit-health__why li.is-warn .motorit-health__impact { background: #fff4e5; color: #8a4500; }
.motorit-health__why li.is-bad .motorit-health__impact { background: #fdecec; color: #9b1c1c; }
.motorit-health__why li.is-neutral .motorit-health__impact { background: #ecf4fa; color: #3d5361; }
.motorit-health__notes li { position: relative; padding-left: 16px; color: #3d5361; font-size: 14px; line-height: 1.5; }
.motorit-health__notes li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: #c96a00; }

/* ---- Price history --------------------------------------------------------------------------------------------- */
.motorit-pricehist__chart { margin: 18px 0 0; }
.motorit-pricehist__plot { position: relative; height: 190px; margin-left: 50px; }
.motorit-pricehist__plot svg { display: block; width: 100%; height: 100%; overflow: visible; }
.motorit-pricehist__plot .grid { stroke: #e3eef7; stroke-width: 1; vector-effect: non-scaling-stroke; }
.motorit-pricehist__plot .band { fill: rgba(31, 138, 80, .10); }
.motorit-pricehist__plot .guide { stroke: #1f8a50; stroke-width: 1.5; stroke-dasharray: 5 5; vector-effect: non-scaling-stroke; }
.motorit-pricehist__plot .line { fill: none; stroke: #067b9d; stroke-width: 3; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.motorit-pricehist__ylabel { position: absolute; left: -50px; width: 44px; transform: translateY(-50%); color: #52636b; font-size: 11px; line-height: 1; text-align: right; }
.motorit-pricehist__dot { position: absolute; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; border: 2.5px solid #067b9d; border-radius: 50%; background: #fff; }
.motorit-pricehist__tag { position: absolute; transform: translate(-50%, calc(-100% - 10px)); padding: 2px 7px; border-radius: 6px; background: #fff; box-shadow: 0 2px 8px rgba(16, 43, 66, .12); color: #102b42; font-size: 11.5px; font-weight: 850; white-space: nowrap; pointer-events: none; }
.motorit-pricehist__tag.is-right { transform: translate(-100%, calc(-100% - 10px)); }
.motorit-pricehist__tag.is-last { background: #067b9d; color: #fff; }
.motorit-pricehist__x { display: flex; justify-content: space-between; margin: 6px 0 0 50px; color: #52636b; font-size: 12px; }
.motorit-pricehist__legend { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; color: #3d5361; font-size: 13px; line-height: 1.4; }
.motorit-pricehist__legend .key-band { flex: 0 0 auto; width: 18px; height: 10px; border-radius: 3px; background: rgba(31, 138, 80, .18); border-top: 1.5px dashed #1f8a50; }
.motorit-pricehist__empty { margin: 18px 0 0; padding: 18px; border: 1px dashed #c9dde4; border-radius: 14px; background: linear-gradient(180deg, #f7fbfe, #fff); }
.motorit-pricehist__empty svg { display: block; width: 100%; max-width: 280px; height: 52px; margin: 0 0 8px; }
.motorit-pricehist__empty .track { stroke: #dfe8f1; stroke-width: 3; stroke-dasharray: 4 6; fill: none; }
.motorit-pricehist__empty .line { stroke: #067b9d; stroke-width: 3; fill: none; }
.motorit-pricehist__empty circle { fill: #fff; stroke: #067b9d; stroke-width: 3; }
.motorit-pricehist__empty p { margin: 0; color: #3d5361; font-size: 14px; line-height: 1.55; }
.motorit-pricehist__empty p strong { display: block; margin-bottom: 4px; color: #102b42; font-size: 16px; }

/* ---- Running costs --------------------------------------------------------------------------------------------- */
.motorit-costs__total { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin: 14px 0 0; padding: 16px 18px; border-radius: 14px; background: linear-gradient(135deg, #067b9d, #045f77); color: #fff; }
.motorit-costs__total strong { font-size: 34px; font-weight: 900; line-height: 1; letter-spacing: -.01em; }
.motorit-costs__total span { font-size: 14px; font-weight: 700; opacity: .95; }
.motorit-costs__rows { display: grid; gap: 0; margin: 12px 0 0; }
.motorit-costs__rows > div { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-bottom: 1px solid #e3eef7; }
.motorit-costs__rows > div:last-child { border-bottom: 0; }
.motorit-costs__rows dt { color: #52636b; font-size: 13px; font-weight: 800; }
.motorit-costs__rows dd { margin: 0; min-width: 0; }
.motorit-costs__rows dd strong { display: block; color: #102b42; font-size: 15.5px; font-weight: 850; }
.motorit-costs__rows dd small { display: block; margin-top: 3px; color: #52636b; font-size: 12.5px; line-height: 1.45; }
.motorit-costs__controls { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 14px; margin-top: 8px; padding: 14px; border: 1px solid #dfe8f1; border-radius: 12px; background: #f7fbfe; }
.motorit-costs__control label { display: block; margin-bottom: 6px; color: #3d5361; font-size: 12px; font-weight: 850; letter-spacing: .02em; }
.motorit-costs__range { display: flex; align-items: center; gap: 10px; }
.motorit-costs__range input { flex: 1 1 auto; min-width: 0; accent-color: #067b9d; height: 24px; }
.motorit-costs__range output { min-width: 56px; color: #102b42; font-size: 14px; font-weight: 850; text-align: right; }
.motorit-costs__control--price input { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid #c9d9df; border-radius: 10px; background: #fff; color: #102b42; font: inherit; font-size: 14px; font-weight: 750; }
.motorit-costs__control--price input:focus, .motorit-costs__range input:focus-visible { outline: 3px solid rgba(6, 123, 157, .35); outline-offset: 2px; }
.motorit-costs__plant { margin: 12px 0 0; color: #3d5361; font-size: 15px; line-height: 1.55; }

/* ---- Watch price + part-exchange (dark teal price card) ---------------------------------------------------------- */
.motorit-vehicle-v3 .motorit-watch-form { margin: 0; }
.motorit-vehicle-v3 .motorit-watch-form .motorit-watch { width: 100%; }
.motorit-vehicle-v3 .motorit-watch span[aria-hidden] { margin-right: 6px; font-size: 1.05em; }
.motorit-vehicle-v3 .motorit-vehicle-price-card .motorit-watch.is-on, .motorit-vehicle-v3 .motorit-vehicle-price-card .motorit-watch.is-on:hover { border-color: #fff; background: #fff; color: var(--mv-brand-dark); }
.motorit-watch__flash { grid-column: 1 / -1; margin: 2px 0 0; color: #fff; font-size: 13px; font-weight: 700; line-height: 1.45; }
.motorit-vehicle-v3 .motorit-px { grid-column: 1 / -1; margin-top: 14px; border: 1px solid rgba(255, 255, 255, .4); border-radius: 12px; background: rgba(0, 43, 61, .16); color: #fff; }
.motorit-px summary { display: grid; gap: 2px; padding: 12px 40px 12px 14px; cursor: pointer; list-style: none; position: relative; }
.motorit-px summary::-webkit-details-marker { display: none; }
.motorit-px summary::after { content: "+"; position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 22px; font-weight: 700; line-height: 1; }
.motorit-px[open] summary::after { content: "−"; }
.motorit-px summary:focus-visible { outline: 3px solid #fff; outline-offset: 2px; border-radius: 12px; }
.motorit-px__title { font-size: 15px; font-weight: 850; }
.motorit-px__sub { font-size: 13px; font-weight: 600; opacity: .95; }
.motorit-px__form { display: grid; gap: 10px; padding: 0 14px 14px; }
.motorit-px__fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.motorit-px__fields label { display: block; margin-bottom: 4px; font-size: 12px; font-weight: 800; }
.motorit-px__fields input { width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid #fff; border-radius: 9px; background: #fff; color: #102b42; font: inherit; font-size: 15px; font-weight: 800; }
.motorit-px__fields input[name="vrm"] { background: #ffd500; border-color: #ffd500; text-transform: uppercase; letter-spacing: .04em; }
.motorit-px__fields input:focus { outline: 3px solid rgba(255, 255, 255, .7); outline-offset: 1px; }
.motorit-px__result:empty { display: none; }
.motorit-px__result { padding: 12px; border-radius: 10px; background: #fff; color: #102b42; font-size: 14px; line-height: 1.5; }
.motorit-px__result strong { display: block; font-size: 20px; font-weight: 900; color: #045f77; }
.motorit-px__result .is-net { display: block; margin-top: 4px; font-weight: 800; }
.motorit-px__result.is-error { background: #fff4e5; color: #4a2e0a; }
.motorit-px__note { margin: 0; font-size: 12px; line-height: 1.45; opacity: .95; }

/* ---- Search: save search, commercial filters, category landing ------------------------------------------------- */
.motorit-save-search { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0; }
.motorit-save-search__btn { display: inline-flex; align-items: center; gap: 7px; min-height: 42px; padding: 0 16px; border: 1px solid rgba(6, 123, 157, .4); border-radius: 12px; background: #fff; color: #045f77; font: inherit; font-size: 14px; font-weight: 850; text-decoration: none; cursor: pointer; }
.motorit-save-search__btn:hover { border-color: #067b9d; background: #f0f7fd; }
.motorit-save-search__btn.is-on { border-color: #067b9d; background: #067b9d; color: #fff; }
.motorit-save-search__flash { flex-basis: 100%; margin: 0; color: #126238; font-size: 13px; font-weight: 750; }
.motorit-work-filters { display: grid; gap: 12px; padding: 14px; border: 1px solid #d7e4ee; border-radius: 16px; background: #f7fbfe; }
.motorit-work-filters__title { margin: 0; color: #045f77; font-size: 11px; font-weight: 950; letter-spacing: .08em; text-transform: uppercase; }
.motorit-work-landing { display: grid; gap: 12px; margin: 0 0 18px; padding: 20px 22px; border: 1px solid #d7e4ee; border-radius: 20px; background: linear-gradient(135deg, #f5f9fe 0%, #fff 70%); box-shadow: 0 12px 34px rgba(16, 43, 66, .06); }
.motorit-work-landing h2 { margin: 0; color: #102b42; font-size: 24px; font-weight: 900; line-height: 1.2; }
.motorit-work-landing p { margin: 0; color: #3d5361; font-size: 15px; line-height: 1.55; }
.motorit-work-landing__chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 0; padding: 0; list-style: none; }
.motorit-work-landing__chips a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border: 1px solid #c9dde4; border-radius: 999px; background: #fff; color: #045f77; font-size: 13.5px; font-weight: 800; text-decoration: none; }
.motorit-work-landing__chips a:hover, .motorit-work-landing__chips a[aria-current="true"] { border-color: #067b9d; background: #067b9d; color: #fff; }

/* ---- Buyer account: alerts ------------------------------------------------------------------------------------- */
.motorit-alerts .motorit-alerts__flash { margin: 0 0 14px; padding: 12px 14px; border-left: 4px solid #067b9d; border-radius: 10px; background: #f3f9fd; color: #173b47; font-size: 14px; font-weight: 700; }
.motorit-alerts .motorit-alerts__flash.is-warn { border-color: #c96a00; background: #fff8ee; color: #4a2e0a; }
.motorit-alerts__prefs { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: 16px 0 0; padding: 14px 16px; border: 1px solid rgb(219, 231, 239); border-radius: 16px; background: #f8fbfd; }
.motorit-alerts__prefs label { display: inline-flex; align-items: center; gap: 8px; color: rgb(15, 23, 42); font-size: 14px; font-weight: 750; }
.motorit-alerts__prefs input[type="checkbox"] { width: 18px; height: 18px; accent-color: rgb(6, 123, 157); }
.motorit-alerts__prefs small { flex-basis: 100%; color: rgb(71, 85, 105); font-size: 12.5px; line-height: 1.5; }
.motorit-alerts__save { min-height: 40px; padding: 0 16px; border: 1px solid rgb(6, 123, 157); border-radius: 12px; background: rgb(6, 123, 157); color: #fff; font: inherit; font-size: 14px; font-weight: 850; cursor: pointer; }
.motorit-alerts h3 { margin: 22px 0 10px; color: rgb(15, 23, 42); font-size: 18px; font-weight: 900; }
.motorit-alerts__list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.motorit-alerts__item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border: 1px solid rgb(219, 231, 239); border-radius: 16px; background: #fff; }
.motorit-alerts__item > div { min-width: 0; }
.motorit-alerts__item a { color: rgb(15, 23, 42); font-size: 15px; font-weight: 850; text-decoration: none; overflow-wrap: anywhere; }
.motorit-alerts__item a:hover { color: rgb(6, 123, 157); text-decoration: underline; }
.motorit-alerts__item small { display: block; margin-top: 2px; color: rgb(71, 85, 105); font-size: 13px; line-height: 1.45; }
.motorit-alerts__item small .is-down { color: #126238; font-weight: 800; }
.motorit-alerts__item form { flex: 0 0 auto; margin: 0; }
.motorit-alerts__remove { min-height: 36px; padding: 0 12px; border: 1px solid rgb(219, 231, 239); border-radius: 10px; background: #fff; color: rgb(71, 85, 105); font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; }
.motorit-alerts__remove:hover { border-color: #b02020; color: #9b1c1c; }
.motorit-alerts .motorit-alerts__empty { padding: 14px 16px; border: 1px dashed rgb(203, 219, 229); border-radius: 16px; color: rgb(71, 85, 105); font-size: 14px; line-height: 1.55; }
.motorit-alerts .motorit-alerts__empty a { color: rgb(6, 123, 157); font-weight: 800; }
.motorit-alerts__tag { display: inline-block; margin-right: 6px; padding: 2px 8px; border-radius: 999px; background: #e8f6ef; color: #126238; font-size: 11.5px; font-weight: 900; vertical-align: 1px; }
.motorit-alerts__tag.is-match { background: #ebf3f9; color: #045f77; }

/* ---- Sell: commercial / plant details --------------------------------------------------------------------------- */
.motorit-sell-work[hidden] { display: none !important; }
.motorit-sell-work { margin-top: 18px; padding: 18px; border: 1px solid #d7e4ee; border-radius: 16px; background: #f7fbfe; }
.motorit-sell-work h4 { margin: 0 0 4px; color: #102b42; font-size: 16px; font-weight: 900; }
.motorit-sell-work > p { margin: 0 0 12px; color: #3d5361; font-size: 14px; line-height: 1.5; }
.motorit-sell-work [data-work-kinds][hidden] { display: none !important; }

/* ---- Responsive -------------------------------------------------------------------------------------------------- */
@media (max-width: 1180px) {
  .motorit-vehicle-v3 .motorit-vehicle-price-card .motorit-px, .motorit-vehicle-v3 .motorit-vehicle-price-card .motorit-watch__flash { grid-column: 1 / -1; grid-row: auto; }
}
@media (max-width: 980px) {
  .motorit-vehicle-v3 .motorit-vehicle__insights-grid { grid-template-columns: minmax(0, 1fr); }
  .motorit-health__facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .motorit-health__head { align-items: flex-start; gap: 12px; }
  .motorit-health__score { width: 78px; height: 78px; }
  .motorit-health__score circle { stroke-width: 8; }
  .motorit-health__score strong { font-size: 24px; margin-top: 10px; }
  .motorit-health__score span { margin-top: -18px; font-size: 9px; }
  .motorit-health__facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .motorit-health__facts > div { padding: 11px 10px 11px 13px; }
  .motorit-health__facts dd { font-size: 14px; }
  .motorit-health__facts small { font-size: 11.5px; }
  .motorit-insight__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .motorit-insight__stats--3 > div:last-child { grid-column: 1 / -1; }
  .motorit-costs__controls { grid-template-columns: minmax(0, 1fr); }
  .motorit-costs__rows > div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .motorit-costs__total strong { font-size: 30px; }
  .motorit-pricehist__plot { height: 170px; margin-left: 44px; }
  .motorit-pricehist__ylabel { left: -44px; width: 40px; }
  .motorit-pricehist__x { margin-left: 44px; }
  .motorit-pricehist__tag.is-mid { display: none; }
  .motorit-alerts__item { flex-direction: column; align-items: flex-start; }
}
