/* ==========================================================================
   Mobility Database - styles
   Design notes: wayfinding-sign clarity. Deep harbor ink, signal blue, sea green.
   One typeface (Atkinson Hyperlegible, made for low-vision readers) with system fallbacks.
   Body text is 18px, tap targets 48px, every text/background pair is AA or better.
   ========================================================================== */

:root {
  --ink: #0e2a38;
  --ink-soft: #4a5f6b;
  --page: #f6fafb;
  --paper: #ffffff;
  --mist: #eaf3f6;
  --pale: #d8ecf3;
  --line: #c5d6de;
  --blue: #0b5c86;
  --blue-dark: #084868;
  --green: #146b50;
  --amber: #7a4f00;
  --warn-bg: #fff3d1;
  --warn-ink: #5c3d00;
  --err: #8c1d18;
  --err-bg: #fdecea;
  --ok-bg: #e3f4ec;
  --grey: #4b5963;
  --radius: 10px;
  --radius-sm: 8px;
  --focus: #ffb703;
  --max: 1160px;
  --font: "Atkinson Hyperlegible", "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 18px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--page); line-height: 1.55; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1 0 auto; }
img, svg { max-width: 100%; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -0.01em; }
h1 { font-size: 2rem; font-weight: 700; }
h2 { font-size: 1.5rem; font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0 0 1em; max-width: 70ch; }
ul, ol { padding-left: 1.3em; margin: 0 0 1em; max-width: 70ch; }
li { margin-bottom: .35em; }
a { color: var(--blue); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
a:hover { color: var(--blue-dark); text-decoration-thickness: 2.5px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
small, .small { font-size: .9rem; }
.muted { color: var(--ink-soft); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.hidden, [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hp-field { position: absolute !important; left: -9999px !important; top: auto; width: 1px; height: 1px; overflow: hidden; }

:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; box-shadow: 0 0 0 6px var(--focus); border-radius: 4px; }
.skip-link { position: absolute; left: 8px; top: -60px; background: var(--ink); color: #fff; padding: 12px 18px; z-index: 1000; border-radius: 0 0 8px 8px; font-weight: 700; }
.skip-link:focus { top: 0; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 16px; }
.section { padding: 2.2rem 0; }
.section-tight { padding: 1.2rem 0; }
.band { background: var(--mist); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.band-ink { background: var(--ink); color: #fff; }
.band-ink a { color: #bfe3f2; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }
.row-between { justify-content: space-between; }
.grid { display: grid; gap: 1rem; }
.cols-2 { grid-template-columns: 1fr; }
.cols-3 { grid-template-columns: 1fr; }
@media (min-width: 700px) { .cols-2 { grid-template-columns: 1fr 1fr; } .cols-3 { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Header ---------- */
.site-header { background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 50; border-bottom: 4px solid var(--blue); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.2rem; letter-spacing: -0.01em; }
.brand:hover { color: #fff; }
.brand-mark { width: 38px; height: 38px; flex: none; }
.nav-toggle { background: transparent; border: 2px solid #bfe3f2; color: #fff; border-radius: var(--radius-sm); min-height: 48px; padding: 0 14px; font: inherit; font-weight: 700; cursor: pointer; }
.site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--ink); padding: 8px 16px 18px; border-bottom: 4px solid var(--blue); }
.site-nav.open { display: block; }
.site-nav a { display: flex; align-items: center; min-height: 48px; color: #fff; text-decoration: none; font-weight: 700; border-bottom: 1px solid #25475a; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: #bfe3f2; }
.site-nav a[aria-current="page"] { box-shadow: inset 4px 0 0 #bfe3f2; padding-left: 12px; }
.site-nav .btn { margin-top: 12px; justify-content: center; border-bottom: 0; }
@media (min-width: 1100px) {
  .nav-toggle { display: none; }
  .site-nav { display: flex !important; position: static; padding: 0; background: transparent; border: 0; align-items: center; gap: 4px; }
  .site-nav a { border: 0; padding: 0 12px; border-radius: var(--radius-sm); }
  .site-nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 #bfe3f2; padding-left: 12px; border-radius: 0; }
  .site-nav .btn { margin: 0 0 0 8px; }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #d7e8ef; margin-top: 3rem; padding: 2.2rem 0 1.6rem; }
.site-footer a { color: #bfe3f2; }
.site-footer h2 { color: #fff; font-size: 1.1rem; }
.footer-grid { display: grid; gap: 1.6rem; grid-template-columns: 1fr; }
@media (min-width: 800px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1.4fr; } }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin: 0; }
.footer-links a { display: inline-block; padding: 6px 0; }
.disclaimer { font-size: .9rem; border-top: 1px solid #25475a; margin-top: 1.6rem; padding-top: 1rem; max-width: none; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 22px; border-radius: var(--radius-sm); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; border: 2px solid var(--blue); background: var(--blue); color: #fff; line-height: 1.2; text-align: center; }
.btn:hover { background: var(--blue-dark); border-color: var(--blue-dark); color: #fff; }
.btn-secondary { background: var(--paper); color: var(--blue); }
.btn-secondary:hover { background: var(--pale); color: var(--blue-dark); border-color: var(--blue-dark); }
.btn-green { background: var(--green); border-color: var(--green); }
.btn-green:hover { background: #0f5540; border-color: #0f5540; }
.btn-danger { background: var(--err); border-color: var(--err); }
.btn-danger:hover { background: #6d1511; border-color: #6d1511; }
.btn-light { background: #fff; color: var(--ink); border-color: #fff; }
.btn-light:hover { background: var(--pale); color: var(--ink); border-color: var(--pale); }
.btn-sm { min-height: 42px; padding: 6px 14px; font-size: .95rem; }
.btn-block { display: flex; width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn-link { background: none; border: 0; color: var(--blue); text-decoration: underline; font: inherit; cursor: pointer; padding: 8px 4px; min-height: 44px; }

/* ---------- Forms ---------- */
label, .label { display: block; font-weight: 700; margin-bottom: 6px; }
.field { margin-bottom: 1.1rem; }
.hint { color: var(--ink-soft); font-size: .92rem; margin: 4px 0 0; max-width: 60ch; }
input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="url"], input[type="date"], input[type="search"], input:not([type]), select, textarea {
  width: 100%; min-height: 48px; padding: 10px 12px; font: inherit; color: var(--ink); background: var(--paper); border: 2px solid #7a97a5; border-radius: var(--radius-sm);
}
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); }
input[type="file"] { width: 100%; padding: 10px 0; font: inherit; }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--err); background: var(--err-bg); }
fieldset { border: 2px solid var(--line); border-radius: var(--radius); padding: 14px 16px 6px; margin: 0 0 1.2rem; background: var(--paper); }
legend { font-weight: 700; padding: 0 8px; }
.check { display: flex; gap: 12px; align-items: flex-start; margin-bottom: .8rem; }
.check input { width: 26px; height: 26px; flex: none; margin: 2px 0 0; accent-color: var(--blue); }
.check label { margin: 0; font-weight: 400; }
.check label strong { font-weight: 700; }
.form-grid { display: grid; gap: 0 1rem; grid-template-columns: 1fr; }
@media (min-width: 700px) { .form-grid.two { grid-template-columns: 1fr 1fr; } .form-grid.three { grid-template-columns: 1fr 1fr 1fr; } }
.field-error { color: var(--err); font-weight: 700; margin-top: 6px; }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.inline-form .field { margin: 0; flex: 1 1 220px; }
.human-check { background: var(--mist); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 1rem; }
.human-check input { max-width: 140px; }
.med-note { font-size: .92rem; color: var(--ink-soft); }

/* ---------- Notices ---------- */
.notice { border-radius: var(--radius); padding: 14px 16px; margin: 0 0 1rem; border: 2px solid var(--line); background: var(--paper); max-width: none; }
.notice > :last-child { margin-bottom: 0; }
.notice-info { background: var(--pale); border-color: #9ec9db; }
.notice-warn { background: var(--warn-bg); border-color: #e1b866; color: var(--warn-ink); }
.notice-ok { background: var(--ok-bg); border-color: #8cc9ad; }
.notice-error { background: var(--err-bg); border-color: #e3a29d; color: var(--err); }
.notice strong { display: block; margin-bottom: 2px; }
.draft-banner { background: var(--warn-bg); color: var(--warn-ink); border: 2px solid #e1b866; border-radius: var(--radius); padding: 12px 16px; font-weight: 700; margin-bottom: 1.4rem; max-width: none; }

/* ---------- Cards and listing cards ---------- */
.card { background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card h2, .card h3 { margin-top: 0; }
.listing-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 560px) { .listing-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .listing-grid { grid-template-columns: repeat(3, 1fr); } }
.lcard { background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; position: relative; }
.lcard:hover { border-color: var(--blue); }
.lcard-photo { aspect-ratio: 4 / 3; background: var(--mist); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.lcard-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lcard-photo svg { width: 38%; height: auto; color: #7a97a5; }
.lcard-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.lcard-price { font-size: 1.5rem; font-weight: 700; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.lcard-price s { font-size: 1rem; font-weight: 400; color: var(--ink-soft); }
.lcard-title { font-size: 1.1rem; font-weight: 700; margin: 0; }
.lcard-title a { color: var(--ink); text-decoration: none; }
.lcard-title a::after { content: ""; position: absolute; inset: 0; }
.lcard-title a:hover { text-decoration: underline; }
.lcard-meta { color: var(--ink-soft); font-size: .95rem; }
.lcard-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }
.lcard .grade { position: absolute; top: 10px; left: 10px; }
.lcard .sample-flag { position: absolute; top: 10px; right: 10px; }
.lcard-fit { font-size: .9rem; margin: 4px 0 0; color: var(--green); }
.lcard-fit.warn { color: var(--warn-ink); }

/* Condition grade tiles: shape + letter + colour so they never rely on colour alone */
.grade { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; font-weight: 700; font-size: 1.35rem; color: #fff; background: var(--blue); flex: none; }
.grade-A { background: var(--green); border-radius: 50%; }
.grade-B { background: var(--blue); border-radius: 10px; }
.grade-C { background: var(--amber); clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%); }
.grade-P { background: var(--grey); border-radius: 4px; outline: 3px dashed #fff; outline-offset: -7px; font-size: 1.1rem; }
.grade-lg { width: 64px; height: 64px; font-size: 2rem; }
.grade-lg.grade-P { font-size: 1.5rem; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: .88rem; font-weight: 700; background: var(--pale); color: var(--ink); border: 1px solid #9ec9db; white-space: nowrap; }
.badge-green { background: var(--ok-bg); border-color: #8cc9ad; color: #0f5540; }
.badge-amber { background: var(--warn-bg); border-color: #e1b866; color: var(--warn-ink); }
.badge-grey { background: #e9eef1; border-color: #b9c7ce; color: var(--grey); }
.badge svg { width: 14px; height: 14px; }

/* ---------- Hero and home ---------- */
.hero { background: var(--ink); color: #fff; padding: 2.4rem 0 2.8rem; border-bottom: 4px solid var(--blue); }
.hero h1 { font-size: 2.1rem; max-width: 18ch; }
.hero p { color: #d7e8ef; font-size: 1.1rem; }
.hero-grid { display: grid; gap: 1.6rem; grid-template-columns: 1fr; align-items: center; }
@media (min-width: 900px) { .hero h1 { font-size: 2.8rem; } .hero-grid { grid-template-columns: 1.15fr 1fr; gap: 3rem; } }
.search-card { background: #fff; color: var(--ink); border-radius: var(--radius); padding: 20px; }
.search-card h2 { font-size: 1.2rem; }
.cat-grid { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
@media (min-width: 700px) { .cat-grid { grid-template-columns: repeat(5, 1fr); } }
.cat-tile { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 16px 8px; min-height: 120px; border: 2px solid var(--line); border-radius: var(--radius); background: var(--paper); text-decoration: none; color: var(--ink); font-weight: 700; }
.cat-tile:hover { border-color: var(--blue); background: var(--pale); color: var(--ink); }
.cat-tile svg { width: 46px; height: 46px; color: var(--blue); }
.steps { display: grid; gap: 1rem; grid-template-columns: 1fr; counter-reset: step; }
@media (min-width: 800px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step { background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius); padding: 18px; position: relative; padding-left: 70px; counter-increment: step; }
.step::before { content: counter(step); position: absolute; left: 16px; top: 16px; width: 40px; height: 40px; border-radius: 50%; background: var(--blue); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.step h3 { margin-bottom: .3em; }
.trust-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; grid-template-columns: 1fr; max-width: none; }
@media (min-width: 800px) { .trust-list { grid-template-columns: 1fr 1fr; } }
.trust-list li { display: flex; gap: 12px; align-items: flex-start; margin: 0; background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.trust-list svg { width: 28px; height: 28px; flex: none; color: var(--green); margin-top: 2px; }
.callout { display: grid; gap: 1rem; grid-template-columns: 1fr; align-items: center; background: var(--pale); border: 2px solid #9ec9db; border-radius: var(--radius); padding: 22px; }
@media (min-width: 800px) { .callout { grid-template-columns: 1fr auto; } }
.callout h2 { margin-bottom: .3em; }
.callout p { margin-bottom: 0; }

/* ---------- Browse layout ---------- */
.browse-layout { display: grid; gap: 1.4rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 960px) { .browse-layout { grid-template-columns: 300px 1fr; } }
.filters { background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius); padding: 16px; }
.filters summary { font-weight: 700; font-size: 1.15rem; cursor: pointer; min-height: 44px; display: flex; align-items: center; }
@media (min-width: 960px) { .filters summary { display: none; } .filters { position: sticky; top: 84px; } }
.result-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 1rem; }
.pager { display: flex; gap: 8px; justify-content: center; align-items: center; margin-top: 1.6rem; flex-wrap: wrap; }
.empty { text-align: center; padding: 2.4rem 1rem; background: var(--paper); border: 2px dashed var(--line); border-radius: var(--radius); }
.empty p { margin-left: auto; margin-right: auto; }

/* ---------- Listing detail ---------- */
.listing-layout { display: grid; gap: 1.6rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 960px) { .listing-layout { grid-template-columns: 1.4fr 1fr; } }
.gallery-main { aspect-ratio: 4 / 3; background: var(--mist); border-radius: var(--radius); border: 2px solid var(--line); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.gallery-main svg { width: 30%; color: #7a97a5; }
.thumbs { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.thumbs button { width: 76px; height: 76px; padding: 0; border: 3px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: #fff; cursor: pointer; }
.thumbs button[aria-current="true"] { border-color: var(--blue); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.price-big { font-size: 2.2rem; font-weight: 700; line-height: 1.1; }
.title-row { display: flex; gap: 14px; align-items: center; margin-bottom: .6rem; }
.title-row h1 { margin: 0; font-size: 1.7rem; }
.plate { background: var(--paper); border: 2px solid var(--ink); border-radius: var(--radius); overflow: hidden; }
.plate h2 { background: var(--ink); color: #fff; margin: 0; padding: 10px 16px; font-size: 1.05rem; }
.plate dl { margin: 0; display: grid; grid-template-columns: 1fr; }
@media (min-width: 560px) { .plate dl { grid-template-columns: 1fr 1fr; } }
.plate dl > div { padding: 10px 16px; border-bottom: 1px solid var(--line); }
.plate dt { font-size: .88rem; color: var(--ink-soft); font-weight: 400; }
.plate dd { margin: 0; font-weight: 700; word-break: break-word; }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; grid-template-columns: 1fr 1fr; max-width: none; }
.checks li { display: flex; gap: 8px; align-items: center; margin: 0; background: var(--ok-bg); border: 1px solid #8cc9ad; border-radius: var(--radius-sm); padding: 8px 10px; font-weight: 700; font-size: .95rem; }
.checks svg { width: 22px; height: 22px; color: var(--green); flex: none; }
.side-card { background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 1rem; }
.side-card h2, .side-card h3 { font-size: 1.15rem; margin-top: 0; }
.seller-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.link-list { list-style: none; padding: 0; margin: 0; }
.link-list li { margin: 0; }
.link-list a { display: block; padding: 8px 0; }
.quote-table { width: 100%; border-collapse: collapse; }
.quote-table td { padding: 8px 0; border-bottom: 1px solid var(--line); }
.quote-table td:last-child { text-align: right; white-space: nowrap; }
.quote-table tr.total td { font-weight: 700; border-bottom: 0; font-size: 1.1rem; }

/* ---------- Tabs, tables ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 3px solid var(--line); margin-bottom: 1.4rem; }
.tabs button, .tabs a { min-height: 48px; padding: 8px 16px; border: 0; background: transparent; font: inherit; font-weight: 700; color: var(--ink-soft); cursor: pointer; border-radius: var(--radius-sm) var(--radius-sm) 0 0; text-decoration: none; display: inline-flex; align-items: center; margin-bottom: -3px; border-bottom: 3px solid transparent; }
.tabs button[aria-selected="true"], .tabs a[aria-current="page"] { color: var(--blue); border-bottom-color: var(--blue); background: var(--paper); }
.tabs .count { background: var(--blue); color: #fff; border-radius: 999px; padding: 0 8px; margin-left: 8px; font-size: .85rem; min-width: 22px; text-align: center; }
.table-wrap { overflow-x: auto; border: 2px solid var(--line); border-radius: var(--radius); background: var(--paper); }
table.data { width: 100%; border-collapse: collapse; font-size: .95rem; min-width: 560px; }
table.data th, table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.data th { background: var(--mist); font-weight: 700; white-space: nowrap; }
table.data input, table.data select { min-height: 40px; padding: 4px 8px; }
.item-row { display: grid; gap: 14px; grid-template-columns: 90px 1fr; align-items: start; background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.item-row .thumb { width: 90px; height: 90px; border-radius: var(--radius-sm); overflow: hidden; background: var(--mist); display: flex; align-items: center; justify-content: center; }
.item-row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.item-row .thumb svg { width: 44px; color: #7a97a5; }
.item-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* ---------- Messages ---------- */
.msg-layout { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 900px) { .msg-layout { grid-template-columns: 340px 1fr; align-items: start; } }
.thread-list { background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.thread-item { display: flex; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; background: var(--paper); border: 0; border-bottom: 1px solid var(--line); cursor: pointer; font: inherit; color: var(--ink); min-height: 64px; }
.thread-item:hover { background: var(--mist); }
.thread-item[aria-current="true"] { background: var(--pale); box-shadow: inset 5px 0 0 var(--blue); }
.thread-item .t { font-weight: 700; display: block; }
.thread-item .s { color: var(--ink-soft); font-size: .92rem; display: block; }
.unread-dot { background: var(--blue); color: #fff; border-radius: 999px; font-size: .8rem; font-weight: 700; min-width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; }
.convo { background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius); }
.convo-head { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.bubbles { padding: 16px; display: flex; flex-direction: column; gap: 12px; max-height: 55vh; overflow-y: auto; }
.bubble { max-width: 85%; padding: 10px 14px; border-radius: 14px; background: var(--mist); align-self: flex-start; white-space: pre-wrap; word-wrap: break-word; }
.bubble.mine { background: var(--pale); align-self: flex-end; }
.bubble .who { display: block; font-size: .85rem; color: var(--ink-soft); margin-top: 4px; }
.convo-form { padding: 14px 16px; border-top: 1px solid var(--line); }
.contact-box { background: var(--ok-bg); border: 2px solid #8cc9ad; border-radius: var(--radius); padding: 12px 14px; margin: 12px 16px; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; padding: 0; margin: 0; border-left: 4px solid var(--line); max-width: none; }
.timeline li { padding: 0 0 14px 18px; position: relative; margin: 0; }
.timeline li::before { content: ""; position: absolute; left: -11px; top: 4px; width: 18px; height: 18px; border-radius: 50%; background: var(--paper); border: 4px solid var(--blue); }
.timeline li:first-child::before { background: var(--blue); }
.status-pill { display: inline-block; padding: 4px 12px; border-radius: 999px; font-weight: 700; background: var(--pale); border: 1px solid #9ec9db; }
.status-Delivered, .status-Active { background: var(--ok-bg); border-color: #8cc9ad; color: #0f5540; }
.status-Issue, .status-Removed, .status-Cancelled { background: var(--err-bg); border-color: #e3a29d; color: var(--err); }
.status-Pending, .status-Requested, .status-Quoted { background: var(--warn-bg); border-color: #e1b866; color: var(--warn-ink); }
.status-Sold, .status-Expired { background: #e9eef1; border-color: #b9c7ce; color: var(--grey); }

/* ---------- Photos upload ---------- */
.photo-grid { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); margin-top: 10px; }
@media (min-width: 640px) { .photo-grid { grid-template-columns: repeat(3, 1fr); } }
.photo-item { position: relative; border: 2px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: #fff; }
.photo-item img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.photo-item button { position: absolute; top: 6px; right: 6px; min-height: 40px; }
.photo-item .first { position: absolute; left: 6px; bottom: 6px; }
.progress { height: 14px; background: var(--mist); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.progress > span { display: block; height: 100%; background: var(--blue); width: 0; transition: width .3s; }
.steps-bar { display: flex; gap: 6px; margin-bottom: 1.2rem; flex-wrap: wrap; }
.steps-bar li { list-style: none; margin: 0; padding: 6px 12px; border-radius: 999px; background: var(--mist); border: 1px solid var(--line); font-size: .92rem; font-weight: 700; color: var(--ink-soft); }
.steps-bar li[aria-current="step"] { background: var(--blue); border-color: var(--blue); color: #fff; }
.steps-bar li.done { background: var(--ok-bg); border-color: #8cc9ad; color: #0f5540; }
.steps-bar { padding: 0; max-width: none; }
.grade-pick { display: grid; gap: 10px; grid-template-columns: 1fr; margin-bottom: 1rem; }
@media (min-width: 700px) { .grade-pick { grid-template-columns: 1fr 1fr; } }
.grade-opt { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 2px solid var(--line); border-radius: var(--radius); background: var(--paper); cursor: pointer; }
.grade-opt:has(input:checked) { border-color: var(--blue); background: var(--pale); }
.grade-opt input { width: 24px; height: 24px; margin-top: 10px; accent-color: var(--blue); flex: none; }
.grade-opt p { margin: 0; font-size: .95rem; }
.grade-opt strong { display: block; }

/* ---------- Dialog, toast, bars ---------- */
dialog { border: 3px solid var(--ink); border-radius: var(--radius); padding: 0; max-width: min(560px, calc(100vw - 24px)); width: 100%; color: var(--ink); background: var(--paper); }
dialog::backdrop { background: rgba(14, 42, 56, .65); }
.dialog-body { padding: 22px; }
.dialog-close { position: absolute; top: 8px; right: 8px; min-height: 44px; min-width: 44px; background: var(--mist); border: 2px solid var(--line); border-radius: var(--radius-sm); font: inherit; font-weight: 700; cursor: pointer; }
.toast-region { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { pointer-events: auto; background: var(--ink); color: #fff; padding: 14px 18px; border-radius: var(--radius); max-width: 560px; width: 100%; font-weight: 700; border-left: 8px solid #bfe3f2; }
.toast.error { border-left-color: #ff8a80; }
.toast.ok { border-left-color: #7fd6ad; }
.signup-bar { position: fixed; left: 0; right: 0; bottom: 0; background: var(--ink); color: #fff; z-index: 90; padding: 12px 16px; border-top: 4px solid var(--blue); }
.signup-bar .wrap { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.signup-bar p { margin: 0; flex: 1 1 260px; }
.signup-bar .btn-link { color: #bfe3f2; }
body.has-bar { padding-bottom: 140px; }
@media (min-width: 700px) { body.has-bar { padding-bottom: 84px; } }

/* ---------- Guides and legal text ---------- */
.prose { max-width: 75ch; }
.prose h2 { margin-top: 2rem; }
.prose h3 { margin-top: 1.4rem; }
.toc { background: var(--mist); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 1.4rem; }
.toc ul { margin: 0; }
.blank-line { border-bottom: 2px solid var(--ink-soft); display: inline-block; min-width: 220px; height: 1.6em; vertical-align: bottom; }
.checkbox-list { list-style: none; padding-left: 0; }
.checkbox-list li { display: flex; gap: 10px; align-items: flex-start; }
.checkbox-list li::before { content: ""; width: 20px; height: 20px; border: 2px solid var(--ink); border-radius: 4px; flex: none; margin-top: 3px; }
.guide-cover { background: var(--ink); color: #fff; border-radius: var(--radius); padding: 28px; margin-bottom: 1.6rem; }
.guide-cover h1 { color: #fff; }
.guide-cover p { color: #d7e8ef; }
.worksheet table { border-collapse: collapse; width: 100%; }
.worksheet th, .worksheet td { border: 2px solid var(--ink-soft); padding: 10px; text-align: left; min-width: 90px; height: 44px; }

/* ---------- Print (guides, legal, delivery records) ---------- */
@media print {
  html { font-size: 12.5pt; }
  body { background: #fff; display: block; }
  .site-header, .site-footer, .signup-bar, .toast-region, .no-print, .skip-link, .nav-toggle { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  a { color: #000; text-decoration: underline; }
  .guide-cover { background: #fff; color: #000; border: 3px solid #000; }
  .guide-cover h1, .guide-cover p { color: #000; }
  h2, h3 { break-after: avoid; }
  .card, .notice, .worksheet, li { break-inside: avoid; }
  .page-break { break-before: page; }
  .draft-banner { border: 2px solid #000; background: #fff; color: #000; }
  .checkbox-list li::before { border-color: #000; }
}

/* ---------- Additions: footer form on dark background, extra status colors, misc ---------- */
.site-footer label { color: #fff; }
.site-footer .check label { color: #e6f1f6; }
.site-footer .human-check label { color: var(--ink); }
.site-footer .notice, .site-footer .notice p { color: var(--ink); }
.site-footer .hint { color: #bcd3dd; }
.status-Confirmed, .status-PickedUp { background: var(--pale); border-color: #9ec9db; color: var(--blue-dark); }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
details.card > summary { list-style-position: inside; }
blockquote { margin: 0 0 1rem; }
.stat-row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.legal-note { font-size: .95rem; }
.hero .btn-light { margin-right: 8px; }
.listing-grid { margin-bottom: 1rem; }

.site-nav a, .brand { white-space: nowrap; }
.worksheet td:first-child, .worksheet th:first-child { width: 58%; }

/* heading icons and untyped inputs */
h2 svg, h3 svg, h4 svg { width:1.1em; height:1.1em; vertical-align:-0.15em; margin-right:.3em; flex:none; }
