/* Lotline demo styles.
   Look: eucalyptus green on quiet neutral greys, IBM Plex Sans + IBM Plex Sans Arabic.
   One bold element per screen (the price panel); everything else stays calm.
   Logical properties (inline-start/end) keep the layout correct in Arabic (RTL). */

:root {
  --page: #E6E8E4;
  --bg: #F2F3F1;
  --surface: #FFFFFF;
  --surface-2: #F6F7F5;
  --ink: #14191A;
  --ink-2: #465052;
  --ink-3: #5F6A6D;
  --line: #E1E4E0;
  --line-strong: #C6CCC6;
  --brand: #1D5C4A;
  --brand-hover: #164A3B;
  --brand-tint: #E4EEE9;
  --brand-ink: #123E31;
  --warn: #9E450B;
  --warn-tint: #FAEDE2;
  --danger: #B42318;
  --danger-tint: #FCEBE9;
  --ring: 0 0 0 3px rgba(29, 92, 74, 0.2);

  --r-s: 8px;
  --r-m: 12px;
  --r-l: 16px;
  --r-xl: 22px;

  --topbar-h: 56px;
  --tabbar-h: 66px;
  --bidbar-h: 76px;

  --font: "IBM Plex Sans", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-ar: "IBM Plex Sans Arabic", "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
}
html[lang="ar"] body { font-family: var(--font-ar); line-height: 1.7; }
.i18n-pending body { opacity: 0; }
h1, h2, h3, p, figure, dl, dd { margin: 0; }
img { display: block; max-width: 100%; }
a { color: var(--brand); text-underline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
bdi { unicode-bidi: isolate; }
[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; z-index: 100;
  inset-inline-start: 12px; top: -60px;
  padding: 10px 14px; border-radius: var(--r-s);
  background: var(--ink); color: #fff; font-weight: 600;
}
.skip-link:focus { top: 12px; }

.icon { width: 20px; height: 20px; flex: none; }
html[dir="rtl"] .flip { transform: scaleX(-1); }
.muted { color: var(--ink-3); }
.small { font-size: 13.5px; }
.body-2 { color: var(--ink-2); }
.with-icon { display: inline-flex; align-items: center; gap: 6px; }
.with-icon .icon { width: 16px; height: 16px; }

/* ---------- App shell ---------- */
.app {
  position: relative;
  display: flex; flex-direction: column;
  max-width: 480px; min-height: 100vh; min-height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  overflow-x: clip;
}
@media (min-width: 520px) { .app { box-shadow: 0 0 0 1px var(--line); } }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: calc(var(--topbar-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 12px 0;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 44px; padding-inline: 4px;
  color: var(--ink); text-decoration: none;
  font-size: 17px; font-weight: 700;
}
.icon-logo { width: 28px; height: 28px; color: var(--brand); flex: none; }
.lang-btn {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  background: var(--surface); cursor: pointer;
  font-size: 14px; font-weight: 500;
}
.lang-btn:hover { border-color: var(--ink-3); }
.lang-btn .icon { width: 18px; height: 18px; color: var(--ink-3); }
.icon-btn {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px;
  border: 0; border-radius: var(--r-m);
  background: transparent; color: var(--ink); cursor: pointer;
}
.icon-btn:hover { background: rgba(20, 25, 26, 0.06); }

.main { flex: 1; padding: 20px 16px 32px; }
.has-tabbar .main { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 28px); }
.has-bidbar .main { padding-bottom: calc(var(--bidbar-h) + env(safe-area-inset-bottom) + 28px); }
.page-title { margin-bottom: 16px; font-size: 28px; font-weight: 700; line-height: 1.2; }
html[lang="en"] .page-title,
html[lang="en"] .auth-title,
html[lang="en"] .detail-title,
html[lang="en"] .deal-title { letter-spacing: -0.015em; }

.tabbar {
  position: fixed; z-index: 30; bottom: 0; inset-inline: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 480px; margin: 0 auto;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 52px; border-radius: var(--r-m);
  color: var(--ink-3); text-decoration: none;
  font-size: 12.5px; font-weight: 500;
}
.tab-icon { position: relative; display: grid; place-items: center; width: 56px; height: 30px; border-radius: 999px; }
.tab[aria-current="page"] { color: var(--brand); font-weight: 600; }
.tab[aria-current="page"] .tab-icon { background: var(--brand-tint); }
.tab-dot {
  position: absolute; top: 3px; inset-inline-end: 14px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--warn); box-shadow: 0 0 0 2px var(--surface);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px;
  border: 1px solid transparent; border-radius: var(--r-m);
  font-size: 15px; font-weight: 600; line-height: 1.2;
  text-decoration: none; text-align: center; cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.btn .icon { width: 18px; height: 18px; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-hover); }
