/* =================================================================
   Receipt Tracker - design system
   Indigo/violet. Every colour, radius and shadow is defined once here.
   ================================================================= */
:root {
  --indigo: #4f46e5;
  --indigo-dark: #3730a3;
  --indigo-light: #818cf8;
  --violet: #7c3aed;
  --violet-light: #a78bfa;

  --ink: #1e1b4b;
  --body: #4b4b66;
  --muted: #8a8aa8;
  --line: #e7e5f4;
  --field: #f6f5fc;
  --canvas: #f7f6fd;
  --surface: #fff;

  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --ok: #059669;
  --ok-soft: #ecfdf5;
  --warn: #d97706;
  --warn-soft: #fffbeb;

  --brand: linear-gradient(135deg, #6366f1, #8b5cf6);
  --brand-deep: linear-gradient(90deg, #4f46e5, #7c3aed);

  --r-field: 14px;
  --r-btn: 15px;
  --r-card: 22px;
  --shadow-card: 0 12px 34px -10px rgba(49, 46, 129, 0.16);
  --shadow-btn: 0 8px 20px -6px rgba(79, 70, 229, 0.55);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--body);
  font: 15px/1.55 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { color: var(--ink); letter-spacing: -0.3px; margin: 0; }
a { color: var(--indigo); }

.hide { display: none !important; }

/* ---------------- auth layout ---------------- */
.auth-wrap { min-height: 100%; position: relative; }

.auth-hero {
  position: absolute;
  inset: 0 0 auto 0;
  height: 300px;
  background: var(--brand);
  border-radius: 0 0 36px 36px;
  overflow: hidden;
}
.auth-hero::before,
.auth-hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}
.auth-hero::before { width: 220px; height: 220px; top: -70px; right: -50px; }
.auth-hero::after  { width: 190px; height: 190px; top: 60px; left: -80px; }

.auth-inner {
  position: relative;
  max-width: 460px;
  margin: 0 auto;
  padding: 40px 18px 60px;
}

.auth-head { padding: 0 10px 24px; }
.auth-badge {
  width: 58px; height: 58px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: grid; place-items: center;
  color: #fff; margin-bottom: 18px;
}
.auth-head h1 { color: #fff; font-size: 28px; line-height: 1.2; font-weight: 800; }
.auth-head p { color: #ddd9fb; font-size: 14.5px; margin: 8px 0 0; }

.card {
  background: var(--surface);
  border-radius: var(--r-card);
  padding: 26px 22px;
  box-shadow: var(--shadow-card);
}

.auth-foot { text-align: center; margin-top: 22px; font-size: 14px; }
.auth-foot a { font-weight: 700; text-decoration: none; cursor: pointer; }

/* ---------------- form ---------------- */
.field { margin-bottom: 17px; }
.field label {
  display: block;
  font-size: 13px; font-weight: 600;
  color: var(--body); margin: 0 0 7px 2px;
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: var(--r-field);
  background: var(--field);
  font: inherit; color: var(--ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.field textarea { resize: vertical; min-height: 74px; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--indigo);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}
.field input.bad, .field textarea.bad { border-color: var(--danger); background: var(--danger-soft); }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 7px; }

.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 46px; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; cursor: pointer; padding: 8px;
  color: var(--muted); font-size: 15px; line-height: 1;
}

/* password strength meter */
.meter { display: flex; align-items: center; gap: 5px; margin-top: 9px; }
.meter i { flex: 1; height: 4px; border-radius: 3px; background: var(--line); transition: background .25s; }
.meter span { font-size: 11.5px; font-weight: 700; color: var(--muted); min-width: 62px; text-align: right; }

/* ---------------- buttons ---------------- */
.btn {
  width: 100%;
  padding: 15px;
  border: 0; border-radius: var(--r-btn);
  background: var(--brand-deep); color: #fff;
  font: 700 15px/1 inherit; letter-spacing: .2px;
  cursor: pointer;
  box-shadow: var(--shadow-btn);
  transition: filter .15s, opacity .15s;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
}
.btn:hover:not(:disabled) { filter: brightness(1.07); }
.btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }

.btn.ghost {
  background: #fff; color: var(--indigo);
  border: 1.4px solid var(--line); box-shadow: none;
}
.btn.danger { background: var(--danger); box-shadow: none; }
.btn.sm { width: auto; padding: 10px 16px; font-size: 13.5px; border-radius: 12px; }
.btn.link {
  width: auto; background: none; color: var(--indigo);
  box-shadow: none; padding: 8px; font-size: 13.5px;
}

.spinner {
  width: 17px; height: 17px;
  border: 2.2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff; border-radius: 50%;
  animation: spin .7s linear infinite;
}
.btn.ghost .spinner { border-color: rgba(79,70,229,.3); border-top-color: var(--indigo); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- banners & toasts ---------------- */
.banner {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 13px 14px; border-radius: var(--r-field);
  font-size: 13.5px; line-height: 1.45; font-weight: 500;
  margin-bottom: 17px; border: 1px solid;
}
.banner svg { flex: none; margin-top: 1px; }
.banner.err  { background: var(--danger-soft); border-color: rgba(220,38,38,.24); color: var(--danger); }
.banner.ok   { background: var(--ok-soft);     border-color: rgba(5,150,105,.24);  color: var(--ok); }
.banner.warn { background: var(--warn-soft);   border-color: rgba(217,119,6,.24);  color: var(--warn); }
.banner.info { background: #f1f0fe;            border-color: rgba(79,70,229,.22);  color: var(--indigo); }

#toasts {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  z-index: 90; display: flex; flex-direction: column; gap: 9px;
  width: min(440px, calc(100vw - 32px));
}
.toast {
  padding: 13px 16px; border-radius: var(--r-field);
  color: #fff; font-size: 13.5px; font-weight: 500;
  box-shadow: 0 12px 30px -8px rgba(15,23,42,.45);
  animation: rise .22s ease-out;
}
.toast.err  { background: #991b1b; }
.toast.ok   { background: #065f46; }
.toast.warn { background: #92400e; }
.toast.info { background: var(--ink); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* ---------------- OTP boxes ---------------- */
.otp-row { display: flex; gap: 8px; margin: 6px 0; }
.otp-row input {
  flex: 1; min-width: 0; text-align: center;
  font-size: 23px; font-weight: 700; color: var(--ink);
  padding: 15px 0;
  border: 1.4px solid var(--line); border-radius: var(--r-field);
  background: var(--field); outline: none;
}
.otp-row input:focus {
  border-color: var(--indigo); border-width: 1.9px; background: #fff;
  box-shadow: 0 4px 12px rgba(79,70,229,.16);
}
.otp-row input.bad { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 30px;
  font-size: 13px; font-weight: 700; border: 1px solid;
}
.pill.live   { background: #f1f0fe;          border-color: rgba(79,70,229,.24); color: var(--indigo); }
.pill.urgent { background: var(--warn-soft);  border-color: rgba(217,119,6,.25); color: var(--warn); }
.pill.dead   { background: var(--danger-soft);border-color: rgba(220,38,38,.25); color: var(--danger); }
.clock { font-variant-numeric: tabular-nums; letter-spacing: .6px; }

/* ---------------- app shell ---------------- */
.app-head {
  background: var(--brand);
  border-radius: 0 0 30px 30px;
  padding: 22px 20px 30px;
  color: #fff;
}
.app-head .row { display: flex; align-items: center; gap: 14px; max-width: 980px; margin: 0 auto; }
.avatar {
  width: 48px; height: 48px; border-radius: 16px;
  background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.3);
  display: grid; place-items: center;
  font-size: 19px; font-weight: 800; color: #fff; flex: none;
}
.app-head .who { flex: 1; min-width: 0; }
.app-head .who small { display: block; color: #ddd9fb; font-size: 12px; font-weight: 500; }
.app-head .who strong {
  display: block; font-size: 15.5px; font-weight: 700; margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.icon-btn {
  width: 40px; height: 40px; border-radius: 13px; flex: none;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.22);
  color: #fff; font-size: 16px; cursor: pointer;
  display: grid; place-items: center;
  transition: background .15s;
}
.icon-btn:hover { background: rgba(255,255,255,.28); }

.quota-strip {
  max-width: 980px; margin: 16px auto 0;
  display: flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.22);
  border-radius: 15px; padding: 11px 15px; font-size: 13px;
}
.quota-strip .bar { flex: 1; height: 5px; border-radius: 3px; background: rgba(255,255,255,.25); overflow: hidden; }
.quota-strip .bar i { display: block; height: 100%; background: #fff; border-radius: 3px; transition: width .3s; }
.quota-strip b { font-weight: 700; }

/* Amber rather than white when a plan is ending or has ended. The strip
   sits on the indigo header, so the warning has to read against that
   rather than against a white page. */
.quota-strip .bar.warn i { background: #fcd34d; }
.strip-btn {
  flex: none; background: #fff; color: var(--indigo); border: 0;
  border-radius: 999px; padding: 6px 14px; cursor: pointer;
  font: inherit; font-size: 12.5px; font-weight: 800; letter-spacing: .2px;
  transition: transform .12s, box-shadow .15s;
}
.strip-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,0,0,.16); }
.badge-pro {
  background: #fff; color: var(--indigo);
  padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 800;
  letter-spacing: .4px;
}

main { max-width: 980px; margin: 0 auto; padding: 26px 18px 70px; }

.section-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 18px; flex-wrap: wrap;
}
.section-head h2 { font-size: 20px; }
.section-head p { margin: 3px 0 0; font-size: 13.5px; color: var(--muted); }

/* ---------------- search ----------------
   16px on the input is not a style choice: iOS Safari zooms the whole
   page in when a focused field is smaller than that, and the zoom does
   not undo itself on blur.
   ---------------------------------------- */
/* Search first, then the action button. On a narrow screen they stack,
   and the search still comes first because it is first in the DOM. */
.list-tools {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 16px; flex-wrap: wrap;
}
.list-tools .searchbar { flex: 1 1 240px; margin: 0; }
.list-tools .btn { flex: 0 0 auto; }

@media (max-width: 460px) {
  /* Full width each, rather than a cramped half-and-half. */
  .list-tools .searchbar { flex-basis: 100%; }
  .list-tools .btn { width: 100%; }
}

.searchbar {
  position: relative;
  display: flex; align-items: center;
  margin: 0 0 14px;
}
.searchbar .s-icon {
  position: absolute; left: 14px;
  display: flex; color: var(--muted); pointer-events: none;
}
.searchbar input {
  width: 100%;
  padding: 12px 42px 12px 42px;
  font: inherit; font-size: 16px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-field);
  outline: none;
  transition: border-color .16s, box-shadow .16s;
  -webkit-appearance: none;
  appearance: none;
}
.searchbar input::placeholder { color: var(--muted); }
.searchbar input:focus {
  border-color: var(--indigo-light);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .14);
}
.searchbar input:focus + .s-clear,
.searchbar input:not(:placeholder-shown) + .s-clear { color: var(--body); }

/* Safari draws its own clear affordance on type=search; ours is the
   one that is wired up, so the native one has to go. */
.searchbar input::-webkit-search-decoration,
.searchbar input::-webkit-search-cancel-button,
.searchbar input::-webkit-search-results-button { -webkit-appearance: none; display: none; }

.searchbar .s-clear {
  position: absolute; right: 8px;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  font-size: 21px; line-height: 1;
  color: var(--muted); background: none; border: 0; border-radius: 9px;
  cursor: pointer;
}
.searchbar .s-clear:hover { background: var(--field); color: var(--ink); }

.result-count {
  margin: -6px 0 14px;
  font-size: 12.5px; font-weight: 600; color: var(--muted);
}
.result-count:empty { display: none; }

/* ---------------- folder grid ---------------- */
.grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
}

.folder {
  background: var(--surface); border-radius: 18px;
  padding: 18px; border: 1px solid var(--line);
  cursor: pointer; position: relative;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.folder:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
  border-color: transparent;
}
.folder .top { display: flex; align-items: flex-start; gap: 11px; }
.folder .swatch {
  width: 40px; height: 40px; border-radius: 13px; flex: none;
  display: grid; place-items: center;
}
.folder h3 { font-size: 15.5px; line-height: 1.35; word-break: break-word; }
.folder .note {
  font-size: 12.5px; color: var(--muted); margin: 5px 0 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.folder .stats {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-top: 15px; padding-top: 13px; border-top: 1px solid var(--line);
}
.folder .stats .n { font-size: 12.5px; color: var(--muted); }
.folder .stats .amt { font-size: 17px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.folder .menu {
  position: absolute; top: 12px; right: 10px;
  background: none; border: 0; color: var(--muted);
  font-size: 17px; cursor: pointer; padding: 5px 8px; border-radius: 8px; line-height: 1;
}
.folder .menu:hover { background: var(--field); color: var(--ink); }

/* colour swatches */
.c-indigo { background: #eef2ff; color: #4f46e5; }
.c-violet { background: #f5f3ff; color: #7c3aed; }
.c-blue   { background: #eff6ff; color: #2563eb; }
.c-teal   { background: #f0fdfa; color: #0d9488; }
.c-green  { background: #f0fdf4; color: #16a34a; }
.c-amber  { background: #fffbeb; color: #d97706; }
.c-rose   { background: #fff1f2; color: #e11d48; }
.c-slate  { background: #f8fafc; color: #475569; }

/* colour picker */
.colors { display: flex; gap: 9px; flex-wrap: wrap; }
.colors button {
  width: 36px; height: 36px; border-radius: 11px;
  border: 2px solid transparent; cursor: pointer;
  display: grid; place-items: center;
  transition: transform .12s;
}
.colors button:hover { transform: scale(1.08); }
.colors button[aria-pressed="true"] { border-color: var(--ink); }

/* ---------------- empty state ---------------- */
.empty { text-align: center; padding: 60px 20px; }
.empty .glyph {
  width: 100px; height: 100px; margin: 0 auto 24px;
  border-radius: 30px; background: #f1f0fe; color: var(--indigo-light);
  display: grid; place-items: center;
}
.empty h3 { font-size: 19px; margin-bottom: 9px; }
.empty p { color: var(--muted); font-size: 14.5px; max-width: 380px; margin: 0 auto 24px; }

/* skeleton while loading */
.skel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px; }
.skel i { display: block; height: 12px; border-radius: 6px; background: var(--field); margin-bottom: 10px;
  animation: pulse 1.3s ease-in-out infinite; }
.skel i:nth-child(1) { width: 60%; height: 40px; border-radius: 13px; }
.skel i:nth-child(2) { width: 80%; }
.skel i:nth-child(3) { width: 40%; }
@keyframes pulse { 50% { opacity: .45; } }

/* ---------------- modal ---------------- */
.overlay {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(30, 27, 75, .45);
  backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 18px;
  animation: fade .15s ease-out;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  background: var(--surface); border-radius: var(--r-card);
  width: min(460px, 100%); max-height: 90vh; overflow: auto;
  padding: 24px 22px;
  box-shadow: 0 30px 70px -20px rgba(15, 23, 42, .5);
  animation: pop .18s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.modal h2 { font-size: 18px; margin-bottom: 4px; }
.modal .sub { font-size: 13.5px; color: var(--muted); margin: 0 0 20px; }
.modal .actions { display: flex; gap: 10px; margin-top: 22px; }
.modal .actions .btn { flex: 1; }

@media (max-width: 520px) {
  .auth-inner { padding-top: 30px; }
  .auth-head h1 { font-size: 25px; }
  .grid { grid-template-columns: 1fr 1fr; gap: 11px; }
  .folder { padding: 15px; }
}
@media (max-width: 380px) {
  .grid { grid-template-columns: 1fr; }
}

/* ---------------- receipts ---------------- */
.app-head.compact { padding-bottom: 24px; }
.head-total { text-align: right; flex: none; }
.head-total small { display: block; color: #ddd9fb; font-size: 11.5px; font-weight: 500; }
.head-total strong { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }

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

.receipt {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 13px 16px 13px 13px;
  cursor: pointer;
  transition: transform .14s, box-shadow .14s, border-color .14s;
}
.receipt:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-card);
  border-color: transparent;
}
.receipt .thumb {
  width: 50px; height: 50px; border-radius: 12px; flex: none;
  background-size: cover; background-position: center;
  background-color: var(--field);
  display: grid; place-items: center; color: var(--indigo-light);
}
.receipt .thumb:not(.blank) { border: 1px solid var(--line); }
.receipt .rmain { flex: 1; min-width: 0; }
.receipt .rmain h3 {
  font-size: 15px; font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.receipt .rmain p { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); }
.receipt .ramt {
  font-size: 17px; font-weight: 800; color: var(--ink);
  font-variant-numeric: tabular-nums; flex: none;
}

/* form grids */
.two   { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.three { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
@media (max-width: 460px) { .three { grid-template-columns: 1fr 1fr; } }

/* photo slot */
.photo-slot {
  border: 1.5px dashed var(--line); border-radius: 16px;
  padding: 14px; margin-bottom: 18px; text-align: center;
  background: var(--field);
}
.photo-preview {
  height: 0; border-radius: 12px; background-size: cover; background-position: center;
  transition: height .2s;
}
.photo-preview.has { height: 168px; margin-bottom: 12px; border: 1px solid var(--line); }
.photo-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.photo-actions .btn.sm { padding: 9px 14px; }
.photo-slot .hint { margin: 10px 0 0; }

/* camera */
.cam-stage {
  position: relative; border-radius: 16px; overflow: hidden;
  background: #0f0d1f; aspect-ratio: 4 / 3; margin-bottom: 6px;
}
.cam-stage video, .cam-stage img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}

/* a field the scan just filled, so the user can see what changed */
.field input.filled, .field select.filled, .field textarea.filled {
  border-color: var(--ok);
  background: var(--ok-soft);
  animation: fillflash .5s ease-out;
}
@keyframes fillflash { from { background: #d1fae5; } }

/* explicit close on every modal */
.modal { position: relative; }
.modal-x {
  position: absolute; top: 12px; right: 12px;
  width: 34px; height: 34px; border-radius: 11px;
  border: 0; background: var(--field); color: var(--muted);
  font-size: 22px; line-height: 1; cursor: pointer;
  display: grid; place-items: center;
  transition: background .15s, color .15s;
}
.modal-x:hover { background: var(--line); color: var(--ink); }
.modal h2 { padding-right: 44px; }

/* required-field marker */
.req { color: var(--danger); font-weight: 700; margin-left: 2px; }
.opt { color: var(--muted); font-weight: 500; font-size: 12px; margin-left: 4px; }

/* ---------------- ads ---------------- */
.wall-glyph {
  width: 76px; height: 76px; margin: 0 auto 18px; border-radius: 24px;
  background: #f1f0fe; color: var(--indigo); display: grid; place-items: center;
}
.ad-stage {
  background: #14122b; border-radius: 18px; padding: 30px 20px 22px;
  text-align: center; margin-bottom: 4px; transition: background .3s;
}
.ad-stage.done { background: #0d2a22; }
.ad-ring {
  width: 78px; height: 78px; margin: 0 auto 14px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.22);
  display: grid; place-items: center;
  font-size: 27px; font-weight: 800; color: #fff;
  font-variant-numeric: tabular-nums;
}
.ad-stage.done .ad-ring { border-color: #34d399; color: #34d399; }
.ad-label { color: #b9b4e8; font-size: 12.5px; margin: 0 0 14px; letter-spacing: .4px; }
.ad-bar { height: 4px; border-radius: 3px; background: rgba(255,255,255,.16); overflow: hidden; }
.ad-bar i { display: block; height: 100%; width: 0; background: var(--violet-light); transition: width 1s linear; }

/* ---------------- checkout ---------------- */
.pick-label { font-size: 13px; font-weight: 600; color: var(--body); margin: 4px 0 9px 2px; }
.methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.method {
  background: var(--field); border: 2px solid transparent; border-radius: 15px;
  padding: 14px 8px; cursor: pointer; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  transition: border-color .15s, background .15s;
}
.method:hover { background: #fff; }
.method[aria-pressed="true"] { border-color: var(--indigo); background: #fff; }
.method .mg { font-size: 21px; }
.method .ml { font-size: 13px; font-weight: 700; color: var(--ink); }
.method .mf { font-size: 11px; color: var(--muted); }

/* Plan picker. Two wide rows rather than the methods' three columns:
   the choice here is a commitment, not an icon, and it needs room for a
   price and a saving without either being abbreviated. */
.plans { display: grid; gap: 9px; margin-bottom: 18px; }
.plan-opt {
  background: var(--field); border: 2px solid transparent; border-radius: 15px;
  padding: 13px 15px; cursor: pointer; text-align: left; width: 100%;
  display: flex; align-items: center; gap: 12px;
  transition: border-color .15s, background .15s;
}
.plan-opt:hover { background: #fff; }
.plan-opt[aria-pressed="true"] { border-color: var(--indigo); background: #fff; }
.plan-opt .pl { display: block; font-size: 14px; font-weight: 700; color: var(--ink); }
.plan-opt .pp { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.plan-opt .pgrow { flex: 1; min-width: 0; }
.plan-opt .save {
  font-size: 11px; font-weight: 700; letter-spacing: .3px;
  color: #0f7b52; background: #dff5e9; border-radius: 999px;
  padding: 4px 9px; white-space: nowrap;
}

.pay-card {
  background: var(--field); border-radius: 16px; padding: 16px; margin: 4px 0 2px;
}
.pay-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 13.5px; padding: 7px 0;
}
.pay-row.muted { color: var(--muted); }
.pay-row.total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 12px; font-size: 15px; }
.pay-row b { font-variant-numeric: tabular-nums; color: var(--ink); }
.pay-ref {
  margin-top: 12px; font: 11px ui-monospace, Consolas, monospace;
  color: var(--muted); word-break: break-all;
}
.pill-status {
  font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 20px;
  text-transform: capitalize;
}
.pill-status.paid { background: var(--ok-soft); color: var(--ok); }
.pill-status.pending { background: var(--warn-soft); color: var(--warn); }
.pill-status.failed { background: var(--danger-soft); color: var(--danger); }

/* ---------------- maker's mark ----------------
   Deliberately quiet. It should be findable on every screen without
   competing with anything the user came here to do.
   ---------------------------------------------- */
.app-footer {
  max-width: 980px;
  margin: 0 auto;
  padding: 26px 18px calc(30px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; justify-content: center; gap: 7px;
  font-size: 12px; color: var(--muted);
  letter-spacing: .2px;
}
.app-footer .mark {
  font-weight: 800;
  letter-spacing: .3px;
  color: var(--indigo);
}
.app-footer .dot { opacity: .55; }

/* Boot splash only - see appFooter() in ui.ts. That screen is nearly
   empty, so in normal flow the mark lands on the edge of the hero and
   turns unreadable; pinning it to the bottom keeps it on the canvas. */
.app-footer.pinned {
  position: absolute;
  left: 0; right: 0; bottom: 0;
}

/* ==================================================================
   Multi-select
   The bar takes the place of the search row rather than sitting above
   it, so the list never shifts down as you switch modes.
   ================================================================== */
.sel-bar {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 16px; padding: 8px 10px 8px 8px;
  background: var(--surface);
  border: 1px solid var(--indigo-light);
  border-radius: var(--r-field);
  flex-wrap: wrap;
}
.sel-bar strong { flex: 1 1 auto; font-size: 14px; color: var(--ink); }
.sel-bar .btn.sm { flex: 0 0 auto; }
.sel-bar .icon-btn { flex: none; font-size: 20px; line-height: 1; }

/* The tick sits where the folder's "..." menu normally does, so nothing
   moves when the mode changes. */
.folder .tick,
.receipt .tick {
  display: grid; place-items: center;
  width: 22px; height: 22px; flex: none;
  border: 2px solid var(--line); border-radius: 7px;
  background: var(--surface); color: #fff;
  transition: background .14s, border-color .14s;
}
.folder .tick { position: absolute; top: 14px; right: 12px; }

.folder .tick.on,
.receipt .tick.on { background: var(--indigo); border-color: var(--indigo); }

.folder.picked,
.receipt.picked {
  border-color: var(--indigo);
  background: #f8f7ff;
}

/* No lift on hover while picking: the cards are targets, not doorways. */
.folder.picking:hover,
.receipt.picking:hover { transform: none; box-shadow: none; border-color: var(--indigo-light); }

/* ==================================================================
   Lightbox - the attached photo, whole
   ================================================================== */
.lightbox {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(10, 8, 24, .93);
  display: flex; flex-direction: column;
}
.lb-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; color: #fff; flex: none;
}
.lb-title {
  flex: 1; font-size: 14.5px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lb-x {
  width: 34px; height: 34px; border-radius: 11px; flex: none;
  border: 0; background: rgba(255, 255, 255, .14); color: #fff;
  font-size: 22px; line-height: 1; cursor: pointer;
  display: grid; place-items: center;
}
.lb-x:hover { background: rgba(255, 255, 255, .26); }

.lb-stage {
  flex: 1; min-height: 0;
  display: grid; place-items: center;
  padding: 0 14px; overflow: hidden;
}
.lb-stage img {
  max-width: 100%; max-height: 100%;
  object-fit: contain; border-radius: 8px;
  cursor: zoom-in; user-select: none;
}

/* Zoomed: the image goes to its natural size and the stage scrolls, so
   no part of a tall receipt is ever out of reach. */
.lb-stage.zoomed { overflow: auto; place-items: start; cursor: grab; }
.lb-stage.zoomed img {
  max-width: none; max-height: none;
  border-radius: 0; cursor: zoom-out;
}
.lb-stage.dragging { cursor: grabbing; }

.lb-hint {
  flex: none; margin: 0; padding: 10px 14px calc(14px + env(safe-area-inset-bottom, 0px));
  text-align: center; font-size: 12.5px; color: rgba(255, 255, 255, .6);
}

/* The preview inside the receipt form, once it holds a photo. */
.photo-preview.has { position: relative; cursor: zoom-in; }
.photo-preview .photo-zoom {
  position: absolute; right: 9px; bottom: 9px;
  display: none; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 20px;
  background: rgba(10, 8, 24, .62); color: #fff;
  font-size: 11.5px; font-weight: 600;
}
.photo-preview.has .photo-zoom { display: inline-flex; }
.photo-preview.has:hover .photo-zoom { background: rgba(10, 8, 24, .8); }
.photo-preview.has:focus-visible { outline: 2px solid var(--indigo); outline-offset: 2px; }
