/* ============================================================
   Carzello — ADESA-Clear-inspired design system
   Light, clean, responsive. One app: desktop → mobile.
   ============================================================ */

:root {
  /* Brand — ONE sacred red (Sayarah). Hover always goes LIGHTER. */
  --brand:        #991B1B;   /* red-800 — primary actions, links, active */
  --brand-600:    #B91C1C;   /* red-700 — hover (lighter) */
  --brand-700:    #7f1717;   /* darker, rare */
  --brand-soft:   #FEF2F2;   /* red-50 */
  --brand-tint:   #fff6f6;
  --sayarah:      #991B1B;
  --sayarah-soft: #FEF2F2;

  /* Surfaces */
  --bg:        #F9FAFB;   /* gray-50 page */
  --bg-2:      #F3F4F6;
  --surface:   #ffffff;
  --surface-2: #F9FAFB;
  --dark:      #111827;   /* gray-900 footer / sidebar */
  --overlay:   rgba(17,24,39,.62);

  /* Text */
  --fg:    #111827;   /* gray-900 */
  --fg-2:  #374151;   /* gray-700 */
  --fg-3:  #6B7280;   /* gray-500 */
  --fg-4:  #68707C;   /* AA ≥4.5 on both #fff and #F9FAFB (axe-verified) */

  /* Lines */
  --border:   #E5E7EB;   /* gray-200 */
  --border-2: #D1D5DB;   /* gray-300 */
  --ring:     0 0 0 3px rgba(153,27,27,.16);

  /* Status */
  --green:      #047857;  /* emerald-700 */
  --green-soft: #ECFDF5;
  --amber:      #B45309;  /* amber-700 */
  --amber-soft: #FFFBEB;
  --red:        #B91C1C;
  --red-soft:   #FEF2F2;
  --live:       #991B1B;

  /* Grade gauge (0–5): emerald → amber → red, no off-palette hues */
  --g-hi:  #047857;
  --g-mid: #B45309;
  --g-lo:  #B45309;
  --g-bad: #991B1B;

  /* Type — Barlow family. Headings condensed + uppercase. */
  --sans: "Barlow", "Exo 2", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --heading: "Barlow Condensed", "Barlow", sans-serif;
  --mono: "Rajdhani", "Barlow", ui-monospace, monospace;
  --disp: var(--heading);

  /* Geometry — squared / industrial. Only dots & avatars stay round. */
  --r:    0px;
  --r-sm: 0px;
  --r-lg: 0px;
  --r-pill: 999px;
  --shadow-1: 0 1px 2px rgba(17,24,39,.05);
  --shadow-2: 0 12px 40px rgba(17,24,39,.07);
  --shadow-3: 0 20px 50px rgba(17,24,39,.22);

  --tabbar-h: 60px;
  --topbar-h: 60px;
  --maxw: 1240px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: hidden; max-width: 100%; }
img, svg, video { max-width: 100%; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 15px;
  line-height: 1.45;
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }
.tnum { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.mono { font-family: var(--mono); }
::selection { background: var(--brand-soft); }

/* scrollbars */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #c8d2dd; border-radius: 99px; border: 2px solid var(--bg); }
*::-webkit-scrollbar-thumb:hover { background: #aebccb; }

/* ============================================================
   App scaffold
   ============================================================ */
.app { min-height: 100vh; display: flex; flex-direction: column; }

/* ---- Top bar (desktop) ---- */
.topbar {
  position: sticky; top: 0; z-index: 60;
  height: var(--topbar-h);
  background: rgba(255,255,255,.86);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 18px;
  padding: 0 22px;
}
.topbar .logo { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.02em; font-size: 19px; flex: none; }
.topbar .logo-img { height: 32px; display: block; }
.topbar .logo .mark {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  background: var(--sayarah); color: #fff; font-weight: 800; font-size: 16px;
  box-shadow: 0 2px 8px rgba(226,35,26,.35);
}
.topbar .logo small { font-weight: 600; color: var(--fg-3); font-size: 12px; letter-spacing: .04em; margin-top: 2px; }
.topnav { display: flex; gap: 2px; margin-left: 6px; }
.topnav a {
  position: relative; padding: 9px 14px; border-radius: 9px; font-weight: 600; font-size: 14px;
  color: var(--fg-2); display: flex; align-items: center; gap: 7px;
}
.topnav a:hover { background: var(--surface-2); color: var(--fg); }
.topnav a.on { color: var(--brand); background: var(--brand-soft); }
.topnav a .badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; font-size: 11px; font-weight: 700;
  background: var(--sayarah); color: #fff; display: grid; place-items: center; font-family: var(--mono);
}
.topnav a.on .badge { background: var(--brand); }

.topsearch {
  flex: 1; max-width: 420px; margin: 0 auto;
  display: flex; align-items: center; gap: 9px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-pill); padding: 9px 14px; color: var(--fg-3);
}
.topsearch input { flex: 1; border: 0; background: transparent; outline: none; font-size: 14px; color: var(--fg); }
.topsearch .kbd { font-family: var(--mono); font-size: 11px; color: var(--fg-4); border: 1px solid var(--border-2); border-radius: 5px; padding: 1px 5px; }

.topbar .right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.iconbtn {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--fg-2); display: grid; place-items: center; position: relative;
}
.iconbtn:hover { background: var(--surface-2); color: var(--fg); }
.iconbtn .dot { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--sayarah); border: 2px solid var(--surface); }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg,var(--brand),#2f9e8f);
  color: #fff; font-weight: 700; display: grid; place-items: center; font-size: 14px;
}

/* ---- Main column ---- */
.main { flex: 1; width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 26px 22px 90px; }
@media (min-width: 900px) { .main { padding-bottom: 40px; } }

