/* Legal pages: same tokens as index.html, reading layout */
:root {
  --bg: #FFFFFF; --surface: #FFFFFF; --ink: #0D1B2E; --muted: #5A6577; --line: #D8DEE8;
  --accent: #D9480F; --accent-strong: #C2410C; --accent-text: #A8360A; --steel: #1F3A5F; --steel-ink: #FFFFFF; --chip: #E8EDF5;
  --ok: #1B7F4B; --ok-text: #146B3E; --danger: #B42318; --accent-ink: #FFFFFF;
  color-scheme: light;   /* always light, even when the device is in dark mode */
  --display: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --body: "IBM Plex Sans", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.65; }
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
a { color: var(--ink); text-underline-offset: 3px; }
.wrap { max-width: 760px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

header { background: var(--surface); border-bottom: 1px solid var(--line); }
header .wrap { max-width: 1200px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 14px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 800; font-stretch: 112%; font-size: 1.15rem; color: var(--ink); text-decoration: none; }
.logo svg { width: 38px; height: 22px; flex: none; }
.logo .us { color: var(--accent-strong); }

main { padding-block: 40px 56px; }
.draft { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent-text); border-radius: 8px; padding: 12px 14px; font-weight: 600; font-size: 0.92rem; margin: 0 0 20px; }
.only { color: var(--muted); font-size: 0.92rem; margin: 0 0 20px; }
h1 { font-family: var(--display); font-weight: 850; font-stretch: 80%; font-size: clamp(2rem, 6vw, 2.8rem); line-height: 1.05; margin: 0 0 8px; text-wrap: balance; }
.updated { color: var(--muted); margin: 0 0 32px; font-size: 0.92rem; }
h2 { font-family: var(--display); font-weight: 800; font-stretch: 85%; font-size: 1.35rem; line-height: 1.2; margin: 36px 0 8px; }
p, li { max-width: 68ch; }
ul { padding-inline-start: 22px; }
li + li { margin-top: 4px; }
.todo { background: var(--chip); border: 1px dashed var(--accent-strong); border-radius: 4px; padding: 0 4px; font-weight: 600; }
address { font-style: normal; }
.back { display: inline-block; margin-top: 40px; font-weight: 600; }

footer { border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 0.88rem; padding-block: 24px; }
footer .wrap { max-width: 1200px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
footer a { color: inherit; }

/* ---------- Shared header controls (all secondary pages) ---------- */
.hright { display: flex; align-items: center; gap: 10px; }
.langsel { font: 600 16px var(--body); color: var(--ink); background: var(--chip); border: 1px solid transparent; border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.navlink { color: var(--ink); font-weight: 600; text-decoration: none; }
.navlink:hover { color: var(--accent-strong); }
html[dir="rtl"] .back { direction: rtl; }
html[lang="ar"] body { font-family: "IBM Plex Sans Arabic", var(--body); }
html[lang="ar"] h1, html[lang="ar"] h2 { font-family: "IBM Plex Sans Arabic", var(--body); font-weight: 700; line-height: 1.35; }

/* ---------- Account pages: sign-up, log-in, my account ---------- */
.narrow { max-width: 560px; }
.lede { color: var(--muted); margin: 0 0 24px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 22px; display: grid; gap: 14px; }
.panel + .panel { margin-top: 20px; }
.dform { display: grid; gap: 14px; border-top: 1px solid var(--line); padding-top: 16px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.phone { display: grid; grid-template-columns: minmax(96px, 0.38fr) 1fr; gap: 10px; }
.f { display: grid; gap: 6px; font-weight: 600; font-size: 0.88rem; min-width: 0; }
.f small { font-weight: 400; color: var(--muted); }
.req { color: var(--accent-strong); }
input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="password"], select.f-in {
  font: inherit; font-size: 16px; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; width: 100%; caret-color: var(--accent-strong); }
input[type="checkbox"] { accent-color: var(--accent-strong); width: 18px; height: 18px; margin: 2px 0 0; flex: none; }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 0.88rem; color: var(--muted); }
.consent:has(input[aria-invalid="true"]) { color: var(--danger); }
.consent a { color: var(--ink); font-weight: 600; white-space: nowrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 600 1rem var(--body); border-radius: 8px;
  padding: 13px 20px; border: 2px solid var(--ink); background: var(--ink); color: var(--bg); text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--accent-ink); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.6; cursor: progress; filter: none; transform: none; }
.msg { border-radius: 8px; padding: 12px 14px; font-weight: 600; }
.msg.ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok-text); }
.msg.err { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.alt { color: var(--muted); font-size: 0.92rem; margin: 16px 0 0; }
.alt a { color: var(--ink); font-weight: 600; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* Account status and deposit steps */
.status { display: flex; gap: 12px; align-items: flex-start; border-radius: 8px; padding: 14px; background: var(--chip); }
.status::before { content: ""; width: 12px; height: 12px; border-radius: 999px; margin-top: 6px; flex: none; background: var(--muted); }
.status[data-state="pending"]::before, .status[data-state="refund_requested"]::before { background: var(--accent); }
h3.ptitle { font-size: 1.05rem; }
.status[data-state="approved"] { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok-text); font-weight: 600; }
.status[data-state="approved"]::before { background: var(--ok); }
dl.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }
ol.dsteps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 12px; }
ol.dsteps li { counter-increment: s; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; }
ol.dsteps li::before { content: counter(s); width: 28px; height: 28px; border-radius: 999px; background: var(--chip); color: var(--accent-strong);
  font: 600 0.85rem "IBM Plex Mono", ui-monospace, monospace; display: grid; place-items: center; }
