/* ==========================================================================
   echo-asset.com — asset reporting client

   Echo brand, citizen variant. Tokens are derived from
   reportwithecho/styles/tokens.css (itself from admin/src/styles.css) so the
   page a resident scans into matches the marketing site that explains it.
   Intentional local deviations: a slightly deeper violet-tinted canvas so the
   white card reads outdoors, and the --urgency-* trio (reportwithecho calls
   the same hues accent-green / status-new / accent-danger).

   Brand rules carried over from PRODUCT.md / DESIGN.md:
     - Violet identifies (masthead, selection, focus); green acts (the one
       primary action per screen). Never both at equal weight side by side.
     - Hanken Grotesk only. PRODUCT.md keeps the editorial display face
       (Big Shoulders) out of product UI, so the masthead uses Hanken 800.
       Self-hosted Latin subset with font-display: optional: the webfont is
       used only when it is ready by first paint, so text never swaps font.
     - AAA contrast (7:1) on essential text, 18px body, 48px tap targets
       for gloved, one-handed, outdoor use (PRODUCT.md citizen rules).

   Layer order:
     1. Tokens
     2. Reset / base / prefers-reduced-motion
     3. Page + phone-card shell
     4. Masthead (brand + header block) + footer mark
     5. Action buttons (primary + urgency 0/1/2)
     6. Picker rows
     7. Floating-label contact fields
     8. Tag widgets (choice/scale/text — class names from widgets.js)
     9. Receipt + chips + success
    10. Loading, errors, asset-input, toast, utility
   ========================================================================== */

:root {
  color-scheme: light;

  /* Surfaces — neutrals tinted toward the violet hue (280) */
  --bg-canvas:   oklch(96%   0.012 290);
  --bg-surface:  oklch(99.5% 0.003 280);
  --bg-elevated: oklch(96%   0.007 280);

  /* Text */
  --text-primary:   oklch(22% 0.012 280);
  --text-secondary: oklch(40% 0.012 280);  /* ≥7:1 on surface + elevated */
  --text-tertiary:  oklch(52% 0.012 280);  /* AA only — non-essential (footer) */
  --text-inverse:   oklch(98% 0.003 280);

  /* Borders */
  --border:        oklch(88% 0.008 280);
  --border-soft:   oklch(93% 0.006 280);
  --border-strong: oklch(76% 0.012 280);

  /* Identity — Echo violet */
  --accent-violet:         oklch(48% 0.14 300);
  --accent-violet-deep:    oklch(34% 0.13 300);
  --accent-violet-deeper:  oklch(26% 0.10 300);
  --accent-violet-soft:    oklch(95% 0.025 300);
  --accent-violet-muted:   oklch(88% 0.045 300);
  --accent-violet-ink:     oklch(34% 0.12 300);
  --accent-violet-on-deep: oklch(85% 0.08 300);

  /* Primary action — civic green */
  --action-green:        oklch(38% 0.060 165);
  --action-green-hover:  oklch(32% 0.065 165);
  --action-green-shadow: oklch(28% 0.055 165);

  /* Urgency trio — quick-tap buttons, receipt values, chips.
     0 = fine (accent green), 1 = attention (amber), 2 = problem (danger red).
     Button labels are 19px bold (large text), where these pairs clear AAA. */
  --urgency-0:        oklch(45% 0.11 158);
  --urgency-0-shadow: oklch(36% 0.10 158);
  --urgency-0-text:   var(--text-inverse);
  --urgency-1:        oklch(80% 0.14 75);
  --urgency-1-shadow: oklch(66% 0.13 70);
  --urgency-1-text:   oklch(28% 0.06 60);
  --urgency-2:        oklch(48% 0.17 28);
  --urgency-2-shadow: oklch(38% 0.15 28);
  --urgency-2-text:   var(--text-inverse);

  /* Ink for urgency labels on light surfaces (receipt values) */
  --urgency-0-ink: oklch(34% 0.10 158);
  --urgency-1-ink: oklch(40% 0.10 60);
  --urgency-2-ink: oklch(42% 0.16 28);

  /* Chip fills — ink above is AA on these */
  --urgency-0-soft: oklch(95% 0.045 158);
  --urgency-1-soft: oklch(95% 0.06 80);
  --urgency-2-soft: oklch(95% 0.035 28);

  /* Focus */
  --focus-ring: oklch(48% 0.14 300 / 0.28);

  /* Error */
  --warn-text: var(--urgency-2-ink);
  --warn-bg:   var(--urgency-2-soft);

  /* Radii */
  --radius-card:   20px;
  --radius-button: 14px;
  --radius-input:  10px;
  --radius-full:   9999px;

  /* Type — Hanken Grotesk when ready at first paint, else the system stack */
  --font-sans: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI',
               Roboto, 'Helvetica Neue', sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Motion — exponential ease-out */
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --transition-fast: 0.12s var(--ease-out-quart);
  --transition-field: 0.15s var(--ease-out-quart);

  /* Elevation — violet-tinted, matching reportwithecho */
  --shadow-card: 0 18px 44px oklch(34% 0.10 300 / 0.14), 0 2px 6px oklch(34% 0.10 300 / 0.06);
}

