/* Tradiebase demo — mobile-first, 390px friendly, no horizontal scroll
   BRAND (Damo's second board): navy #0D1B2A = dark surfaces + body ink,
   orange #FF6A00 = buttons / accents / CTA, white #FFFFFF = cards + brand zone.
   Those three are the ONLY primaries; everything else here is a neutral or a
   semantic status colour (green/blue/red/amber), never a brand colour. */
:root{
  --ink:#0D1B2A;--muted:#78716c;--bg:#fafaf9;--card:#fff;--line:#e7e5e4;
  --navy:#0D1B2A;--brand:#FF6A00;--brand-d:#0D1B2A;--ok:#16a34a;--blue:#2563eb;--blue2:#dbeafe;
  --ok2:#dcfce7;--gray2:#f5f5f4;--warn2:#fef3c7;--warn:#b45309;
  /* tints of the NEW orange (light surfaces for notes / suggestions / badges) —
     never a primary, always the orange's own wash */
  --brand-50:#fff3e9;--brand-100:#ffe7d6;--brand-200:#ffd2b3;
}
*{box-sizing:border-box}
html,body{overflow-x:hidden;max-width:100vw}
body{
  margin:0;background:var(--bg);color:var(--ink);
  font-family:"Poppins",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  font-size:17px;font-weight:500;line-height:1.45;padding-bottom:96px;
  -webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent;
}
/* body links: navy text so every line of copy stays >= 4.5:1 on white, with the
   brand's ORANGE underline carrying the accent colour. */
a{color:var(--navy);text-decoration-color:var(--brand);text-underline-offset:2px}
.topbar{
  position:sticky;top:0;z-index:40;background:var(--navy);color:#fff;
  display:flex;align-items:center;justify-content:space-between;
  /* wrap, never overflow: at 390px the SIGNED-IN header carries brand + Demo tag +
     Sign out + the bell/gear group, and the header must never push any of them past
     the viewport edge (the phone rule: 0 horizontal scroll). */
  flex-wrap:wrap;gap:4px;
  padding:10px 8px;min-height:54px;
}
.topbar a{color:#fff;text-decoration:none}
/* ACTIVE BRAND CONTROL (Damo): ONE <a> home button holding BOTH of his exports —
   the icon tile then the wordmark — on the white field both images carry, so the
   pill is #FFFFFF on the navy bar (never recolour the images). Full-height tap
   target, pointer cursor, hover/press feedback, focus ring. */
.brand{
  flex:0 0 auto;display:inline-flex;align-items:center;gap:7px;
  background:#fff;border-radius:10px;padding:5px 6px;min-height:52px;
  color:var(--navy);text-decoration:none;cursor:pointer;
  -webkit-tap-highlight-color:transparent;
}
.brand img{display:block;flex:0 0 auto}
.brand .b-icon{height:40px;width:auto}
/* INTERIM wordmark (Damo's new crop still to come): LIVE TEXT, not recreated art —
   TRADIE in navy + BASE in the board's orange, Poppins Semibold, sized to sit beside
   the icon tile at the old wordmark's height (~30px line box). Same white pill rule;
   when his crop arrives the text swaps back to an <img> in the same slot. */
.brand .b-word{
  font:600 19px/30px Poppins,-apple-system,system-ui,sans-serif;
  color:#0D1B2A;letter-spacing:.01em;white-space:nowrap;
}
.brand .b-base{font-weight:600;color:#FF6A00}
.brand:hover{opacity:.92}
.brand:active{transform:scale(.97);opacity:.85}
.brand:focus-visible{outline:3px solid var(--brand);outline-offset:2px}
/* The DEMO marker the server injects beside the brand on EVERY rendered page — a
   public demo must never read as a live account. Pill-sized on purpose: brand + tag +
   gear must still fit a 390px header with zero horizontal scroll (topbar is
   space-between, so the tag lands centred between them). */
.topbar .demo-tag{
  flex:0 0 auto;align-self:center;white-space:nowrap;
  font-size:11px;font-weight:600;letter-spacing:.07em;text-transform:uppercase;
  background:#fff;color:var(--navy);border:1px solid rgba(13,27,42,.25);
  border-radius:999px;padding:3px 5px;line-height:1.3;
}
.topbar .tag{font-size:12px;opacity:.9;font-weight:600}
/* header top-right gear = the ONLY Settings entry point now (the Demo badge moved out):
   icon-only, aria-label + title do the naming, 40px round target on the brand orange. */
.topbar .gear{
  display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;
  width:40px;height:40px;border-radius:50%;background:rgba(255,255,255,.15);
  color:#fff;font-size:20px;line-height:1;text-decoration:none;
}
.topbar .gear:active{background:rgba(255,255,255,.34);transform:scale(.96)}
/* HEADER BELL — in-app notifications (payments received, quotes accepted, invoices
   overdue), worked out server-side from the activity log. It sits in the header's right
   icon GROUP (.topr, app.js wraps the gear into one) beside the gear, on the demo and on
   a signed-in account alike. Icon = a real SVG (no glyph stand-in), 40px round target on
   the brand orange like the gear, white pill badge with the unread count. */
/* min-height:40px is deliberate — the global `button` rule asks for 54px, which would
   stretch this circle past the gear beside it. */
.topbar .bell{
  position:relative;display:inline-flex;align-items:center;justify-content:center;
  flex:0 0 auto;width:40px;height:40px;min-height:40px;padding:0;border:0;
  border-radius:50%;background:rgba(255,255,255,.15);color:#fff;cursor:pointer;
  line-height:1;
}
.topbar .bell:active{background:rgba(255,255,255,.34);transform:scale(.96)}
.topbar .bell svg{width:21px;height:21px;display:block}
.bell-badge{
  position:absolute;top:-4px;right:-5px;min-width:18px;height:18px;padding:0 4px;
  box-sizing:border-box;border:1.5px solid var(--brand);border-radius:9px;
  background:#fff;color:var(--navy);font-size:11px;font-weight:600;line-height:15px;
  text-align:center;pointer-events:none;
}
/* the panel hangs under the header's icon group: same card language as the rest of the
   app, never wider than the phone (width is capped in vw, so 0 horizontal scroll with it
   open at 390px), scrollable inside its own box instead of pushing the page. */
.notif-panel{
  position:absolute;top:calc(100% + 8px);right:8px;width:min(92vw,360px);
  max-height:70vh;overflow-y:auto;z-index:60;
  background:var(--card);color:var(--ink);border:1px solid var(--line);
  border-radius:16px;box-shadow:0 14px 34px rgba(28,25,23,.24);padding:6px;
}
.notif-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 8px 6px}
.notif-head b{font-size:15px}
.notif-head .chip{font-size:13px;padding:6px 11px;min-height:34px}
/* the author rule above would otherwise beat the browser's own [hidden] styling and
   leave "Mark all read" sitting in an EMPTY panel — hidden must still mean hidden. */
.notif-head .chip[hidden]{display:none}
.notif-list .notif-row{
  display:flex;align-items:flex-start;gap:9px;padding:11px 8px;border-radius:12px;
  text-decoration:none;color:inherit;
}
.notif-list .notif-row+.notif-row{border-top:1px solid var(--line)}
.notif-list .notif-row:active{background:var(--gray2)}
.nr-dot{width:8px;height:8px;margin-top:7px;border-radius:50%;background:var(--brand);flex:0 0 auto}
.notif-row.read .nr-dot{background:transparent}
.notif-row.read .nr-t{font-weight:600;color:var(--muted)}
.nr-body{min-width:0;display:flex;flex-direction:column;gap:2px}
.nr-t{font-size:15px;font-weight:600;line-height:1.3}
.nr-s{font-size:12px;color:var(--muted)}
.notif-empty{padding:14px 8px;color:var(--muted);font-size:14px}
.topr{display:flex;align-items:center;gap:8px}
main{padding:16px 16px 8px;max-width:560px;margin:0 auto}
/* The explicit way back to the public landing page ("/" — the features page), present
   on EVERY inner page (the header brand button goes to /app, so it can never be the way
   out). A pill at the end of the content: thumb-sized, centred, clear of the fixed
   tabbar (and the chat composer) by its own bottom margin + the body's padding. */
.site-foot{max-width:560px;margin:16px auto 56px;padding:0 16px;text-align:center}
.site-foot a{
  display:inline-flex;align-items:center;gap:6px;min-height:44px;
  padding:10px 18px;border:1.5px solid var(--line);border-radius:999px;
  background:var(--card);color:var(--navy);
  font-size:14px;font-weight:600;text-decoration:none;
}
.site-foot a:active{background:var(--brand-50);border-color:var(--brand);transform:scale(.98)}
h1{font-size:25px;line-height:1.2;margin:4px 0 14px;font-weight:600}
h2{font-size:18px;margin:20px 0 10px}
.muted{color:var(--muted);font-size:14px}
.card{background:var(--card);border:1px solid var(--line);border-radius:16px;padding:16px;margin-bottom:14px}
.card.tight{padding:12px 14px}
label{display:block;font-size:14px;font-weight:600;color:var(--muted);margin:14px 0 6px}
input,select,textarea{
  width:100%;font-size:16px;padding:13px 14px;border:1.5px solid var(--line);
  border-radius:12px;background:#fff;color:var(--ink);min-height:52px;
}
input:focus,select:focus,textarea:focus{outline:2px solid var(--brand);border-color:var(--brand)}
input.bad{border-color:#b91c1c;background:#fef2f2}
.ferr{color:#b91c1c;font-size:13px;font-weight:600;margin:6px 0 0}
/* suggestion dropdown under a field (address autocomplete in app.js + the returning-customer
   picker on the quote form): same look everywhere, in normal flow so it pushes content down
   instead of covering it, capped in height and scrollable at 390px (0 h-scroll). */
.sugs{border:1px solid var(--line);border-radius:12px;margin-top:6px;overflow:hidden;background:#fff;max-height:46vh;overflow-y:auto}
.sug{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:2px;width:100%;
     min-height:54px;padding:10px 14px;background:#fff;color:var(--ink);text-align:left;
     border:none;border-bottom:1px solid var(--line);font-size:16px;font-weight:600;border-radius:0}
.sug:last-child{border-bottom:none}
.sug .sub{font-size:13px;font-weight:600;color:var(--muted)}
.sug.on,.sug:focus{background:var(--brand-50);box-shadow:inset 3px 0 0 var(--brand);outline:none}
textarea{min-height:88px;resize:vertical}
/* PRIMARY BUTTON = the brand ORANGE with a NAVY label (white on #FF6A00 is only
   2.9:1; navy on it is 6.1:1, so every primary button clears 4.5:1 at any size). */
button,.btn{
  display:flex;align-items:center;justify-content:center;text-align:center;gap:8px;
  width:100%;min-height:54px;padding:13px 16px;border:none;border-radius:12px;cursor:pointer;
  background:var(--brand);color:var(--navy);font-size:17px;font-weight:600;text-decoration:none;
  font-family:inherit;
}
button:active,.btn:active{transform:scale(.99);filter:brightness(.95)}
.btn.sec{background:#fff;color:var(--ink);border:1.5px solid var(--line)}
.btn.ok{background:var(--ok);color:#fff}
.btn.blue{background:var(--blue);color:#fff}
.btn.sm{min-height:46px;font-size:15px;padding:10px 12px;width:auto}
.row{display:flex;gap:10px}
.row>*{flex:1;min-width:0}
/* quote/invoice form action row: every .btn is width:100%, so a no-shrink child made
   the row's children 658px wide — Cancel poked 9px past 390px and Save was crushed to
   32px. Buttons share their row and may wrap instead. The footer now runs a PAIR
   (Save / Save and send) side by side with Cancel on its own row: at 390px each half
   gets ~151px, so both labels stay on one legible line, 0 h-scroll. */
#quote-form .row{flex-wrap:wrap}
#quote-form .row>button{flex:1 1 0 !important;min-width:0}
/* the Save / Save and send pair: 17px labels overflow a ~151px half and wrapped to two
   lines, so the pair runs 15px text + 8px side padding -> both labels ONE legible line,
   54px tall, side by side, 0 h-scroll at 390px. Cancel (own row) keeps the 17px default. */
#quote-form #q-save,#quote-form #q-send{font-size:15px;padding:13px 8px;letter-spacing:-.2px}
.stack{display:flex;flex-direction:column;gap:10px}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:10px}
/* dashboard quick actions: two rows of three (labels wrap, styling unchanged) */
.grid3{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.stat{background:var(--card);border:1px solid var(--line);border-radius:16px;padding:14px;
  display:block;text-decoration:none;color:inherit;min-height:44px;
  -webkit-tap-highlight-color:transparent}
a.stat:active{transform:scale(.98);filter:brightness(.97)}
a.stat:focus-visible{outline:3px solid var(--brand);outline-offset:2px}
/* summary tiles double as filters (invoices page) — whole tile tappable, ≥44px */
button.stat{
  width:100%;text-align:left;font-family:inherit;cursor:pointer;color:var(--ink);
  font-size:17px;line-height:1.45;
}
button.stat:active{transform:scale(.98);filter:brightness(.97)}
button.stat:focus-visible{outline:3px solid var(--brand);outline-offset:2px}
button.stat.on{
  background:var(--brand);border-color:var(--brand-d);color:var(--navy);
  box-shadow:0 0 0 2px var(--brand-d);
}
button.stat.on .k{color:rgba(13,27,42,.85)}
.stat .v{font-size:24px;font-weight:600;display:block}
.stat .k{font-size:13px;color:var(--muted);font-weight:600;display:block}
/* tappable calendar/dashboard job rows (tap -> edit view) */
.jrow{cursor:pointer;-webkit-tap-highlight-color:transparent;flex-wrap:wrap}
/* map actions get their own full-width line: "Google Maps" + "Apple Maps" sit side by
   side (~157px each at 390px) without squeezing the job text or scrolling sideways */
.jrow .mapbtns{flex:1 0 100%;margin-top:10px}
.jrow:active{background:var(--gray2)}
.jrow:focus-visible{outline:3px solid var(--brand);outline-offset:-3px;border-radius:10px}
.chip.on{background:var(--brand);border-color:var(--brand-d);color:var(--navy)}
.chip:focus-visible{outline:3px solid var(--brand);outline-offset:2px}
/* Quotes | Invoices segmented toggle (invoices page) */
.seg{display:flex;gap:0;background:var(--gray2);border:1px solid var(--line);border-radius:999px;padding:4px;margin:0 0 4px}
.seg-b{
  flex:1;min-height:44px;width:auto;padding:9px 12px;border-radius:999px;background:transparent;
  color:var(--muted);font-size:16px;font-weight:600;border:none;
}
.seg-b.on{background:var(--brand);border-color:var(--brand-d);color:var(--navy);box-shadow:0 0 0 2px var(--brand-d)}
.seg-b:focus-visible{outline:3px solid var(--brand);outline-offset:2px}
/* email send panel (Send now / Mail app / Copy) — same shell as .chase */
.mailpanel{border-top:1px solid var(--line);margin-top:12px;padding-top:12px}
.mailpanel .note{margin:0 0 10px}
.mailpanel input{min-height:50px}
.badge.accepted{background:var(--ok2);color:var(--ok)}
.badge.rejected{background:#fee2e2;color:#b91c1c}
.badge.expired{background:var(--gray2);color:var(--muted)}
.badge{display:inline-block;font-size:12px;font-weight:600;padding:4px 10px;border-radius:999px;text-transform:uppercase;letter-spacing:.4px}
.badge.paid{background:var(--ok2);color:var(--ok)}
.badge.sent{background:var(--blue2);color:var(--blue)}
.badge.draft{background:var(--gray2);color:var(--muted)}
/* quote-converted lead / e-accepted quote marker — the shared orange-tinted pill
   (structure-style: one reusable class, not a per-page one-off) */
.badge.quote{background:var(--brand-50);color:var(--navy);border:1px solid var(--brand-200)}
.badge.overdue{background:#fee2e2;color:#b91c1c}
/* Xero accounting: pushed / paid-via-Xero badges, disabled + spinner states */
.badge.xero{background:#e0f2fe;color:#0369a1}
.row .badge{align-self:center}
button:disabled,.btn:disabled{opacity:.55;cursor:not-allowed}
.btn.spin{color:transparent;pointer-events:none;position:relative}
.btn.spin::after{
  content:"";position:absolute;left:50%;top:50%;width:16px;height:16px;margin:-8px 0 0 -8px;
  border:2px solid rgba(255,255,255,.45);border-top-color:#fff;border-radius:50%;
  animation:xspin .7s linear infinite;
}
@keyframes xspin{to{transform:rotate(360deg)}}
/* payment section on an invoice view (bank transfer details + terms + card-link slot) */
.paybox{border:1px dashed var(--line);background:var(--gray2);border-radius:12px;padding:12px 14px;margin-top:12px}
.bank{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:14px;
  background:#fff;border:1px solid var(--line);border-radius:10px;padding:10px 12px;margin:8px 0;line-height:1.55}
.paybox .ph{font-size:13px;color:var(--muted);margin:8px 0 0}
.phtag{display:inline-block;background:var(--warn2);color:var(--warn);font-size:11px;font-weight:600;
  padding:2px 7px;border-radius:999px;text-transform:uppercase;letter-spacing:.4px;margin-left:4px;vertical-align:1px}
/* ---- paperwork GO: what a list row shows, the logo header, the terms footer, Pay now.
   .rowdesc only exists on rows that HAVE a description, so a row without one keeps the
   exact height it has always had; it is one line that ellipsises at 390px. */
.rowdesc{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  font-size:13px;font-weight:500;color:var(--muted);margin-top:2px}
/* logo + business name at the top of a quote/invoice view (renders only when a logo is
   uploaded — with none, the view is exactly what it was before) */
.doc-head{display:flex;align-items:center;gap:12px;margin:0 0 12px;min-width:0}
.doc-logo{display:block;max-width:120px;max-height:40px;width:auto;height:auto;border-radius:6px}
.doc-biz{font-size:16px;font-weight:600;color:var(--ink);min-width:0;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* terms + bank details footer — the on-screen twin of the PDF footer (renders only when
   terms have been written) */
.doc-foot{border-top:1px solid var(--line);margin-top:14px;padding-top:10px}
.doc-terms{margin:0 0 8px;font-size:14px;font-weight:600;color:var(--ink);white-space:pre-wrap}
.doc-bank{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:13.5px;
  color:var(--muted);line-height:1.6}
.doc-bank-l{display:block}
/* pay-by-link: a pasted URL is a plain button, nothing more (no processor, no SDK) */
.paynow{margin-top:8px}
.paynow-url{margin:6px 0 0;font-size:13px;word-break:break-all}
/* chase-payment reminder panel (WhatsApp link + copy) */
.chase{border-top:1px solid var(--line);margin-top:12px;padding-top:12px}
.chase .msg{margin:0 0 10px;font-size:15px}
.chip{display:inline-block;background:var(--gray2);border:1px solid var(--line);border-radius:999px;padding:7px 13px;font-size:14px;font-weight:600;cursor:pointer;color:var(--ink)}
/* shared filter-chip row (structure-style, reusable): the global button{width:100%}
   would stack these full-width — chips size to their label in a tappable 44px row */
.chips{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.chips>.chip{min-height:44px;width:auto;display:inline-flex;align-items:center}
.list-item{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:13px 0;border-bottom:1px solid var(--line)}
.list-item:last-child{border-bottom:none}
.list-item .t{font-weight:600}
.list-item .s{font-size:14px;color:var(--muted)}
.avatar{width:44px;height:44px;border-radius:50%;background:var(--brand);color:var(--navy);display:flex;align-items:center;justify-content:center;font-weight:600;flex:0 0 auto}
.left{display:flex;gap:12px;align-items:center;min-width:0}
.right{display:flex;flex-direction:column;align-items:flex-end;gap:6px;flex:0 0 auto}
.thumb{width:76px;height:76px;object-fit:cover;border-radius:12px;border:1px solid var(--line);background:var(--gray2)}
.photo-grid{display:flex;flex-wrap:wrap;gap:10px;margin-top:10px}
/* job detail (shared by the client detail's Job history rows): a tappable row link,
   the notes block, and the tap-to-fullscreen photo viewer */
a.list-item.job-link{text-decoration:none}
a.job-link{color:inherit;text-decoration:underline;text-decoration-color:var(--line);text-underline-offset:3px}
a.list-item:active{background:var(--gray2)}
.thumb-btn{display:inline-block;line-height:0;border-radius:12px;padding:0;border:none;background:none;cursor:pointer}
.thumb-btn:focus-visible{outline:3px solid var(--brand);outline-offset:2px}
.job-back{margin-bottom:14px}
.job-addr{margin-top:10px;font-size:16px;font-weight:600}
.job-notes{margin:0;font-size:18px;line-height:1.55;white-space:pre-wrap}
.job-actions{margin-top:4px;flex-wrap:wrap}
.pv{position:fixed;inset:0;z-index:80;background:rgba(13,27,42,.94);display:flex;
    flex-direction:column;align-items:center;justify-content:center;padding:16px;gap:10px}
.pv[hidden]{display:none}
.pv img{max-width:100%;max-height:76vh;object-fit:contain;border-radius:12px}
.pv-cap{color:#e7e5e4;font-size:14px;font-weight:600;margin:0}
.pv-x{position:absolute;top:12px;right:12px;width:48px;height:48px;border-radius:50%;
      background:rgba(255,255,255,.16);color:#fff;border:none;font-size:20px;opacity:1}
.badge.done{background:var(--ok2);color:var(--ok)}
.badge.today{background:var(--brand-100);color:var(--navy)}
.badge.booked{background:var(--blue2);color:var(--blue)}
/* Recurring job's own rule badge — its own colour so it can never read as a status
   (a job can be Completed AND repeat), and it never borrows draft/sent/accepted. */
.badge.rep{background:#f5f3ff;color:#5b21b6}
.empty{text-align:center;color:var(--muted);padding:26px 10px;font-size:15px}
.toast{position:fixed;left:50%;transform:translateX(-50%);bottom:150px;background:var(--navy);color:#fff;padding:12px 18px;border-radius:999px;font-size:15px;font-weight:600;z-index:60;opacity:0;transition:opacity .25s;pointer-events:none;max-width:92vw;text-align:center}
.toast.show{opacity:1}
/* bottom tab bar — thumb zone (7 items at 390px = 55.7px each: icon/label sized so
   every label stays on one legible line, no clipping, no horizontal scroll) */
.tabbar{
  position:fixed;left:0;right:0;bottom:0;z-index:50;background:#fff;border-top:1px solid var(--line);
  display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);padding-bottom:env(safe-area-inset-bottom);
}
.tabbar a{
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;
  min-height:62px;text-decoration:none;color:var(--muted);font-size:10px;font-weight:600;
  padding:6px 0;text-align:center;letter-spacing:-.2px;
}
.tabbar a .ic{font-size:20px;line-height:1}
.tabbar a.active{color:var(--brand)}
/* chat */
.chat-main{max-width:560px;margin:0 auto;padding:14px 14px 190px}
.thread{display:flex;flex-direction:column;gap:10px}
.bubble{max-width:86%;padding:12px 14px;border-radius:16px;font-size:16px;white-space:pre-wrap;word-wrap:break-word}
.bubble.me{align-self:flex-end;background:var(--brand);color:var(--navy);border-bottom-right-radius:4px}
.bubble.ai{align-self:flex-start;background:#fff;border:1px solid var(--line);border-bottom-left-radius:4px}
.bubble .meta{display:block;font-size:11px;opacity:.7;margin-top:6px}
.preview{background:#fff;border:1.5px solid var(--brand);border-radius:16px;padding:16px;align-self:stretch}
.preview h3{margin:0 0 4px;font-size:17px}
.li-row{display:flex;justify-content:space-between;gap:10px;padding:8px 0;border-bottom:1px dashed var(--line);font-size:15px}
.total-row{display:flex;justify-content:space-between;padding-top:10px;font-weight:600;font-size:18px}
/* VAT breakdown rows (Settings -> VAT ON): Net / VAT 20% sit above the Gross total */
.vat-row{font-weight:600;color:#57534e}
.src{font-size:12px;font-weight:600;padding:4px 10px;border-radius:999px;display:inline-block;margin-bottom:8px}
.src.openai{background:var(--ok2);color:var(--ok)}
.src.fallback{background:var(--warn2);color:var(--warn)}
/* intent-matched guidance note (orange wash, navy text) + preview action row */
.note{background:var(--brand-50);border:1px solid var(--brand-200);color:var(--navy);border-radius:12px;
  padding:10px 12px;font-size:14px;line-height:1.4;font-weight:600;margin-top:12px}
.prow .btn{font-size:15px;padding:12px 6px;letter-spacing:-.2px}
.prow .btn.ok,.prow .btn.blue{font-size:15px}
/* in-place amend form */
.amend-form label{margin:12px 0 6px}
.amend-form input{font-size:16px}
.lines{display:flex;flex-direction:column;gap:10px}
/* line-item editor — compact 2-line row so no box is ever a guess at 390px:
   line 1 = description + remove, line 2 = Qty | £ each | Amount with a VISIBLE label
   on every box (the Amount box is a read-only qty × unit display) */
.li-edit{display:grid;grid-template-columns:minmax(0,1fr) 44px;gap:6px;align-items:start}
.li-edit .li-desc{grid-column:1;grid-row:1}
.li-edit .rm{grid-column:2;grid-row:1;width:44px;min-width:44px;min-height:52px;padding:0;font-size:16px}
.li-q3{grid-column:1/-1;display:grid;grid-template-columns:minmax(0,84px) minmax(0,1fr) minmax(0,1fr);gap:6px}
.li-f{display:flex;flex-direction:column;min-width:0}
.li-l{font-size:12px;font-weight:600;color:var(--muted);letter-spacing:.2px;margin:0 0 3px}
.li-edit input{min-height:52px;padding:9px 8px;font-size:16px}
.li-edit input[readonly]{background:var(--gray2);border-style:dashed;font-weight:600;color:var(--ink)}
.li-edit .li-qerr{grid-column:1/-1;margin:0}
/* read-mode rows: the amount side never wraps, the description takes the rest */
.li-row span:first-child{min-width:0}
.li-row .li-amt{flex:0 0 auto;white-space:nowrap;font-weight:600}
.live-total-row{border-top:1px solid var(--line);margin-top:10px}
.composer{
  position:fixed;bottom:calc(62px + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);
  width:100%;max-width:560px;background:#fff;border-top:1px solid var(--line);
  padding:10px 12px;display:flex;gap:9px;z-index:55;
}
.composer input{min-height:52px;border-radius:999px;padding-left:18px}
.composer button{width:54px;min-width:54px;height:52px;border-radius:50%;padding:0;flex:0 0 auto;font-size:20px}
/* landing — navy hero band, orange CTA, white cards (the board's palette) */
.hero{background:var(--navy);color:#fff;padding:48px 20px 40px;text-align:center}
.hero h1{font-size:34px;margin:0 0 12px;line-height:1.15;font-weight:600}
/* the board's tagline, sitting in the hero's own copy stack: white with the
   ORANGE full stop (the one punctuation mark the brand colours) */
.hero .tagline{font-size:15px;font-weight:600;letter-spacing:.16em;margin:0 auto 16px;
  max-width:none;opacity:1;color:#fff}
.hero .tagline .dot{color:var(--brand)}
.hero p{font-size:18px;opacity:.95;margin:0 auto 26px;max-width:480px;font-weight:500}
.hero .btn{max-width:340px;margin:0 auto;background:var(--brand);color:var(--navy);font-size:19px;min-height:58px;font-weight:600}
.eyebrow{display:inline-block;background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.35);border-radius:999px;padding:6px 14px;font-size:13px;font-weight:600;margin-bottom:18px}
.features{max-width:560px;margin:0 auto;padding:30px 16px 10px}
/* the board's mission sentence, leading the existing feature stack (no new section) */
.features .mission{margin:0 auto 18px;max-width:470px;text-align:center;font-size:17px;
  font-weight:600;color:var(--navy);line-height:1.5}
.feature{display:flex;gap:14px;align-items:flex-start;background:#fff;border:1px solid var(--line);border-radius:16px;padding:16px;margin-bottom:12px}
.feature .fic{font-size:26px}
.feature h3{margin:0 0 4px;font-size:17px;font-weight:600}
.feature p{margin:0;font-size:15px;color:var(--muted);font-weight:500}
/* the board's five feature lines lead the cards they belong to — navy, so the
   line reads first and the detail follows */
.feature p b{color:var(--navy);font-weight:600}
.landing-cta{max-width:560px;margin:0 auto;padding:8px 16px 40px;text-align:center}
/* footer = a dark surface: navy band, white copy, orange links */
footer.site{background:var(--navy);color:#fff;text-align:center;font-size:13px;
  padding:20px 16px 30px;font-weight:500}
footer.site a{color:var(--brand);text-decoration:underline;text-decoration-color:var(--brand)}
/* misc */
details{background:#fff;border:1px solid var(--line);border-radius:16px;padding:0 16px;margin-bottom:12px}
summary{cursor:pointer;font-weight:600;padding:16px 0;min-height:52px;display:flex;align-items:center;justify-content:space-between;gap:10px}
details[open] summary{border-bottom:1px solid var(--line);margin-bottom:8px}
details .inner{padding-bottom:16px}
.daynav{display:flex;gap:10px;align-items:center}
.daynav button{width:54px;min-width:54px;flex:0 0 auto;font-size:20px;padding:0}
.daynav .d{flex:1;text-align:center;font-weight:600;font-size:16px}
.hidden{display:none!important}
/* month grid — fits 390px, cells ≥44px, no horizontal scroll */
.mgrid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:2px;margin-top:10px}
.mgrid .wd{text-align:center;font-size:10.5px;font-weight:600;color:var(--muted);text-transform:uppercase;letter-spacing:.3px;padding:2px 0}
.mcell{
  position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;
  min-height:46px;padding:2px 0;border:1.5px solid var(--line);border-radius:10px;background:#fff;
  font-family:inherit;font-size:14px;font-weight:600;color:var(--ink);cursor:pointer;
}
.mcell:active{transform:scale(.96)}
.mcell .dn{line-height:1}
.mcell .cnt{
  min-width:16px;height:16px;padding:0 3px;border-radius:999px;background:var(--brand);color:var(--navy);
  font-size:10px;font-weight:600;line-height:16px;text-align:center;
}
.mcell.out{background:transparent;border-color:transparent;color:var(--muted);opacity:.5}
.mcell.today{background:var(--brand);border-color:var(--brand-d);color:var(--navy);box-shadow:0 0 0 2px var(--brand-d)}
.mcell.today .cnt{background:#fff;color:var(--brand-d)}
.mcell.sel{border-color:var(--brand);box-shadow:inset 0 0 0 1px var(--brand)}
.mcell.today.sel{box-shadow:0 0 0 2px var(--brand-d),inset 0 0 0 1px #fff}
/* ---- Reports (mobile-first, 390px): section chips + fixed-layout tables ----------
   table-layout:fixed + colgroup + nowrap/ellipsis inside the card means a table can
   never push the PAGE sideways — the "0 horizontal scroll at 390px" rule every suite
   asserts. Money cells are right-aligned, tabular-nums, bold; totals row is heavier. */
.rnav{display:flex;flex-wrap:wrap;gap:8px;margin:2px 0 14px}
.rnav .chip{text-decoration:none;min-height:40px;display:inline-flex;align-items:center}
/* 6 narrow columns have to fit a 390px phone: 12.5px tabular numerals, 2px gutters,
   and ONLY the label column wraps — money cells stay on one line (ellipsis as a last
   resort, never a page-level sideways scroll). */
.rtab{width:100%;border-collapse:collapse;table-layout:fixed;font-size:12.5px;font-variant-numeric:tabular-nums}
.rtab th,.rtab td{padding:7px 2px;text-align:right;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;border-bottom:1px solid var(--line)}
.rtab th:first-child,.rtab td:first-child{text-align:left;white-space:normal;overflow-wrap:anywhere}
.rtab th{font-size:10px;letter-spacing:.01em;text-transform:uppercase;color:var(--muted);font-weight:600}
.rtab td.num{font-weight:600}
.rtab tbody tr:last-child td{border-bottom:none}
.rtab tfoot td{border-top:2px solid var(--line);border-bottom:none;font-weight:600}
.rtools{display:flex;gap:8px;align-items:center;justify-content:space-between;flex-wrap:wrap;margin:0 0 10px}
.rtools .chips{display:flex;gap:8px;flex-wrap:wrap}
.rtools .chip{padding:6px 11px;font-size:13px}
.card-h{display:flex;gap:8px;align-items:center;justify-content:space-between;flex-wrap:wrap;margin-bottom:8px}
.banner{border-radius:14px;padding:12px 14px;margin:0 0 14px;background:var(--warn2);border:1px solid #fcd34d;color:#78350f;font-size:15px;line-height:1.4}
.banner b{display:block;font-size:15.5px;margin-bottom:3px;font-weight:600}
.kv{display:flex;justify-content:space-between;gap:12px;align-items:baseline;padding:9px 0;border-bottom:1px dashed var(--line);font-size:15.5px}
.kv:last-child{border-bottom:none}
.kv b{font-variant-numeric:tabular-nums;white-space:nowrap}
/* ---- SECTION CARDS (GO: "too much going on — please set borders") ---------------
   ONE reusable treatment for stacked content blocks, declared once here and applied
   on every screen so a block never bleeds into the next one. Values are the .card
   family's own so panels and cards read as one system:
     border  : 1px solid var(--line)   (existing palette hairline)
     radius  : 16px                    (matches .card)
     padding : 14px                    (internal padding, all four sides)
     gap     : margin 0 0 14px         (vertical gap to the next card)
     header  : a leading <h2> inside the panel is the optional card label
               (its margins reset so it sits as a header, not as page furniture)
   A block INSIDE a section card is a ROW of that panel, not a second box: .card and
   <details> descendants drop their own border/fill/padding and split on a 1px
   divider instead — one border per section, never box-in-box. Interactive units
   (.stat tiles, .btn, .chip, .seg) keep their own affordance so taps, focus rings
   and the active (orange) states are untouched. Nav bars, topbars, composers and
   page <h1> stay OUTSIDE cards — cards are for content blocks only. */
.section-card{
  background:var(--card);border:1px solid var(--line);border-radius:16px;
  padding:14px;margin:0 0 14px;
}
.section-card>h2:first-child{margin:0 0 10px}
.section-card .card,.section-card details{
  border:none;background:transparent;border-radius:0;padding:14px 0;margin:0;
}
.section-card .card:not([hidden])+.card,
.section-card details+details{border-top:1px solid var(--line)}
.section-card .card:first-child,.section-card details:first-child{padding-top:0}
.section-card .card:last-child,.section-card details:last-child{padding-bottom:0}
/* summary tiles inside a panel are SEGMENTS of that panel, not second boxes — the
   double border was the noise GO saw. The active (orange) tile keeps its own lit
   styling, and every tile keeps its size/tap target. */
.section-card>.stat:not(.on),
.section-card>.grid2>.stat:not(.on),
.section-card>.grid3>.stat:not(.on){border:none;background:var(--gray2)}
/* grids / toolbars inside a panel: the panel owns the outer gap */
.section-card>.grid2,.section-card>.grid3,.section-card>.row,
.section-card>.rnav{margin-bottom:0}
@media (min-width:640px){
  body{padding-bottom:100px}
  .hero h1{font-size:44px}
}

/* ------------------------------------------------- signed-in account + read-only mode
   .tb-acct = the "Sign out" pill the server's signed-in pages get (topbar, before the
   gear — brand + Demo tag + sign out + gear must still fit 390px with no h-scroll).
   .viewer  = the MIRROR of the viewer's read-only role: every action button is visible
   but locked and dimmed, so the page never offers what the server would refuse (the
   server refuses it anyway — see the middleware). */
/* signed in: brand + Demo tag + this pill + the bell/gear group must all sit on ONE
   390px row, so the pill stays small (11px type, tight padding) — it still reads as
   words, never an icon-only mystery button. */
.topbar .tb-acct{
  flex:0 0 auto;width:auto;          /* the global full-width button rule must not stretch it */
  min-height:40px;padding:8px;cursor:pointer;
  border-radius:999px;background:rgba(255,255,255,.15);color:#fff;
  font-size:11px;font-weight:600;line-height:1;letter-spacing:.01em;white-space:nowrap;
}
.topbar .tb-acct:active{background:rgba(255,255,255,.34)}
.viewer main button{opacity:.5;cursor:not-allowed}
.viewer main button:disabled{opacity:.5}

/* Team (Settings): one row per person — who, role, state, then the owner's controls.
   Wraps cleanly at 390px, never scrolls sideways. */
.team-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap;
  padding:11px 0;border-top:1px solid var(--line)}
.team-row:first-child{border-top:0;padding-top:2px}
.team-who{flex:1 1 150px;min-width:0;display:flex;flex-direction:column;gap:1px}
.team-who b{font-size:15px;font-weight:600}
.team-who .muted{font-size:13px;word-break:break-all}
.team-state{flex:1 1 100%;font-size:13px}
.team-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;flex:1 1 auto}
.team-actions select{flex:1 1 120px;min-height:46px;min-width:0}
.team-actions .btn.sm{flex:1 1 110px;min-width:0}
