/* ───────── Tokens ───────── */
:root {
  /* Surfaces */
  --bg:        #F1EDE2;
  --surface:   #FFFFFF;
  --ink:       #0A0A09;
  --ink-soft:  rgba(10, 10, 9, 0.55);
  --ink-sep:   rgba(10, 10, 9, 0.10);

  /* Accent */
  --accent:     #FF3D00;
  --accent-ink: #FFFFFF;

  /* On dark */
  --on-dark:         #FFFFFF;
  --on-dark-soft:    rgba(255, 255, 255, 0.6);
  --on-dark-sep:     rgba(255, 255, 255, 0.10);
  --on-dark-surface: rgba(255, 255, 255, 0.06);

  /* Typography */
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body:    "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono:    "Geist Mono", "JetBrains Mono", ui-monospace, monospace;

  /* Radii */
  --radius-xs:   4px;
  --radius-sm:  10px;
  --radius-md:  12px;
  --radius-lg:  14px;
  --radius-xl:  16px;
  --radius-2xl: 18px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-card:  0 4px 20px rgba(10,10,9,0.08);
  --shadow-cta:   0 10px 30px rgba(10,10,9,0.25);
  --shadow-sheet: 0 -20px 50px rgba(10,10,9,0.30);
}

/* ───────── Reset ───────── */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: inherit;
  font-size: inherit;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

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

a { color: inherit; }

/* ───────── Stage / layout ───────── */
#app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.screen {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  position: relative;
  animation: fadeUp 0.22s ease-out;
}
.screen[hidden] { display: none !important; }

.stage-light  { background: var(--bg); color: var(--ink); }
.stage-orange { background: var(--accent); color: var(--on-dark); }
.stage-dark   { background: var(--ink); color: var(--on-dark); }

.screen-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 14px 22px 0;
  min-height: 0;
}

.spacer { flex: 1; min-height: 8px; }
.cta-spacer { display: none; }

/* ───────── BrandBar ───────── */
.brandbar {
  padding-top: max(env(safe-area-inset-top), 12px);
  padding-right: 22px;
  padding-bottom: 8px;
  padding-left: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brandbar-left { display: flex; align-items: center; gap: 8px; }
.brand-logo {
  height: 20px;
  width: auto;
  display: block;
}
.brand-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.brand-kebab {
  width: 28px; height: 28px;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}
.brand-kebab i {
  width: 4px; height: 4px;
  border-radius: 999px;
  background: var(--ink);
  display: block;
}

.brandbar.inverse .brand-logo { filter: brightness(0) invert(1); }
.brandbar.inverse .brand-sub  { color: var(--on-dark-soft); }
.brandbar.inverse .brand-kebab { border-color: #fff; }
.brandbar.inverse .brand-kebab i { background: #fff; }

/* ───────── Type primitives ───────── */
.hero {
  font-family: var(--font-display);
  font-weight: 800;
  margin: 0;
}
.hero-xl   { font-size: clamp(64px, 22vw, 96px); line-height: 0.88; letter-spacing: -3.6px; margin-top: 14px; }
.hero-lg   { font-size: clamp(64px, 24vw, 100px); line-height: 0.88; letter-spacing: -4px;   margin-top: 18px; }
.hero-md   { font-size: clamp(56px, 20vw, 84px);  line-height: 0.88; letter-spacing: -3px;   margin-top: 24px; }
.hero-mega { font-size: clamp(120px, 48vw, 200px); line-height: 0.82; letter-spacing: -8px;  margin-top: 18px; }

.section-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(32px, 11vw, 48px);
  line-height: 0.9;
  letter-spacing: -1.5px;
  margin: 28px 0 0;
}

.lede {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.35;
  color: var(--ink-soft);
  margin: 18px 0 0;
  max-width: 320px;
}
.lede.on-dark { color: rgba(255,255,255,0.85); }

.caption {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 10px;
}

.accent { color: var(--accent); }
.accent-glow { animation: accentGlow 3s ease-in-out infinite; }
.accent-pulse { display: inline-block; animation: pulse 1.2s ease-in-out infinite; }

/* ───────── Buttons / CTAs ───────── */
.btn-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--ink);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.5px;
  padding: 20px 22px;
  border-radius: var(--radius-2xl);
  margin-top: 14px;
  /* Keep clear of iOS Safari's bottom toolbar / gesture zone */
  margin-bottom: calc(env(safe-area-inset-bottom, 0px) + 72px);
  cursor: pointer;
  text-align: left;
  position: relative;
}
.btn-cta-label { flex: 1; }
.btn-cta-bubble {
  width: 44px; height: 44px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.btn-cta-bubble svg { width: 20px; height: 20px; }
.nudge { animation: nudge 2.2s ease-in-out infinite; }

.upload-fallback {
  display: block;
  text-align: center;
  margin: 14px auto 28px;
  padding: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--ink-soft);
  cursor: pointer;
}

