/* ============================================================
   Legacy Roofing Ops App — design system
   White-label: every brand value is a --brand-* / --chrome-* token.
   ============================================================ */

:root {
  /* Brand (swap these per contractor) */
  --brand: oklch(0.50 0.20 27);          /* Legacy red #C0141C */
  --brand-press: oklch(0.42 0.19 27);    /* #9A0F15 */
  --brand-tint: oklch(0.95 0.035 27);
  --brand-ink-on: oklch(0.99 0.01 80);

  /* Chrome (dark branded bar) */
  --chrome: oklch(0.185 0.012 265);      /* #0D0F14 */
  --chrome-2: oklch(0.235 0.014 265);    /* #141720 */
  --chrome-text: oklch(0.95 0.008 80);   /* cream */
  --chrome-text-dim: oklch(0.74 0.01 265);

  /* Surfaces */
  --bg: oklch(0.972 0.006 80);           /* warm off-white */
  --surface: oklch(0.995 0.003 80);      /* near white */
  --surface-2: oklch(0.965 0.006 80);
  --border: oklch(0.905 0.006 80);
  --border-strong: oklch(0.84 0.007 80);

  /* Ink */
  --ink: oklch(0.235 0.012 265);
  --ink-2: oklch(0.46 0.010 265);
  --ink-3: oklch(0.62 0.008 265);

  /* Semantic */
  --paid: oklch(0.55 0.12 150);
  --paid-tint: oklch(0.95 0.04 150);
  --waiting: oklch(0.66 0.12 70);
  --waiting-tint: oklch(0.95 0.05 75);
  --info: oklch(0.55 0.10 240);
  --info-tint: oklch(0.95 0.035 240);
  --danger: oklch(0.50 0.20 27);
  --danger-tint: oklch(0.95 0.04 27);

  /* Radii / shadow / motion */
  --r-sm: 8px;
  --r: 14px;
  --r-lg: 20px;
  --r-full: 999px;
  --shadow-sm: 0 1px 2px oklch(0.2 0.02 265 / 0.06), 0 1px 1px oklch(0.2 0.02 265 / 0.04);
  --shadow: 0 4px 16px oklch(0.2 0.02 265 / 0.08), 0 1px 3px oklch(0.2 0.02 265 / 0.06);
  --shadow-lg: 0 16px 40px oklch(0.18 0.02 265 / 0.18);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 200ms;

  --topbar-h: 60px;
  --tabbar-h: 64px;
  --maxw: 1180px;
  --sidenav-w: 240px;

  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Archivo", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button { font-family: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); letter-spacing: -0.01em; }
.num { font-family: var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

.icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: block; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ============================================================
   App shell
   ============================================================ */
.app {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: var(--topbar-h) 1fr var(--tabbar-h);
}

/* Top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--topbar-h);
  padding: 0 14px;
  padding-top: env(safe-area-inset-top);
  background: var(--chrome);
  color: var(--chrome-text);
}
.topbar__back {
  display: grid; place-items: center;
  width: 40px; height: 40px; margin-left: -6px;
  border: 0; border-radius: var(--r-full);
  background: transparent; color: var(--chrome-text);
}
.topbar__back:active { background: oklch(1 0 0 / 0.10); }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand__mark {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--brand); color: var(--brand-ink-on);
  font-family: var(--font-display); font-weight: 800; font-size: 19px;
  box-shadow: inset 0 0 0 1px oklch(1 0 0 / 0.12);
}
.brand__name { font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: -0.01em; white-space: nowrap; }
.topbar__title { font-size: 18px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__action {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 6px;
  height: 40px; padding: 0 14px 0 11px;
  border: 0; border-radius: var(--r-full);
  background: var(--brand); color: var(--brand-ink-on);
  font-weight: 600; font-size: 15px;
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.topbar__action:active { background: var(--brand-press); transform: scale(0.97); }
.topbar__action .icon { width: 19px; height: 19px; stroke-width: 2.4; }

/* Content */
.content {
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  outline: none;
}
.content:focus-visible { outline: none; }
.page { padding: 18px 16px calc(28px + env(safe-area-inset-bottom)); max-width: 680px; margin: 0 auto; }
.page--wide { max-width: var(--maxw); }

/* Bottom tab bar */
.tabbar {
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 30;
}
.tab {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  color: var(--ink-3);
  font-size: 11px; font-weight: 600;
  padding: 8px 0 6px;
  position: relative;
  transition: color var(--dur) var(--ease);
}
.tab .icon { width: 24px; height: 24px; stroke-width: 2; }
.tab[aria-current="page"] { color: var(--brand); }
.tab[aria-current="page"]::before {
  content: ""; position: absolute; top: 0; width: 28px; height: 3px;
  border-radius: 0 0 3px 3px; background: var(--brand);
}

/* ============================================================
   Desktop: top bar full-width, tabbar becomes side nav
   ============================================================ */
@media (min-width: 880px) {
  .app {
    grid-template-columns: var(--sidenav-w) 1fr;
    grid-template-rows: var(--topbar-h) 1fr;
    grid-template-areas: "top top" "nav main";
  }
  .topbar { grid-area: top; }
  .content { grid-area: main; }
  .tabbar {
    grid-area: nav;
    flex-direction: column;
    border-top: 0; border-right: 1px solid var(--border);
    padding: 14px 12px;
    gap: 4px;
  }
  .tab {
    flex: 0 0 auto;
    flex-direction: row; justify-content: flex-start;
    gap: 13px; padding: 12px 14px;
    border-radius: var(--r);
    font-size: 15px;
  }
  .tab .icon { width: 21px; height: 21px; }
  .tab[aria-current="page"] { background: var(--brand-tint); color: var(--brand); }
  .tab[aria-current="page"]::before { display: none; }
  .tab:not([aria-current="page"]):hover { background: var(--surface-2); color: var(--ink); }
  .page { padding: 28px 32px 48px; }
}

/* ============================================================
   Reusable bits
   ============================================================ */
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.page-head h2 { font-size: 22px; font-weight: 800; }
.muted { color: var(--ink-2); }
.center-muted { text-align: center; color: var(--ink-3); padding: 32px 16px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px;
  border: 1px solid transparent; border-radius: var(--r);
  font-weight: 600; font-size: 16px; line-height: 1;
  transition: background var(--dur) var(--ease), transform 120ms var(--ease), border-color var(--dur) var(--ease);
}
.btn .icon { width: 19px; height: 19px; }
.btn:active { transform: scale(0.98); }
.btn--primary { background: var(--brand); color: var(--brand-ink-on); }
.btn--primary:hover { background: var(--brand-press); }
.btn--secondary { background: var(--surface); color: var(--ink); border-color: var(--border-strong); }
.btn--secondary:hover { background: var(--surface-2); }
.btn--ghost { background: transparent; color: var(--ink-2); min-height: 40px; padding: 0 12px; }
.btn--ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn--block { width: 100%; }
.btn--lg { min-height: 54px; font-size: 17px; }

.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }

/* Status pills */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  height: 26px; padding: 0 10px 0 8px;
  border-radius: var(--r-full);
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.pill .icon { width: 14px; height: 14px; stroke-width: 2.4; }
.pill--draft { background: var(--surface-2); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--border-strong); }
.pill--sent, .pill--scheduled, .pill--invoiced { background: var(--info-tint); color: var(--info); }
.pill--approved, .pill--paid, .pill--done { background: var(--paid-tint); color: var(--paid); }
.pill--waiting, .pill--progress { background: var(--waiting-tint); color: var(--waiting); }
.pill--overdue { background: var(--danger-tint); color: var(--danger); }

