[x-cloak] { display: none !important; }
html { background-color: #00263B; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; background-color: #f4f6f8; margin: 0; padding-bottom: 6.5rem; color: #1e293b; -webkit-font-smoothing: antialiased; }
.shell { max-width: 28rem; margin: 0 auto; min-height: 100vh; flex-direction: column; display: flex; background-color: #f4f6f8; box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1); }
header { background-color: #00263B; color: #FAFFE4; padding: calc(1rem + env(safe-area-inset-top, 0px)) 1rem 1rem; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.35rem 0.75rem; position: sticky; top: 0; z-index: 50; border-bottom: 3px solid #AA9251; }
.wait-label { flex: 1 0 100%; margin: 0; font-size: 0.75rem; font-weight: 700; color: #FAFFE4; font-family: inherit; line-height: 1.4; overflow-wrap: anywhere; }
header h1 { margin: 0; font-size: 1rem; font-weight: 700; letter-spacing: -0.025em; }
header p { margin: 0; font-size: 10px; color: #FAFFE4; font-family: monospace; font-weight: bold; letter-spacing: 0.05em; }
.status-box { display: flex; align-items: center; gap: 0.35rem; }
header .icon-btn { width: auto; background: transparent; color: #FAFFE4; border: 0; padding: 0.35rem; display: flex; align-items: center; justify-content: center; border-radius: 0.5rem; }
header a.icon-btn { text-decoration: none; }
header .icon-btn.cog-on { background: #01344f; }
header .help-mark { width: 1.9rem; height: 1.9rem; padding: 0; font-size: 1.25rem; font-weight: 700; line-height: 1; }
header .help-chip { display: inline-flex; align-items: center; justify-content: center; border: 1.5px solid #FAFFE4; color: #FAFFE4; background: transparent; border-radius: 0.55rem; padding: 0.4rem 0.85rem; font-size: 0.95rem; font-weight: 600; line-height: 1; text-decoration: none; }
header .icon-btn.cog-ring { width: 2.15rem; height: 2.15rem; padding: 0; border: 1.5px solid #FAFFE4; border-radius: 999px; }
header .icon-btn.cog-ring svg { width: 18px; height: 18px; }
.help-page { display: flex; flex-direction: column; }
.help-page .page-title { margin-bottom: 0.35rem; }
.help-page > .page-lead { margin-bottom: 1.05rem; }
.help-steps { list-style: none; margin: 0 0 1.05rem; padding: 0; display: flex; flex-direction: column; gap: 0.85rem; }
.help-step { background: #ffffff; border: 1px solid #e6eaee; border-radius: 0.95rem; padding: 1rem 1.05rem 1.05rem; box-shadow: 0 1px 2px rgb(0 0 0 / 0.04); }
.help-step-head { display: flex; align-items: center; gap: 0.7rem; }
.help-num { width: 1.75rem; height: 1.75rem; flex: 0 0 1.75rem; display: flex; align-items: center; justify-content: center; background: #00263B; color: #FAFFE4; border-radius: 0.35rem; font-size: 0.95rem; font-weight: 700; line-height: 1; }
.help-step h3 { margin: 0; font-size: 1.05rem; font-weight: 700; color: #00263B; }
.help-step p { margin: 0.55rem 0 0; color: #64748b; font-size: 0.95rem; font-weight: 500; line-height: 1.45; }
.help-note { margin: 0; }
.refresh-btn { border: 0; background: transparent; color: inherit; font: inherit; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; cursor: pointer; padding: 0.35rem 0.2rem; }
a.refresh-btn { text-decoration: none; }
.dot { width: 0.6rem; height: 0.6rem; border-radius: 50%; display: inline-block; background-color: #34d399; }
.dot.syncing { background-color: #FAFFE4; animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
.banner { background-color: #00263B; border-bottom: 1px solid #01344f; padding: 0.5rem 0.75rem; text-align: left; font-size: 0.75rem; font-weight: 600; color: #FAFFE4; line-height: 1.4; overflow-wrap: anywhere; }
main { padding: 1rem; flex: 1; display: flex; flex-direction: column; gap: 1rem; background-color: #f4f6f8; }
.home-board { display: flex; flex-direction: column; gap: 0.85rem; }
.home-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.home-pair button { padding: 0.9rem 0.45rem; }
.home-heading { margin: 0.15rem 0 0; font-size: 1.15rem; font-weight: 700; color: #0f172a; }
.pile-list { display: flex; flex-direction: column; gap: 0.75rem; }
button.pile { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; width: 100%; text-align: left; background: #ffffff; color: #0f172a; border: 1px solid #e6eaee; border-radius: 0.9rem; padding: 0.95rem 1rem; font-weight: 700; box-shadow: 0 1px 2px rgb(0 0 0 / 0.04); }
.pile-copy { display: flex; flex-direction: column; min-width: 0; }
button.pile .metric-value { font-size: 1.55rem; margin-top: 0.3rem; }
.pile-hint { display: block; margin-top: 0.2rem; font-size: 0.72rem; font-weight: 600; color: #64748b; text-transform: none; letter-spacing: 0; }
.pile-empty { display: block; margin-top: 0.35rem; font-size: 0.95rem; font-weight: 600; color: #64748b; text-transform: none; letter-spacing: 0; }
.pile-chevron { flex-shrink: 0; color: #00263B; }
.sheet-page > * + * { margin-top: 0.85rem; }
.sheet-page > .page-lead { margin-top: 0.3rem; }
.sheet-page > .inv-stack { margin-top: 1rem; }
.page-title { margin: 0; font-size: 1.7rem; font-weight: 700; color: #00263B; letter-spacing: -0.02em; }
.page-lead { margin: 0; color: #64748b; font-size: 0.95rem; font-weight: 500; }
.pay-row { display: flex; align-items: center; gap: 0.55rem; margin: 0.15rem 0 0.85rem; }
a.pay-open { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; color: #00263B; font-weight: 700; font-size: 0.92rem; }
button.pay-copy { width: 2.5rem; height: 2.5rem; flex: 0 0 2.5rem; padding: 0; background: #ffffff; color: #00263B; border: 1px solid #e2e8f0; border-radius: 0.65rem; display: flex; align-items: center; justify-content: center; }
button.pay-copy:disabled { background: #ffffff; color: #94a3b8; }
.pay-copied { margin: -0.35rem 0 0.75rem; color: #065f46; font-size: 0.8rem; font-weight: 700; }
.inv-stack { display: flex; flex-direction: column; gap: 0.85rem; }
.inv-card { background: #ffffff; border: 1px solid #e6eaee; border-radius: 0.95rem; padding: 1rem 1.05rem 1.05rem; box-shadow: 0 1px 2px rgb(0 0 0 / 0.04); cursor: pointer; }
.inv-client { font-size: 1.15rem; font-weight: 700; color: #00263B; }
.inv-card.inv-late { border-left: 4px solid #AA9251; }
.inv-flag:empty { display: none; }
.inv-flag { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #AA9251; }
.inv-code { margin-top: 0.15rem; color: #64748b; font-size: 0.92rem; font-weight: 500; }
.inv-facts { margin-top: 0.45rem; display: flex; flex-direction: column; gap: 0.16rem; }
.inv-fact { display: flex; gap: 0.45rem; align-items: baseline; font-size: 0.9rem; line-height: 1.35; color: #1e293b; font-weight: 500; }
.inv-k { flex: 0 0 auto; font-weight: 700; color: #64748b; }
.inv-fact span:last-child { min-width: 0; overflow-wrap: anywhere; }
.inv-amount { margin-top: 0.5rem; font-size: 1.55rem; font-weight: 700; color: #00263B; line-height: 1.15; }
.inv-actions { display: flex; gap: 0.65rem; align-items: center; }
.inv-card .inv-actions { margin-top: 0.9rem; }
.inv-actions button { flex: 1 1 0; width: auto; }
button.btn-line { background: #ffffff; color: #00263B; border: 1.5px solid #00263B; }
button.btn-quiet { width: auto; align-self: center; background: transparent; color: #64748b; padding: 0.15rem 0.35rem; font-size: 0.8rem; font-weight: 700; }
button.btn-quiet:disabled { background: transparent; color: #94a3b8; }
.send-dock .pay-row, .send-dock .pay-copied { margin: 0; }
.send-dock .share-whatsapp { flex: 1 1 100%; }
button.btn-line.btn-auto { flex: 0 0 auto; padding-left: 1.15rem; padding-right: 1.15rem; }
.send-bar { background: #00263B; color: #FAFFE4; border-radius: 0.75rem; padding: 0.85rem 1rem; font-weight: 700; overflow-wrap: anywhere; }
.send-heading { margin: 0; font-size: 1.2rem; font-weight: 700; color: #00263B; }
button.back-home { width: auto; align-self: flex-start; background: transparent; color: #00263B; font-size: 0.85rem; font-weight: 700; padding: 0; text-align: left; }
label.to-label { text-transform: none; letter-spacing: 0; font-size: 0.95rem; font-weight: 600; color: #334155; }
textarea.email-preview { min-height: 4.25rem; line-height: 1.4; white-space: pre-wrap; background: #ffffff; }
.invoice-sheet { background: #ffffff; border: 1px solid #e6eaee; border-radius: 0.95rem; padding: 1rem 1rem 0.75rem; box-shadow: 0 1px 2px rgb(0 0 0 / 0.04); scroll-margin-top: 5.25rem; }
.invoice-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem; }
.invoice-head > div:first-child { min-width: 0; }
.invoice-sheet .page-title { overflow-wrap: anywhere; }
.invoice-meta > div { min-width: 0; }
.inv-actions { flex-wrap: wrap; }
.invoice-kicker { margin: 0; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #64748b; }
.invoice-client { margin: 0.15rem 0 0; font-size: 1.05rem; font-weight: 700; color: #00263B; overflow-wrap: anywhere; }
.invoice-job { margin: 0.25rem 0 0; color: #334155; font-size: 0.92rem; font-weight: 600; overflow-wrap: anywhere; }
.invoice-total-block { flex: 0 0 auto; text-align: right; }
.invoice-total { display: block; margin-top: 0.15rem; font-size: 1.45rem; font-weight: 700; color: #00263B; line-height: 1.1; }
.invoice-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 0.55rem 0.75rem; margin: 0.9rem 0 0; }
.invoice-meta dt { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: #94a3b8; }
.invoice-meta dd { margin: 0.12rem 0 0; font-size: 0.92rem; font-weight: 600; color: #1e293b; overflow-wrap: anywhere; }
.invoice-lines { margin-top: 0.85rem; border-top: 1px solid #e6eaee; }
.related-invoices { margin-top: 0.85rem; }
.related-invoices .page-lead { margin-bottom: 0.45rem; }
.related-invoices .inv-row + .inv-row { margin-top: 0.45rem; }
.invoice-line { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem; padding: 0.7rem 0; border-bottom: 1px solid #f1f5f9; }
.invoice-line-main { min-width: 0; }
.invoice-line-title { display: block; font-weight: 700; color: #00263B; overflow-wrap: anywhere; }
.invoice-line-meta { display: block; margin-top: 0.15rem; color: #64748b; font-size: 0.8rem; font-weight: 600; overflow-wrap: anywhere; }
.invoice-line-amt { flex: 0 0 auto; font-weight: 700; color: #00263B; }
.invoice-totals { margin-top: 0.35rem; }
.invoice-payments { margin-top: 0.8rem; border-top: 1px solid #e6eaee; padding-top: 0.6rem; }
.invoice-payments > * + * { margin-top: 0.4rem; }
.payment-line { margin: 0; font-size: 0.95rem; }
.option-group { border: 1px solid #e2e8f0; border-radius: 0.85rem; padding: 0.35rem 0.9rem 0.9rem; background: #ffffff; }
.option-group:not([open]) > :not(summary) { display: none; }
.option-group summary { cursor: pointer; font-weight: 700; color: #00263B; padding: 0.6rem 0; }
.option-group[open] summary { margin-bottom: 0.15rem; }
.vat-note { margin: 0 0 0.85rem; color: #64748b; font-size: 0.85rem; font-weight: 600; line-height: 1.4; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.85rem; }
.switch-label { font-size: 0.95rem; font-weight: 700; color: #00263B; text-transform: none; letter-spacing: 0; }
button.switch { width: 3.15rem; height: 1.85rem; flex: 0 0 3.15rem; padding: 0.18rem; border-radius: 999px; background: #e2e8f0; position: relative; }
button.switch.switch-on { background: #00263B; }
.switch-knob { display: block; width: 1.45rem; height: 1.45rem; border-radius: 999px; background: #ffffff; transform: translateX(0); }
button.switch.switch-on .switch-knob { transform: translateX(1.3rem); }
.invoice-total-row { display: flex; justify-content: space-between; gap: 0.75rem; padding: 0.22rem 0; font-size: 0.92rem; font-weight: 600; color: #334155; }
.invoice-grand { margin-top: 0.15rem; padding-top: 0.45rem; border-top: 2px solid #AA9251; font-size: 1.05rem; font-weight: 700; color: #00263B; }
.email-sheet { background: #ffffff; border: 1px solid #e6eaee; border-radius: 0.85rem; padding: 0.7rem; }
.email-sheet > * + * { margin-top: 0.55rem; }
.email-sheet button { padding: 0.7rem; }
.send-dock { position: sticky; bottom: 4.4rem; z-index: 30; background: #f4f6f8; padding-top: 0.35rem; max-height: calc(100dvh - 9.5rem); overflow-y: auto; }
.send-dock-inner { display: flex; flex-direction: column; gap: 0.55rem; }
.metric-title.gold { color: #AA9251; }
.metric-box.alt .metric-title.gold { color: #AA9251; }
section { background: #ffffff; border: 1px solid #f1f5f9; border-radius: 1rem; padding: 1.25rem; display: flex; flex-direction: column; gap: 1rem; box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); }
section + section { margin-top: 1rem; }
.card-title { font-size: 1rem; font-weight: 700; color: #0f172a; margin: 0; padding-bottom: 0.5rem; border-bottom: 1px solid #f1f5f9; }
.form-group { display: flex; flex-direction: column; gap: 0.375rem; }
label { font-size: 0.75rem; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: 0.05em; }
select, input, textarea { width: 100%; background-color: #f8fafc; border: 1px solid #e2e8f0; border-radius: 0.75rem; padding: 0.75rem; font-size: 0.875rem; color: #0f172a; box-sizing: border-box; font-family: inherit; }
input:disabled, textarea:disabled, select:disabled { background-color: #f1f5f9; color: #64748b; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.5rem; }
input[type="time"], input[type="date"], input[type="file"] { min-height: 2.75rem; }
.logo-frame { display: block; background: #ffffff; border: 1px solid #e2e8f0; border-radius: 0.75rem; padding: 0.75rem; }
.logo-frame img { display: block; max-width: 100%; max-height: 12rem; margin: 0 auto; object-fit: contain; }
.shift-note { margin: 0; font-size: 0.75rem; font-weight: 600; color: #FAFFE4; background: #00263B; border-radius: 0.75rem; padding: 0.5rem 0.75rem; }
button { width: 100%; background-color: #00263B; color: #FAFFE4; font-weight: 600; padding: 1rem; border-radius: 0.75rem; border: none; font-size: 0.875rem; cursor: pointer; }
button:disabled { background-color: #f1f5f9; color: #94a3b8; cursor: not-allowed; }
button.btn-alt { background-color: #00263B; color: #FAFFE4; }
button.btn-paid { background-color: #047857; }
button.btn-unpaid { background-color: #b45309; }
button.btn-bad { background-color: #be123c; }
nav { background-color: #00263B; color: #FAFFE4; display: flex; justify-content: center; padding: 0.45rem 0.35rem calc(0.7rem + env(safe-area-inset-bottom, 0px)); position: fixed; bottom: 0; left: 0; right: 0; max-width: 28rem; margin: 0 auto; z-index: 50; border-top: 1px solid #01344f; box-sizing: border-box; gap: 0.35rem; }
nav button, nav a { background: none; color: #FAFFE4; font-size: 0.85rem; display: flex; align-items: center; justify-content: center; padding: 0.45rem 0.15rem 0.15rem; width: auto; min-width: 0; flex: 1 1 0; font-weight: 500; line-height: 1.2; text-align: center; text-decoration: none; }
button.see-more { width: auto; align-self: flex-start; background: transparent; color: #00263B; font-size: 0.8rem; font-weight: 700; padding: 0; text-align: left; }
.alert { padding: 0.875rem; border-radius: 0.75rem; text-align: center; font-size: 0.875rem; font-weight: 600; border: 1px solid transparent; }
.job-logged-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.75rem; margin: 0; }
button.text-btn { width: auto; background: transparent; color: inherit; padding: 0; border-radius: 0; font-weight: 700; text-decoration: underline; text-underline-offset: 0.18em; }
button.text-btn:disabled { background: transparent; color: inherit; opacity: 0.55; }
.alert-success { background-color: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.alert-error { background-color: #fff1f2; color: #9f1239; border-color: #fecdd3; }
.metric-box { background-color: #f8fafc; border: 1px solid #f1f5f9; padding: 0.75rem; border-radius: 0.75rem; }
.metric-box.alt { background-color: #00263B; border-color: #00263B; color: #FAFFE4; }
.metric-box.warn { background-color: #fff7ed; border-color: #fed7aa; color: #9a3412; }
.metric-box.bad { background-color: #fff1f2; border-color: #fecdd3; color: #9f1239; }
button.metric-box { text-align: left; color: #0f172a; font-weight: 700; padding: 0.75rem; }
button.metric-box.alt { background-color: #00263B; color: #FAFFE4; }
button.metric-box.warn { background-color: #fff7ed; color: #9a3412; }
button.metric-box.bad { background-color: #fff1f2; color: #9f1239; }
.metric-title { font-size: 10px; font-weight: 700; color: #94a3b8; text-transform: uppercase; display: block; }
.metric-value { display: block; margin-top: 0.25rem; font-size: 1.15rem; font-weight: 700; line-height: 1.2; }
.metric-value-sm { font-size: 0.95rem; }
.metric-sub { display: block; margin-top: 0.2rem; font-size: 0.7rem; font-weight: 600; color: #64748b; }
button.seg { background: #f8fafc; color: #475569; padding: 0.65rem 0.4rem; border: 1px solid #e2e8f0; }
button.seg.seg-on { background: #00263B; color: #FAFFE4; border-color: #00263B; }
button.btn-ghost { background: #e2e8f0; color: #0f172a; }
button.inv-row { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; width: 100%; background: #fff; color: #0f172a; border: 1px solid #e2e8f0; text-align: left; padding: 0.75rem; }
.inv-main { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.inv-title { font-weight: 700; font-size: 0.85rem; }
.inv-meta { font-size: 0.7rem; font-weight: 600; color: #64748b; }
.inv-side { display: flex; flex-direction: column; align-items: flex-end; gap: 0.25rem; flex-shrink: 0; }
.inv-amt { font-weight: 700; font-size: 0.85rem; }
.pill { display: inline-block; border-radius: 999px; padding: 0.15rem 0.45rem; font-size: 0.65rem; font-weight: 700; background: #e2e8f0; color: #334155; }
.pill-overdue, .pill-bad, .pill-writtenoff { background: #ffe4e6; color: #9f1239; }
.pill-due { background: #ffedd5; color: #9a3412; }
.pill-draft { background: #00263B; color: #FAFFE4; }
.pill-paid { background: #d1fae5; color: #065f46; }
.line { display: grid; grid-template-columns: 1fr 1.2fr auto; gap: 0.15rem 0.5rem; padding: 0.55rem 0; border-bottom: 1px solid #f1f5f9; font-size: 0.75rem; }
.line-amt { font-weight: 700; text-align: right; }
.line-sub { color: #64748b; font-weight: 600; }
button.btn-line:disabled,
button.btn-alt:disabled,
button.btn-paid:disabled,
button.btn-bad:disabled,
button.btn-ghost:disabled,
button.btn-unpaid:disabled {
  background-color: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
}
header .refresh-btn:disabled { background: transparent; color: #FAFFE4; opacity: 0.45; }
nav button, nav a { position: relative; }
nav button.nav-on { color: #FAFFE4; font-weight: 700; }
nav button.nav-on::before { content: ""; position: absolute; top: 0; left: 50%; width: 1.5rem; height: 3px; transform: translateX(-50%); background: #AA9251; border-radius: 2px; }
.metric-box.alt .metric-title,
.metric-box.alt .metric-sub,
button.metric-box.alt .metric-title,
button.metric-box.alt .metric-sub { color: #FAFFE4; }
.banner.sample { background: #fff7ed; border-bottom-color: #fed7aa; color: #9a3412; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }

.todo-list { display: flex; flex-direction: column; gap: 0.65rem; }
button.todo-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "kicker amount" "client amount" "meta amount";
  align-items: center;
  column-gap: 0.75rem;
  row-gap: 0.12rem;
  width: 100%;
  text-align: left;
  background: #ffffff;
  color: #00263B;
  border: 1px solid #e6eaee;
  border-radius: 0.95rem;
  padding: 0.9rem 1rem;
  font-weight: 700;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.04);
}
button.todo-row.todo-late { border-left: 4px solid #AA9251; }
.todo-kicker { grid-area: kicker; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #64748b; }
button.todo-late .todo-kicker { color: #AA9251; }
.todo-client { grid-area: client; font-size: 1.05rem; font-weight: 700; color: #00263B; overflow-wrap: anywhere; }
.todo-meta { grid-area: meta; font-size: 0.85rem; font-weight: 600; color: #64748b; }
.todo-amount { grid-area: amount; font-size: 1.25rem; font-weight: 700; color: #00263B; white-space: nowrap; }
.home-foot { margin: 0.15rem 0 0; color: #64748b; font-size: 0.9rem; font-weight: 500; line-height: 1.4; }
.quiet-actions { display: flex; flex-wrap: wrap; gap: 0.55rem; }
.quiet-actions > button { flex: 1 1 0; width: auto; padding: 0.75rem 0.4rem; }
.remind-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0.55rem; margin-top: 0.55rem; }
.send-choices { display: flex; flex-direction: column; gap: 0.55rem; }
.send-choices > button { width: 100%; }

/* Phase 10 (#133): All invoices, unbilled work, editing a draft's lines */
.is-hidden { display: none !important; }
.seg-tabs { display: flex; gap: 0.4rem; margin: 0.4rem 0 0.6rem; }
.seg-tabs button { flex: 1; background: #ffffff; color: #00263B; border: 1px solid #c9d3db; }
.seg-tabs button.seg-on { background: #00263B; color: #FAFFE4; }
.form-row { display: flex; gap: 0.6rem; }
.form-row > .form-group { flex: 1; }
.btn-inline { display: inline; padding: 0; width: auto; }
.history-row { display: grid; grid-template-columns: 1fr auto; gap: 0.15rem 0.6rem; text-align: left; width: 100%; }
.history-title { font-weight: 600; }
.history-total { grid-column: 2; grid-row: 1; font-weight: 600; }
.history-meta, .history-owed { font-size: 0.9rem; color: #475569; }
.history-owed { grid-column: 2; text-align: right; }
.history-late .history-meta { color: #b42318; }
.unbilled-row { display: grid; grid-template-columns: 1.6rem 1fr auto; gap: 0.5rem; align-items: center; width: 100%; text-align: left; background: #ffffff; color: #0f172a; border: 1px solid #e6eaee; }
.unbilled-head { font-weight: 600; background: #f4f7f9; }
.unbilled-mark { font-size: 1.15rem; }
.invoice-line { position: relative; }
.line-remove { width: auto; padding: 0.25rem 0.55rem; margin-left: 0.4rem; background: transparent; color: #b42318; border: 1px solid #f1c4bf; }
.btn-danger { color: #b42318; border-color: #f1c4bf; }

/* Phase 11: cash sale, receipt, discount */
.sale-total { font-size: 1.3rem; font-weight: 700; margin: 0.6rem 0; }
/* #170 PR 1: Log a job */
.sb-ux .log-title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; }
.sb-ux .log-title-row .card-title { margin-bottom: 0.5rem; }
.sb-ux .see-entries { min-height: 44px; padding: 0 0.25rem; font-size: 0.9rem; font-weight: 600; color: #00263B; text-decoration: underline; background: none; border: 0; width: auto; }
.sb-ux .date-break-row.grid-2 { gap: 0.6rem; }
.sb-ux #job-date { min-height: 44px; width: 100%; }
.sb-ux .mat-photo-frame { margin: 0.25rem 0 0.5rem; }
.sb-ux .mat-photo { display: block; max-width: 100%; max-height: 14rem; border-radius: 0.6rem; border: 1px solid #e2e8f0; object-fit: contain; background: #f8fafc; }
.sb-ux .field-hint { margin: 0.3rem 0 0; font-size: 0.8rem; color: #64748b; }
.sb-ux .fab.fab-up { bottom: calc(9.5rem + env(safe-area-inset-bottom, 0px)); }
/* #170 PR 2: search + filter sheet, compact sortable lists */
.sb-ux .search-wrap { position: relative; }
.sb-ux .search-wrap input[type="search"] { padding-right: 3.25rem; }
.sb-ux .search-filter-btn { position: absolute; top: 50%; right: 0.25rem; transform: translateY(-50%); width: 44px; height: 44px; min-height: 44px; padding: 0; margin: 0; display: flex; align-items: center; justify-content: center; background: transparent; color: #00263B; border: 0; border-radius: 0.5rem; }
.sb-ux .search-filter-btn.filter-on { background: #00263B; color: #FAFFE4; }
.sb-ux .filter-badge { position: absolute; top: 3px; right: 3px; min-width: 1.05rem; height: 1.05rem; border-radius: 999px; background: #AA9251; color: #00263B; font-size: 0.68rem; font-weight: 800; line-height: 1.05rem; text-align: center; }
.sb-ux .filter-sheet { border-top: 4px solid #AA9251; background: #FFFDF5; }
.sb-ux .sheet-head { display: flex; align-items: center; justify-content: space-between; margin: -0.25rem 0 0.5rem; }
.sb-ux .sheet-head h2 { margin: 0; font-size: 1.1rem; color: #00263B; }
.sb-ux .sheet-close { width: 44px; height: 44px; min-height: 44px; padding: 0; background: none; border: 0; color: #00263B; font-size: 1.1rem; }
.sb-ux .sheet-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 0.6rem; margin-top: 0.5rem; position: sticky; bottom: calc(-1rem - env(safe-area-inset-bottom, 0px)); background: inherit; padding: 0.5rem 0 0.25rem; }
.sb-ux .sheet-actions button { min-height: 48px; margin: 0; }
.sb-ux .list-table { box-sizing: border-box; max-width: 100%; background: #fff; border: 1px solid #e2e8f0; border-radius: 0.75rem; overflow-x: auto; overflow-y: hidden; margin: 0.25rem 0 0.75rem; }
.sb-ux .lt-head, .sb-ux .lt-row { display: grid; align-items: center; column-gap: 0.4rem; padding: 0 0.6rem; }
.sb-ux .hist-table .lt-head, .sb-ux .hist-table .lt-row { grid-template-columns: 2.3rem minmax(0, 1fr) 3.1rem 4.6rem 4.3rem; }
.sb-ux .lt-num-full { display: none; }
.sb-ux .client-table .lt-head, .sb-ux .client-table .lt-row { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) 4.6rem 3.4rem; }
.sb-ux .lt-head { background: #f1f5f9; border-bottom: 1px solid #e2e8f0; }
.sb-ux .lt-col { min-height: 40px; padding: 0; margin: 0; background: none; border: 0; color: #475569; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; text-align: left; width: auto; white-space: nowrap; overflow: hidden; }
.sb-ux .lt-col.lt-sorted { color: #00263B; }
.sb-ux .lt-row { width: 100%; min-height: 48px; margin: 0; background: #fff; color: #0f172a; border: 0; border-bottom: 1px solid #f1f5f9; border-radius: 0; text-align: left; font-size: 0.85rem; font-weight: 500; }
.sb-ux .lt-row:last-child { border-bottom: 0; }
.sb-ux .lt-row:active, .sb-ux .lt-row:hover { background: #f8fafc; }
.sb-ux .lt-row > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.sb-ux .lt-num { font-weight: 700; font-size: 0.78rem; font-variant-numeric: tabular-nums; }
.sb-ux .lt-client { font-weight: 600; }
.sb-ux .lt-date, .sb-ux .lt-contact { color: #64748b; font-size: 0.8rem; }
.sb-ux .lt-amt, .sb-ux .lt-c-amount, .sb-ux .lt-c-owed { text-align: right; font-variant-numeric: tabular-nums; }
.sb-ux .lt-amt { font-weight: 700; }
.sb-ux .lt-status { text-align: right; }
.sb-ux .lt-c-status { text-align: right; }
.sb-ux .lt-bal { display: none; }
.sb-ux .hist-table .lt-c-bal { display: none; }
.sb-ux .status-chip { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; padding: 0.12rem 0.45rem; border-radius: 999px; font-size: 0.7rem; font-weight: 700; background: #e2e8f0; color: #334155; }
.sb-ux .chip-paid, .sb-ux .chip-converted, .sb-ux .chip-accepted { background: #dcfce7; color: #166534; }
.sb-ux .chip-sent, .sb-ux .chip-part-paid { background: #dbeafe; color: #1e40af; }
.sb-ux .chip-overdue, .sb-ux .chip-expired { background: #fee2e2; color: #991b1b; }
.sb-ux .chip-draft { background: #fef3c7; color: #92400e; }
.sb-ux .chip-written-off, .sb-ux .chip-declined { background: #f1f5f9; color: #64748b; }
.sb-ux .lt-row.history-late .lt-date { color: #b42318; }
.sb-ux .lt-row.lt-archived { color: #94a3b8; }
.sb-ux .lt-row.lt-owes .lt-amt { color: #b42318; }
.sb-ux .client-table .lt-amt { font-weight: 600; }
@media (min-width: 48rem) {
  /* Wide screens: the whole panel grows, so tables stay inside it (was a 60rem table breaking out of a 28rem panel). */
  .sb-ux .shell, .sb-ux nav { max-width: 60rem; }
  .sb-ux .list-table { width: 100%; }
  .sb-ux .hist-table .lt-head, .sb-ux .hist-table .lt-row { grid-template-columns: 8rem minmax(0, 2fr) 7rem 7rem 7rem 7rem; column-gap: 1rem; padding: 0 1rem; }
  .sb-ux .client-table .lt-head, .sb-ux .client-table .lt-row { grid-template-columns: minmax(0, 2fr) minmax(0, 2fr) 8rem 8rem; column-gap: 1rem; padding: 0 1rem; }
  .sb-ux .lt-row { font-size: 0.95rem; }
  .sb-ux .lt-bal { display: block; text-align: right; color: #64748b; }
  .sb-ux .lt-num-full { display: inline; }
  .sb-ux .lt-num-short { display: none; }
  .sb-ux .hist-table .lt-c-bal { display: block; text-align: right; }
}
/* #170 PR 3: menu section dividers, Summary first pass */
.sb-ux .app-menu .menu-group { margin: 0; padding: 0.9rem 1rem 0.3rem; border-top: 6px solid #e8edf3; background: #f8fafc; color: #00263B; font-size: 0.72rem; letter-spacing: 0.08em; border-bottom: 1px solid #e2e8f0; }
.sb-ux .app-menu .menu-group:first-of-type { border-top: 0; }
.sb-ux .app-menu .menu-item { box-sizing: border-box; margin: 0; border-radius: 0; border-bottom: 1px solid #e2e8f0; }
.sb-ux .app-menu .menu-item.menu-danger { border-top: 6px solid #e8edf3; }
.sb-ux .sum2 { background: transparent; box-shadow: none; padding: 0; border: 0; }
.sb-ux .sum2-title { margin: 0 0 0.6rem; }
.sb-ux .period-pick { display: grid; grid-template-columns: repeat(4, 1fr); background: #e2e8f0; border-radius: 999px; padding: 3px; gap: 2px; }
.sb-ux .pp { min-height: 40px; margin: 0; padding: 0; border: 0; border-radius: 999px; background: transparent; color: #334155; font-weight: 600; font-size: 0.9rem; width: auto; }
.sb-ux .pp.pp-on { background: #00263B; color: #FAFFE4; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); }
.sb-ux .sum2-range { margin: 0.45rem 0 0.7rem; color: #64748b; font-size: 0.85rem; text-align: center; }
.sb-ux .kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.sb-ux .kpi { display: flex; flex-direction: column; align-items: flex-start; gap: 0.15rem; min-height: 5.2rem; margin: 0; padding: 0.75rem 0.85rem; box-sizing: border-box; background: #fff; color: #0f172a; border: 1px solid #e2e8f0; border-left: 5px solid #00263B; border-radius: 0.8rem; text-align: left; width: auto; box-shadow: 0 1px 2px rgba(0, 38, 59, 0.06); }
.sb-ux .kpi-paid { border-left-color: #16a34a; }
.sb-ux .kpi-owed { border-left-color: #dc2626; cursor: pointer; }
.sb-ux .kpi-profit { border-left-color: #AA9251; }
.sb-ux .kpi-k { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #64748b; }
.sb-ux .kpi-v { font-size: 1.35rem; font-weight: 800; color: #00263B; font-variant-numeric: tabular-nums; line-height: 1.2; }
.sb-ux .kpi-s { font-size: 0.75rem; color: #64748b; font-weight: 500; }
.sb-ux .sum2-list { margin-top: 1rem; background: #fff; border: 1px solid #e2e8f0; border-radius: 0.8rem; overflow: hidden; }
.sb-ux .sum2-list-head { display: flex; align-items: center; justify-content: space-between; padding: 0.55rem 0.9rem; background: #f1f5f9; font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #00263B; }
.sb-ux .sum2-list-head .text-btn { min-height: 32px; padding: 0; text-transform: none; letter-spacing: 0; font-size: 0.85rem; width: auto; background: none; border: 0; color: #00263B; text-decoration: underline; }
.sb-ux .sum2-hint { font-weight: 500; text-transform: none; letter-spacing: 0; color: #64748b; }
.sb-ux .sum2-row { box-sizing: border-box; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 0.6rem; width: 100%; min-height: 52px; margin: 0; padding: 0.5rem 0.9rem; background: #fff; color: #0f172a; border: 0; border-top: 1px solid #f1f5f9; border-radius: 0; text-align: left; }
.sb-ux .sum2-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-ux .sum2-meta { grid-row: 2; font-size: 0.78rem; color: #64748b; }
.sb-ux .sum2-amt { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.sb-ux .sum2-late { color: #b42318; }
.sb-ux .sum2-empty { margin: 0; padding: 0.8rem 0.9rem; color: #64748b; font-size: 0.9rem; }
.sb-ux .sum2-more { margin: 1rem 0 0.25rem; min-height: 48px; background: #fff; color: #00263B; border: 1px dashed #94a3b8; border-radius: 0.8rem; font-weight: 600; }
/* #168 cash-sale client picker */
.sale-pick-wrap { position: relative; }
.sale-pick-list { position: absolute; left: 0; right: 0; top: calc(100% + 2px); z-index: 20; background: #fff; border: 1px solid #cbd5e1; border-radius: 0.6rem; box-shadow: 0 10px 24px rgba(0, 38, 59, 0.18); overflow: hidden; max-height: 18rem; overflow-y: auto; }
.sale-pick { display: flex; flex-direction: column; align-items: flex-start; width: 100%; min-height: 48px; padding: 0.55rem 0.8rem; background: #fff; color: #0f172a; border: 0; border-bottom: 1px solid #f1f5f9; border-radius: 0; text-align: left; }
.sale-pick:last-child { border-bottom: 0; }
.sale-pick-on, .sale-pick:hover { background: #eef4f8; }
.sale-pick-name { font-weight: 600; font-size: 1rem; }
.sale-pick-meta { font-size: 0.8rem; color: #64748b; font-weight: 400; }
#sale-client-note { margin: 0.3rem 0 0.6rem; padding: 0; background: none; color: #475569; font-size: 0.85rem; font-weight: 500; border-radius: 0; }
.receipt-banner { background: #e7f6ec; color: #14532d; border-radius: 0.5rem; padding: 0.4rem 0.6rem; font-weight: 600; }
#home-cash-sale, #log-cash-sale { width: 100%; margin: 0.5rem 0; }

/* #149: popups (toasts) and the notification list. */
.toast { position: fixed; left: 1rem; right: 1rem; bottom: 5.25rem; z-index: 60; max-width: 30rem; margin: 0 auto; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18); cursor: pointer; }
.bell-btn { position: relative; }
.bell-count { position: absolute; top: -0.1rem; right: -0.2rem; min-width: 1.05rem; height: 1.05rem; padding: 0 0.2rem; border-radius: 0.6rem; background: #e11d48; color: #fff; font-size: 0.65rem; font-weight: 700; line-height: 1.05rem; text-align: center; }
.notes-panel { position: fixed; top: 4.25rem; left: 0.75rem; right: 0.75rem; max-width: 30rem; margin: 0 auto; max-height: 70vh; overflow-y: auto; z-index: 55; background: #fff; border-radius: 0.9rem; padding: 0.9rem; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22); }
.notes-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.notes-head .card-title { flex: 1; margin: 0; }
.notes-head button { width: auto; }
.note-row { border-top: 1px solid #e5e7eb; padding: 0.6rem 0 0.6rem 0.6rem; border-left: 3px solid transparent; }
.note-row.note-unread { border-left-color: #0ea5e9; background: #f0f9ff; }
.note-row.note-error .note-text { color: #9f1239; }
.note-text { font-size: 0.875rem; font-weight: 600; }
.note-when { font-size: 0.75rem; color: #6b7280; margin-top: 0.15rem; }
.note-actions { display: flex; gap: 0.5rem; margin-top: 0.35rem; }
.note-actions button { width: auto; padding: 0.35rem 0.7rem; font-size: 0.8rem; }

/* #107: Form 11 prep. */
.f11-disclaimer { text-align: left; font-weight: 600; }
.f11-table { margin: 0.5rem 0 0.75rem; }
.f11-row { display: flex; justify-content: space-between; gap: 0.75rem; padding: 0.35rem 0; border-bottom: 1px solid #eef0f2; font-size: 0.875rem; }
.f11-row.f11-head { font-weight: 700; border-bottom: 0; padding-top: 0.75rem; text-transform: uppercase; font-size: 0.75rem; color: #6b7280; }
.f11-row.f11-total { font-weight: 700; border-top: 2px solid #1f2937; }
.f11-row.f11-muted { color: #6b7280; }
.f11-amt { white-space: nowrap; font-variant-numeric: tabular-nums; }
.exp-row { border-top: 1px solid #e5e7eb; padding: 0.55rem 0; }
.exp-main { display: flex; justify-content: space-between; gap: 0.75rem; font-weight: 600; font-size: 0.9rem; }

.f11-checklist { margin: 12px 0; padding: 10px 12px; border: 1px solid #e3c770; background: #fff8e1; border-radius: 8px; }
.f11-checklist-title { font-weight: 700; margin-bottom: 4px; }
.f11-checklist ul { margin: 0; padding-left: 20px; }
.f11-checklist li { margin: 2px 0; }

/* #160 mobile UX: Summary panes, collapsible sections, sticky actions */
.sum-panes { margin: 0 0 0.75rem; }
.sum-panes .seg { min-height: 44px; font-size: 0.85rem; }
.sec { border: 1px solid #e2e8f0; border-radius: 0.85rem; background: #ffffff; margin: 0 0 0.6rem; }
.sec-head { width: 100%; min-height: 48px; text-align: left; background: none; color: #00263B; font-weight: 700; padding: 0.7rem 2.2rem 0.7rem 0.9rem; position: relative; border: 0; }
.sec-head::after { content: "▸"; position: absolute; right: 0.9rem; top: 50%; transform: translateY(-50%); color: #64748b; }
.sec.sec-open > .sec-head::after { content: "▾"; }
.sec-body { padding: 0 0.9rem 0.6rem; }
.sec:not(.sec-open) > .sec-body { display: none; }
.sec-flat .sec { border: 0; margin: 0; background: none; }
.sec-flat .sec-head { display: none; }
.sec-flat .sec-body, .sec-flat .sec:not(.sec-open) > .sec-body { display: block; padding: 0; }
.sticky-action, .save-bar { position: sticky; bottom: calc(4.2rem + env(safe-area-inset-bottom, 0px)); z-index: 20; box-shadow: 0 6px 18px rgba(0, 38, 59, 0.25); }
.save-bar { box-shadow: none; padding: 0.5rem 0 0; background: linear-gradient(rgba(255,255,255,0), #ffffff 35%); }
.save-bar button { box-shadow: 0 6px 18px rgba(0, 38, 59, 0.25); }

/* #160 PR B: filters chip, add-line link, payment bottom sheet */
button.chip { width: auto; min-height: 44px; padding: 0.5rem 1rem; border-radius: 999px; background: #f8fafc; color: #00263B; border: 1px solid #cbd5e1; font-weight: 600; margin: 0 0 0.6rem; }
button.chip.chip-on { background: #00263B; color: #FAFFE4; border-color: #00263B; }
#history-filters { margin-bottom: 0.4rem; }
.history-count { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
button.add-line { min-height: 44px; margin: -0.3rem 0 0.6rem; }
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0, 38, 59, 0.45); z-index: 60; }
.bottom-sheet { position: fixed; left: 0; right: 0; bottom: 0; max-width: 28rem; margin: 0 auto; z-index: 61; max-height: 88vh; overflow-y: auto; border-radius: 1.1rem 1.1rem 0 0; padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px)); background: #ffffff; box-shadow: 0 -8px 28px rgba(0, 38, 59, 0.3); }
.bottom-sheet #save-payment { min-height: 52px; font-size: 1.05rem; }
.bottom-sheet .btn-quiet { min-height: 44px; }
.send-dock.dock-hidden { display: none; }

/* #160 PR C: 44px tap targets and a slim test banner, Supabase mode only (html.sb-ux) */
.sb-ux header { padding: calc(0.35rem + env(safe-area-inset-top, 0px)) 0.5rem 0.35rem 1rem; }
.sb-ux header .status-box { gap: 0; }
.sb-ux header .icon-btn, .sb-ux header .help-mark { min-width: 44px; min-height: 44px; width: 44px; height: 44px; padding: 0; }
.sb-ux header .refresh-btn { min-height: 44px; padding: 0 0.6rem; }
.sb-ux nav { padding: 0.25rem 0.35rem calc(0.25rem + env(safe-area-inset-bottom, 0px)); }
.sb-ux nav button, .sb-ux nav a { min-height: 48px; padding: 0.25rem 0.15rem; }
.sb-ux .banner.sample { padding: 0.15rem 0.75rem; font-size: 0.7rem; text-align: center; letter-spacing: 0.04em; text-transform: uppercase; }
.sb-ux .back-home, .sb-ux .see-more, .sb-ux .btn-inline, .sb-ux .text-btn, .sb-ux #change-valid, .sb-ux #clients-archived { min-height: 44px; display: inline-flex; align-items: center; padding-top: 0; padding-bottom: 0; }
.sb-ux .line-remove { min-width: 44px; min-height: 44px; padding: 0 0.6rem; display: inline-flex; align-items: center; justify-content: center; }
.sb-ux .note-row { cursor: pointer; }
.sb-ux .note-actions button, .sb-ux .notes-head button { min-height: 44px; min-width: 44px; padding: 0 0.9rem; }
.sb-ux .bell-count { top: 4px; right: 4px; }

/* #165 Option A: header back, menu, + New sheet, Invoices tab (Supabase) */
.sb-ux header .brand { display: flex; align-items: center; gap: 0.15rem; min-width: 0; }
.sb-ux header .back-arrow { font-size: 1.6rem; line-height: 1; font-weight: 400; }
/* Menu and notifications: one panel system. Both slide in from the right below the header, same width and backdrop; the header stays visible. */
.sb-ux header { z-index: 72; }
.sb-ux .app-menu, .sb-ux .notes-panel { position: fixed; top: var(--hdr, 56px); right: 0; bottom: 0; left: auto; width: min(20rem, 88vw); max-width: none; max-height: none; margin: 0; border-radius: 0; z-index: 70; background: #ffffff; box-shadow: -8px 0 28px rgba(0, 38, 59, 0.25); overflow-y: auto; padding: 0 0 calc(1rem + env(safe-area-inset-bottom, 0px)); animation: sb-panel-in 0.18s ease-out; }
.sb-ux .menu-backdrop { top: var(--hdr, 56px); z-index: 69; }
.sb-ux .panel-head { display: flex; align-items: center; gap: 0.25rem; min-height: 52px; margin: 0; padding: 0.25rem 0.25rem 0.25rem 1rem; background: #ffffff; color: #0f172a; border-bottom: 1px solid #e2e8f0; position: sticky; top: 0; z-index: 1; }
.sb-ux .panel-head .panel-title { flex: 1; margin: 0; padding: 0; border: 0; font-size: 1.05rem; font-weight: 700; color: #0f172a; }
.sb-ux .panel-head .panel-close { flex: 0 0 44px; width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0; margin: 0; background: none; border: 0; color: #0f172a; font-size: 1.1rem; display: flex; align-items: center; justify-content: center; border-radius: 0.5rem; }
.sb-ux .notes-panel .page-lead, .sb-ux .notes-panel .note-row { margin-left: 1rem; margin-right: 1rem; }
.sb-ux .notes-panel .page-lead { margin-top: 1rem; }
.sb-ux header .icon-btn.hdr-on { background: #01344f; }
@keyframes sb-panel-in { from { transform: translateX(100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .sb-ux .app-menu, .sb-ux .notes-panel { animation: none; } }
.sb-ux .menu-group { margin: 0.9rem 1rem 0.2rem; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #64748b; }
.sb-ux .menu-item { display: block; width: 100%; text-align: left; background: none; color: #0f172a; border: 0; border-bottom: 1px solid #f1f5f9; padding: 0.9rem 1rem; font-size: 1rem; font-weight: 600; text-decoration: none; min-height: 48px; }
.sb-ux .menu-item.menu-danger { color: #b42318; }
.sb-ux .new-sheet { z-index: 71; }
.sb-ux .new-sheet .menu-item { border: 1px solid #e2e8f0; border-radius: 0.75rem; margin: 0.4rem 0; background: #f8fafc; }
.sb-ux .fab { position: fixed; right: 1rem; bottom: calc(4.6rem + env(safe-area-inset-bottom, 0px)); z-index: 55; width: 56px; height: 56px; min-height: 56px; padding: 0; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #00263B; color: #FAFFE4; font-size: 2rem; font-weight: 400; line-height: 1; box-shadow: 0 6px 18px rgba(0, 38, 59, 0.3); border: 0; }
/* Room under every screen for the bottom menu + the round + (56px) + the phone's safe area, so nothing hides under them. */
html.sb-ux body { padding-bottom: calc(4.25rem + 56px + 1.25rem + env(safe-area-inset-bottom, 0px)); }
/* help.html (#167 docs) */
.help-sub { margin: 1.25rem 0 0.4rem; font-size: 1rem; font-weight: 700; color: #00263B; }
.help-list { margin: 0; padding: 0; list-style: none; }
.help-list li { padding: 0.55rem 0; border-bottom: 1px solid #f1f5f9; font-size: 0.95rem; line-height: 1.4; }

/* Round 3: Summary KPI strip + Invoiced vs Paid chart */
.sb-ux .kpi-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; background: #fff; border: 1px solid #e2d9c3; border-radius: 0.8rem; overflow: hidden; }
.sb-ux .kpi-strip .kpi { min-height: 0; padding: 0.55rem 0.4rem; border: 0; border-left: 1px solid #efe8d6; border-top: 3px solid #00263B; border-radius: 0; box-shadow: none; align-items: center; text-align: center; }
.sb-ux .kpi-strip .kpi:first-child { border-left: 0; }
.sb-ux .kpi-strip .kpi-paid { border-top-color: #16a34a; }
.sb-ux .kpi-strip .kpi-owed { border-top-color: #dc2626; }
.sb-ux .kpi-strip .kpi-profit { border-top-color: #AA9251; }
.sb-ux .kpi-strip .kpi-k { font-size: 0.62rem; letter-spacing: 0.03em; }
.sb-ux .kpi-strip .kpi-v { font-size: 0.92rem; }
.sb-ux .kpi-note { margin: 0.35rem 0 0.6rem; font-size: 0.75rem; color: #64748b; text-align: center; }
.sb-ux .sum-chart-card { background: #fffdf7; border: 1px solid #e2d9c3; border-radius: 0.8rem; padding: 0.6rem 0.6rem 0.3rem; margin-bottom: 0.8rem; }
.sb-ux .sum-chart-legend { display: flex; gap: 0.9rem; font-size: 0.72rem; font-weight: 700; color: #475569; margin-bottom: 0.2rem; }
.sb-ux .sum-chart-legend .lg::before { content: ""; display: inline-block; width: 0.65rem; height: 0.65rem; border-radius: 2px; margin-right: 0.3rem; vertical-align: -1px; }
.sb-ux .lg-inv::before { background: #00263B; }
.sb-ux .lg-paid::before { background: #AA9251; }
.sb-ux .sum-chart-svg { width: 100%; height: auto; display: block; }
.sb-ux .sum-chart-svg .bar-inv { fill: #00263B; }
.sb-ux .sum-chart-svg .bar-paid { fill: #AA9251; }
.sb-ux .sum-chart-svg text { font-size: 9px; fill: #64748b; font-family: inherit; }

/* Installable app: iOS Add to Home Screen hint in the menu */
.sb-ux .install-hint { margin: 0; padding: 0.7rem 1rem 0.9rem; font-size: 0.88rem; color: #334155; background: #FAFFE4; border-bottom: 1px solid #e2d9c3; }

/* Install banners (Android prompt and iOS Share hint) */
.install-banner { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin: 0 0 0.8rem; padding: 0.7rem 0.8rem; border: 1px solid #e2d9c3; border-radius: 0.8rem; background: #FAFFE4; color: #00263B; }
.install-banner .install-banner-text { flex: 1 1 12rem; margin: 0; font-size: 0.9rem; line-height: 1.35; }
.install-banner .install-banner-actions { display: flex; gap: 0.5rem; width: 100%; }
.install-banner .install-banner-actions button { flex: 1; margin: 0; padding: 0.55rem 0.8rem; min-height: 0; }
.install-banner-ios { flex-wrap: nowrap; }
.install-banner .share-badge { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 2.2rem; height: 2.2rem; border-radius: 0.6rem; background: #fff; border: 1px solid #e2d9c3; color: #007AFF; }
.install-banner .share-inline { width: 1em; height: 1em; vertical-align: -0.15em; color: #007AFF; }
.install-banner .panel-close { flex: 0 0 auto; width: auto; margin: 0; padding: 0.3rem 0.5rem; }

/* Offline saving: status strip under the header */
.offline-strip { display: block; width: 100%; margin: 0; padding: 0.45rem 1rem; min-height: 0; border: 0; border-radius: 0; font-size: 0.85rem; font-weight: 700; text-align: center; color: #fff; background: #475569; }
.offline-strip.offline-sync { background: #AA9251; color: #00263B; }

/* Settings → Payments (Stripe Connect) */
.sb-ux #settings-payments .stripe-status { margin: 0.4rem 0 0.8rem; padding: 0.6rem 0.8rem; border-radius: 0.6rem; background: #f1f5f9; color: #334155; font-weight: 600; font-size: 0.92rem; }
.sb-ux #settings-payments .stripe-status.stripe-on { background: #ecfdf5; color: #166534; }
.sb-ux #settings-payments .btn-line { margin-top: 0.5rem; }
/* Round 4 (Jane's snag list), Supabase mode only */
/* 1. Hints are plain muted text; only real buttons are navy. */
.sb-ux .shift-note { background: none; color: #64748b; padding: 0; border-radius: 0; font-size: 0.85rem; font-weight: 500; line-height: 1.4; }
.sb-ux .pill-draft { background: #fef3c7; color: #92400e; }
/* 2. Menu: cream highlight bands with a gold rule as section separators. */
.sb-ux .app-menu .menu-group { background: #FFF8E6; color: #7a6526; border-top: 3px solid #AA9251; border-bottom: 1px solid #efe3c4; padding: 0.55rem 1rem 0.4rem; }
.sb-ux .app-menu .menu-group:first-of-type { border-top: 0; }
.sb-ux .app-menu .menu-item.menu-danger { border-top: 3px solid #AA9251; }
.sb-ux .app-menu .menu-item:active, .sb-ux .app-menu .menu-item:hover { background: #fffdf5; }
/* 3. Unbilled work: groups per client, light highlight, sticky footer. */
.sb-ux .unbilled-list { display: flex; flex-direction: column; gap: 0.35rem; }
.sb-ux .unbilled-row { min-height: 48px; padding: 0.6rem 0.75rem; border-radius: 0.6rem; font-weight: 500; }
.sb-ux .unbilled-head { background: #f1f5f9; color: #00263B; font-weight: 700; border-color: #e2e8f0; }
.sb-ux .unbilled-list > .unbilled-head ~ .unbilled-head { margin-top: 0.75rem; }
.sb-ux .unbilled-job { margin-left: 0.75rem; width: calc(100% - 0.75rem); }
.sb-ux .unbilled-row.unbilled-on { background: #FFF8E6; border-color: #AA9251; }
.sb-ux .unbilled-head.unbilled-some { border-color: #AA9251; }
.sb-ux .unbilled-mark { color: #00263B; }
.sb-ux .unbilled-amount { font-weight: 700; font-variant-numeric: tabular-nums; }
.sb-ux .unbilled-dock { position: sticky; bottom: calc(4.4rem + env(safe-area-inset-bottom, 0px)); z-index: 20; background: #ffffff; border: 1px solid #e2d9c3; border-top: 3px solid #AA9251; border-radius: 0.8rem; padding: 0.7rem; box-shadow: 0 6px 18px rgba(0, 38, 59, 0.18); display: flex; flex-direction: column; gap: 0.5rem; }
.sb-ux .unbilled-sum { margin: 0; font-size: 1rem; font-weight: 700; color: #00263B; }
.sb-ux .unbilled-switch { margin: 0; font-size: 0.82rem; color: #7a6526; }
.sb-ux .unbilled-dock button { min-height: 48px; padding: 0.75rem; }
.sb-ux .unbilled-draft { display: flex; flex-direction: column; gap: 0.4rem; }
/* 6. Logged jobs: badge per job; invoiced ones are locked. */
.sb-ux .entry-badge { font-size: 0.68rem; font-weight: 700; border-radius: 999px; padding: 0.12rem 0.45rem; background: #f1f5f9; color: #64748b; white-space: nowrap; }
.sb-ux .entry-locked { background: #f8fafc; }
.sb-ux .entry-locked .entry-badge { background: #dcfce7; color: #166534; }
.sb-ux .entry-locked .entry-badge::before { content: "🔒 "; }
.sb-ux .entry-draft .entry-badge { background: #fef3c7; color: #92400e; }
.sb-ux .app-sheet { z-index: 71; }
.sb-ux .app-sheet > * + * { margin-top: 0.7rem; }
.sb-ux .entry-lock { margin: 0; color: #64748b; font-size: 0.9rem; }
.sb-ux .entry-facts { display: grid; grid-template-columns: 5.5rem 1fr; gap: 0.4rem 0.75rem; margin: 0.6rem 0 0; }
.sb-ux .entry-facts dt { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: #94a3b8; padding-top: 0.15rem; }
.sb-ux .entry-facts dd { margin: 0; font-weight: 600; color: #0f172a; overflow-wrap: anywhere; }
/* 8. Inline two-way choice (materials, merge picker). */
.sb-ux .choice-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.sb-ux button.choice { display: flex; flex-direction: column; align-items: flex-start; gap: 0.15rem; text-align: left; min-height: 48px; padding: 0.65rem 0.75rem; background: #ffffff; color: #0f172a; border: 1.5px solid #e2e8f0; border-radius: 0.7rem; font-weight: 500; }
.sb-ux button.choice b { font-weight: 700; color: #00263B; font-size: 0.9rem; }
.sb-ux button.choice span { font-size: 0.75rem; color: #64748b; }
.sb-ux button.choice.choice-on { background: #FFF8E6; border-color: #AA9251; box-shadow: inset 0 0 0 1px #AA9251; }
/* 9. Materials photo: camera or gallery. */
.sb-ux .photo-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.sb-ux label.photo-btn { display: flex; align-items: center; justify-content: center; min-height: 48px; border: 1.5px solid #00263B; border-radius: 0.75rem; background: #ffffff; color: #00263B; font-size: 0.875rem; font-weight: 600; text-transform: none; letter-spacing: 0; cursor: pointer; text-align: center; }
.sb-ux .photo-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
/* 11. Jobs by profit: chart + compact grid. */
.sb-ux .profit-svg .pc-label { font-size: 11.5px; fill: #334155; }
.sb-ux .profit-svg .pc-val { font-size: 11.5px; fill: #00263B; font-weight: 700; }
.sb-ux .sum-chart-svg .bar-loss { fill: #dc2626; }
.sb-ux .profit-table .lt-head, .sb-ux .profit-table .lt-row { grid-template-columns: minmax(0, 1fr) 4.1rem 4.1rem 4.4rem; }
.sb-ux .profit-table .lt-head .lt-col { display: flex; align-items: center; }
.sb-ux .profit-table .lt-r { justify-content: flex-end; }
.sb-ux .profit-table .lt-row { padding-top: 0.35rem; padding-bottom: 0.35rem; }
.sb-ux .pt-job { display: flex; flex-direction: column; min-width: 0; white-space: normal !important; }
.sb-ux .pt-job > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-ux .pt-meta { font-size: 0.72rem; color: #64748b; }
.sb-ux .pt-cost { color: #64748b; font-weight: 500 !important; }
.sb-ux .pt-loss .pt-profit { color: #b42318; }
/* 12. Form 11: one info style; "not deducted" block. */
.sb-ux .info-box { margin: 0; background: #FFFDF5; border: 1px solid #e2d9c3; border-left: 4px solid #AA9251; border-radius: 0.6rem; padding: 0.65rem 0.8rem; color: #00263B; font-size: 0.875rem; font-weight: 500; text-align: left; line-height: 1.45; }
.sb-ux .f11-checklist { margin: 0; }
.sb-ux .f11-checklist ul { padding-left: 1.1rem; }
.sb-ux .f11-notded { border: 1px solid #e2e8f0; border-radius: 0.6rem; padding: 0.5rem 0.75rem; }
.sb-ux .f11-notded-title { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #6b7280; }
.sb-ux .f11-nd-row .f11-row { border-bottom: 0; padding-bottom: 0; }
.sb-ux .f11-nd-why { margin: 0.1rem 0 0.4rem; font-size: 0.8rem; color: #64748b; }
/* 16. Merge picker */
.sb-ux #client-merge-open { color: #00263B; text-decoration: underline; text-underline-offset: 0.18em; min-height: 44px; }
.sb-ux .merge-explain { margin: 0; color: #334155; font-size: 0.92rem; line-height: 1.45; }
.sb-ux .merge-list { display: flex; flex-direction: column; gap: 0.4rem; max-height: 40vh; overflow-y: auto; }
.sb-ux .merge-list button.choice { width: 100%; font-weight: 700; color: #00263B; }
/* 14. Help page in app styling */
.sb-ux .help-sub { margin: 0.4rem 0 0.5rem; font-size: 1.05rem; }
.sb-ux .help-list { background: #ffffff; border: 1px solid #e6eaee; border-radius: 0.95rem; padding: 0.15rem 1rem; box-shadow: 0 1px 2px rgb(0 0 0 / 0.04); margin-bottom: 1.05rem; }
.sb-ux .help-list li { color: #475569; }
.sb-ux .help-list li:last-child { border-bottom: 0; }
.sb-ux .help-list li b { color: #00263B; }
.sb-ux .help-page .help-note { margin-top: 0.2rem; }
.sb-ux .photo-pick + .photo-input + .photo-input + .btn-line, .sb-ux #materials-choice { margin-top: 0.5rem; }
.revolut-pay { margin: 0.5rem 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; font-size: 0.9rem; color: var(--grey, #475569); }
.revolut-pay .revolut-btn { display: inline-block; text-decoration: none; background: #ffffff; color: #00263B; border: 1.5px solid #00263B; border-radius: 8px; padding: 0.55rem 1rem; font-weight: 600; }
.pay-sub { margin: 0.75rem 0 0.25rem; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; color: #475569; }
.pay-choice { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pay-choice button { flex: 1 1 0; width: auto; min-width: 0; padding-left: 0.4rem; padding-right: 0.4rem; margin: 0; }
.pay-choice button.pay-on { background: #00263B; color: #FAFFE4; }
/* Phase 21: Request access (sign-in) and access.html */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.access-page { max-width: 32rem; margin: 0 auto; padding: 1.25rem 1rem 2rem; }
.access-details { margin: 0 0 1.25rem; display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 0.9rem; font-size: 0.95rem; }
.access-details dt { color: #64748b; }
.access-details dd { margin: 0; color: #1e293b; font-weight: 600; overflow-wrap: anywhere; white-space: pre-wrap; }
/* #194: nothing in the panel is wider than the panel. Flex/grid children may shrink, long text wraps, wide tables scroll inside themselves. */
main, main > *, .card { min-width: 0; max-width: 100%; box-sizing: border-box; }
main .card, main p, main h2, main h3, main td, main .lt-col { overflow-wrap: anywhere; }
main table { display: block; max-width: 100%; overflow-x: auto; }
@media (min-width: 48rem) { .sb-ux .fab { right: max(1rem, calc(50vw - 30rem + 1rem)); } }
/* #196: free test banner */
.trial-banner { margin: 0 0 0.8rem; padding: 0.65rem 0.8rem; border-radius: 0.8rem; background: #FAFFE4; border: 1px solid #e2d9c3; color: #00263B; font-size: 0.88rem; font-weight: 600; }
.trial-banner.trial-over { background: #fff1f2; border-color: #fecdd3; color: #9f1239; }
/* #197 feedback */
.sb-ux .fb-kinds { grid-template-columns: 1fr 1fr 1fr; margin: 0.5rem 0 0.75rem; }
#feedback-sheet textarea { width: 100%; box-sizing: border-box; }
.fb-kinds button.pay-on { background: #00263B; color: #FAFFE4; }
/* #198 Admin */
.admin-page { position: fixed; inset: 0; z-index: 80; background: #f4f6f8; overflow-y: auto; padding: 0 1rem calc(2rem + env(safe-area-inset-bottom, 0px)); box-sizing: border-box; }
.admin-page .panel-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 0.5rem; background: #00263B; color: #FAFFE4; margin: 0 -1rem 0.75rem; padding: calc(0.6rem + env(safe-area-inset-top, 0px)) 1rem 0.6rem; }
.admin-page .panel-title { flex: 1; margin: 0; color: #FAFFE4; font-size: 1.1rem; }
.admin-page .panel-head .icon-btn, .admin-page .adm-refresh { width: auto; background: transparent; color: #FAFFE4; border: 1.5px solid #FAFFE4; padding: 0.4rem 0.8rem; }
.admin-page > * { max-width: 60rem; margin-left: auto; margin-right: auto; }
.adm-kpis { margin-bottom: 0.8rem; }
.adm-kpis .metric-box { display: flex; flex-direction: column; gap: 0.2rem; padding: 0.7rem; background: #fff; border: 1px solid #e2e8f0; border-radius: 0.75rem; }
.adm-kpis .metric-label { font-size: 0.72rem; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: 0.04em; }
.adm-kpis .metric-val { font-size: 1.3rem; font-weight: 700; color: #00263B; }
.adm-biz-list { background: #fff; border: 1px solid #e2e8f0; border-radius: 0.75rem; overflow: hidden; }
.adm-biz { border-top: 1px solid #f1f5f9; }
.adm-biz:first-child { border-top: 0; }
button.adm-biz-row { display: flex; flex-direction: column; align-items: flex-start; gap: 0.15rem; width: 100%; background: #fff; color: #0f172a; border-radius: 0; padding: 0.7rem 0.9rem; text-align: left; }
.adm-biz-name { font-weight: 700; }
.adm-biz-meta { font-size: 0.78rem; color: #64748b; font-weight: 500; overflow-wrap: anywhere; }
.adm-tl { padding: 0 0.9rem; }
.adm-timeline { margin: 0 0 0.7rem; padding-left: 1.1rem; font-size: 0.8rem; color: #334155; }
.adm-list { list-style: none; margin: 0 0 1rem; padding: 0; background: #fff; border: 1px solid #e2e8f0; border-radius: 0.75rem; }
.adm-list li { padding: 0.6rem 0.9rem; border-top: 1px solid #f1f5f9; font-size: 0.85rem; overflow-wrap: anywhere; }
.adm-list li:first-child { border-top: 0; }
.adm-msg { color: #0f172a; }
.admin-page .sum-chart-svg .bar-inv { fill: #00263B; }
.admin-page .sum-chart-svg text { font-size: 9px; fill: #64748b; }
@media (min-width: 48rem) { .sb-ux .adm-kpis { grid-template-columns: repeat(4, 1fr); } }
#admin-page .panel-title { color: #FAFFE4; }
.admin-page > .panel-head { max-width: none; }
.admin-page .sum-chart-card { max-width: 34rem; margin-left: 0; }
/* #199 View as */
.view-as-banner { position: sticky; top: var(--hdr, 56px); z-index: 45; display: flex; align-items: center; gap: 0.6rem; margin: 0 0 0.8rem; padding: 0.6rem 0.8rem; border-radius: 0.8rem; background: #fef3c7; border: 2px solid #d97706; color: #78350f; font-weight: 700; font-size: 0.9rem; }
.view-as-banner span { flex: 1; overflow-wrap: anywhere; }
button.view-as-exit { width: auto; padding: 0.45rem 0.9rem; background: #92400e; color: #fff; border-radius: 0.6rem; }
html.view-as header { border-bottom-color: #d97706; }
button.adm-view-as { width: auto; margin: 0 0.9rem 0.6rem; padding: 0.45rem 0.8rem; font-size: 0.82rem; }