.upload-body { padding-bottom: max(env(safe-area-inset-bottom), 10px); }

/* ───────── Stats strip (Upload) ───────── */
.stats-strip {
  display: flex;
  padding: 14px 0;
  border-top: 1px solid var(--ink-sep);
  border-bottom: 1px solid var(--ink-sep);
  margin: 0 0 4px;
}
.stats-cell { flex: 1; }
.stats-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.5px;
  color: var(--ink);
}
.stats-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 2px;
}
.stats-div {
  width: 1px;
  background: var(--ink-sep);
  margin: 0 12px;
}

/* ───────── Extracting ───────── */
.receipt-card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 14px;
  box-shadow: var(--shadow-card);
  margin-top: 6px;
  animation: receiptBob 4s ease-in-out infinite;
  --scan-distance: 230px;
}
.receipt-img {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: contain;
  border-radius: 8px;
  background: #FBFAF6;
  border: 1px dashed var(--ink-sep);
}
.scan-line {
  position: absolute;
  left: 0; right: 0; top: 6px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent) 30%, var(--accent) 70%, transparent);
  box-shadow: 0 0 18px var(--accent), 0 0 4px var(--accent);
  animation: scanY 2.4s cubic-bezier(.6,.05,.4,.95) infinite;
  pointer-events: none;
}
.scan-glow {
  position: absolute;
  left: 0; right: 0; top: 6px;
  height: 60px;
  background: linear-gradient(180deg, rgba(255,61,0,0.18), transparent);
  mix-blend-mode: multiply;
  animation: scanY 2.4s cubic-bezier(.6,.05,.4,.95) infinite;
  pointer-events: none;
  --scan-distance: 170px;
}

