/* ---------- Tokens (from Figma) ---------- */
:root {
  --ci-black: #000;
  --ci-white: #fff;
  --ci-red: #e50335;
  --ci-red-error: #cc042f;
  --ci-green: #19865e;
  --ci-green-hover: #177955;
  --ci-grey: #c9c9c9;
  --ci-grey-600: #666;
  --ci-asterisk: #6e736e;
  --ci-link: #4170ce;
  --ci-shadow: 0 1px 6px 1px rgba(0, 0, 0, .1);
  --ci-btn-shadow: 0 1px 3px rgba(0, 0, 0, .1);
  --plex: "IBM Plex Sans", system-ui, sans-serif;

  /* Legend */
  --lg-w: 272px;
  --lg-blue: #2563eb;
  --lg-border: #d1d5db;
  --lg-muted: #6b7280;
  --lg-text: #111827;
  --inter: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--inter); color: var(--lg-text); background: #e5e5e5; overflow: hidden; }
button { font: inherit; color: inherit; }
img { display: block; }
:focus-visible { outline: 2px solid var(--lg-blue); outline-offset: 2px; }

/* ---------- Legend ---------- */
.legend {
  position: fixed; inset: 0 auto 0 0; width: var(--lg-w);
  background: #fff; border-right: 1px solid #e5e7eb;
  overflow-y: auto; padding: 20px 16px 24px; z-index: 50;
  scrollbar-width: thin;
}
.lg-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.lg-title { font-size: 16px; font-weight: 700; margin: 0; }
.lg-hide { border: 0; background: none; color: var(--lg-muted); font-size: 13px; cursor: pointer; display: flex; gap: 6px; align-items: center; padding: 4px; border-radius: 6px; }
.lg-hide:hover { color: var(--lg-text); }
kbd {
  font-family: var(--inter); font-size: 11px; font-weight: 500; line-height: 1;
  min-width: 20px; height: 20px; padding: 0 5px; display: inline-flex; align-items: center; justify-content: center;
  background: #f3f4f6; border: 1px solid var(--lg-border); border-radius: 4px; color: var(--lg-muted);
}
.lg-sec { margin-top: 22px; }
.lg-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--lg-muted); margin: 0 0 8px; }
.lg-row { display: flex; justify-content: space-between; align-items: baseline; }
.lg-count { font-size: 12px; font-weight: 600; color: var(--lg-muted); }
.lg-count.full { color: #dc2626; }
.lg-note { font-size: 12px; color: var(--lg-muted); margin: -2px 0 8px; line-height: 1.4; }
.opt-group { display: flex; flex-direction: column; gap: 8px; }
.opt {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  text-align: left; background: #fff; border: 1px solid var(--lg-border); border-radius: 8px;
  padding: 10px 12px; font-size: 14px; cursor: pointer; min-height: 40px;
}
.opt:hover { border-color: #9ca3af; }
.opt[aria-checked="true"], .opt.on { border: 2px solid var(--lg-blue); padding: 9px 11px; font-weight: 600; }
.opt[aria-checked="true"] kbd, .opt.on kbd { background: #eff6ff; border-color: var(--lg-blue); color: var(--lg-blue); }
.opt:disabled { opacity: .45; cursor: not-allowed; }
.opt .opt-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.opt small { font-size: 12px; font-weight: 400; color: var(--lg-muted); line-height: 1.3; }
.stepper { display: flex; align-items: center; gap: 8px; }
.step-btn { width: 32px; height: 32px; border: 1px solid var(--lg-border); background: #fff; border-radius: 8px; cursor: pointer; font-size: 16px; flex: none; }
.step-btn:hover:not(:disabled) { border-color: #9ca3af; }
.step-btn:disabled { opacity: .4; cursor: not-allowed; }
.dl-bar { flex: 1; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.dl-bar span { height: 8px; border-radius: 4px; background: #e5e7eb; }
.dl-bar span.used { background: var(--lg-blue); }
.dl-bar.full span.used { background: #dc2626; }
.lg-link { border: 0; background: none; color: var(--lg-blue); font-size: 13px; padding: 6px 0 0; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.tgl-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; font-weight: 600; padding: 8px 0; cursor: pointer; }
.tgl { appearance: none; -webkit-appearance: none; width: 44px; height: 24px; border-radius: 12px; background: #6b7280; position: relative; cursor: pointer; flex: none; margin: 0; transition: background .15s; }
.tgl::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; }
.tgl:checked { background: var(--lg-blue); }
.tgl:checked::after { transform: translateX(20px); }
.seg { display: inline-flex; border: 1px solid var(--lg-border); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: #fff; font-size: 12px; font-weight: 500; padding: 5px 10px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--lg-border); }
.seg button[aria-checked="true"] { background: var(--lg-blue); color: #fff; }
.lg-foot { font-size: 12px; color: var(--lg-muted); line-height: 1.5; margin-top: 24px; }
.lg-show { position: fixed; left: 12px; top: 12px; z-index: 60; background: #fff; border: 1px solid var(--lg-border); border-radius: 8px; padding: 8px 10px; font-size: 13px; font-weight: 600; display: flex; gap: 8px; align-items: center; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.lg-show[hidden] { display: none; }
body.lg-hidden .legend { display: none; }
body.lg-hidden .stage { left: 0; }

/* ---------- Stage + frames ---------- */
.stage { position: fixed; inset: 0 0 0 var(--lg-w); }
.frame { position: absolute; inset: 0; background: #fff; overflow: hidden; }
.scroller { position: absolute; inset: 0; overflow: auto; }
body.view-mobile .stage { display: flex; align-items: center; justify-content: center; }
body.view-mobile .frame {
  position: relative; inset: auto; width: 375px; height: min(812px, calc(100vh - 48px));
  border-radius: 28px; border: 10px solid #111; box-shadow: 0 20px 50px rgba(0,0,0,.25);
}

/* ---------- Site (CarsIreland page) ---------- */
.site { font-family: var(--plex); color: var(--ci-black); min-width: 1300px; }
body.view-mobile .site { min-width: 0; }
.m-only { display: none !important; }
body.view-mobile .m-only { display: block !important; }
body.view-mobile .d-only { display: none !important; }
body.view-mobile .ci-head-m.m-only { display: flex !important; }

.ci-head { border-bottom: 1px solid #e3e3e3; }
.ci-head-in { max-width: 1314px; margin: 0 auto; height: 108px; display: flex; align-items: center; padding: 0 24px; }
.ci-nav { display: flex; gap: 40px; margin-left: 84px; }
.ci-nav a { color: #000; text-decoration: none; font-weight: 600; font-size: 16px; display: inline-flex; align-items: center; gap: 14px; }
.ci-nav a:hover { text-decoration: underline; }
.ci-head-btns { margin-left: auto; display: flex; gap: 24px; }
.btn-outline-red { display: inline-flex; align-items: center; justify-content: center; width: 194px; height: 60px; border: 2px solid var(--ci-red); border-radius: 3px; font-weight: 700; color: #000; text-decoration: none; }
.btn-outline-red:hover { text-decoration: underline; }
.chev { display: inline-block; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-3px); }
.chev.red { color: var(--ci-red); margin-left: auto; }

.ci-head-m { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid #e3e3e3; }
.burger { width: 32px; height: 32px; border: 0; background: none; display: flex; flex-direction: column; justify-content: center; gap: 5px; padding: 4px; cursor: pointer; }
.burger span { height: 2px; background: #000; border-radius: 1px; }

.ci-sub { max-width: 1266px; margin: 0 auto; padding: 20px 0 0; }
.back { color: var(--ci-link); text-decoration: none; font-size: 16px; display: inline-block; }
.back:hover { text-decoration: underline; }
.banner { margin: 16px auto 0; }
body.view-mobile .ci-sub { padding: 12px 16px 0; }
body.view-mobile .back { margin-left: 0; }

.ci-body { display: flex; gap: 16px; justify-content: center; padding: 10px 0 48px; }
.col-main { width: 796px; display: flex; flex-direction: column; gap: 16px; }
.col-side { width: 454px; }
.col-side .dealer { margin-left: 14.5px; }
.shot { max-width: 100%; height: auto; }
.ad-wrap { display: flex; justify-content: center; }
body.view-mobile .ci-body { display: block; padding: 8px 0 32px; }
body.view-mobile .col-main { width: auto; gap: 16px; }
body.view-mobile .col-main > .shot { width: 100%; }
body.view-mobile .col-main > .shot.m-only { width: calc(100% - 32px); margin: 0 16px; }
body.view-mobile .ad-wrap { padding: 0 16px; }

.byb { font-size: 16px; font-weight: 700; line-height: 24px; margin: 0 0 0 24px; }
body.view-mobile .byb { margin-left: 16px; }
.cards { display: flex; gap: 16px; justify-content: center; align-items: stretch; padding: 0 16px; }
body.view-mobile .cards { flex-direction: column; }

/* Card */
.card {
  width: 374px; background: var(--ci-white); border: 1px solid var(--ci-grey); border-radius: 4px;
  box-shadow: var(--ci-shadow); padding: 24px; display: flex; flex-direction: column; gap: 16px;
}
body.view-mobile .card { width: 100%; }
.card-head { display: flex; align-items: flex-end; justify-content: space-between; min-height: 30px; }
.card-head.center { align-items: center; }
.card h3 { font-size: 18px; line-height: 24px; font-weight: 700; margin: 0; }
.card p { font-size: 16px; line-height: 24px; margin: 0; }
.card .stack { display: flex; flex-direction: column; gap: 24px; }
.ticks { list-style: none; margin: 0; padding: 0; }
.ticks li { display: flex; gap: 10px; align-items: center; font-size: 16px; line-height: 24px; }
.ticks svg { flex: none; }
.card .spacer { flex: 1; }
.link-inline { font-weight: 700; color: inherit; text-decoration: none; }
.link-inline:hover, .link-inline:focus-visible { text-decoration: underline; }

/* Buttons */
.btn {
  height: 60px; border-radius: 3px; font-family: var(--plex); font-weight: 700; font-size: 16px; line-height: 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  box-shadow: var(--ci-btn-shadow); border: 0; width: 100%; padding: 0 16px; text-decoration: none;
}
.btn-green { background: var(--ci-green); color: #fff; }
.btn-green:hover:not(:disabled) { background: var(--ci-green-hover); text-decoration: underline; }
.btn-green:disabled { background: var(--ci-grey); color: var(--ci-grey-600); cursor: not-allowed; }
.btn-green[aria-busy="true"] { cursor: progress; }
.btn-red { background: var(--ci-red); color: #fff; }
.btn-red:hover { background: #cc032f; text-decoration: underline; }
.btn-outline { background: #fff; border: 1px solid var(--ci-red); color: #000; }
.btn-outline:hover { text-decoration: underline; }

.accordions { border-top: 0; }
.acc { width: 100%; display: flex; align-items: center; gap: 16px; padding: 18px 8px 18px 0; border: 0; border-bottom: 1px solid #e3e3e3; background: none; font-family: var(--plex); font-weight: 700; font-size: 16px; cursor: pointer; text-align: left; }
.acc-dot { width: 40px; height: 40px; border-radius: 50%; background: #e3e3e3; flex: none; }
body.view-mobile .accordions { padding: 0 16px; }
.ci-foot { background: #f5f5f5; color: #666; text-align: center; font-size: 13px; padding: 32px 16px; }

/* ---------- Modal ---------- */
.overlay { position: absolute; inset: 0; background: rgba(0, 0, 0, .45); display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 20; overflow: auto; }
.overlay[hidden] { display: none; }
.modal {
  font-family: var(--plex); background: #fff; border: 1px solid var(--ci-grey); border-radius: 4px;
  box-shadow: var(--ci-shadow); width: 800px; max-width: 100%; padding: 40px 80px; position: relative;
  max-height: 100%; overflow: auto; margin: auto;
}
.modal:focus { outline: none; }
.m-x { position: absolute; width: 32px; height: 32px; border: 0; background: none; cursor: pointer; padding: 0; display: flex; align-items: center; justify-content: center; border-radius: 4px; color: #666; }
.m-x:hover { color: #000; background: #f2f2f2; }
.form-x { position: static; }

/* Form state */
.f-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 16px; margin-bottom: 40px; }
.f-head h2 { font-size: 32px; line-height: 40px; font-weight: 700; margin: 0; }
.fields { display: flex; flex-direction: column; gap: 8px; }
.fields.has-err { gap: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; min-height: 86px; }
.fields.has-err .field { min-height: 0; }
.field label { font-size: 14px; line-height: 20px; }
.field label .req { color: var(--ci-asterisk); margin-left: 4px; }
.field input {
  height: 44px; border: .5px solid #000; border-radius: 4px; padding: 8px 16px; font-family: var(--plex);
  font-size: 16px; line-height: 24px; color: #000; background: #fff; width: 100%;
}
.field input::placeholder { color: var(--ci-grey-600); }
.field input:focus { outline: none; border: 1px solid var(--ci-link); box-shadow: 0 0 0 3px rgba(65,112,206,.25); }
.field input[aria-invalid="true"] { border: 1px solid var(--ci-red-error); box-shadow: 0 0 8px rgba(211, 47, 47, .35); }
.field .err { color: var(--ci-red-error); font-size: 14px; line-height: 1; }
.field .err:empty { display: none; }
.incl { margin-top: 40px; }
.incl h3 { font-size: 16px; line-height: 24px; font-weight: 700; margin: 0 0 8px; }
.incl-cols { display: grid; grid-template-columns: 280px 280px; column-gap: 32px; }
.divider { height: 1px; background: var(--ci-grey); margin: 24px 0; }
.optin { display: flex; gap: 8px; align-items: center; font-size: 16px; line-height: 24px; cursor: pointer; }
.optin input { appearance: none; -webkit-appearance: none; width: 24px; height: 24px; border: 1px solid #666; border-radius: 2px; background: #fff; flex: none; margin: 0; cursor: pointer; display: grid; place-items: center; }
.optin input:checked { background: var(--ci-green); border-color: var(--ci-green); }
.optin input:checked::after { content: ""; width: 6px; height: 12px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.legal { font-size: 12px; line-height: 18px; margin: 24px 0; }
.legal a { color: var(--ci-link); }
.f-submit { width: 286px; }

/* Result states (confirmation / limit) */
.res { padding: 16px 16px 0; text-align: center; }
.res .m-x { top: 56px; right: 96px; }
.res-icon { display: flex; justify-content: center; margin: 32px 0 16px; }
.res h2 { font-size: 24px; line-height: 32px; font-weight: 700; margin: 0 0 4px; }
.res p { font-size: 16px; line-height: 24px; margin: 0; }
.res .email { color: var(--ci-link); word-break: break-all; }
.res-btns { display: flex; gap: 16px; justify-content: center; margin-top: 24px; }
.res-btns .btn { width: 240px; }
.res.limit h2 { margin-bottom: 8px; }
.res.limit p { max-width: 607px; margin: 0 auto; }

/* Mobile modal: bottom card with 16px margins */
body.view-mobile .overlay { align-items: flex-end; padding: 16px; }
body.view-mobile .modal { width: 100%; padding: 24px 16px; margin: 0; }
body.view-mobile .f-head { padding-top: 0; margin-bottom: 24px; align-items: flex-start; }
body.view-mobile .f-head h2 { font-size: 24px; line-height: 32px; }
body.view-mobile .incl { margin-top: 24px; }
body.view-mobile .incl-cols { grid-template-columns: 1fr; }
body.view-mobile .f-submit { width: 100%; }
body.view-mobile .res { padding: 8px 0 0; }
body.view-mobile .res .m-x { top: 16px; right: 16px; }
body.view-mobile .res-btns { flex-direction: column; }
body.view-mobile .res-btns .btn { width: 100%; }

/* ---------- Behaviour notes ---------- */
.note {
  display: none; font-family: var(--inter); font-size: 11px; line-height: 1.35; font-weight: 500;
  background: #fef3c7; color: #78350f; border: 1px solid #f59e0b; border-radius: 6px; padding: 6px 8px; text-align: left;
}
body.notes .note { display: block; }

/* ---------- Toast ---------- */
.toast { position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); background: #111827; color: #fff; font-family: var(--inter); font-size: 13px; padding: 10px 14px; border-radius: 8px; z-index: 40; max-width: calc(100% - 32px); box-shadow: 0 6px 20px rgba(0,0,0,.25); }

/* ---------- README ---------- */
.readme { position: absolute; inset: 0; background: rgba(17, 24, 39, .5); display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 30; }
.readme[hidden] { display: none; }
.readme-card { background: #fff; border-radius: 12px; max-width: 640px; width: 100%; max-height: 100%; overflow: auto; padding: 28px 32px; position: relative; font-size: 14px; line-height: 1.55; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.readme-card h2 { font-size: 20px; margin: 0 0 8px; }
.readme-card h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--lg-muted); margin: 20px 0 6px; }
.readme-card ul { padding-left: 18px; margin: 0; }
.readme-card li { margin-bottom: 4px; }
.readme-card a { color: var(--lg-blue); }
.readme-x { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border: 0; background: #f3f4f6; border-radius: 8px; font-size: 20px; cursor: pointer; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- Static page parts rebuilt in HTML ---------- */
.ad-ph { background: repeating-linear-gradient(45deg, #f2f2f2 0 10px, #e9e9e9 10px 20px); color: #888; font: 600 12px/1 var(--inter); letter-spacing: .08em; text-transform: uppercase; display: flex; align-items: center; justify-content: center; border: 1px dashed #c9c9c9; }
.ad-ph.banner { width: 740px; height: 92px; margin: 16px auto 0; }
.ad-ph.mpu { width: 489px; max-width: 100%; height: 280px; }
.desc { padding: 0 8px; }
.desc h2 { font-size: 16px; font-weight: 700; margin: 0 0 12px; }
.desc p { margin: 0 0 16px; font-size: 14px; }
.readmore { color: var(--ci-link); text-decoration: none; display: inline-flex; gap: 10px; align-items: center; font-size: 14px; }
.m-pad { padding: 0 16px; }
.sum { font-family: var(--plex); }
.sum-top { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 20px; border-bottom: 2px solid #c9c9c9; }
.sum-small { font-size: 12px; color: #555; }
.sum-title { font-size: 22px; font-weight: 400; margin: 4px 0 2px; }
.sum-sub { font-size: 13px; }
.sum-year { font-size: 20px; font-weight: 700; margin-top: 14px; }
.sum-km { font-size: 15px; font-weight: 600; margin-top: 4px; }
.sum-year small, .sum-km small { font-size: 10px; color: #666; font-weight: 400; letter-spacing: .04em; }
.sum-right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.sum-price { font-size: 26px; font-weight: 600; }
.aa { background: #ffd200; font-size: 10px; font-weight: 700; padding: 8px 10px; }
.save { border: 0; background: none; font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; gap: 6px; margin-top: 22px; cursor: pointer; font-family: var(--plex); }
.specs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin: 0; padding: 20px 0; border-bottom: 2px solid #c9c9c9; }
.specs div { display: flex; flex-direction: column; }
.specs dt { font-size: 11px; color: #666; }
.specs dd { margin: 0; font-size: 14px; }
.sum-links { display: flex; gap: 20px; padding: 14px 0; font-size: 14px; }
.sum-links a { color: #000; }
.sum-btns { display: flex; flex-direction: column; gap: 14px; }
.sum-btns .btn-outline { border-width: 2px; }
.finance { display: grid; grid-template-columns: 1fr 1fr; height: 56px; border: 2px solid var(--ci-link); border-radius: 3px; padding: 0; overflow: hidden; cursor: pointer; font-family: var(--plex); }
.finance span:first-child { background: var(--ci-link); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.fin-amt { color: var(--ci-link); font-weight: 700; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 15px; background: #fff; }
.fin-amt small { color: #000; font-size: 9px; }
.dealer-box { background: #f5f5f5; padding: 28px; margin-top: 16px; font-family: var(--plex); }
.dealer-name { font-size: 26px; font-weight: 400; margin: 6px 0 16px; }
.dealer-box address { font-style: normal; font-size: 14px; line-height: 28px; }
.dealer-tel a { color: #000; font-size: 16px; }
.dealer-link { color: var(--ci-link); text-decoration: none; font-weight: 600; font-size: 14px; }
.dealer-hours { display: flex; align-items: center; border-top: 2px solid #c9c9c9; padding-top: 20px; font-weight: 700; font-size: 16px; }
.helpful { padding: 24px 0; display: flex; flex-direction: column; gap: 12px; font-family: var(--plex); }
.helpful h3 { margin: 0; font-size: 16px; }
.helpful a { color: var(--ci-link); text-decoration: none; font-size: 14px; }
.helpful .report { color: #000; border-bottom: 2px solid var(--ci-red); align-self: flex-start; margin-top: 8px; }
.gal .gallery { width: 100%; height: auto; aspect-ratio: 796 / 600; object-fit: cover; background: #ddd; }
.thumbs { display: grid; grid-template-columns: repeat(9, 1fr); gap: 12px; margin-top: 10px; }
.thumbs span { aspect-ratio: 4 / 3; background: linear-gradient(160deg, #c9d3e6, #8a99b8); border-radius: 2px; }
.thumbs span.on { outline: 3px solid var(--ci-red); color: #fff; font: 600 10px/1 var(--plex); display: flex; align-items: center; justify-content: center; }
body.view-mobile .thumbs { gap: 4px; padding: 0 4px; }
