/* FollowUpBills design system. Notion-inspired: white, near-black type, one accent,
   soft tints, 12px cards, 8px controls. Spec: docs/DESIGN.md. Every text/background
   pair here was checked for WCAG AA contrast (docs/DESIGN-BRIEF.md). */
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/inter-latin-wght.woff2") format("woff2");
}
:root {
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --ink: #191918; --ink-2: #5f5e5b; --ink-3: #73726e;
  --bg: #ffffff; --bg-2: #f9f9f8; --bg-3: #f1f1ef; --hover: rgba(0, 0, 0, .04);
  --line: rgba(0, 0, 0, .1); --line-2: rgba(0, 0, 0, .06);
  --accent: #c2410c; --accent-hover: #a8380b; --accent-tint: #fff1e8; --accent-ink: #9a3412;
  --brand-bright: #e8711a;
  --red: #b02a27; --red-bg: #fdebec; --blue: #1f6391; --blue-bg: #e7f3f8;
  --green: #2f6a36; --green-bg: #edf3ec; --yellow: #8a5a00; --yellow-bg: #fbf3db;
  --r-card: 12px; --r-ctl: 8px; --r-tag: 6px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 16px rgba(0, 0, 0, .04);
  --gutter: 16px; --header: 64px; --tabbar: 64px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 32px; font-weight: 700; letter-spacing: -.75px; line-height: 1.15; }
h2 { font-size: 22px; font-weight: 700; }
h3 { font-size: 17px; font-weight: 600; }
p { margin: 0 0 1em; }
img, svg { max-width: 100%; }
.icon { flex: none; vertical-align: -3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.wrap { max-width: 1184px; margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 640px; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 14px; }
.tiny { font-size: 13px; }
.center { text-align: center; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 12px; align-items: center; }
.row.wrap-ok { flex-wrap: wrap; }
.spacer { flex: 1; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px;
  padding: 8px 16px; border-radius: var(--r-ctl); border: 1px solid transparent; font: inherit; font-weight: 500;
  font-size: 15px; line-height: 1.2; text-decoration: none; cursor: pointer; white-space: nowrap;
  background: var(--accent); color: #fff; transition: background .15s; }
.btn:hover { background: var(--accent-hover); color: #fff; }
.btn.tint { background: var(--accent-tint); color: var(--accent-ink); }
.btn.tint:hover { background: #ffe4d1; color: var(--accent-ink); }
.btn.ghost { background: var(--bg); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--bg-2); color: var(--ink); }
.btn.quiet { background: transparent; color: var(--ink); }
.btn.quiet:hover { background: var(--hover); }
.btn.danger { background: var(--bg); color: var(--red); border-color: var(--line); }
.btn.danger:hover { background: var(--red-bg); color: var(--red); }
.btn.big { min-height: 48px; padding: 12px 22px; font-size: 16px; }
.btn.block { display: flex; width: 100%; }
.btn.sm { min-height: 32px; padding: 4px 12px; font-size: 14px; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; }
form.inline { display: inline; margin: 0; }

/* ---------- forms ---------- */
label { display: block; font-weight: 500; font-size: 14px; margin: 16px 0 6px; }
label .hint, .hint { font-weight: 400; color: var(--ink-2); font-size: 13px; }
input, select, textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: var(--r-ctl); font: inherit; font-size: 16px; background: var(--bg); color: var(--ink);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, .02); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
input[type=file] { padding: 9px; min-height: 44px; background: var(--bg-2); }
input[type=checkbox], input[type=radio] { width: 24px; height: 24px; min-height: 0; margin: 0; flex: none;
  accent-color: var(--accent); box-shadow: none; }
textarea { min-height: 96px; resize: vertical; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 15px;
  margin: 14px 0; cursor: pointer; min-height: 24px; }
label.check input { margin-top: -1px; }
.field-row { display: grid; gap: 0 12px; grid-template-columns: 1fr 1fr; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { min-height: 32px; padding: 4px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--bg);
  font: inherit; font-size: 14px; color: var(--ink); cursor: pointer; }
.chip:hover, .chip.on { background: var(--bg-3); }
.amount-input { font-size: 22px; font-weight: 600; }
details.more { border-top: 1px solid var(--line-2); margin-top: 20px; padding-top: 6px; }
details.more > summary { list-style: none; cursor: pointer; min-height: 44px; display: flex; align-items: center;
  gap: 6px; font-weight: 500; color: var(--ink-2); }
details.more > summary::-webkit-details-marker { display: none; }
details.more[open] > summary .icon { transform: rotate(180deg); }

/* ---------- surfaces ---------- */
.card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-card); padding: 20px; margin-bottom: 16px; }
.card.flat { border-color: transparent; background: var(--bg-2); }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.section-title { display: flex; align-items: center; gap: 12px; margin: 28px 0 10px; }
.section-title h2 { margin: 0; font-size: 18px; }
.flash, .notice { padding: 12px 14px; border-radius: var(--r-ctl); margin-bottom: 16px; font-size: 15px; }
.flash { background: var(--green-bg); color: var(--green); }
.notice { background: var(--yellow-bg); color: var(--yellow); }
.notice a { color: inherit; font-weight: 600; }
.errors { background: var(--red-bg); color: var(--red); padding: 12px 14px; border-radius: var(--r-ctl); margin-bottom: 16px; }
.errors ul { margin: 0; padding-left: 18px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* tags (Notion property style) */
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: var(--r-tag);
  font-size: 13px; font-weight: 500; line-height: 20px; white-space: nowrap; background: var(--bg-3); color: var(--ink-2); }