.field-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 22px;
}
.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--ink-sep);
  opacity: 0;
  animation: fadeUp 0.4s ease-out both;
}
.field-key {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.field-val {
  display: flex;
  align-items: center;
  gap: 8px;
}
.field-val-text {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  color: var(--ink-soft);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.field-val-text[data-done="1"] { color: var(--ink); }

.status {
  width: 18px; height: 18px;
  border-radius: 999px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.status-run {
  border: 2px solid var(--ink-sep);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
.status-done {
  background: var(--ink);
  animation: none;
  border: none;
}
.status-done::after {
  content: "";
  width: 10px; height: 10px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'><path d='M2 5l2 2 4-4' stroke='%23fff' stroke-width='2' fill='none' stroke-linecap='round'/></svg>") center/contain no-repeat;
}

/* ───────── Review ───────── */
.review-body {
  padding-bottom: 0;
  overflow: visible;
}
.hero-card {
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius-2xl);
  padding: 16px 18px;
  margin-top: 10px;
  display: flex;
  gap: 14px;
  align-items: stretch;
}
.hero-card-text { flex: 1; min-width: 0; }
.hero-card-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hero-card-amount {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -2px;
  line-height: 1;
  margin-top: 8px;
  color: var(--accent);
}
.hero-card-currency {
  font-size: 22px;
  color: #fff;
  font-weight: 600;
  letter-spacing: 0;
}
.hero-card-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(255,255,255,0.55);
  margin-top: 8px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.hero-card-thumb {
  width: 72px;
  height: 96px;
  border-radius: 8px;
  object-fit: cover;
  background: rgba(255,255,255,0.06);
  align-self: flex-start;
  border: 1px dashed rgba(255,255,255,0.15);
}
.hero-card-thumb[src=""], .hero-card-thumb:not([src]) { display: none; }

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 18px;
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.field-ai, .field-saved {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.3px;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 600;
}
.field-ai { background: var(--accent); color: #fff; }
.field-saved { background: var(--ink); color: #fff; }

.field input[type="text"],
.field input[type="number"],
.field input[type="date"],
.field select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-md);
  background: var(--surface);
  font-family: var(--font-body);
  font-size: 16px; /* keeps iOS from zooming */
  font-weight: 600;
  color: var(--ink);
  appearance: none;
  -webkit-appearance: none;
}
.field input:focus, .field select:focus { outline: 2px solid var(--accent); outline-offset: 2px; }

.vat-breakdown {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-soft);
  margin-top: 2px;
}

/* Segmented pills */
.seg-group { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.seg-group legend { padding: 0; }
.segmented { display: flex; gap: 6px; }
.segmented .seg {
  flex: 1;
  position: relative;
}
.segmented .seg input { position: absolute; opacity: 0; inset: 0; }
.segmented .seg span {
  display: block;
  padding: 12px 8px;
  text-align: center;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.3px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
}
.segmented.seg-2 .seg span { padding: 14px 12px; font-size: 13px; letter-spacing: -0.2px; }
.segmented .seg input:checked + span { background: var(--ink); color: #fff; }
.segmented .seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Job tile */
.job-tile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  width: 100%;
  text-align: left;
  cursor: pointer;
}
.job-tile[data-empty="1"] { background: var(--surface); color: var(--ink); border: 1.5px solid var(--ink); }
.job-tile[data-empty="1"] .job-tile-client { color: var(--ink-soft); }
.job-tile[data-empty="1"] .job-tile-arrow { color: var(--ink); }
.job-tile-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.job-tile-client {
  font-family: var(--font-mono);
  font-size: 11px;
  opacity: 0.85;
  letter-spacing: 0.4px;
}
.job-tile-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.job-tile-arrow { width: 18px; height: 18px; color: #fff; flex-shrink: 0; margin-left: 12px; }

/* Submit CTA (inline at the end of the Review form) */
.cta-floating {
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius-2xl);
  padding: 14px 14px 14px 22px;
  margin-top: 22px;
  /* Keep clear of iOS Safari's bottom toolbar / gesture zone */
  margin-bottom: calc(env(safe-area-inset-bottom, 0px) + 72px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  cursor: pointer;
  text-align: left;
}
.cta-floating[disabled] { opacity: 0.45; }
.cta-floating-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: 0.6;
}
.cta-floating-main {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.6px;
  margin-top: 2px;
  display: block;
}
.cta-floating-aux { opacity: 0.5; font-weight: 500; font-size: 16px; margin-left: 6px; }
.cta-floating-circle {
  width: 52px; height: 52px;
  border-radius: 999px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cta-floating-circle svg { width: 22px; height: 22px; color: #fff; }

/* ───────── Job Picker (full-screen) ───────── */
.brand-back {
  width: 32px; height: 32px;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
}
.brand-back svg { width: 18px; height: 18px; color: var(--ink); }
.brand-spacer { width: 32px; height: 32px; flex-shrink: 0; }

.picker-body {
  padding-bottom: 0;
}
.picker-title {
  margin: 6px 0 14px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(32px, 9vw, 44px);
  letter-spacing: -1px;
  line-height: 1;
}
.picker-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-lg);
  flex-shrink: 0;
}
.picker-search svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--ink); }
.picker-search input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 16px;
  min-width: 0;
}
.picker-hits {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-soft);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  flex-shrink: 0;
}

.tabs {
  margin-top: 12px;
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.tab {
  flex: 1;
  padding: 12px 8px;
  text-align: center;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.3px;
  cursor: pointer;
}
.tab.is-on { background: var(--ink); color: #fff; }

.picker-list {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  margin-top: 18px;
  padding-bottom: max(env(safe-area-inset-bottom), 24px);
  -webkit-overflow-scrolling: touch;
}
.picker-section-header {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 18px 0 8px;
  display: flex;
  justify-content: space-between;
}
.picker-section-header:first-child { margin-top: 0; }

.cat-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.6px;
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: 600;
  background: var(--ink);
  color: #fff;
  text-transform: uppercase;
}

/* ───────── Login screen ───────── */
.login-body { padding-bottom: max(env(safe-area-inset-bottom), 28px); }
.mono-inline {
  font-family: var(--font-mono);
  font-size: 0.95em;
  background: var(--ink-sep);
  padding: 0 4px;
  border-radius: 3px;
}
.gsi-mount {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
  min-height: 44px;
}
.login-error {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--accent);
  text-align: center;
  margin-bottom: 14px;
}

