:root {
  --bg: #f5f4ef;
  --surface: #ffffff;
  --ink: #1c2420;
  --muted: #69736e;
  --line: #e2e0d8;
  --line-strong: #cfccc2;
  --brand: #1f5c4a;
  --brand-ink: #ffffff;
  --brand-soft: #e6efe9;
  --warn: #9a5b00;
  --warn-soft: #fbf1df;
  --danger: #b3261e;
  --danger-soft: #fbe9e7;
  --ok: #1f6f3f;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 30, 25, .06), 0 4px 16px rgba(20, 30, 25, .04);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.45;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 26px; margin: 0; letter-spacing: -.01em; font-weight: 650; }
h2 { font-size: 17px; margin: 28px 0 10px; font-weight: 620; }
h3 { font-size: 15px; margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; letter-spacing: .01em; }
.r { text-align: right; }
.nowrap { white-space: nowrap; }
.danger { color: var(--danger); }
.ok { color: var(--ok); }
.spacer { flex: 1; }
.center { padding: 60px; text-align: center; }

/* Shell */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); padding: 18px 14px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { font-weight: 750; font-size: 19px; letter-spacing: -.02em; padding: 2px 8px 14px; color: var(--ink); }
.brand span, .brand-lg span { color: var(--brand); }
.company { padding: 10px 8px 14px; border-bottom: 1px solid var(--line); margin-bottom: 10px; display: flex; flex-direction: column; gap: 2px; }
.company select { font-weight: 600; }
.role { font-size: 12px; color: var(--muted); text-transform: capitalize; }
.sidebar nav { display: flex; flex-direction: column; gap: 1px; }
.sidebar nav a { color: var(--ink); padding: 7px 10px; border-radius: 7px; font-size: 14.5px; }
.sidebar nav a:hover { background: var(--bg); text-decoration: none; }
.sidebar nav a.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav-section { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 14px 10px 4px; }
.sidebar-foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.topbar { display: none; }
.content { padding: 28px 36px 80px; max-width: 1240px; width: 100%; }