/* --- Reset / base ------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

@font-face {
  font-family: 'Hanken Grotesk';
  font-style: normal;
  font-weight: 400 800;
  font-display: optional;
  src: url('/assets/fonts/hanken-grotesk-latin-1f21c6ea.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Painted while a server-rendered page waits for its body, so the wait is
     the page's own canvas, not white. Brand themes never change it. */
  background: var(--bg-canvas);
}

body {
  margin: 0;
  padding: 20px 14px 32px;
  min-height: 100vh;
  background: var(--bg-canvas);
  font-family: var(--font-sans);
  font-size: 18px;
  color: var(--text-primary);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

p { margin: 0; }
h1, h2, h3 { margin: 0; }

:focus-visible {
  outline: 3px solid var(--accent-violet);
  outline-offset: 2px;
}

/* Headings receive programmatic focus (tabindex="-1") so screen readers
   announce each new screen. That is not a keyboard affordance, so no ring. */
[tabindex="-1"]:focus,
[tabindex="-1"]:focus-visible {
  outline: none;
}

button {
  font: inherit;
  cursor: pointer;
  background: none;
  border: 0;
  color: inherit;
}

/* --- Shell ------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
}

#app { display: block; }

/* Phone card — every screen wraps in one. The masthead bleeds to its edges. */
.phone-card {
  background: var(--bg-surface);
  border-radius: var(--radius-card);
  padding: 0 18px 20px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: card-in 0.36s var(--ease-out-quart) both;
}

/* A server-rendered first card is already final at first paint. */
#app[data-ssr] .phone-card { animation: none; }

@keyframes card-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* Quiet variant — rate-limited posture. Desaturates the masthead so a
   "blocked" screen doesn't read as an invitation. */
.phone-card.card--quiet .header-block {
  background: var(--text-secondary);
}

/* --- Masthead ---------------------------------------------------------- */

.header-block {
  margin: 0 -18px;
  padding: 18px 20px 22px;
  /* Flat fill: masthead text is measured against one color (≥7:1). */
  background: var(--accent-violet-deep);
  color: var(--text-inverse);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  margin-bottom: 14px;
}

.brand-orb {
  display: block;
  width: 28px;
  height: 28px;
}

/* A white ring keeps the orb distinct on a partner's colour. */
:root[data-branded] .brand-orb {
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 2px #fff;
}

/* The partner's exact colour fills the orb; its swoosh is the white behind. */
.brand-orb--themed::before {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  background: var(--orb-color);
  -webkit-mask: url("/assets/echo-orb-shape.svg") center / contain no-repeat;
  mask: url("/assets/echo-orb-shape.svg") center / contain no-repeat;
}

.brand-wordmark {
  display: block;
  height: 17px;
  width: auto;
}

/* Saved partner identity uses dark text on a neutral surface, regardless of
   the uploaded brand color. Echo attribution remains in every page footer. */
.label-brand {
  --label-color: var(--border-strong);
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--label-color);
  border-radius: var(--radius-input);
  background: var(--bg-surface);
  color: var(--text-primary);
}