/* ───────── Profile menu (dropdown from brandbar) ───────── */
.menu-scrim {
  position: fixed;
  inset: 0;
  background: rgba(10,10,9,0.35);
  z-index: 90;
  animation: fadeIn 0.15s ease-out;
}
.menu {
  position: fixed;
  top: max(env(safe-area-inset-top), 50px);
  right: 14px;
  width: min(320px, calc(100% - 28px));
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 14px 40px rgba(10,10,9,0.28);
  z-index: 91;
  overflow: hidden;
  animation: fadeUp 0.18s ease-out;
}
.menu-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--ink-sep);
}
.menu-avatar {
  width: 36px; height: 36px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: -0.4px;
  flex-shrink: 0;
  overflow: hidden;
}
.menu-avatar img { width: 100%; height: 100%; object-fit: cover; }
.menu-id { min-width: 0; flex: 1; }
.menu-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.menu-email {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-soft);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 16px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--ink-sep);
  color: var(--ink);
  cursor: pointer;
}
.menu-item:last-child { border-bottom: 0; }
.menu-item:active { background: var(--ink-sep); }
.menu-item-danger { color: var(--accent); }

/* Brandbar avatar (replaces kebab when signed in) */
.brand-kebab.has-avatar {
  border-color: var(--ink);
  background: var(--ink);
  gap: 0;
  overflow: hidden;
}
.brand-kebab.has-avatar i { display: none; }
.brand-kebab.has-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.brand-kebab.has-avatar .avatar-initials {
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: -0.3px;
}

/* ───────── History screen ───────── */
.history-body {
  padding-bottom: 0;
}
.history-list {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  margin-top: 16px;
  padding-bottom: max(env(safe-area-inset-bottom), 24px);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.history-item {
  display: flex;
  align-items: stretch;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--ink-sep);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
}
.history-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.history-item-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.history-item-vendor {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
}
.history-item-amount {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.4px;
  color: var(--accent);
  flex-shrink: 0;
}
.history-item-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink-soft);
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.history-item-note {
  margin-top: 4px;
  font-size: 12px;
  font-style: italic;
  color: var(--ink-soft);
}

.job-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-md);
  margin-bottom: 6px;
  cursor: pointer;
  text-align: left;
  width: 100%;
}
.job-card.is-selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.job-card-code {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
  background: var(--ink);
  color: #fff;
  padding: 4px 6px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}
.job-card.is-selected .job-card-code { background: rgba(255,255,255,0.18); color: #fff; }
.job-card-body { flex: 1; min-width: 0; }
.job-card-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.job-card-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-soft);
  margin-top: 2px;
  letter-spacing: 0.3px;
}
.job-card.is-selected .job-card-meta { color: rgba(255,255,255,0.7); }
.job-card-check { width: 20px; height: 20px; color: #fff; flex-shrink: 0; }

.job-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--ink-sep);
  cursor: pointer;
  text-align: left;
  width: 100%;
}
.job-row:last-child { border-bottom: none; }
.job-row-code {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  min-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.job-row-name {
  flex: 1;
  font-family: var(--font-body);
  font-size: 14px;
}

.highlight {
  background: rgba(255,61,0,0.18);
  padding: 0 2px;
  border-radius: 2px;
}
.job-card.is-selected .highlight { background: rgba(255,255,255,0.25); }

.picker-empty {
  padding: 32px 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--ink-soft);
}

/* ───────── IBAN ───────── */
.iban-body { padding-bottom: max(env(safe-area-inset-bottom), 14px); }
.iban-block { margin-top: 24px; }
.iban-input-wrap {
  margin-top: 8px;
  position: relative;
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}
#ibanInput {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 17px;
  letter-spacing: 0.4px;
  color: var(--ink);
  text-transform: uppercase;
}
.iban-caret {
  width: 2px; height: 22px;
  background: var(--accent);
  animation: pulse 1s ease-in-out infinite;
  margin-left: 4px;
}

.refund-summary {
  margin-top: 22px;
  background: var(--surface);
  border: 1px solid var(--ink-sep);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
}
.refund-amount {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 36px;
  letter-spacing: -1px;
  margin-top: 4px;
}

