/* APOTHEKA parcel lookup — Tidewater Archive skin (matches shop + dashboard).
 * No external fonts, no CDN, no images. One texture: inline SVG noise ≤4%.
 * Tokens are the EXACT Tidewater Archive values from
 * depop_os/dashboard/static/tide.css (measured from
 * design-refs/depop-avatar-20260914.jpg):
 *   ground #06222E · panel #0B2F3E · sea #54A0DA · aqua #70C6E1
 *   ice #96C7EF · foam #F4FBFD · sand #DCDFE8 · mist #B3B7C3
 *   body #D7EEF7 · warn #FFD9A0 · good #9DF0C9
 * Failure red #FF9B8A is retained — Tidewater defines no red and a
 * distinguishable failure state is required.
 * Pairs (all on --paper #06222E unless noted):
 *   ink #D7EEF7 ≈ 13.7:1 · muted #B3B7C3 ≈ 8.2:1 · stamp #06222E on accent ≈ 8.5:1
 *   warn #FFD9A0 ≈ 12.3:1 · red #FF9B8A ≈ 8.1:1 · good #9DF0C9 ≈ 12.3:1
 *   ink/muted on --card #0B2F3E ≈ 11.7:1 / 7.0:1. All body ≥ 4.5:1 (1.4.3).
 * Status is never colour-alone (1.4.1): every state carries a text stamp
 * label plus timeline dots/words, so colour is redundant with text. */
:root {
  --tide-ground: #06222E;
  --tide-panel: #0B2F3E;
  --tide-sea: #54A0DA;
  --tide-aqua: #70C6E1;
  --tide-ice: #96C7EF;
  --tide-foam: #F4FBFD;
  --tide-sand: #DCDFE8;
  --tide-mist: #B3B7C3;
  --tide-body: #D7EEF7;
  --tide-warn: #FFD9A0;
  --tide-good: #9DF0C9;
  --paper: #06222E;
  --ink: #D7EEF7;
  --muted: #B3B7C3;
  --card: #0B2F3E;
  --line: rgba(112, 198, 225, 0.28);
  --accent: #70C6E1;
  --stamp: #06222E;
  --signal-amber: #FFD9A0;
  --signal-red: #FF9B8A;
  --signal-green: #9DF0C9;
  --radius-card: 10px;
  --radius-input: 6px;
  --radius-stamp: 2px;
  --font-brand: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-code: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(84, 160, 218, 0.22), transparent 60%),
    radial-gradient(900px 480px at 8% 0%, rgba(112, 198, 225, 0.16), transparent 55%),
    var(--paper);
  color: var(--ink);
  margin: 0;
  font-family: var(--font-brand);
  font-size: 16px;
  line-height: 24px;
}
/* sea wash grain: one inline-SVG texture, no network request */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
}
.page {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px 64px;
}
@media (min-width: 430px) {
  .page { padding-left: 20px; padding-right: 20px; }
}
/* shelf-label header */
.shelf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.wordmark {
  font-family: var(--font-code);
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0;
}
.wordmark small {
  display: block;
  color: var(--muted);
  letter-spacing: 0.08em;
}
.code-chip {
  font-family: var(--font-code);
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-input);
  padding: 8px 12px;
  white-space: nowrap;
}
h1.title {
  font-size: 22px;
  line-height: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 24px 0 8px;
  max-width: 42ch;
}
h1.title:focus, h2.stamp:focus { outline: none; }
.section-label {
  font-family: var(--font-code);
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 24px 0 8px;
}
p.body { font-size: 16px; line-height: 24px; margin: 8px 0; max-width: 42ch; }
p.fine { font-size: 13px; line-height: 18px; color: var(--muted); margin: 8px 0; max-width: 42ch; }
/* stamped status: a stamp, not a SaaS pill. Text label always present —
 * state is never signalled by colour alone (1.4.1). */