.label-brand-logo { width: 48px; height: 48px; object-fit: contain; flex-shrink: 0; }
.label-brand-name { font-size: 18px; font-weight: 700; overflow-wrap: anywhere; }

.label-context-notice {
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 18px;
  overflow-wrap: anywhere;
}

.label-code { font-family: var(--font-mono); color: var(--text-secondary); }

.greeting {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-violet-on-deep);
}

/* An owner's own wording shows exactly as they typed it. */
.greeting--custom {
  letter-spacing: normal;
  overflow-wrap: anywhere;
  text-transform: none;
}

.location {
  font-weight: 800;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--text-inverse);
  text-wrap: balance;
  margin-top: 2px;
}

.location-secondary {
  font-size: 16px;
  font-weight: 600;
  color: var(--accent-violet-on-deep);
}

.meta {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--accent-violet-on-deep);
}

/* --- Footer mark ------------------------------------------------------- */

.footer-mark {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-align: center;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.page-code {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-align: right;
  color: var(--text-tertiary);
}

/* --- Action buttons ---------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 56px;
  padding: 16px 14px;
  border-radius: var(--radius-button);
  font-weight: 700;
  font-size: 19px;
  line-height: 1.15;
  text-align: center;
  cursor: pointer;
  color: var(--text-inverse);
  background: var(--action-green);
  box-shadow: 0 3px 0 var(--action-green-shadow);
  transition: transform 0.08s var(--ease-out-quart), box-shadow 0.08s var(--ease-out-quart), background var(--transition-fast);
}

.btn:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--action-green-shadow);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* The one primary action on a screen: Send report, Proceed, Retry. */
.btn-primary:hover:not(:disabled) { background: var(--action-green-hover); }

a.btn { text-decoration: none; }
.btn-secondary { color: var(--text-primary); background: var(--bg-elevated); border: 1px solid var(--border-strong); box-shadow: none; }
.btn-secondary:hover { background: var(--bg-canvas); }

.btn--urgency-0 { background: var(--urgency-0); color: var(--urgency-0-text); box-shadow: 0 3px 0 var(--urgency-0-shadow); }
.btn--urgency-1 { background: var(--urgency-1); color: var(--urgency-1-text); box-shadow: 0 3px 0 var(--urgency-1-shadow); }
.btn--urgency-2 { background: var(--urgency-2); color: var(--urgency-2-text); box-shadow: 0 3px 0 var(--urgency-2-shadow); }
.btn--urgency-0:active:not(:disabled) { box-shadow: 0 1px 0 var(--urgency-0-shadow); }
.btn--urgency-1:active:not(:disabled) { box-shadow: 0 1px 0 var(--urgency-1-shadow); }
.btn--urgency-2:active:not(:disabled) { box-shadow: 0 1px 0 var(--urgency-2-shadow); }

.button-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Progressive-disclosure expander on multi-tag forms. Quiet dashed affordance
   so it reads as "optional, more available" rather than a primary action. */
.collapse-toggle {
  width: 100%;
  min-height: 48px;
  padding: 12px;
  justify-content: center;
  background: transparent;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-input);
  color: var(--accent-violet-ink);
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--transition-field), background var(--transition-field), transform 0.08s var(--ease-out-quart);
}

.collapse-toggle:hover,
.collapse-toggle:focus-visible {
  border-color: var(--accent-violet);
  background: var(--accent-violet-soft);
}

.collapse-toggle:active { transform: translateY(1px); }

/* --- Picker rows ------------------------------------------------------- */

.picker-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.picker-item {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--transition-field), background var(--transition-field), transform 0.08s var(--ease-out-quart);
}

.picker-item:hover,
.picker-item:focus-visible {
  border-color: var(--accent-violet);
  background: var(--accent-violet-soft);
}

.picker-item:active { transform: translateY(1px); }

.picker-name { flex: 1; }
.picker-arrow {
  color: var(--accent-violet);
  font-size: 24px;
  line-height: 1;
}

