/* KitchenBase — licensee app. Direction "Signal" (chosen 26 Sep 2026):
   ink hero surfaces, off-white page, yellow as the one signal, pill controls.
   Phones get a top bar + tab bar; 1024 px and up get a sidebar. */
:root {
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bg: #F3F2EE; --surface: #FFFFFF; --surface-2: #F7F6F2; --surface-3: #EFEDE7;
  --ink: #0B0B0B; --ink-2: #45443F; --muted: #6A6862; --line: #E3E1DA; --grid: #ECEAE4;
  --accent: #FFE600; --accent-ink: #0B0B0B;
  --hero: #0B0B0B; --hero-2: #1C1C1A; --hero-line: #2E2E2B; --hero-ink: #FFFFFF; --hero-muted: #C9C7BF;
  --grab: #0E8A4A; --fp: #E0457B;                 /* dataviz-validated pair (CVD, contrast) */
  --good: #0B7A36; --good-bg: #E7F4EC;
  --warn: #8A5A00; --warn-bg: #FFF3D6;
  --bad: #B42318; --bad-bg: #FDECEA;
  --radius: 20px; --radius-sm: 14px; --radius-xs: 10px;
  --tabbar-h: 64px;
  color-scheme: light;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; font-size: 15px; line-height: 1.45; min-height: 100vh; }
.hidden { display: none !important; }
button, a, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { text-decoration: none; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 8px; }
h1[tabindex="-1"]:focus { outline: none; }            /* focus moves to the page title on navigation; no ring */
svg.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; border: 0 !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; }   /* wins over any field rule */
.muted { color: var(--muted); }
.noscript { padding: 24px; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 999px; font-weight: 700; font-size: 15px; white-space: nowrap; transition: transform .1s ease, background .15s ease; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #F5DC00; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-ghost { background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: #C9C7BF; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 13.5px; }
.link-btn { font-size: 13px; font-weight: 600; color: var(--ink-2); padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); min-height: 34px; display: inline-flex; align-items: center; gap: 6px; }
.link-btn[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field input { font-size: 16px; font-weight: 500; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; min-height: 48px; width: 100%; }
.field input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(11,11,11,.08); }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 74px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font-size: 13px; font-weight: 700; padding: 8px 12px; border-radius: 999px; color: var(--ink-2); min-height: 36px; }
.form-err { color: var(--bad); background: var(--bad-bg); font-size: 13.5px; font-weight: 600; padding: 10px 12px; border-radius: 10px; }
.fine { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: .01em; white-space: nowrap; }
.tag.warn { color: var(--warn); background: var(--warn-bg); }
.tag.bad { color: var(--bad); background: var(--bad-bg); }
.tag.good { color: var(--good); background: var(--good-bg); }
.tag.info { color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); }
.tag.dark { color: #fff; background: var(--ink); }

/* ---------- sign in ---------- */
.login { min-height: 100vh; display: grid; grid-template-rows: auto 1fr; }
.login-art { background: var(--hero); color: var(--hero-ink); padding: 22px 20px 30px; }
.login .brand { color: #fff; }
.login .brand img { background: #fff; border-radius: 9px; }
.login-pitch { margin-top: 28px; max-width: 460px; }
.login-pitch h1 { font-size: 30px; line-height: 1.12; letter-spacing: -.03em; font-weight: 800; }
.login-pitch .hl { color: var(--accent); }
.login-pitch p { margin-top: 10px; color: var(--hero-muted); font-size: 15px; }
.login-points { display: none; list-style: none; margin-top: 26px; gap: 12px; flex-direction: column; }
.login-points li { display: flex; align-items: center; gap: 10px; color: #E6E4DC; font-size: 14.5px; }
.login-points li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.login-form-wrap { padding: 24px 20px 40px; display: flex; justify-content: center; }
.login-form { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 16px; }
.login-form h2 { font-size: 24px; letter-spacing: -.02em; }
.login-form .muted { font-size: 14px; margin-top: -8px; }

/* ---------- shell ---------- */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; letter-spacing: -.02em; min-height: 44px; }
.app { min-height: 100vh; }
.side { display: none; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  background: rgba(243, 242, 238, .88); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 13px; display: grid; place-items: center; flex: none; }
.main { padding: 4px 16px calc(var(--tabbar-h) + 32px + env(safe-area-inset-bottom)); max-width: 1180px; margin: 0 auto; outline: none; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--line); }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); position: relative; min-height: 44px; }
.tab .ic { width: 22px; height: 22px; }
.tab[aria-current="page"] { color: var(--ink); }
.tab[aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--ink); }
.badge { position: absolute; top: 7px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 5px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; }
.viewas { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 16px 0; padding: 8px 8px 8px 14px; background: var(--ink); color: #fff; border-radius: 18px; font-size: 13px; font-weight: 600; line-height: 1.35; }
.viewas span { min-width: 0; overflow-wrap: anywhere; }            /* wraps rather than hiding a long licensee name */
.viewas b { color: var(--accent); }
.viewas .btn { min-height: 32px; padding: 0 14px; font-size: 12.5px; }

/* ---------- page furniture ---------- */
.page-head { padding: 16px 2px 16px; }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--muted); }
.page-head h1 { font-size: 26px; line-height: 1.2; font-weight: 800; letter-spacing: -.025em; margin-top: 4px; }
.page-head .sub { margin-top: 6px; font-size: 14px; color: var(--ink-2); }
.pills { display: flex; flex-wrap: wrap; gap: 6px 8px; margin-top: 10px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; color: var(--ink-2); max-width: 100%; }
.sec-title { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 6px 2px 10px; }
.card { background: var(--surface); border-radius: var(--radius); padding: 18px; }
.card-title { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.card-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.grid { display: grid; gap: 16px; }
.state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 36px 20px; color: var(--ink-2); }
.state .ic { width: 28px; height: 28px; color: var(--muted); }
.state b { color: var(--ink); font-size: 16px; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--ink); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--surface-3) 0%, var(--surface-2) 50%, var(--surface-3) 100%); background-size: 200% 100%; animation: shimmer 1.2s ease-in-out infinite; border-radius: 10px; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton, .spinner { animation-duration: 3s; } .btn, .row-link { transition: none; } }