.depbox { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--chip); border-radius: 8px; padding: 12px 14px; font-weight: 600; }
.depbox strong { font: 600 1.3rem "IBM Plex Mono", ui-monospace, monospace; color: var(--accent-text); font-variant-numeric: tabular-nums; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
h2.ptitle { margin: 0; font-size: 1.25rem; }

@media (max-width: 520px) {
  .row2 { grid-template-columns: 1fr; }
  .panel { padding: 18px; }
  header .navlink { font-size: 0.92rem; }
}

/* ---------- Lot page ---------- */
.lotwrap { max-width: 1100px; }
.backlink { display: inline-block; font-weight: 600; text-decoration: none; margin-bottom: 20px; }
.backlink:hover { text-decoration: underline; }
.lotgrid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.mainphoto { aspect-ratio: 4 / 3; background: var(--chip); border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.mainphoto img { width: 100%; height: 100%; object-fit: contain; display: block; background: var(--surface); }
.mainphoto.nophoto { background: var(--chip) url("favicon.svg") center / 64px no-repeat; opacity: 0.6; }
.thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding-bottom: 4px; }
.thumbs button { flex: none; width: 72px; height: 54px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: var(--chip); cursor: pointer; }
.thumbs button[aria-pressed="true"] { border-color: var(--ink); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lotinfo { display: grid; gap: 14px; }
.lotinfo h1 { margin: 0; font-size: clamp(1.7rem, 4vw, 2.3rem); }
.lotid { margin: 0; font: 500 0.82rem "IBM Plex Mono", ui-monospace, monospace; color: var(--muted); }
.lottime { margin: 0; font: 600 1rem "IBM Plex Mono", ui-monospace, monospace; }
.lottime.ended { color: var(--muted); }
.entrybox { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border-block: 1px solid var(--line); padding-block: 12px; }
.entrybox strong { font: 600 1.8rem "IBM Plex Mono", ui-monospace, monospace; color: var(--accent-strong); font-variant-numeric: tabular-nums; }
.manifest { margin-top: 40px; }
.manifest h2 { margin: 0 0 12px; }
.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.manifest table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.manifest th, .manifest td { padding: 10px 14px; text-align: start; border-bottom: 1px solid var(--line); }
.manifest th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; }
html[lang="ar"] .manifest th { letter-spacing: 0; }
.manifest tr:last-child td { border-bottom: 0; }
.manifest td.num { white-space: nowrap; text-align: end; font-family: "IBM Plex Mono", ui-monospace, monospace; }
.lock { margin-top: 12px; background: var(--surface); border: 1px dashed var(--accent-strong); border-radius: 12px; padding: 18px; display: grid; gap: 12px; }
.lock p { margin: 0; font-weight: 600; }
.muted { color: var(--muted); }

/* My bids on the account page */
.poslist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.poslist li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.poslist li:last-child { border-bottom: 0; }
.poslist a { font-weight: 600; overflow-wrap: anywhere; }
.poslist .pmax { font-family: "IBM Plex Mono", ui-monospace, monospace; }
.pill { display: inline-block; font-size: 0.75rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--chip); color: var(--ink); justify-self: start; }
.pill[data-s="active"], .pill[data-s="won"] { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok-text); }
.pill[data-s="awaiting_deposit"] { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent-text); }

@media (max-width: 860px) {
  .lotgrid { grid-template-columns: 1fr; gap: 24px; }
  .manifest .m-retail { display: none; }
}

/* Shipping note under the entry price, and the delivery-service panel */
.ship { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 0.85rem; color: var(--muted); }
.shipbtn { display: inline-grid; place-items: center; width: 32px; height: 32px; flex: none; padding: 0; border: 1px solid var(--line); border-radius: 999px; background: var(--chip); color: var(--ink); cursor: pointer; }
.shipbtn:hover { border-color: var(--ink); }
.shipbtn svg { width: 18px; height: 18px; }
.shippop { width: min(440px, calc(100vw - 32px)); margin: auto; border: 1px solid var(--line); border-radius: 12px; padding: 20px; background: var(--surface); color: var(--ink); }
.shippop::backdrop { background: rgba(13, 27, 46, 0.45); }
.shippop h2 { margin: 0 0 8px; font-size: 1.2rem; }
.shippop p { margin: 0 0 16px; line-height: 1.6; }
html.no-popover .shippop:not(.open) { display: none; }
html.no-popover .shippop.open { display: block; position: fixed; inset: 0; z-index: 50; height: fit-content; }
.pill[data-s="leading"] { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok-text); }
.pill[data-s="outbid"] { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.poslist .raise { grid-column: 2; justify-self: end; font-size: 0.88rem; }