/* Cards / panels */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 26px 2px 12px; }
.section-title h3 { font-size: 16px; font-weight: 700; }
.section-title a { font-size: 14px; font-weight: 600; color: var(--brand); }

/* List rows */
.list { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.row {
  display: flex; align-items: center; gap: 13px;
  padding: 14px 15px; width: 100%; text-align: left;
  background: transparent; border: 0; border-top: 1px solid var(--border);
  transition: background 140ms var(--ease);
}
.row:first-child { border-top: 0; }
.row:hover { background: var(--surface-2); }
.row:active { background: var(--brand-tint); }
.row__avatar {
  flex: none; width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 17px;
  background: var(--brand-tint); color: var(--brand);
}
.row__avatar--photo { background-size: cover; background-position: center; color: transparent; }
.row__main { min-width: 0; flex: 1; }
.row__title { display: block; font-weight: 600; font-size: 16px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row__meta { display: block; font-size: 13.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.row__end { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.row__amount { font-family: var(--font-display); font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }
.row__chev { flex: none; color: var(--ink-3); }
.row__chev .icon { width: 20px; height: 20px; }

/* Dashboard money strip */
.money-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 8px; }
.money {
  padding: 16px 16px 18px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.money__label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.money__label .icon { width: 16px; height: 16px; }
.money__value { font-family: var(--font-display); font-weight: 800; font-size: 30px; margin-top: 8px; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.money__sub { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.money--in .icon { color: var(--paid); }
.money--out .icon { color: var(--waiting); }

/* Greeting */
.greeting { margin-bottom: 18px; }
.greeting h2 { font-size: 24px; font-weight: 800; }
.greeting p { margin: 4px 0 0; color: var(--ink-2); font-size: 15px; }

/* Today snapshot card */
.today { padding: 4px; }
.today__item { display: flex; align-items: center; gap: 12px; padding: 13px 13px; border-radius: var(--r); transition: background 140ms var(--ease); width: 100%; text-align: left; background: transparent; border: 0; }
.today__item + .today__item { border-top: 1px solid var(--border); border-radius: 0; }
.today__item:hover { background: var(--surface-2); }
.today__time { flex: none; width: 56px; font-family: var(--font-display); font-weight: 700; font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.today__dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--info); }
.today__dot--done { background: var(--paid); }
.today__dot--progress { background: var(--waiting); }
.today__body { flex: 1; min-width: 0; }
.today__body strong { font-weight: 600; font-size: 15.5px; display: block; }
.today__body span { font-size: 13px; color: var(--ink-3); }

/* Detail header */
.detail-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 6px; }
.detail-head__avatar { width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 24px; background: var(--brand-tint); color: var(--brand); flex: none; }
.detail-head__info h2 { font-size: 22px; font-weight: 800; }
.detail-head__info .muted { font-size: 14.5px; margin-top: 3px; }

.contact-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0 6px; }
.contact-actions .btn { min-height: 46px; font-size: 15px; }

.kv { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-top: 1px solid var(--border); }
.kv:first-child { border-top: 0; }
.kv dt { font-size: 12.5px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.04em; }
.kv dd { margin: 0; font-size: 15.5px; color: var(--ink); }

/* Note block */
.note { background: var(--waiting-tint); border-radius: var(--r); padding: 13px 15px; font-size: 14.5px; color: oklch(0.42 0.07 70); line-height: 1.5; }

/* Document (estimate / invoice) */
.doc {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow); overflow: hidden;
}
.doc__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 22px 22px 18px; background: var(--chrome); color: var(--chrome-text); }
.doc__brand { display: flex; align-items: center; gap: 11px; }
.doc__brand .brand__mark { width: 40px; height: 40px; font-size: 22px; }
.doc__co h3 { font-size: 17px; font-weight: 700; }
.doc__co span { font-size: 12.5px; color: var(--chrome-text-dim); }
.doc__type { text-align: right; }
.doc__type .eyebrow { color: var(--chrome-text-dim); }
.doc__type .num { font-size: 20px; font-weight: 800; }
.doc__parties { display: flex; justify-content: space-between; gap: 16px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.doc__parties .eyebrow { margin-bottom: 4px; }
.doc__parties strong { font-weight: 600; font-size: 15.5px; }
.doc__parties .muted { font-size: 13.5px; }
.doc__date { text-align: right; }

.litem { display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; padding: 14px 22px; border-top: 1px solid var(--border); }
.litem:first-of-type { border-top: 0; }
.litem__desc { font-weight: 600; font-size: 15px; }
.litem__sub { grid-column: 1; font-size: 13px; color: var(--ink-3); }
.litem__amt { grid-row: 1; grid-column: 2; font-family: var(--font-display); font-weight: 700; font-variant-numeric: tabular-nums; align-self: start; }

.totals { padding: 14px 22px 6px; border-top: 2px solid var(--border-strong); }
.totals__line { display: flex; justify-content: space-between; padding: 5px 0; font-size: 14.5px; color: var(--ink-2); }
.totals__line .num { color: var(--ink); }
.totals__grand { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 0 6px; margin-top: 6px; border-top: 1px solid var(--border); }
.totals__grand span { font-weight: 700; font-size: 16px; }
.totals__grand .num { font-size: 26px; font-weight: 800; color: var(--ink); }
.doc__foot { padding: 16px 22px 22px; font-size: 13px; color: var(--ink-3); }

/* Payment status banner */
.paidbanner { display: flex; align-items: center; gap: 10px; padding: 14px 18px; background: var(--paid-tint); color: var(--paid); font-weight: 600; }
.paidbanner .icon { width: 22px; height: 22px; }
.duebanner { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; background: var(--waiting-tint); color: var(--waiting); font-weight: 600; }
.duebanner--overdue { background: var(--danger-tint); color: var(--danger); }

/* Estimate builder */
.builder-line { display: flex; align-items: center; gap: 10px; padding: 13px 0; border-top: 1px solid var(--border); }
.builder-line:first-child { border-top: 0; }
.builder-line__main { flex: 1; min-width: 0; }
.builder-line__main strong { display: block; font-weight: 600; font-size: 15px; }
.builder-line__main span { font-size: 13px; color: var(--ink-3); }
.builder-line__amt { font-family: var(--font-display); font-weight: 700; font-variant-numeric: tabular-nums; }
.add-line { display: flex; align-items: center; gap: 8px; width: 100%; padding: 14px; margin-top: 4px; border: 1.5px dashed var(--border-strong); border-radius: var(--r); background: transparent; color: var(--brand); font-weight: 600; font-size: 15px; }
.add-line:hover { background: var(--brand-tint); }
.add-line .icon { width: 18px; height: 18px; }

.sticky-foot {
  position: sticky; bottom: 0;
  margin: 18px -16px calc(-28px - env(safe-area-inset-bottom));
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  background: oklch(0.995 0.003 80 / 0.92);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px;
}
.sticky-foot__total { flex: none; }
.sticky-foot__total .eyebrow { font-size: 11px; }
.sticky-foot__total .num { font-size: 22px; font-weight: 800; display: block; }
.sticky-foot .btn { flex: 1; }

/* Jobs pipeline */
.pipe-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 14px; scrollbar-width: none; }
.pipe-tabs::-webkit-scrollbar { display: none; }
.pipe-tab { flex: none; height: 38px; padding: 0 15px; border-radius: var(--r-full); border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink-2); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 7px; transition: all 140ms var(--ease); }
.pipe-tab .count { display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: var(--r-full); background: var(--surface-2); color: var(--ink-3); font-size: 12px; font-weight: 700; }
.pipe-tab[aria-pressed="true"] { background: var(--chrome); color: var(--chrome-text); border-color: var(--chrome); }
.pipe-tab[aria-pressed="true"] .count { background: oklch(1 0 0 / 0.16); color: var(--chrome-text); }