.tag.overdue, .tag.red { background: var(--red-bg); color: var(--red); }
.tag.open, .tag.blue { background: var(--blue-bg); color: var(--blue); }
.tag.paid, .tag.green { background: var(--green-bg); color: var(--green); }
.tag.paused, .tag.yellow { background: var(--yellow-bg); color: var(--yellow); }

/* ---------- lists (replace tables: one markup, phone first) ---------- */
.list { border-top: 1px solid var(--line-2); }
.item { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center; padding: 12px 8px;
  border-bottom: 1px solid var(--line-2); color: var(--ink); text-decoration: none; border-radius: 6px; min-height: 56px; }
a.item:hover { background: var(--hover); color: var(--ink); }
.item .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.item .meta { color: var(--ink-2); font-size: 14px; grid-column: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .amt { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.item .side { grid-column: 2; grid-row: 2; text-align: right; }
.empty { text-align: center; padding: 36px 16px; color: var(--ink-2); }
.empty .icon { color: var(--ink-3); margin-bottom: 8px; }

/* view tabs */
.views { display: flex; gap: 2px; margin: 4px 0 8px; overflow-x: auto; scrollbar-width: none; }
.views::-webkit-scrollbar { display: none; }
.views a { padding: 6px 10px; border-radius: 6px; text-decoration: none; color: var(--ink-2); font-size: 14px;
  font-weight: 500; white-space: nowrap; min-height: 32px; display: inline-flex; align-items: center; }
.views a:hover { background: var(--hover); color: var(--ink); }
.views a.on { background: var(--bg-3); color: var(--ink); }

/* stats */
.stats { display: grid; gap: 8px; grid-template-columns: repeat(2, 1fr); margin-bottom: 8px; }
.stat { background: var(--bg-2); border-radius: var(--r-card); padding: 12px 14px; color: var(--ink); text-decoration: none; display: block; }
a.stat:hover { background: var(--bg-3); color: var(--ink); }
.stat .n { font-size: 20px; font-weight: 700; letter-spacing: -.3px; font-variant-numeric: tabular-nums; }
.stat .l { color: var(--ink-2); font-size: 13px; }
.stat.alert .n { color: var(--red); }
@media (min-width: 900px) { .stats { grid-template-columns: repeat(4, 1fr); gap: 12px; } .stat { padding: 16px 18px; } .stat .n { font-size: 24px; } }

/* aging bar */
.aging { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: var(--bg-3); margin: 6px 0 12px; }
.aging span { display: block; height: 100%; }
.b-not_due { background: #9bbfd6; } .b-1_30 { background: #f2b46b; } .b-31_60 { background: #e8813f; }
.b-61_90 { background: #d65a3a; } .b-90_plus { background: #a8261f; }
.legend { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 16px; font-size: 14px; }
.legend div { display: flex; align-items: center; gap: 8px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend b { margin-left: auto; font-variant-numeric: tabular-nums; }

/* board (who owes you) */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.board .col { background: var(--bg-2); border-radius: var(--r-card); padding: 10px; min-height: 120px; }
.board .col h3 { font-size: 14px; display: flex; gap: 8px; align-items: center; margin: 2px 4px 10px; }
.board .col h3 .total { margin-left: auto; color: var(--ink-2); font-weight: 500; }
.board .bcard { display: block; background: var(--bg); border: 1px solid var(--line-2); border-radius: 8px; padding: 10px 12px;
  margin-bottom: 8px; text-decoration: none; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.board .bcard:hover { border-color: var(--line); }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 16px 28px; }
.timeline li::before { content: ""; position: absolute; left: 7px; top: 22px; bottom: -2px; width: 2px; background: var(--line-2); }
.timeline li:last-child::before { display: none; }
.timeline .dot { position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg);
  border: 2px solid var(--ink-3); }
.timeline .dot.done { background: var(--green); border-color: var(--green); }
.timeline .dot.next { border-color: var(--accent); }
.timeline .dot.bad { background: var(--red); border-color: var(--red); }
.timeline .when { font-weight: 600; font-size: 15px; }
.timeline .what { color: var(--ink-2); font-size: 14px; }

/* ---------- public site ---------- */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line-2); }
.site-header .wrap { display: flex; align-items: center; gap: 8px; height: var(--header); }
.logo { font-weight: 700; font-size: 19px; letter-spacing: -.4px; color: var(--ink); text-decoration: none; display: inline-flex;
  align-items: center; gap: 8px; min-height: 44px; }
.logo:hover { color: var(--ink); }
.logo .mark { width: 26px; height: 26px; border-radius: 7px; background: var(--ink); color: #fff; display: grid; place-items: center; }
.logo span.b { color: var(--brand-bright); }
.site-nav { display: flex; gap: 2px; margin: 0 auto; }
.site-nav a { color: var(--ink); text-decoration: none; padding: 8px 12px; border-radius: 6px; font-size: 15px; }
.site-nav a:hover { background: var(--hover); }
.header-cta { display: flex; gap: 6px; align-items: center; }
.menu-toggle { display: none; }
.mobile-menu { display: none; }
@media (max-width: 799px) {
  .site-nav, .header-cta .login { display: none; }
  .header-cta { margin-left: auto; }
  .menu-toggle { display: inline-flex; width: 44px; height: 44px; align-items: center; justify-content: center; border-radius: 8px;
    background: none; border: 0; color: var(--ink); cursor: pointer; }
  .menu-open .mobile-menu { display: block; position: fixed; inset: var(--header) 0 0 0; background: var(--bg); z-index: 19;
    padding: 12px var(--gutter); overflow-y: auto; }
  .mobile-menu a { display: flex; align-items: center; min-height: 52px; font-size: 18px; font-weight: 600; color: var(--ink);
    text-decoration: none; border-bottom: 1px solid var(--line-2); }
  .mobile-menu .btn { margin-top: 16px; }
}

.hero { padding: 64px 0 40px; text-align: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; color: var(--accent-ink);
  background: var(--accent-tint); padding: 4px 12px; border-radius: 99px; margin-bottom: 18px; text-decoration: none; }
.display { font-size: clamp(40px, 7vw, 76px); font-weight: 700; letter-spacing: clamp(-1.5px, -.045em, -3px); line-height: 1.04;
  max-width: 920px; margin: 0 auto 18px; }
.lead { font-size: clamp(17px, 2vw, 20px); line-height: 1.45; color: var(--ink-2); max-width: 640px; margin: 0 auto 26px; }
.cta-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.cta-note { margin-top: 12px; font-size: 14px; color: var(--ink-2); }
@media (max-width: 599px) {
  .hero { padding: 36px 0 28px; }
  .cta-row { flex-direction: column; align-items: stretch; }
  .cta-row .btn { width: 100%; min-height: 48px; }
}
.h-section { font-size: clamp(30px, 4.6vw, 48px); font-weight: 700; letter-spacing: -1.2px; line-height: 1.08; margin: 0 0 12px; }
.section { padding: 56px 0; }
.section.tight { padding: 32px 0; }
.section-lead { color: var(--ink-2); font-size: 18px; max-width: 640px; margin: 0 0 28px; }
.section.center .section-lead { margin-left: auto; margin-right: auto; }

/* phone mockup with real messages */
.showcase { display: grid; gap: 20px; grid-template-columns: 1fr; max-width: 980px; margin: 8px auto 0; align-items: start; }
@media (min-width: 860px) { .showcase { grid-template-columns: 1fr 1fr; gap: 28px; } }
.phone { background: #fff; border: 1px solid var(--line); border-radius: 32px; padding: 14px; box-shadow: var(--shadow);
  max-width: 380px; margin: 0 auto; width: 100%; text-align: left; }
.phone .bar { display: flex; flex-direction: column; align-items: center; padding: 6px 0 12px; border-bottom: 1px solid var(--line-2); }
.phone .avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--bg-3); display: grid; place-items: center; color: var(--ink-2); font-weight: 600; }
.phone .who { font-size: 13px; color: var(--ink-2); margin-top: 4px; }
.thread { padding: 12px 4px 4px; display: flex; flex-direction: column; gap: 6px; }
.thread .stamp { text-align: center; font-size: 12px; color: var(--ink-3); margin: 8px 0 2px; }
.bubble { background: #e9e9eb; color: var(--ink); padding: 9px 13px; border-radius: 18px 18px 18px 6px; max-width: 88%;
  font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; }
.bubble a { color: #0a64d6; }
.bubble.me { align-self: flex-end; background: #1d6ae5; color: #fff; border-radius: 18px 18px 6px 18px; }
.paycard { border: 1px solid var(--line); border-radius: 20px; padding: 24px; box-shadow: var(--shadow); max-width: 380px; margin: 0 auto;
  width: 100%; background: #fff; text-align: center; }

/* feature cards */
.features { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .features { grid-template-columns: 1fr 1fr; } }
.feature { border-radius: 16px; padding: 24px; background: var(--bg-2); display: flex; flex-direction: column; gap: 10px; min-height: 100%; }
.feature .label { font-size: 14px; color: var(--ink-2); font-weight: 500; }
.feature h3 { font-size: 22px; font-weight: 700; letter-spacing: -.3px; margin: 0; }
.feature p { color: var(--ink-2); margin: 0; }
.feature .visual { margin-top: auto; padding-top: 12px; }
.feature.t-red { background: #fef3f1; } .feature.t-blue { background: #f2f9ff; }
.feature.t-green { background: #f0f8f1; } .feature.t-yellow { background: #fff8e6; }
.mini { background: #fff; border-radius: 12px; border: 1px solid var(--line-2); padding: 14px; box-shadow: 0 1px 2px rgba(0,0,0,.04); font-size: 14px; }

/* use-case rows */
.uses { display: grid; gap: 8px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .uses { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .uses { grid-template-columns: repeat(4, 1fr); } }
.use { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 12px 16px; border: 1px solid var(--line);
  border-radius: 12px; text-decoration: none; color: var(--ink); font-weight: 600; }
.use:hover { background: var(--bg-2); color: var(--ink); }
.use .ic { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-tint); color: var(--accent-ink); flex: none; }
.use .icon.go { margin-left: auto; color: var(--ink-3); }

/* quotes */
.quotes { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .quotes { grid-template-columns: repeat(3, 1fr); } }
.quote { background: var(--bg-2); border-radius: 12px; padding: 18px 20px; font-size: 17px; line-height: 1.45; }
.quote::before { content: "\201C"; display: block; font-size: 36px; line-height: 1; color: var(--brand-bright); font-weight: 700; height: 22px; }

/* sequence preview */
.sequence { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .sequence { grid-template-columns: repeat(2, 1fr); } }
.seq { border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.seq .head { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.seq .body { font-size: 15px; color: var(--ink); background: var(--bg-2); border-radius: 10px; padding: 10px 12px; overflow-wrap: anywhere; }
.seq .body + .body { margin-top: 8px; }
.seq .chan { font-size: 12px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; display: block; margin-bottom: 2px; }

/* pricing */
.plans { display: grid; gap: 16px; grid-template-columns: 1fr; max-width: 1120px; margin: 0 auto; }
@media (min-width: 760px) { .plans { grid-template-columns: repeat(3, 1fr); } }
.plan { border: 1px solid var(--line); border-radius: 16px; padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.plan.pro { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.plan .price { font-size: 44px; font-weight: 700; letter-spacing: -1.5px; line-height: 1; }
.plan .per { font-size: 15px; color: var(--ink-2); font-weight: 400; letter-spacing: 0; }
.plan ul { list-style: none; padding: 0; margin: 4px 0 0; }
.plan li { display: flex; gap: 8px; padding: 5px 0; font-size: 15px; }
.plan li .icon { color: var(--green); margin-top: 3px; }
.plan .btn { margin-top: auto; }
@media (min-width: 760px) and (max-width: 979px) { .plans { gap: 12px; } .plan { padding: 20px; } .plan .price { font-size: 36px; } }
.compare { width: 100%; border-collapse: collapse; font-size: 15px; }
.compare th, .compare td { padding: 12px 8px; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: top; }
.compare th { font-weight: 600; }
.compare td.c, .compare th.c { text-align: center; width: 22%; }
@media (max-width: 600px) { .compare { font-size: 13px; } .compare th, .compare td { padding: 10px 4px; } .compare td.c, .compare th.c { width: 21%; } }
.compare .icon { color: var(--green); }
.compare .grp td { font-weight: 600; color: var(--ink-2); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; padding-top: 22px; }

/* faq */
.faq { max-width: 760px; margin: 0 auto; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 12px 0;
  font-weight: 600; font-size: 17px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon { margin-left: auto; transition: transform .15s; color: var(--ink-3); }
.faq details[open] summary .icon { transform: rotate(45deg); }
.faq .a { padding: 0 0 18px; color: var(--ink-2); }

.cta-band { text-align: center; padding: 72px 0; background: var(--bg-2); }

.site-footer { border-top: 1px solid var(--line-2); padding: 48px 0 32px; font-size: 14px; }
.site-footer .cols { display: grid; gap: 28px; grid-template-columns: 1fr 1fr; }
@media (min-width: 860px) { .site-footer .cols { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.site-footer .brand { grid-column: 1 / -1; }
@media (min-width: 860px) { .site-footer .brand { grid-column: auto; } }
.site-footer h3 { font-size: 13px; color: var(--ink-2); font-weight: 500; margin: 0 0 8px; }
.site-footer a { display: block; color: var(--ink); text-decoration: none; padding: 5px 0; min-height: 32px; }
.site-footer a:hover { color: var(--accent); }
.site-footer .legal { margin-top: 32px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 8px 20px; }

/* prose (terms/privacy) */
.prose { max-width: 720px; margin: 0 auto; padding: 40px 0 64px; }
.prose h1 { font-size: clamp(32px, 5vw, 44px); letter-spacing: -1px; }
.prose h3 { margin-top: 28px; }
.prose p, .prose li { color: var(--ink); }

/* ---------- auth pages ---------- */
.auth { max-width: 380px; margin: 0 auto; padding: 48px var(--gutter) 64px; }
.auth .logo { margin-bottom: 24px; }
.auth h1 { font-size: 24px; letter-spacing: -.3px; margin-bottom: 2px; }
.auth h1 + .sub { font-size: 24px; font-weight: 600; color: var(--ink-3); letter-spacing: -.3px; line-height: 1.2; margin-bottom: 20px; }
.auth .btn.block { margin-top: 20px; }
.auth .foot { margin-top: 20px; font-size: 14px; color: var(--ink-2); text-align: center; }

/* ---------- app shell ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { display: none; }
.app-main { flex: 1; min-width: 0; }
.app-content { max-width: 1040px; margin: 0 auto; padding: 20px var(--gutter) calc(var(--tabbar) + 32px); }
.topbar { position: sticky; top: 0; z-index: 10; background: rgba(255, 255, 255, .94); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line-2); height: 56px; display: flex; align-items: center; gap: 10px; padding: 0 var(--gutter); }
.topbar .biz { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-head { display: flex; align-items: center; gap: 12px; margin: 4px 0 16px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 28px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); text-decoration: none; font-size: 14px; min-height: 32px; margin-bottom: 4px; }
.back:hover { color: var(--ink); }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(var(--tabbar) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); background: rgba(255, 255, 255, .96); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr); }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px;
  font-weight: 500; color: var(--ink-2); text-decoration: none; min-height: 48px; }
.tabbar a.on { color: var(--ink); }
.tabbar a.on .icon { stroke-width: 2.4; }
.tabbar .add span.fab { width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center;
  box-shadow: 0 2px 8px rgba(194, 65, 12, .35); }
.tabbar .add { color: var(--accent-ink); }
@media (min-width: 900px) {
  .tabbar, .topbar { display: none; }
  .sidebar { display: flex; flex-direction: column; width: 248px; flex: none; background: var(--bg-2); border-right: 1px solid var(--line-2);
    position: sticky; top: 0; height: 100vh; padding: 12px 10px; }
  .sidebar .biz { display: flex; align-items: center; gap: 8px; padding: 6px 8px; font-weight: 600; font-size: 15px; min-height: 40px; }
  .sidebar .biz .mark { width: 24px; height: 24px; border-radius: 6px; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 13px; flex: none; }
  .sidebar .biz span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sidebar nav { display: flex; flex-direction: column; gap: 1px; margin-top: 8px; }
  .sidebar nav a, .sidebar .linkbtn { display: flex; align-items: center; gap: 10px; padding: 6px 10px; min-height: 34px; border-radius: 6px;
    color: var(--ink-2); text-decoration: none; font-size: 15px; font-weight: 500; width: 100%; text-align: left; }
  .sidebar nav a:hover, .sidebar .linkbtn:hover { background: var(--hover); color: var(--ink); }
  .sidebar nav a.on { background: rgba(0, 0, 0, .06); color: var(--ink); }
  .sidebar .btn { margin: 4px 0 6px; }
  .sidebar .bottom { margin-top: auto; }
  .sidebar .plan-note { font-size: 13px; color: var(--ink-2); padding: 10px; background: var(--bg); border: 1px solid var(--line-2); border-radius: 10px; margin: 0 0 8px; }
  .app-content { padding: 32px 40px 64px; }
}
.more-menu a, .more-menu button { display: flex; align-items: center; gap: 12px; min-height: 52px; width: 100%; padding: 0 4px;
  border-bottom: 1px solid var(--line-2); color: var(--ink); text-decoration: none; font-size: 17px; font-weight: 500; }

/* sticky submit bar on phone forms */
.form-actions { margin-top: 20px; }
@media (max-width: 899px) {
  .form-actions.sticky { position: sticky; bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); background: linear-gradient(rgba(255,255,255,0), #fff 30%);
    padding: 16px 0 12px; margin-bottom: -12px; z-index: 5; }
  .form-actions .btn { width: 100%; min-height: 48px; }
}

/* customer invoice page */
.paypage { max-width: 440px; margin: 0 auto; padding: 24px var(--gutter) 48px; }
.paypage .from { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.paypage .from .avatar { width: 40px; height: 40px; border-radius: 10px; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 700; }
.paypage .amount { font-size: 44px; font-weight: 700; letter-spacing: -1.5px; line-height: 1.05; margin: 6px 0 8px; font-variant-numeric: tabular-nums; }
.paypage .facts { margin: 18px 0; border-top: 1px solid var(--line-2); }
.paypage .facts div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: 15px; }
.paypage .facts dt { color: var(--ink-2); }
.paypage .facts dd { margin: 0; text-align: right; font-weight: 500; }
.paypage .btn + .btn { margin-top: 10px; }
.paypage .done { text-align: center; padding: 28px 16px; }
.paypage .done .icon { color: var(--green); }
.paypage .powered { text-align: center; font-size: 13px; color: var(--ink-3); margin-top: 28px; }
