/* Iron Ledger — All Terrain 2.0 (tokens from docs/design/build_artboards.py) */
:root {
  /* --ink-3 and --orange-ink are darkened vs the artboards so 11–13 px text and links pass WCAG AA on cream/white. */
  --bg: #F4F1EB; --paper: #FFFFFF; --ink: #1A1714; --ink-2: #5C554B; --ink-3: #6B6455;
  --line: #D5CEC1; --line-2: #E3DDD2; --coal: #14120F; --coal-2: #1E1B17; --coal-line: #2B2822;
  --cream: #F1ECE3; --cream-2: #D6CFC2; --muted: #A39B8C;
  --orange: #E8621A; --orange-ink: #B0470C; --orange-dark: #8F3A0A; --tint: #F3E4D6;
  --radius: 6px; --wrap: 1240px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 Barlow, "Segoe UI", Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--orange-ink); text-decoration: none; }
a:hover { color: var(--orange-dark); }
p a, li a, .desc a, .form-note a, .est-note a, .empty a, .form-sent a { text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3, h4 { margin: 0; }
p { margin: 0 0 1em; }
.display { font-family: "Barlow Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif; text-transform: uppercase; font-weight: 700; line-height: .95; letter-spacing: .005em; text-wrap: balance; }
.mono { font-family: "JetBrains Mono", Consolas, "Cascadia Mono", monospace; font-variant-numeric: tabular-nums; }
.label { font-family: "JetBrains Mono", Consolas, monospace; text-transform: uppercase; letter-spacing: .14em; font-size: 11px; }
.accent { color: var(--orange); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--orange); color: var(--coal); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }

.btn { display: inline-flex; align-items: center; gap: 10px; border: 0; border-radius: var(--radius); padding: 12px 18px; font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; white-space: nowrap; }
.btn-primary { background: var(--orange); color: var(--coal); }
.btn-primary:hover { background: #F07328; color: var(--coal); }
.btn-dark { background: var(--coal); color: var(--cream); }
.btn-dark:hover { background: var(--coal-2); color: var(--cream); }
.btn-ghost { background: transparent; color: var(--cream); border: 1px solid var(--coal-line); }
.btn-danger { background: #FBE9E4; color: #8A2B0E; border: 1px solid #EBC0B0; }
.btn-danger:hover { background: #F6D9CF; color: #8A2B0E; }
.btn-outline { background: transparent; color: var(--ink); border: 1px solid var(--line); }

/* header */
.site-header { background: var(--coal); color: var(--cream); position: sticky; top: 0; z-index: 50; border-bottom: 1px solid var(--coal-line); }
.header-row { display: flex; align-items: center; gap: 28px; min-height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--cream); }
.brand img { width: auto; height: 40px; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name { font-size: 22px; font-weight: 800; }
.brand-sub { color: var(--muted); font-size: 9px; margin-top: 3px; }
.nav { display: flex; gap: 24px; margin-left: 12px; font-weight: 600; font-size: 15px; }
.nav a { color: var(--cream); padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a.is-active { border-bottom-color: var(--orange); color: var(--cream); }
.nav .count { font-size: 11px; background: var(--coal-line); color: var(--cream-2); padding: 2px 6px; border-radius: 3px; margin-left: 4px; }
.header-cta { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.hours { color: var(--muted); font-size: 14px; }
.nav-toggle { display: none; margin-left: auto; background: transparent; color: var(--cream); border: 1px solid var(--coal-line); border-radius: var(--radius); padding: 8px 12px; font: inherit; font-weight: 600; }
.mobile-nav { display: flex; flex-direction: column; gap: 4px; padding: 8px 20px 16px; border-top: 1px solid var(--coal-line); }
.mobile-nav[hidden] { display: none; }
.mobile-nav a { color: var(--cream); padding: 10px 0; font-weight: 600; border-bottom: 1px solid var(--coal-line); }
.mobile-nav a.btn { margin-top: 10px; justify-content: center; color: var(--coal); border-bottom: 0; }
@media (max-width: 960px) {
  .nav, .header-cta { display: none; }
  .nav-toggle { display: inline-block; }
}
@media (min-width: 961px) { .mobile-nav { display: none !important; } }

/* hero */
.hero { position: relative; background: var(--coal); color: var(--cream); overflow: hidden; min-height: 560px; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.hero-copy { padding: 64px 20px 64px max(20px, calc((100vw - var(--wrap)) / 2 + 20px)); display: flex; flex-direction: column; gap: 22px; justify-content: center; }
.hero h1 { font-size: clamp(48px, 7vw, 92px); font-weight: 800; }
.hero h1 span { color: var(--orange); }
.hero p { font-size: 19px; color: var(--cream-2); max-width: 46ch; margin: 0; }
.hero-media { position: relative; min-height: 320px; }
.hero-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--coal) 0%, rgba(20,18,15,.15) 30%, rgba(20,18,15,0) 60%); }
.hero-facts { display: flex; flex-wrap: wrap; gap: 8px 26px; font-size: 14px; color: var(--cream-2); }
.hero-facts span::before { content: "✓"; color: var(--orange); margin-right: 8px; }
.search-bar { display: flex; background: var(--paper); border-radius: var(--radius); overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,.35); max-width: 760px; }
.search-bar label { display: flex; flex-direction: column; gap: 2px; padding: 8px 16px; flex: 1 1 0; border-right: 1px solid var(--line-2); min-width: 0; }
.search-bar label .label { color: var(--ink-3); }
.search-bar select { border: 0; background: transparent; font: inherit; font-weight: 600; font-size: 15px; color: var(--ink); padding: 0; min-width: 0; }
.search-bar .btn { border-radius: 0; padding: 0 26px; }
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .hero-media { order: -1; min-height: 240px; }
  .hero-media::after { background: linear-gradient(180deg, rgba(20,18,15,0) 40%, var(--coal) 100%); }
  .hero-copy { padding: 28px 20px 48px; }
  .search-bar { flex-direction: column; }
  .search-bar label { border-right: 0; border-bottom: 1px solid var(--line-2); }
  .search-bar .btn { padding: 14px; justify-content: center; }
}

/* sections */
.section { padding: 56px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.section-head h2 { font-size: clamp(30px, 4vw, 44px); }
.section-head .label { color: var(--ink-3); display: block; margin-bottom: 6px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; }
.type-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.type-tile { background: var(--coal); color: var(--cream); padding: 26px 22px; border-radius: var(--radius); display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--coal-line); }
.type-tile:hover { border-color: var(--orange); color: var(--cream); }
.type-tile .display { font-size: 30px; }
.type-tile .mono { color: var(--muted); font-size: 13px; }
@media (max-width: 700px) { .type-tiles { grid-template-columns: 1fr; } }
.promise { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.promise div { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.promise h3 { font-size: 22px; margin-bottom: 6px; }
.promise p { color: var(--ink-2); font-size: 14px; margin: 0; }
@media (max-width: 900px) { .promise { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .promise { grid-template-columns: 1fr; } }

/* cards */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.card-media { position: relative; aspect-ratio: 4 / 3; background: var(--line-2); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.badge-video { position: absolute; right: 12px; bottom: 12px; background: rgba(20,18,15,.78); color: var(--cream); font: 600 11px "JetBrains Mono", Consolas, monospace; letter-spacing: .1em; text-transform: uppercase; padding: 5px 9px; border-radius: 4px; }
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 10px; }
.card-cat { color: var(--ink-3); margin: 0; }
.card-title { font-size: 24px; }
.card-title a { color: var(--ink); }
.card-specs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; margin: 0; font-size: 13px; color: var(--ink-2); border-top: 1px dashed var(--line); padding-top: 12px; }
.card-specs div { display: flex; justify-content: space-between; gap: 8px; }
.card-specs dt, .card-specs dd { margin: 0; }
.card-specs dd { color: var(--ink); font-weight: 600; }
.card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 6px; }
.card-price { font-size: 22px; font-weight: 600; }
.link-more { font-weight: 600; font-size: 14px; }

/* inventory */
.page-head { background: var(--coal); color: var(--cream); padding: 40px 0 34px; }
.page-head h1 { font-size: clamp(36px, 5vw, 64px); }
.page-head .label { color: var(--orange); display: block; margin-bottom: 8px; }
.page-head p { color: var(--cream-2); margin: 10px 0 0; max-width: 60ch; }
.inv-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 32px; padding: 32px 0 56px; }
.filters { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; align-self: start; position: sticky; top: 88px; display: flex; flex-direction: column; gap: 14px; }
.filters .field span { font-size: 12px; }
.filters .btn { justify-content: center; }
.filters .reset { font-size: 13px; text-align: center; }
.inv-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.inv-toolbar .mono { color: var(--ink-2); font-size: 14px; }
.inv-toolbar select { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chip { font-size: 13px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); }
.chip.is-active { background: var(--coal); color: var(--cream); border-color: var(--coal); }
.chips-more { flex-basis: 100%; }
.chips-more summary { display: inline-block; cursor: pointer; list-style: none; color: var(--ink-2); }
.chips-more summary::-webkit-details-marker { display: none; }
.chips-more[open] summary { background: var(--line-2); }
.filters-btn { display: none; }
.pager { display: flex; justify-content: center; gap: 8px; margin-top: 32px; }
.pager a, .pager span { padding: 8px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); color: var(--ink); }
.pager .is-active { background: var(--coal); color: var(--cream); border-color: var(--coal); }
.empty { background: var(--paper); border: 1px dashed var(--line); padding: 40px; text-align: center; border-radius: var(--radius); color: var(--ink-2); }
@media (max-width: 860px) {
  .inv-layout { grid-template-columns: 1fr; gap: 16px; padding-top: 20px; }
  .filters { position: static; display: none; }
  .filters-btn { display: inline-flex; justify-self: start; }
  .filters-toggle:checked ~ .filters { display: flex; }
  .filters-toggle:checked ~ .filters-btn { background: var(--coal); color: var(--cream); border-color: var(--coal); }
}

/* unit */
.unit-head { padding: 28px 0 18px; }
.crumbs { font-size: 13px; color: var(--ink-3); margin-bottom: 12px; }
.crumbs a { color: var(--ink-2); }
.unit-head h1 { font-size: clamp(32px, 4.5vw, 56px); }
.unit-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--ink-2); font-size: 14px; margin-top: 10px; }
.unit-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 32px; padding-bottom: 56px; align-items: start; }
.gallery-main { background: var(--coal); border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.gallery-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-top: 10px; }
.gallery-thumbs button { padding: 0; border: 2px solid transparent; border-radius: 4px; overflow: hidden; background: var(--line-2); cursor: pointer; aspect-ratio: 4 / 3; }
.gallery-thumbs button.is-active { border-color: var(--orange); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.video-embed { margin-top: 18px; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--coal); }
.video-embed iframe { width: 100%; height: 100%; border: 0; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 18px; }
.panel h2 { font-size: 26px; margin-bottom: 14px; }
.price-block .mono { font-size: 34px; font-weight: 600; display: block; }
.price-block small { color: var(--ink-3); font-size: 13px; }
.cta-stack { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.cta-stack .btn { justify-content: center; }
.cta-sub { text-align: center; font-size: 13px; color: var(--ink-3); }
.specs-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.specs-table th, .specs-table td { text-align: left; padding: 8px 0; border-bottom: 1px dashed var(--line); vertical-align: top; }
.specs-table th { color: var(--ink-2); font-weight: 500; width: 45%; }
.specs-table td { font-weight: 600; }
.desc { white-space: pre-line; font-size: 15px; }
.desc-panel { margin-top: 22px; }
.estimator { display: grid; gap: 12px; }
.estimator output { display: block; font-size: 30px; font-weight: 600; }
.estimator .field-row { gap: 10px; }
.est-note { font-size: 12px; color: var(--ink-3); margin: 0; }
.ask-panel { background: var(--coal); color: var(--cream); border-color: var(--coal-line); padding: 0; overflow: hidden; }
.ask-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 18px 20px 0; }
.ask-head h2 { color: var(--cream); margin: 0; font-size: 22px; }
.ask-stock { color: var(--muted); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.ask-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 14px 20px 0; padding: 4px; background: var(--coal-2); border: 1px solid var(--coal-line); border-radius: 8px; }
.ask-tabs [role=tab] { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 8px; border: 0; border-radius: 6px; background: transparent; color: var(--cream-2); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.ask-tabs [role=tab][aria-selected=true] { background: var(--orange); color: var(--coal); }
.ask-tabs [role=tab]:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.ask-pane { padding: 16px 20px 20px; }
.ask-pane[hidden] { display: none; }
.ask-form-intro { margin: 0 0 14px; color: var(--cream-2); font-size: 14px; }
.ask-panel .field span { color: var(--cream-2); }
.ask-panel .field input, .ask-panel .field textarea { background: var(--paper); border-color: var(--coal-line); }
.ask-panel .form-note { color: var(--muted); }
.ask-panel .lead-form .btn { align-self: stretch; justify-content: center; }
.ask-panel .lead-form textarea { min-height: 72px; }
.ask-panel .form-sent { background: var(--coal-2); color: var(--cream); border: 1px solid var(--coal-line); }
.ask-panel .form-sent a { color: var(--orange); }
@media (max-width: 960px) {
  /* Phone order: photo → price/CTAs → thumbnails → video → description → specs → Ask → estimator.
     The two columns dissolve (display: contents) so their children share one flow and can be re-ordered. */
  .unit-layout { grid-template-columns: 1fr; gap: 18px; }
  .unit-layout > div, .unit-layout > aside { display: contents; }
  .unit-layout .panel { margin: 0; }
  .gallery-main { order: 1; } .price-block { order: 2; } .gallery-thumbs { order: 3; margin-top: 0; } .video-embed { order: 4; }
  .desc-panel { order: 5; } .specs-panel { order: 6; } .ask-panel { order: 7; } .estimator-panel { order: 8; }
  .gallery-thumbs { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
  .gallery-thumbs button { flex: 0 0 88px; scroll-snap-align: start; }
}

/* forms */
.lead-form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 14px; flex: 1 1 0; min-width: 0; }
.field span { color: var(--ink-2); font-weight: 500; }
.field input, .field textarea, .field select { font: inherit; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); color: var(--ink); width: 100%; }
.field input:focus, .field textarea:focus, .field select:focus { outline: 2px solid var(--orange); outline-offset: 1px; border-color: var(--orange); }
.field-row { display: flex; gap: 14px; }
@media (max-width: 520px) { .field-row { flex-direction: column; } }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-note { font-size: 12px; color: var(--ink-3); margin: 0; }
.form-error { background: #FBE9E4; color: #8A2B0E; padding: 10px 12px; border-radius: var(--radius); margin: 0; }
.form-sent { background: var(--tint); padding: 18px; border-radius: var(--radius); }
.lead-form .btn { align-self: flex-start; }

/* static pages */
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; padding: 40px 0 56px; align-items: start; }
.two-col h2 { font-size: 30px; margin-bottom: 12px; }
.two-col ul { padding-left: 18px; color: var(--ink-2); }
.two-col li { margin-bottom: 6px; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }
.info-list { display: grid; gap: 14px; }
.info-list div { border-left: 3px solid var(--orange); padding-left: 12px; }
.info-list .label { color: var(--ink-3); }
.map { border: 0; width: 100%; height: 320px; border-radius: var(--radius); }

