/* Invomo prototype — mobile-first styles */

:root {
  --bg: #f3f4f1;
  --card: #ffffff;
  --ink: #0b1220;
  --ink2: #374151;
  --muted: #6b7280;
  --line: #e5e7eb;
  --brand: #16a34a;
  --brand-ink: #15803d;
  --brand-soft: #dcfce7;
  --blue: #1d4ed8; --blue-soft: #dbeafe;
  --teal: #0f766e; --teal-soft: #ccfbf1;
  --amber: #b45309; --amber-soft: #fef3c7;
  --red: #dc2626; --red-soft: #fee2e2;
  --gray-soft: #f1f5f9;
  --r: 16px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .07);
  --tabh: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.45 var(--font); -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body.locked { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
input, select, textarea { font: inherit; color: inherit; }
i { font-style: normal; color: var(--muted); font-weight: 500; }
.ic { width: 22px; height: 22px; flex: none; }
.mt { margin-top: 12px; }
.center { text-align: center; }
.green { color: #4ade80; }
.red { color: var(--red); }
.hero .red { color: #f87171; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; }

#app { max-width: 640px; margin: 0 auto; min-height: 100dvh; padding-bottom: calc(var(--tabh) + var(--safe-b) + 28px); }
body.no-tabs #app { padding-bottom: calc(100px + var(--safe-b)); }
body.no-tabs #tabbar { display: none; }

/* ---------- top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 6px;
  padding: calc(var(--safe-t) + 8px) 10px 8px; min-height: 58px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.5) blur(14px); -webkit-backdrop-filter: saturate(1.5) blur(14px);
}
.top.large { padding: calc(var(--safe-t) + 18px) 16px 10px; align-items: flex-end; }
.top-titles { flex: 1; min-width: 0; }
.kicker { font-size: 14px; font-weight: 600; color: var(--muted); }
.top h1 { margin: 0; font-size: 30px; line-height: 1.1; font-weight: 800; letter-spacing: -.025em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top h2 { flex: 1; margin: 0; font-size: 17px; font-weight: 700; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; display: inline-grid; place-items: center; color: var(--ink); flex: none; }
.icon-btn:active { background: rgba(0, 0, 0, .06); }
.icon-btn.ghost { visibility: hidden; }
.icon-btn.sm { width: 34px; height: 34px; }
.icon-btn.sm .ic { width: 18px; height: 18px; }
.text-btn { padding: 10px 8px; font-weight: 600; color: var(--brand-ink); min-width: 64px; }
.text-btn.strong { font-weight: 800; text-align: right; }
.danger-text { color: var(--red) !important; }

.page { padding: 4px 16px 16px; }
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; margin: 0 0 12px; }
.section-title { margin: 24px 4px 10px; font-size: 12.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.note { font-size: 14px; color: var(--muted); margin: 0 0 14px; }
.or { text-align: center; font-size: 13px; color: var(--muted); margin: 12px 0; }
.link { color: var(--brand-ink); font-weight: 600; font-size: 14px; }

/* ---------- home ---------- */
.hero {
  background: var(--ink); color: #fff; border-radius: 22px; padding: 20px 20px 16px;
  box-shadow: 0 14px 30px -14px rgba(11, 18, 32, .6); position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; right: -70px; top: -70px; width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(34, 197, 94, .38), transparent 70%); pointer-events: none;
}
.hero-label { font-size: 12.5px; font-weight: 700; color: #9ca3af; text-transform: uppercase; letter-spacing: .07em; }
.hero-amt { font-size: 48px; line-height: 1.1; font-weight: 800; letter-spacing: -.03em; margin: 4px 0 14px; }
.hero-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; border-top: 1px solid rgba(255, 255, 255, .12); padding-top: 12px; }
.hero-row span { display: block; font-size: 12px; color: #9ca3af; }
.hero-row strong { font-size: 15.5px; font-variant-numeric: tabular-nums; }
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0 0; }
.quick-btn {
  display: flex; flex-direction: column; gap: 14px; padding: 16px; border-radius: 18px;
  background: var(--card); box-shadow: var(--shadow); font-weight: 700; font-size: 16px;
}
.quick-btn .ic { width: 28px; height: 28px; color: var(--brand); }
.quick-btn.primary { background: var(--brand); color: #fff; box-shadow: 0 10px 22px -12px rgba(22, 163, 74, .9); }
.quick-btn.primary .ic { color: #fff; }
.quick-btn:active, .btn:active, .am:active { transform: scale(.98); }

/* ---------- lists ---------- */
.list { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); min-height: 64px; width: 100%; }
.row:last-child { border-bottom: 0; }
a.row:active, button.row:active { background: #f9fafb; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { font-size: 13px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-end { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.row-amt { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-amt small { font-weight: 500; color: var(--muted); font-size: 12px; }
.row.menu { gap: 14px; min-height: 56px; }
.row.menu .ic { color: var(--ink2); }
.row.menu small { display: block; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.row.menu.danger, .row.menu.danger .ic { color: var(--red); }
.doc-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.doc-ic .ic { width: 20px; height: 20px; }
.doc-ic.estimate { background: var(--blue-soft); color: var(--blue); }
.doc-ic.invoice { background: var(--brand-soft); color: var(--brand-ink); }
.doc-ic.paid { background: var(--brand-soft); color: var(--brand-ink); }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); display: grid; place-items: center; font-weight: 700; font-size: 15px; flex: none; }
.badge { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.badge.gray { background: var(--gray-soft); color: #475569; }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.teal { background: var(--teal-soft); color: var(--teal); }
.badge.green { background: var(--brand-soft); color: var(--brand-ink); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.red { background: var(--red-soft); color: var(--red); }
.empty { text-align: center; padding: 36px 24px; color: var(--muted); }
.empty .ic { width: 44px; height: 44px; color: #9ca3af; }
.empty h3 { color: var(--ink); margin: 12px 0 4px; font-size: 18px; }
.empty p { margin: 0; font-size: 15px; }
.empty.small { padding: 18px; }

.search { display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 14px; padding: 0 14px; box-shadow: var(--shadow); margin-bottom: 12px; color: var(--muted); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; padding: 13px 0; background: transparent; font-size: 16px; color: var(--ink); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 12px; margin: 0 -2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chips.tight { margin-top: -6px; }
.chip { flex: none; padding: 9px 14px; border-radius: 999px; background: #fff; box-shadow: var(--shadow); font-size: 14px; font-weight: 600; white-space: nowrap; }
.sheet .chip { box-shadow: 0 0 0 1.5px var(--line); }
.chip.on { background: var(--ink); color: #fff; box-shadow: none; }

.fab {
  position: fixed; right: max(16px, calc(50% - 304px)); bottom: calc(var(--tabh) + var(--safe-b) + 16px);
  width: 60px; height: 60px; border-radius: 20px; background: var(--brand); color: #fff;
  display: grid; place-items: center; box-shadow: 0 12px 24px -8px rgba(22, 163, 74, .75); z-index: 15;
}
.fab .ic { width: 28px; height: 28px; }

/* ---------- tab bar ---------- */
#tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: rgba(255, 255, 255, .94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line); padding-bottom: var(--safe-b);
}
.tabs { max-width: 640px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); height: var(--tabh); }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: #6b7280; }
.tab.on { color: var(--ink); }
.tab.on .ic { color: var(--brand); }

/* ---------- forms & buttons ---------- */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink2); margin-bottom: 6px; }
.field input, .field select, .field textarea, .with-btn input {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px;
  background: #fff; font-size: 16px; outline: none; transition: border-color .15s; min-height: 48px;
}
.field textarea { resize: vertical; line-height: 1.4; }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #6b7280 50%), linear-gradient(135deg, #6b7280 50%, transparent 50%); background-position: calc(100% - 20px) 21px, calc(100% - 15px) 21px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.field input:focus, .field select:focus, .field textarea:focus, .with-btn input:focus, .mini input:focus, .calc-row input:focus { border-color: var(--brand); }
.big-input { font-size: 28px !important; font-weight: 800; font-variant-numeric: tabular-nums; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 12px; padding: 8px 0; font-size: 15px; font-weight: 500; }
.check input { width: 22px; height: 22px; accent-color: var(--brand); flex: none; }
.with-btn { display: flex; gap: 6px; }
.calc-btn { width: 48px; flex: none; border-radius: 12px; background: var(--brand-soft); color: var(--brand-ink); display: grid; place-items: center; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 54px;
  padding: 0 18px; border-radius: 16px; font-weight: 700; font-size: 16px; background: #fff; box-shadow: var(--shadow); text-align: center;
}
.sheet .btn:not(.primary):not(.danger):not(.ghost) { box-shadow: 0 0 0 1.5px var(--line); }
.btn.primary { background: var(--brand); color: #fff; box-shadow: 0 10px 22px -12px rgba(22, 163, 74, .9); }
.btn.danger { background: var(--red); color: #fff; box-shadow: none; }
.btn.ghost { background: transparent; box-shadow: none; color: var(--ink2); }
.btn.sm { min-height: 42px; font-size: 14px; width: auto; border-radius: 12px; padding: 0 14px; display: inline-flex; }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-col { display: grid; gap: 10px; }
.seg { display: inline-flex; background: var(--gray-soft); border-radius: 11px; padding: 3px; flex: none; }
.seg button { padding: 7px 12px; border-radius: 9px; font-size: 14px; font-weight: 700; color: var(--muted); min-width: 36px; text-align: center; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.seg.wide { display: flex; }
.seg.wide button { flex: 1; padding: 10px; }

/* ---------- sheets ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 100; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(11, 18, 32, .45); opacity: 0; transition: opacity .2s; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-width: 640px; margin: 0 auto;
  background: var(--bg); border-radius: 24px 24px 0 0; max-height: 92dvh; display: flex; flex-direction: column;
  transform: translateY(100%); transition: transform .22s cubic-bezier(.2, .8, .2, 1); padding-bottom: var(--safe-b);
}
.sheet.full { height: 92dvh; }
.sheet-wrap.open .sheet-backdrop { opacity: 1; }
.sheet-wrap.open .sheet { transform: none; }
.sheet-grab { width: 40px; height: 5px; border-radius: 3px; background: #d1d5db; margin: 8px auto 0; flex: none; }
.sheet-head { display: flex; align-items: center; padding: 6px 8px 2px 20px; flex: none; }
.sheet-head h3 { flex: 1; margin: 0; font-size: 20px; line-height: 1.2; font-weight: 800; letter-spacing: -.01em; }
.sheet-body { overflow-y: auto; padding: 10px 16px 22px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.sheet .list { box-shadow: 0 0 0 1px var(--line); }
.confirm-msg { font-size: 18px; font-weight: 700; text-align: center; margin: 18px 8px 8px; }
#toast {
  position: fixed; left: 50%; bottom: calc(var(--tabh) + var(--safe-b) + 92px); transform: translate(-50%, 16px);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 600; font-size: 15px;
  opacity: 0; pointer-events: none; transition: .2s; z-index: 300; max-width: calc(100vw - 32px); text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- editor ---------- */
.ed-label { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.ed-label .count { background: var(--gray-soft); color: var(--ink2); border-radius: 999px; padding: 1px 8px; letter-spacing: 0; }
.ed-label .hint { text-transform: none; letter-spacing: 0; font-weight: 500; }
.add-dashed { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 54px; border: 2px dashed #cbd5e1; border-radius: 14px; color: var(--brand-ink); font-weight: 700; }
.add-dashed.mt { margin-top: 12px; }
.cust-card { display: flex; gap: 12px; align-items: center; width: 100%; }
.line { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); width: 100%; }
.line-main { flex: 1; min-width: 0; }
.line-name { font-weight: 650; }
.line-sub { font-size: 13.5px; color: var(--muted); }
.line-amt { font-weight: 700; font-variant-numeric: tabular-nums; }
.quick-label { margin: 16px 0 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.quick-items { display: flex; gap: 8px; flex-wrap: wrap; }
.qi { padding: 9px 12px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-ink); font-size: 14px; font-weight: 600; }
.qi:active { background: #bbf7d0; }
.tot-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 44px; font-variant-numeric: tabular-nums; }
.tot-row.soft { color: var(--muted); font-size: 15px; min-height: 30px; }
.tot-row.grand { font-size: 20px; font-weight: 800; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; }
.mini { display: flex; gap: 6px; align-items: center; }
.mini input { width: 88px; padding: 9px 10px; border: 1.5px solid var(--line); border-radius: 11px; text-align: right; font-size: 16px; outline: none; }
.mini .unit { color: var(--muted); font-weight: 600; width: 16px; flex: none; }
.tot-row > span:first-child { flex: 1; min-width: 0; white-space: nowrap; }
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photo { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: #e5e7eb; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo button { position: absolute; top: 5px; right: 5px; width: 30px; height: 30px; border-radius: 50%; background: rgba(0, 0, 0, .6); color: #fff; display: grid; place-items: center; }
.photo button .ic { width: 16px; height: 16px; }
.add-photo { aspect-ratio: 1; border: 2px dashed #cbd5e1; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; }
.line-total { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; background: var(--brand-soft); border-radius: 12px; color: var(--brand-ink); font-weight: 600; margin-bottom: 8px; }
.line-total strong { font-size: 20px; }
.calc-row { display: grid; grid-template-columns: 1fr auto 1fr auto 64px 34px; gap: 6px; align-items: center; margin-bottom: 8px; }
.calc-row input { width: 100%; min-width: 0; padding: 11px 6px; border: 1.5px solid var(--line); border-radius: 12px; font-size: 16px; text-align: center; outline: none; background: #fff; }
.calc-row span { color: var(--muted); font-weight: 700; }
.calc-row strong { text-align: right; font-variant-numeric: tabular-nums; }
.calc-total { display: flex; justify-content: space-between; align-items: baseline; margin: 16px 0; padding: 14px 16px; background: #fff; border-radius: 14px; box-shadow: 0 0 0 1px var(--line); font-weight: 600; }
.calc-total strong { font-size: 22px; }
.bottom-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line);
  padding: 10px 16px calc(10px + var(--safe-b));
}
.bottom-bar-inner { max-width: 608px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.bb-total { flex: 1; min-width: 0; }
.bb-total span { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.bb-total strong { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.bottom-bar .btn { width: auto; flex: 1.4; }
.bottom-bar .btn.ghost { flex: .8; white-space: nowrap; }

/* ---------- detail ---------- */
.summary { text-align: center; padding: 20px 16px 22px; }
.summary .who { font-weight: 600; color: var(--ink2); margin-top: 10px; }
.summary .amt { font-size: 44px; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; }
.summary .meta { font-size: 14px; color: var(--muted); }
.pill-note { display: inline-block; margin-top: 10px; padding: 6px 12px; border-radius: 999px; background: var(--amber-soft); color: var(--amber); font-size: 13.5px; font-weight: 700; }
.actions-more { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0 0; }
.am { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; background: #fff; border-radius: 14px; box-shadow: var(--shadow); font-size: 12.5px; font-weight: 600; text-align: center; }
.am .ic { color: var(--ink2); }
.link-card { display: flex; align-items: center; gap: 12px; margin-top: 12px; font-weight: 600; }
.link-card span { flex: 1; }
.link-card small { display: block; font-weight: 500; color: var(--muted); font-size: 13px; }
.link-card .ic:first-child { color: var(--brand); }
.link-card .ic:last-child { color: var(--muted); }
.sig-wrap { position: relative; }
.sig-canvas { width: 100%; height: 210px; background: #fff; border-radius: 14px; border: 1.5px solid var(--line); touch-action: none; display: block; }
.sig-hint { position: absolute; left: 0; right: 0; bottom: 34px; text-align: center; color: #cbd5e1; font-weight: 600; pointer-events: none; border-top: 1.5px dashed #e5e7eb; margin: 0 24px; padding-top: 6px; }
.sig-hint.hide { opacity: 0; }

/* customer */
.cust-hero { text-align: center; }
.cust-hero .avatar { width: 64px; height: 64px; font-size: 22px; margin: 0 auto; }
.cust-hero h3 { margin: 10px 0 2px; font-size: 22px; }
.contact-btns { display: flex; justify-content: center; gap: 8px; margin: 12px 0; }
.contact-btns .am { width: 84px; box-shadow: 0 0 0 1px var(--line); }
.mini-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
.mini-stats span { display: block; font-size: 12.5px; color: var(--muted); }
.mini-stats strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.private-note { background: var(--amber-soft); color: #78350f; border-radius: 12px; padding: 10px 12px; font-size: 14px; text-align: left; margin: 12px 0 0; white-space: pre-wrap; }

/* settings */
.logo-up { display: flex; align-items: center; gap: 14px; cursor: pointer; }
.logo-box { width: 72px; height: 72px; border-radius: 16px; background: #fff; border: 2px dashed #cbd5e1; display: grid; place-items: center; overflow: hidden; color: var(--muted); flex: none; }
.logo-box img { width: 100%; height: 100%; object-fit: contain; }
.logo-up .note { margin: 2px 0 0; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 40px; height: 40px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1.5px var(--line); position: relative; }
.swatch.on { box-shadow: 0 0 0 3px var(--ink); }
.swatch.custom { display: grid; place-items: center; background: #fff; color: var(--ink2); cursor: pointer; overflow: hidden; }
.swatch.custom input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.about { display: flex; gap: 12px; align-items: center; font-size: 13px; color: var(--muted); margin: 28px 4px 8px; }
.mark { width: 36px; height: 36px; flex: none; }

/* onboarding */
.ob { padding: calc(var(--safe-t) + 22px) 16px 20px; }
.brand-row { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; letter-spacing: -.02em; margin-bottom: 20px; }
.ob h1 { font-size: 30px; line-height: 1.12; letter-spacing: -.03em; margin: 18px 0 8px; }
.lead { color: var(--muted); margin: 0 0 20px; font-size: 16px; }
.steps { display: flex; gap: 6px; }
.steps i { flex: 1; height: 5px; border-radius: 3px; background: #d1d5db; }
.steps i.on { background: var(--brand); }
.trades { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.trade {
  background: #fff; border-radius: 16px; box-shadow: var(--shadow); padding: 14px 6px; min-height: 96px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  font-size: 13px; font-weight: 600; text-align: center; border: 2px solid transparent; line-height: 1.2;
}
.sheet .trade { box-shadow: 0 0 0 1px var(--line); }
.trade.on { border-color: var(--brand); background: var(--brand-soft); }
.trade .emo { font-size: 28px; }
.ob-preview { background: #fff; border-radius: 12px; box-shadow: 0 8px 24px -12px rgba(0, 0, 0, .3); padding: 16px; }
.obp-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 3px solid var(--pc); padding-bottom: 10px; }
.obp-head div { display: flex; align-items: center; gap: 8px; }
.obp-head img { max-height: 28px; max-width: 70px; object-fit: contain; }
.obp-head span { color: var(--pc); font-weight: 800; letter-spacing: .04em; }
.obp-lines { display: grid; gap: 8px; padding: 14px 0; }
.obp-lines i { height: 8px; border-radius: 4px; background: #eef0f3; }
.obp-lines i:nth-child(2) { width: 80%; }
.obp-lines i:nth-child(3) { width: 60%; }
.obp-due { display: flex; justify-content: space-between; background: var(--pc); color: #fff; font-weight: 800; padding: 10px 12px; border-radius: 8px; }

/* ---------- document preview (paper) ---------- */
.paper-wrap { border-radius: 6px; overflow: hidden; box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .3); }
.paper { background: #fff; color: #111827; padding: 22px 20px; font-size: 12px; line-height: 1.45; }
.p-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.paper.bold .p-head { background: var(--pc); color: #fff; margin: -22px -20px 14px; padding: 22px 20px 16px; }
.p-logo { max-width: 120px; max-height: 50px; display: block; margin-bottom: 8px; object-fit: contain; }
.paper.bold .p-logo { background: #fff; padding: 4px; border-radius: 5px; }
.p-bizname { font-weight: 800; font-size: 14px; }
.p-type { font-size: 20px; font-weight: 800; color: var(--pc); text-align: right; letter-spacing: .02em; }
.paper.bold .p-type { color: #fff; }
.p-num { text-align: right; color: #6b7280; }
.paper.bold .p-num { color: rgba(255, 255, 255, .85); }
.p-meta { display: flex; justify-content: space-between; gap: 12px; margin: 10px 0 12px; color: #6b7280; font-size: 11px; }
.p-dates { text-align: right; flex: none; }
.p-dates span { margin-right: 8px; }
.p-dates b { color: #111827; }
.p-billto { border-top: 1px solid #e5e7eb; padding-top: 10px; margin-bottom: 14px; font-size: 11px; color: #374151; }
.p-billto span { display: block; font-size: 9.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #6b7280; }
.p-billto strong { display: block; font-size: 13.5px; color: #111827; }
.p-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.p-table th { background: var(--pc); color: #fff; text-align: right; padding: 6px; font-size: 9px; letter-spacing: .06em; }
.p-table th:first-child, .p-table td:first-child { text-align: left; }
.p-table td { padding: 7px 6px; border-bottom: 1px solid #e5e7eb; text-align: right; vertical-align: top; white-space: nowrap; }
.p-table td:first-child { white-space: normal; }
.p-table tbody tr:nth-child(even) { background: #f9fafb; }
.p-desc { color: #6b7280; font-size: 10px; }
.p-empty { text-align: center !important; color: #9ca3af; padding: 16px !important; }
.p-bottom { display: flex; gap: 12px; align-items: flex-start; margin-top: 10px; }
.p-stamp-area { flex: 1; display: flex; justify-content: center; padding-top: 16px; }
.p-stamp { font-size: 30px; font-weight: 900; color: #16a34a; border: 3px solid #16a34a; border-radius: 8px; padding: 0 10px; transform: rotate(-12deg); letter-spacing: .06em; }
.p-totals { width: 64%; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.p-totals > div { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; }
.p-total { font-weight: 800; font-size: 12.5px; border-top: 1px solid #e5e7eb; margin-top: 3px; padding-top: 6px !important; }
.p-due { background: var(--pc); color: #fff; font-weight: 800; padding: 8px !important; border-radius: 5px; margin-top: 6px; font-size: 12.5px; }
.p-block h4 { margin: 16px 0 3px; font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: #6b7280; }
.p-block p { margin: 0; white-space: pre-wrap; color: #374151; font-size: 11px; }
.p-sign img { max-width: 170px; max-height: 56px; display: block; margin-top: 16px; }
.p-sign div { font-size: 10px; color: #6b7280; border-top: 1px solid #e5e7eb; padding-top: 4px; max-width: 240px; }
.p-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.p-photos img { width: 100%; border-radius: 4px; display: block; }
.p-brand { margin-top: 18px; font-size: 9.5px; color: #9ca3af; }

/* ---------- plans, paywall, reports ---------- */
.doc-thumb { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; flex: none; background: #e5e7eb; }
.plan-note { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: #fff; box-shadow: var(--shadow); font-size: 14px; color: var(--ink2); }
.plan-note.out { background: var(--amber-soft); color: #78350f; box-shadow: none; }
.plan-link .ic:first-child { color: var(--brand); }
.link-card + .list { margin-top: 12px; }
.plan-list { display: grid; gap: 12px; margin: 14px 0; }
.plan-card { position: relative; background: #fff; border-radius: 18px; padding: 18px; box-shadow: 0 0 0 1.5px var(--line); }
.plan-card.hl { box-shadow: 0 0 0 2.5px var(--brand), 0 12px 28px -18px rgba(22, 163, 74, .8); }
.plan-flag { position: absolute; top: -11px; left: 18px; background: var(--brand); color: #fff; font-size: 11.5px; font-weight: 800; padding: 3px 10px; border-radius: 999px; letter-spacing: .02em; }
.plan-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.plan-top h4 { margin: 0; font-size: 20px; font-weight: 800; }
.plan-price { font-size: 14px; color: var(--muted); text-align: right; }
.plan-price b { font-size: 24px; color: var(--ink); font-weight: 800; }
.plan-price .save { display: block; font-size: 12px; font-weight: 700; color: var(--brand-ink); }
.plan-card ul { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 7px; }
.plan-card li { display: flex; gap: 8px; align-items: flex-start; font-size: 14.5px; }
.plan-card li .ic { width: 18px; height: 18px; color: var(--brand); margin-top: 1px; }
.billing { margin-top: 4px; }
.paywall-sub { font-size: 15px; color: var(--ink2); margin: 0 0 14px; }
.current-plan { text-align: center; }
.cp-name { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.cp-usage { font-weight: 600; color: var(--ink2); margin: 2px 0 6px; }
.price-lock { background: var(--brand-soft); color: var(--brand-ink); border-radius: 14px; padding: 12px 14px; font-size: 14px; margin-bottom: 14px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: #fff; border-radius: 16px; box-shadow: var(--shadow); padding: 14px; min-width: 0; }
.stat-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.stat-value { font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin: 2px 0; overflow-wrap: anywhere; }
.stat-note { font-size: 12.5px; color: var(--muted); }
.row.rank { min-height: 52px; }
.rank-n { width: 26px; height: 26px; border-radius: 50%; background: var(--gray-soft); display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--ink2); flex: none; }
.my-sig { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 12px; }
.my-sig img { max-height: 56px; max-width: 200px; }
.empty .btn { max-width: 260px; margin-left: auto; margin-right: auto; }

/* setup: all trades fit on one phone screen */
.ob .trades.compact { gap: 8px; }
.ob .trades.compact .trade { min-height: 70px; padding: 8px 4px; gap: 3px; font-size: 12.5px; border-radius: 14px; }
.ob .trades.compact .trade .emo { font-size: 22px; }
.ob .brand-row { margin-bottom: 14px; }
.ob h1 { font-size: 26px; margin: 14px 0 6px; }
.ob .lead { margin-bottom: 14px; font-size: 15px; }
.trade.on { position: relative; }
.trade.on::after { content: "✓"; position: absolute; top: 5px; right: 7px; font-size: 12px; font-weight: 800; color: var(--brand-ink); }
.demo-banner { display: flex; flex-direction: column; gap: 10px; background: var(--amber-soft); color: #78350f; border-radius: 16px; padding: 14px; margin-bottom: 12px; font-size: 14.5px; }
.demo-banner .btn { align-self: flex-start; }

/* ---------- round 3: address, $ inputs, color slider, photo viewer ---------- */
.grid-addr { display: grid; grid-template-columns: 1.6fr .8fr 1fr; gap: 10px; }
.upper { text-transform: uppercase; }
.money-in { position: relative; }
.money-in::before { content: "$"; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; pointer-events: none; }
.money-in input { padding-left: 28px !important; }
.money-in.big::before { font-size: 22px; font-weight: 800; color: var(--ink2); }
.money-in.big input { padding-left: 34px !important; }
.hue-row { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.hue-dot { width: 40px; height: 40px; border-radius: 50%; flex: none; border: 3px solid #fff; box-shadow: 0 0 0 1.5px var(--line); }
.field input.hue, .hue { -webkit-appearance: none; appearance: none; flex: 1; width: auto; min-height: 0; height: 26px; padding: 0; border: 0; border-radius: 13px; outline: none; cursor: pointer;
  background: linear-gradient(to right, hsl(0,80%,45%), hsl(45,80%,45%), hsl(90,80%,45%), hsl(150,80%,45%), hsl(200,80%,45%), hsl(250,80%,45%), hsl(300,80%,45%), hsl(359,80%,45%)); }
.field input.hue::-webkit-slider-thumb, .hue::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 30px; border-radius: 50%; background: #fff; border: 3px solid var(--ink); box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.hue::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 3px solid var(--ink); }
.hue-note { margin: 8px 0 0; font-size: 13px; }
button.link-card { width: 100%; text-align: left; }
.link-card small { display: block; }
.stat { text-align: left; width: 100%; }
.stat:active { transform: scale(.98); }
.stat-note { color: var(--brand-ink); font-weight: 600; }
a.row.rank .ic { color: var(--muted); width: 18px; height: 18px; }
.photos.strip { grid-template-columns: repeat(4, 1fr); }
.photos.strip .photo { padding: 0; border-radius: 12px; }
.photo img[data-view] { cursor: zoom-in; }
.p-photos img { cursor: zoom-in; }
.viewer { position: fixed; inset: 0; z-index: 400; background: rgba(5, 8, 15, .96); display: grid; place-items: center; touch-action: pan-y; }
.viewer img { max-width: 100vw; max-height: 86dvh; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.viewer button { position: absolute; width: 48px; height: 48px; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; display: grid; place-items: center; }
.viewer .v-close { top: calc(var(--safe-t) + 14px); right: 14px; }
.viewer .v-prev { left: 10px; top: 50%; transform: translateY(-50%); }
.viewer .v-next { right: 10px; top: 50%; transform: translateY(-50%); }
.viewer .v-count { position: absolute; bottom: calc(var(--safe-b) + 20px); left: 0; right: 0; text-align: center; color: #fff; font-weight: 600; }

@media (min-width: 700px) {
  .paper { padding: 32px 30px; font-size: 13px; }
  .paper.bold .p-head { margin: -32px -30px 18px; padding: 30px; }
}
@media (max-width: 360px) {
  .trades { grid-template-columns: repeat(2, 1fr); }
  .hero-amt { font-size: 36px; }
  .actions-more { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* deposit card on estimates */
.deposit-card { margin-top: 12px; }
.deposit-card .dc-text { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; margin-bottom: 12px; }
.deposit-card .dc-text span { font-size: 14px; color: var(--muted); }
.dc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.dc-amt { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.dc-side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.dc-side .text-btn { padding: 6px 0; min-width: 0; }
.deposit-card .note { margin: 2px 0 0; }

/* estimate options */
.opt-toggle { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 16px; padding: 12px 14px; border-radius: 14px; background: var(--blue-soft); color: var(--blue); text-align: left; }
.opt-toggle span { display: flex; flex-direction: column; }
.opt-toggle small { color: var(--ink2); font-size: 13px; }
.opt-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; margin: 0 -2px; scrollbar-width: none; }
.opt-tab { flex: none; min-width: 104px; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 9px 12px; border-radius: 12px; background: var(--gray-soft); font-weight: 700; font-size: 14px; }
.opt-tab small { font-weight: 600; color: var(--muted); font-size: 12.5px; }
.opt-tab.on { background: var(--ink); color: #fff; }
.opt-tab.on small { color: #cbd5e1; }
.opt-tab.add { min-width: 48px; align-items: center; justify-content: center; }
.opt-tools { display: flex; align-items: center; gap: 4px; margin-bottom: 4px; }
.opt-tools .note { flex: 1; margin: 0; font-size: 13.5px; }
.opt-tools .text-btn { min-width: 0; padding: 8px 6px; font-size: 14px; }
.p-option { margin-bottom: 16px; }
.p-opt-name { font-weight: 800; font-size: 13px; margin: 4px 0 6px; }
.p-opt-total { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 6px 2px; font-size: 11px; color: #6b7280; }
.p-opt-total b { color: var(--pc); font-size: 12.5px; }
.p-opt-note { font-size: 11px; color: #374151; margin: 0 0 6px; }

/* Account & backup */
.acct-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.acct-head > .ic { flex: none; width: 22px; height: 22px; margin-top: 2px; color: var(--brand); }
.acct-head strong { display: block; word-break: break-all; }
.acct-head .note { margin: 4px 0 0; }

/* Start screen (fits one phone screen) */
.start { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: calc(var(--safe-t) + 24px) 20px calc(var(--safe-b) + 24px); max-width: 480px; margin: 0 auto; }
.start h1 { font-size: 32px; line-height: 1.1; letter-spacing: -.03em; margin: 8px 0 10px; }
.start-points { list-style: none; padding: 0; margin: 0 0 28px; display: grid; gap: 10px; font-weight: 600; }
.start-points li { display: flex; align-items: center; gap: 10px; }
.start-points .ic { width: 20px; height: 20px; color: var(--brand); flex: none; }
.start-actions .text-btn { justify-self: center; }
.field-hint { display: block; margin-top: 6px; font-size: 13px; color: var(--muted); }
.acct-btn { width: 42px; height: 42px; flex: none; border-radius: 50%; display: grid; place-items: center; overflow: hidden; background: var(--ink); color: #fff; font-weight: 800; font-size: 15px; text-decoration: none; box-shadow: 0 0 0 2px var(--card), 0 0 0 3.5px var(--line); }
.acct-btn img { width: 100%; height: 100%; object-fit: contain; background: #fff; }

/* Help */
.faq details { background: var(--card); border-radius: 12px; box-shadow: var(--shadow); margin-bottom: 8px; padding: 0 14px; }
.faq summary { padding: 16px 0; font-weight: 700; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--muted); font-weight: 600; }
.faq details[open] summary::after { content: '−'; }
.faq p { margin: 0; padding: 0 0 16px; color: var(--ink2); line-height: 1.5; }
.warn-text { color: var(--amber) !important; }
.acct .btn-row:has(> :only-child) { grid-template-columns: 1fr; }
.fb-note { margin-top: 18px; }
.login-email { font-weight: 700; word-break: break-all; margin-bottom: 4px; }

/* Signed-in footer on the Account page */
.acct-foot { text-align: center; padding: 20px 16px 16px; }
.acct-label { font-size: 12.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.acct-email { font-size: 17px; font-weight: 700; margin: 4px 0 12px; word-break: break-all; }
.sync-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: 13.5px; font-weight: 600; margin-bottom: 16px; max-width: 100%; }
.sync-pill .ic { width: 16px; height: 16px; stroke-width: 3; }
.sync-pill.ok { background: var(--brand-soft); color: var(--brand-ink); }
.sync-pill.busy { background: var(--gray-soft); color: var(--muted); }
.sync-pill.warn { background: var(--amber-soft); color: var(--amber); text-align: left; border-radius: 12px; }

/* AI mockups */
.mk-badge { position: absolute; left: 5px; bottom: 5px; padding: 2px 7px; border-radius: 6px; background: rgba(11, 18, 32, .85); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .03em; pointer-events: none; }
.add-photo.mk-tile { border-color: var(--brand); color: var(--brand-ink); background: var(--brand-soft); }
.add-photo.mk-tile small { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; opacity: .8; }
.photo.pick { border: 0; padding: 0; cursor: pointer; }
.photo.pick:focus-visible, .photo.pick:hover { outline: 3px solid var(--brand); outline-offset: 1px; }
.mk-before img { width: 100%; max-height: 220px; object-fit: cover; border-radius: 12px; display: block; margin-bottom: 14px; }
.mk-sample { display: flex; align-items: center; gap: 12px; }
.mk-sample img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; }
.chips .chip { cursor: pointer; }
.chip.look { display: inline-flex; align-items: center; gap: 8px; padding-left: 6px; }
.chip.look img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.chip.look i { font-style: normal; color: var(--muted); padding: 0 2px 0 4px; }
.mk-working { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 70px 16px; text-align: center; color: var(--muted); }
.mk-working b { color: var(--ink); font-size: 18px; }
.spinner { width: 44px; height: 44px; border-radius: 50%; border: 4px solid var(--brand-soft); border-top-color: var(--brand); animation: spin 0.9s linear infinite; margin-bottom: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }
.ba { position: relative; border-radius: 14px; overflow: hidden; background: #000; touch-action: pan-y; }
.ba img { display: block; width: 100%; height: auto; }
.ba .ba-after { position: absolute; inset: 0; height: 100%; object-fit: cover; clip-path: inset(0 0 0 var(--split)); }
.ba::after { content: ''; position: absolute; top: 0; bottom: 0; left: var(--split); width: 3px; margin-left: -1.5px; background: #fff; box-shadow: 0 0 6px rgba(0,0,0,.5); pointer-events: none; }
.ba input[type=range] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.ba-tag { position: absolute; top: 8px; padding: 3px 8px; border-radius: 6px; background: rgba(11,18,32,.75); color: #fff; font-size: 12px; font-weight: 700; pointer-events: none; }
.ba-tag.left { left: 8px; } .ba-tag.right { right: 8px; }
.p-photo { position: relative; }
.p-note { font-size: 11px; color: var(--muted); margin: 14px 0 0; }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
.add-photo.mk-tile { gap: 2px; padding: 8px 6px; font-size: 12px; text-align: center; line-height: 1.15; }
.add-photo.mk-tile .ic { width: 20px; height: 20px; }
.add-photo.mk-tile small { font-size: 10px; }
.add-photo.mk-tile { position: relative; padding-top: 14px; }
.pro-pill { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); padding: 2px 8px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 10px; font-weight: 800; letter-spacing: .08em; box-shadow: 0 0 0 3px var(--card), 0 0 12px rgba(22, 163, 74, .6); }
[data-sec="photos"] .photos { padding-top: 10px; }
.mk-allowance { margin-top: 16px; }
.ba { box-shadow: 0 10px 30px -14px rgba(0,0,0,.45); }
.ba-tag { top: auto; bottom: 10px; padding: 4px 9px; border-radius: 999px; background: rgba(255,255,255,.18); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.35); font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.ba-tag.left { left: 10px; } .ba-tag.right { right: 10px; }
.ba-knob { position: absolute; top: 50%; left: var(--split); width: 38px; height: 38px; margin: -19px 0 0 -19px; border-radius: 50%; background: #fff; box-shadow: 0 4px 14px rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; color: var(--ink); pointer-events: none; z-index: 1; }
.ba-knob .ic { width: 14px; height: 14px; stroke-width: 3; margin: 0 -2px; }
.ba-caption { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 10px 0 0; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.ba-caption .ic { width: 14px; height: 14px; color: var(--brand); }
.mk-badge.before { background: rgba(255,255,255,.9); color: var(--ink); }

/* Select & delete on lists */
a.row { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.selrow { width: 100%; text-align: left; }
.sel-check { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid #cbd5e1; display: grid; place-items: center; color: transparent; }
.sel-check .ic { width: 15px; height: 15px; stroke-width: 3; }
.selrow.on .sel-check { background: var(--brand); border-color: var(--brand); color: #fff; }
.selrow.on { background: var(--brand-soft); }
.sel-bar { position: fixed; left: 0; right: 0; bottom: calc(var(--tabh) + var(--safe-b)); z-index: 30; padding: 10px 16px; background: var(--card); border-top: 1px solid var(--line); box-shadow: 0 -6px 18px -12px rgba(0,0,0,.25); }
.sel-bar-inner { max-width: 608px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.sel-count { flex: 1; text-align: center; font-weight: 700; font-size: 14px; color: var(--ink2); }
.btn.danger.sm[disabled] { opacity: .45; }
body.selecting .page { padding-bottom: 90px; }
.sheet textarea.grow { width: 100%; resize: none; overflow: hidden; min-height: 52px; line-height: 1.4; }
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 1000; }

/* Celebrations */
.celebrate { position: fixed; inset: 0; z-index: 1000; pointer-events: none; display: grid; place-items: center; overflow: hidden; }
.stamp { padding: 10px 26px; border: 6px solid #16a34a; border-radius: 14px; color: #16a34a; font: 900 clamp(26px, 8vw, 44px)/1 var(--font); letter-spacing: .1em; background: rgba(255,255,255,.88);
  transform: rotate(-12deg); animation: stamp-in 1.9s cubic-bezier(.2,.9,.3,1.2) forwards; box-shadow: 0 0 0 3px rgba(22,163,74,.15) inset; }

@keyframes stamp-in { 0% { transform: rotate(-12deg) scale(2.6); opacity: 0; } 22% { transform: rotate(-12deg) scale(.92); opacity: 1; } 30% { transform: rotate(-12deg) scale(1.04); } 38%, 78% { transform: rotate(-12deg) scale(1); opacity: 1; } 100% { transform: rotate(-12deg) scale(1); opacity: 0; } }
.coin { position: absolute; left: 50%; top: 58%; width: 34px; height: 34px; margin: -17px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fde68a, #f59e0b 60%, #b45309); color: #7c2d12;
  font: 900 18px/34px var(--font); text-align: center; box-shadow: 0 3px 8px rgba(0,0,0,.25); animation: coin-pop 1.6s cubic-bezier(.2,.7,.4,1) var(--d) both; }
@keyframes coin-pop { 0% { transform: translate(0,0) scale(.3); opacity: 0; } 15% { opacity: 1; } 55% { transform: translate(var(--dx), var(--dy)) scale(1) rotate(200deg); opacity: 1; } 100% { transform: translate(calc(var(--dx) * 1.1), calc(var(--dy) + 340px)) scale(.9) rotate(360deg); opacity: 0; } }
.plane { position: absolute; width: 56px; height: 56px; color: var(--brand); left: 10%; bottom: 18%; animation: plane-fly 1.4s cubic-bezier(.5,0,.75,.4) forwards; filter: drop-shadow(0 6px 8px rgba(0,0,0,.2)); }
@keyframes plane-fly { 0% { transform: translate(0,0) rotate(0deg) scale(.6); opacity: 0; } 15% { opacity: 1; transform: translate(10vw,-4vh) rotate(-6deg) scale(1); } 100% { transform: translate(95vw,-80vh) rotate(-18deg) scale(.7); opacity: 0; } }
.first-wrap { pointer-events: auto; background: rgba(11,18,32,.25); animation: fade-out 3.6s ease forwards; }
.first-card { position: relative; width: min(320px, 86vw); padding: 26px 20px; border-radius: 22px; background: var(--card); box-shadow: 0 24px 60px -20px rgba(0,0,0,.5); text-align: center; display: grid; gap: 6px; animation: card-in .5s cubic-bezier(.2,.9,.3,1.3) both; }
.first-card b { font-size: 21px; letter-spacing: -.02em; }
.first-card > span { color: var(--muted); font-size: 14.5px; }
.first-emoji { font-size: 44px; animation: rocket 1.2s ease-in-out .2s both; }
.spark { position: absolute; left: 50%; top: 50%; margin: -10px; color: #f59e0b; font-size: 20px; animation: spark 1.1s ease-out .15s both; }
@keyframes spark { 0% { transform: translate(0,0) scale(.2); opacity: 0; } 30% { opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) scale(1); opacity: 0; } }
@keyframes card-in { from { transform: scale(.7) translateY(20px); opacity: 0; } }
@keyframes rocket { 0% { transform: translateY(14px); } 50% { transform: translateY(-8px); } 100% { transform: translateY(0); } }
@keyframes fade-out { 0%, 85% { opacity: 1; } 100% { opacity: 0; } }

/* Deposit card buttons: keep each label on one line so it sits centered */
.deposit-card .btn-row .btn { padding: 0 10px; gap: 6px; font-size: 15px; white-space: nowrap; }
.deposit-card .btn-row .btn .ic { width: 18px; height: 18px; flex: none; }

/* Sent: a green check draws itself inside a ring, with a soft pulse */
.sent-wrap { place-items: center; }
.sent-badge { display: grid; justify-items: center; gap: 10px; animation: sent-life 1.6s ease forwards; }
.sent-ring { width: 92px; height: 92px; border-radius: 50%; background: var(--brand); display: grid; place-items: center; box-shadow: 0 0 0 0 rgba(22,163,74,.45); animation: sent-pulse 1.1s ease-out .1s; }
.sent-ring svg { width: 50px; height: 50px; }
.sent-ring path { stroke: #fff; stroke-width: 3.2; fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 30; stroke-dashoffset: 30; animation: sent-draw .45s ease .25s forwards; }
.sent-badge b { padding: 5px 14px; border-radius: 999px; background: var(--card); color: var(--ink); font-size: 15px; box-shadow: 0 6px 18px -8px rgba(0,0,0,.35); }
@keyframes sent-draw { to { stroke-dashoffset: 0; } }
@keyframes sent-pulse { from { box-shadow: 0 0 0 0 rgba(22,163,74,.45); } to { box-shadow: 0 0 0 34px rgba(22,163,74,0); } }
@keyframes sent-life { 0% { transform: scale(.6); opacity: 0; } 18% { transform: scale(1.05); opacity: 1; } 28%, 80% { transform: scale(1); opacity: 1; } 100% { transform: scale(.95); opacity: 0; } }

/* Send: card into envelope, flap closes, envelope zips away */
.env-stage { display: grid; justify-items: center; gap: 16px; }
.env { position: relative; width: 210px; height: 136px; animation: env-zip 2.2s cubic-bezier(.5,0,.75,0) forwards; }
.env-back, .env-front, .env-flap { position: absolute; left: 0; right: 0; }
.env-back { top: 0; bottom: 0; border-radius: 10px; background: #e6ebf1; box-shadow: 0 14px 30px -14px rgba(0,0,0,.45); }
.env-front { top: 0; bottom: 0; border-radius: 10px; background: #d9e1ea; clip-path: polygon(0 30%, 50% 66%, 100% 30%, 100% 100%, 0 100%); z-index: 3; }
.env-flap { top: 0; height: 64%; background: #c9d3de; clip-path: polygon(0 0, 100% 0, 50% 100%); transform-origin: top center; z-index: 1;
  animation: env-flap 2.2s ease forwards; }
.env-card { position: absolute; left: 18px; right: 18px; height: 112px; top: 12px; z-index: 2; border-radius: 8px; background: #fff; padding: 14px 12px 10px;
  box-shadow: 0 6px 16px -6px rgba(0,0,0,.35); text-align: left; overflow: hidden; animation: env-card 2.2s cubic-bezier(.3,.7,.3,1) forwards; }
.env-card-bar { position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--pc); }
.env-card-title { font: 900 11px/1 var(--font); letter-spacing: .12em; color: var(--pc); }
.env-card-name { margin-top: 8px; font-weight: 700; font-size: 14px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.env-card-amt { margin-top: 4px; font-weight: 900; font-size: 20px; color: var(--ink); font-variant-numeric: tabular-nums; }
.env-label { padding: 5px 14px; border-radius: 999px; background: var(--card); color: var(--ink); font-size: 15px; box-shadow: 0 6px 18px -8px rgba(0,0,0,.35); animation: env-label 2.2s ease forwards; }
@keyframes env-card {
  0% { transform: translateY(-150px) scale(.6); opacity: 0; }
  14% { transform: translateY(-140px) scale(1.05); opacity: 1; }
  24% { transform: translateY(-140px) scale(1); }
  46% { transform: translateY(0) scale(1); opacity: 1; }
  56% { transform: translateY(8px) scale(.97); opacity: 1; }
  62%, 100% { transform: translateY(10px) scale(.95); opacity: 0; }
}
@keyframes env-flap {
  0%, 46% { transform: scaleY(-1); z-index: 1; filter: brightness(1.05); }
  47% { z-index: 4; }
  62%, 100% { transform: scaleY(1); z-index: 4; filter: brightness(1); }
}
@keyframes env-zip {
  0%, 66% { transform: translateY(0) scale(1); opacity: 1; }
  72% { transform: translateY(14px) scale(.97); }
  100% { transform: translateY(-110vh) scale(.85) rotate(-4deg); opacity: 1; }
}
@keyframes env-label { 0%, 64% { opacity: 0; transform: translateY(6px); } 74%, 90% { opacity: 1; transform: none; } 100% { opacity: 0; } }

/* Customer link page (v/) */
body.cust { padding-bottom: 40px; }
.cust-loading { min-height: 70vh; display: grid; place-items: center; }
.cust-wrap { max-width: 640px; margin: 0 auto; padding: calc(var(--safe-t) + 18px) 16px 24px; display: grid; gap: 14px; }
.cust-head { display: flex; align-items: center; gap: 12px; }
.cust-head img { max-height: 46px; max-width: 120px; object-fit: contain; }
.cust-head b { display: block; font-size: 18px; letter-spacing: -.01em; }
.cust-head a { color: var(--muted); font-size: 14px; text-decoration: none; }
.vcard { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px; }
.vcard.center { text-align: center; margin-top: 18vh; }
.vcard h1 { font-size: 22px; margin: 0 0 8px; }
.vcard h2 { font-size: 15px; margin: 0 0 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.cust-sum { text-align: center; }
.cust-kicker { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.cust-amt { font-size: 40px; font-weight: 900; letter-spacing: -.03em; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.cust-sum .note { margin: 0; }
.cust-sum .pill-note { margin-top: 10px; }
.cust-opts { display: grid; gap: 8px; }
.cust-opt { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 12px; border: 2px solid var(--line); background: #fff; text-align: left; font-size: 16px; cursor: pointer; }
.cust-opt .radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #cbd5e1; flex: none; }
.cust-opt.on { border-color: var(--brand); background: var(--brand-soft); }
.cust-opt.on .radio { border: 7px solid var(--brand); }
.cust-opt .o-name { flex: 1; font-weight: 700; }
.cust-opt .o-amt { font-weight: 800; font-variant-numeric: tabular-nums; }
.btn.big { min-height: 60px; font-size: 18px; }
.cust-done { display: flex; gap: 12px; align-items: center; background: var(--brand-soft); }
.cust-done > .ic { color: var(--brand); width: 26px; height: 26px; flex: none; }
.cust-done b { display: block; font-size: 17px; }
.cust-done span { color: var(--ink2); font-size: 14.5px; }
.cust .pre { white-space: pre-wrap; margin: 0; }
.cust-foot { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.cust-foot .mark { width: 22px; height: 22px; }
.cust-foot a { color: var(--brand-ink); font-weight: 700; }

/* Send sheet: customer link status */
.link-box { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--gray-soft); font-size: 14px; color: var(--ink2); margin-bottom: 14px; }
.link-box > span:not(.spinner) { flex: 1; }
.link-box.ready { background: var(--brand-soft); }
.link-box.ready > .ic { color: var(--brand); width: 20px; height: 20px; flex: none; }
.link-box.warn { background: var(--amber-soft); color: var(--amber); }
.spinner.sm { width: 18px; height: 18px; border-width: 3px; margin: 0; flex: none; }
.seen-note { display: inline-block; margin-top: 8px; padding: 6px 12px; line-height: 1.35; max-width: 100%; border-radius: 12px; background: var(--blue-soft); color: var(--blue); font-size: 13px; font-weight: 600; }
.seen-note .ic { display: inline-block; width: 15px; height: 15px; vertical-align: -3px; margin-right: 5px; }
.seen-note.signed { background: var(--brand-soft); color: var(--brand-ink); }
.row-tags { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.viewed-ic { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--blue-soft); color: var(--blue); }
.viewed-ic .ic { width: 14px; height: 14px; }
.check.agree span { font-size: 14px; }
.seen-note { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cust-sub { font-size: 15px; color: var(--muted); font-weight: 500; }
.cust-sub.late { color: var(--red); font-weight: 600; }
.cust-sub.paid { color: var(--brand-ink); font-weight: 600; }
.cust-done .done-ic { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; }
.cust-done .done-ic .ic { width: 20px; height: 20px; stroke-width: 3; }
.cust-done b { font-size: 16.5px; }
.cust-done div > span { display: block; font-size: 14px; color: var(--ink2); margin-top: 2px; }