.job-card { display: flex; gap: 13px; padding: 14px; }
.job-thumb { flex: none; width: 64px; height: 64px; border-radius: var(--r); background-size: cover; background-position: center; background-color: var(--surface-2); }

/* Calendar */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-head h3 { font-size: 18px; font-weight: 800; }
.cal-nav { display: flex; gap: 6px; }
.cal-nav button { width: 38px; height: 38px; border-radius: var(--r-full); border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink-2); display: grid; place-items: center; }
.cal-nav button:hover { background: var(--surface-2); }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-full); padding: 3px; }
.seg button { height: 32px; padding: 0 14px; border: 0; border-radius: var(--r-full); background: transparent; color: var(--ink-2); font-weight: 600; font-size: 14px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { text-align: center; font-size: 11.5px; font-weight: 700; color: var(--ink-3); padding: 4px 0; text-transform: uppercase; letter-spacing: 0.03em; }
.cal-cell { aspect-ratio: 1 / 1.05; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); padding: 6px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-cell--out { background: var(--surface-2); border-color: transparent; }
.cal-cell--today { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.cal-date { font-family: var(--font-display); font-weight: 700; font-size: 13px; color: var(--ink-2); }
.cal-cell--today .cal-date { color: var(--brand); }
.cal-ev { font-size: 10.5px; font-weight: 600; line-height: 1.2; padding: 2px 4px; border-radius: 5px; background: var(--info-tint); color: var(--info); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-ev--done { background: var(--paid-tint); color: var(--paid); }
.cal-ev--progress { background: var(--waiting-tint); color: var(--waiting); }
.cal-more { font-size: 10px; font-weight: 700; color: var(--ink-3); padding-left: 4px; }

/* Agenda (week) */
.agenda-day { margin-bottom: 8px; }
.agenda-day__label { display: flex; align-items: baseline; gap: 8px; padding: 14px 2px 8px; }
.agenda-day__label strong { font-family: var(--font-display); font-weight: 800; font-size: 16px; }
.agenda-day__label.is-today strong { color: var(--brand); }

/* More menu */
.menu-list .row__icon { width: 40px; height: 40px; border-radius: 11px; background: var(--surface-2); display: grid; place-items: center; color: var(--ink-2); flex: none; }
.profile-card { display: flex; align-items: center; gap: 14px; padding: 18px; }
.profile-card .brand__mark { width: 52px; height: 52px; font-size: 26px; border-radius: 14px; }
.profile-card h3 { font-size: 18px; font-weight: 800; }

/* Bottom sheet */
.sheet-scrim { position: fixed; inset: 0; background: oklch(0.18 0.02 265 / 0.45); z-index: 50; animation: fade var(--dur) var(--ease); }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 51;
  background: var(--surface);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  box-shadow: var(--shadow-lg);
  padding: 8px 18px calc(22px + env(safe-area-inset-bottom));
  max-width: 560px; margin: 0 auto;
  animation: sheet-up 320ms var(--ease);
  max-height: 86dvh; overflow-y: auto;
}
.sheet__grip { width: 40px; height: 4px; border-radius: 2px; background: var(--border-strong); margin: 8px auto 14px; }
.sheet h3 { font-size: 19px; font-weight: 800; margin-bottom: 4px; }
.sheet__sub { color: var(--ink-2); font-size: 14.5px; margin-bottom: 16px; }
.sheet-actions { display: flex; flex-direction: column; gap: 10px; }
.sheet-opt { display: flex; align-items: center; gap: 14px; padding: 15px 16px; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface); text-align: left; width: 100%; transition: background 140ms var(--ease), border-color 140ms var(--ease); }
.sheet-opt:hover { background: var(--surface-2); border-color: var(--border-strong); }
.sheet-opt__icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-tint); color: var(--brand); flex: none; }
.sheet-opt__t { font-weight: 600; font-size: 16px; }
.sheet-opt__d { font-size: 13px; color: var(--ink-3); }