/* portal */
.portal-main { padding: 28px 20px 60px; }
.portal-warn { background: var(--tint); color: #8A3A0A; border: 1px solid #E8C7AE; border-left: 4px solid var(--orange); padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 14px; }
.portal-warn a { color: #8A3A0A; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.portal-login { max-width: 420px; margin: 60px auto; }
.portal-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.portal-head h1 { font-size: clamp(30px, 4vw, 44px); }
.portal-head .form-note { max-width: 70ch; margin: 6px 0 0; }
.portal-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 22px; align-items: start; }
@media (max-width: 960px) { .portal-grid { grid-template-columns: 1fr; } }
.table-wrap { overflow-x: auto; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.portal-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.portal-table th, .portal-table td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: middle; }
.portal-table th { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); font-family: "JetBrains Mono", Consolas, monospace; }
.portal-table .num { text-align: right; }
.portal-table .thumb img { border-radius: 4px; object-fit: cover; display: block; }
.portal-table .msg { max-width: 36ch; white-space: pre-line; }
.portal-table.compact td { padding: 6px 8px; }
.inv-table .flags .pill { text-decoration: none; margin: 2px 4px 2px 0; }
.inv-table .vid { color: var(--orange-ink); font-size: 12px; margin-left: 6px; }
@media (max-width: 760px) {
  /* Phone: each row becomes a card; cells label themselves from data-l. */
  .inv-table, .inv-table tbody, .inv-table tr, .inv-table td { display: block; }
  .inv-table thead { display: none; }
  .inv-table tr { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 8px; }
  .inv-table td { border: 0; padding: 4px 0; text-align: left !important; display: flex; justify-content: space-between; gap: 12px; }
  .inv-table td[data-l]::before { content: attr(data-l); color: var(--ink-3); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; font-family: "JetBrains Mono", Consolas, monospace; flex: none; padding-top: 3px; }
  .inv-table td.thumb { display: none; }
  .inv-table td:empty { display: none; }
  .inv-table td.flags { justify-content: flex-end; flex-wrap: wrap; }
}
.pill { display: inline-block; font: 600 11px "JetBrains Mono", Consolas, monospace; letter-spacing: .08em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: var(--line-2); color: var(--ink-2); }
.pill.ok { background: #DCEFD8; color: #1F5E1B; }
.pill.warn { background: var(--tint); color: #8A3A0A; }
.pill.bad { background: #FBE9E4; color: #8A2B0E; }
.pill.dim { background: var(--line-2); color: var(--ink-3); }
.desc-editor { font: inherit; font-size: 15px; line-height: 1.55; width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); resize: vertical; }
.source-text { background: var(--bg); padding: 12px; border-radius: var(--radius); font-size: 14px; color: var(--ink-2); max-height: 220px; overflow: hidden; position: relative; }
.source-text::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 56px; background: linear-gradient(transparent, var(--bg)); }
.source-toggle:checked ~ .source-text { max-height: none; }
.source-toggle:checked ~ .source-text::after { display: none; }
.source-more { display: inline-block; margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--orange-ink); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.source-more .less, .source-toggle:checked ~ .source-more .more { display: none; }
.source-toggle:checked ~ .source-more .less { display: inline; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.thumb-row { display: flex; gap: 8px; }
.thumb-row img { border-radius: 4px; object-fit: cover; }
.alert-signup { margin-top: 28px; }
button.link-more { background: none; border: 0; padding: 0; font: inherit; color: var(--orange-ink); cursor: pointer; font-weight: 600; }

/* fab + footer */
.ask-fab { position: fixed; right: 20px; bottom: 20px; display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 20px 0 16px; border-radius: 999px; background: var(--coal); color: var(--cream); font-weight: 700; font-size: 15px; box-shadow: 0 10px 30px rgba(20,18,15,.35); border: 1px solid var(--coal-line); z-index: 40; }
.ask-fab:hover { color: var(--cream); border-color: var(--orange); }
.site-footer { background: var(--coal); color: var(--muted); padding: 56px 0 40px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.footer-grid > div { display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.footer-grid a { color: var(--cream); }
.footer-grid address { font-style: normal; color: var(--cream); }
.footer-brand { color: var(--cream); font-size: 28px; font-weight: 800; }
.footer-grid p { max-width: 32ch; margin: 0; }
.footer-bottom { display: flex; justify-content: space-between; gap: 24px; border-top: 1px solid var(--coal-line); margin-top: 36px; padding-top: 20px; font-size: 12px; flex-wrap: wrap; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } .ask-fab { bottom: 14px; right: 14px; width: 52px; padding: 0; justify-content: center; border-radius: 50%; } .ask-fab span { display: none; } }
@media (max-width: 960px) { .site-footer { padding-bottom: 96px; } }

/* Portal sync progress (fed by /portal/sync-status) */
.sync-progress { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; }
.sync-progress[hidden] { display: none; }   /* an author display: beats the UA [hidden] rule — must be explicit */
.sync-bar { width: 240px; height: 10px; background: var(--cream-2); border: 1px solid var(--line); flex: none; }
.sync-fill { height: 100%; width: 0; background: var(--orange); transition: width .6s ease; }

/* Unit page: share / print actions */
.unit-actions { display: flex; gap: 8px; margin-top: 12px; }
.unit-actions .btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; font-size: 13px; }

/* Print: a clean spec sheet — photo, title, price, description, specs, dealer contact */
@media print {
  .site-header, .site-footer, .mobile-nav, .crumbs, .unit-actions, .gallery-thumbs, .video-embed,
  .ask-panel, .cta-stack, .no-print, .section, .skip-link { display: none !important; }
  body { background: #fff; color: #000; }
  .wrap { max-width: none; padding: 0; }
  .unit-layout { display: block; }
  .gallery-main img { max-width: 480px; height: auto; }
  .panel, .price-block { border: none; box-shadow: none; padding: 0 0 14px; background: none; }
  a { color: inherit; text-decoration: none; }
}
.print-only { display: none; }
@media print { .print-only { display: block; font-size: 13px; } }

/* Portal settings tabs (server-rendered: /portal/settings/{tab}) */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin: 0 0 22px; flex-wrap: wrap; }
.tabs a { padding: 10px 18px; margin-bottom: -2px; border-bottom: 2px solid transparent; text-decoration: none; color: var(--ink-2); font-weight: 600; letter-spacing: .02em; }
.tabs a:hover { color: var(--ink); }
.tabs a.is-active { color: var(--ink); border-bottom-color: var(--orange); }
.settings-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.settings-grid .panel { margin: 0; }
@media (max-width: 900px) { .settings-grid { grid-template-columns: 1fr; } }

/* Unit page: AI assistant chat */
.chat { display: flex; flex-direction: column; gap: 10px; }
.chat-log { min-height: 120px; max-height: 300px; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 8px; padding: 12px; background: var(--coal-2); border: 1px solid var(--coal-line); border-radius: 10px; scrollbar-width: thin; scrollbar-color: var(--coal-line) transparent; }
.chat-msg { max-width: 88%; padding: 9px 12px; border-radius: 14px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-msg.bot { background: var(--paper); color: var(--ink); align-self: flex-start; border-bottom-left-radius: 4px; }
.chat-msg.user { background: var(--orange); color: var(--coal); align-self: flex-end; border-bottom-right-radius: 4px; }
.chat-msg.note { background: transparent; color: var(--muted); font-size: 13px; padding: 2px 4px; align-self: center; text-align: center; max-width: 100%; }
.chat-msg.typing { opacity: .6; }
.chat-starters { display: flex; flex-wrap: wrap; gap: 6px; }
.chat-starters button { border: 1px solid var(--coal-line); background: transparent; color: var(--cream-2); font: inherit; font-size: 13px; padding: 7px 11px; border-radius: 999px; cursor: pointer; }
.chat-starters button:hover { border-color: var(--orange); color: var(--cream); }
.chat-form { display: flex; align-items: center; gap: 6px; padding: 4px 4px 4px 14px; background: var(--paper); border: 1px solid var(--coal-line); border-radius: 999px; }
.chat-form:focus-within { outline: 2px solid var(--orange); outline-offset: 1px; }
.chat-form input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 15px; padding: 8px 0; }
.chat-form input:focus { outline: none; }
.chat-send { flex: none; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--orange); color: var(--coal); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.chat-send:hover { background: #F07328; }
.chat-send:disabled { opacity: .5; cursor: default; }
.chat-foot { margin: 0; font-size: 12px; color: var(--muted); }
.chat-foot a { color: var(--cream-2); white-space: nowrap; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--orange); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.chat-ended .chat-form, .chat-ended .chat-starters { display: none; }
@media (max-width: 960px) { .chat-log { max-height: min(52vh, 420px); } .chat-msg { font-size: 15px; } .chat-form input { font-size: 16px; } }

/* Portal: VIN check + transcripts */
.vin-findings { margin: 8px 0 12px; padding-left: 18px; font-size: 14px; }
.vin-findings li.mismatch { color: var(--orange-ink); font-weight: 600; }
.vin-findings li.note { color: var(--ink-2); }
.vin-decode th { width: 34%; color: var(--ink-3); font-weight: 600; }
.transcript { margin-top: 8px; max-width: 520px; }
.transcript p { margin: 0 0 8px; font-size: 13px; }
.transcript p.assistant { color: var(--ink-2); }

/* Portal: leads workspace */
.tab-count { display: inline-block; min-width: 20px; padding: 1px 6px; margin-left: 4px; border-radius: 999px; background: var(--line-2); color: var(--ink-2); font: 600 11px "JetBrains Mono", Consolas, monospace; text-align: center; }
.tabs a.is-active .tab-count { background: var(--orange); color: var(--coal); }
.btn-sm { padding: 8px 12px; font-size: 13px; }
.copy-row { display: flex; gap: 6px; }
.copy-row input { flex: 1; min-width: 0; }
.lead-list { display: flex; flex-direction: column; gap: 8px; }
.lead-row { display: flex; gap: 16px; align-items: flex-start; background: var(--paper); border: 1px solid var(--line); border-left: 4px solid transparent; border-radius: var(--radius); padding: 14px 16px; }
.lead-row.is-new { border-left-color: var(--orange); }
.lead-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.lead-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lead-name { font-size: 17px; font-weight: 700; color: var(--ink); }
.is-new .lead-name { color: var(--ink); }
.lead-age { margin-left: auto; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.lead-contact { display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; }
.lead-contact a { font-weight: 600; }
.lead-contact .lead-unit { font-weight: 500; color: var(--ink-2); }
.lead-msg { margin: 0; font-size: 14px; color: var(--ink-2); white-space: pre-line; }
.lead-note { margin: 0; font-size: 13px; color: var(--ink-3); }
.lead-note b { color: var(--ink-2); font-weight: 600; }
.lead-actions { display: flex; gap: 8px; flex: none; align-items: center; }
.lead-actions form { margin: 0; }
.lead-cta { display: flex; gap: 8px; flex-wrap: wrap; }
.lead-message { white-space: pre-line; font-size: 15px; background: var(--bg); padding: 12px 14px; border-radius: var(--radius); }
.status-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.status-steps form { margin: 0; }
.status-step { width: 100%; display: flex; flex-direction: column; gap: 2px; padding: 10px 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); font: inherit; text-align: left; cursor: pointer; color: var(--ink-2); }
.status-step b { color: var(--ink); font-size: 14px; }
.status-step span { font-size: 11px; line-height: 1.3; }
.status-step:hover { border-color: var(--ink-3); }
.status-step.is-current { background: var(--coal); border-color: var(--coal); color: var(--cream-2); }
.status-step.is-current b { color: var(--cream); }
.note-form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.note-form textarea { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); width: 100%; resize: vertical; }
.note-form textarea:focus { outline: 2px solid var(--orange); outline-offset: 1px; border-color: var(--orange); }
.note-form-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 16px; border-left: 2px solid var(--line-2); display: flex; flex-direction: column; gap: 14px; }
.timeline li { position: relative; }
.timeline li::before { content: ""; position: absolute; left: -21px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); }
.tl-meta { font-size: 12px; color: var(--ink-3); margin-bottom: 2px; }
.tl-text { font-size: 14px; white-space: pre-line; }
.sub { font-size: 15px; margin: 18px 0 8px; display: flex; justify-content: space-between; align-items: baseline; }
.convo { display: flex; flex-direction: column; gap: 8px; padding: 12px; background: var(--bg); border-radius: var(--radius); max-height: 460px; overflow-y: auto; }
.convo-full { max-height: none; padding: 20px; }
.convo-msg { max-width: 85%; padding: 9px 12px; border-radius: 14px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.convo-msg.assistant { background: var(--paper); border: 1px solid var(--line-2); align-self: flex-start; border-bottom-left-radius: 4px; }
.convo-msg.user { background: var(--coal); color: var(--cream); align-self: flex-end; border-bottom-right-radius: 4px; }
.convo-who { display: block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; opacity: .6; margin-bottom: 3px; }
.convo-panel { padding: 0; overflow: hidden; }
@media (max-width: 700px) { .lead-row { flex-direction: column; } .lead-actions { width: 100%; } .lead-actions .btn { flex: 1; justify-content: center; } .status-steps { grid-template-columns: 1fr 1fr; } .convo-msg { max-width: 95%; } }

/* Portal: sync history */
.sync-row .lead-name { font-size: 16px; }
.sync-changes { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.sync-changes li { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.sync-diffs { color: var(--ink-2); font-size: 13px; }
