/* A silver-white watch dial with a blue and black GMT bezel: cards sit on the dial, the hero wears the bezel. */
:root {
  --dial: #e9edf2;
  --dial-2: #f6f8fa;
  --card: #ffffff;
  --ink: #141a23;
  --ink-2: #4d5866;
  --line: #d3dae3;
  --bezel-blue: #1d4f9f;
  --bezel-black: #171c24;
  --on-bezel: #f3f6fa;
  --buy: #1d4f9f;
  --on-buy: #ffffff;
  --taken: #0f6b57;
  --taken-bg: #dff1ec;
  --warn: #8f3a12;
  --shadow: 0 1px 2px rgba(20, 30, 45, .08);
  --display: "Saira Semi Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --body: "Instrument Sans", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --dial: #0f141b;
    --dial-2: #151b24;
    --card: #1a212b;
    --ink: #eef2f7;
    --ink-2: #a9b4c2;
    --line: #2c3644;
    --bezel-blue: #2b63bd;
    --bezel-black: #070a0e;
    --on-bezel: #f3f6fa;
    --buy: #8db6f5;
    --on-buy: #0b1420;
    --taken: #7fd8c2;
    --taken-bg: #15332d;
    --warn: #f0a57a;
    --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --dial: #0f141b;
  --dial-2: #151b24;
  --card: #1a212b;
  --ink: #eef2f7;
  --ink-2: #a9b4c2;
  --line: #2c3644;
  --bezel-blue: #2b63bd;
  --bezel-black: #070a0e;
  --on-bezel: #f3f6fa;
  --buy: #8db6f5;
  --on-buy: #0b1420;
  --taken: #7fd8c2;
  --taken-bg: #15332d;
  --warn: #f0a57a;
  --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--dial);
  color: var(--ink);
  font: 400 16px/1.5 var(--body);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
img { max-width: 100%; display: block; }
h1, h2, h3, .price { font-family: var(--display); }
a { color: var(--buy); }
:focus-visible { outline: 3px solid var(--buy); outline-offset: 2px; }