.btn-secondary { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn-secondary:hover { border-color: var(--ink-3); }
.btn-ghost { background: transparent; color: var(--brand); }
.btn-ghost:hover { background: var(--brand-tint); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }
.btn-small { min-height: 44px; padding: 0 14px; border-radius: 10px; font-size: 14px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn[aria-busy="true"] { opacity: 0.8; cursor: progress; }
.btn-link {
  min-height: 44px; padding: 0 4px;
  border: 0; background: none; cursor: pointer;
  color: var(--brand); font-weight: 600;
  text-decoration: underline; text-underline-offset: 2px;
}
.btn-link:disabled { color: var(--ink-3); text-decoration: none; cursor: default; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin: 0 0 18px; padding: 0; border: 0; }
.field > label, .field > legend { padding: 0; font-size: 14px; font-weight: 600; }
.field input:not([type="checkbox"]):not([type="radio"]),
.field select,
.field textarea {
  width: 100%; min-height: 48px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--surface); color: var(--ink);
  font-size: 16px; /* 16px stops iOS from zooming in */
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field textarea { min-height: 96px; padding: 12px 14px; line-height: 1.5; resize: vertical; }
.field select {
  appearance: none;
  padding-inline-end: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235F6A6D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-size: 18px; background-position: right 14px center;
}
html[dir="rtl"] .field select { background-position: left 14px center; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.field [aria-invalid="true"] { border-color: var(--danger) !important; }
.field [aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.18); }
.hint { font-size: 13px; color: var(--ink-3); }
.field:has([aria-invalid="true"]) > .hint { display: none; }
.field-error { display: flex; align-items: flex-start; gap: 6px; font-size: 13.5px; color: var(--danger); }
.field-error .icon { width: 16px; height: 16px; margin-top: 2px; }
.form-error {
  display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 18px; padding: 12px 14px;
  border-radius: var(--r-m); background: var(--danger-tint); color: var(--danger);
  font-size: 14px;
}
.form-error:focus { outline: none; }
.form-error .icon { margin-top: 1px; }
.form-error a { color: inherit; font-weight: 600; }

.password-wrap { position: relative; }
.password-wrap input { padding-inline-end: 52px !important; }
.password-wrap .icon-btn { position: absolute; inset-block-start: 2px; inset-inline-end: 2px; color: var(--ink-3); }
.password-wrap .icon-btn[aria-pressed="true"] { color: var(--brand); }

.field > label.check { display: grid; grid-template-columns: 24px 1fr; align-items: start; gap: 10px; font-size: 14px; font-weight: 400; color: var(--ink-2); cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--brand); }
.check a { font-weight: 600; }

.code-input {
  min-height: 60px !important;
  text-align: center;
  font-size: 26px !important; font-weight: 600;
  letter-spacing: 0.5em; padding-inline-start: calc(14px + 0.5em) !important;
  font-variant-numeric: tabular-nums;
}

.money-input { position: relative; }
.money-input input {
  min-height: 58px !important;
  padding-inline-start: 50px !important;
  font-size: 22px !important; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.money-prefix {
  position: absolute; top: 50%; inset-inline-start: 16px;
  transform: translateY(-50%);
  font-size: 16px; font-weight: 600; color: var(--ink-3);
}

.segmented {
  position: relative;
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px;
  padding: 4px; border-radius: var(--r-m);
  background: var(--surface-2); border: 1px solid var(--line);
}
.segmented input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.segmented label {
  display: grid; place-items: center;
  min-height: 44px; padding: 0 6px; border-radius: 9px;
  font-size: 14px; font-weight: 500; color: var(--ink-2);
  text-align: center; cursor: pointer;
}
.segmented input:checked + label {
  background: var(--surface); color: var(--ink); font-weight: 600;
  box-shadow: 0 1px 2px rgba(20, 25, 26, 0.08), 0 0 0 1px var(--line);
}
.segmented input:focus-visible + label { outline: 2px solid var(--brand); outline-offset: 1px; }
.range { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.range .field { margin-bottom: 0; }
.range label { font-size: 13px; font-weight: 500; color: var(--ink-2); }

/* ---------- Auth screens ---------- */
.auth { padding-top: 32px; }
.auth-head { display: grid; gap: 8px; margin-bottom: 26px; }
.auth-head .icon-logo { width: 48px; height: 48px; margin-bottom: 10px; }
.auth-badge {
  display: grid; place-items: center;
  width: 52px; height: 52px; margin-bottom: 10px;
  border-radius: 16px; background: var(--brand-tint); color: var(--brand);
}
.auth-badge .icon { width: 26px; height: 26px; }
.auth-title { font-size: 28px; font-weight: 700; line-height: 1.2; }
.lead { font-size: 16px; color: var(--ink-2); }
.auth-switch {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 8px;
  margin-top: 18px; color: var(--ink-2); text-align: center;
}
.auth-switch a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.auth-row { display: flex; justify-content: flex-end; margin: -10px 0 14px; }
.auth-row a { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; font-weight: 600; }
.demo-note {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 18px; padding: 10px 12px;
  border: 1px dashed var(--line-strong); border-radius: 10px;
  background: var(--surface-2); color: var(--ink-2); font-size: 13.5px;
}
.demo-note .icon { width: 18px; height: 18px; color: var(--ink-3); }

/* ---------- Browse ---------- */
.search-row { display: flex; gap: 10px; margin-bottom: 14px; }
.search { position: relative; flex: 1; }
.search-icon { position: absolute; top: 50%; inset-inline-start: 14px; display: grid; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.search input {
  width: 100%; min-height: 48px; padding-inline: 44px 14px;
  border: 1px solid var(--line-strong); border-radius: var(--r-m);
  background: var(--surface); font-size: 16px;
}
.search input:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.filter-btn { padding: 0 14px; }
.count-badge {
  display: inline-grid; place-items: center;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--brand); color: #fff; font-size: 12px; font-weight: 700;
}

.chips {
  display: flex; gap: 8px;
  margin: 0 -16px 6px; padding: 2px 16px 6px;
  overflow-x: auto; scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-height: 44px; padding: 0 16px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  background: var(--surface); cursor: pointer; white-space: nowrap;
  font-size: 14px; font-weight: 500;
}
.chip:hover { border-color: var(--ink-3); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.results-count { margin: 6px 0 12px; font-size: 13.5px; color: var(--ink-3); }

.auction-list { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.card {
  display: block; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l);
  color: inherit; text-decoration: none;
  transition: border-color 0.15s;
}
.card:hover { border-color: var(--line-strong); }
.card:focus-visible { outline-offset: 3px; }
.card-media { position: relative; aspect-ratio: 16 / 10; background: var(--surface-2); }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.media-badge {
  position: absolute; inset-block-start: 12px; inset-inline-start: 12px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px; border-radius: 999px;
  background: rgba(20, 25, 26, 0.8); color: #fff;
  font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.media-badge .icon { width: 15px; height: 15px; }
.media-badge.is-urgent { background: var(--warn); }
.card-body { display: grid; gap: 4px; padding: 14px 16px 16px; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 14px; font-size: 13px; color: var(--ink-3); }
.meta-link { display: inline-flex; align-items: center; min-height: 32px; color: var(--brand); font-weight: 600; text-decoration: none; }
.card-title { font-size: 17px; font-weight: 600; line-height: 1.35; }
.card-qty { font-size: 14px; color: var(--ink-2); }
.card-foot {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
  margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line);
}
.price-label { font-size: 12.5px; color: var(--ink-3); }
.price { font-size: 21px; font-weight: 700; line-height: 1.25; font-variant-numeric: tabular-nums; }
.card-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; font-size: 13px; }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.pill .icon { width: 14px; height: 14px; }
.pill--lead { background: var(--brand-tint); color: var(--brand-ink); }
.pill--warn { background: var(--warn-tint); color: var(--warn); }
.pill--muted { background: var(--surface-2); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }

.empty { display: grid; justify-items: center; gap: 10px; padding: 44px 16px; text-align: center; }
.empty-icon {
  display: grid; place-items: center; width: 52px; height: 52px;
  border: 1px solid var(--line); border-radius: 16px;
  background: var(--surface); color: var(--ink-3);
}
.empty-title { font-size: 16px; font-weight: 600; }

/* ---------- Auction detail ---------- */
.main--detail { padding-top: 0; background: var(--surface); }
.gallery { position: relative; margin: 0 -16px; background: var(--surface-2); }
.gallery-track {
  display: flex; overflow-x: auto;
  scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain;
}
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-track:focus-visible { outline-offset: -3px; }
.gallery-slide { flex: 0 0 100%; aspect-ratio: 4 / 3; scroll-snap-align: center; }
.gallery-slide img { width: 100%; height: 100%; object-fit: cover; }
.gallery-count {
  position: absolute; inset-block-end: 12px; inset-inline-end: 12px;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(20, 25, 26, 0.75); color: #fff;
  font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.detail-head { display: grid; gap: 4px; padding: 16px 0 18px; }
.detail-title { font-size: 24px; font-weight: 700; line-height: 1.25; }
.detail-qty { margin-top: 2px; font-size: 15px; color: var(--ink-2); }

/* The one bold element: price and time */
.price-panel {
  display: grid; gap: 14px;
  padding: 18px; border-radius: var(--r-l);
  background: var(--brand); color: #fff;
}
.pp-main { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.pp-price { flex: 1 1 auto; min-width: 0; }
.pp-label { font-size: 13px; color: rgba(255, 255, 255, 0.8); }
.pp-label.dark { color: var(--ink-3); }
.pp-amount { margin: 2px 0 6px; font-size: 34px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
html[lang="en"] .pp-amount { letter-spacing: -0.02em; }
.pp-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13.5px; color: rgba(255, 255, 255, 0.88); }
.pp-sep { width: 1px; height: 12px; background: rgba(255, 255, 255, 0.35); }
.pp-timer { flex: 0 1 auto; min-width: 0; max-width: 50%; text-align: end; }
.pp-clock { margin: 2px 0 6px; font-size: 24px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pp-flags { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, 0.2); }
.pp-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px;
  background: #fff; color: var(--brand-ink);
  font-size: 13px; font-weight: 600;
}
.pp-chip .icon { width: 15px; height: 15px; }
.pp-chip.is-warn { color: var(--warn); }
.price-panel.is-updated { animation: pp-pulse 1.1s var(--ease); }
@keyframes pp-pulse {
  0% { box-shadow: 0 0 0 0 rgba(29, 92, 74, 0.5); }
  100% { box-shadow: 0 0 0 16px rgba(29, 92, 74, 0); }
}

.detail-section { padding: 22px 0; border-bottom: 1px solid var(--line); }
.detail-section:last-child { border-bottom: 0; }
.section-title { margin-bottom: 12px; font-size: 17px; font-weight: 600; }
.seller-row { display: flex; align-items: center; gap: 12px; }
.seller-name { font-weight: 600; }
.rating { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; font-size: 13.5px; color: var(--ink-2); }
.rating .icon { width: 15px; height: 15px; }
.icon.is-filled { fill: currentColor; color: var(--ink); }
.avatar {
  display: grid; place-items: center; flex: none;
  width: 44px; height: 44px; border-radius: var(--r-m);
  background: var(--brand-tint); color: var(--brand-ink);
  font-size: 15px; font-weight: 700;
}
.avatar--sm { width: 32px; height: 32px; border-radius: 9px; font-size: 12px; }
.avatar--lg { width: 56px; height: 56px; border-radius: var(--r-l); font-size: 19px; }
.specs { white-space: pre-line; color: var(--ink-2); line-height: 1.7; }
.pickup { margin-top: 10px; }

.doc-list { display: grid; }
.doc-row {
  display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 56px; padding: 8px 0;
  border: 0; border-top: 1px solid var(--line);
  background: none; text-align: start; cursor: pointer;
}
.doc-row:first-child { border-top: 0; }
.doc-row:hover .doc-name { color: var(--brand); }
.doc-icon {
  display: grid; place-items: center; width: 40px; height: 40px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface-2); color: var(--ink-2);
}
.doc-name { flex: 1; font-weight: 500; }

.note { display: grid; gap: 4px; padding: 12px 14px; border-radius: var(--r-m); background: var(--surface-2); }
.note + .note { margin-top: 8px; }

.qa-list { display: grid; gap: 18px; margin: 0 0 20px; padding: 0; list-style: none; }
.qa { display: grid; gap: 4px; }
.qa-q { font-weight: 600; }
.qa-meta { font-size: 13px; }
.qa-a { margin-top: 4px; padding: 10px 12px; border-radius: var(--r-m); background: var(--surface-2); }
.qa-a-label { margin-bottom: 2px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.qa-pending { font-size: 13.5px; color: var(--warn); }
.qa-empty { margin-bottom: 16px; }

.history { margin: 0; padding: 0; list-style: none; }
.history-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-top: 1px solid var(--line);
}
.history-row:first-child { border-top: 0; }
.history-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.history-name { display: block; font-weight: 500; }
.history-time { display: block; font-size: 12.5px; }
.history-amount { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.history-row.is-top .history-amount { color: var(--brand); }

.bidbar {
  position: fixed; z-index: 30; bottom: 0; inset-inline: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  max-width: 480px; min-height: var(--bidbar-h); margin: 0 auto;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 20px rgba(20, 25, 26, 0.06);
}
.bidbar-info { min-width: 0; }
.bidbar-label { font-size: 12.5px; color: var(--ink-3); }
.bidbar-amount { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.bidbar-result { font-size: 14px; font-weight: 600; }
.bidbar-btn { flex: none; min-width: 150px; }
.bidbar-note { display: flex; flex: 1; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); }
.bidbar-note.is-brand { color: var(--brand); font-weight: 600; }

/* ---------- Sheets and dialogs ---------- */
dialog { color: var(--ink); }
dialog::backdrop { background: rgba(20, 25, 26, 0.48); }
.sheet {
  position: fixed; inset: 0;
  width: 100%; max-width: 480px; max-height: min(88dvh, 720px);
  margin: auto auto 0; padding: 0; border: 0;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  background: var(--surface);
  box-shadow: 0 -12px 40px rgba(20, 25, 26, 0.2);
  overflow: hidden;
}
.sheet[open] { animation: sheet-up 0.24s var(--ease); }
@keyframes sheet-up { from { transform: translateY(32px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-body { max-height: inherit; overflow-y: auto; padding: 6px 20px calc(20px + env(safe-area-inset-bottom)); }
.sheet-grip { width: 40px; height: 4px; margin: 6px auto 8px; border-radius: 2px; background: var(--line-strong); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.sheet-title { font-size: 19px; font-weight: 700; }
.sheet-actions { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; margin-top: 6px; }

.modal {
  width: calc(100% - 32px); max-width: 380px;
  padding: 22px; border: 0; border-radius: var(--r-l);
  box-shadow: 0 20px 50px rgba(20, 25, 26, 0.25);
}
.modal[open] { animation: modal-in 0.18s var(--ease); }
@keyframes modal-in { from { transform: scale(0.97); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-title { margin-bottom: 8px; font-size: 18px; font-weight: 700; }
.modal-body { margin-bottom: 20px; color: var(--ink-2); }
.modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }

.bid-now {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin-bottom: 18px; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface-2);
}
.bid-now-amount { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.quick-amounts { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 18px; }
.bid-final { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 16px; font-size: 13.5px; color: var(--ink-2); }
.bid-final .icon { width: 18px; height: 18px; margin-top: 2px; color: var(--ink-3); }

/* ---------- Alerts and toasts ---------- */
.alerts {
  position: sticky; z-index: 25;
  top: calc(var(--topbar-h) + env(safe-area-inset-top));
  display: grid; gap: 8px; padding: 0 12px;
}
.alerts:empty { display: none; }
.alert {
  display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 12px;
  margin-top: 10px; padding: 12px 14px;
  border: 1px solid var(--line-strong); border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(20, 25, 26, 0.12);
  animation: alert-in 0.25s var(--ease);
}
@keyframes alert-in { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }
.alert-icon { display: grid; place-items: center; grid-row: span 2; width: 36px; height: 36px; border-radius: 10px; }
.alert--warn .alert-icon { background: var(--warn-tint); color: var(--warn); }
.alert--brand .alert-icon { background: var(--brand-tint); color: var(--brand); }
.alert--muted .alert-icon { background: var(--surface-2); color: var(--ink-2); }
.alert-text { align-self: center; font-size: 14px; line-height: 1.45; }
.alert-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.toast-region {
  position: fixed; z-index: 70; inset-inline: 0;
  bottom: calc(20px + env(safe-area-inset-bottom));
  display: grid; justify-items: center; gap: 8px;
  padding: 0 16px; pointer-events: none;
}
.has-tabbar .toast-region { bottom: calc(var(--tabbar-h) + 14px + env(safe-area-inset-bottom)); }
.has-bidbar .toast-region { bottom: calc(var(--bidbar-h) + 14px + env(safe-area-inset-bottom)); }
.toast {
  width: 100%; max-width: 448px; padding: 12px 16px;
  border-radius: var(--r-m); background: var(--ink); color: #fff;
  font-size: 14px; box-shadow: 0 10px 28px rgba(20, 25, 26, 0.25);
  pointer-events: auto;
  animation: toast-in 0.22s var(--ease);
}
.toast--success { background: var(--brand-ink); }
.toast.is-leaving { opacity: 0; transform: translateY(6px); transition: opacity 0.2s, transform 0.2s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- My bids ---------- */
.tabs {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px;
  margin-bottom: 16px; padding: 4px;
  border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface-2);
}
.tab-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; border: 0; border-radius: 9px;
  background: transparent; color: var(--ink-2); cursor: pointer; font-weight: 500;
}
.tab-btn[aria-selected="true"] {
  background: var(--surface); color: var(--ink); font-weight: 600;
  box-shadow: 0 1px 2px rgba(20, 25, 26, 0.08), 0 0 0 1px var(--line);
}
.tab-count {
  display: inline-grid; place-items: center;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--ink); color: #fff; font-size: 12px; font-weight: 700;
}
.tab-count:empty { display: none; }
[role="tabpanel"]:focus-visible { outline-offset: 4px; border-radius: var(--r-s); }
.bid-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.bid-row {
  display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 14px;
  padding: 12px; border: 1px solid var(--line); border-radius: var(--r-l);
  background: var(--surface); color: inherit; text-decoration: none;
}
.bid-row:hover { border-color: var(--line-strong); }
.bid-thumb { width: 88px; height: 88px; border-radius: 10px; background: var(--surface-2); object-fit: cover; }
.bid-row-body { display: grid; align-content: start; justify-items: start; gap: 6px; min-width: 0; }
.bid-row-title { font-size: 15.5px; font-weight: 600; line-height: 1.35; }
.kv { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.kv dt { font-size: 12.5px; color: var(--ink-3); }
.kv dd { font-weight: 600; font-variant-numeric: tabular-nums; }
.row-cta { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 600; color: var(--brand); }
.row-cta .icon { width: 16px; height: 16px; }

/* ---------- Deal ---------- */
.stack { display: grid; gap: 14px; }
.panel { padding: 18px; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); }
#deal-root { display: grid; gap: 14px; }
.deal-hero { display: grid; justify-items: center; gap: 4px; padding: 10px 0 8px; text-align: center; }
.deal-check {
  display: grid; place-items: center;
  width: 56px; height: 56px; margin-bottom: 10px; border-radius: 50%;
  background: var(--brand); color: #fff;
}
.deal-check .icon { width: 28px; height: 28px; stroke-width: 2.25; }
.deal-title { font-size: 26px; font-weight: 700; }
.deal-item { margin-bottom: 12px; color: var(--ink-2); }
.deal-amount { font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; }
.deadline {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-m);
  background: var(--surface);
}
.deadline .icon { width: 22px; height: 22px; margin-top: 1px; color: var(--brand); }
.deadline.is-overdue .icon { color: var(--warn); }
.deadline-date { font-weight: 600; }
.steps { display: grid; gap: 20px; margin: 0; padding: 0; list-style: none; }
.step { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; }
.step h3 { margin-bottom: 2px; font-size: 15.5px; font-weight: 600; }
.step-num {
  display: grid; place-items: center; width: 32px; height: 32px;
  border: 1.5px solid var(--line-strong); border-radius: 50%;
  font-size: 14px; font-weight: 700; color: var(--ink-2);
}
.seller-card { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 12px; border-radius: var(--r-m); background: var(--surface-2); }
.contact-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.contact-lines { display: grid; gap: 2px; margin-top: 8px; font-size: 13.5px; color: var(--ink-2); }
.status-note {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; border-radius: var(--r-m);
  background: var(--brand-tint); color: var(--brand-ink);
}
.status-note.is-warn { background: var(--warn-tint); color: var(--warn); }
.status-note .icon { width: 22px; height: 22px; flex: none; }
.status-title { font-weight: 700; }
.deal-actions { display: grid; gap: 8px; }

.stars-field { min-width: 0; margin: 0 0 16px; padding: 0; border: 0; }
.rating-legend { margin-bottom: 8px; padding: 0; font-size: 16px; font-weight: 700; }
.stars { display: flex; gap: 4px; }
.star {
  display: grid; place-items: center; width: 48px; height: 48px;
  border-radius: var(--r-m); color: var(--line-strong); cursor: pointer;
}
.star .icon { width: 32px; height: 32px; }
.star:hover { background: var(--surface-2); }
.stars input:focus-visible + .star { outline: 2px solid var(--brand); outline-offset: 1px; }
.stars[data-value="1"] .star:nth-of-type(-n+1),
.stars[data-value="2"] .star:nth-of-type(-n+2),
.stars[data-value="3"] .star:nth-of-type(-n+3),
.stars[data-value="4"] .star:nth-of-type(-n+4),
.stars[data-value="5"] .star:nth-of-type(-n+5) { color: var(--ink); }
.stars[data-value="1"] .star:nth-of-type(-n+1) .icon,
.stars[data-value="2"] .star:nth-of-type(-n+2) .icon,
.stars[data-value="3"] .star:nth-of-type(-n+3) .icon,
.stars[data-value="4"] .star:nth-of-type(-n+4) .icon,
.stars[data-value="5"] .star:nth-of-type(-n+5) .icon { fill: currentColor; }
.posted-stars { display: inline-flex; gap: 2px; }
.posted-stars .icon { width: 22px; height: 22px; color: var(--line-strong); }
.posted-stars .icon.is-on { color: var(--ink); fill: currentColor; }

/* ---------- Account ---------- */
.account-card {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 18px; padding: 16px;
  border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface);
}
.account-id { display: grid; gap: 2px; min-width: 0; }
.account-id .with-icon { font-size: 14px; }
.account-name { font-size: 17px; font-weight: 700; }
.list { margin-bottom: 24px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); }
.list-row { display: flex; justify-content: space-between; gap: 16px; padding: 14px 16px; border-top: 1px solid var(--line); }
.list-row:first-child { border-top: 0; }
.list-row dt { color: var(--ink-3); }
.list-row dd { font-weight: 500; text-align: end; overflow-wrap: anywhere; }
.list-group { min-width: 0; margin: 0 0 24px; padding: 0; border: 0; }
.list-title { margin-bottom: 8px; padding: 0; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.list-hint { margin-top: 8px; }
.list-buttons { overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); }
.demo-tools .list-buttons { border-style: dashed; border-color: var(--line-strong); }
.list-button {
  display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 54px; padding: 0 16px;
  border: 0; border-top: 1px solid var(--line);
  background: none; text-align: start; cursor: pointer; font-weight: 500;
}
.list-button:first-child { border-top: 0; }
.list-button:hover { background: var(--surface-2); }
.list-button .icon { color: var(--ink-3); }
.list-button.is-danger, .list-button.is-danger .icon { color: var(--danger); }

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