/* Lotcross client app. Phone first: one column, nothing wider than the screen, no horizontal scroll
   at 375px. Lotcross brand only (asphalt, sign yellow, paper); system fonts, nothing loaded from
   anywhere else. Logical properties (inline-start/end) so Persian and Arabic lay out right to left (lane
   watch-i18n); figures inside RTL text are <bdi>. */
:root {
  --paper: #F4F5F2; --card: #FFFFFF; --ink: #22272B; --ink-2: #4A535A; --rule: #D3D7D3; --soft: #E9EBE8;
  --asphalt: #22272B; --on-dark: #F4F5F2; --sign: #F3C318; --sign-soft: #FDF6D8;
  --ok: #1C6A42; --ok-bg: #E3F1E7; --wait: #734D00; --wait-bg: #FDF0C4; --stop: #9E261B; --stop-bg: #FAE4E0;
  --info: #1F4E8C; --info-bg: #E4EDF8;
  --f: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.5 var(--f); overflow-wrap: anywhere; }
a { color: var(--info); }
.skip { position: absolute; inset-inline-start: -999px; }
.skip:focus { inset-inline-start: 0.5rem; top: 0.5rem; background: var(--card); padding: 0.5rem; z-index: 2; }
.top { background: var(--asphalt); color: var(--on-dark); padding: 0.75rem 1rem; }
.top .brand { font-weight: 800; letter-spacing: 0.02em; color: var(--on-dark); text-decoration: none; }
.top .brand span { background: var(--sign); color: var(--asphalt); padding: 0 0.3rem; border-radius: 4px; margin-inline-start: 0.25rem; }
.top form { display: inline; margin: 0; }
.wrap { max-width: 44rem; margin: 0 auto; padding: 1rem; }
h1 { font-size: 1.5rem; line-height: 1.25; margin: 0.5rem 0 0.75rem; }
h2 { font-size: 1.15rem; margin: 1.5rem 0 0.5rem; }
.card { background: var(--card); border: 1px solid var(--rule); border-radius: 12px; padding: 0.9rem 1rem; margin: 0 0 0.75rem; }
.card h3 { margin: 0 0 0.25rem; font-size: 1.05rem; }
.muted { color: var(--ink-2); }
.small { font-size: 0.9rem; }
.stats { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.5rem 0; padding: 0; list-style: none; }
.stats li { background: var(--soft); border-radius: 8px; padding: 0.35rem 0.6rem; }
.pill { display: inline-block; border-radius: 999px; padding: 0.1rem 0.6rem; font-size: 0.85rem; background: var(--soft); }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.wait { background: var(--wait-bg); color: var(--wait); }
.pill.stop { background: var(--stop-bg); color: var(--stop); }
.banner { border-radius: 8px; padding: 0.6rem 0.8rem; margin: 0 0 1rem; }
.banner.warn { background: var(--stop-bg); color: var(--stop); }
.banner.ok { background: var(--ok-bg); color: var(--ok); }
.banner.info { background: var(--info-bg); color: var(--info); }
label { display: block; font-weight: 600; margin: 0.75rem 0 0.25rem; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=search], textarea, select {
  width: 100%; max-width: 100%; font: inherit; padding: 0.6rem 0.7rem; border: 1px solid var(--rule); border-radius: 8px; background: var(--card); color: var(--ink);
}
fieldset { border: 1px solid var(--rule); border-radius: 8px; margin: 0.75rem 0; padding: 0.5rem 0.75rem; }
fieldset label { font-weight: 400; margin: 0.35rem 0; }
button, .button { display: inline-block; font: inherit; font-weight: 700; min-height: 2.75rem; padding: 0.55rem 1.1rem; border-radius: 8px;
  border: 0; background: var(--sign); color: var(--asphalt); cursor: pointer; text-decoration: none; }