/* ───────── Saving ───────── */
.saving-body { padding-bottom: max(env(safe-area-inset-bottom), 14px); }
.steps {
  margin-top: 36px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.step {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--ink-sep);
  opacity: 0;
  animation: fadeUp 0.45s ease-out both;
}
.step[data-state="run"]  { background: var(--ink); color: #fff; border-color: var(--ink); }
.step-label {
  flex: 1;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.2px;
}
.step-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.4px;
  color: var(--ink-soft);
}
.step[data-state="run"] .step-meta { color: rgba(255,255,255,0.6); }

.step-dot {
  width: 22px; height: 22px;
  border-radius: 999px;
  flex-shrink: 0;
  border: 2px solid var(--ink-sep);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.step[data-state="run"] .step-dot {
  border-color: rgba(255,255,255,0.4);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
.step[data-state="done"] .step-dot {
  background: var(--accent);
  border: none;
}
.step[data-state="done"] .step-dot::after {
  content: "";
  width: 12px; height: 12px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'><path d='M2 5l2 2 4-4' stroke='%23fff' stroke-width='2' fill='none' stroke-linecap='round'/></svg>") center/contain no-repeat;
}

.footnote {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-align: center;
  margin-bottom: 28px;
}

/* ───────── Success ───────── */
.success-body { padding-bottom: max(env(safe-area-inset-bottom), 14px); }
.success-summary {
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius-xl);
  padding: 14px 16px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.success-summary-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
}
.success-summary-row.dim { color: rgba(255,255,255,0.6); }
.success-summary-amount {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 36px;
  letter-spacing: -1px;
  color: var(--accent);
}

.btn-success-primary {
  background: var(--ink);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.5px;
  padding: 20px 24px;
  border-radius: var(--radius-2xl);
  text-align: center;
  margin-bottom: 10px;
  cursor: pointer;
}
.btn-success-secondary {
  display: block;
  text-align: center;
  background: transparent;
  color: #fff;
  border: 1.5px solid rgba(255,255,255,0.6);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  padding: 14px;
  border-radius: var(--radius-lg);
  margin-bottom: 28px;
  text-decoration: none;
  cursor: pointer;
}

.pop-in { animation: popIn 0.6s cubic-bezier(.34,1.56,.64,1) both; }
.fade-up-delay { animation: fadeUp 0.5s ease-out 0.3s both; opacity: 0; }

/* ───────── Error ───────── */
.error-body { padding-bottom: max(env(safe-area-inset-bottom), 14px); }
.shake { animation: shake 0.45s ease-in-out 0.1s 1 both; }

.diag {
  margin-top: 26px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
}
.diag-title {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  margin-bottom: 8px;
}
.diag-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.diag-key {
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.diag-val {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.diag-val[data-ok="1"] {
  font-family: var(--font-mono);
  color: #fff;
}

.btn-error-primary {
  background: var(--accent);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.5px;
  padding: 20px 24px;
  border-radius: var(--radius-2xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  cursor: pointer;
}
.btn-error-bubble {
  width: 40px; height: 40px;
  border-radius: 999px;
  background: rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.btn-error-bubble svg { width: 20px; height: 20px; color: #fff; }
.btn-error-secondary {
  background: transparent;
  color: #fff;
  border: 1.5px solid rgba(255,255,255,0.6);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  padding: 14px;
  border-radius: var(--radius-lg);
  margin-bottom: 28px;
  text-align: center;
  cursor: pointer;
}

/* ───────── Keyframes ───────── */
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}
@keyframes scanY {
  0%   { transform: translateY(0);                            opacity: 0; }
  8%   { opacity: 1; }
  92%  { opacity: 1; }
  100% { transform: translateY(var(--scan-distance, 220px));  opacity: 0; }
}
@keyframes receiptBob {
  0%, 100% { transform: translateY(0)    rotate(-0.3deg); }
  50%      { transform: translateY(-3px) rotate( 0.3deg); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes popIn {
  0%   { opacity: 0; transform: scale(0.92); }
  60%  { opacity: 1; transform: scale(1.02); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes nudge {
  0%, 100% { transform: translateX(0); }
  50%      { transform: translateX(4px); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}
@keyframes accentGlow {
  0%, 100% { text-shadow: 0 0 0 transparent; }
  50%      { text-shadow: 0 0 18px rgba(255,61,0,0.45); }
}
/* ───────── Reduced motion ───────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
