/* Pickup — v1
   Palette and type carried over from Leonard's prototype: mineral greens, oxide,
   brass and rust, on a warm-grey ground. Condensed display face for anything that
   behaves like signage, mono for anything that behaves like data. */

:root {
  --paper: #E9EAE5;
  --surface: #F5F6F2;
  --surface-2: #DFE1DA;
  --ink: #191C19;
  --muted: #5E635E;
  --line: #C9CCC4;
  --line-soft: #D8DBD3;
  --oxide: #3F6B57;
  --oxide-soft: #DCE7E0;
  --brass: #96742F;
  --brass-soft: #EFE4CC;
  --rust: #8C3A24;
  --rust-soft: #F2DFD9;
  --shadow: 0 18px 44px rgba(25, 28, 25, .16);

  --f-display: "Barlow Condensed", "Arial Narrow", ui-sans-serif, sans-serif;
  --f-body: "Public Sans", ui-sans-serif, system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #131613;
    --surface: #1C201C;
    --surface-2: #272C27;
    --ink: #E7E9E3;
    --muted: #9AA098;
    --line: #333A33;
    --line-soft: #2A302A;
    --oxide: #7CB495;
    --oxide-soft: #1E2E27;
    --brass: #CCA35A;
    --brass-soft: #302819;
    --rust: #CE7157;
    --rust-soft: #33201B;
    --shadow: 0 18px 48px rgba(0, 0, 0, .55);
  }
}

:root[data-theme="dark"] {
  --paper: #131613;
  --surface: #1C201C;
  --surface-2: #272C27;
  --ink: #E7E9E3;
  --muted: #9AA098;
  --line: #333A33;
  --line-soft: #2A302A;
  --oxide: #7CB495;
  --oxide-soft: #1E2E27;
  --brass: #CCA35A;
  --brass-soft: #302819;
  --rust: #CE7157;
  --rust-soft: #33201B;
  --shadow: 0 18px 48px rgba(0, 0, 0, .55);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

.shell {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 18px 56px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
}

/* ---------------------------------------------------------- masthead */

.masthead {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 34px;
  letter-spacing: .01em;
  line-height: 1;
  margin: 0;
  text-transform: uppercase;
}
.wordmark span { color: var(--brass); }

.masthead p { margin: 6px 0 0; color: var(--muted); font-size: 13.5px; max-width: 48ch; }

.flag {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 4px;
  padding: 6px 10px;
  white-space: nowrap;
}

/* ------------------------------------------------------------ switch */

.switch {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--surface-2);
  border-radius: 999px;
  flex-wrap: wrap;
  justify-content: center;
}
.switch button {
  font-family: var(--f-display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 20px;
  border-radius: 999px;
  cursor: pointer;
}
.switch button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* ------------------------------------------------------------ device */

.stage { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; }

.device {
  width: 100%;
  max-width: 392px;
  height: 784px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 30px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.statusbar {
  flex: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 20px 9px;
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--muted);
  border-bottom: 1px solid var(--line-soft);
}
.statusbar b { color: var(--ink); font-weight: 600; letter-spacing: .04em; }

.viewport { flex: 1; overflow-y: auto; overscroll-behavior: contain; }

.screen { display: flex; flex-direction: column; gap: 16px; padding: 18px 18px 26px; }
.screen[hidden] { display: none !important; }

.caption {
  max-width: 460px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  min-height: 34px;
}
.caption b { color: var(--ink); font-weight: 600; }

/* -------------------------------------------------------- typography */

.eyebrow {
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

h2.title {
  font-family: var(--f-display);
  font-size: 27px;
  font-weight: 700;
  line-height: 1.05;
  margin: 4px 0 0;
  text-wrap: balance;
}

.lede { margin: 0; color: var(--muted); font-size: 13.5px; }
.group { display: flex; flex-direction: column; gap: 9px; }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------- controls */

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  font-size: 13px;
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 999px;
  padding: 7px 13px;
  cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.styleopt {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  text-align: left;
  width: 100%;
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 8px;
  padding: 11px 13px;
  cursor: pointer;
}
.styleopt strong { font-size: 14px; font-weight: 600; }
.styleopt small { grid-column: 1; color: var(--muted); font-size: 12px; line-height: 1.35; }
.styleopt .tick {
  grid-row: 1 / span 2;
  align-self: center;
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--line);
}
.styleopt[aria-pressed="true"] { border-color: var(--brass); background: var(--brass-soft); }
.styleopt[aria-pressed="true"] .tick { color: var(--brass); }

.slider-row { display: flex; align-items: baseline; justify-content: space-between; }
input[type="range"] { width: 100%; accent-color: var(--brass); }

.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.field input[type="text"],
.field input[type="email"],
.field input[type="number"],
.field select {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 7px;
  padding: 10px 11px;
  width: 100%;
}
.field .hint { font-size: 12px; color: var(--muted); }
.field.invalid input { border-color: var(--rust); }
.field .err { font-size: 12px; color: var(--rust); }

.checkrow { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; }
.checkrow input { margin-top: 3px; accent-color: var(--oxide); flex: none; }

.btn {
  font-family: var(--f-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 13px 16px;
  cursor: pointer;
  width: 100%;
  display: block;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--brass); color: #191C19; }
.btn-quiet { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-danger { background: transparent; color: var(--rust); border-color: var(--line); }
.btn-row { display: flex; flex-direction: column; gap: 8px; }

.backlink {
  background: none; border: 0; padding: 0; cursor: pointer;
  font-family: var(--f-mono); font-size: 11px;
  letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  align-self: flex-start;
}

/* ------------------------------------------------------------- cards */

.card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  background: var(--paper);
}
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.card-head h3 { font-family: var(--f-display); font-size: 20px; font-weight: 600; margin: 0; line-height: 1.1; }

.rows { display: flex; flex-direction: column; gap: 5px; }
.row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; align-items: baseline; }
.row .k { color: var(--muted); }
.row .v { text-align: right; font-variant-numeric: tabular-nums; }

.pill {
  font-family: var(--f-mono);
  font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
  padding: 4px 8px; border-radius: 999px; white-space: nowrap;
}
.pill-oxide { background: var(--oxide-soft); color: var(--oxide); }
.pill-brass { background: var(--brass-soft); color: var(--brass); }
.pill-rust  { background: var(--rust-soft);  color: var(--rust); }
.pill-quiet { background: var(--surface-2);  color: var(--muted); }

.note { border-left: 2px solid var(--line); padding-left: 11px; font-size: 12.5px; color: var(--muted); }
.note.locked { border-left-color: var(--brass); }
.note.good { border-left-color: var(--oxide); }
.note.warn { border-left-color: var(--rust); }

.divider { height: 1px; background: var(--line-soft); border: 0; margin: 2px 0; }

/* --------------------------------------------------------- searching */

.pulse { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 34px 0 10px; }
.pulse-ring {
  width: 74px; height: 74px; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--brass);
  animation: spin 1.5s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .pulse-ring { animation: none; border-top-color: var(--line); } }