.stamp {
  display: inline-block;
  font-family: var(--font-code);
  font-size: 17px;
  line-height: 24px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--stamp);
  background: var(--accent);
  border-radius: var(--radius-stamp);
  padding: 8px 14px;
  margin: 12px 0 4px;
  transform: rotate(-0.6deg);
}
.stamp.stamp-live { color: var(--stamp); background: var(--accent); }
.stamp.stamp-wait {
  color: var(--ink);
  background: transparent;
  border: 1.5px solid var(--muted);
}
.stamp.stamp-stale {
  color: var(--stamp);
  background: var(--signal-amber);
}
.stamp.stamp-good {
  color: var(--stamp);
  background: var(--signal-green);
}
.stamp.stamp-bad {
  color: var(--stamp);
  background: var(--signal-red);
}
.status-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 18px;
  margin-top: 16px;
}
.status-card.current { border: 1.5px solid var(--accent); }
/* warn stale banner: always visible, never dismissible */
.banner-stale {
  border: 1.5px solid var(--signal-amber);
  border-radius: var(--radius-card);
  background: var(--card);
  padding: 14px 16px;
  margin-top: 16px;
}
.banner-stale p { margin: 4px 0; color: var(--ink); }
/* code entry form */
label.codelabel {
  display: block;
  font-family: var(--font-code);
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 16px 0 8px;
}
#apocode {
  width: 100%;
  min-height: 56px;
  font-family: var(--font-code);
  font-size: 18px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-input);
  padding: 0 14px;
}
#apocode[aria-invalid="true"] { border-color: var(--signal-red); }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  margin-top: 12px;
  font-family: var(--font-brand);
  font-size: 16px;
  font-weight: 700;
  color: var(--stamp);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-input);
  cursor: pointer;
}
.btn[disabled] { opacity: 0.7; cursor: default; }
.btn-secondary {
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
}
.error-text { color: var(--signal-red); }
a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
/* timeline: manifest log, newest first */
.timeline {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}
.timeline li {
  position: relative;
  padding: 0 0 16px 22px;
  border-left: 1px solid var(--line);
  margin-left: 5px;
}
.timeline li:last-child { padding-bottom: 0; }
.timeline .dot {
  position: absolute;
  left: -6px;
  top: 4px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1.5px solid var(--muted);
  background: var(--paper);
}
.timeline li.current { border-left: 1.5px solid var(--accent); }
.timeline li.current .dot {
  background: var(--accent);
  border-color: var(--accent);
}
.timeline li.customs .dot {
  background: var(--signal-amber);
  border-color: var(--signal-amber);
}
.timeline .t-text { font-size: 16px; line-height: 24px; color: var(--ink); margin: 0; }
.timeline li.current .t-text { font-weight: 700; }
.timeline time {
  display: block;
  font-family: var(--font-code);
  font-size: 14px;
  line-height: 20px;
  color: var(--muted);
}
.timeline .t-note { font-size: 14px; line-height: 20px; color: var(--muted); margin: 2px 0 0; }
.toggle-history {
  background: none;
  border: none;
  padding: 12px 0;
  min-height: 44px;
  font-family: var(--font-code);
  font-size: 14px;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
  cursor: pointer;
}
/* item card: the Depop listing stub */
.item-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 14px;
  margin-top: 8px;
}
.item-card img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius-input);
  background: var(--paper);
  flex-shrink: 0;
}
.item-card .t { font-size: 16px; line-height: 24px; font-weight: 700; margin: 0 0 4px; }
.item-card .n {
  font-family: var(--font-code);
  font-size: 14px;
  line-height: 20px;
  color: var(--muted);
  overflow-wrap: anywhere;
  margin: 0;
}
/* window card, help, archive, footer */
.window-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 14px 16px;
  margin-top: 24px;
}
.window-card p { margin: 4px 0; }
.archive-link {
  margin-top: 24px;
  font-size: 13px;
  line-height: 18px;
  color: var(--muted);
}
footer.colophon {
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding-top: 16px;
  font-size: 13px;
  line-height: 18px;
  color: var(--muted);
}
/* visible focus, never removed (2.4.7) */
a:focus-visible, button:focus-visible, input:focus-visible, [tabindex="-1"]:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
/* one 160ms ease-out swap on submit; honour reduced motion */
.swap { transition: opacity 160ms ease-out; }
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