/* Hero */
.hero {
  background: var(--bezel-black);
  color: var(--on-bezel);
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.hero-in {
  max-width: 1040px;
  margin: 0 auto;
  padding-block: 28px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.hero-copy { min-width: 0; }
.bezel { flex: 0 0 132px; width: 132px; height: 132px; }
.bezel svg { display: block; width: 100%; height: 100%; }
.bz-black { fill: #2a313c; }
.bz-blue { fill: #2b63bd; }
.bz-dial { fill: #e9edf2; }
.bz-tick { stroke: #f3f6fa; stroke-width: 1.4; }
.bz-text { fill: #141a23; font-family: var(--display); font-weight: 700; text-anchor: middle; }
.bz-big { font-size: 25px; }
.bz-small { font-size: 12px; letter-spacing: .08em; }
.kicker {
  margin: 0 0 6px;
  font: 600 13px/1.3 var(--display);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #a9c6f5;
}
h1 {
  margin: 0;
  font-size: clamp(34px, 7vw, 56px);
  font-weight: 700;
  line-height: 1.02;
  text-wrap: balance;
}
.lede { margin: 12px 0 0; max-width: 56ch; color: #d6dee9; }

/* Layout */
main {
  max-width: 1040px;
  margin: 0 auto;
  padding-block: 20px 16px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.notes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.notes p {
  margin: 0;
  min-width: 0;
  padding: 12px 14px;
  background: var(--dial-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  color: var(--ink-2);
}
.notes strong { color: var(--ink); }
.status {
  margin: 14px 0 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--dial-2);
  color: var(--warn);
  font-size: 14px;
}
.group { margin-top: 28px; }
.group-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}
.group-head h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
}
.group-head p { margin: 0; font-size: 14px; color: var(--ink-2); }
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

/* Cards */
.card {
  min-width: 0;
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card.wide { grid-column: 1 / -1; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); }
.photo {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 148px;
  padding: 0;
  border: 0;
  background: #fff;
  cursor: zoom-in;
}
.photo img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.photo-tile {
  display: grid;
  place-items: center;
  min-height: 148px;
  background: var(--bezel-black);
  color: var(--on-bezel);
  font: 700 18px/1.15 var(--display);
  text-align: center;
  padding: 12px;
}
.body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
}
.card h3 { margin: 0; font-size: 21px; font-weight: 600; line-height: 1.15; }
.blurb { margin: 0; font-size: 14px; color: var(--ink-2); }
.pick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}
.price {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.buy {
  display: inline-block;
  padding: 9px 13px;
  border-radius: 7px;
  background: var(--buy);
  color: var(--on-buy);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
}
.why, .delivery, .backup, .checked { margin: 0; font-size: 14px; }
.delivery { color: var(--ink-2); }
.delivery.late { color: var(--warn); }
.backup { color: var(--ink-2); }
.checked { color: var(--ink-2); font-size: 13px; }
.none { margin: 0; font-size: 14px; color: var(--warn); }
.opts { display: grid; gap: 8px; margin: 2px 0 0; padding: 0; list-style: none; }
.opts li { padding: 10px 0 0; border-top: 1px solid var(--line); min-width: 0; }
.opts li:first-child { border-top: 0; padding-top: 0; }
.opt-name { font-weight: 600; }
.price-inline { font-family: var(--display); font-weight: 700; font-variant-numeric: tabular-nums; }
.opt-meta { display: block; font-size: 14px; color: var(--ink-2); }

/* Claim slot */
.slot { margin-top: auto; padding-top: 6px; display: grid; gap: 8px; }
body[data-role="owner"] .slot { display: none; }
.btn {
  appearance: none;
  border-radius: 7px;
  padding: 10px 14px;
  font: 600 15px/1.2 var(--body);
  cursor: pointer;
}
.btn.solid { background: var(--ink); color: var(--dial-2); border: 1px solid var(--ink); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn:disabled { opacity: .55; cursor: default; }
.claimed {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  padding: 9px 12px;
  border-radius: 7px;
  background: var(--taken-bg);
  color: var(--taken);
  font-weight: 600;
  font-size: 15px;
  min-width: 0;
}
.claimed span { min-width: 0; overflow-wrap: anywhere; }
.link-btn {
  appearance: none;
  border: 0;
  padding: 0;
  background: none;
  color: inherit;
  font: 500 14px/1.3 var(--body);
  text-decoration: underline;
  cursor: pointer;
}
.card.taken .photo, .card.taken .photo-tile { opacity: .55; }

/* Missing link */
.missing { padding: 40px 0; }
.missing h2 { margin: 0 0 8px; font-size: 28px; }
.missing p { margin: 0; color: var(--ink-2); }
body[data-role="missing"] .notes,
body[data-role="missing"] #list,
body[data-role="missing"] .foot,
body[data-role="missing"] #lede { display: none; }

.foot {
  max-width: 1040px;
  margin: 0 auto;
  padding-block: 12px 32px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  color: var(--ink-2);
  font-size: 14px;
}
.foot p { margin: 0; }

/* Sheets */
dialog { color: var(--ink); }
.sheet {
  width: min(420px, calc(100vw - 32px));
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}
.sheet::backdrop, .viewer::backdrop { background: rgba(8, 12, 18, .6); }
.sheet h2 { margin: 0 0 4px; font-size: 24px; }
.sheet-item { margin: 0 0 12px; color: var(--ink-2); font-size: 15px; }
.sheet label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 14px; }
.sheet input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--dial-2);
  color: var(--ink);
  font: 400 16px/1.3 var(--body);
}
.sheet-error { margin: 8px 0 0; color: var(--warn); font-size: 14px; }
.sheet-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

/* Photo viewer */
.viewer {
  width: min(920px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 12px;
  border: 0;
  border-radius: 10px;
  background: #fff;
}
.viewer img { width: 100%; max-height: calc(100dvh - 92px); object-fit: contain; }
.viewer-close {
  display: block;
  margin: 0 0 8px auto;
  padding: 7px 12px;
  border: 1px solid #c7ced8;
  border-radius: 7px;
  background: #fff;
  color: #141a23;
  font: 600 14px/1.2 var(--body);
  cursor: pointer;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100vw - 32px);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 15px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--dial-2);
  font-size: 15px;
  z-index: 20;
}
.toast button {
  appearance: none;
  border: 0;
  padding: 0;
  background: none;
  color: inherit;
  font: 600 15px/1.2 var(--body);
  text-decoration: underline;
  cursor: pointer;
}

@media (max-width: 760px) {
  .notes, .grid { grid-template-columns: minmax(0, 1fr); }
  .card, .card.wide { grid-template-columns: minmax(0, 1fr); }
  .photo { min-height: 0; height: 240px; }
  .photo-tile { min-height: 96px; }
  .hero-in { gap: 16px; padding-block: 20px; }
  .bezel { flex-basis: 92px; width: 92px; height: 92px; }
  .group-head { display: block; }
}
@media (prefers-reduced-motion: no-preference) {
  .buy, .btn { transition: filter .12s ease; }
  .buy:hover, .btn:hover:not(:disabled) { filter: brightness(1.12); }
}