/* --- Floating-label contact fields ------------------------------------ */

.contact-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field {
  position: relative;
}

.field input,
.field textarea {
  display: block;
  width: 100%;
  min-height: 56px;
  padding: 22px 13px 6px;
  font: inherit;
  font-size: 18px; /* ≥16px also keeps iOS Safari from zooming on focus */
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  transition: border-color var(--transition-field), box-shadow var(--transition-field);
}

.field input::placeholder,
.field textarea::placeholder {
  color: transparent;
}

.field input:hover,
.field textarea:hover { border-color: var(--border-strong); }

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent-violet);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.field-label {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 17px;
  color: var(--text-secondary);
  pointer-events: none;
  padding: 0 2px;
  transition: top var(--transition-field), font-size var(--transition-field), color var(--transition-field), transform var(--transition-field);
}

/* Floating-label state. Load-bearing structural contract:
 *   1. Each .field wraps a single <input>/<textarea> followed immediately by
 *      its <label class="field-label"> (adjacent-sibling combinator).
 *   2. The input carries placeholder=" " so :placeholder-shown matches when
 *      empty and unmatches when typed/autofilled.
 * makeField() in client/app.js is the only producer of this DOM and
 * encapsulates both invariants. If you refactor the wrapper, update both
 * makeField and this selector together. */
.field input:focus + .field-label,
.field input:not(:placeholder-shown) + .field-label,
.field textarea:focus + .field-label,
.field textarea:not(:placeholder-shown) + .field-label {
  top: 7px;
  transform: translateY(0);
  font-size: 11px;
  color: var(--accent-violet-ink);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.field-error {
  display: block;
  margin-top: 4px;
  padding-left: 14px;
  font-size: 15px;
  font-weight: 600;
  color: var(--warn-text);
}

/* --- Tag widgets (class names emitted by client/widgets.js) ----------- */

.tag-fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tag-legend {
  padding: 0;
  margin-bottom: 8px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.required-mark { color: var(--urgency-2-ink); }

.tag-helper {
  margin: 0;
  font-size: 16px;
  color: var(--text-secondary);
}

.tag-error {
  margin: 0;
  padding: 8px 10px;
  background: var(--warn-bg);
  border-radius: 8px;
  color: var(--warn-text);
  font-size: 15px;
  font-weight: 600;
}

.choice-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.choice-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-input);
  font-size: 18px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color var(--transition-field), background var(--transition-field), color var(--transition-field);
}

.choice-card:hover {
  border-color: var(--accent-violet-muted);
  background: var(--bg-elevated);
}

.choice-card:has(input:checked) {
  background: var(--accent-violet-soft);
  border-color: var(--accent-violet);
  color: var(--accent-violet-ink);
  font-weight: 700;
}

.choice-card:focus-within {
  box-shadow: 0 0 0 3px var(--focus-ring);
}

/* The card is the focus indicator; suppress the native ring on the input. */
.choice-card input:focus-visible { outline: none; }

.choice-card input {
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  margin: 0;
  accent-color: var(--accent-violet);
  flex-shrink: 0;
}

.choice-label { flex: 1; }

.scale-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(44px, 1fr));
  gap: 6px;
}

.scale-step {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 8px 4px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-input);
  cursor: pointer;
  transition: border-color var(--transition-field), background var(--transition-field), color var(--transition-field);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-secondary);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.scale-step:hover { border-color: var(--accent-violet-muted); }

.scale-step input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.scale-step:has(input:checked) {
  background: var(--accent-violet);
  border-color: var(--accent-violet);
  color: var(--text-inverse);
}