button.secondary { background: transparent; color: inherit; border: 1px solid currentColor; min-height: 2.25rem; padding: 0.3rem 0.8rem; font-weight: 600; }
.actions { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 0.4rem 0; border-bottom: 1px solid var(--soft); }
.code { font-size: 1.6rem; letter-spacing: 0.2em; text-align: center; }
footer.foot { max-width: 44rem; margin: 1rem auto 2rem; padding: 0 1rem; color: var(--ink-2); font-size: 0.85rem; }
input[type=date] { width: 100%; max-width: 100%; font: inherit; padding: 0.6rem 0.7rem; border: 1px solid var(--rule); border-radius: 8px; background: var(--card); color: var(--ink); }
label input[type=checkbox] { margin-inline-end: 0.4rem; }
.consent { background: var(--sign-soft); border-radius: 8px; padding: 0.5rem 0.75rem; margin: 0.75rem 0; }
label.check { font-weight: 600; display: flex; gap: 0.5rem; align-items: flex-start; }
label.check input[type=checkbox] { margin-inline-end: 0; }
input[type=file] { max-width: 100%; font: inherit; }
ul.report li { padding: 0.5rem 0; }
/* Market pages (watch-client-analytics): server-rendered SVG charts with their numbers in a table beside them. */
.picker { display: flex; flex-wrap: wrap; gap: 0.4rem 0.8rem; margin: 0 0 1rem; }
.picker a[aria-current="page"] { font-weight: 700; text-decoration-color: var(--sign); text-decoration-thickness: 3px; }
form.period { display: flex; flex-wrap: wrap; align-items: end; gap: 0.5rem; margin: 0.5rem 0 1rem; }
form.period label { margin: 0; width: 100%; }
form.period select { width: auto; flex: 1 1 10rem; }
.legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; margin: 0 0 0.75rem; font-size: 0.9rem; }
.legend span { display: inline-flex; align-items: center; gap: 0.35rem; }
.chart-box { width: 100%; max-width: 100%; }
svg.chart { display: block; max-width: 100%; height: auto; }
details summary { cursor: pointer; margin: 0.5rem 0; color: var(--info); }
ul.numbers li { display: flex; flex-wrap: wrap; gap: 0.25rem 0.6rem; align-items: baseline; }
.cell { border-top: 1px solid var(--soft); padding: 0.5rem 0 0.25rem; }
.cell h4 { margin: 0 0 0.25rem; font-size: 1rem; }
/* lane watch-car-filters: the shared car filter form (lotcross_watch/carfilter_templates/_car_filters.html), the
   desk's small `filters` rule set in this app's spacing. One column at phone width, inputs at least 44px tall. */
.filters { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.2rem 0.75rem; align-items: end; }
@media (min-width: 40rem) { .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.filters label { margin-top: 0.3rem; }
.filters input[type=text], .filters select { box-sizing: border-box; min-height: 2.75rem; }
.filters .actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 0.5rem; }
.filters .button.secondary { background: transparent; color: inherit; border: 1px solid currentColor; font-weight: 600; }
/* lane watch-i18n: system-font fallbacks per script (the Latin stack has
   no Armenian, Arabic, Persian, Korean or Chinese glyphs on some systems). Latin typography is unchanged. */
