:root {
  --paper: #f6f3ee;
  --ink: #1c1915;
  --muted: #6b645c;
  --copper: #8c3f1d;
  --copper-soft: #f4e6dc;
  --line: #e4ddd2;
  --card: #fffcf8;
  --green: #1f6b45;
  --red: #8d2d2d;
  --amber: #8a5a12;
  /* Field and control borders: 3:1 against white and the paper (WCAG 1.4.11). */
  --field: #8a8075;
}
* { box-sizing: border-box; }
a { color: var(--copper); }
a:hover { color: var(--ink); }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: "Avenir Next", "Segoe UI", system-ui, sans-serif; }
.shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
.rail { background: #efeae3; border-right: 1px solid var(--line); padding: 20px 16px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { font-family: Georgia, serif; font-size: 24px; color: var(--copper); margin: 0 0 4px; }
.company { font-size: 13px; color: var(--muted); margin-bottom: 24px; }
.nav { display: flex; flex-direction: column; gap: 6px; }
.nav button { display: block; width: 100%; text-align: left; background: transparent; border: 0; padding: 10px 12px; border-radius: 8px; cursor: pointer; color: var(--ink); font: inherit; }
.nav button.active { background: var(--card); }
.main { padding: 28px 32px 112px; max-width: 1200px; min-width: 0; }
.main:focus { outline: none; }
.top { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.back { background: transparent; border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; cursor: pointer; font: inherit; color: var(--copper); }
h1 { font-family: Georgia, serif; font-weight: 500; font-size: 36px; margin: 0; }
h2 { font-size: 18px; margin: 0 0 8px; }
.sub { color: var(--muted); margin: 4px 0 20px; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 24px; }
.metric { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.metric .k { font-size: 13px; color: var(--muted); }
.metric .v { font-size: 28px; font-weight: 600; margin-top: 4px; }
.stages { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.stage { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; font: inherit; font-size: 13px; color: var(--ink); cursor: pointer; }
table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 12px; overflow: hidden; margin-bottom: 16px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); font-size: 14px; }
th { font-size: 12px; color: var(--muted); font-weight: 500; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; }
.pill.red { background: #f8e8e4; color: var(--red); }
.pill.amber { background: #f8efd8; color: var(--amber); }
.pill.green { background: #e5f2ea; color: var(--green); }
.pill.copper { background: var(--copper-soft); color: var(--copper); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.btn { background: var(--copper); color: white; border: 0; border-radius: 8px; padding: 8px 14px; cursor: pointer; font: inherit; }
.btn.secondary { background: transparent; color: var(--copper); border: 1px solid var(--line); }
.btn.small { padding: 4px 8px; font-size: 13px; }
a.btn { display: inline-block; text-decoration: none; }
.due-strip { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.due-item { background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--copper); border-radius: 8px; padding: 8px 12px; font: inherit; font-size: 13px; color: var(--ink); cursor: pointer; text-align: left; }
.due-item:hover { background: var(--copper-soft); }
.due-item.overdue { border-color: var(--red); color: var(--red); }
.blocker { color: var(--red); font-weight: 500; }
.next-action { font-size: 13px; color: var(--copper); }
.ai-badge { position: fixed; bottom: 24px; right: 24px; width: 56px; height: 56px; border-radius: 50%; background: var(--copper); color: white; border: none; box-shadow: 0 4px 12px rgba(140,63,29,0.3); cursor: pointer; font-size: 22px; display: flex; align-items: center; justify-content: center; z-index: 1000; }
.ai-panel { position: fixed; bottom: 92px; right: 24px; width: min(400px, calc(100vw - 32px)); max-height: min(620px, calc(100vh - 120px)); background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 32px rgba(0,0,0,0.14); z-index: 1000; display: none; flex-direction: column; overflow: hidden; }
.ai-panel.open { display: flex; }
.ai-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding: 14px 16px 8px; border-bottom: 1px solid var(--line); }
.ai-head h3 { margin: 0; font-family: Georgia, serif; font-weight: 500; font-size: 18px; }
.ai-head .sub { margin: 2px 0 0; font-size: 12px; }
.ai-close { background: none; border: 0; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); padding: 2px 6px; }
.ai-replies { flex: 1; overflow-y: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; min-height: 120px; }
.msg { font-size: 14px; line-height: 1.45; max-width: 92%; }
.msg p { margin: 0 0 6px; white-space: pre-wrap; }
.msg ul { margin: 4px 0 6px; padding-left: 18px; }
.msg.you { align-self: flex-end; background: var(--copper); color: var(--card); padding: 8px 12px; border-radius: 12px 12px 2px 12px; }
.msg.helper { align-self: flex-start; background: #f3efe8; padding: 10px 12px; border-radius: 12px 12px 12px 2px; }
.msg.typing { color: var(--muted); font-style: italic; }
.msg-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.msg-rate { margin-top: 6px; font-size: 12px; color: var(--muted); }
.ai-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 8px; }
.chip { border: 1px solid var(--line); background: var(--card); color: var(--copper); border-radius: 999px; padding: 4px 10px; font: inherit; font-size: 12px; cursor: pointer; }
.chip:hover, .chip:focus { border-color: var(--copper); outline: none; }
.ai-form { display: flex; gap: 8px; padding: 8px 16px; border-top: 1px solid var(--line); }
.ai-form input { flex: 1; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.ai-note { margin: 0; padding: 0 16px 10px; font-size: 11px; color: var(--muted); }
.actions-vert { display: flex; flex-direction: column; gap: 10px; }
.action-row { display: flex; gap: 10px; align-items: flex-start; }
.action-row .blurb { font-size: 12px; color: var(--muted); margin: 2px 0 0; }
.btn.pop { background: var(--copper); color: white; font-weight: 600; }
.metric.highlight { border-color: var(--copper); background: var(--copper-soft); }
.metric.highlight .v { color: var(--copper); }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.money-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--line); }
.money-row .label { color: var(--muted); }
.list-item { padding: 8px 0; border-bottom: 1px solid var(--line); }
.hidden { display: none; }
.reset-btn { margin-top: 16px; font-size: 12px; color: var(--muted); background: none; border: none; cursor: pointer; text-decoration: underline; }
.cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { text-align: center; font-size: 12px; color: var(--muted); padding: 6px 0; }
.cal-day { background: var(--card); border: 1px solid var(--line); border-radius: 8px; min-height: 100px; padding: 6px; font: inherit; font-size: 13px; text-align: left; display: flex; flex-direction: column; align-items: stretch; gap: 2px; cursor: pointer; color: var(--ink); min-width: 0; }
.cal-day.other { background: transparent; border-color: transparent; cursor: default; }
.cal-day.selected { border-color: var(--copper); box-shadow: 0 0 0 1px var(--copper); }
.cal-dot { display: none; }
.cal-month { margin: 0 12px; }
.cal-day.today { border-color: var(--copper); }
.cal-day .num { font-weight: 600; margin-bottom: 4px; }
.cal-event { display: block; font-size: 11px; padding: 2px 4px; margin: 2px 0; border-radius: 4px; background: var(--copper-soft); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-event.overdue { background: #f8e8e4; color: var(--red); }
.cal-event.waiver { background: #f8efd8; color: var(--amber); }
.cal-event.paid { background: #e5f2ea; color: var(--green); }
.help-card { background: var(--copper-soft); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 20px; font-size: 14px; position: relative; }
.help-dismiss { position: absolute; top: 8px; right: 12px; background: none; border: 0; cursor: pointer; color: var(--muted); font-size: 18px; }
.nav-section { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 16px 0 6px 12px; }
.action-queue { margin-bottom: 20px; }
.action-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.table-wrap { overflow-x: auto; margin-bottom: 16px; }
table.sortable th { cursor: pointer; }
table.sortable th:hover { color: var(--copper); }
.form-inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 8px 0; }
.form-inline input, .form-inline textarea, .form-inline select { padding: 6px 8px; border: 1px solid var(--field); border-radius: 6px; font: inherit; background: white; min-height: 34px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.gate-reason { font-size: 13px; color: var(--red); margin: 6px 0; }
.next-step { background: var(--copper-soft); border-left: 3px solid var(--copper); padding: 10px 14px; margin-bottom: 16px; border-radius: 0 8px 8px 0; }
.legend { display: flex; gap: 12px; margin: 8px 0 16px; font-size: 12px; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 4px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.legend .lg-paid { background: #e5f2ea; } .legend .lg-waiver { background: #f8efd8; } .legend .lg-overdue { background: #f8e8e4; } .legend .lg-other { background: var(--copper-soft); }
.day-detail { margin-top: 16px; }
.filter-bar { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.filter-bar select { padding: 6px 10px; border-radius: 6px; border: 1px solid var(--field); font: inherit; background: white; min-height: 34px; }
.inline-label { font-size: 13px; color: var(--muted); }
select { max-width: 100%; }
.stage.clickable { cursor: pointer; }
.stage.clickable:hover, .stage.active { border-color: var(--copper); background: var(--copper-soft); }
.toast { position: fixed; top: 16px; left: 50%; max-width: min(560px, calc(100vw - 32px)); transform: translateX(-50%); background: var(--ink); color: white; padding: 10px 16px; border-radius: 8px; z-index: 2000; font-size: 14px; }
.summary-row { display: flex; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.summary-row .metric { min-width: 140px; }
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 32px 28px; width: 100%; max-width: 400px; box-shadow: 0 8px 24px rgba(28,25,21,0.04); }
.auth-card h1 { font-size: 32px; margin: 0 0 4px; }
.auth-card label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 4px; }
.auth-card input { width: 100%; padding: 10px 12px; border: 1px solid var(--field); border-radius: 8px; font: inherit; background: white; }
.auth-card .btn { width: 100%; margin-top: 18px; padding: 10px 14px; }
.auth-toggle { margin-top: 16px; font-size: 13px; color: var(--muted); text-align: center; }
.auth-toggle button { background: none; border: 0; color: var(--copper); cursor: pointer; font: inherit; text-decoration: underline; padding: 0; }
.auth-error { color: var(--red); font-size: 13px; margin-top: 10px; }
.auth-hint { font-size: 12px; color: var(--muted); margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.user-meta { font-size: 12px; color: var(--muted); margin-top: 20px; padding-top: 12px; border-top: 1px solid var(--line); }
.user-meta .reset-btn { margin-top: 8px; }
.landing { min-height: 100vh; }
.land-bar { display: flex; align-items: center; justify-content: space-between; padding: 18px 32px; border-bottom: 1px solid var(--line); }
.land-bar-actions { display: flex; gap: 8px; }
.land-hero { display: grid; grid-template-columns: 1.3fr 0.9fr; gap: 40px; padding: 56px 32px 32px; max-width: 1080px; margin: 0 auto; align-items: start; }
.land-copy h1 { font-size: 44px; line-height: 1.15; margin: 8px 0 16px; }
.eyebrow { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--copper); margin: 0 0 8px; }
.lede { font-size: 18px; color: var(--muted); margin: 0 0 24px; max-width: 540px; }
.land-points { display: grid; gap: 14px; }
.land-points div { display: grid; gap: 2px; }
.land-points strong { font-size: 15px; }
.land-points span { font-size: 14px; color: var(--muted); }
.land-form { margin: 0; }
.land-form h2 { margin: 0 0 4px; font-family: Georgia, serif; font-weight: 500; }
.land-how, .land-price { max-width: 1080px; margin: 0 auto; padding: 8px 32px 32px; }
.land-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.land-steps .card h3 { margin: 8px 0 4px; font-size: 16px; }
.land-steps .card p { margin: 0; color: var(--muted); font-size: 14px; }
.step { display: inline-flex; width: 28px; height: 28px; border-radius: 50%; background: var(--copper-soft); color: var(--copper); align-items: center; justify-content: center; font-weight: 600; }
.land-price .card { max-width: 420px; }
.land-price h2 { font-size: 40px; margin: 0 0 4px; }
.land-price h2 span { font-size: 18px; color: var(--muted); font-weight: 400; }
.land-foot { padding: 24px 32px 40px; color: var(--muted); font-size: 13px; text-align: center; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.form-grid label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.form-grid input, .form-grid select, .form-grid textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--field); border-radius: 6px; font: inherit; background: white; }
.form-grid [aria-invalid="true"], .form-inline [aria-invalid="true"] { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }
.form-grid .span-2 { grid-column: span 2; }
.form-section { margin: 16px 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.req { color: var(--copper); }
.form-error { background: #fff5f0; border: 1px solid var(--red); color: var(--red); padding: 10px 12px; border-radius: 8px; margin-bottom: 12px; font-size: 13px; }
.field-error { display: block; color: var(--red); font-size: 12px; margin-top: 2px; }
.empty-state { background: var(--card); border: 1px dashed var(--line); border-radius: 12px; padding: 28px 20px; text-align: center; color: var(--muted); margin: 12px 0; }
.empty-state strong { display: block; color: var(--ink); margin-bottom: 6px; }
.empty-state p { margin: 0 0 12px; }
@media (max-width: 800px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
}
@media (max-width: 800px) {
  .land-hero, .land-steps { grid-template-columns: 1fr; }
  .land-copy h1 { font-size: 34px; }
  .land-bar { padding: 14px 16px; }
  .land-hero, .land-how, .land-price { padding-left: 16px; padding-right: 16px; }
}
.net-banner { display: none; position: sticky; top: 0; z-index: 50; padding: 10px 16px; background: #fff5f0; color: #8a2b0f; border-bottom: 1px solid #e9b8a6; font-size: 14px; }
a.reset-btn { display: block; text-decoration: none; text-align: left; }
/* Field help: the (i) is hidden until its area is hovered or focused. */
.has-info { position: relative; }
.info { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; margin-left: 6px; border-radius: 50%; border: 1px solid var(--muted); color: var(--muted); font: italic 600 11px/1 Georgia, serif; text-transform: none; letter-spacing: 0; cursor: help; vertical-align: middle; opacity: 0; transition: opacity .12s; }
.has-info:hover .info, .has-info:focus-within .info, .info:focus { opacity: 1; }
.info:hover, .info:focus { color: var(--copper); border-color: var(--copper); outline: none; }
@media (hover: none) { .info { opacity: 1; } }
.help-tip { display: none; position: fixed; z-index: 100; max-width: 280px; padding: 8px 10px; border-radius: 8px; background: var(--ink); color: var(--card); font-size: 13px; line-height: 1.4; box-shadow: 0 6px 18px rgba(0,0,0,.18); pointer-events: none; }
/* Import */
.dropzone { border: 2px dashed var(--line); border-radius: 10px; padding: 18px; margin: 12px 0; background: var(--card); display: flex; flex-direction: column; gap: 6px; }
.dropzone.small { padding: 12px; }
.drop-overlay { display: none; position: fixed; inset: 0; z-index: 90; align-items: center; justify-content: center; background: rgba(140,63,29,.12); border: 3px dashed var(--copper); font: 600 22px Georgia, serif; color: var(--copper); pointer-events: none; }
.linkish { background: none; border: 0; padding: 0; color: var(--copper); text-decoration: underline; cursor: pointer; font: inherit; }
.inbox-item { border-top: 1px solid var(--line); padding: 12px 0; display: flex; flex-direction: column; gap: 6px; }
.inbox-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.inbox-text { white-space: pre-wrap; font-size: 13px; background: #f3efe8; padding: 8px; border-radius: 6px; max-height: 240px; overflow: auto; }
#paste-text { width: 100%; font: inherit; padding: 8px; border: 1px solid var(--line); border-radius: 8px; margin: 8px 0; }
.copy-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0 12px; }
.copy-row code { background: #f3efe8; padding: 6px 8px; border-radius: 6px; font-size: 12px; word-break: break-all; max-width: 100%; }
.nav .count { display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 9px; background: var(--copper); color: var(--card); font-size: 11px; text-align: center; }
tr.clickable { cursor: pointer; }
tr.clickable:hover { background: var(--copper-soft); }
.glossary dt { font-weight: 600; margin-top: 10px; }
.glossary dd { margin: 2px 0 0; color: var(--muted); }
.steps { display: grid; gap: 6px; padding-left: 20px; }
details.card > summary { cursor: pointer; }
/* In the nav, keep the (i) at the far right so a click on the label always opens the page. */
.nav button { display: flex; align-items: center; }
.nav button .info { margin-left: auto; }

/* schedule of values */
.sov-table td, .sov-table th { padding: 4px 6px; }
.sov-table td.num, .sov-table th { white-space: nowrap; }
.sov-table .sov-total td { font-weight: 600; border-top: 1px solid var(--line, #ddd); }
.sov-in { padding: 4px 6px; font: inherit; border: 1px solid var(--line, #d8d2c8); border-radius: 6px; background: #fff; width: 100%; box-sizing: border-box; }
.sov-in.sov-item { width: 4.5em; }
.sov-in.sov-unit { width: 4.5em; }
.sov-in.sov-num { width: 7em; text-align: right; }
.sov-in.sov-desc { min-width: 14em; }
#sov-op { width: 5em; }
.sov-op-label { margin-left: 12px; }
.sov-paste { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0; }
.sov-paste textarea { flex: 1; font: inherit; padding: 6px 8px; border: 1px dashed var(--line, #d8d2c8); border-radius: 8px; }
.sov-warn { background: #f8efd8; border-radius: 8px; padding: 8px 10px; margin: 8px 0; font-size: 13px; display: grid; gap: 2px; }
.sov-sums { max-width: 520px; margin: 8px 0; }
#sov-sum-diff.ok { color: var(--green); }
.email-body { white-space: pre-wrap; max-height: 9em; overflow: auto; }

/* accounts, onboarding, trial */
.verify-banner, .trial-banner { background: #f8efd8; border-radius: 8px; padding: 10px 12px; margin: 0 0 14px; font-size: 14px; }
.trial-banner { background: #eef3ee; }
.onboarding { position: relative; }
.onb-steps { margin: 6px 0 0; padding-left: 22px; display: grid; gap: 8px; }
.onb-steps li.done { color: var(--muted, #6b645c); }
.onb-steps li.next { font-weight: 600; }
.invite-result { background: #eef3ee; border-radius: 8px; padding: 10px; margin: 8px 0; }
.danger-zone { border-color: var(--red, #8d2d2d); }
.btn.danger { background: var(--red, #8d2d2d); color: #fff; border-color: var(--red, #8d2d2d); }
.terms-check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; margin: 8px 0; line-height: 1.4; }
.terms-check input { width: auto; margin-top: 2px; }
.land-legal { margin-top: 8px; font-size: 13px; }
.notice { background: #f8efd8; color: var(--amber); border: 1px solid #ecd9ae; border-radius: 8px; padding: 8px 12px; margin: -8px 0 16px; font-size: 14px; }
.land-notice { margin: 0; border-radius: 0; border-width: 0 0 1px; text-align: center; }

/* ---------- Option A: shell, tabs, job page, phone layout, accessibility ---------- */
.skip-link { position: absolute; left: 8px; top: -48px; z-index: 3000; background: var(--ink); color: white; padding: 8px 12px; border-radius: 8px; }
.skip-link:focus { top: 8px; }
:focus-visible { outline: 3px solid var(--copper); outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.topbar, .scrim { display: none; }
.rail { display: flex; flex-direction: column; }
.rail .company strong { color: var(--ink); font-weight: 600; }
.nav button { font-size: 15px; padding: 11px 12px; }
.nav button.active { background: var(--card); font-weight: 600; box-shadow: inset 3px 0 0 var(--copper); }
.user-meta { margin-top: auto; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -8px 0 20px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 12px; font: inherit; font-size: 14px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--copper); border-bottom-color: var(--copper); font-weight: 600; }
.count-badge { display: inline-block; min-width: 22px; padding: 0 7px; border-radius: 11px; background: var(--copper); color: var(--card); font-size: 12px; text-align: center; vertical-align: middle; }
.action-item { gap: 12px; }
.action-text { min-width: 0; }
.action-text .next-action { margin-top: 2px; }
td.num, .num { font-variant-numeric: tabular-nums; }
.row-sub { margin: 2px 0 0; font-size: 12px; }
.job-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.job-head .sub { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.next-card { display: flex; justify-content: space-between; align-items: center; gap: 16px; background: var(--copper-soft); border: 1px solid #e8d3c4; border-left: 4px solid var(--copper); border-radius: 12px; padding: 14px 16px; margin: 4px 0 16px; }
.next-text { display: grid; gap: 2px; min-width: 0; }
.next-text .eyebrow { margin: 0; }
.next-text .sub { margin: 2px 0 0; font-size: 13px; }
.next-card .btn { white-space: nowrap; padding: 10px 18px; font-weight: 600; }
.blockers-card { border-color: var(--red); background: #fff5f0; }
.blocker-list { margin: 6px 0 8px; padding-left: 20px; }
.blockers-card details summary { cursor: pointer; font-size: 13px; color: var(--copper); }
.more-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.form-card h2 { font-size: 16px; }
.money-row.strong span { font-weight: 600; color: var(--ink); }
.h2-gap { margin-top: 20px; }
.row-link { display: flex; justify-content: space-between; align-items: center; }
.add-record summary { cursor: pointer; color: var(--copper); font-size: 14px; margin-top: 10px; }
.danger-text { color: var(--red); border-color: var(--red); }
.send-check { border-color: var(--copper); }
.send-check .btn { margin-top: 10px; }
.packet-item { display: grid; gap: 6px; }
.packet-item .mark { font-weight: 700; }
.packet-item.present .mark { color: var(--green); }
.packet-item.absent .mark { color: var(--red); }
.playbook-card summary { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.playbook-card summary .sub { margin: 0; }
.playbook-card form { margin-top: 12px; }
textarea { font: inherit; }
.email-details summary { cursor: pointer; font-size: 12px; color: var(--copper); }
.actions-cell { white-space: nowrap; }
.land-legal a { color: var(--copper); }

@media (max-width: 800px) {
  .shell { display: block; }
  .topbar { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 60; background: #efeae3; border-bottom: 1px solid var(--line); padding: 8px 12px; }
  .topbar .brand { font-size: 20px; margin: 0; }
  .topbar-section { margin-left: auto; font-size: 14px; color: var(--muted); }
  .menu-btn { width: 44px; height: 44px; border: 1px solid var(--field); border-radius: 8px; background: var(--card); font-size: 20px; cursor: pointer; color: var(--ink); }
  .rail { position: fixed; top: 0; left: 0; bottom: 0; width: min(300px, 85vw); height: 100vh; z-index: 80; transform: translateX(-102%); transition: transform .18s ease-out; box-shadow: 0 0 24px rgba(0,0,0,.2); }
  .drawer-open .rail { transform: none; }
  .drawer-open .scrim { display: block; position: fixed; inset: 0; z-index: 70; background: rgba(28,25,21,.35); }
  .main { padding: 16px 16px 112px; }
  h1 { font-size: 28px; }
  .metrics { grid-template-columns: 1fr 1fr; gap: 8px; }
  .metric .v { font-size: 22px; }
  .detail-grid { grid-template-columns: 1fr; }
  .next-card { flex-direction: column; align-items: stretch; }
  .next-card .btn { width: 100%; }
  .job-head { flex-direction: column; }
  .action-item { align-items: stretch; flex-direction: column; }
  .tabs { margin: -4px -16px 16px; padding: 0 8px; }
  /* tables become one card per row; each cell shows its column name */
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack { background: transparent; border-radius: 0; }
  table.stack tr.head-row { display: none; }
  table.stack tr { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; }
  table.stack td { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border: 0; padding: 5px 0; text-align: right; }
  table.stack td::before { content: attr(data-label); color: var(--muted); font-size: 12px; text-align: left; flex-shrink: 0; }
  table.stack td:first-child { display: block; text-align: left; font-size: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
  table.stack td:first-child::before { content: none; }
  table.stack td.next-action { display: block; text-align: left; }
  table.stack td.next-action::before { display: block; margin-bottom: 2px; }
  table.stack td.actions-cell { white-space: normal; justify-content: flex-start; flex-wrap: wrap; }
  table.stack td.actions-cell::before { width: 100%; }
  .table-wrap { overflow: visible; }
  .cal-grid { gap: 2px; }
  .cal-day { min-height: 52px; padding: 4px; align-items: center; }
  .cal-day .cal-event { display: none; }
  .cal-dot { display: inline-block; margin-top: 2px; min-width: 18px; padding: 0 4px; border-radius: 9px; background: var(--copper-soft); color: var(--copper); font-size: 11px; text-align: center; }
  .cal-dow { font-size: 11px; }
  .ai-badge { width: 48px; height: 48px; bottom: 16px; right: 16px; }
  .toast { top: 68px; }
  .form-inline > input, .form-inline > select { flex: 1 1 100%; }
  .sov-paste { flex-direction: column; }
}
@media (max-width: 420px) {
  .metrics { grid-template-columns: 1fr; }
}
/* Touch screens: every control at least 44 px tall (WCAG 2.5.5 target size). */
@media (pointer: coarse) {
  .btn, .btn.small, .linkish, .tab, .stage, .due-item, .back, select, input:not([type=checkbox]), .filter-bar button, .chip, .nav button { min-height: 44px; }
  .linkish { display: inline-flex; align-items: center; }
  .info { width: 24px; height: 24px; font-size: 14px; }
  .help-dismiss, .ai-close { min-width: 44px; min-height: 44px; }
}
.ai-why { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.ai-why input { flex: 1 1 160px; padding: 6px 8px; border: 1px solid var(--field); border-radius: 6px; font: inherit; }

/* Layout helpers instead of style="" attributes, which the page's CSP doesn't allow (P2-8). */
.grow, .form-inline > .grow { flex: 1; }
.full-input { width: 100%; font: inherit; }

/* In-page confirmation (askConfirm in js/dom.js) */
.confirm-dialog { border: 1px solid var(--line); border-radius: 12px; padding: 20px; max-width: min(440px, calc(100vw - 32px)); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18); }
.confirm-dialog::backdrop { background: rgba(28, 25, 21, 0.4); }
.confirm-dialog p { margin: 0 0 16px; line-height: 1.5; }
.confirm-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.confirm-actions .btn { min-height: 44px; padding: 8px 16px; }
.read-only-banner { font-weight: 600; }

/* Today's queue: the action and Open side by side, wrapping under the text on a phone */
.action-buttons { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }

/* Job page: the history, and the money file's one-line summary when it is folded */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 10px 0; border-bottom: 1px solid var(--line); line-height: 1.45; }
.timeline li:last-child { border-bottom: 0; }
.money-file > summary { cursor: pointer; }
.money-file > summary h2 { display: inline; margin: 0 8px 0 0; }
.money-file[open] > summary { margin-bottom: 8px; }
