/* PullCheck shared chrome — components built from tokens.css.
   Used by styleguide.html and every screen in screens/. */

* { box-sizing: border-box; margin: 0; }

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.45;
  color: var(--text);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}

/* ---- the phone screen shell: exactly 390x844 ---- */
.screen {
  width: 390px; height: 844px;
  margin: 0 auto;
  background: var(--canvas);
  display: flex; flex-direction: column;
  overflow: hidden;
  position: relative;
}
.screen-body { flex: 1; overflow-y: auto; padding: 0 var(--sp-4); }

/* ---- status row + the offline pill (a feature, not an apology) ---- */
.status-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px var(--sp-4) 6px;
  font-size: var(--fs-caption); font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: var(--fs-micro); font-weight: 600;
  padding: 3px 9px; border-radius: var(--r-pill);
  letter-spacing: .01em;
}
.pill svg { width: 11px; height: 11px; }
.pill.offline { background: var(--accent-soft); color: var(--accent-soft-ink); }
.pill.ok      { background: var(--ok-soft);     color: var(--ok-ink); }
.pill.warn    { background: var(--warn-soft);   color: var(--warn-ink); }
.pill.quiet   { background: var(--raised);      color: var(--text-2); }

/* ---- screen header ---- */
.screen-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-2) 0 var(--sp-4);
}
.screen-head h1 {
  font-family: var(--font-display);
  font-size: var(--fs-title); font-weight: 600; letter-spacing: -.01em;
}
.screen-head .mini { font-size: var(--fs-caption); color: var(--text-3); font-weight: 400; }