/* ---------- sales hero (home + sales page) ---------- */
.hero { background: var(--hero); color: var(--hero-ink); }
.hero .card-sub, .hero .hero-meta, .hero .fine { color: var(--hero-muted); }
.sales-head { display: flex; flex-direction: column; gap: 12px; }
.seg { display: flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); align-self: flex-start; max-width: 100%; }
.seg button { padding: 7px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap; min-height: 34px; display: inline-flex; align-items: center; gap: 6px; }
.seg button .dot { width: 8px; height: 8px; border-radius: 50%; }
.seg button[aria-checked="true"] { background: var(--ink); color: #fff; }
.hero .seg { background: var(--hero-2); border-color: var(--hero-line); }
.hero .seg button { color: #D9D7CF; }
.hero .seg button[aria-checked="true"] { background: var(--accent); color: var(--accent-ink); }
.hero-fig { font-size: 44px; font-weight: 700; letter-spacing: -.035em; line-height: 1.05; margin-top: 18px; }
.hero-fig .cents { font-size: .5em; letter-spacing: -.01em; color: var(--hero-muted); margin-left: 1px; }
.hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 8px; font-size: 14px; font-weight: 500; }
.delta { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 700; }
.delta .ic { width: 14px; height: 14px; stroke-width: 2.25; }
.hero .delta.up { background: #1F3A27; color: #7EE2A1; }
.hero .delta.down { background: #4A1F1B; color: #FFB4AB; }
.hero .delta.flat { background: var(--hero-2); color: var(--hero-muted); }
.chart-wrap { position: relative; margin-top: 16px; background: #fff; color: var(--ink); border-radius: var(--radius-sm); padding: 14px 12px 8px; }
.chart-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .tick { font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .baseline { stroke: #C9C7BF; stroke-width: 1; }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .hit:focus { outline: none; }
.chart .col.hover path, .chart .col.hover rect { filter: brightness(1.12); }
.chart .col.focus-ring { outline: none; }
.tip { position: absolute; z-index: 5; pointer-events: none; min-width: 190px; background: #0B0B0B; color: #fff; border-radius: 12px; padding: 10px 12px; font-size: 12.5px; box-shadow: 0 12px 28px -8px rgba(0,0,0,.35); }
.tip .t-date { color: #BDBBB3; font-weight: 600; font-size: 11.5px; }
.tip .t-total { font-size: 16px; font-weight: 700; margin: 2px 0 6px; }
.tip .t-row { display: flex; align-items: center; gap: 8px; margin-top: 3px; }
.tip .t-row b { font-weight: 700; margin-left: auto; font-variant-numeric: tabular-nums; }
.tip .t-row small { color: #BDBBB3; font-size: 12px; min-width: 64px; text-align: right; font-variant-numeric: tabular-nums; }
.tip .t-row i { width: 12px; height: 2px; border-radius: 2px; display: inline-block; }
.table-view { max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-xs); }
.table-view table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.table-view th, .table-view td { padding: 8px 10px; text-align: right; border-bottom: 1px solid var(--grid); white-space: nowrap; }
.table-view th:first-child, .table-view td:first-child { text-align: left; }
.table-view thead th { position: sticky; top: 0; background: var(--surface); font-size: 12px; color: var(--muted); font-weight: 600; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--hero-line); }
.split-row { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.split-row .name { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; }
.split-row .name i { width: 10px; height: 10px; border-radius: 3px; }
.split-row .val { font-size: 19px; font-weight: 700; letter-spacing: -.02em; }
.split-row .sub { font-size: 12.5px; color: var(--hero-muted); }
.split-row.dim { opacity: .45; }
.hero .fine { margin-top: 14px; }
.empty-chart { padding: 28px 12px; text-align: center; color: var(--ink-2); font-size: 14px; }

/* ---------- lists of rows (attention, sections) ---------- */
.rows { display: grid; gap: 10px; }
.row-link { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 12px; padding: 14px; background: var(--surface); border-radius: var(--radius-sm); border: 1px solid transparent; min-height: 72px; transition: border-color .12s ease, transform .1s ease; }
.row-link:hover { border-color: var(--line); }
.row-link:active { transform: scale(.99); }
.ic-wrap { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink); flex: none; }
.row-link .lbl { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.row-link .v { font-size: 17px; font-weight: 700; letter-spacing: -.015em; margin-top: 1px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-link .s { display: block; font-size: 13px; color: var(--ink-2); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.chev { color: var(--muted); }
.na { color: var(--muted); font-weight: 700; }
.is-na .ic-wrap { opacity: .6; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { display: flex; flex-direction: column; gap: 10px; padding: 14px; background: var(--surface); border-radius: var(--radius-sm); border: 1px solid transparent; min-height: 126px; transition: border-color .12s ease; }
.tile:hover { border-color: var(--line); }
.tile .t { font-size: 14px; font-weight: 700; }
.tile .d { font-size: 12.5px; color: var(--ink-2); line-height: 1.4; }
.more { margin-top: 22px; }

/* ---------- sales page ---------- */
.month-nav { display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.month-label { font-weight: 700; font-size: 15px; min-width: 130px; text-align: center; }
.brand-list { display: grid; gap: 0; }
.brand-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 2px; border-bottom: 1px solid var(--grid); }
.brand-row:last-child { border-bottom: 0; }
.brand-row .n { font-weight: 700; font-size: 14.5px; }
.brand-row .k { font-size: 12.5px; color: var(--muted); }
.brand-row .m { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- sheet (account, pickers) ---------- */
.sheet-back { position: fixed; inset: 0; background: rgba(11,11,11,.45); z-index: 60; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; background: var(--surface); border-radius: 22px 22px 0 0; padding: 8px 16px calc(20px + env(safe-area-inset-bottom)); max-height: 86vh; overflow: auto; box-shadow: 0 -20px 40px -20px rgba(0,0,0,.3); }
.sheet::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto 12px; }
.sheet h2 { font-size: 18px; letter-spacing: -.01em; }
.sheet .sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.menu { display: grid; gap: 2px; margin-top: 8px; }
.menu button, .menu a { display: flex; align-items: center; gap: 12px; padding: 12px 10px; border-radius: 12px; font-weight: 600; min-height: 48px; text-align: left; width: 100%; }
.menu button:hover, .menu a:hover { background: var(--surface-2); }
.acct-card { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; padding: 12px; background: var(--surface-2); border-radius: 14px; }
.acct-card .avatar { width: 44px; height: 44px; }
.acct-card .a1 { font-weight: 700; line-height: 1.25; }
.acct-card .a2 { font-size: 12.5px; color: var(--muted); }
.search { font-size: 16px; width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); min-height: 46px; }
.search:focus { outline: none; border-color: var(--ink); background: #fff; }
.pick-list { display: grid; gap: 2px; margin-top: 10px; }
.pick { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; text-align: left; padding: 11px 10px; border-radius: 12px; width: 100%; min-height: 56px; }
.pick:hover { background: var(--surface-2); }
.pick[aria-current="true"] { background: var(--ink); color: #fff; }
.pick[aria-current="true"] .k { color: #CFCDC5; }
.pick .n { font-weight: 700; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick .k { grid-column: 1; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick .tags { grid-row: 1 / span 2; grid-column: 2; display: flex; gap: 4px; }

.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 18px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: #0B0B0B; color: #fff; padding: 11px 18px; border-radius: 999px; font-size: 13.5px; font-weight: 600; z-index: 70; max-width: calc(100vw - 32px); text-align: center; }

/* ---------- small phones ---------- */
@media (max-width: 374px) {
  .hero-fig { font-size: 38px; }
  .seg button { padding: 7px 9px; font-size: 12.5px; }
  .page-head h1 { font-size: 23px; }
  .login-pitch h1 { font-size: 27px; }
}

/* ---------- tablet ---------- */
@media (min-width: 700px) {
  .main { padding-left: 28px; padding-right: 28px; }
  .viewas { margin-left: 28px; margin-right: 28px; }
  .tiles { grid-template-columns: repeat(4, 1fr); }
  .sales-head { flex-direction: row; justify-content: space-between; align-items: flex-start; }
  .hero-fig { font-size: 52px; }
  .card { padding: 22px; }
  .sheet { left: 50%; right: auto; bottom: auto; top: 50%; transform: translate(-50%, -50%); width: min(520px, calc(100vw - 48px)); border-radius: 22px; padding: 20px 20px 22px; }
  .sheet::before { display: none; }
}

/* ---------- desktop: sidebar ---------- */
@media (min-width: 1024px) {
  .topbar, .tabbar { display: none; }
  .login { grid-template-rows: none; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
  .login-art { padding: 40px 56px; display: flex; flex-direction: column; }
  .login-pitch { margin-top: auto; margin-bottom: auto; }
  .login-pitch h1 { font-size: 46px; }
  .login-pitch p { font-size: 17px; }
  .login-points { display: flex; }
  .login-form-wrap { align-items: center; padding: 40px; }
  .app { display: grid; grid-template-columns: 248px minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .side { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; padding: 22px 16px; background: var(--hero); color: #fff; grid-row: 1 / span 2; }
  .side .brand { padding: 4px 8px 10px; }
  .side .brand img { background: #fff; border-radius: 8px; }
  .side-nav { display: flex; flex-direction: column; gap: 2px; }
  .nav-i { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; font-size: 14px; font-weight: 600; color: #CFCDC5; min-height: 42px; }
  .nav-i:hover { background: var(--hero-2); color: #fff; }
  .nav-i[aria-current="page"] { background: var(--accent); color: var(--accent-ink); }
  .nav-i .n { margin-left: auto; font-size: 11.5px; font-weight: 700; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--bad); color: #fff; display: grid; place-items: center; }
  .nav-i .soon { margin-left: auto; font-size: 11px; font-weight: 600; color: #9A988F; }
  .nav-i[aria-current="page"] .soon { color: var(--ink-2); }
  .side-acct { margin-top: auto; display: grid; grid-template-columns: 36px 1fr; gap: 10px; align-items: center; padding: 12px; border-radius: 14px; background: #161615; border: 1px solid #2A2A27; text-align: left; width: 100%; }
  .side-acct:hover { border-color: #3A3A36; }
  .side-acct .avatar { width: 36px; height: 36px; }
  .side-acct .a1 { font-size: 13px; font-weight: 700; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .side-acct .a2 { font-size: 12px; color: #A4A29A; }
  .viewas { grid-column: 2; margin: 16px 40px 0; }
  .main { grid-column: 2; padding: 24px 40px 48px; width: 100%; }
  .page-head h1 { font-size: 32px; }
  .grid.home { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; gap: 20px; }
  .toast { bottom: 28px; }
}
@media (min-width: 1280px) { .grid.home { grid-template-columns: minmax(0, 1fr) 380px; } }

/* ---------- bills ---------- */
.bill-hero .hero-fig { margin-top: 6px; }
.bill-hero .hero-meta { color: var(--hero-muted); }
.bill-list { padding: 4px 0; }
.bill-row { display: grid; grid-template-columns: 1fr auto 20px; gap: 12px; align-items: center; padding: 14px 16px; min-height: 64px; border-bottom: 1px solid var(--grid); }
.bill-row:last-child { border-bottom: 0; }
.bill-row:hover { background: var(--surface-2); }
.b-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.b-title { font-weight: 700; font-size: 14.5px; }
.b-sub { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.b-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.b-amt { font-weight: 700; font-variant-numeric: tabular-nums; }
.inv-page-head { display: grid; gap: 6px; }
.inv-page-head h1 { font-size: 22px; }
.back { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 600; color: var(--ink-2); min-height: 40px; width: max-content; }
.inv-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 4px; }
.invoice { background: #fff; border-radius: var(--radius); padding: 20px 16px; color: #1A1A18; font-size: 13px; }
.inv-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.inv-top h2 { font-size: 24px; font-weight: 500; letter-spacing: .02em; text-transform: uppercase; color: #6A6862; }
.inv-brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 17px; letter-spacing: -.02em; }
.inv-head { display: grid; gap: 18px; margin-top: 20px; }
.inv-parties { display: grid; gap: 16px; }
.inv-parties section { display: flex; flex-direction: column; gap: 2px; line-height: 1.45; }
.inv-parties h3 { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 4px; }
.inv-meta { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; align-self: start; }
.inv-meta dt { font-weight: 700; }
.inv-meta dd { text-align: right; font-variant-numeric: tabular-nums; }
.inv-table-wrap { display: none; margin-top: 20px; border-top: 1px solid var(--line); }
.inv-lines { list-style: none; margin-top: 18px; border-top: 1px solid var(--line); }
.inv-lines li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid var(--grid); }
.inv-lines .l-desc { grid-column: 1 / -1; font-weight: 600; }
.inv-lines .l-calc { color: var(--muted); font-variant-numeric: tabular-nums; }
.inv-lines .l-amt { text-align: right; font-variant-numeric: tabular-nums; }
.inv-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.inv-table th { background: var(--surface-2); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; padding: 9px 8px; text-align: left; white-space: nowrap; }
.inv-table td { padding: 9px 8px; border-bottom: 1px solid var(--grid); vertical-align: top; }
.inv-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.inv-table .tax { white-space: nowrap; }
.inv-table .desc { min-width: 220px; }
.inv-foot { display: grid; gap: 18px; margin-top: 18px; }
.inv-memo p { color: var(--ink-2); line-height: 1.5; }
.inv-totals { display: grid; grid-template-columns: 1fr auto; gap: 6px 20px; font-variant-numeric: tabular-nums; }
.inv-totals dt { font-weight: 700; }
.inv-totals dd { text-align: right; }
.inv-totals .due { background: var(--surface-3); padding: 8px 10px; margin-top: 4px; font-weight: 800; font-size: 14px; }
.inv-totals dt.due { border-radius: 8px 0 0 8px; }
.inv-totals dd.due { border-radius: 0 8px 8px 0; }
.inv-pay { margin-top: 20px; padding: 12px 14px; border-radius: 12px; background: var(--warn-bg); color: var(--warn); font-weight: 600; }
@media (min-width: 700px) {
  .invoice { padding: 32px 36px; font-size: 13.5px; }
  .inv-head { grid-template-columns: 1fr 280px; }
  .inv-foot { grid-template-columns: 1fr 320px; align-items: start; }
  .inv-table { min-width: 0; }
  .inv-table-wrap { display: block; }
  .inv-lines { display: none; }
}
@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff; }
  .side, .topbar, .tabbar, .viewas, .toast, .sheet, .sheet-back, .page-head, .fine { display: none !important; }
  .app { display: block !important; }
  .main { padding: 0 !important; max-width: none; }
  .invoice { padding: 0; border-radius: 0; font-size: 11.5px; }
  .inv-head { grid-template-columns: 1fr 260px; }
  .inv-foot { grid-template-columns: 1fr 300px; }
  .inv-table { min-width: 0; }
  .inv-table-wrap { display: block !important; overflow: visible; }
  .inv-lines { display: none !important; }
  .inv-table th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .inv-totals .due, .inv-pay { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- issues ---------- */
.head-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.seg-light { margin: 0 0 12px; }
.seg-light a { padding: 8px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); min-height: 36px; display: inline-flex; align-items: center; }
.seg-light a[aria-selected="true"] { background: var(--ink); color: #fff; }
.issue-list { padding: 4px 0; }
.issue-row { display: grid; grid-template-columns: 1fr 20px; gap: 10px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--grid); min-height: 72px; }
.issue-row:last-child { border-bottom: 0; }
.issue-row:hover { background: var(--surface-2); }
.i-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.i-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.i-cat { font-size: 12px; font-weight: 600; color: var(--muted); }
.i-title { font-weight: 700; font-size: 15px; }
.i-sub { font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.form { display: flex; flex-direction: column; gap: 18px; }
.input { font: inherit; font-size: 16px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; width: 100%; min-height: 48px; resize: vertical; }
.input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(11,11,11,.08); }
.field .fine { font-weight: 500; text-align: right; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 13.5px; font-weight: 600; color: var(--ink-2); min-height: 40px; }
.chip[aria-checked="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.ph { display: flex; flex-direction: column; gap: 10px; }
.ph-thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.ph-thumbs:empty { display: none; }
.ph-thumb { position: relative; width: 84px; height: 84px; border-radius: 12px; overflow: hidden; background: var(--surface-3); }
.ph-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-remove { position: absolute; top: 4px; right: 4px; width: 32px; height: 32px; border-radius: 50%; background: rgba(11,11,11,.72); color: #fff; display: grid; place-items: center; }
.ph-remove .ic { width: 16px; height: 16px; }
.ph-add { display: flex; flex-wrap: wrap; gap: 8px; }
.ph .fine { text-align: left; font-weight: 400; }
.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-top: 12px; }
.ph-cell { aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--surface-3); padding: 0; }
.ph-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.viewer img { width: 100%; height: auto; border-radius: 12px; display: block; }
.steps { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 16px; }
.steps li { display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.steps .dot { height: 6px; border-radius: 3px; background: var(--surface-3); }
.steps li.done .dot { background: var(--ink); }
.steps li.now { color: var(--ink); }
.steps li.now .dot { background: var(--accent); box-shadow: inset 0 0 0 1px rgba(11,11,11,.15); }
.issue-desc { white-space: pre-wrap; line-height: 1.55; color: var(--ink-2); }
.thread { display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 88%; padding: 12px 14px; border-radius: 16px; background: var(--surface); align-self: flex-start; border-top-left-radius: 6px; }
.msg.you { align-self: flex-end; background: var(--ink); color: #fff; border-top-left-radius: 16px; border-top-right-radius: 6px; }
.msg-meta { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.msg.you .msg-meta { color: #CFCDC5; }
.msg p { white-space: pre-wrap; line-height: 1.5; }
.msg .ph-grid { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
.composer { margin-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.composer-actions { display: flex; justify-content: flex-end; }