.scale-step:focus-within {
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.scale-label { position: relative; pointer-events: none; }

/* Number/date/text widgets render a bare .input inside the fieldset. */
.tag-fieldset .input {
  display: block;
  width: 100%;
  min-height: 56px;
  padding: 12px 13px;
  font: inherit;
  font-size: 18px;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  transition: border-color var(--transition-field), box-shadow var(--transition-field);
}

.tag-fieldset .input:focus {
  outline: none;
  border-color: var(--accent-violet);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.tag-fieldset .input.textarea {
  min-height: 88px;
  resize: vertical;
  font-family: inherit;
}

/* --- Form screen ------------------------------------------------------- */

.screen-form {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* Contact fields + submit sit closer together than the question groups. */
.screen-form .contact-block { margin-top: -4px; }

/* --- Error / unknown / empty / rate-limited message blocks ------------ */

.message-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.message-heading {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

.message-body {
  font-size: 18px;
  color: var(--text-secondary);
}

.message-body strong {
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.message-block .btn { margin-top: 6px; }

.error-message {
  margin: 0;
  padding: 10px 12px;
  background: var(--warn-bg);
  border-radius: 8px;
  color: var(--warn-text);
  font-size: 16px;
  font-weight: 600;
}

/* --- Asset-input screen ------------------------------------------------ */

.asset-input-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.input.mono {
  display: block;
  width: 100%;
  min-height: 60px;
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 22px;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-input);
  transition: border-color var(--transition-field), box-shadow var(--transition-field);
}

.input.mono::placeholder {
  color: var(--text-secondary);
  text-transform: none;
  letter-spacing: 0.04em;
}

.input.mono:focus {
  outline: none;
  border-color: var(--accent-violet);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.hint {
  font-size: 17px;
  color: var(--text-secondary);
}

/* --- Success / receipt ------------------------------------------------ */

.thanks-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

/* Green check — the brand's "it works" semantic. Pops in once. */
.thanks-check {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  background: var(--urgency-0)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E")
    center / 28px no-repeat;
  box-shadow: 0 0 0 6px var(--urgency-0-soft);
  margin-bottom: 8px;
  animation: check-pop 0.45s var(--ease-out-quart) 0.1s both;
}

@keyframes check-pop {
  from { transform: scale(0.4); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.thanks-title {
  font-weight: 800;
  font-size: 32px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.thanks-sub {
  font-size: 18px;
  color: var(--text-secondary);
}

.receipt {
  align-self: stretch;
  margin-top: 14px;
  padding: 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
}

.receipt-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.receipt-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.receipt-value {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
}

.receipt-value.urgency-0 { color: var(--urgency-0-ink); }
.receipt-value.urgency-1 { color: var(--urgency-1-ink); }
.receipt-value.urgency-2 { color: var(--urgency-2-ink); }

.receipt-sub {
  font-size: 16px;
  color: var(--text-secondary);
}

.receipt-id {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}

.receipt-divider {
  height: 1px;
  background: var(--border);
  margin: 14px 0;
}

/* --- Chips (multi-value receipt) -------------------------------------- */

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: var(--radius-full);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
}

.chip.urgency-0 { color: var(--urgency-0-ink); background: var(--urgency-0-soft); }
.chip.urgency-1 { color: var(--urgency-1-ink); background: var(--urgency-1-soft); }
.chip.urgency-2 { color: var(--urgency-2-ink); background: var(--urgency-2-soft); }

/* --- Loading spinner -------------------------------------------------- */

.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 16px 0;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--accent-violet-soft);
  border-top-color: var(--accent-violet);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-text {
  font-size: 17px;
  font-weight: 500;
  color: var(--text-secondary);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- Toast ------------------------------------------------------------ */

.toast {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--accent-violet-deeper);
  color: var(--text-inverse);
  font-size: 16px;
  box-shadow: var(--shadow-card);
  z-index: 100;
}

.toast.toast-error {
  background: var(--urgency-2);
  color: var(--urgency-2-text);
}

/* --- Utility ---------------------------------------------------------- */

.hidden { display: none !important; }

/* Shown when a server-rendered page's script never loads (index.html). */
.boot-error {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: var(--radius-card);
  background: var(--bg-surface);
  box-shadow: var(--shadow-card);
  color: var(--text-primary);
  font-size: 16px;
}
.boot-error a { color: var(--accent-violet); font-weight: 700; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Responsive ------------------------------------------------------- */

@media (min-width: 480px) {
  body { padding-top: 48px; }
  .container { max-width: 400px; }
}