/* Page header */
.page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-header .subtitle { color: var(--muted); margin-top: 4px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.page-header .actions { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.back { margin-bottom: 6px; display: inline-block; }

/* Buttons and inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 8px; padding: 8px 14px; font: inherit; font-size: 14px; font-weight: 560; cursor: pointer; border: 1px solid transparent; line-height: 1.2; white-space: nowrap; }
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover:not(:disabled) { background: #184c3d; }
.btn-secondary { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn-secondary:hover:not(:disabled) { background: var(--bg); }
.btn-danger { background: var(--surface); border-color: #e7b8b3; color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-ghost { background: transparent; color: var(--brand); padding-left: 6px; padding-right: 6px; }
.btn-ghost:hover { background: var(--brand-soft); }
.btn.full { width: 100%; margin-top: 8px; }
.link { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; cursor: pointer; }
.link.danger { color: var(--danger); }
input, select, textarea { font: inherit; font-size: 14.5px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 7px; padding: 7px 9px; width: 100%; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(31, 92, 74, .25); border-color: var(--brand); }
input[type=checkbox] { width: auto; accent-color: var(--brand); }
/* iPhone draws date boxes wider than the others and centres the text; make them behave like every other box */
input[type=date], input[type=month] { -webkit-appearance: none; appearance: none; display: block; box-sizing: border-box; max-width: 100%; min-height: 2.35em; text-align: left; }
input[type=date]::-webkit-date-and-time-value, input[type=month]::-webkit-date-and-time-value { text-align: left; }
input.money { text-align: right; font-variant-numeric: tabular-nums; }
input.plain { border-color: transparent; background: transparent; color: var(--muted); padding: 3px 9px; }
input.plain:focus { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.inline-num { width: 64px; display: inline-block; padding: 2px 6px; margin: 0 2px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field.wide { grid-column: 1 / -1; }
.field-label { font-size: 13px; font-weight: 560; color: #3c4541; }
.field-hint { font-size: 12.5px; color: var(--muted); }
.field-error { font-size: 12.5px; color: var(--danger); }
.check { display: flex; gap: 8px; align-items: center; margin: 8px 0; cursor: pointer; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.tight { gap: 4px; flex-wrap: nowrap; }
.row > select, .row > input { flex: 1; }
.segmented { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; background: var(--surface); }
.segmented button { border: 0; background: transparent; padding: 7px 14px; font: inherit; font-size: 14px; cursor: pointer; color: var(--muted); }
.segmented button + button { border-left: 1px solid var(--line-strong); }
.segmented button.on { background: var(--brand); color: #fff; font-weight: 560; }
.segmented.small button { padding: 5px 10px; font-size: 13px; }

/* Layout helpers */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.gap-top { margin-top: 18px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card.form { padding: 22px 24px; }
.form-actions { display: flex; gap: 10px; align-items: center; position: sticky; bottom: 0; padding: 14px 0; background: linear-gradient(transparent, var(--bg) 35%); }
.notice { background: var(--brand-soft); border-radius: 8px; padding: 10px 14px; margin: 4px 0 16px; font-size: 14px; }
.notice.warn { background: var(--warn-soft); color: #5c3a00; }
.hint { font-size: 12.5px; color: var(--muted); margin: 6px 0; }
.error-box { background: var(--danger-soft); color: var(--danger); border: 1px solid #f0c4bf; padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; }
.loading { padding: 40px; color: var(--muted); text-align: center; }
.empty { padding: 28px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.tag { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--brand-soft); color: var(--brand); margin-left: 6px; font-weight: 560; }
.tag.small { font-size: 11px; padding: 1px 6px; }
.tag.subtle { background: var(--bg); color: var(--muted); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.status { font-size: 12.5px; padding: 2px 9px; border-radius: 99px; font-weight: 560; white-space: nowrap; }
.status-draft { background: #eef0f7; color: #3d4a7a; }
.status-posted { background: var(--brand-soft); color: var(--brand); }
.status-paid { background: #e5f2e9; color: var(--ok); }
.status-reversed, .status-rejected { background: var(--danger-soft); color: var(--danger); }
.status-pending { background: var(--warn-soft); color: var(--warn); }
.status-approved { background: #e5f2e9; color: var(--ok); }

/* Tables */
.table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; font-size: 14.5px; }
.table th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 9px 12px; border-bottom: 1px solid var(--line); background: #fbfaf7; }
.table th.r { text-align: right; }
.table td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table.compact td, .table.compact th { padding: 6px 10px; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: #f8f7f2; }
.table tr.selected td { background: #f2f7f4; }
.table tr.total td, .table tr.subtotal td { font-weight: 600; background: #fbfaf7; }
.table tr.grand td { font-weight: 700; border-top: 2px solid var(--line-strong); background: #fbfaf7; }
.table tr.head td { font-weight: 650; padding-top: 16px; color: var(--brand); border-bottom: 0; }
.table tr.group td { font-weight: 600; color: var(--muted); background: #fbfaf7; }
.table td.indent { padding-left: 28px; }
.table.lines { border: 0; box-shadow: none; margin: 16px 0 8px; }
.table.lines td { border-bottom: 0; padding: 6px 6px; }
.table.lines tr.sub td { padding-top: 0; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.table.lines th { background: transparent; padding: 6px; }
.amount { font-variant-numeric: tabular-nums; white-space: nowrap; }
.amount.neg { color: var(--danger); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 4px 0 14px; overflow-x: auto; }
.tab { border: 0; background: none; font: inherit; font-size: 14.5px; padding: 9px 14px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.tab .count { margin-left: 6px; font-size: 12px; background: var(--bg); padding: 1px 7px; border-radius: 99px; color: var(--muted); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.filters > select, .filters > input { width: auto; min-width: 140px; }
.filters .field { margin-bottom: 0; }
.date-range { display: flex; gap: 8px; }
.date-range .field { margin-bottom: 0; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin: 26px 0 10px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }

/* Overview */
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 22px; }
.quick-action { display: flex; flex-direction: column; gap: 3px; background: var(--brand); color: #fff; border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.quick-action:hover { text-decoration: none; background: #184c3d; }
.quick-action b { font-size: 16px; }
.quick-action span { font-size: 13px; opacity: .85; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stats.small .stat-value { font-size: 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; color: var(--ink); box-shadow: var(--shadow); }
a.stat:hover { border-color: var(--brand); text-decoration: none; }
.stat.highlight { border-color: var(--brand); background: var(--brand-soft); }
.stat-label { font-size: 13px; color: var(--muted); }
.stat-value { font-size: 23px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat-note { font-size: 12px; color: var(--muted); }
.accounts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.account-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; color: var(--ink); box-shadow: var(--shadow); }
.account-tile:hover { border-color: var(--brand); text-decoration: none; }
.account-name { font-weight: 600; }

/* Totals panel */
.totals { background: #fbfaf7; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; align-self: start; }
.totals > div { display: flex; justify-content: space-between; padding: 4px 0; }
.totals .grand { border-top: 1px solid var(--line-strong); margin-top: 6px; padding-top: 10px; font-size: 17px; }
.discount-box { background: #fbfaf7; border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 10px; }
.kv { display: flex; justify-content: space-between; padding: 4px 0; gap: 12px; }
.kv.col { flex-direction: column; justify-content: flex-start; gap: 2px; }
.kv.col > span:first-child { font-size: 13px; color: var(--muted); }
.kv.strong { font-weight: 650; }
details.journal { margin-top: 22px; }
details.journal summary { cursor: pointer; font-weight: 600; margin-bottom: 10px; }
.report-nav { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 14px; }
.report-nav a { padding: 6px 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); font-size: 14px; }
.report-nav a.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.report-nav a:hover { text-decoration: none; border-color: var(--brand); }
.report-table { border: 0; }
.coa h2 { margin-top: 22px; }

/* Bill paper */
.doc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 18px; align-items: start; }
.paper { background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 40px 44px; box-shadow: var(--shadow); min-height: 520px; }
.paper-head { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 20px; border-bottom: 2px solid var(--ink); }
.paper-company { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.paper-title { font-size: 15px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--brand); }
.paper-to { margin: 22px 0; display: flex; flex-direction: column; gap: 2px; }
.paper-lines { width: 100%; border-collapse: collapse; }
.paper-lines th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-bottom: 1px solid var(--line-strong); padding: 8px 0; }
.paper-lines td { padding: 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.paper-lines tfoot td { border-bottom: 0; padding: 5px 0; }
.paper-lines th + th, .paper-lines td + td { padding-left: 14px; }
.paper-lines tfoot tr.grand td { font-weight: 700; font-size: 17px; border-top: 2px solid var(--ink); padding-top: 10px; }
.paper-lines td.r, .paper-lines th.r { text-align: right; padding-left: 20px; font-variant-numeric: tabular-nums; }
.paper-note { margin-top: 24px; white-space: pre-wrap; }
.paper-foot { margin-top: 40px; }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 20% 10%, #e3ece6, var(--bg) 55%); }
.login-card { background: var(--surface); width: 100%; max-width: 380px; border-radius: 14px; padding: 32px; box-shadow: 0 10px 40px rgba(20, 30, 25, .1); border: 1px solid var(--line); display: flex; flex-direction: column; }
.brand-lg { font-size: 28px; font-weight: 750; letter-spacing: -.02em; }
.fine { font-size: 12px; color: var(--muted); text-align: center; margin: 18px 0 0; }

/* Modal and toasts */
.modal-backdrop { position: fixed; inset: 0; background: rgba(20, 28, 24, .35); display: grid; place-items: center; padding: 20px; z-index: 50; }
.modal { background: var(--surface); border-radius: 14px; width: 100%; max-width: 620px; max-height: 92vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0, 0, 0, .2); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); }
.toasts { position: fixed; top: 18px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow); font-size: 14px; }

/* Mobile */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; align-content: start; }  /* short pages must not stretch the top bar */
  .sidebar { position: fixed; z-index: 40; left: 0; top: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.15); }
  .shell.nav-open .sidebar { transform: none; }
  .topbar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
  .topbar .brand { padding: 0; }
  .menu { font-size: 22px; color: var(--ink); }
  .content { padding: 18px 14px 80px; }
  .grid-2, .grid-3, .grid-4, .doc-layout { grid-template-columns: 1fr; }
  .quick { grid-template-columns: 1fr 1fr; gap: 8px; }
  .quick-action { padding: 12px 14px; }
  .quick-action span { display: none; }
  h1 { font-size: 22px; }
  .table { display: block; overflow-x: auto; }
  .paper { padding: 22px; }
}

/* Print: only the document */
@media print {
  :root { background: #fff; }
  .sidebar, .topbar, .page-header, .no-print, .notice, .toasts, .form-actions, .filters, .report-nav { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; max-width: none; }
  .doc-layout { display: block; }
  .paper, .card { border: 0; box-shadow: none; padding: 0; }
  .report.card { padding: 0; }
}

/* Phase 2: accounts, settings, master login */
.right { text-align: right; }
.center-text { text-align: center; }
.pre { white-space: pre-wrap; }
.table-wrap { overflow-x: auto; }
.tab-body { margin-top: 18px; }
.card-head { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.auth-title { font-size: 19px; margin: 6px 0 2px; }
.auth-links { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; font-size: 14px; flex-wrap: wrap; }
.setup-wrap { min-height: 100vh; padding: 40px 20px; }
.setup { max-width: 860px; margin: 0 auto; }
.setup h1 { margin: 18px 0 4px; }
.setup > .muted { margin: 0 0 18px; }
.type-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 4px 0 14px; }
.type-card { text-align: left; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; padding: 12px; cursor: pointer; font: inherit; display: flex; flex-direction: column; gap: 4px; color: var(--ink); }
.type-card span { font-size: 12.5px; color: var(--muted); }
.type-card.on { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand) inset; }
.banner { background: var(--brand-soft); border-radius: 8px; padding: 10px 14px; margin-bottom: 16px; font-size: 14px; }
.banner.warn { background: var(--warn-soft); color: #5c3a00; }
.settings-split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.invoice-preview { position: sticky; top: 16px; }
.invoice-preview .paper { min-height: 0; padding: 22px; font-size: 13px; margin-top: 6px; }
.invoice-preview .paper-head { border-bottom-color: var(--brand); align-items: center; }
.invoice-preview .paper-head img { max-height: 48px; max-width: 140px; }
.invoice-preview .paper-name { font-weight: 700; font-size: 16px; margin-top: 6px; }
.invoice-preview .paper-title { font-size: 11px; text-align: right; }
.pv-line, .pv-total { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); margin-top: 14px; }
.pv-total { font-weight: 700; border-bottom: 0; border-top: 2px solid var(--brand); margin-top: 0; }
.logo-row { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.logo-row .field { margin-bottom: 0; }
.logo-box { width: 140px; height: 70px; border: 1px dashed var(--line-strong); border-radius: 8px; display: flex; align-items: center; justify-content: center; background: #fafaf7; }
.logo-box img { max-width: 130px; max-height: 60px; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
input[type=color] { width: 56px; height: 36px; padding: 2px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; background: #efeee8; padding: 1px 5px; border-radius: 4px; margin-right: 4px; }
.check-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.radio { display: flex; gap: 8px; align-items: baseline; margin: 6px 0; cursor: pointer; }
.radio input { width: auto; accent-color: var(--brand); }
.copy-row { display: flex; gap: 8px; }
.role-guide { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 16px; }
.role-guide > div { display: flex; flex-direction: column; gap: 2px; }
.row-error td { background: var(--danger-soft); }
.custom-fields { margin-top: 6px; }
.paper-logo { max-height: 64px; max-width: 200px; display: block; margin-bottom: 8px; }
.paper-head { border-bottom-color: var(--brand); }
.paper-terms { margin-top: 24px; }
.paper-bank { margin-top: 12px; padding: 10px 12px; background: #f7f7f3; border-radius: 6px; }
.operator-shell { min-height: 100vh; }
.op-top { display: flex; gap: 16px; align-items: center; padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--line); }
.operator-shell .content { max-width: 1240px; margin: 0 auto; }
.facts { display: grid; grid-template-columns: 140px 1fr; gap: 4px 12px; margin: 0; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.stat-row { display: flex; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.stat-row > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; display: flex; flex-direction: column; min-width: 160px; }
.stat-row span { font-size: 12.5px; color: var(--muted); }
.stat-row b { font-size: 18px; font-variant-numeric: tabular-nums; }
@media (max-width: 860px) {
  .type-grid, .role-guide { grid-template-columns: 1fr 1fr; }
  .settings-split { grid-template-columns: 1fr; }
  .invoice-preview { position: static; }
  .check-list { grid-template-columns: 1fr 1fr; }
  .facts { grid-template-columns: 1fr; }
  .op-top { flex-wrap: wrap; padding: 10px 14px; }
  .setup-wrap { padding: 20px 12px; }
}
@media print { .banner { display: none !important; } .paper-bank { background: none; border: 1px solid #ddd; } }
.tabs { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs .tab { flex: none; }
.content { min-width: 0; }
.tab-body .card { overflow-x: auto; }
@media (max-width: 860px) { .copy-row { flex-direction: column; } .card-head .btn { flex: 1; } }
td .link + .link, td .link + a, td a + .link { margin-left: 14px; }

/* AI setup assistant */
.setup-choice { grid-template-columns: repeat(2, 1fr); }
.setup-choice .type-card { padding: 18px; }
.setup-choice .type-card b .tag { font-size: 11px; color: var(--brand); }
.ai-chat { padding: 0; overflow: hidden; }
.ai-log { display: flex; flex-direction: column; gap: 10px; padding: 16px; max-height: 56vh; overflow-y: auto; }
.ai-msg { max-width: 85%; padding: 10px 14px; border-radius: 14px; font-size: 14.5px; line-height: 1.45; overflow-wrap: anywhere; }
.ai-msg p { margin: 0; white-space: pre-wrap; }
.ai-msg p + p { margin-top: 6px; }
.ai-model { align-self: flex-start; background: var(--bg); border-bottom-left-radius: 4px; }
.ai-user { align-self: flex-end; background: var(--brand); color: var(--brand-ink); border-bottom-right-radius: 4px; }
.ai-q { font-weight: 600; }
.ai-thinking p { color: var(--muted); font-style: italic; }
.ai-options { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 12px; }
.ai-chip { font: inherit; font-size: 13.5px; border: 1px solid var(--brand); color: var(--brand); background: var(--surface); border-radius: 99px; padding: 6px 12px; cursor: pointer; }
.ai-chip:hover:not(:disabled) { background: var(--brand-soft); }
.ai-chip:disabled { opacity: .5; cursor: default; }
.ai-input { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); align-items: flex-end; }
.ai-input textarea { flex: 1; resize: vertical; min-height: 44px; font: inherit; }
.ai-chat .fine { padding: 0 16px 12px; margin: 0; }
.ai-chat .error-box { margin: 0 16px 12px; }
.ai-ready { display: flex; align-items: center; gap: 12px; justify-content: space-between; margin: 0 16px 12px; padding: 10px 14px; background: var(--brand-soft); border-radius: 10px; }
.ai-resume p { margin-top: 0; }
.ai-review h3 { margin: 0 0 12px; font-size: 16px; }
.ai-adviser { margin-bottom: 16px; }
.ai-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.ai-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.ai-row > *, .ai-acc > *, .ai-add > * { min-width: 0; }
.ai-coa { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.ai-acc { display: grid; grid-template-columns: 90px minmax(0, 1fr) 120px 210px; gap: 8px; align-items: center; }
.ai-acc > :last-child { justify-self: start; }
.ai-acc.ai-group input { font-weight: 650; }
.ai-acc.ai-child { padding-left: 18px; }
.ai-acc .tag { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ai-type { font-size: 12.5px; color: var(--muted); }
.ai-code { width: 100%; }
.ai-add { display: grid; grid-template-columns: 90px minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: center; padding-top: 10px; border-top: 1px dashed var(--line); }
.ai-notes ul, .ai-errors ul { margin: 4px 0 12px; padding-left: 20px; }
.ai-notes li, .ai-errors li { margin: 3px 0; overflow-wrap: anywhere; }
.approval-ai { margin-top: 10px; padding: 10px 14px; background: var(--brand-soft); border-radius: 8px; font-size: 13.5px; }
.approval-ai ul { margin: 4px 0 6px; padding-left: 20px; }
.feature-row { display: flex; align-items: center; gap: 16px; justify-content: space-between; flex-wrap: wrap; }
@media (max-width: 860px) {
  .setup-choice { grid-template-columns: 1fr; }
  .ai-msg { max-width: 92%; }
  .ai-row { grid-template-columns: 1fr 1fr; }
  .ai-row > input { grid-column: 1 / -1; }
  .ai-acc { grid-template-columns: 72px minmax(0, 1fr); }
  .ai-acc .ai-type { grid-column: 2; }
  .ai-acc > :nth-child(4) { grid-column: 2; justify-self: start; }
  .ai-acc.ai-child { padding-left: 8px; }
  .ai-add { grid-template-columns: 72px minmax(0, 1fr); }
  .ai-add select, .ai-add .btn { grid-column: 1 / -1; }
  .ai-ready { flex-direction: column; align-items: stretch; }
  .ai-review .form-actions { flex-wrap: wrap; position: static; }
  .ai-review .form-actions .btn { flex: 1 1 100%; }
  .ai-review .form-actions .spacer { display: none; }
}

/* AI entry ("Ask AI") */
.ai-entry { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.ai-entry > * { min-width: 0; }
.ai-entry .ai-chat { margin: 0; }
.ai-entry .ai-log { max-height: 52vh; }
.ai-examples { padding: 8px 0 0; }
.ai-file { font-size: 12.5px; opacity: .85; }
.ai-attach { flex: none; }
.ai-draft { margin: 0; display: flex; flex-direction: column; gap: 12px; }
.ai-draft-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ai-draft-head h3 { margin: 2px 0 0; font-size: 18px; }
.eyebrow { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--brand); font-weight: 650; }
.ai-draft .facts { margin: 0; }
.ai-lines td, .ai-lines th { font-variant-numeric: tabular-nums; }
.ai-lines-total td { font-weight: 650; border-top: 1px solid var(--line-strong); }
.ai-note { margin: 0; }
.ai-needs { display: flex; flex-direction: column; gap: 10px; padding: 12px; background: var(--warn-soft); border-radius: 10px; }
.ai-need { display: flex; flex-direction: column; gap: 6px; }
.ai-need-q { font-weight: 600; font-size: 14px; }
.ai-need-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.ai-need select { max-width: 100%; }
.ai-mini { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); }
.ai-draft-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ai-done { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.ai-done-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ai-entry-foot { display: flex; flex-wrap: wrap; gap: 16px; margin: 12px 0; }
.ai-recent { margin-top: 8px; }
.ai-recent-row { display: flex; justify-content: space-between; gap: 12px; width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--line); padding: 10px 0; font: inherit; color: var(--ink); cursor: pointer; }
.ai-recent-row:hover .ai-recent-text { color: var(--brand); }
.ai-recent-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.attachments { margin-top: 16px; }
.attachment-list { display: flex; flex-wrap: wrap; gap: 12px; }
.attachment { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 8px; max-width: 100%; }
.attachment img, .attachment-icon { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; background: var(--bg); flex: none; }
.attachment-icon { display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--muted); font-size: 13px; }
.attachment-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.attachment-name { overflow-wrap: anywhere; font-size: 14px; }
@media (max-width: 860px) {
  .ai-entry { grid-template-columns: 1fr; }
  .ai-entry .ai-input { flex-wrap: wrap; }
  .ai-entry .ai-input textarea { flex-basis: 100%; order: -1; }
  .ai-draft-actions .btn { flex: 1 1 auto; }
  .ai-draft-actions .spacer { display: none; }
}

/* AI settings and plans */
.ai-settings { display: flex; flex-direction: column; gap: 16px; }
.ai-settings .card { margin: 0; }
.ai-words { max-width: 340px; overflow-wrap: anywhere; }
.form-actions-inline { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.plans-table input { width: 100%; min-width: 70px; }
.plans-table td:first-child input { min-width: 110px; }
.notify-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.notify-edit { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.notify-edit input { min-width: 240px; max-width: 100%; }
.status-sent { background: var(--brand-soft); color: var(--ok); }
.status-queued { background: var(--warn-soft); color: var(--warn); }
.status-failed { background: var(--danger-soft); color: var(--danger); }
.wht-card .card-head { flex-wrap: wrap; gap: 8px; }
.wht-card .card-head input[type=month] { width: auto; }

/* Import screen: chart of accounts review */
.segmented { flex-wrap: wrap; max-width: 100%; }
.wrap-head { flex-wrap: wrap; gap: 8px; }
.chart-table input:not([type=checkbox]), .chart-table select { width: 100%; min-width: 90px; font: inherit; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.chart-table td:nth-child(2) input { min-width: 180px; }
.chart-table tr.chart-heading input, .chart-table tr.chart-heading select { font-weight: 600; }
.chart-table td.c { text-align: center; }
ul.plain { list-style: none; padding: 0; margin: 6px 0 0; }
ul.plain li { padding: 2px 0; }

/* AI coming soon */
.nav-soon { margin-left: 6px; font-size: 10.5px; vertical-align: 1px; }
.ai-soon { max-width: 720px; }
.ai-soon h3 { margin: 10px 0 6px; }
.ai-soon .plain li { padding: 3px 0; }
.setup-soon { margin-top: -4px; }

/* Master login: email test and problems */
.test-email { flex-wrap: wrap; gap: 8px; }
.outbox-error { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Waiting for approval */
.pending-actions { display: grid; gap: 6px; margin: 4px 0 8px; }
.pending-actions p { margin: 0; }

/* Feedback */
.feedback-btn { width: 100%; margin-bottom: 8px; }
.topbar-feedback { margin-left: auto; font-size: 14px; }
.feedback-shot { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.feedback-preview { display: block; max-width: 100%; max-height: 340px; border: 1px solid var(--line); border-radius: 8px; margin-top: 10px; }
.feedback-table .feedback-msg { max-width: 420px; white-space: pre-wrap; overflow-wrap: anywhere; }
.strong-row td { font-weight: 600; }

/* Simple / Accountant mode */
.mode-switch { display: flex; width: 100%; margin: 4px 0 12px; }
.mode-switch button { flex: 1; padding: 6px 8px; font-size: 13px; }
.simple-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin: 8px 0 20px; }
.simple-actions.two { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.simple-action { display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: var(--ink); box-shadow: var(--shadow); min-height: 96px; }
.simple-action:hover { border-color: var(--brand); }
.simple-action b { font-size: 17px; color: var(--brand); }
.simple-action span { color: var(--muted); font-size: 14px; line-height: 1.4; }
.simple-stats { margin-bottom: 14px; }
.simple-todo { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0 0 14px; }
.simple-todo a { font-weight: 600; }
.simple-recent ul.plain li a { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; align-items: baseline; }
.simple-recent ul.plain li:first-child a { border-top: 0; }
.ai-details { margin: 8px 0; }
.ai-details summary { cursor: pointer; color: var(--brand); font-size: 14px; }
@media (max-width: 560px) { .simple-recent ul.plain li a { grid-template-columns: 1fr auto; } .simple-recent ul.plain li a .muted.small { display: none; } }
.sidebar > * { flex-shrink: 0; }  /* never squeeze menu sections; the menu scrolls instead */
.sidebar-foot { flex-wrap: wrap; }
.sidebar-foot .feedback-btn { flex-basis: 100%; }
.sidebar-foot .muted.small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }

/* Guided (plain-language) sale and purchase: one question per screen, phone first */
.guided { max-width: 560px; }
.guided h2 { font-size: 20px; margin: 6px 0 14px; }
.guided h3 { font-size: 16px; margin: 18px 0 10px; }
.guided .field { display: flex; margin-bottom: 12px; }
.guided .field input, .guided .field select { font-size: 16px; min-height: 44px; }  /* 16px stops phones zooming in */
.guided-dots { display: flex; gap: 6px; margin: 2px 0 10px; }
.guided-dots span { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.guided-dots span.on { background: var(--brand); }
.guided-choices { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); margin-bottom: 8px; }
.guided-choices .simple-action { font: inherit; text-align: left; cursor: pointer; min-height: 56px; padding: 14px 16px; justify-content: center; }
.guided-choices .simple-action.on { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand) inset; }
.guided-picker input[type=search] { width: 100%; font-size: 16px; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line-strong, var(--line)); border-radius: 10px; margin-bottom: 8px; box-sizing: border-box; }
.guided-list { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow-y: auto; margin-bottom: 12px; }
.guided-list button { font: inherit; font-size: 16px; text-align: left; padding: 12px 14px; min-height: 46px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); cursor: pointer; }
.guided-list button:hover { border-color: var(--brand); }
.guided-list button.add { color: var(--brand); font-weight: 600; border-style: dashed; }
.guided-list button.add.on { border-style: solid; border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand) inset; }
.guided-picked { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border: 2px solid var(--brand); border-radius: 10px; background: var(--surface); margin-bottom: 12px; font-size: 17px; }
.guided-line { padding: 12px 14px 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); margin-bottom: 10px; }
.guided-line .link.danger { margin-bottom: 10px; }
.guided-review { padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 17px; line-height: 1.5; margin-bottom: 12px; }
.guided-review p { margin: 0 0 10px; }
.guided-nav { display: flex; justify-content: space-between; gap: 10px; margin: 18px 0 8px; flex-wrap: wrap; }
.guided-nav .btn { min-height: 46px; min-width: 110px; font-size: 16px; }
.guided-alt { margin-top: 18px; }
.guided-done { text-align: center; padding: 24px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.guided-done h2 { margin: 8px 0; }
.guided-done p { margin: 4px 0; font-size: 16px; }
.guided-tick { width: 52px; height: 52px; border-radius: 50%; margin: 0 auto; display: grid; place-items: center; background: var(--brand); color: #fff; font-size: 28px; }
@media (max-width: 560px) {
  .guided-choices { grid-template-columns: 1fr; }
  .guided-nav .btn { flex: 1; }
  .guided-nav > span:empty { display: none; }
  .guided-done + .guided-nav { flex-direction: column; }
}

/* Master login inside a company */
.btn-sm { padding: 5px 10px; font-size: 13px; }
.support-banner { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; }
.support-banner .btn { flex-shrink: 0; }
.link.company-open { text-align: left; padding: 0; color: var(--brand); }
.activity-list li { display: grid; grid-template-columns: 150px 1fr; gap: 4px 14px; padding: 9px 0; border-top: 1px solid var(--line); }
.activity-list li:first-child { border-top: 0; }
.activity-list li.support { background: #fff8e6; margin: 0 -12px; padding: 9px 12px; }
@media (max-width: 560px) { .activity-list li { grid-template-columns: 1fr; } }
.guided-add { display: inline-block; margin: 2px 0 8px; font-size: 15px; padding: 6px 0; }
/* Phones: the Save / Record buttons sit after the form instead of floating over the totals */
@media (max-width: 860px) {
  .form-actions { position: static; background: none; flex-wrap: wrap; padding: 16px 0 4px; }
  .form-actions .btn { min-height: 44px; flex: 1 1 auto; }
  .form-actions .spacer { display: none; }
}

/* Products: extra units with conversion; quantity boxes */
input.qty { text-align: right; font-variant-numeric: tabular-nums; }
.unit-rows { margin-top: 12px; }
.unit-row { display: grid; grid-template-columns: auto minmax(0, 1.4fr) auto minmax(0, 0.7fr) auto minmax(0, 1fr) auto auto; gap: 6px; align-items: center; margin: 6px 0; }
@media (max-width: 560px) { .unit-row { grid-template-columns: auto 1fr auto 1fr auto; } .unit-row > :nth-child(6) { grid-column: 2 / 6; } .unit-row > :nth-child(7) { grid-column: 6; grid-row: 1; } }
.guided-qty { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.guided-qty .field:nth-child(3) { grid-column: 1 / 3; }
.guided-amount { grid-column: 1 / 3; font-size: 17px; margin: -2px 0 10px; }
td.neg, .neg { color: var(--danger, #b42318); }
.fill-row { justify-content: space-between; margin: 6px 0; }
.fill-row input { max-width: 120px; flex: 0 0 120px; }
.check.wide { grid-column: 1 / -1; }
/* Stock table on phones: one card per product */
@media (max-width: 560px) {
  .stock-table thead { display: none; }
  .stock-table, .stock-table tbody { display: block; }
  .stock-table tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
  .stock-table td { display: block; border: 0; padding: 0; text-align: left; }
  .stock-table td:nth-child(1) { font-weight: 600; font-size: 16px; }
  .stock-table td:nth-child(2) { text-align: right; font-size: 16px; }
  .stock-table td:nth-child(3) { grid-column: 1 / -1; }
  .stock-table td:nth-child(4) { color: var(--muted); font-size: 13px; }
  .stock-table td:nth-child(5) { text-align: right; }
  .stock-table tr.grand td:first-child { grid-column: 1; }
}
/* Phone menu: the dimmed area beside the open menu closes it when tapped */
.nav-backdrop { display: none; }
@media (max-width: 860px) {
  .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 39; background: rgba(20, 28, 24, .35); }
}

/* Delivery challan form: one row per cylinder type, like the paper pad; cards on phones */
.dc-grid { margin: 14px 0 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.dc-head, .dc-row { display: grid; grid-template-columns: minmax(0, 1.6fr) 80px 90px 90px 100px minmax(170px, 1.2fr) 110px; gap: 8px; align-items: center; padding: 8px 12px; }
.dc-head { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-bottom: 1px solid var(--line-strong); }
.dc-row { border-bottom: 1px solid var(--line); }
.dc-row:last-child { border-bottom: 0; }
.dc-row label small { display: none; }
.dc-cap, .dc-vol, .dc-amt { text-align: right; font-variant-numeric: tabular-nums; }
.dc-rate { display: flex; gap: 4px; }
.dc-rate select { width: auto; flex: 0 0 auto; }
.dc-extra .row { margin: 6px 0; }
.dc-stock > div, .dc-foot > div, .dc-slip > div { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.dc-stock .grand { font-weight: 700; border-bottom: 0; }
.dc-invoice { margin-top: 10px; }
.dc-meta { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 10px 0; }
.dc-foot { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 20px; margin-top: 14px; }
.dc-sign { display: flex; justify-content: space-between; margin-top: 30px; gap: 20px; flex-wrap: wrap; }
.dc-slip { max-width: 360px; margin: 10px 0; font-size: 16px; }
.dc-actions { margin-bottom: 12px; }
.send-channels { display: grid; gap: 10px; }
.send-channels .simple-action { font: inherit; text-align: left; cursor: pointer; min-height: 60px; }
.send-preview pre { white-space: pre-wrap; font-size: 13px; background: var(--bg); padding: 10px; border-radius: 8px; }
.stat-chip { display: inline-block; padding: 4px 10px; border: 1px solid var(--line); border-radius: 20px; margin: 2px 4px 2px 0; background: var(--surface); }
.rate-row { display: grid; grid-template-columns: minmax(0, 1.5fr) auto minmax(0, 1fr) auto auto; gap: 6px; margin: 6px 0; align-items: center; }
.unit-cyl { white-space: nowrap; font-size: 13px; margin: 0; }
@media (max-width: 760px) {
  .dc-head { display: none; }
  .dc-row { grid-template-columns: 1fr 1fr; padding: 12px; }
  .dc-row .dc-name { font-weight: 600; }
  .dc-row .dc-cap { text-align: right; color: var(--muted); }
  .dc-row label small { display: block; color: var(--muted); font-size: 12px; margin-bottom: 2px; }
  .dc-row input { font-size: 16px; }
  .dc-row .dc-vol { text-align: left; color: var(--muted); }
  .dc-row .dc-rate { grid-column: 1 / -1; }
  .dc-row .dc-amt { grid-column: 1 / -1; font-weight: 600; }
  .rate-row { grid-template-columns: 1fr 1fr; }
}
.dc-photo-wrap { margin: 4px 0 16px; max-width: 520px; }
.dc-photo-big { width: 100%; font: inherit; text-align: left; cursor: pointer; border: 2px solid var(--brand); }
.dc-photo-big b { font-size: 19px; }
/* The DC's 7 columns on a phone: smaller type, tighter spacing, and any excess scrolls inside the challan */
.dc-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 560px) {
  .dc-paper { padding: 16px 12px; }
  .dc-lines { font-size: 12px; }
  .dc-lines th { font-size: 10px; letter-spacing: 0; }
  .dc-lines th + th, .dc-lines td + td { padding-left: 6px; }
  .dc-lines td:first-child { min-width: 90px; }
}
@media print { .dc-table-wrap { overflow: visible; } }
/* Tick boxes keep their size next to long text */
.check input[type=checkbox] { flex: 0 0 auto; width: 16px; height: 16px; margin: 0; }
.check.feature-check { align-items: flex-start; }
.check.feature-check input[type=checkbox] { margin-top: 3px; }

/* Simple home: two big choices */
.home-two .simple-action.big { min-height: 150px; font: inherit; text-align: left; cursor: pointer; border: 2px solid var(--brand); justify-content: center; }
.home-two .simple-action.big b { font-size: 21px; }
.home-two .simple-action.big span { font-size: 15px; }
.home-two .muted-card { border-style: dashed; border-color: var(--line-strong); cursor: default; }
.home-two .muted-card b { color: var(--muted); }
.guided-review.warn { border-color: var(--danger, #b42318); }
.guided-choices.three { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.who-status { margin: -6px 0 10px; color: var(--muted); }
.paid-now { margin-top: 10px; }