/* ---- Bottom tab bar (mobile) ---- */
.tabbar { display: none; }
@media (max-width: 899px) {
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(255,255,255,.94); backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
  }
  .tabbar a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: var(--fg-3); font-size: 10.5px; font-weight: 600; position: relative;
  }
  .tabbar a.on { color: var(--brand); }
  .tabbar a .tbadge {
    position: absolute; top: 7px; left: 50%; margin-left: 4px;
    min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; font-size: 10px;
    background: var(--sayarah); color: #fff; display: grid; place-items: center; font-family: var(--mono); font-weight: 700;
  }
}

/* ============================================================
   Generic UI
   ============================================================ */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-1); }
.card-pad { padding: 18px; }
.muted { color: var(--fg-3); }
.row { display: flex; align-items: center; }
.col { display: flex; flex-direction: column; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-10 { gap: 10px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-20 { gap: 20px; }
.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--brand); }
.h1 { font-size: clamp(24px, 3.4vw, 34px); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.h2 { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.section-h { display: flex; align-items: center; gap: 10px; margin: 4px 0 14px; }
.section-h h2 { margin: 0; }
.section-h .link { margin-left: auto; color: var(--brand); font-weight: 700; font-size: 13.5px; display: flex; align-items: center; gap: 4px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--border-2); background: var(--surface); color: var(--fg);
  border-radius: var(--r-sm); padding: 10px 16px; font-weight: 700; font-size: 14px;
  transition: transform .04s ease, background .15s ease, box-shadow .15s ease; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 2px 10px rgba(22,102,214,.30); }
.btn.primary:hover { background: var(--brand-600); }
.btn.sayarah { background: var(--sayarah); border-color: var(--sayarah); color: #fff; box-shadow: 0 2px 10px rgba(226,35,26,.30); }
.btn.sayarah:hover { filter: brightness(.95); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--fg-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--fg); }
.btn.outline { background: transparent; }
.btn.lg { padding: 14px 20px; font-size: 15.5px; border-radius: 11px; }
.btn.sm { padding: 7px 12px; font-size: 13px; }
.btn.block { width: 100%; }
.btn.success { background: var(--green); border-color: var(--green); color: #fff; }

/* Pills / badges */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .02em;
  padding: 4px 9px; border-radius: var(--r-pill); border: 1px solid var(--border-2);
  background: var(--surface-2); color: var(--fg-2); white-space: nowrap;
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.live { background: var(--sayarah-soft); color: var(--sayarah); border-color: #f6c9c6; }
.pill.live .dot { animation: pulse 1.2s infinite; }
.pill.green { background: var(--green-soft); color: var(--green); border-color: #bfe6d1; }
.pill.amber { background: var(--amber-soft); color: var(--amber); border-color: #f3dcae; }
.pill.blue { background: var(--brand-soft); color: var(--brand); border-color: #c6dcf8; }
.pill.red { background: var(--red-soft); color: var(--red); border-color: #f4c7c4; }
.pill.solid-live { background: var(--sayarah); color: #fff; border-color: var(--sayarah); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* Inputs */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; font-weight: 700; color: var(--fg-2); letter-spacing: .01em; }
.input, .select {
  width: 100%; border: 1px solid var(--border-2); background: var(--surface);
  border-radius: var(--r-sm); padding: 11px 13px; font-size: 14px; color: var(--fg); outline: none;
}
.input:focus, .select:focus { border-color: var(--brand); box-shadow: var(--ring); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 5l3 3 3-3' stroke='%236b7a8d' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.checkline { display: flex; align-items: center; gap: 10px; padding: 7px 4px; font-size: 14px; color: var(--fg-2); cursor: pointer; border-radius: 7px; }
.checkline:hover { background: var(--surface-2); }
.checkline input { width: 17px; height: 17px; accent-color: var(--brand); }
.checkline .ct { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--fg-4); }

/* Segmented control */
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; color: var(--fg-3); font-weight: 700; font-size: 13px; padding: 8px 14px; border-radius: 7px; }
.seg button.on { background: var(--surface); color: var(--fg); box-shadow: var(--shadow-1); }

/* ============================================================
   AutoGrade badge (circular 0–5 score, ADESA-style)
   ============================================================ */
.autograde {
  --c: var(--g-mid);
  display: inline-grid; place-items: center; position: relative;
  width: 52px; height: 52px; border-radius: 50%;
  background: conic-gradient(var(--c) calc(var(--pct) * 1%), #e7edf3 0);
}
.autograde::after { content: ""; position: absolute; inset: 4px; background: var(--surface); border-radius: 50%; }
.autograde .val { position: relative; z-index: 1; font-weight: 800; font-size: 16px; color: var(--c); font-variant-numeric: tabular-nums; }
.autograde.sm { width: 40px; height: 40px; }
.autograde.sm .val { font-size: 13px; }
.autograde.lg { width: 72px; height: 72px; }
.autograde.lg .val { font-size: 22px; }
.gradechip {
  display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 12px;
  padding: 3px 9px 3px 4px; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--border);
}
.gradechip .num { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 800; }

/* ============================================================
   Photo placeholder
   ============================================================ */
.photo {
  position: relative; overflow: hidden; border-radius: var(--r-sm);
  background: linear-gradient(135deg,#eaeff5,#dde5ee);
  display: grid; place-items: center; color: #9fb0c2; aspect-ratio: 4/3;
}
.photo .ph-ic { opacity: .55; }
.photo .ph-label { position: absolute; left: 10px; bottom: 8px; font-family: var(--mono); font-size: 10px; letter-spacing: .12em; color: #7c8bda; text-transform: uppercase; }
.photo .ph-count { position: absolute; right: 8px; bottom: 8px; font-family: var(--mono); font-size: 10.5px; background: rgba(16,26,40,.62); color: #fff; padding: 2px 7px; border-radius: 99px; }

/* ============================================================
   Listing card (responsive grid)
   ============================================================ */
.inv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
@media (max-width: 560px) { .inv-grid { grid-template-columns: 1fr; gap: 12px; } }

.lcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow-1); cursor: pointer; transition: box-shadow .16s ease, transform .12s ease, border-color .16s ease; display: flex; flex-direction: column; }
.lcard:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); border-color: var(--border-2); }
.lcard .hero { position: relative; aspect-ratio: 16/10; }
.lcard .hero .photo { width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; }
.lcard .toptags { position: absolute; left: 10px; top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.lcard .src { position: absolute; right: 10px; top: 10px; font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; background: rgba(255,255,255,.92); color: var(--fg-2); padding: 3px 7px; border-radius: 6px; }
.lcard .src.own { background: var(--brand); color: #fff; }
.lcard .watch { position: absolute; right: 10px; bottom: 10px; width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.92); border: 1px solid var(--border); display: grid; place-items: center; color: var(--fg-3); box-shadow: var(--shadow-1); }
.lcard .watch.on { color: var(--amber); }
.lcard .watch:hover { background: #fff; }
.lcard .pc { position: absolute; left: 10px; bottom: 10px; font-family: var(--mono); font-size: 10.5px; background: rgba(16,26,40,.6); color: #fff; padding: 2px 8px; border-radius: 99px; display: flex; align-items: center; gap: 4px; }
.lcard .body { padding: 13px 14px 0; }
.lcard .title { font-weight: 800; font-size: 16px; letter-spacing: -.01em; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lcard .trim { color: var(--fg-3); font-size: 13px; margin-top: 1px; }
.lcard .specs { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 10px; color: var(--fg-2); font-size: 12.5px; font-family: var(--mono); }
.lcard .specs span { display: inline-flex; align-items: center; gap: 4px; }
.lcard .loc { display: flex; align-items: center; gap: 5px; color: var(--fg-3); font-size: 12px; margin-top: 9px; }
.lcard .foot { margin-top: 12px; padding: 12px 14px; border-top: 1px solid var(--border); display: flex; align-items: flex-end; justify-content: space-between; }
.lcard .foot .l { font-size: 11px; color: var(--fg-3); font-weight: 600; letter-spacing: .02em; }
.lcard .foot .bid { font-weight: 800; font-size: 19px; letter-spacing: -.01em; }
.lcard .foot .bid.winning { color: var(--green); }
.lcard .foot .time { font-weight: 700; font-size: 14px; font-family: var(--mono); }
.lcard .foot .time.ending { color: var(--sayarah); }
.lcard.winning { border-color: #bfe6d1; }
.lcard.outbid { border-color: #f3dcae; }

/* List (compact) row variant for run lists */
.runrow { display: grid; grid-template-columns: 120px 1fr auto; gap: 14px; align-items: center; padding: 12px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); cursor: pointer; }
.runrow:hover { background: var(--surface-2); }
.runrow .photo { width: 120px; aspect-ratio: 16/11; border-radius: 8px; }
@media (max-width: 560px) { .runrow { grid-template-columns: 92px 1fr; } .runrow .runprice { grid-column: 2; text-align: left; } .runrow .photo { width: 92px; } }

/* ============================================================
   Filters
   ============================================================ */
.browse-layout { display: grid; grid-template-columns: 260px 1fr; gap: 22px; align-items: start; }
.browse-layout > * { min-width: 0; }  /* grid items must be allowed to shrink below content width */
@media (max-width: 899px) { .browse-layout { grid-template-columns: 1fr; } .filters-desktop { display: none; } }
.filters { position: sticky; top: calc(var(--topbar-h) + 16px); }
.filter-group { padding: 14px 4px; border-bottom: 1px solid var(--border); }
.filter-group:last-child { border-bottom: 0; }
.filter-h { font-size: 11.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-3); margin-bottom: 8px; }
.range { display: flex; gap: 8px; align-items: center; }
.range .input { padding: 9px 10px; font-size: 13px; }

.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; -webkit-overflow-scrolling: touch; min-width: 0; max-width: 100%; }
.chips .chip { flex: none; }
.row, .col { min-width: 0; }
.card, .form-card { min-width: 0; max-width: 100%; }
.chip { border: 1px solid var(--border-2); background: var(--surface); color: var(--fg-2); border-radius: var(--r-pill); padding: 7px 13px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.chip.on { background: var(--fg); border-color: var(--fg); color: #fff; }
.chip:hover:not(.on) { background: var(--surface-2); }

/* ============================================================
   Vehicle Detail (VDP)
   ============================================================ */
.vdp-layout { display: grid; grid-template-columns: 1fr 360px; gap: 24px; align-items: start; }
@media (max-width: 980px) { .vdp-layout { grid-template-columns: 1fr; } }

.gallery .main { aspect-ratio: 16/10; border-radius: var(--r); }
.gallery .thumbs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-top: 8px; }
.gallery .thumbs .photo { aspect-ratio: 4/3; cursor: pointer; border: 2px solid transparent; }
.gallery .thumbs .photo.on { border-color: var(--brand); }

.vdp-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 22px 0 16px; overflow-x: auto; }
.vdp-tab { border: 0; background: transparent; padding: 11px 14px; font-weight: 700; font-size: 14px; color: var(--fg-3); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.vdp-tab.on { color: var(--brand); border-bottom-color: var(--brand); }
.vdp-tab .ct { color: var(--fg-4); font-weight: 600; margin-left: 3px; }

.cr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.cr-cell { border: 1px solid var(--border); border-radius: var(--r-sm); padding: 13px; background: var(--surface); }
.cr-cell .l { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--fg-3); font-weight: 700; }
.cr-cell .bar { height: 6px; border-radius: 99px; background: #eaeff4; margin: 9px 0 6px; overflow: hidden; }
.cr-cell .bar span { display: block; height: 100%; border-radius: 99px; }
.cr-cell .sc { font-weight: 800; font-size: 17px; }
.cr-cell .note { font-size: 12px; color: var(--fg-3); margin-top: 4px; line-height: 1.4; }

.announce { display: flex; flex-direction: column; gap: 0; }
.announce .row { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--border); align-items: flex-start; }
.announce .row:last-child { border-bottom: 0; }
.announce .ic { color: var(--amber); flex-shrink: 0; margin-top: 1px; }
.announce .ic.ok { color: var(--green); }

.dmg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.dmg-cell { border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden; background: var(--surface); }
.dmg-cell .photo { aspect-ratio: 4/3; border-radius: 0; }
.dmg-cell .meta { padding: 9px 11px; }
.dmg-cell .loc { font-weight: 700; font-size: 13px; }
.dmg-cell .sev { font-size: 11.5px; color: var(--fg-3); margin-top: 2px; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; align-items: baseline; }
.kv dt { color: var(--fg-3); font-size: 13px; }
.kv dd { margin: 0; font-weight: 600; font-size: 13.5px; text-align: right; }

.obd-row { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.obd-row:last-child { border-bottom: 0; }
.obd-row .code { font-family: var(--mono); font-weight: 700; }

/* ---- Bid panel ---- */
.bidpanel { position: sticky; top: calc(var(--topbar-h) + 16px); display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 980px) { .bidpanel { position: static; } }
.bidpanel .big-price { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.bidpanel .big-price.winning { color: var(--green); }
.statline { display: flex; justify-content: space-between; gap: 12px; }
.statline .l { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--fg-3); font-weight: 700; }
.statline .v { font-weight: 800; font-size: 18px; }

.bidinput { display: flex; align-items: center; gap: 0; border: 1.5px solid var(--border-2); border-radius: 10px; overflow: hidden; background: var(--surface); }
.bidinput:focus-within { border-color: var(--brand); box-shadow: var(--ring); }
.bidinput .cur { padding: 0 4px 0 13px; font-weight: 800; color: var(--fg-3); font-size: 17px; }
.bidinput input { flex: 1; border: 0; outline: none; font-size: 19px; font-weight: 800; padding: 12px 6px; font-variant-numeric: tabular-nums; min-width: 0; }
.bidinput .step { border: 0; border-left: 1px solid var(--border); background: var(--surface-2); padding: 0 13px; align-self: stretch; font-weight: 800; font-size: 13px; color: var(--fg-2); font-family: var(--mono); }
.bidinput .step:hover { background: var(--bg-2); }

.feedback { font-size: 13px; font-weight: 600; padding: 10px 12px; border-radius: 8px; display: flex; gap: 8px; align-items: center; }
.feedback.ok { background: var(--green-soft); color: var(--green); }
.feedback.err { background: var(--red-soft); color: var(--red); }
.feedback.warn { background: var(--amber-soft); color: var(--amber); }
.feedback.info { background: var(--surface-2); color: var(--fg-2); }

.feerow { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: 13.5px; color: var(--fg-2); }
.feerow:last-child { border-bottom: 0; }
.feerow.total { border-top: 2px solid var(--border-2); border-bottom: 0; margin-top: 4px; padding-top: 11px; font-weight: 800; font-size: 16px; color: var(--fg); }
.feerow .dim { color: var(--fg-4); font-size: 11.5px; }

/* Countdown */
.countdown { font-family: var(--mono); font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.countdown.danger { color: var(--sayarah); }
.countdown.warn { color: var(--amber); }

/* ============================================================
   Live bidding room
   ============================================================ */
.liveroom { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
@media (max-width: 980px) { .liveroom { grid-template-columns: 1fr; } }
.livehero { position: relative; border-radius: var(--r); overflow: hidden; border: 1px solid var(--border); background: #0e1620; }
.livehero .photo { aspect-ratio: 16/9; border-radius: 0; }
.livehero .topbar2 { position: absolute; top: 0; left: 0; right: 0; padding: 12px 14px; display: flex; align-items: center; gap: 10px; background: linear-gradient(rgba(8,14,22,.7), transparent); color: #fff; }
.livehero .bottom { position: absolute; bottom: 0; left: 0; right: 0; padding: 16px; display: flex; justify-content: space-between; align-items: flex-end; background: linear-gradient(transparent, rgba(8,14,22,.85)); color: #fff; }
.livehero .bottom h2 { margin: 0; font-size: 22px; font-weight: 800; }
.livehero .bottom .sub { color: #c5d2e0; font-size: 13px; margin-top: 3px; }
.livehero .timer-xl { font-family: var(--mono); font-weight: 800; font-size: 40px; line-height: 1; text-align: right; }

.feed { border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); overflow: hidden; display: flex; flex-direction: column; max-height: 460px; }
.feed .head { padding: 12px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; }
.feed .rows { overflow-y: auto; flex: 1; }
.feedrow { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.feedrow .who { color: var(--fg-2); font-weight: 600; }
.feedrow .t { font-family: var(--mono); font-size: 11px; color: var(--fg-4); }
.feedrow .amt { font-weight: 800; font-variant-numeric: tabular-nums; }
.feedrow.you { background: var(--brand-tint); }
.feedrow.you .who { color: var(--brand); }
.feedrow.new { animation: flashrow 1.4s ease; }
@keyframes flashrow { 0% { background: var(--amber-soft); } 100% { background: transparent; } }

.snipe-toast {
  position: absolute; left: 50%; top: 16px; transform: translateX(-50%);
  background: var(--sayarah); color: #fff; padding: 10px 16px; border-radius: 10px;
  display: flex; align-items: center; gap: 10px; box-shadow: var(--shadow-3); z-index: 5;
  animation: pop .3s ease;
}
@keyframes pop { from { transform: translateX(-50%) scale(.9); opacity: 0; } to { transform: translateX(-50%) scale(1); opacity: 1; } }

/* ============================================================
   Empty states, toasts, sheets, modal
   ============================================================ */
.empty { text-align: center; padding: 60px 20px; color: var(--fg-3); }
.empty .ic { width: 56px; height: 56px; border-radius: 16px; background: var(--surface-2); display: grid; place-items: center; margin: 0 auto 14px; color: var(--fg-4); }
.empty h3 { margin: 0 0 6px; color: var(--fg); font-size: 18px; }

.toast-wrap { position: fixed; z-index: 200; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
@media (max-width: 899px) { .toast-wrap { right: 12px; left: 12px; bottom: calc(var(--tabbar-h) + 14px); max-width: none; } }
.toast { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--brand); border-radius: 10px; box-shadow: var(--shadow-3); padding: 12px 14px; display: flex; gap: 11px; align-items: flex-start; animation: toastin .25s ease; }
.toast.win { border-left-color: var(--green); }
.toast.outbid { border-left-color: var(--amber); }
.toast.lost { border-left-color: var(--red); }
.toast .tt { font-weight: 800; font-size: 13.5px; }
.toast .tb { font-size: 12.5px; color: var(--fg-3); margin-top: 2px; }
.toast .tic { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; background: var(--brand-soft); color: var(--brand); }
.toast.win .tic { background: var(--green-soft); color: var(--green); }
.toast.outbid .tic { background: var(--amber-soft); color: var(--amber); }
.toast.lost .tic { background: var(--red-soft); color: var(--red); }
@keyframes toastin { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.modal-back { position: fixed; inset: 0; background: var(--overlay); z-index: 150; display: grid; place-items: center; padding: 20px; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-3); width: 100%; max-width: 440px; overflow: hidden; animation: pop2 .22s ease; }
@keyframes pop2 { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal .mhead { padding: 18px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.modal .mbody { padding: 20px; }
.modal .mfoot { padding: 16px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; flex-wrap: wrap; }
.modal .mfoot > * { min-width: 0; }

/* Sheet (mobile filters) */
.sheet-back { position: fixed; inset: 0; background: var(--overlay); z-index: 150; animation: fade .2s ease; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 160; background: var(--surface); border-radius: 18px 18px 0 0; max-height: 86vh; overflow-y: auto; box-shadow: var(--shadow-3); animation: sheetup .26s cubic-bezier(.2,.8,.2,1); }
@keyframes sheetup { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet .grab { width: 40px; height: 4px; border-radius: 99px; background: var(--border-2); margin: 10px auto 4px; }
.sheet .shead { padding: 6px 18px 12px; display: flex; align-items: center; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); }
.sheet .sbody { padding: 14px 18px; }
.sheet .sfoot { position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--border); padding: 14px 18px; display: flex; gap: 10px; }

/* Dashboard / account tiles */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.stat { border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); padding: 16px; box-shadow: var(--shadow-1); }
.stat .l { font-size: 12px; color: var(--fg-3); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.stat .v { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin-top: 6px; }
.stat .s { font-size: 12px; color: var(--fg-3); margin-top: 2px; }

.stepper { display: flex; gap: 0; margin: 4px 0 16px; }
.stepper .st { flex: 1; text-align: center; position: relative; padding-top: 30px; font-size: 12px; font-weight: 600; color: var(--fg-3); }
.stepper .st .dot { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 22px; height: 22px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border-2); display: grid; place-items: center; color: var(--fg-3); font-size: 11px; font-weight: 800; z-index: 1; }
.stepper .st::before { content: ""; position: absolute; top: 10px; left: -50%; width: 100%; height: 2px; background: var(--border-2); }
.stepper .st:first-child::before { display: none; }
.stepper .st.done { color: var(--green); }
.stepper .st.done .dot { background: var(--green); border-color: var(--green); color: #fff; }
.stepper .st.done::before { background: var(--green); }
.stepper .st.cur { color: var(--brand); }
.stepper .st.cur .dot { border-color: var(--brand); color: var(--brand); }

.tablewrap { border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.ltable { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ltable th { text-align: left; padding: 11px 14px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-3); background: var(--surface-2); border-bottom: 1px solid var(--border); font-weight: 700; }
.ltable td { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.ltable tr:last-child td { border-bottom: 0; }
.ltable tr:hover td { background: var(--surface-2); }
.hide-sm { }
@media (max-width: 620px) { .hide-sm { display: none; } }

/* ---- Phone fit (iPhone SE 375px and up): the top bar must never exceed the viewport ---- */
@media (max-width: 620px) {
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar .logo-img { height: 24px; }
  .topbar .right { gap: 6px; margin-inline-start: auto; }
  .topbar .iconbtn { width: 36px; height: 36px; }
  .topbar .right .btn.sm { padding: 8px 12px; font-size: 12.5px; white-space: nowrap; }
  .avatar { width: 36px; height: 36px; font-size: 13px; }
  .main { padding-left: 16px; padding-right: 16px; }  /* matches the hero's -16px bleed */
  .hero .stats { gap: 16px 22px; }
  .hero .stats .n { font-size: 25px; }
  .hero .sub { font-size: 13.5px; }
  .toolbar .select { max-width: 46vw; }
  .chip { padding: 9px 13px; }         /* comfortable tap targets */
  .modal-back { padding: 10px; place-items: end center; }
  .modal { max-width: none; }
  .modal .mhead b { min-width: 0; overflow-wrap: anywhere; }
  .pagehead .sub { font-size: 13.5px; }
}
/* data tables scroll inside themselves on phones instead of stretching the page */
@media (max-width: 899px) {
  .atable, .ltable { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* Hero/banner on browse */
.pagehead { margin-bottom: 20px; }
.pagehead .sub { color: var(--fg-3); font-size: 15px; margin-top: 6px; max-width: 640px; }

/* Mobile sticky bid bar (lot detail) */
.mob-bidbar { display: none; }
@media (max-width: 980px) {
  .vdp-aside-desktop { display: none; }
  .mob-bidbar {
    display: flex; align-items: center; gap: 12px;
    position: fixed; left: 0; right: 0; bottom: var(--tabbar-h); z-index: 65;
    padding: 10px 14px calc(10px); background: rgba(255,255,255,.96); backdrop-filter: blur(10px);
    border-top: 1px solid var(--border);
  }
  .mob-bidbar .price { font-weight: 800; font-size: 18px; line-height: 1.1; }
  .mob-bidbar .price small { display: block; font-size: 10.5px; color: var(--fg-3); font-weight: 600; }
}
@media (min-width: 981px) { .mob-only { display: none !important; } }

/* utility */
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.skeleton { background: linear-gradient(90deg,#eef2f6 25%,#e3e9ef 50%,#eef2f6 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 8px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.fadein { animation: fade .3s ease; }

/* ============================================================
   ADMIN CONSOLE
   ============================================================ */
.admin { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; background: var(--bg); }
.admin-side {
  background: #0f1722; color: #c7d2de; position: sticky; top: 0; height: 100vh; align-self: start;
  display: flex; flex-direction: column; padding: 16px 12px; gap: 4px;
}
.admin-side .brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 14px; font-weight: 800; color: #fff; font-size: 17px; }
.admin-side .brand .mark { width: 28px; height: 28px; border-radius: 7px; background: var(--sayarah); display: grid; place-items: center; font-size: 15px; }
.admin-side .brand small { display: block; font-size: 10px; letter-spacing: .14em; color: #8595a8; font-weight: 700; text-transform: uppercase; }
.admin-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.admin-nav a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 9px; color: #aeb9c8; font-weight: 600; font-size: 14px; }
.admin-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.admin-nav a.on { background: var(--brand); color: #fff; }
.admin-nav a .badge { margin-left: auto; min-width: 20px; height: 18px; padding: 0 6px; border-radius: 99px; font-size: 11px; font-weight: 700; background: rgba(255,255,255,.16); display: grid; place-items: center; font-family: var(--mono); }
.admin-side .foot { border-top: 1px solid rgba(255,255,255,.08); padding-top: 12px; }
.admin-side .foot a { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 8px; color: #aeb9c8; font-size: 13px; font-weight: 600; }
.admin-side .foot a:hover { background: rgba(255,255,255,.06); color: #fff; }

.admin-main { min-width: 0; display: flex; flex-direction: column; }
.admin-top { position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); padding: 14px 26px; display: flex; align-items: center; gap: 14px; }
.admin-top h1 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.admin-top .crumb { color: var(--fg-3); font-size: 13px; }
.admin-body { padding: 24px 26px 60px; }

@media (max-width: 860px) {
  .admin { grid-template-columns: 1fr; }
  .admin-side { position: fixed; left: 0; right: 0; bottom: 0; top: auto; height: auto; flex-direction: row; z-index: 80; padding: 6px; overflow-x: auto; }
  .admin-side .brand { display: none; }
  /* keep exit/sign-out reachable on mobile: lay the foot out inline in the bottom bar */
  .admin-side .foot { display: flex; flex-direction: row; border-top: 0; padding-top: 0; margin-left: auto; }
  .admin-side .foot a { padding: 7px 9px; font-size: 10px; }
  .admin-nav { flex-direction: row; gap: 2px; }
  .admin-nav a { flex-direction: column; gap: 3px; font-size: 10px; padding: 7px 9px; white-space: nowrap; }
  .admin-nav a .badge { display: none; }
  .admin-body { padding: 18px 16px 90px; }
  .admin-top { padding: 12px 16px; }
}

/* KPI tiles */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow-1); }
.kpi .l { font-size: 12px; color: var(--fg-3); font-weight: 600; display: flex; align-items: center; gap: 7px; }
.kpi .v { font-size: 28px; font-weight: 800; letter-spacing: -.02em; margin-top: 8px; }
.kpi .d { font-size: 12px; margin-top: 4px; font-weight: 600; }
.kpi .d.up { color: var(--green); } .kpi .d.down { color: var(--red); }
.kpi .ic { width: 34px; height: 34px; border-radius: 9px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; float: right; }

/* admin table */
.atable-wrap { border: 1px solid var(--border); border-radius: var(--r); overflow: auto; background: var(--surface); box-shadow: var(--shadow-1); }
.atable { width: 100%; border-collapse: collapse; font-size: 13.5px; white-space: nowrap; }
.atable th { text-align: left; padding: 12px 14px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--fg-3); background: var(--surface-2); border-bottom: 1px solid var(--border); font-weight: 700; position: sticky; top: 0; }
.atable td { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.atable tr:last-child td { border-bottom: 0; }
.atable tr:hover td { background: var(--surface-2); }
.atable .thumb { width: 52px; height: 36px; border-radius: 6px; }
.iconbtn.sm { width: 30px; height: 30px; border-radius: 7px; }

/* status dot */
.sdot { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 12px; }
.sdot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

/* form layout */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow-1); }
.form-card h3 { margin: 0 0 14px; font-size: 14px; font-weight: 800; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.repeat-row { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--border); }

/* charts */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 160px; padding-top: 10px; }
.bars .bar { flex: 1; background: linear-gradient(180deg, var(--brand), #e3938e); border-radius: 5px 5px 0 0; min-height: 3px; position: relative; transition: .2s; }
.bars .bar:hover { filter: brightness(1.08); }
.bars .bar .cap { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: 10px; font-weight: 700; color: var(--fg-2); opacity: 0; }
.bars .bar:hover .cap { opacity: 1; }
.bars-x { display: flex; gap: 6px; margin-top: 6px; }
.bars-x span { flex: 1; text-align: center; font-size: 9.5px; color: var(--fg-4); }
.hbar { display: grid; grid-template-columns: 90px 1fr auto; gap: 10px; align-items: center; padding: 7px 0; }
.hbar .track { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.hbar .track span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand-700), var(--brand)); }

/* login gate */
.gate { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(1200px 600px at 50% -10%, #18263a, #0f1722); padding: 20px; }
.gate .card { width: 100%; max-width: 380px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-3); padding: 28px; }

/* ============================================================
   SAYARAH DESIGN SYSTEM — brand overrides
   red-800 · squared · Barlow Condensed uppercase · border-2
   ============================================================ */

/* Headings — condensed, black, uppercase */
.h1, .h2 { font-family: var(--heading); text-transform: uppercase; letter-spacing: -.005em; }
.h1 { font-weight: 900; font-size: clamp(28px, 4vw, 46px); line-height: .98; }
.h2 { font-weight: 800; }
.section-h h2 { font-family: var(--heading); text-transform: uppercase; font-weight: 800; }
.lcard .title > span:first-child,
.runrow b, .feed .head, .stat .v, .kpi .v, .big-price,
.livehero .bottom h2, .modal .mhead b { font-family: var(--heading); }
.lcard .title > span:first-child { text-transform: uppercase; font-weight: 800; letter-spacing: 0; font-size: 18px; }

/* Section label — red dash + uppercase red caps */
.eyebrow { display: inline-flex; align-items: center; gap: 12px; color: var(--brand); }
.eyebrow::before { content: ""; width: 38px; height: 2px; background: var(--brand); flex: none; }

/* Buttons — uppercase, tracked, squared; hover lightens */
.btn { text-transform: uppercase; letter-spacing: .12em; font-weight: 700; font-size: 12px; border-radius: 0; }
.btn.lg { font-size: 12.5px; letter-spacing: .14em; padding: 14px 22px; }
.btn.sm { font-size: 11px; letter-spacing: .1em; }
.btn.outline { border-width: 2px; }
.btn.primary { box-shadow: none; }
.btn.primary:hover { background: var(--brand-600); }
.btn.sayarah { background: var(--dark); border-color: var(--dark); box-shadow: none; }
.btn.sayarah:hover { background: #1f2937; filter: none; }

/* Pills — squared, uppercase */
.pill { border-radius: 0; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.pill .dot { border-radius: 50%; }
.chip { border-radius: 0; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; font-weight: 700; }
.chip.on { background: var(--brand); border-color: var(--brand); }

/* Inputs — border-2, gray-50, red focus */
.input, .select { border-width: 2px; background: var(--surface-2); border-radius: 0; }
.input:focus, .select:focus { background: var(--surface); }
.field label { text-transform: uppercase; letter-spacing: .1em; font-size: 11px; }
.bidinput { border-radius: 0; border-width: 2px; }

/* Segmented control — squared, border-2 */
.seg { border-radius: 0; border-width: 2px; padding: 0; }
.seg button { border-radius: 0; text-transform: uppercase; letter-spacing: .08em; font-size: 11.5px; }
.seg button.on { background: var(--brand); color: #fff; box-shadow: none; }

/* Cards — hover lift + red-200 border (no scale) */
.card { border-radius: 0; }
.lcard { border-radius: 0; }
.lcard:hover { border-color: #FECACA; box-shadow: var(--shadow-2); }
.lcard .foot .bid.winning, .feerow.total, .stat .v, .kpi .v { letter-spacing: 0; }

/* Avatar / logo — brand red */
.avatar { background: var(--brand); border-radius: 50%; }
.topbar .logo { font-family: var(--heading); text-transform: uppercase; letter-spacing: .01em; font-weight: 900; font-size: 22px; }
.topbar .logo small { font-family: var(--sans); }
.topnav a { text-transform: uppercase; letter-spacing: .06em; font-size: 12.5px; font-weight: 700; border-radius: 0; }
.tabbar a { text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }

/* Misc squared surfaces */
.iconbtn, .stat, .kpi, .toast, .tablewrap, .atable-wrap, .form-card,
.feed, .livehero, .photo, .modal, .feedback, .gradechip, .autograde-skip { border-radius: 0; }
.gradechip { border-radius: 0; text-transform: uppercase; letter-spacing: .05em; font-size: 11px; }
.gradechip .num { border-radius: 50%; }

/* Pagehead sub stays sentence case */
.pagehead .sub, .empty, .muted { text-transform: none; }

/* ---- Hero — plain white band, border-separated ---- */
.hero {
  position: relative; background: var(--surface); color: var(--fg);
  border-bottom: 1px solid var(--border);
  margin: -26px -22px 24px; padding: 36px 22px 30px;
}
.hero .inner { position: relative; max-width: var(--maxw); margin: 0 auto; }
.hero .sub { color: var(--fg-3); }
.hero .trust { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border);
  background: var(--surface-2); padding: 6px 14px; margin-bottom: 16px; }
.hero .trust .d { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: pulse 1.4s infinite; }
.hero .trust span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; color: var(--fg-4); }
.hero .stats { display: flex; gap: 30px; flex-wrap: wrap; margin-top: 20px; }
.hero .stats .n { font-family: var(--heading); font-weight: 900; font-size: 30px; color: var(--fg); line-height: 1; }
.hero .stats .k { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--fg-4); margin-top: 4px; }
@media (max-width: 899px) { .hero { margin: -26px -16px 22px; padding: 30px 16px 26px; } }

/* Title accent word */
.accent { color: var(--brand); }

/* Admin — heading font + uppercase */
.admin-top h1 { font-family: var(--heading); text-transform: uppercase; letter-spacing: 0; font-weight: 800; }
.form-card h3 { font-family: var(--heading); text-transform: uppercase; letter-spacing: .01em; font-size: 16px; }
.admin-side .brand { font-family: var(--heading); text-transform: uppercase; }
.kpi .l, .atable th { text-transform: uppercase; }
.lcard .foot .bid, .runrow .runprice .tnum, .feedrow .amt, .countdown { font-family: var(--mono); }
.btn .badge, .topnav a .badge, .admin-nav a .badge { font-family: var(--mono); }

/* ============================================================
   i18n / RTL + offers + market polish
   ============================================================ */
[dir="rtl"] body, [dir="rtl"] .app { direction: rtl; }
/* flip the section-label dash to the right of the text */
[dir="rtl"] .eyebrow { flex-direction: row-reverse; }
/* directional chevrons / arrows */
[dir="rtl"] .iconbtn .dot { right: auto; left: 9px; }
[dir="rtl"] .topnav a .badge, [dir="rtl"] .tabbar a .tbadge { /* badges fine */ }
[dir="rtl"] .lcard .src { right: auto; left: 10px; }
[dir="rtl"] .lcard .watch { right: auto; left: 10px; }
[dir="rtl"] .lcard .pc { left: auto; right: 10px; }
[dir="rtl"] .lcard .toptags { left: auto; right: 10px; }
[dir="rtl"] .photo .ph-count { right: auto; left: 8px; }
[dir="rtl"] .photo .ph-label { left: auto; right: 10px; }
[dir="rtl"] .admin { grid-template-columns: 1fr 240px; }
[dir="rtl"] .vdp-tab.on, [dir="rtl"] .vdp-tab { } /* underline unaffected */
[dir="rtl"] .feed .head, [dir="rtl"] .toast { text-align: right; }
[dir="rtl"] .hero { } /* hero uses logical props mostly */
/* numbers stay LTR even in RTL context */
.tnum, .mono, .countdown, .bidinput input, .big-price { unicode-bidi: plaintext; }
[dir="rtl"] .kv dd { text-align: left; }

/* Arabic-script langs (AR / FA Dari / PS Pashto) — font coverage + line-height */
[lang="ar"], [lang="fa"], [lang="ps"] { font-family: "Tahoma", "Segoe UI", var(--sans); }
[lang="ar"] .h1, [lang="ar"] .h2, [lang="ar"] .topbar .logo,
[lang="fa"] .h1, [lang="fa"] .h2, [lang="fa"] .topbar .logo,
[lang="ps"] .h1, [lang="ps"] .h2, [lang="ps"] .topbar .logo { font-family: "Tahoma", "Segoe UI", var(--heading); letter-spacing: 0; }
[lang="ar"] body, [lang="fa"] body, [lang="ps"] body { line-height: 1.65; }

/* market badge inside cards */
.lcard .body .pill { font-size: 10.5px; }

/* ============================================================
   ACCESSIBILITY
   ============================================================ */
/* Visible keyboard focus for every interactive element */
a:focus-visible, button:focus-visible, [role="button"]:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible,
[tabindex]:focus-visible, .lcard:focus-visible, .runrow:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
/* Don't double up on inputs that already show a ring */
.input:focus-visible, .select:focus-visible { outline: none; }

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Mirror directional icons (back / chevrons) in RTL */
[dir="rtl"] .ic-dir { transform: scaleX(-1); }

/* Screen-reader-only utility */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ============================================================
   Lane cards (upcoming lanes / recently viewed / scheduler picker)
   ============================================================ */
.lanecard {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  border: 2px solid var(--border-2); background: var(--surface);
  padding: 9px 13px; white-space: nowrap; text-align: start; cursor: pointer;
}
.lanecard:hover { border-color: var(--brand); }
.lanecard.on { border-color: var(--brand); background: var(--brand-soft); }

/* ============================================================
   Site footer (buyer app)
   ============================================================ */
.site-footer { background: var(--surface); color: var(--fg); margin-top: 40px; border-top: 1px solid var(--border); }
.site-footer .inner { max-width: var(--maxw); margin: 0 auto; padding: 64px 22px 46px; }
.site-footer .cols { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: 40px; }
.site-footer .floc { display: block; font-size: 13.5px; color: var(--fg-3); padding: 8px 0; }
.site-footer .fname { font-family: var(--heading); font-weight: 800; font-size: 25px; text-transform: uppercase; letter-spacing: .01em; margin-bottom: 14px; }
.site-footer .fdesc { font-size: 15px; color: var(--fg-2); max-width: 380px; line-height: 1.65; }
.site-footer .fbar { width: 110px; height: 4px; margin-top: 28px; background: linear-gradient(90deg, var(--fg) 0%, rgba(17,24,39,0) 100%); }
.site-footer .cols b { display: block; font-family: var(--heading); font-size: 13.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 16px; color: var(--fg); }
.site-footer .cols a { display: block; font-size: 15px; color: var(--fg-2); padding: 8px 0; }
.site-footer .cols a:hover { color: var(--brand); }
.site-footer .base { border-top: 1px solid var(--border); margin-top: 46px; padding-top: 28px; font-size: 14px; color: var(--fg-2); line-height: 1.7; }
.site-footer .base .credit { opacity: .6; }
@media (max-width: 720px) { .site-footer .cols { grid-template-columns: 1fr; gap: 30px; } }
@media (max-width: 899px) { .site-footer { margin-bottom: var(--tabbar-h); } }

/* ============================================================
   Print (invoices / statements / gate pass)
   ============================================================ */
.print-doc { background: #fff; }
@media print {
  body * { visibility: hidden !important; }
  .print-doc, .print-doc * { visibility: visible !important; }
  .modal-back { position: static !important; background: none !important; padding: 0 !important; display: block !important; }
  .modal { box-shadow: none !important; max-width: none !important; width: 100% !important; }
  .print-doc { position: absolute; inset: 0; }
  .print-doc [style*="max-height"] { max-height: none !important; overflow: visible !important; }
  .no-print { display: none !important; }
}

/* Card title as a real button (fixes nested-interactive: outer card is no
   longer role=button; keyboard/AT users activate via the title). */
.cardlink { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: start; }
.lcard .title .cardlink { text-transform: uppercase; font-weight: 800; font-family: var(--heading); font-size: 18px; letter-spacing: 0; }