/* Field (read-only demo inputs) */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.field input, .field textarea, .field .fake-input { width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: var(--r); background: var(--surface); font: inherit; color: var(--ink); }
.field input:focus, .field textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 18px); transform: translateX(-50%);
  z-index: 60; background: var(--chrome); color: var(--chrome-text);
  padding: 13px 18px; border-radius: var(--r-full); font-weight: 600; font-size: 14.5px;
  box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 9px;
  animation: toast-in 300ms var(--ease);
  max-width: calc(100% - 32px);
}
.toast .icon { width: 18px; height: 18px; color: oklch(0.7 0.13 150); }
@media (min-width: 880px) { .toast { bottom: 24px; } }

/* Customer-facing view: drop the app shell entirely */
body.is-public .topbar, body.is-public .tabbar { display: none !important; }
body.is-public .app { display: block; min-height: 100dvh; }
body.is-public .content { overflow: visible; height: auto; }
.public { max-width: 560px; margin: 0 auto; padding: 24px 16px 48px; }
.public__bar { background: var(--chrome); color: var(--chrome-text); padding: 18px 20px; border-radius: var(--r-lg); display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.public__pay { position: sticky; bottom: 16px; margin-top: 18px; }

/* Animations */
@keyframes fade { from { opacity: 0; } }
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes toast-in { from { transform: translate(-50%, 14px); opacity: 0; } }
.view-enter { animation: view-in 260ms var(--ease); }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } }

/* Print: only the document */
@media print {
  .topbar, .tabbar, .sticky-foot, .btn-row, .duebanner, .public__pay, .toast { display: none !important; }
  .app { display: block; }
  .doc { box-shadow: none; border: 0; }
  body { background: #fff; }
}
