/* XapidPriceFinder — Variant A "Scoreboard" design system (UI-DESIGN.md, Gate 2). */
:root {
  --ink: #1b1e28;
  --muted: #6b7080;
  --paper: #f7f7f9;
  --card: #fff;
  --line: #e4e5eb;
  --primary: #0f766e;
  --primary-ink: #fff;
  --win: #15803d;
  --win-bg: #eaf7ee;
  --warn: #b45309;
  --warn-bg: #fef6e7;
  --banner: #facc15;
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    "Noto Sans",
    sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}
.phone {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--paper);
}

/* PROTOTYPE banner — persistent, sticky, never dismissible */
.proto {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--banner);
  color: #111;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  padding: 7px 10px;
  letter-spacing: 0.02em;
  border-bottom: 1px solid rgba(0, 0, 0, 0.15);
}

header {
  padding: 14px 16px 4px;
}
.brand {
  font-size: 20px;
  font-weight: 800;
}
.brand em {
  color: var(--primary);
  font-style: normal;
}
.tag {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.pin {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 10px 0 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  min-height: 36px;
  font-family: inherit;
}
.pin b {
  font-weight: 600;
}
.pin .chg {
  color: var(--primary);
  font-weight: 600;
}
.pinedit {
  display: none;
  margin-top: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}
.pinedit label {
  font-size: 12px;
  font-weight: 600;
  display: block;
  margin-bottom: 6px;
}
.pinedit .hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}
.pinedit .err {
  font-size: 12px;
  color: #b91c1c;
  margin-top: 6px;
  display: none;
}
.pinrow {
  display: flex;
  gap: 8px;
}
.pinrow input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 16px;
  font-family: inherit;
}
.pinrow button {
  border: 0;
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  min-height: 44px;
  font-family: inherit;
}

.searchwrap {
  padding: 12px 16px 0;
  position: sticky;
  top: 32px;
  background: var(--paper);
  z-index: 40;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.search {
  display: flex;
  gap: 8px;
}
.search input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 16px;
  background: var(--card);
  font-family: inherit;
  min-height: 48px;
}
.search input:focus {
  outline: 2px solid var(--primary);
  border-color: var(--primary);
}
.search button {
  border: 0;
  background: var(--primary);
  color: var(--primary-ink);
  border-radius: 12px;
  padding: 0 18px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  min-height: 48px;
  font-family: inherit;
}

/* empty state */
.empty {
  padding: 36px 24px;
  text-align: center;
}
.empty h2 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 8px;
}
.empty p {
  color: var(--muted);
  max-width: 320px;
  margin: 0 auto 18px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.chips button {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  min-height: 40px;
}

/* verdict */
.verdict {
  display: none;
  margin: 14px 16px 0;
  background: var(--win-bg);
  border: 1px solid #bbe3c5;
  border-radius: 14px;
  padding: 14px 16px;
}
.verdict .v1 {
  font-weight: 800;
  font-size: 16px;
  color: var(--win);
}
.verdict .v2 {
  font-size: 13px;
  color: #2c6e3b;
  margin-top: 2px;
}
.allfail {
  display: none;
  margin: 14px 16px 0;
  background: var(--warn-bg);
  border: 1px solid #f1d9ae;
  border-radius: 14px;
  padding: 16px;
  text-align: center;
}
.allfail p {
  font-size: 14px;
  color: var(--warn);
  margin-bottom: 10px;
}
.allfail button {
  border: 0;
  background: var(--primary);
  color: #fff;
  border-radius: 10px;
  padding: 10px 18px;
  font-weight: 700;
  cursor: pointer;
  min-height: 44px;
  font-family: inherit;
}

/* B-2: rejected-request state (server 400) — the input's fault, not the platforms' */
.reqerr {
  display: none;
  margin: 14px 16px 0;
  background: var(--warn-bg);
  border: 1px solid #f1d9ae;
  border-radius: 14px;
  padding: 16px;
  text-align: center;
}
.reqerr p {
  font-size: 14px;
  color: var(--warn);
}

.qecho {
  display: none;
  margin: 12px 16px 0;
  font-size: 13px;
  color: var(--muted);
}
.qecho b {
  color: var(--ink);
}
.samplenote {
  display: none;
  margin: 10px 16px 0;
  font-size: 12px;
  color: var(--warn);
  background: var(--warn-bg);
  border: 1px solid #f1d9ae;
  border-radius: 10px;
  padding: 8px 12px;
}

/* result rows */
#rows {
  padding: 10px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.row {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  display: block;
  color: inherit;
  text-decoration: none;
  transition: transform 0.25s ease;
}
.row.win {
  border: 1.5px solid var(--win);
  background: var(--win-bg);
}
.rtop {
  display: flex;
  align-items: center;
  gap: 10px;
}
.badge {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.pname {
  flex: 1;
  min-width: 0;
}
.pname .plat {
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.pname .item {
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.price {
  font-size: 20px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.price.dim {
  color: var(--muted);
  text-decoration: line-through;
  font-weight: 600;
  font-size: 16px;
}
.rbot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  gap: 8px;
}
.meta {
  font-size: 12px;
  color: var(--muted);
}
.meta .ok {
  color: var(--win);
  font-weight: 600;
}
.meta .oos {
  color: var(--warn);
  font-weight: 600;
}
.fresh {
  font-size: 11px;
  color: var(--muted);
}
.pill {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 8px;
  vertical-align: 1px;
}
.pill.win {
  background: var(--win);
  color: #fff;
}
.pill.sample {
  background: var(--warn);
  color: #fff;
}
.pill.mismatch {
  background: var(--warn-bg);
  color: var(--warn);
  border: 1px solid #f1d9ae;
}
.go {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}

.row.loading .rtop {
  opacity: 0.85;
}
.spin {
  width: 16px;
  height: 16px;
  border: 2px solid var(--line);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: sp 0.8s linear infinite;
  flex: none;
}
@keyframes sp {
  to {
    transform: rotate(360deg);
  }
}
.skel {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, #ecedf2, #f6f6f9, #ecedf2);
  background-size: 200% 100%;
  animation: sh 1.2s infinite;
}
@keyframes sh {
  to {
    background-position: -200% 0;
  }
}

.row.fail {
  background: var(--warn-bg);
  border-color: #f1d9ae;
}
.fail .ftitle {
  font-weight: 700;
  font-size: 14px;
  color: var(--warn);
}
.fail .fbody {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
}
.factions {
  display: flex;
  gap: 14px;
  margin-top: 8px;
}
.factions button,
.factions a {
  border: 0;
  background: none;
  padding: 6px 0;
  color: var(--primary);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  min-height: 32px;
}

footer {
  padding: 14px 16px 28px;
  font-size: 11.5px;
  color: var(--muted);
  text-align: center;
}
