/* Stash: the look from the mockups. Light ground, ink actions, orange for "need", blue for "fine". */
:root {
  --ground: #F5F6F2;
  --surface: #FFFFFF;
  --ink: #16211C;
  --muted: #5B6660;
  --line: #DDE1DA;
  --rule: #EEF0EC;
  --soft: #E7EAE4;
  --need-bg: #FCEBD9;
  --need: #9A4A0B;
  --fine-bg: #E3EEF6;
  --fine: #1F5A82;
  --radius: 20px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
  color: var(--ink);
  background: var(--ground);
  -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--ground); }
body { font-size: 16px; line-height: 1.35; -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
h1, h2, p { margin: 0; }
a { color: var(--ink); }

.screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: calc(var(--safe-top) + 24px) 20px calc(var(--safe-bottom) + 24px);
  max-width: 520px;
  margin: 0 auto;
  gap: 16px;
}
.grow { flex: 1; display: flex; flex-direction: column; gap: 16px; }
.center { justify-content: center; }

.mark {
  width: 64px; height: 64px; border-radius: 18px; background: var(--ink);
  display: flex; align-items: center; justify-content: center;
}
.title { font-size: 30px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.15; }
.h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.01em; }
.lead { font-size: 17px; color: var(--muted); }
.s { font-size: 14px; color: var(--muted); }
.t { font-weight: 600; }
.gh { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 4px 4px 8px; }

.btn {
  border: 0; border-radius: 999px; min-height: 56px; padding: 0 22px; width: 100%;
  font-size: 17px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 10px;
}
.btn.primary { background: var(--ink); color: #fff; }
.btn.soft { background: var(--soft); color: var(--ink); }
.btn:disabled { opacity: .55; }
.link {
  border: 0; background: transparent; min-height: 44px; padding: 0 4px; font-size: 15px; font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px; align-self: center;
}
.ib {
  width: 44px; height: 44px; border-radius: 999px; border: 0; background: var(--surface);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; padding: 0;
}

.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 14px; font-weight: 600; color: var(--muted); }
.input {
  height: 56px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface);
  padding: 0 16px; font-size: 17px; width: 100%; outline: none;
}
.input:focus { border-color: var(--ink); }
.input.code { font-family: ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .04em; text-transform: uppercase; }

.card { background: var(--surface); border-radius: var(--radius); padding: 4px 16px; }
.row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 0; }
.row + .row { border-top: 1px solid var(--rule); }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.seg { display: flex; background: var(--soft); border-radius: 999px; padding: 4px; gap: 4px; }
.seg button { border: 0; background: transparent; border-radius: 999px; height: 36px; padding: 0 16px; font-size: 15px; font-weight: 600; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); }

.search {
  display: flex; align-items: center; gap: 10px; background: var(--surface); border-radius: 16px;
  height: 56px; padding: 0 16px; border: 1px solid var(--line); color: var(--muted);
}
.search input { flex: 1; border: 0; outline: 0; font-size: 17px; background: transparent; min-width: 0; }
.search input::placeholder { color: var(--muted); }

.places { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.place {
  background: var(--surface); border: 0; border-radius: 18px; padding: 14px; text-align: left;
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-height: 96px;
}
.pi { width: 36px; height: 36px; border-radius: 10px; background: var(--soft); display: flex; align-items: center; justify-content: center; }

.chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 11px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.chip.need { background: var(--need-bg); color: var(--need); }
.chip.fine { background: var(--fine-bg); color: var(--fine); }

.codebox {
  background: var(--surface); border-radius: var(--radius); padding: 20px; text-align: center;
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 20px; font-weight: 600; letter-spacing: .04em;
  user-select: all; -webkit-user-select: all; word-break: break-all;
}

.steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; font-size: 17px; }

/* Hidden until it has something to say: invisible and nudged up, then slides into place. */
.toast {
  position: fixed; left: 50%; top: calc(var(--safe-top) + 16px); transform: translate(-50%, -12px);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; font-size: 15px; font-weight: 600;
  max-width: calc(100% - 32px); pointer-events: none; z-index: 20;
  visibility: hidden; opacity: 0;
  transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
}
.toast.show {
  visibility: visible; opacity: 1; transform: translate(-50%, 0);
  transition: opacity .2s ease, transform .2s ease, visibility 0s;
}

.update {
  position: fixed; left: 16px; right: 16px; bottom: calc(var(--safe-bottom) + 16px);
  background: var(--ink); color: #fff; border-radius: 16px; padding: 10px 10px 10px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; z-index: 20; max-width: 488px; margin: 0 auto;
}
.update button { border: 0; background: #fff; color: var(--ink); border-radius: 999px; min-height: 44px; padding: 0 16px; font-weight: 600; }
.update[hidden] { display: none; }

:focus-visible { outline: 3px solid #1F5A82; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }
