@import url("doc.css");
:root {
  --signal: #4338F2; --signal-strong: #2F23C9; --tint: #EEEDFF; --tint-2: #DCD9FF; --saffron: #FFB21E;
  --paper: #FAF9FD; --paper-2: #F1EFFA; --ink: #13112A; --muted: #67647F; --line: #E6E3F0;
  --card: #fff; --warn: #C4522A; --warn-tint: #FBEDE6; --ok: #1f8a4c; --radius: 12px;
  --shadow: 0 1px 2px rgba(19,17,42,.05), 0 2px 8px rgba(19,17,42,.05);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Sora", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.5 var(--font); }
a { color: var(--signal); }
h1 { font: 700 26px/1.2 var(--font-display); letter-spacing: -.02em; margin: 0; }
h2 { font-size: 16px; margin: 0 0 12px; display: flex; gap: 10px; align-items: baseline; justify-content: space-between; }
h3 { font-size: 15px; margin: 0 0 10px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .center { text-align: center; } .warn { color: var(--warn); }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 20px 16px 110px; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 10px 16px; background: var(--signal); color: #fff; }
.brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 17px; display: flex; gap: 6px; align-items: center; }
.public .brand { color: var(--signal); }
.brand-mark { font-size: 20px; }
.company-name { opacity: .75; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 30vw; }
.topnav { display: flex; gap: 2px; margin-left: auto; }
.topnav a { color: #fff; text-decoration: none; padding: 7px 11px; border-radius: 8px; opacity: .85; font-size: 14px; }
.topnav a.on, .topnav a:hover { background: rgba(255,255,255,.14); opacity: 1; }
.usermenu { position: relative; }
.usermenu summary { list-style: none; cursor: pointer; width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.2); display: grid; place-items: center; font-weight: 700; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu .menu { position: absolute; right: 0; top: 42px; background: #fff; color: var(--ink); border-radius: 10px; box-shadow: 0 8px 30px rgba(0,0,0,.15); padding: 10px; min-width: 200px; display: flex; flex-direction: column; gap: 2px; }
.usermenu .menu a, .usermenu .menu button { color: var(--ink); text-decoration: none; padding: 7px 8px; border-radius: 6px; text-align: left; }
.usermenu .menu a:hover, .usermenu .menu button:hover { background: var(--tint); }
.mobile-only { display: none; }
.impersonate { background: var(--warn); color: #fff; text-align: center; padding: 6px; font-size: 13px; }

/* Bottom nav (phone) */
.bottomnav { display: none; }
@media (max-width: 820px) {
  .topnav, .company-name { display: none; }
  .usermenu { margin-left: auto; }
  .mobile-only { display: block; }
  .bottomnav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; background: #fff; border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; align-items: center; }
  .bottomnav a { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); text-decoration: none; font-size: 11px; min-width: 56px; }
  .bottomnav a.on { color: var(--signal); }
  .bottomnav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .bottomnav .fab { order: 2; width: 52px; height: 52px; min-width: 52px; border-radius: 50%; background: var(--signal); color: #fff; font-size: 30px; line-height: 1; justify-content: center; margin-top: -26px; box-shadow: 0 4px 14px rgba(15,95,74,.4); }
  .bottomnav a:nth-child(3), .bottomnav a:nth-child(4) { order: 3; }
}

/* Page */
.pagehead { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.pagehead h1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card.narrow { max-width: 640px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid2 > .card, .grid3 > .card { margin-bottom: 0; }
.grid2 + .grid2, .grid2 + .card, .card + .grid2 { margin-top: 16px; }
@media (max-width: 820px) { .grid2, .grid3 { grid-template-columns: 1fr; gap: 0 12px; } .grid2 > .card { margin-bottom: 16px; } }

.flash { padding: 11px 14px; border-radius: 10px; margin-bottom: 14px; background: var(--tint); border: 1px solid var(--tint-2); }
.flash-error { background: var(--warn-tint); border-color: #f0c9b7; color: #7a2e12; }
.notice { display: block; padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; background: var(--paper-2); color: var(--ink); text-decoration: none; border: 1px solid #e9dfc3; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); }
.stat span { font-size: 13px; color: var(--muted); }
.stat b { font-size: 21px; font-variant-numeric: tabular-nums; }
.stat-warn { border-color: #f0c9b7; background: var(--warn-tint); }
.stat-warn b { color: var(--warn); }
@media (max-width: 820px) { .stats { grid-template-columns: 1fr 1fr; } .stat b { font-size: 17px; } }

/* Lists */
.list { display: flex; flex-direction: column; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid #f0eee6; color: var(--ink); text-decoration: none; }
.row:last-child { border-bottom: 0; }
a.row:hover { background: #fafaf5; }
.row.dim, tr.dim { opacity: .5; }
.empty { text-align: center; padding: 24px 8px; color: var(--muted); }
.tag { background: var(--tint); color: var(--signal-strong); padding: 1px 6px; border-radius: 4px; font-size: 11px; }
.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: #eceae2; color: #555; vertical-align: middle; font-family: -apple-system, sans-serif; }
.badge-paid { background: #dff3e6; color: #17693a; }
.badge-overdue { background: var(--warn-tint); color: var(--warn); }
.badge-issued { background: #e6eef8; color: #2b5a8f; }
.badge-part_paid { background: #fff2d6; color: #8a5a00; }
.badge-draft { background: #eceae2; color: #555; }
.badge-credited, .badge-credit_note { background: #ececec; color: #666; }
.tabs { display: flex; gap: 4px; overflow-x: auto; margin-bottom: 12px; }
.tabs a { padding: 7px 12px; border-radius: 99px; text-decoration: none; color: var(--ink); white-space: nowrap; font-size: 14px; }
.tabs a.on { background: var(--signal); color: #fff; }
.tabs small { opacity: .6; }
.search { margin-bottom: 12px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 6px; border-bottom: 1px solid var(--line); }
.table td { padding: 8px 6px; border-bottom: 1px solid #f0eee6; }
.section-scroll { overflow-x: auto; }

/* Forms */
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 500; margin-bottom: 12px; }
input, select, textarea { font: inherit; font-size: 16px; padding: 10px 11px; border: 1px solid #d6d3c8; border-radius: 9px; background: #fff; color: var(--ink); width: 100%; min-height: 44px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--tint-2); border-color: var(--signal); }
input[type=color] { padding: 3px; }
input[disabled] { background: #f4f3ee; }
.form label.check, label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
label.check input { width: 20px; min-height: 20px; }
.inline { display: flex; gap: 8px; }
.inline select { flex: 1; }
.hp { position: absolute; left: -9999px; }
.segmented { display: flex; background: #f1efe6; border-radius: 10px; padding: 3px; margin-bottom: 14px; }
.segmented label { flex: 1; margin: 0 !important; }
.segmented input { display: none; }
.segmented span { display: block; text-align: center; padding: 8px; border-radius: 8px; cursor: pointer; font-weight: 500; }
.segmented input:checked + span { background: #fff; box-shadow: var(--shadow); color: var(--signal); }
.logo-prev { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.logo-prev img { max-height: 40px; max-width: 140px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 9px 16px; border-radius: 10px; border: 1px solid #d6d3c8; background: #fff; color: var(--ink); font: 500 15px/1 inherit; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--signal); }
.btn-primary { background: var(--signal); color: #fff; border-color: var(--signal); }
.btn-primary:hover { background: var(--signal-strong); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-danger-ghost { color: var(--warn); }
.btn-sm { min-height: 32px; padding: 6px 10px; font-size: 13px; }
.btn-lg { min-height: 50px; padding: 12px 22px; font-size: 16px; }
.btn-block { width: 100%; }
.linklike { background: none; border: 0; color: var(--signal); cursor: pointer; padding: 0; font: inherit; }
.inline-form { display: inline; }
.actions-col { display: flex; flex-direction: column; gap: 8px; }
.actions-col form { margin: 0; }
.stickybar { position: sticky; bottom: 0; display: flex; gap: 8px; justify-content: flex-end; padding: 12px 0; background: linear-gradient(transparent, var(--paper) 30%); z-index: 5; }
@media (max-width: 820px) { .stickybar { bottom: 64px; flex-wrap: wrap; } .stickybar .btn { flex: 1; } }

/* Invoice editor */
.quickadd { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.chip { border: 1px solid var(--tint-2); background: var(--tint); color: var(--signal-strong); border-radius: 99px; padding: 8px 12px; font: 500 14px inherit; cursor: pointer; min-height: 38px; }
.lines { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.line { display: grid; grid-template-columns: 1fr 80px 80px 120px 90px 110px 36px; gap: 6px; align-items: center; }
.line-head { font-size: 12px; color: var(--muted); }
.l-del { border: 0; background: none; font-size: 22px; color: var(--muted); cursor: pointer; min-height: 44px; }
.totals { margin-left: auto; max-width: 320px; }
.totals div { display: flex; justify-content: space-between; padding: 4px 0; }
.totals .grand { border-top: 2px solid var(--ink); margin-top: 4px; padding-top: 8px; font-size: 19px; }
@media (max-width: 820px) {
  .line-head { display: none; }
  .line { grid-template-columns: 1fr 1fr 1fr; padding: 10px; background: #fafaf5; border-radius: 10px; border: 1px solid #efece2; }
  .l-desc { grid-column: 1 / -1; }
  .l-total { grid-column: 1 / 3; font-weight: 600; text-align: left; }
  .l-del { justify-self: end; }
  .totals { max-width: none; }
}

/* Invoice page */
.invoice-layout { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
.doc-wrap { overflow-x: auto; background: #e9e7df; border-radius: var(--radius); padding: 18px; }
.doc-wrap .doc { margin: 0 auto; box-shadow: 0 2px 12px rgba(0,0,0,.1); }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid #f3f1ea; font-size: 14px; }
.kv span { color: var(--muted); }
.kv b { text-align: right; font-weight: 500; }
.kv-big b { font-size: 18px; font-weight: 700; }
.timeline { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.timeline li { padding: 6px 0 6px 14px; border-left: 2px solid var(--tint-2); }
.note-internal { margin: 12px 0; padding: 10px; background: var(--paper-2); border-radius: 8px; font-size: 14px; }
@media (max-width: 1000px) {
  .invoice-layout { grid-template-columns: 1fr; }
  .side { order: -1; }
  .doc-wrap { padding: 8px; }

}


/* Public */
.pubbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; max-width: 1180px; margin: 0 auto; }
.pubbar nav { display: flex; gap: 14px; align-items: center; }
.pubbar nav a { text-decoration: none; color: var(--ink); font-size: 14px; }
.pubbar nav a.on { font-weight: 700; color: var(--signal); }
.pubbar .btn-primary { color: #fff; }
.hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; padding-top: 40px; padding-bottom: 40px; }
.hero h1 { font-size: 44px; line-height: 1.1; margin: 8px 0 16px; }
.eyebrow { color: var(--signal); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; font-size: 13px; margin: 0; }
.lead { font-size: 18px; color: #3b4348; }
.hero-card { background: var(--tint); border-radius: 20px; padding: 32px; }
.mini-inv { background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 10px 30px rgba(67,56,242,.18); }
.mini-head { display: flex; justify-content: space-between; margin-bottom: 14px; }
.mini-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid #f0eee6; font-size: 14px; }
.mini-row.total { border: 0; border-top: 2px solid var(--ink); font-weight: 700; font-size: 16px; margin-top: 6px; }
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; padding-top: 10px; padding-bottom: 30px; }
.features h3 { color: var(--signal); }
.features p { color: #3b4348; margin: 0; font-size: 14px; }
.pricing { padding-top: 10px; padding-bottom: 20px; }
.pricing h2 { font: 600 28px "Iowan Old Style", Georgia, serif; justify-content: center; }
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.plan { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 24px; }
.plan-hl { border: 2px solid var(--signal); }
.price { font-size: 34px; font-weight: 700; }
.price small { font-size: 14px; color: var(--muted); font-weight: 400; }
.plan ul { padding-left: 18px; color: #3b4348; }
.pubfoot { padding-bottom: 30px; text-align: center; }
.authbox { max-width: 420px; margin: 30px auto; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 28px; }
.authbox h1 { margin-bottom: 18px; }
@media (max-width: 820px) {
  .hero, .features, .plans { grid-template-columns: 1fr; }
  .hero h1 { font-size: 32px; }
  .hero { padding-top: 10px; }
  .authbox { margin: 10px 16px; padding: 20px; }
  .pubbar nav { gap: 10px; }
}

/* Quotes */
.public-quote { max-width: 900px; margin: 0 auto; }
.answer-box .inline { flex-wrap: wrap; }
.answer-box .btn { flex: 1; }
details.answer summary { list-style: none; }
details.answer summary::-webkit-details-marker { display: none; }
details.answer[open] summary { margin-bottom: 10px; }
.checks { text-align: left; display: inline-block; margin: 0 auto 16px; padding-left: 20px; }
.badge-sent { background: #e6eef8; color: #2b5a8f; }
.badge-accepted, .badge-invoiced { background: #dff3e6; color: #17693a; }
.badge-declined, .badge-expired { background: #ececec; color: #666; }
.nav-lock { font-size: 11px; opacity: .7; }

/* Sign-up: CVR lookup + activation */
.cvr-result { background: var(--tint); border: 1px solid var(--tint-2); border-radius: 10px; padding: 10px 12px; margin: -4px 0 12px; font-size: 14px; }
.cvr-result.err { background: var(--warn-tint); border-color: #f0c9b7; color: #7a2e12; }
.big-icon { font-size: 44px; }
.cvr-tip { display: block; margin: -6px 0 12px; }
.biz-only .cvr-result { margin-top: 0; }

/* ===================================================================================
   App shell v2 (2026-11-07): dark sidebar layout from the FM prototype, a1RepairFlow green.
   =================================================================================== */
body.app {
  --bg: #F6F5FB; --ink: #13112A; --line: #E6E3F0; --muted: #6B6888; --card: #fff;
  --side: #13112A; --side-hover: #221F45; --side-text: #CBC7EA; --side-cnt: #2E2A5C;
  --blue: #4338F2; --blue-d: #2F23C9; --blue-l: #EEEDFF;
  --ok: #1f9d55; --ok-l: #e6f6ec; --bad: #d64545; --bad-l: #fdeaea; --warn: #d97706; --warn-l: #fdf3e1;
  --radius: 12px; --shadow: none;
  background: var(--bg); color: var(--ink);
}
body.app h1 { font: 700 26px/1.2 var(--font-display); letter-spacing: -.02em; }
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.main { padding: 26px 30px 60px; min-width: 0; max-width: 1240px; }

/* Sidebar */
.sidebar { background: var(--side); color: var(--side-text); padding: 16px 12px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow-y: auto; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; color: #fff; text-decoration: none; font-weight: 800; font-size: 14px; line-height: 1.25; }
.side-brand img { height: 32px; max-width: 80px; object-fit: contain; border-radius: 4px; background: #fff1; }
.side-brand .brand-mark { width: 30px; height: 30px; flex: none; }
.side-brand .oltara-word { font: 700 19px/1 var(--font-display); letter-spacing: -.03em; }
.sidebar nav { display: flex; flex-direction: column; }
.sidebar a.nv { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; color: var(--side-text); text-decoration: none; font-weight: 500; font-size: 14.5px; margin-bottom: 2px; }
.sidebar a.nv:hover { background: var(--side-hover); color: #fff; }
.sidebar a.nv.on { background: var(--signal); color: #fff; }
.sidebar a.nv .ic { width: 20px; text-align: center; font-size: 15px; }
.sidebar a.nv .cnt { margin-left: auto; background: var(--side-cnt); color: #fff; border-radius: 10px; font-size: 11px; padding: 1px 7px; font-weight: 600; }
.sidebar a.nv.on .cnt { background: rgba(255,255,255,.22); }
.side-new { margin: 14px 4px 0; }
.side-foot { margin-top: auto; padding-top: 16px; }
.side-foot .usermenu summary { width: auto; height: auto; border-radius: 10px; background: none; display: flex; gap: 10px; align-items: center; padding: 8px; color: #fff; }
.side-foot .usermenu summary:hover { background: var(--side-hover); }
.side-foot .who { display: flex; flex-direction: column; min-width: 0; font-size: 13px; }
.side-foot .who small { color: #8a96a5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.usermenu.up .menu { top: auto; bottom: 52px; left: 0; right: auto; }
.avatar { width: 32px; height: 32px; min-width: 32px; border-radius: 50%; background: var(--signal); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.powered { display: flex; align-items: center; gap: 7px; padding: 10px 8px 0; color: #8C88B5; font: 700 13px/1 var(--font-display); letter-spacing: -.02em; }
.powered img { width: 18px; height: 18px; opacity: .9; }
.mtop { display: none; }

/* Cards: header row like the prototype (.card > h2 becomes the header bar) */
body.app .card { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: none; }
body.app .card > h2:first-child, body.app .card > .card-hd:first-child { margin: -16px -16px 14px; padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 16px; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
body.app .card > h2:first-child a { font-size: 13px; font-weight: 600; }
body.app .card.flush { padding: 0; overflow: hidden; }
body.app .card.flush > h2:first-child { margin: 0; }

/* KPI cards */
.hello { margin-bottom: 18px; }
.hello h1 { margin: 0; }
.hello p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
body.app .stats { gap: 14px; margin-bottom: 22px; }
body.app .stat { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: none; gap: 2px; }
body.app .stat span { font-size: 13px; font-weight: 600; color: var(--muted); }
body.app .stat b { font-size: 26px; font-weight: 800; letter-spacing: -.01em; }
body.app .stat small { font-size: 12px; color: var(--muted); }
body.app .stat-warn { background: #fff; border-color: var(--line); }
body.app .stat-warn b { color: var(--bad); }
body.app .stat-ok b { color: var(--ok); }

/* Tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: 10px 16px; border-bottom: 1px solid var(--line); background: #fbfcfd; white-space: nowrap; }
.tbl td { padding: 12px 16px; border-bottom: 1px solid #eef1f4; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl th.num, .tbl td.num { text-align: right; }
.tbl tr.link { cursor: pointer; }
.tbl tr.link:hover td { background: #f8fafb; }
.tbl td a.rowlink { color: inherit; text-decoration: none; font-weight: 600; }
.tbl .sub { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.only-mob { display: none; }

/* Pills (status) */
body.app .badge { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 20px; }
body.app .badge-paid, body.app .badge-accepted, body.app .badge-invoiced { background: var(--ok-l); color: var(--ok); }
body.app .badge-issued, body.app .badge-sent { background: var(--blue-l); color: var(--blue-d); }
body.app .badge-overdue { background: var(--bad-l); color: var(--bad); }
body.app .badge-part_paid { background: var(--warn-l); color: var(--warn); }
body.app .badge-draft, body.app .badge-credited, body.app .badge-credit_note, body.app .badge-declined, body.app .badge-expired { background: #eef1f4; color: #57606a; }

/* Buttons, forms, tabs in the new palette */
body.app .btn { border-color: var(--line); border-radius: 9px; font-weight: 600; }
body.app .btn-primary { background: var(--signal); border-color: var(--signal); color: #fff; }
body.app input, body.app select, body.app textarea { border-color: #d5dbe1; }
body.app .tabs a { background: #fff; border: 1px solid var(--line); }
body.app .tabs a.on { background: var(--ink); border-color: var(--ink); color: #fff; }
body.app .row { border-bottom-color: #eef1f4; }
body.app .stickybar { background: linear-gradient(transparent, var(--bg) 30%); }
body.app .doc-wrap { background: #e9edf1; }
body.app .notice { background: var(--warn-l); border-color: #f5d9a8; }

/* Phones: sidebar → slim top bar + bottom nav */
@media (max-width: 820px) {
  .shell { display: block; }
  .sidebar { display: none; }
  .mtop { display: flex; position: sticky; top: 0; z-index: 20; align-items: center; justify-content: space-between; background: var(--side); padding: 8px 12px; }
  .mtop .side-brand { padding: 0; }
  .mtop .usermenu summary { background: none; width: auto; height: auto; }
  .main { padding: 16px 16px 110px; }
  .only-desk { display: none; }
  .only-mob { display: block; }
  body.app .stat b { font-size: 19px; }
  .bottomnav a { position: relative; }
  .bottomnav .dot { position: absolute; top: -2px; right: 12px; background: var(--bad); color: #fff; font-style: normal; font-size: 10px; border-radius: 8px; padding: 0 5px; }
}
@media (min-width: 821px) { .bottomnav { display: none !important; } }
body.app .card.flush .list .row { padding: 11px 16px; }
body.app .card.flush .empty { padding: 28px 16px; }
.tbl .warn { color: var(--bad); }
body.app .stat b { white-space: nowrap; font-size: clamp(18px, 1.9vw, 26px); }
body.app .card.flush { overflow-x: auto; }
.tbl td.num, .tbl th { white-space: nowrap; }
@media (max-width: 1100px) and (min-width: 821px) {
  .shell { grid-template-columns: 200px 1fr; }
  .main { padding: 22px 20px 60px; }
  body.app .stats { grid-template-columns: repeat(2, 1fr); }
  .tbl th, .tbl td { padding: 10px 10px; }
}
.side-brand span { min-width: 0; overflow-wrap: anywhere; }

/* Proof photos */
.photos-card { padding: 0 !important; }
.photos-card > summary { list-style: none; cursor: pointer; padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; font-weight: 600; }
.photos-card > summary::-webkit-details-marker { display: none; }
.photos-card > summary::after { content: '▾'; color: var(--muted); margin-left: 8px; }
.photos-card[open] > summary { border-bottom: 1px solid var(--line); }
.photos-card .photos { padding: 14px 16px 16px; }
.photos .muted.small { margin-top: 0; }
.ph-add { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.ph-pick { cursor: pointer; }
.ph-qrbox { display: flex; gap: 12px; align-items: center; padding: 10px; border: 1px dashed #cfd6dd; border-radius: 10px; max-width: 360px; }
.ph-qr { width: 132px; height: 132px; flex: none; }
.ph-qr img, .ph-qr canvas { width: 132px; height: 132px; }
.ph-status { margin: 10px 0 4px; min-height: 1em; }
.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.ph { position: relative; margin: 0; background: #f1f4f7; border-radius: 10px; overflow: hidden; }
.ph img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.ph figcaption { font-size: 11px; color: var(--muted); padding: 4px 6px; }
.ph-del { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 16px; line-height: 1; cursor: pointer; }
.ph-attach { margin-top: 12px; }
.phone-up { max-width: 480px; margin: 0 auto; }
.phone-up h1 { font-size: 24px; }

/* Subscriptions */
.sub-grid { align-items: start; grid-template-columns: 1.3fr 1fr; }
.sub-h2 { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.send-mode { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 0 0 12px; }
.send-mode legend { font-size: 13px; font-weight: 600; padding: 0 4px; }
.send-mode label.check { align-items: flex-start; margin: 6px 0; }
@media (max-width: 820px) { .sub-grid { grid-template-columns: 1fr; } }
.photo-page { max-width: 1000px; margin: 0 auto; }
.pp-head { display: flex; gap: 16px; align-items: center; margin: 10px 0 18px; }
.pp-logo { max-height: 56px; max-width: 160px; }
.pp-head h1 { margin: 0; font-size: 26px; }
.pp-head p { margin: 4px 0 0; }
.pp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-bottom: 20px; }
.pp-grid figure { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.pp-grid img { display: block; width: 100%; height: auto; }
.pp-grid figcaption { padding: 8px 12px; font-size: 13px; color: var(--muted); }

/* Mobile job app (/m) */
body.mapp { background: var(--bg); }
.m-top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px; background: #0b0f14; color: #fff; padding: 12px 14px; padding-top: max(12px, env(safe-area-inset-top)); }
.m-top a { color: #fff; text-decoration: none; }
.m-back { font-size: 30px; line-height: 1; width: 24px; }
.m-title { flex: 1; font-weight: 700; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-office { font-size: 18px; opacity: .8; }
.m-main { max-width: 560px; margin: 0 auto; padding: 14px 14px 40px; }
.m-hello { font-size: 20px; font-weight: 800; margin: 4px 0 14px; }
.m-hello small { font-size: 13px; font-weight: 500; }
.m-h { font-size: 15px; margin: 18px 0 8px; display: flex; gap: 6px; align-items: baseline; }
.m-job { display: flex; justify-content: space-between; gap: 10px; text-decoration: none; color: var(--ink); margin-bottom: 10px; padding: 14px !important; }
.m-job-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.m-job-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; white-space: nowrap; }
.m-cust h2 { margin: 0 0 8px !important; padding: 0 !important; border: 0 !important; font-size: 19px; }
.m-line { display: block; padding: 6px 0; color: var(--ink); text-decoration: none; border-top: 1px solid #eef1f4; }
.m-photos h2 { font-size: 15px; }
.m-done { margin-top: 6px; }
.m-done .btn-lg { min-height: 58px; font-size: 18px; }
.m-qr-card { display: flex; gap: 14px; align-items: center; }
.m-qr-card code { font-size: 13px; }

/* Pay by bank */
.paybox { max-width: 440px; margin: 20px auto; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.pay-head { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; }
.pay-head img { max-height: 44px; max-width: 120px; }
.pay-amount { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 0; margin-bottom: 14px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.pay-amount b { font-size: 28px; }
.pay-done { text-align: center; font-size: 40px; padding: 10px 0; }
.pay-done h1 { font-size: 22px; margin: 8px 0 4px; }
.pay-manual { margin-top: 16px; font-size: 14px; }
.pay-manual summary { cursor: pointer; color: var(--muted); }
.demo-bank { border: 3px dashed #d97706; }
.demo-banner { background: #fdf3e1; color: #92400e; font-weight: 700; font-size: 12px; padding: 6px 10px; border-radius: 8px; margin-bottom: 12px; text-align: center; }
.pay-done p { font-size: 15px; margin: 0; }

/* Invoice template picker */
.tpl-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tpl-card { display: flex !important; flex-direction: column; gap: 4px !important; border: 1px solid var(--line); border-radius: 10px; padding: 8px; cursor: pointer; margin: 0 !important; font-weight: 400 !important; }
.tpl-card.on, .tpl-card:has(input:checked) { border: 2px solid var(--signal); padding: 7px; }
.tpl-card input { position: absolute; opacity: 0; pointer-events: none; }
.tpl-thumb { display: block; position: relative; width: 100%; aspect-ratio: 210 / 297; overflow: hidden; border-radius: 6px; background: #e9edf1; }
.tpl-thumb iframe { position: absolute; top: 0; left: 0; width: 794px; height: 1123px; border: 0; transform-origin: 0 0; pointer-events: none; }
.tpl-name { display: flex; gap: 6px; align-items: center; margin-top: 2px; }
@media (max-width: 820px) { .tpl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Products & services */
.pack-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.pack-card { display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.pack-card .btn { align-self: flex-start; margin-top: auto; }
.quickadd .qa-group { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; width: 100%; }
.quickadd .qa-label { font-size: 12px; color: var(--muted); min-width: 52px; }
.chip.chip-product { border-color: #D6D2FB; background: var(--blue-l, #e3f0fc); color: var(--blue-d, #1565c0); }

/* Website requests */
.limit-meter { padding: 12px 16px; }
.limit-meter .meter { height: 6px; background: #eceae1; border-radius: 4px; margin-top: 8px; overflow: hidden; }
.limit-meter .meter i { display: block; height: 100%; background: var(--signal); }
.limit-meter.is-full .meter i { background: #c0392b; }
tr.is-new td:first-child { box-shadow: inset 3px 0 0 var(--signal); }
.copyrow input { flex: 1; font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
textarea.code { width: 100%; font-family: ui-monospace, Menlo, monospace; font-size: 12px; background: #f7f6f1; }
.plan-compare { margin: 16px 0; text-align: left; }
.plan-compare .card { margin: 0; }
.public-request { max-width: 640px; margin: 0 auto; }
.pr-head { text-align: center; padding: 18px 0 10px; }
.pr-head img { max-height: 64px; max-width: 220px; }
.public-request .btn-primary { background: var(--accent); border-color: var(--accent); }
.pr-items { border: 0; padding: 0; margin: 0 0 14px; }
.pr-items legend { font-weight: 600; margin-bottom: 6px; }
.form .pr-item { flex-direction: row; text-align: left; font-size: 14px; font-weight: 400; }
.pr-item input { width: 20px !important; min-height: 20px; flex: none; margin: 0; }
.pr-item span b { font-weight: 600; }
.pr-item { display: flex !important; align-items: center; gap: 10px; border: 1px solid var(--line, #e5e2d8); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px !important; cursor: pointer; }
.pr-item span { flex: 1; display: flex; flex-direction: column; }
.pr-item em { font-style: normal; font-weight: 600; white-space: nowrap; }
.pr-item:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, #fff); }
.widget-preview { background: #f2f1ec; border-radius: 12px; padding: 16px; margin-top: 8px; }

/* Pro trial banner */
.trialbar { display: flex; justify-content: space-between; gap: 12px; align-items: center; background: var(--blue-l); color: var(--blue-d); border: 1px solid #D6D2FB; border-radius: 12px; padding: 10px 14px; margin-bottom: 18px; text-decoration: none; font-weight: 600; font-size: 14px; }
.trialbar span { white-space: nowrap; }
.trialbar.soon { background: #FFF4DC; color: #8A5A00; border-color: #FFE2A3; }
.pack-group { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 8px; }
.pack-group:first-child { margin-top: 4px; }
.chan { display: inline-block; font-size: 14px; }
.social-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin: 12px 0; }
.social-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fff; }
.social-card h3 { margin: 0 0 6px; font-size: 15px; }
.social-card input { width: 100%; font-family: ui-monospace, Menlo, monospace; font-size: 12px; margin: 6px 0; }
.social-card ol { margin: 6px 0 0; padding-left: 18px; font-size: 13px; color: var(--muted); }
.social-qr { display: flex; gap: 16px; align-items: center; margin-top: 10px; }
.cat-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 12px; }
.cat-chips a { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 11px; font-size: 13px; color: var(--ink); text-decoration: none; }
.cat-chips a.on { background: var(--signal); border-color: var(--signal); color: #fff; }
.cat-chips small { opacity: .7; }
