/* 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; }
.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; 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; }