/* ---- card art: sacred. 63:88, never cropped, sleeve edge highlight ---- */
.card-art {
  aspect-ratio: 63 / 88;
  border-radius: var(--r-art);
  position: relative; overflow: hidden;
  background: linear-gradient(165deg, #2A3B58, #1A2740 60%, #14203A);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16);  /* the sleeve edge */
}
/* the card's own frame + art window, so placeholders read as cards */
.card-art::before {
  content: "";
  position: absolute; inset: 6% 6.5% auto;
  height: 52%;
  border-radius: 4px;
  background:
    radial-gradient(120% 100% at 28% 18%, #4E7FB0 0%, transparent 58%),
    radial-gradient(110% 90% at 76% 78%, #7A5EA8 0%, transparent 55%),
    linear-gradient(150deg, #33517A, #232F52);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .1);
}
.theme-light .card-art, [data-theme="light"] .card-art {
  background: linear-gradient(165deg, #E4EBF4, #CBD8E7 60%, #BCCCDE);
  box-shadow: inset 0 0 0 1px rgba(19, 26, 36, .14);
}
.theme-light .card-art::before, [data-theme="light"] .card-art::before {
  background:
    radial-gradient(120% 100% at 28% 18%, #9FC2E2 0%, transparent 58%),
    radial-gradient(110% 90% at 76% 78%, #C0A8E0 0%, transparent 55%),
    linear-gradient(150deg, #8FB0D2, #7E93BE);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .5);
}
.card-art.mini { border-radius: var(--r-art-mini); }
.card-art .art-label {
  position: absolute; inset: auto 0 0 0;
  padding: 22% var(--sp-2) var(--sp-2);
  font-size: var(--fs-micro); font-weight: 600; text-align: center;
  color: #EAF0F8;
  background: linear-gradient(transparent, rgba(6, 10, 18, .72));
}
.theme-light .card-art .art-label,
[data-theme="light"] .card-art .art-label {
  color: #F6FAFF;
  background: linear-gradient(transparent, rgba(44, 60, 82, .62));
}

/* ---- tiles + list rows ---- */
.tile {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-card);
  padding: var(--sp-4);
}

/* ---- buttons: 44pt floor, 56pt primary, bottom-half reach ---- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: var(--tap-min);
  font-family: var(--font-display);
  font-size: var(--fs-body); font-weight: 600;
  border: none; border-radius: var(--r-control);
  cursor: pointer; text-decoration: none;
  color: var(--text);
  background: var(--raised);
  transition: transform var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease);
}
.btn.primary {
  min-height: var(--tap-primary);
  background: var(--accent); color: var(--accent-ink);
  font-size: var(--fs-body);
}
.btn.secondary {
  background: transparent; color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--line);
}
.btn:active { transform: scale(.98); }
.btn:focus-visible, .pill:focus-visible, .pocket:focus-visible,
.candidate:focus-visible, .tab:focus-visible {
  outline: none; box-shadow: var(--focus-ring);
}

/* ---- price + provenance: a number without a source is a rumor ---- */
.price { font-family: var(--font-data); font-variant-numeric: tabular-nums; }
.provenance {
  font-family: var(--font-data);
  font-size: var(--fs-micro);
  color: var(--text-3);
  letter-spacing: .01em;
}

/* ---- the receipt (price-detail evidence) ---- */
.receipt {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-card) var(--r-card) 0 0;
  padding: var(--sp-4) var(--sp-4) var(--sp-5);
  /* perforated bottom edge */
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 7px),
    97% 100%, 94% calc(100% - 7px), 91% 100%, 88% calc(100% - 7px),
    85% 100%, 82% calc(100% - 7px), 79% 100%, 76% calc(100% - 7px),
    73% 100%, 70% calc(100% - 7px), 67% 100%, 64% calc(100% - 7px),
    61% 100%, 58% calc(100% - 7px), 55% 100%, 52% calc(100% - 7px),
    49% 100%, 46% calc(100% - 7px), 43% 100%, 40% calc(100% - 7px),
    37% 100%, 34% calc(100% - 7px), 31% 100%, 28% calc(100% - 7px),
    25% 100%, 22% calc(100% - 7px), 19% 100%, 16% calc(100% - 7px),
    13% 100%, 10% calc(100% - 7px), 7% 100%, 4% calc(100% - 7px), 0 100%);
}
.receipt .rc-head {
  font-family: var(--font-data); font-size: var(--fs-micro);
  color: var(--text-3); letter-spacing: .14em; text-transform: uppercase;
  text-align: center; padding-bottom: var(--sp-3);
  border-bottom: 1px dashed var(--line);
}
.receipt .rc-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 9px 0; border-bottom: 1px dashed var(--line);
  font-size: var(--fs-sub);
}
.receipt .rc-row:last-of-type { border-bottom: none; }
.receipt .rc-row .src { color: var(--text-2); }
.receipt .rc-row .price { font-weight: 600; font-size: var(--fs-sub); }

/* ---- binder pockets: the empty pocket is the motivator ---- */
.binder-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-2);
}
.pocket {
  aspect-ratio: 63 / 88;
  border-radius: var(--r-art);
  position: relative;
}
.pocket.empty {
  border: 1.5px dashed var(--line);
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 2px;
}
.pocket.empty .num {
  font-family: var(--font-data); font-size: var(--fs-sub);
  color: var(--text-3); font-variant-numeric: tabular-nums;
}
.pocket.empty .ghost { font-size: var(--fs-micro); color: var(--text-3); opacity: .7; }

/* ---- candidate picker: three equal choices, never a hedged answer ---- */
.candidate {
  display: flex; align-items: center; gap: var(--sp-3);
  width: 100%; min-height: 76px;
  padding: var(--sp-3);
  background: var(--surface);
  border: 1.5px solid var(--line-soft);
  border-radius: var(--r-card);
  cursor: pointer; text-align: left;
  color: var(--text); font: inherit;
  transition: border-color var(--dur-fast) var(--ease);
}
.candidate.picked {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.candidate .radio {
  width: 22px; height: 22px; flex: 0 0 auto;
  border-radius: 50%;
  border: 2px solid var(--text-3);
  display: flex; align-items: center; justify-content: center;
}
.candidate.picked .radio { border-color: var(--accent); }
.candidate.picked .radio::after {
  content: ""; width: 11px; height: 11px; border-radius: 50%;
  background: var(--accent);
}

/* ---- bento stats (collection header): unequal tiles ---- */
.bento {
  display: grid; gap: var(--sp-2);
  grid-template-columns: 1.6fr 1fr;
  grid-template-rows: auto auto;
}
.bento .b-hero { grid-row: 1 / 3; }
.bento .stat-label {
  font-size: var(--fs-micro); font-weight: 600; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .08em;
}
.bento .stat-value {
  font-family: var(--font-data); font-variant-numeric: tabular-nums;
  font-weight: 600; margin-top: 2px;
}

/* ---- tab bar: solid surface, hairline, no glass ---- */
.tab-bar {
  display: flex; justify-content: space-around; align-items: stretch;
  border-top: 1px solid var(--line-soft);
  background: var(--surface);
  padding: 6px 0 24px;   /* home-indicator clearance */
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  min-width: var(--tap-min); min-height: var(--tap-min);
  justify-content: center;
  font-size: var(--fs-micro); font-weight: 600;
  color: var(--text-3); text-decoration: none;
  border-radius: var(--r-control);
}
.tab svg { width: 22px; height: 22px; }
.tab.on { color: var(--accent); }

.home-indicator {
  position: absolute; bottom: 8px; left: 50%;
  width: 134px; height: 5px; border-radius: 3px;
  transform: translateX(-50%);
  background: var(--text); opacity: .28;
}