bdi, code { unicode-bidi: isolate; }
html:lang(ar), html:lang(fa) { --f: system-ui, -apple-system, "Segoe UI", Tahoma, "Geeza Pro", "Noto Naskh Arabic", "Noto Sans Arabic", Arial, sans-serif; }
html:lang(hy) { --f: system-ui, -apple-system, "Segoe UI", "Noto Sans Armenian", Mshtakan, Sylfaen, Arial, sans-serif; }
html:lang(ko) { --f: system-ui, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", "Noto Sans CJK KR", sans-serif; }
html:lang(zh-Hans) { --f: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Noto Sans CJK SC", sans-serif; }
/* messages (sql/0053): a plain list, the reader's own side set off by its edge; logical properties so it mirrors
   on right-to-left pages; long words wrap so nothing scrolls sideways at 375px */
.msgs, .msg-inbox { list-style: none; padding: 0; margin: 0 0 1rem; }
.msg { background: var(--card); border: 1px solid var(--rule); border-radius: 12px; padding: 0.6rem 0.8rem; margin: 0 0 0.6rem; }
.msg.mine { border-inline-start: 4px solid var(--sign); background: var(--sign-soft); }
.msg-who { margin: 0 0 0.25rem; }
.msg-text { margin: 0 0 0.25rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg details p { margin: 0.25rem 0 0; }

/* ===== Help center (lane watch-help-docs): /help, client/templates/help_*.html. Everything below is the help
   center's own; no rule above is changed. No script: the phone drawer is the checkbox .help-toc-toggle, the section a
   reader jumped to is shown with :target. One column at 375px; the sidebar sits on the left from 56rem up. */
.help-top { position: sticky; top: 0; z-index: 3; }
.help-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; max-width: 72rem; margin: 0 auto; }
.help-find { display: flex; flex: 1 1 16rem; gap: 0.4rem; align-items: center; margin: 0; }
.help-find input[type=search] { flex: 1 1 auto; min-width: 0; padding: 0.4rem 0.6rem; }
.help-find button.secondary { color: var(--on-dark); }
.help-find-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.help-back { color: var(--on-dark); margin-left: auto; }
.help-layout { max-width: 72rem; margin: 0 auto; padding: 0 1rem; }
.help-toc-toggle { position: absolute; opacity: 0; width: 1px; height: 1px; }
.help-toc-button { display: inline-block; margin: 0.75rem 0 0; padding: 0.35rem 0.8rem; border: 1px solid var(--rule);
  border-radius: 8px; background: var(--card); font-weight: 700; cursor: pointer; }
.help-toc-toggle:focus-visible + .help-toc-button { outline: 3px solid var(--sign); }
.help-toc { display: none; background: var(--card); border: 1px solid var(--rule); border-radius: 12px; padding: 0.5rem 1rem;
  margin: 0.5rem 0 0; }
.help-toc-toggle:checked ~ .help-toc { display: block; }
.help-toc ul { list-style: none; margin: 0; padding: 0; }
.help-toc ul ul { padding-inline-start: 0.9rem; border-inline-start: 2px solid var(--soft); margin: 0.2rem 0 0.4rem; font-size: 0.92rem; }
.help-toc li { padding: 0.15rem 0; }
.help-toc a { text-decoration: none; }
.help-toc a:hover, .help-toc a:focus { text-decoration: underline; }
.help-toc a[aria-current="page"] { font-weight: 700; color: var(--ink); }
.help-toc-group { margin: 0.75rem 0 0.25rem; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-2); }
.help-toc-home { margin: 0.25rem 0; }
.help-main { min-width: 0; padding: 1rem 0 2rem; }
.help-main h1 { margin-top: 0.25rem; }
.help-section { scroll-margin-top: 6rem; border-top: 1px solid var(--rule); margin-top: 1.5rem; padding-top: 0.25rem; }
.help-section:target { background: var(--sign-soft); border-inline-start: 4px solid var(--sign); padding: 0.25rem 0.75rem 0.5rem;
  border-start-end-radius: 8px; border-end-end-radius: 8px; }
.help-anchor { color: inherit; text-decoration: none; }
.help-anchor:hover, .help-anchor:focus { text-decoration: underline; }
.help-steps li { margin: 0.25rem 0; }
.help-see { background: var(--info-bg); color: var(--info); border-radius: 8px; padding: 0.5rem 0.75rem; }
.help-shot { margin: 0.75rem 0 1rem; }
.help-shot img { display: block; max-width: 100%; height: auto; border: 1px solid var(--rule); border-radius: 8px; background: var(--card); }
.help-shot figcaption { font-size: 0.88rem; color: var(--ink-2); margin-top: 0.3rem; }
.help-results li { padding: 0.6rem 0; }
@media (min-width: 56rem) {
  .help-layout { display: grid; grid-template-columns: 16rem minmax(0, 1fr); gap: 0 2rem; align-items: start; }
  .help-toc-button { display: none; }
  .help-toc { display: block; position: sticky; top: 4.5rem; max-height: calc(100vh - 5.5rem); overflow-y: auto; margin-top: 1rem; }
  .help-main { max-width: 46rem; }
}
/* ===== lane watch-deal-next-step (Neo 2026-10-19): the deal page's "Your next step" card, its "All steps" checklist
   (client/templates/_deal_next.html, _deal_steps.html) and the seller's three answer buttons (_trade.html,
   trade_offer_answer.html). Logical properties so the right-to-left languages mirror it. */
.deal-next { border: 2px solid var(--ok); background: var(--ok-bg); }
.deal-next.waiting { border-color: var(--rule); background: var(--card); }
.deal-next h2 { margin: 0.1rem 0 0.4rem; font-size: 1.2rem; }
.deal-next p { margin: 0.3rem 0; }
.deal-next-label { margin: 0; font-weight: 600; color: var(--ok); text-transform: uppercase; letter-spacing: 0.04em; }
.deal-next.waiting .deal-next-label { color: var(--ink-2); }
.deal-next form { margin: 0; }
.deal-next .actions { margin-top: 0.6rem; }
.deal-steps { list-style: none; padding: 0; margin: 0 0 1rem; border: 1px solid var(--rule); border-radius: 12px;
  background: var(--card); }
.deal-step { padding: 0.55rem 0.9rem; border-top: 1px solid var(--soft); }
.deal-step:first-child { border-top: 0; }
.deal-step.now { border-inline-start: 4px solid var(--ok); background: var(--ok-bg); }
.deal-step p, .deal-step ul { margin: 0.2rem 0; }
.deal-step details summary { margin: 0; color: var(--ink-2); }
.deal-step-state { font-size: 0.85rem; color: var(--ink-2); }
.deal-step-state.ok { color: var(--ok); font-weight: 600; }
.answer-buttons { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.6rem; }
.answer-buttons .button { flex: 1 1 6rem; text-align: center; text-decoration: none; }
.answer-buttons .button.secondary { background: transparent; color: inherit; border: 1px solid currentColor; font-weight: 600; }
.answer-reasons { border: 0; padding: 0; margin: 0 0 0.5rem; }
.answer-reasons label { display: block; margin: 0.35rem 0; }
@media (max-width: 30rem) { .answer-buttons { flex-direction: column; } }
/* ===== end lane watch-deal-next-step */

/* Listing photos (lane watch-listing-photos, sql/0061): the seller's block, the cover on a car card and the car page's
   strip. No script: the strip is CSS scroll-snap inside its own box, so the page itself never scrolls sideways; where
   scroll-snap is not supported the photos stack. */
.lx-photo-list { list-style: none; margin: 0.75rem 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); gap: 0.75rem; }
.lx-photo { min-width: 0; }
.lx-photo img, .lx-photo-tile { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; border: 1px solid var(--rule); background: var(--soft); }
.lx-photo-tile { display: flex; align-items: center; justify-content: center; text-align: center; padding: 0.5rem; color: var(--ink-2); font-size: 0.9rem; }
.lx-photo-tile.warn { background: var(--stop-bg); color: var(--stop); }
.lx-photo .actions { margin-top: 0.4rem; gap: 0.35rem; }
.lx-photo .actions form { margin: 0; }
.lx-photo .actions button { min-height: 2.75rem; }
.lx-photo-add input[type="file"] { max-width: 100%; }
/* inside the List a car and confirm forms: the block sits in the form's card, and its Enter-key default button is unseen */
.card .lx-photos { border: 0; box-shadow: none; padding: 0; margin: 1rem 0; }
.lx-default { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; padding: 0; }
.lx-car-card .lx-cover { display: block; margin: -0.9rem -1rem 0.6rem; }
/* a short band on the card: the whole photo, letterboxed on the same light gray as the cleaned photo's own backdrop */
.lx-cover img { display: block; width: 100%; height: 13rem; object-fit: contain; border-start-start-radius: 12px; border-start-end-radius: 12px; background: #ecedef; }
.lx-gallery { margin: 0 0 0.75rem; }
.lx-gallery h2 { margin: 0 0 0.35rem; font-weight: 600; }
.lx-strip { display: flex; gap: 0.5rem; margin: 0; padding: 0; list-style: none; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.lx-strip li { flex: 0 0 100%; scroll-snap-align: center; min-width: 0; }
.lx-strip img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; background: var(--soft); }
@supports not (scroll-snap-type: x mandatory) {
  .lx-strip { display: block; overflow: visible; }
  .lx-strip li { margin-bottom: 0.5rem; }
  .lx-swipe { display: none; }
}

/* watch-client-shell: layout and nav (Neo 2026-10-19). One <nav class="tabs"> is the whole menu: a fixed bar at the bottom of
   a phone, a row in the top bar on a wide screen. No script, no inline style: a media query, logical properties (so it
   mirrors in Persian and Arabic) and the device's bottom inset. */
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
.top-actions { display: flex; align-items: center; gap: 0.75rem; margin-inline-start: auto; }
.top-actions .more-link { color: var(--on-dark); min-height: 2.75rem; display: inline-flex; align-items: center; padding: 0 0.25rem; }
.top-actions a[aria-current="page"], nav.tabs a[aria-current="page"] { font-weight: 700; }
.top .secondary { color: var(--on-dark); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
nav.tabs { display: flex; }
nav.tabs a { color: var(--on-dark); text-decoration: none; display: flex; align-items: center; justify-content: center; gap: 0.3rem;
  min-height: 2.75rem; padding: 0 0.6rem; border-radius: 8px; }
nav.tabs a[aria-current="page"] { background: var(--sign); color: var(--asphalt); }
.tab-count { background: var(--stop); color: #fff; border-radius: 999px; font-size: 0.75rem; font-weight: 700; line-height: 1; padding: 0.2rem 0.4rem; min-width: 1.25rem; text-align: center; }
nav.tabs a[aria-current="page"] .tab-count { background: var(--asphalt); }
.more-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.more-list li { border-bottom: 1px solid var(--soft); }
.more-list a { display: flex; align-items: center; min-height: 3rem; padding: 0.4rem 0.25rem; font-weight: 600; text-decoration: none; }
form.lang { margin: 0 0 1rem; }
ul.langs { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; margin: 0.35rem 0; padding: 0; }
ul.langs button { min-height: 2.75rem; }
ul.langs button[aria-pressed="true"] { background: var(--sign); color: var(--asphalt); border-color: var(--sign); }
.more-out { margin: 1.5rem 0; }
.orient { margin: 0 0 1rem; }
.foot .lang-link { margin: 0 0 0.5rem; }
@media (max-width: 47.99rem) {
  body.has-tabs { padding-bottom: calc(4rem + env(safe-area-inset-bottom)); }
  nav.tabs { position: fixed; inset-inline: 0; bottom: 0; z-index: 5; background: var(--asphalt); border-top: 1px solid var(--ink-2);
    padding: 0.25rem 0.25rem calc(0.25rem + env(safe-area-inset-bottom)); gap: 0.25rem; }
  nav.tabs a { flex: 1 1 0; min-width: 0; flex-direction: column; gap: 0.1rem; padding: 0.25rem 0.1rem; min-height: 3rem; font-size: 0.78rem; text-align: center; position: relative; }
  .tab-label { overflow-wrap: anywhere; line-height: 1.15; }
  .tab-count { position: absolute; top: 0.1rem; inset-inline-end: 0.2rem; }
}
@media (min-width: 48rem) {
  nav.tabs { gap: 0.25rem; margin-inline-start: 1rem; }
  .top-actions { gap: 1rem; }
}

/* Sell one tap (lane watch-sell-one-tap): the confirm screen's facts and the per-car "Sell to dealers" line */
.sell-confirm h2 { margin-top: 0; }
.sell-confirm .facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.3rem 1rem; margin: 0 0 1rem; }
.sell-confirm .facts dt { color: var(--ink-2); }
.sell-confirm .facts dd { margin: 0; overflow-wrap: anywhere; }
.sell-to-dealers { margin: 0.5rem 0 0; }

/* lane watch-buy-first (Neo 2026-10-19, cars first): the car filters behind ONE closed "Filter" control on a single line
   with what is active and Clear, so the first car shows on a phone without scrolling past a form; and the one-tap
   keep page of a reminder email. No script: details/summary only. */
.cf-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0 0 0.75rem; }
.cf-bar .cf-control { flex: 0 0 auto; }
.cf-bar .cf-control[open] { flex: 1 1 100%; order: 3; }
.cf-bar .cf-control > summary { display: inline-flex; align-items: center; min-height: 2.75rem; margin: 0; padding: 0.3rem 1rem;
  border: 1px solid currentColor; border-radius: 8px; color: var(--info); font-weight: 700; list-style: none; }
.cf-bar .cf-control > summary::-webkit-details-marker { display: none; }
.cf-bar .cf-control > summary::after { content: ""; display: inline-block; width: 0.45rem; height: 0.45rem; margin-inline-start: 0.5rem;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-0.15rem) rotate(45deg); }
.cf-bar .cf-control[open] > summary::after { transform: translateY(0.1rem) rotate(-135deg); }
.cf-bar .cf-control > .filters { margin: 0.5rem 0 0; }
.cf-bar .cf-now { flex: 1 1 0; min-width: 0; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1;
  line-clamp: 1; overflow: hidden; color: var(--ink-2); }
.cf-bar > .button.secondary { flex: 0 0 auto; background: transparent; color: inherit; border: 1px solid currentColor; font-weight: 600;
  padding: 0.55rem 0.9rem; }
.keep { text-align: center; }
.keep .keep-what { font-size: 1.15rem; }
.keep form { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; margin: 1.25rem 0 0; }
.keep .keep-yes { min-height: 3.5rem; font-size: 1.15rem; width: 100%; max-width: 22rem; }
.keep .keep-no { width: 100%; max-width: 22rem; }

/* the demo copy's ribbon (lane watch-client-demo, LOTCROSS_CLIENT_DEMO_RIBBON): in the page flow above the top bar, so it
   never covers the header or the phone tab bar; production sets no ribbon and renders none */
.demo-ribbon { margin: 0; padding: 0.35rem 1rem; background: var(--sign); color: var(--asphalt); font-weight: 700;
  font-size: 0.9rem; text-align: center; border-bottom: 2px solid var(--asphalt); overflow-wrap: anywhere; }