.invitee {
  display: flex; flex-direction: column; gap: 7px;
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 13px;
  background: var(--paper);
}
.invitee-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.handle { font-family: var(--f-display); font-size: 19px; font-weight: 600; }
.meta { display: flex; flex-wrap: wrap; gap: 5px 10px; font-size: 12.5px; color: var(--muted); }
.meta span { white-space: nowrap; }

/* ----------------------------------------------------------- journey */

.journey {
  display: grid; grid-template-columns: 1fr 1fr auto; gap: 3px 10px;
  font-family: var(--f-mono); font-size: 12px; font-variant-numeric: tabular-nums;
  padding: 8px 0; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft);
}
.journey .lab { grid-row: 1; color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.journey .val { grid-row: 2; font-size: 15px; font-weight: 500; }
.journey .gap-good { color: var(--oxide); }
.journey .gap-poor { color: var(--rust); }

/* ------------------------------------------------------- venue panel */

.panel {
  width: 100%;
  max-width: 760px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.panel[hidden] { display: none !important; }

.util { display: flex; flex-direction: column; gap: 7px; }
.util-row { display: grid; grid-template-columns: 38px 1fr 46px; align-items: center; gap: 10px; }
.util-row .d { font-family: var(--f-mono); font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.track { height: 15px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.fill { height: 100%; background: var(--oxide); border-radius: 3px; }
.fill.dead { background: var(--rust); }
.util-row .n { font-family: var(--f-mono); font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }

.stat { display: flex; flex-direction: column; gap: 1px; }
.stat .big { font-family: var(--f-display); font-size: 30px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.stat .lab { font-family: var(--f-mono); font-size: 10px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.stat-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.verdict {
  border: 1px solid var(--brass);
  background: var(--brass-soft);
  border-radius: 10px;
  padding: 14px 15px;
  display: flex; flex-direction: column; gap: 7px;
}
.verdict p { margin: 0; font-size: 13.5px; }
.verdict .headline { font-family: var(--f-display); font-size: 21px; font-weight: 600; line-height: 1.15; }

.calc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }

.result-table { display: flex; flex-direction: column; gap: 6px; }
.result-table .row { font-size: 14px; }
.result-table .row.total { border-top: 1px solid var(--line); padding-top: 7px; font-weight: 600; }
.result-table .row .v.up { color: var(--oxide); font-weight: 600; }

.section-head { display: flex; flex-direction: column; gap: 3px; }
.section-head h3 { font-family: var(--f-display); font-size: 23px; font-weight: 700; margin: 0; line-height: 1.1; }

/* --------------------------------------------------------- setup bar */

.setupbar {
  width: 100%;
  max-width: 760px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.setupbar summary {
  cursor: pointer;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  list-style: none;
}
.setupbar summary::-webkit-details-marker { display: none; }
.setupbar summary::before { content: "▸ "; }
.setupbar[open] summary::before { content: "▾ "; }
.setup-inner { display: flex; flex-direction: column; gap: 12px; padding-top: 12px; }
.setup-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.setup-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.setup-actions .btn { width: auto; padding: 10px 18px; font-size: 15px; }

.storeflag {
  font-family: var(--f-mono); font-size: 11px; letter-spacing: .05em;
  color: var(--oxide); background: var(--oxide-soft);
  padding: 5px 9px; border-radius: 4px;
}

/* ------------------------------------------------------------- toast */

.toast {
  position: fixed;
  left: 50%; bottom: 22px;
  transform: translateX(-50%);
  background: var(--ink); color: var(--paper);
  padding: 11px 18px; border-radius: 8px;
  font-size: 13.5px; z-index: 50;
  box-shadow: var(--shadow);
  max-width: min(92vw, 420px);
}
.toast[hidden] { display: none !important; }
.toast.bad { background: var(--rust); color: #fff; }

.footnote { max-width: 640px; text-align: center; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.footnote code { font-family: var(--f-mono); font-size: 11.5px; background: var(--surface-2); padding: 1px 5px; border-radius: 3px; }
.footnote a { color: var(--muted); }

@media (max-width: 460px) {
  .shell { padding: 14px 10px 40px; }
  .device { height: calc(100dvh - 190px); min-height: 520px; border-radius: 20px; }
  .wordmark { font-size: 28px; }
  .panel { padding: 15px; border-radius: 10px; }
  .stat-pair { grid-template-columns: 1fr; gap: 10px; }
}
