/* STL Workspace — a quiet, practical visual system for client work. */
:root {
  --ink: #17353d;
  --text: #263c43;
  --muted: #66777c;
  --sidebar: #15333c;
  --sidebar-deep: #102a32;
  --teal: #167d7f;
  --teal-dark: #0e6467;
  --teal-soft: #e8f3f0;
  --gold: #bd8a35;
  --amber-soft: #fff4df;
  --red: #b64849;
  --red-soft: #fceeed;
  --blue: #496e9c;
  --blue-soft: #edf2fa;
  --green: #3b7e5e;
  --green-soft: #eaf5ed;
  --purple: #7a659a;
  --purple-soft: #f1edf7;
  --canvas: #f6f7f4;
  --paper: #ffffff;
  --line: #e1e6e3;
  --line-soft: #edf0ed;
  --shadow: 0 3px 18px rgba(22, 47, 55, .035);
  --shadow-raised: 0 10px 32px rgba(22, 47, 55, .1);
  --radius: 10px;
  --sidebar-width: 232px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--canvas); color: var(--text); font-family: var(--font); font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
body.modal-open { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
a { color: var(--teal-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
button { color: inherit; }
button, input, select, textarea { outline: none; }
:focus-visible { outline: 3px solid #6abdb3; outline-offset: 3px; }
input:focus, select:focus, textarea:focus { border-color: var(--teal) !important; box-shadow: 0 0 0 3px rgba(22, 125, 127, .1); }
svg { flex-shrink: 0; vertical-align: middle; }
img { max-width: 100%; }
[hidden] { display: none !important; }
h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.25; }
h1 { font-size: 32px; letter-spacing: -.9px; font-weight: 650; }
h2 { font-size: 20px; letter-spacing: -.3px; font-weight: 650; }
h3 { font-size: 16px; font-weight: 650; }
p { margin-bottom: 14px; }
small { font-size: 13px; }
code { padding: 2px 5px; background: #f0f3f1; border-radius: 4px; font-size: .92em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }

/* Workspace shell */
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 60; inset: 0 auto 0 0; display: flex; flex-direction: column; width: var(--sidebar-width); background: var(--sidebar); color: #d0dedf; padding: 28px 16px 18px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #47616a transparent; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 10px 28px; color: white; text-decoration: none; flex-shrink: 0; }
.brand:hover { text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 39px; height: 39px; border: 1px solid #628c8c; border-radius: 9px; color: #c2e9de; font-size: 13px; font-weight: 750; letter-spacing: -.7px; background: rgba(134, 193, 181, .07); }
.brand-name { color: #fff; font-size: 18px; line-height: 1.15; letter-spacing: -.5px; font-weight: 650; }
.brand-sub { display: block; margin-top: 4px; color: #9bb4b8; font-size: 11.5px; font-weight: 550; letter-spacing: 1.2px; text-transform: uppercase; white-space: nowrap; }
.nav-group-label { margin: 24px 12px 9px; color: #829fa5; font-size: 11.5px; font-weight: 650; letter-spacing: 1.3px; text-transform: uppercase; }
.nav-group-label:first-child { margin-top: 4px; }
.nav-item { position: relative; display: flex; align-items: center; gap: 11px; width: 100%; min-height: 42px; margin: 3px 0; padding: 10px 12px; border: 0; border-radius: 7px; color: #c4d4d7; background: transparent; font-size: 13px; text-align: left; text-decoration: none; font-weight: 500; transition: background .16s, color .16s; }
.nav-item:hover { color: #fff; background: rgba(255, 255, 255, .055); text-decoration: none; }
.nav-item.active { color: #fff; background: #294b53; }
.nav-item.active::before { content: ""; position: absolute; left: -16px; top: 10px; bottom: 10px; width: 3px; background: #8dc5b6; border-radius: 0 3px 3px 0; }
.nav-icon { display: flex; align-items: center; color: #92b2b7; }
.nav-item.active .nav-icon { color: #b8ded5; }
.nav-count { margin-left: auto; padding: 0 7px; line-height: 20px; border-radius: 5px; color: #cee3de; background: rgba(219, 239, 233, .09); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.sidebar-bottom { margin-top: auto; padding: 25px 10px 0; color: #9fb6ba; font-size: 12.5px; }
.sidebar-bottom .avatar { background: #3b5961; color: #e3efeb; }
.sidebar-bottom .split { padding-top: 16px; border-top: 1px solid #36515a; }
.sidebar-bottom strong { color: #e2e9e8; font-size: 13px; font-weight: 550; }
.sidebar-bottom p { color: #91adb2; margin: 4px 0 15px; line-height: 1.5; }
.workspace { min-width: 0; min-height: 100vh; margin-left: var(--sidebar-width); }
.topbar { position: sticky; z-index: 40; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 22px; min-height: 70px; padding: 13px 32px; background: rgba(255, 255, 255, .97); border-bottom: 1px solid var(--line); }
.breadcrumb { display: flex; align-items: center; gap: 9px; color: #6d7d82; font-size: 13px; white-space: nowrap; }
.breadcrumb strong, .breadcrumb .current { color: var(--ink); font-weight: 550; }
.breadcrumb svg { color: #b1bcbe; }
.global-search { position: relative; display: flex; align-items: center; gap: 10px; width: 320px; max-width: 37vw; color: #89959a; border: 1px solid var(--line); border-radius: 7px; background: #fafbf9; padding: 0 12px; min-height: 37px; }
.global-search > input { background: none; border: 0; min-width: 0; width: 100%; padding: 8px 0; font-size: 13px; color: var(--text); box-shadow: none !important; }
.global-search:focus-within { border-color: #72a8a4; box-shadow: 0 0 0 3px rgba(22, 125, 127, .06); }
.global-search kbd { flex-shrink: 0; border: 1px solid #dde3df; border-radius: 4px; font: 10px var(--font); padding: 1px 5px; color: #6b7e73; }
.top-actions { display: flex; align-items: center; gap: 14px; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 33px; height: 33px; flex-shrink: 0; border-radius: 50%; color: var(--teal-dark); background: #dfedE7; font-size: 12.5px; font-weight: 700; letter-spacing: -.2px; }
.avatar.small { width: 26px; height: 26px; font-size: 11px; }
.avatar.large { width: 48px; height: 48px; font-size: 16px; }
.demo-label { display: inline-flex; align-items: center; gap: 6px; color: #8a733e; background: #f8f3e8; border: 1px solid #eee6d5; padding: 4px 8px; border-radius: 5px; font-size: 11.5px; font-weight: 600; white-space: nowrap; letter-spacing: .15px; }
.demo-label::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #b59453; }
.mobile-menu { display: none; }
.page { width: 100%; max-width: 1720px; padding: 29px 32px 42px; margin: 0 auto; animation: enter .18s ease-out; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.eyebrow { color: var(--teal); font-size: 11.5px; font-weight: 700; letter-spacing: 1.25px; text-transform: uppercase; margin-bottom: 6px; }
.page-title { font-size: 29px; font-weight: 650; letter-spacing: -.9px; margin: 0 0 7px; line-height: 1.2; }
.page-subtitle { color: var(--muted); font-size: 13px; line-height: 1.6; margin: 0; max-width: 790px; }
.header-actions { display: flex; align-items: center; gap: 9px; flex-shrink: 0; padding-top: 5px; flex-wrap: wrap; }
.prototype-banner { display: flex; align-items: flex-start; gap: 9px; padding: 10px 15px; margin-bottom: 23px; color: #6d7f81; background: #eef3ef; border: 1px solid #e0e8e2; border-radius: 7px; font-size: 13px; line-height: 1.5; }
.prototype-banner strong { color: #3e5d61; font-weight: 600; }
.prototype-banner a { margin-left: auto; white-space: nowrap; }

/* Buttons and useful small elements */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 9px 14px; border: 1px solid #d9e2dd; border-radius: 7px; background: #fff; color: var(--ink); font-size: 13px; line-height: 1.35; font-weight: 600; text-decoration: none; white-space: nowrap; transition: background .16s, border-color .16s, box-shadow .16s; }
.btn:hover { background: #f6f9f6; border-color: #b9cdc5; text-decoration: none; }
.btn.primary { background: var(--teal); color: white; border-color: var(--teal); box-shadow: 0 2px 3px rgba(22, 125, 127, .08); }
.btn.primary:hover { background: var(--teal-dark); border-color: var(--teal-dark); }
.btn.secondary { background: white; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: #edf2ee; color: var(--ink); }
.btn.danger { color: var(--red); border-color: #f0d4d0; background: #fff8f7; }
.btn.danger:hover { background: var(--red-soft); }
.btn.small { min-height: 29px; padding: 5px 9px; font-size: 12.5px; gap: 5px; border-radius: 5px; }
.btn.icon-only { width: 35px; min-width: 35px; padding: 7px; }
.btn.full { width: 100%; }
.link-button { display: inline-flex; align-items: center; gap: 5px; padding: 0; border: 0; background: none; color: var(--teal-dark); font-size: inherit; font-weight: 550; text-align: left; cursor: pointer; }
.link-button:hover { text-decoration: underline; }
.badge { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 3px 8px; border-radius: 5px; background: #eff2ee; color: #64766d; font-size: 11.5px; line-height: 1.45; font-weight: 600; letter-spacing: .05px; white-space: nowrap; }
.badge.teal { color: #286f66; background: var(--teal-soft); }
.badge.green { color: #357553; background: var(--green-soft); }
.badge.amber { color: #99712b; background: var(--amber-soft); }
.badge.red { color: #ad4949; background: var(--red-soft); }
.badge.blue { color: #506e9c; background: var(--blue-soft); }
.badge.purple { color: #796391; background: var(--purple-soft); }
.badge.neutral { color: #728080; background: #eef1ef; }
.date-chip { display: inline-flex; align-items: center; gap: 4px; color: #6c7b7e; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.date-chip.overdue { color: var(--red); }
.muted { color: var(--muted) !important; }
.text-right { text-align: right !important; }
.text-small { font-size: 13px; }
.text-teal { color: var(--teal); }
.text-red { color: var(--red); }
.text-amber { color: #9d742c; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.spacer { flex: 1; }
.split { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }

/* Work overview and panels */
.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 25px; }
.metric-card { position: relative; min-width: 0; min-height: 127px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 18px 19px 16px; box-shadow: var(--shadow); }
.metric-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #67797d; font-size: 13px; font-weight: 500; margin-bottom: 9px; }
.metric-value { display: block; color: var(--ink); font-size: 29px; font-weight: 650; letter-spacing: -.7px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.metric-meta { display: flex; align-items: center; gap: 5px; color: #687c71; margin-top: 10px; font-size: 11.5px; line-height: 1.4; }
.metric-meta strong { color: #43816b; font-weight: 600; }
.metric-icon { color: #749995; display: inline-flex; }
.metric-card.highlight { background: var(--teal); color: white; border-color: var(--teal); }
.metric-card.highlight .metric-label, .metric-card.highlight .metric-meta, .metric-card.highlight .metric-icon { color: #c2e0d9; }
.metric-card.highlight .metric-value { color: #fff; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(290px, 1fr); align-items: start; gap: 22px; }
.panel { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.panel + .panel { margin-top: 22px; }
.grid-2 > .panel + .panel, .grid-3 > .panel + .panel, .content-grid > .panel + .panel { margin-top: 0; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 22px 17px; border-bottom: 1px solid var(--line-soft); }
.panel-header > div { min-width: 0; }
.panel-title { margin: 0; font-size: 15px; color: var(--ink); font-weight: 650; letter-spacing: -.12px; }
.panel-subtitle { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.panel-body { padding: 21px 22px; }
.panel-body > :last-child { margin-bottom: 0; }
.section-title { margin: 27px 0 13px; font-size: 15px; color: var(--ink); font-weight: 650; }
.section-title:first-child { margin-top: 0; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 17px 20px; border-bottom: 1px solid var(--line-soft); background: #fff; }
.toolbar > .split { flex-wrap: wrap; }
.search-input, .filter-select { border: 1px solid #dfe6e1; border-radius: 6px; color: #53696b; background: #fff; min-height: 35px; padding: 7px 11px; font-size: 13px; }
.search-input { min-width: 220px; }
.search-input::placeholder { color: #99a4a5; }
.filter-select { max-width: 100%; cursor: pointer; }
.segmented { display: inline-flex; gap: 3px; padding: 3px; background: #f0f3ef; border: 1px solid #e8ece6; border-radius: 7px; max-width: 100%; overflow-x: auto; }
.segmented button { padding: 6px 10px; border: 0; border-radius: 5px; background: transparent; color: #7c8986; font-size: 12.5px; line-height: 1.5; font-weight: 550; white-space: nowrap; }
.segmented button.active { color: var(--teal-dark); background: white; box-shadow: 0 1px 3px rgba(30, 58, 53, .09); }
.segmented button:hover:not(.active) { color: var(--ink); background: #e6ece5; }
.table-wrap { width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: thin; scrollbar-color: #cbd8d1 transparent; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
.data-table th { background: #fafbf8; border-bottom: 1px solid var(--line); padding: 12px 18px; color: #647b6d; text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: 15px 18px; border-bottom: 1px solid var(--line-soft); color: #647377; vertical-align: middle; line-height: 1.45; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fbfcfa; }
.data-table td:last-child, .data-table th:last-child { padding-right: 22px; }
.data-table td:first-child, .data-table th:first-child { padding-left: 22px; }
.data-table .money, .data-table .amount { color: var(--ink); font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cell-main { display: block; color: var(--ink); font-size: 13px; font-weight: 600; line-height: 1.45; }
.cell-sub { display: block; margin-top: 3px; color: #6b7b75; font-size: 11.5px; font-weight: 400; line-height: 1.5; }
.row-link { color: var(--ink); cursor: pointer; font-weight: 600; }
.row-link:hover { color: var(--teal); text-decoration: underline; }
.data-table .avatar { margin-right: 5px; vertical-align: middle; }
.table-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 22px; border-top: 1px solid var(--line-soft); color: #68796f; font-size: 11.5px; }
.empty-state { text-align: center; padding: 48px 24px; color: var(--muted); }
.empty-state svg { color: #9db9ac; margin-bottom: 12px; }
.empty-state h3 { margin: 0 0 7px; font-size: 15px; }
.empty-state p { font-size: 13px; margin-bottom: 18px; }

/* Cases, leads, clients and properties */
.kanban { display: flex; align-items: flex-start; gap: 16px; overflow-x: auto; padding: 0 0 20px; margin-top: 20px; overscroll-behavior-inline: contain; scrollbar-width: thin; scrollbar-color: #cad7cf transparent; }
.kanban-column { flex: 1 0 245px; min-width: 235px; max-width: 330px; border-top: 2px solid #cadad1; background: #eef2ed; border-radius: 6px; padding: 0 10px 12px; }
.kanban-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 4px; color: #63786f; font-size: 13px; font-weight: 650; }
.kanban-header .nav-count { background: #dfe8e0; color: #6d8578; }
.kanban-card { background: white; border: 1px solid #e2e8e0; border-radius: 8px; padding: 15px; box-shadow: 0 2px 2px rgba(25, 63, 47, .025); margin-bottom: 10px; transition: border-color .16s, box-shadow .16s; }
.kanban-card:hover { border-color: #a2c5b8; box-shadow: 0 4px 12px rgba(25, 63, 47, .05); }
.kanban-card:last-child { margin-bottom: 0; }
.card-title { margin: 7px 0; color: var(--ink); font-size: 13px; font-weight: 650; line-height: 1.4; }
.card-meta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 7px; color: #68796f; font-size: 11.5px; margin-top: 12px; }
.kanban-card .card-description { color: #7e8b86; font-size: 12.5px; line-height: 1.5; margin: 8px 0 12px; }
.case-grid, .client-grid, .property-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.case-card, .client-card, .property-card { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: white; padding: 21px; box-shadow: var(--shadow); }
.case-card:hover, .client-card:hover, .property-card:hover { border-color: #bdd0c7; }
.case-card .card-title, .client-card .card-title, .property-card .card-title { font-size: 16px; }
.client-card p, .property-card p { color: var(--muted); font-size: 13px; }
.client-card .split, .property-card .split { align-items: flex-start; }
.client-card .avatar { width: 39px; height: 39px; font-size: 13px; margin-bottom: 12px; }
.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line-soft); padding-top: 13px; margin-top: 18px; }
.progress-track { height: 5px; border-radius: 5px; overflow: hidden; background: #e8eee7; }
.progress-fill { height: 100%; border-radius: inherit; background: #5d9d8b; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 310px; align-items: start; gap: 23px; }
.detail-main, .detail-aside { min-width: 0; }
.detail-aside .panel + .panel { margin-top: 18px; }
.detail-aside .panel-header { padding: 17px 19px; }
.detail-aside .panel-body { padding: 17px 19px; }
.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin: 0 0 23px; overflow-x: auto; scrollbar-width: thin; }
.tabs button { position: relative; padding: 0 0 14px; border: 0; background: transparent; white-space: nowrap; color: #637b6f; font-size: 13px; font-weight: 550; }
.tabs button:hover { color: var(--teal); }
.tabs button.active { color: var(--teal-dark); }
.tabs button.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--teal); }
.stat-list { margin: 0; }
.stat-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.stat-row:last-child { border-bottom: 0; }
.stat-row > :first-child { color: var(--muted); }
.stat-row > :last-child { color: var(--ink); font-weight: 550; text-align: right; }
.stat-row dt, .stat-row dd { margin: 0; }
.notice { display: flex; align-items: flex-start; gap: 10px; padding: 13px 16px; border: 1px solid #dbe8e3; background: #eff6f2; border-radius: 7px; font-size: 13px; line-height: 1.6; color: #54736a; }
.notice svg { margin-top: 2px; }
.notice p { margin: 0; }
.notice.info { color: #59718d; background: #f0f5fb; border-color: #e1e9f3; }
.notice.warning { color: #926e33; background: #fff7e9; border-color: #f1e3c5; }
.notice.success { color: #47745a; background: #eef7ef; border-color: #d9e8dc; }

/* Tasks, documents and activity */
.task-row { display: flex; align-items: flex-start; gap: 11px; padding: 15px 21px; border-bottom: 1px solid var(--line-soft); }
.task-row:last-child { border-bottom: 0; }
.task-row > div { min-width: 0; }
.task-row .task-content { flex: 1; }
.task-row .cell-main { margin-bottom: 4px; }
.task-row.done .cell-main { color: #6d8074; text-decoration: line-through; }
.task-check { appearance: none; display: inline-block; flex-shrink: 0; width: 17px; height: 17px; margin: 2px 0 0; padding: 0; border: 1px solid #cad8cf; border-radius: 4px; background: #fff; cursor: pointer; }
.task-check:checked, .task-check.done { background: var(--teal); border-color: var(--teal); }
.task-check:checked::after, .task-check.done::after { content: ""; display: block; width: 4px; height: 8px; border: solid white; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); margin: 2px 5px; }
.checklist { display: flex; flex-direction: column; gap: 0; }
.check-item { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.check-item:last-child { border-bottom: 0; }
.check-item > input { accent-color: var(--teal); }
.check-item .badge { margin-left: auto; }
.document-card { display: flex; align-items: center; gap: 13px; padding: 16px 18px; border: 1px solid var(--line); background: white; border-radius: 8px; margin-bottom: 10px; }
.document-card > svg { color: #78a293; }
.document-card > div { min-width: 0; flex: 1; }
.document-card .cell-main { overflow-wrap: anywhere; }
.document-card .btn { flex-shrink: 0; }
.timeline { margin: 0; padding: 0; list-style: none; }
.timeline-item { position: relative; padding: 0 0 23px 25px; margin-left: 5px; border-left: 1px solid #dfe8e0; font-size: 13px; }
.timeline-item:last-child { padding-bottom: 0; border-left-color: transparent; }
.timeline-item::before { position: absolute; content: ""; left: -4px; top: 5px; width: 7px; height: 7px; background: #8bb6a5; border-radius: 50%; border: 2px solid white; box-sizing: content-box; }
.timeline-item .cell-sub { margin-bottom: 5px; }
.timeline-item p { color: #6b7e75; margin: 0; }
.activity-feed { padding: 0 20px; }
.activity-item { display: flex; gap: 11px; padding: 15px 0; border-bottom: 1px solid var(--line-soft); }
.activity-item:last-child { border-bottom: 0; }
.activity-item > svg { margin-top: 3px; color: #88a798; }
.activity-item p { font-size: 12.5px; color: #6c7b73; margin: 0; }
.activity-item small { display: block; margin-top: 5px; font-size: 11.5px; color: #6c7e72; }

/* Reports */
.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; margin-top: 22px; }
.bar-chart { display: flex; flex-direction: column; gap: 17px; padding: 2px 0; }
.bar-row { display: grid; grid-template-columns: 125px minmax(0, 1fr) 30px; align-items: center; gap: 12px; }
.bar-label { font-size: 12.5px; color: #718178; line-height: 1.4; }
.bar-track { height: 9px; border-radius: 3px; overflow: hidden; background: #edf2ed; }
.bar-fill { height: 100%; border-radius: inherit; background: #6ba995; min-width: 0; }
.bar-fill.amber { background: #c2a369; }
.bar-fill.blue { background: #8ca6c0; }
.bar-fill.teal { background: var(--teal); }
.bar-value { text-align: right; color: var(--ink); font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; color: #677b6c; font-size: 11.5px; margin-top: 16px; }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 7px; height: 7px; background: var(--teal); border-radius: 2px; }
.chart-note { color: #6d7e71; margin: 17px 0 0; font-size: 11.5px; line-height: 1.6; }

/* Forms and overlays */
.modal-backdrop { position: fixed; z-index: 100; inset: 0; display: flex; align-items: center; justify-content: center; padding: 28px; background: rgba(12, 35, 42, .4); backdrop-filter: blur(3px); overflow-y: auto; }
.modal { width: 560px; max-width: 100%; max-height: calc(100dvh - 56px); display: flex; flex-direction: column; border-radius: 13px; background: #fff; box-shadow: 0 28px 80px rgba(13, 35, 42, .22); overflow: hidden; animation: modalEnter .2s ease-out; }
.modal.wide { width: 790px; }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 22px 25px 19px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.modal-header h2 { font-size: 20px; margin: 0 0 4px; }
.modal-header p { margin: 0; color: var(--muted); font-size: 13px; }
.modal-body { padding: 23px 25px; overflow-y: auto; min-height: 0; }
.modal-body > :last-child { margin-bottom: 0; }
.modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: 9px; padding: 16px 25px; border-top: 1px solid var(--line); background: #fafbf9; flex-shrink: 0; }
.modal form { display: contents; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 17px; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > label { color: #5d726a; font-size: 12.5px; font-weight: 600; }
.field label .required { color: #bd7865; margin-left: 2px; }
.field small { color: #6c7d70; font-size: 11.5px; line-height: 1.5; }
.form-grid .full, .field.full { grid-column: 1 / -1; }
.input, .textarea, .select, .field input:not([type="checkbox"]), .field select, .field textarea { width: 100%; min-height: 39px; padding: 9px 11px; border: 1px solid #dce5de; border-radius: 6px; background: white; color: var(--ink); font-size: 13px; line-height: 1.5; }
.input::placeholder, .textarea::placeholder, .field input::placeholder, .field textarea::placeholder { color: #a0aaa5; }
.textarea, .field textarea { min-height: 90px; resize: vertical; }
.field input[readonly], .field input:disabled { background: #f4f7f2; color: #7f8c83; }
.checkbox-row { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; color: #63776b; }
.checkbox-row input { accent-color: var(--teal); margin-top: 4px; }
.toast { position: fixed; z-index: 150; bottom: 27px; left: calc(50% + 116px); transform: translate(-50%, 14px); max-width: calc(100vw - 40px); padding: 13px 19px; display: flex; align-items: center; gap: 9px; border: 1px solid #2d5a58; border-radius: 8px; background: #214c4c; box-shadow: var(--shadow-raised); color: white; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.drawer { position: fixed; z-index: 100; inset: 0 0 0 auto; width: 500px; max-width: 100%; background: white; border-left: 1px solid var(--line); box-shadow: -14px 0 50px rgba(20, 45, 44, .1); overflow-y: auto; }
.search-results { position: absolute; z-index: 80; top: calc(100% + 8px); left: 0; right: 0; max-height: min(480px, 70vh); overflow-y: auto; padding: 7px; border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: 0 12px 38px rgba(22, 51, 45, .14); }
.search-result { display: flex; align-items: center; gap: 11px; padding: 11px 9px; width: 100%; background: transparent; border: 0; border-radius: 6px; color: var(--ink); text-align: left; }
.search-result:hover { background: #f0f6f0; }
.search-result > svg { color: #7b9a8b; }
.search-result .cell-main { font-size: 12.5px; }
.search-result .cell-sub { font-size: 11.5px; }
.search-results .empty-state { padding: 20px 12px; font-size: 13px; }

@keyframes enter { from { opacity: .45; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }
@keyframes modalEnter { from { opacity: .5; transform: translateY(7px) scale(.99); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* Record-specific details and shared module aliases. */
.skip-link { position: fixed; z-index: 200; left: 16px; top: -60px; padding: 10px 16px; border-radius: 6px; background: var(--teal); color: white; font-weight: 600; }
.skip-link:focus { top: 12px; }
.status-dot { display: inline-block; flex-shrink: 0; width: 5px; height: 5px; border-radius: 50%; background: #b59453; }
.demo-label::before { display: none; }
.workspace > .prototype-banner { margin: 0; padding: 9px 32px; border: 0; border-bottom: 1px solid #e1e8df; border-radius: 0; justify-content: space-between; align-items: center; background: #eef3ec; font-size: 11.5px; }
.banner-detail { margin-left: 8px; color: #61755e; }
.banner-right { display: inline-flex; gap: 17px; align-items: center; color: #64765e; white-space: nowrap; }
.banner-right .link-button { font-size: 11.5px; font-weight: 550; }
.stage-strip { display: flex; align-items: stretch; gap: 4px; padding: 5px; background: #edf1ec; border: 1px solid #e1e7de; border-radius: 8px; overflow-x: auto; margin: 0 0 23px; }
.stage-step { display: flex; align-items: center; justify-content: center; gap: 6px; flex: 1 0 auto; min-height: 40px; padding: 9px 13px; border: 0; border-radius: 5px; background: transparent; color: #667e69; font-size: 12.5px; font-weight: 550; white-space: nowrap; }
.stage-step.complete { color: #52806b; }
.stage-step.current { color: #fff; background: var(--teal); box-shadow: 0 2px 5px rgba(30, 99, 89, .13); }
.stage-step.current svg { color: #d6ece5; }
.readiness-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.readiness-item { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 11px 12px; border: 1px solid #e3e9df; border-radius: 6px; background: #fafcf8; color: #6e8070; font-size: 12.5px; }
.readiness-item input { accent-color: var(--teal); }
.readiness-item.complete, .readiness-item.ready { background: #eff7ef; color: #4b7c5e; border-color: #d8e8d8; }
.readiness-item.missing, .readiness-item.blocked { background: #fff8eb; color: #9a773c; border-color: #eee1c7; }
.record-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.record-head h1, .record-head h2 { margin-bottom: 7px; }
.record-id { display: inline-flex; align-items: center; gap: 8px; color: #637e6c; font-size: 12.5px; font-weight: 500; letter-spacing: .1px; margin-bottom: 6px; }
.property-summary { padding: 15px 18px; border: 1px solid #e3e8de; border-radius: 8px; background: #f6f8f2; color: #74816f; font-size: 13px; line-height: 1.7; }
.property-summary strong { color: #405d4d; }
.quick-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.workflow-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 19px; }
.workflow-card { padding: 23px; min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.workflow-card h3 { font-size: 16px; margin: 0 0 9px; }
.workflow-card p { color: var(--muted); font-size: 13px; }
.workflow-card .section-title { font-size: 12.5px; margin: 18px 0 7px; letter-spacing: .35px; text-transform: uppercase; color: #7d9083; }
.workflow-card ol, .workflow-card ul { color: #6a7f71; margin: 9px 0 0; padding-left: 19px; font-size: 13px; line-height: 1.8; }
.module-list { list-style: none; padding: 0; margin: 0; }
.module-list > li, .module-list > div { display: flex; align-items: flex-start; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.module-list > :last-child { border-bottom: 0; }
.module-list svg { color: #739889; margin-top: 3px; }
.module-list strong { display: block; font-size: 13px; color: var(--ink); }
.module-list p { font-size: 13px; color: var(--muted); margin: 3px 0 0; }
.permission-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.permission-table th { font-size: 11.5px; text-align: left; color: #627a66; background: #f7f9f3; }
.permission-table th, .permission-table td { padding: 11px 13px; border-bottom: 1px solid var(--line); }
.permission-table td { color: #657968; }
.design-section { margin: 26px 0; }
.design-section > h2 { margin: 0 0 13px; font-size: 19px; }
.design-section > p { color: var(--muted); font-size: 13px; max-width: 850px; }
.flow-diagram { display: flex; align-items: center; justify-content: center; gap: 13px; flex-wrap: wrap; padding: 20px 0; }
.flow-node { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 138px; padding: 19px 23px; border: 1px solid #c8dcd2; border-radius: 8px; background: #f1f7f2; color: #467261; font-size: 13px; font-weight: 650; text-align: center; }
.flow-node small { margin-top: 4px; color: #86a090; font-size: 11.5px; font-weight: 400; }
.flow-arrow { color: #9cb4a6; font-size: 19px; }
.feature-list { margin: 0; padding-left: 18px; color: #6c8071; font-size: 13px; line-height: 1.8; }
.feature-list li { padding-left: 3px; margin-bottom: 5px; }
.page-eyebrow { color: var(--teal); font-size: 11.5px; font-weight: 700; letter-spacing: 1.25px; text-transform: uppercase; margin-bottom: 6px; }
.page-description { color: var(--muted); font-size: 13px; line-height: 1.6; margin: 0; max-width: 790px; }
.page-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; flex-shrink: 0; padding-top: 5px; }
.btn-primary { background: var(--teal); color: white; border-color: var(--teal); }
.btn-primary:hover { background: var(--teal-dark); border-color: var(--teal-dark); }
.btn-secondary { background: white; color: var(--ink); }
.btn-small { min-height: 29px; padding: 5px 9px; font-size: 12.5px; border-radius: 5px; }
.metric-note { color: #687c71; margin-top: 9px; font-size: 11.5px; line-height: 1.5; }
.filter-label { display: inline-flex; align-items: center; gap: 8px; color: #839187; font-size: 12.5px; }
.filter-label select { padding: 7px 10px; min-height: 35px; border: 1px solid #dfe6df; border-radius: 6px; color: #5c7566; background: white; font-size: 13px; }
.table-primary { display: block; color: var(--ink); font-size: 13px; font-weight: 600; }
.table-secondary { display: block; color: #68796f; margin-top: 4px; font-size: 11.5px; }
.numeric { text-align: right !important; font-variant-numeric: tabular-nums; }
.overdue { color: var(--red); }
.note-line { color: #667d69; font-size: 12.5px; line-height: 1.7; margin: 14px 0 0; }
.inline-stat { display: inline-flex; align-items: baseline; gap: 7px; color: var(--muted); font-size: 12.5px; }
.inline-stat strong { color: var(--ink); font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; }
.report-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 17px; color: #637b67; font-size: 11.5px; }
.report-legend > span { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { display: inline-block; width: 7px; height: 7px; border-radius: 2px; background: var(--teal); }
.legend-dot.amber { background: #c2a369; }
.legend-dot.blue { background: #8ca6c0; }
.split-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.summary-line { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 12.5px; color: #7d8d81; }
.summary-line:last-child { border-bottom: 0; }
.summary-line strong { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.report-footnote { color: #667c6b; font-size: 11.5px; line-height: 1.7; margin: 15px 0 0; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.text-link { color: var(--teal-dark); font-weight: 550; text-decoration: none; border: 0; padding: 0; background: none; font-size: inherit; cursor: pointer; }
.text-link:hover { text-decoration: underline; }

/* Interactive records retain link semantics without native button chrome. */
button.row-link { appearance: none; display: inline; margin: 0; padding: 0; border: 0; border-radius: 2px; background: transparent; color: var(--ink); font: inherit; font-weight: 600; line-height: inherit; text-align: left; vertical-align: baseline; cursor: pointer; }
button.row-link:hover { color: var(--teal-dark); text-decoration: underline; }
button.row-link:focus-visible { outline: 3px solid #6abdb3; outline-offset: 3px; }
button.bar-row { appearance: none; width: 100%; margin: 0; padding: 5px 6px; border: 0; border-radius: 5px; background: transparent; text-align: left; font: inherit; }
button.bar-row:hover { background: #f0f6ef; }
button.bar-row:focus-visible { outline: 3px solid #6abdb3; outline-offset: 2px; }
.bar-fill { display: block; }
button.kanban-card { display: block; width: 100%; font: inherit; text-align: left; }
.kanban-header h2 { margin: 0; font-size: 13px; font-weight: 650; color: #5c7869; }
.kanban-card > .card-meta:first-child { margin-top: 0; }
.kanban-card > p { color: #748477; font-size: 13px; line-height: 1.55; margin: 8px 0 12px; }
button.task-check { display: inline-flex; align-items: center; justify-content: center; color: white; min-width: 17px; }
button.task-check[aria-pressed="true"], button.task-check.checked { background: var(--teal); border-color: var(--teal); }
button.task-check[aria-pressed="false"]:hover { background: #e9f4ed; border-color: #75a98c; }
.back-link { margin: 0 0 17px; font-size: 12.5px; color: #6d8577; }
.card-next { display: flex; align-items: flex-start; gap: 6px; border-top: 1px solid var(--line-soft); margin-top: 12px; padding-top: 11px; color: #6c8173; font-size: 12.5px; line-height: 1.5; }
.card-next svg { margin-top: 2px; color: #7d9e8b; }
.case-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; padding: 18px 0; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.case-facts > div { min-width: 0; }
.case-facts span { display: block; font-size: 11.5px; margin-bottom: 5px; }
.case-facts strong { display: block; color: var(--ink); font-size: 13px; font-weight: 550; overflow-wrap: anywhere; }
.case-kanban .kanban-column { flex-basis: 247px; }
.client-card-stats { display: flex; gap: 25px; margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line-soft); color: #778b7b; font-size: 11.5px; }
.client-card-stats strong { display: block; font-size: 21px; color: #345847; font-weight: 600; line-height: 1.25; margin-bottom: 3px; }
.column-empty { padding: 26px 8px; margin: 0; font-size: 12.5px; text-align: center; }
.decision-list { counter-reset: decision; list-style: none; margin: 0; padding: 0; }
.decision-list li { position: relative; counter-increment: decision; margin: 0; padding: 15px 0 15px 35px; border-bottom: 1px solid var(--line-soft); color: #657d6d; font-size: 13px; line-height: 1.6; }
.decision-list li:last-child { border-bottom: 0; }
.decision-list li::before { content: counter(decision, decimal-leading-zero); position: absolute; left: 0; top: 15px; color: #75a28c; font-size: 12.5px; font-weight: 650; }
.document-content { flex: 1; min-width: 0; }
.document-icon { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 35px; height: 40px; border-radius: 6px; background: #eff5ed; color: #739b81; }
.document-list .document-card:last-child { margin-bottom: 0; }
.document-preview { padding: 23px; border: 1px solid #e4e8dc; border-radius: 7px; background: #fafbf6; color: #5d7260; font-size: 13px; line-height: 1.9; overflow-wrap: anywhere; }
.filter-group { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; min-width: 0; }
.filter-group .search-input { flex: 1 1 210px; }
.form-error { padding: 11px 13px; border: 1px solid #efd8d1; border-radius: 6px; background: #fff2ef; color: #ad5143; font-size: 13px; margin: 18px 0 0; }
.form-error:empty { display: none; }
.next-action { color: #254a3e; font-size: 18px; line-height: 1.5; font-weight: 550; letter-spacing: -.2px; margin-bottom: 21px; }
.property-meta { display: flex; justify-content: space-between; gap: 16px; margin-top: 18px; padding-top: 13px; border-top: 1px solid var(--line-soft); color: #718570; font-size: 11.5px; }
.property-meta strong { display: block; color: #3e634c; margin-top: 4px; font-size: 13px; font-weight: 550; }
.record-fields { display: grid; grid-template-columns: 115px minmax(0, 1fr); gap: 13px 15px; margin: 0 0 22px; font-size: 13px; line-height: 1.6; }
.record-fields dt { color: #748673; font-size: 12.5px; }
.record-fields dd { margin: 0; color: var(--ink); font-weight: 500; overflow-wrap: anywhere; }
.detail-aside .record-fields { grid-template-columns: minmax(0, 1fr); gap: 4px; }
.detail-aside .record-fields dd { margin-bottom: 12px; }
.detail-aside .record-fields dd:last-child { margin-bottom: 0; }
.scope-text { margin: 18px 0 0; color: #778776; font-size: 13px; line-height: 1.75; }
.scope-text + .notice { margin-top: 18px; }
.section-link { margin-top: 17px; font-size: 12.5px; }
.sidebar-note { margin-bottom: 7px; color: #91abae; font-size: 11.5px; }
.sidebar-version { display: block; margin-top: 15px; color: #86a0a4; font-size: 11px; }
.sidebar-bottom > .nav-item { padding: 9px 0; font-size: 11.5px; line-height: 1.6; color: #b2cbc9; }
.sidebar-bottom > .nav-item svg { width: 16px; }
.task-date { flex-shrink: 0; min-width: 80px; max-width: 100px; text-align: right; font-size: 12.5px; line-height: 1.5; }
.task-date .badge { white-space: normal; text-align: center; }
.timeline-dot { position: absolute; left: -4px; top: 5px; width: 7px; height: 7px; background: #8bb6a5; border: 2px solid white; border-radius: 50%; box-sizing: content-box; }
.timeline-item:has(.timeline-dot)::before { display: none; }
.view-meta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 18px; margin: 15px 0; color: #627d69; font-size: 12.5px; }
.view-meta .muted { font-size: 11.5px; }
.workflow-docs { margin: 16px 0 19px; padding: 13px 0 0; border-top: 1px solid var(--line-soft); }
.workflow-docs strong { display: block; font-size: 11.5px; font-weight: 650; color: #6a8772; margin-bottom: 5px; }
.workflow-docs p { font-size: 12.5px; line-height: 1.7; margin: 0; }
.workflow-card > h2 { font-size: 18px; margin: 13px 0 9px; }
.detail-main .property-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel-body > .task-row { padding-left: 0; padding-right: 0; }
.panel-body > .task-row:first-child { padding-top: 0; }
.content-grid + .content-grid { margin-top: 23px; }
@media (min-width: 1000px) {
  .topbar .mobile-menu { display: none; }
}

/* The workspace adapts to the task; tables scroll inside their own panels. */
@media (min-width: 1600px) {
  .page { padding: 35px 42px 48px; }
  .topbar { padding-left: 42px; padding-right: 42px; }
  .metrics-grid { gap: 21px; }
  .metric-card { padding: 22px; }
  .content-grid { grid-template-columns: minmax(0, 1.9fr) minmax(330px, 1fr); gap: 25px; }
}
@media (max-width: 1250px) {
  .page { padding: 26px 25px 36px; }
  .topbar { padding-left: 25px; padding-right: 25px; }
  .metrics-grid { gap: 12px; }
  .metric-card { padding: 16px; }
  .metric-value { font-size: 27px; }
  .content-grid { grid-template-columns: minmax(0, 1.55fr) minmax(270px, 1fr); gap: 18px; }
  .detail-grid { grid-template-columns: minmax(0, 1fr) 285px; gap: 18px; }
  .client-grid, .property-grid, .case-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .global-search { width: 260px; }
  .top-actions { gap: 10px; }
  .data-table th, .data-table td { padding-left: 14px; padding-right: 14px; }
}
@media (max-width: 999px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; width: 248px; box-shadow: 12px 0 40px rgba(14, 37, 43, .2); }
  .workspace { margin-left: 0; }
  .sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-open::after { content: ""; position: fixed; z-index: 50; inset: 0; background: rgba(15, 37, 41, .3); }
  .sidebar-open .mobile-menu { position: relative; z-index: 65; }
  .mobile-menu { display: inline-flex; flex-shrink: 0; }
  .topbar .mobile-menu { display: inline-flex; }
  .topbar { gap: 13px; }
  .breadcrumb { margin-right: auto; }
  .global-search { width: 290px; max-width: 36vw; }
  .top-actions { margin-left: auto; }
  .toast { left: 50%; }
}
@media (max-width: 760px) {
  .page { padding: 23px 19px 32px; }
  .page-title { font-size: 25px; }
  .page-subtitle { font-size: 13px; }
  .page-header { gap: 15px; margin-bottom: 21px; }
  .header-actions { padding-top: 1px; }
  .header-actions .btn { padding-left: 10px; padding-right: 10px; }
  .topbar { min-height: 62px; padding: 11px 18px; gap: 10px; }
  .breadcrumb { display: none; }
  .global-search { flex: 1; width: auto; max-width: none; }
  .global-search kbd { display: none; }
  .top-actions { gap: 9px; margin-left: 0; }
  .top-actions .demo-label { display: none; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 21px; }
  .metric-card { min-height: 116px; padding: 15px; }
  .metric-value { font-size: 26px; }
  .metric-label { font-size: 12.5px; }
  .metric-meta { margin-top: 8px; }
  .content-grid, .detail-grid, .chart-grid { grid-template-columns: minmax(0, 1fr); }
  .detail-aside { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 17px; }
  .detail-aside .panel + .panel { margin-top: 0; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel-header { padding: 17px 18px 15px; }
  .panel-body { padding: 18px; }
  .toolbar { padding: 14px 16px; gap: 10px; }
  .toolbar .search-input { flex: 1; width: 100%; min-width: 140px; }
  .toolbar > .split { flex: 1; }
  .toolbar .filter-select { flex: 1; }
  .data-table { min-width: 620px; }
  .data-table.compact { min-width: 430px; }
  .data-table th, .data-table td { padding: 12px 14px; }
  .data-table td:first-child, .data-table th:first-child { padding-left: 17px; }
  .table-footer { padding: 12px 17px; }
  .kanban { margin-right: -19px; padding-right: 19px; }
  .kanban-column { flex-basis: 253px; }
  .task-row { padding: 14px 18px; }
  .tabs { gap: 20px; }
  .modal-backdrop { padding: 17px; }
  .modal { max-height: calc(100dvh - 34px); }
  .modal-header, .modal-body { padding: 20px; }
  .modal-footer { padding: 15px 20px; }
  .workspace > .prototype-banner { padding: 9px 19px; }
  .banner-detail { display: block; margin-left: 0; }
  .banner-right { gap: 9px; font-size: 11px; }
  .flow-node { min-width: 117px; padding: 16px 18px; }
}
@media (max-width: 520px) {
  body { font-size: 13px; }
  .page { padding: 21px 15px 30px; }
  .page-header { flex-direction: column; gap: 14px; }
  .header-actions { width: 100%; padding: 0; }
  .header-actions .btn { flex: 1; }
  .page-title { font-size: 25px; }
  .page-subtitle { font-size: 13px; }
  .topbar { padding: 10px 14px; }
  .top-actions .btn.icon-only { display: none; }
  .top-actions .avatar { width: 30px; height: 30px; }
  .global-search { min-height: 35px; padding: 0 10px; }
  .global-search input { font-size: 12.5px; }
  .prototype-banner { padding: 10px 12px; font-size: 11.5px; }
  .prototype-banner a { white-space: normal; }
  .metrics-grid { gap: 10px; }
  .metric-card { padding: 14px; border-radius: 8px; }
  .metric-value { font-size: 25px; }
  .metric-label { font-size: 11.5px; }
  .metric-icon svg { width: 15px; height: 15px; }
  .metric-meta { font-size: 11px; }
  .content-grid, .detail-grid, .chart-grid { gap: 17px; }
  .grid-2, .grid-3, .client-grid, .property-grid, .case-grid, .detail-aside { grid-template-columns: minmax(0, 1fr); gap: 15px; }
  .panel + .panel { margin-top: 17px; }
  .content-grid > .panel + .panel { margin-top: 0; }
  .panel-header { gap: 10px; }
  .panel-title { font-size: 14px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar .segmented { width: fit-content; max-width: 100%; }
  .toolbar .search-input { min-width: 0; }
  .segmented button { padding: 6px 8px; font-size: 11.5px; }
  .kanban { margin-right: -15px; padding-right: 15px; gap: 12px; }
  .kanban-column { flex-basis: min(285px, 82vw); min-width: 230px; }
  .task-row { gap: 10px; }
  .task-row .avatar { display: none; }
  .document-card { flex-wrap: wrap; gap: 10px; padding: 14px; }
  .document-card > div { flex-basis: calc(100% - 40px); }
  .document-card .btn { margin-left: 34px; }
  .bar-row { grid-template-columns: 105px minmax(0, 1fr) 25px; gap: 9px; }
  .bar-label { font-size: 11.5px; }
  .modal-backdrop { padding: 10px; align-items: flex-end; }
  .modal { border-radius: 12px; max-height: calc(100dvh - 20px); }
  .modal-header { padding: 18px; }
  .modal-header h2 { font-size: 18px; }
  .modal-body { padding: 18px; }
  .modal-footer { padding: 14px 18px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .input, .textarea, .select, .field input:not([type="checkbox"]), .field select, .field textarea { font-size: 16px; min-height: 43px; }
  .search-results { position: fixed; top: 63px; left: 12px; right: 12px; max-height: 65vh; }
  .toast { bottom: 18px; width: calc(100vw - 30px); max-width: 420px; justify-content: center; font-size: 12.5px; }
  .workspace > .prototype-banner { padding: 9px 15px; gap: 12px; }
  .banner-right { flex-direction: column; align-items: flex-end; gap: 1px; }
  .workflow-grid, .readiness-grid, .split-summary { grid-template-columns: minmax(0, 1fr); }
  .workflow-card { padding: 19px; }
  .flow-diagram { gap: 9px; }
  .flow-node { min-width: 115px; flex: 1; }
  .flow-arrow { font-size: 14px; }
  .record-head { flex-direction: column; gap: 12px; }
  .page-actions { width: 100%; padding: 0; }
  .page-actions .btn { flex: 1; }
  .permission-table { min-width: 560px; }
  .case-facts { grid-template-columns: minmax(0, 1fr); gap: 13px; }
  .case-facts > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
  .case-facts strong { text-align: right; }
  .case-facts span { margin-bottom: 0; }
  .next-action { font-size: 16px; }
  .record-fields { grid-template-columns: minmax(0, 1fr); gap: 3px; }
  .record-fields dd { margin-bottom: 12px; }
  .record-fields dd:last-child { margin-bottom: 0; }
  .detail-main .property-grid { grid-template-columns: minmax(0, 1fr); }
  .document-preview { padding: 16px; font-size: 13px; }
  .document-card > .document-content { flex-basis: calc(100% - 50px); }
  .task-date { min-width: 66px; max-width: 85px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
@media print {
  body { background: white; color: #000; }
  .sidebar, .topbar, .prototype-banner, .header-actions, .modal-backdrop, .toast, .btn { display: none !important; }
  .workspace { margin-left: 0; }
  .page { max-width: none; padding: 0; }
  .panel, .metric-card { box-shadow: none; break-inside: avoid; }
  .table-wrap { overflow: visible; }
  .data-table { min-width: 0; }
  .page-header { display: block; }
}
/* Shared, server-backed edition. */
.nav-symbol{display:inline-block;width:20px;text-align:center;font-size:18px;color:#96b8bb}.sidebar-user{padding-top:15px;border-top:1px solid #37555c}.sidebar-user>a{display:block;color:#c2d8d8;margin-top:7px}.sidebar-logout{border:0;background:none;color:#c2d8d8;padding:5px 0;font-size:13px}.sidebar{padding-top:24px}.page{padding:30px 32px 50px;max-width:1800px;margin:auto}.page-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;margin-bottom:25px}.eyebrow{color:var(--teal);font-size:11.5px;font-weight:700;letter-spacing:1.2px;text-transform:uppercase;margin-bottom:7px}.page-heading h1{margin:0 0 8px}.page-heading p{color:var(--muted);max-width:750px;margin:0}.actions{display:flex;gap:9px;flex-wrap:wrap;align-items:center}.notice{border:1px solid #c9ded5;background:#edf6f0;color:#295644;padding:13px 17px;border-radius:7px;margin-bottom:18px}.notice.error,.errornote{border-color:#ebc8c5;background:#fff1ef;color:#8d383c}.notice.warning{background:#fff6e4;border-color:#e7d7b6;color:#86652b}.notice.info{background:#eff4f8;border-color:#d1dce6;color:#3c5970}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px 24px}.field{min-width:0}.field.full{grid-column:1/-1}.field label{display:block;font-weight:600;font-size:13px;margin-bottom:7px;color:var(--ink)}.field input:not([type=checkbox]),.field select,.field textarea{width:100%;border:1px solid #d5dfdb;border-radius:6px;padding:10px 12px;background:#fff;min-height:42px;color:var(--text)}.field textarea{min-height:100px;resize:vertical}.field input[type=checkbox]{width:18px;height:18px;accent-color:var(--teal);vertical-align:middle}.field .helptext,.helptext{font-size:12.5px;color:var(--muted);display:block;margin-top:5px}.errorlist{margin:6px 0;padding-left:18px;color:#a73d43;font-size:13px}.form-footer{display:flex;gap:10px;margin-top:25px;border-top:1px solid var(--line);padding-top:20px}.form-panel{max-width:1000px}.data-table th{white-space:nowrap}.data-table td{vertical-align:top}.data-table td strong{display:block}.data-table td small{display:block;color:var(--muted);margin-top:3px}.data-table tbody tr:hover{background:#fbfcfa}.empty-state{padding:42px 25px;text-align:center;color:var(--muted)}.empty-state h2{font-size:18px}.empty-state p{max-width:490px;margin:0 auto 16px}.record-fields{display:grid;grid-template-columns:140px 1fr;gap:10px 16px;margin:0}.record-fields dt{color:var(--muted);font-size:13px}.record-fields dd{margin:0;white-space:pre-line}.detail-grid{display:grid;grid-template-columns:minmax(0,1.8fr) minmax(270px,1fr);gap:22px;align-items:start}.detail-main>.panel,.detail-aside>.panel{margin-bottom:22px}.timeline{list-style:none;margin:0;padding:0}.timeline li{padding:12px 0;border-bottom:1px solid var(--line-soft)}.timeline li:last-child{border:0}.timeline small{display:block;color:var(--muted);font-size:12.5px}.check-list{list-style:none;margin:0;padding:0}.check-list li{padding:9px 0;border-bottom:1px solid var(--line-soft)}.check-list li:last-child{border:0}.check-list .pass{color:#3b7e5e}.check-list .fail{color:#a73d43}.inline-form{display:inline}.inline-form .btn{vertical-align:middle}.form-inline-grid{display:flex;align-items:flex-end;gap:12px;flex-wrap:wrap}.form-inline-grid .field{flex:1;min-width:150px}.form-inline-grid .btn{min-height:42px}.two-column{display:grid;grid-template-columns:1fr 1fr;gap:20px}.pill-list{display:flex;gap:7px;flex-wrap:wrap}.timeline .actor{font-weight:600}.section-divider{border-top:1px solid var(--line);padding-top:20px;margin-top:20px}.workflow-steps{padding-left:21px}.workflow-steps li{padding:4px 0}.pagination{padding:16px 20px;display:flex;gap:18px;align-items:center;justify-content:center;border-top:1px solid var(--line)}.auth-layout{max-width:470px;margin:8vh auto;padding:25px}.auth-layout .panel{padding:30px}.auth-layout .field{margin-bottom:18px}.auth-layout input{width:100%;border:1px solid var(--line);border-radius:6px;padding:10px}.auth-layout button{margin-top:10px}.mobile-menu{display:none}.state-strip{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:20px}.state-strip span{padding:6px 10px;border-radius:5px;border:1px solid var(--line);font-size:12.5px;color:var(--muted)}.state-strip .current{background:var(--teal);border-color:var(--teal);color:white}.task-done{opacity:.58}.task-done .task-title{text-decoration:line-through}.filter-form{display:flex;gap:10px;flex-wrap:wrap;align-items:center;width:100%}.filter-form input,.filter-form select{border:1px solid var(--line);padding:8px 10px;border-radius:6px;background:#fff;min-height:37px}.text-preline{white-space:pre-line}.version-note{font-size:12.5px;color:var(--muted);margin-bottom:0}.document-versions details{margin-top:7px}.document-versions summary{cursor:pointer;color:var(--teal);font-size:12.5px}.document-versions ul{padding-left:18px;font-size:12.5px}.readiness-form{margin-top:18px}.readiness-form label{font-size:13px;display:flex;gap:8px;align-items:flex-start;margin:9px 0}.readiness-form input{accent-color:var(--teal);margin-top:3px}.workflow-card{margin:0!important}.workflow-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}.stats-row{display:flex;flex-wrap:wrap;gap:16px;margin-top:15px}.stats-row>span{font-size:13px}.list-link{font-weight:600}.field .checkbox-row{display:flex;gap:9px;align-items:center}.field .checkbox-row label{margin:0}.task-line{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;border-bottom:1px solid var(--line-soft);padding:14px 0}.task-line:last-child{border:0}.task-line small{display:block;color:var(--muted);margin-top:3px}
@media(max-width:1100px){.metrics-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.detail-grid,.content-grid{grid-template-columns:1fr}.topbar{padding:13px 22px}.page{padding:25px 22px}.global-search{width:270px}.workflow-grid{grid-template-columns:1fr}}
@media(max-width:850px){.sidebar{transform:translateX(-100%);transition:transform .2s}.sidebar.is-open{transform:translateX(0)}.workspace{margin-left:0}.mobile-menu{display:inline-flex}.topbar{gap:12px}.breadcrumb{display:none}.global-search{max-width:none;flex:1}.topbar>.badge{display:none}.page-heading{flex-direction:column}.form-grid,.two-column{grid-template-columns:1fr}.field.full{grid-column:auto}.page{padding:22px 16px}.record-fields{grid-template-columns:115px 1fr}}
@media(max-width:480px){.metrics-grid{grid-template-columns:1fr 1fr;gap:10px}.metric-card{padding:14px;min-height:110px}.metric-value{font-size:25px}.panel-header,.panel-body{padding:17px}.record-fields{grid-template-columns:1fr;gap:3px}.record-fields dd{margin-bottom:10px}h1{font-size:27px}}
@media(max-width:999px){.sidebar.is-open{transform:translateX(0)}.topbar .mobile-menu{display:inline-flex}.topbar .global-search{max-width:none}}
.detail-aside .form-grid{grid-template-columns:1fr}.detail-aside .field.full{grid-column:auto}
/* STL Solutions brand identity (logo from stlsolutions.co.uk). */
.brand { gap: 12px; padding: 0 8px 26px; }
.brand-logo { display: block; width: 88px; height: auto; flex-shrink: 0; }
.brand .brand-name { padding-left: 12px; border-left: 1px solid #3e5d65; font-size: 16px; }
.app-footer { display: flex; align-items: center; gap: 10px; max-width: 1800px; margin: 0 auto; padding: 18px 32px 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; }
.app-footer-logo { width: 40px; height: auto; opacity: .85; }
@media (max-width: 850px) { .app-footer { padding: 16px; } }
@media print { .app-footer { display: none; } }

/* Workflow library */
.wf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin-top: 8px; }
.wf-grid > div { min-width: 0; }
.wf-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; }
.wf-list li { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; border-bottom: 1px solid var(--line, #e3e8ec); padding-bottom: 8px; }
.wf-list li small { display: block; color: var(--muted, #667); font-size: 12.5px; }
.wf-controls { display: inline-flex; gap: 4px; flex-wrap: wrap; flex-shrink: 0; }
.wf-controls .inline-form { display: inline-flex; gap: 4px; }

/* Leads: step bar, what-to-do-now, calls */
.contact-chips{display:flex;flex-wrap:wrap;gap:6px 16px;color:var(--muted);font-size:13.5px}.contact-chips a{color:var(--teal-dark);text-decoration:none}.contact-chips a:hover{text-decoration:underline}
.stepper{list-style:none;margin:0 0 22px;padding:0;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));background:var(--paper);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);overflow:hidden}
.stepper li{display:flex;gap:11px;align-items:flex-start;padding:15px 16px;position:relative;border-right:1px solid var(--line-soft)}.stepper li:last-child{border-right:0}
.step-dot{flex:0 0 26px;height:26px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;font-size:12.5px;font-weight:700;border:1.5px solid #cfdad6;color:var(--muted);background:#fff}
.step-text{display:flex;flex-direction:column;min-width:0}.step-text strong{font-size:13.5px;color:var(--ink)}.step-text small{font-size:12px;color:var(--muted);margin-top:2px}
.stepper li.done .step-dot{background:var(--teal-soft);border-color:var(--teal);color:var(--teal-dark)}.stepper li.done .step-text strong{color:var(--teal-dark)}
.stepper li.current{background:var(--teal-soft)}.stepper li.current::after{content:"";position:absolute;left:0;right:0;bottom:0;height:3px;background:var(--teal)}
.stepper li.current .step-dot{background:var(--teal);border-color:var(--teal);color:#fff}
.stepper li.todo .step-text strong{color:var(--muted)}.stepper.closed{opacity:.6}
.step-back{border:0;background:none;padding:0;margin-top:5px;color:var(--teal);font-size:12px;cursor:pointer;text-align:left}.step-back:hover{text-decoration:underline}
.now-card{border-left:4px solid var(--teal)}.now-card .next-action{font-size:16px;font-weight:650;color:var(--ink);margin:0 0 8px}.now-card .actions{margin-top:14px}
.todo-list{list-style:none;padding:0;margin:16px 0}.todo-list li{display:flex;gap:10px;align-items:center;padding:9px 0;border-bottom:1px solid var(--line-soft);font-size:14px}.todo-list li:last-child{border:0}
.todo-list .tick{flex:0 0 22px;height:22px;border-radius:6px;border:1.5px solid #cfdad6;display:inline-flex;align-items:center;justify-content:center;font-size:12px;font-weight:700}
.todo-list li.done .tick{background:var(--green);border-color:var(--green);color:#fff}.todo-list li.done>span:last-child{color:var(--muted)}
.invoice-line{display:flex;flex-wrap:wrap;gap:6px 18px;padding:12px 14px;border:1px solid var(--line);border-radius:8px;background:#fbfcfa;margin:12px 0}
.enquiry-text{background:#fbfcfa;border:1px solid var(--line-soft);border-radius:8px;padding:12px 14px;margin-bottom:16px;font-size:13.5px;max-height:320px;overflow:auto}
.call-card{display:flex;gap:14px;padding:13px 0;border-bottom:1px solid var(--line-soft)}.call-card:last-child{border-bottom:0}
.now-card .call-card{border:1px solid #cfe3dd;border-radius:9px;padding:13px 14px;background:#fff;margin:6px 0 4px}
.date-tile{flex:0 0 54px;height:58px;border-radius:9px;border:1px solid var(--line);display:flex;flex-direction:column;align-items:center;justify-content:center;background:#fff;line-height:1.05}
.date-tile span{font-size:10.5px;text-transform:uppercase;letter-spacing:.8px;color:var(--red);font-weight:700}.date-tile strong{font-size:21px;color:var(--ink)}.date-tile small{font-size:10.5px;color:var(--muted)}
.call-card.upcoming .date-tile{border-color:var(--teal);background:var(--teal-soft)}.call-card.cancelled{opacity:.55}.call-card.to-record .date-tile{border-color:var(--gold);background:var(--amber-soft)}
.call-body{min-width:0;flex:1}.call-title{display:flex;flex-wrap:wrap;gap:6px 9px;align-items:center;font-size:14px}.call-meta{font-size:12.5px;color:var(--muted);margin-top:3px}
.call-outcome{font-size:13px;margin-top:7px;padding:8px 10px;background:#fbfcfa;border-left:3px solid var(--line);border-radius:4px}
.call-actions{display:flex;flex-wrap:wrap;gap:7px;margin-top:9px}
.field ul[id^="id_mode"],.field ul[id^="id_status"],.field div[id^="id_mode"],.field div[id^="id_status"]{display:flex;flex-wrap:wrap;gap:8px;list-style:none;padding:0;margin:0}
.field [id^="id_mode"] label,.field [id^="id_status"] label{display:inline-flex;gap:8px;align-items:center;border:1px solid #d5dfdb;border-radius:7px;padding:9px 13px;font-weight:500;margin:0;cursor:pointer;background:#fff}
.field input[type=radio]{width:16px!important;min-height:0!important;height:16px;accent-color:var(--teal);margin:0}
@media(max-width:1100px){.stepper{grid-template-columns:repeat(5,minmax(150px,1fr));overflow-x:auto}}
@media(max-width:760px){.stepper{display:flex;overflow-x:auto}.stepper li{flex:0 0 170px}}

/* Calls calendar */
.panel.attention{border-color:#ecd9b0;background:#fffbf2}.to-record-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:10px}
.to-record{display:flex;flex-direction:column;gap:2px;padding:10px 12px;border:1px solid #ecd9b0;border-radius:8px;background:#fff;text-decoration:none;color:var(--text);font-size:13px}.to-record .link{color:var(--teal);font-weight:600;margin-top:3px}
.cal-panel{padding:0;overflow:hidden}.cal{--hour:58px}
.cal-head,.cal-body{display:grid;grid-template-columns:58px repeat(7,minmax(0,1fr))}
.cal-head{border-bottom:1px solid var(--line);background:#fbfcfa;position:sticky;top:0;z-index:2}
.cal-day-head{padding:9px 8px;text-align:center;border-left:1px solid var(--line-soft);display:flex;flex-direction:column;line-height:1.15}.cal-day-head span{font-size:11px;text-transform:uppercase;letter-spacing:.8px;color:var(--muted)}.cal-day-head strong{font-size:19px;color:var(--ink)}
.cal-day-head.today strong{color:#fff;background:var(--teal);border-radius:50%;width:32px;height:32px;display:inline-flex;align-items:center;justify-content:center;margin:2px auto 0}
.cal-day-head.weekend,.cal-col.weekend{background:#fafbf9}
.cal-hour{height:var(--hour);position:relative}.cal-hour span{position:absolute;top:-8px;right:8px;font-size:11px;color:var(--muted)}.cal-hour:first-child span{top:3px}
.cal-col{position:relative;border-left:1px solid var(--line-soft)}.cal-col.today{background:#f6fbf9}
.cal-slot{height:var(--hour);border-bottom:1px solid var(--line-soft)}
.cal-now{position:absolute;left:0;right:0;height:2px;background:var(--red);z-index:3}.cal-now::before{content:"";position:absolute;left:-5px;top:-4px;width:10px;height:10px;border-radius:50%;background:var(--red)}
.cal-item{position:absolute;left:4px;right:4px;border-radius:7px;padding:4px 7px;font-size:11.5px;line-height:1.25;overflow:hidden;text-decoration:none;display:flex;flex-direction:column;border-left:3px solid;z-index:1;min-height:22px;box-shadow:0 1px 2px rgba(22,47,55,.08)}
.cal-item:hover{z-index:4;box-shadow:var(--shadow-raised);min-height:max-content}
.cal-time{font-weight:700}.cal-name{font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.cal-kind{opacity:.8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.kind-free-consultation{background:var(--teal-soft);border-color:var(--teal);color:var(--teal-dark)}
.kind-needs-call{background:var(--blue-soft);border-color:var(--blue);color:#33547c}
.kind-expert-session{background:var(--purple-soft);border-color:var(--purple);color:#5b4878}
.kind-follow-up-call,.kind-meeting{background:var(--green-soft);border-color:var(--green);color:#2d6248}
.cal-item.other,.agenda-item.other,.cal-legend .other{background:#f1f3f1;border-color:#b8c2bf;color:#5c6a6e}
.cal-item.held{opacity:.7}.cal-item.no-show{opacity:.6;text-decoration:line-through}
.cal-item.to-record,.cal-legend .to-record{box-shadow:inset 0 0 0 1.5px var(--gold)}
.cal-legend{display:flex;flex-wrap:wrap;gap:8px;padding:12px 16px;border-top:1px solid var(--line);font-size:12px}.cal-legend span{padding:3px 9px;border-radius:5px;border-left:3px solid}
.cal-agenda{display:none;padding:6px 16px}.agenda-day h3{font-size:13px;margin:14px 0 6px;color:var(--muted);text-transform:uppercase;letter-spacing:.6px}
.agenda-item{display:grid;grid-template-columns:52px 1fr;gap:0 8px;padding:9px 10px;border-radius:7px;border-left:3px solid;margin-bottom:6px;text-decoration:none}.agenda-item small{grid-column:2;opacity:.8}
@media(max-width:760px){.cal{display:none}.cal-agenda{display:block}}

/* Scope of service on a lead */
.scope-summary { margin-top: 6px; font-size: 13px; }
.scope-summary summary { cursor: pointer; color: var(--teal); font-weight: 600; }
.scope-summary ul { margin: 4px 0 8px 18px; padding: 0; }
.scope-summary li { margin: 2px 0; }
.scope-summary .eyebrow { margin-top: 8px; }

/* ==========================================================================
   Design layer, Nov 2026. One colour per step, used everywhere; red and amber
   only for urgency; dark ink for the main action. Everything above still applies.
   ========================================================================== */
:root {
  --stage-enquiry: #496e9c;  --stage-enquiry-soft: #edf2fa;
  --stage-call: #7a659a;     --stage-call-soft: #f1edf7;
  --stage-proposal: #b07f2c; --stage-proposal-soft: #fbf3e4;
  --stage-onboarding: #167d7f; --stage-onboarding-soft: #e8f3f0;
  --stage-started: #3b7e5e;  --stage-started-soft: #eaf5ed;
  --stage-closed: #8a979b;   --stage-closed-soft: #eff1f1;
  --amber: #99712b;
  --primary: #17353d; --primary-hover: #0f262c;
  --board: #eef1ed;
}
.stage-enquiry { --stage: var(--stage-enquiry); --stage-soft: var(--stage-enquiry-soft); }
.stage-needs-call { --stage: var(--stage-call); --stage-soft: var(--stage-call-soft); }
.stage-proposal { --stage: var(--stage-proposal); --stage-soft: var(--stage-proposal-soft); }
.stage-awaiting-payment { --stage: var(--stage-onboarding); --stage-soft: var(--stage-onboarding-soft); }
.stage-started { --stage: var(--stage-started); --stage-soft: var(--stage-started-soft); }
.stage-closed { --stage: var(--stage-closed); --stage-soft: var(--stage-closed-soft); }

/* Main actions in dark ink, so colour is free to mean something */
.btn.primary, .btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 2px 4px rgba(15, 38, 44, .12); }
.btn.primary:hover, .btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.primary:disabled { background: #8b9a9e; border-color: #8b9a9e; }
.eyebrow, .page-eyebrow { color: var(--muted); }
.metric-card.highlight { background: var(--sidebar); border-color: var(--sidebar); }
.metric-card.highlight .metric-label, .metric-card.highlight .metric-meta { color: #9fc1bc; }
.badge.teal { color: var(--ink); background: #e8eef0; }
.state-strip .current, .stage-step.current { background: var(--primary); border-color: var(--primary); }
:focus-visible { outline-color: #7aa6c8; }
.data-table td, .metric-value, .money { font-variant-numeric: tabular-nums; }
.data-table small.inline { display: inline; }

/* Step badge, used in lists and queues */
.stage-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px 3px 7px; border-radius: 5px; background: var(--stage-soft, #eef1ef); color: var(--stage, #5d6d67); font-size: 11.5px; font-weight: 650; white-space: nowrap; }
.stage-badge::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--stage, #b8c2bf); }
.stage-text { color: var(--stage); }

/* Top bar and menu */
.top-actions { display: flex; align-items: center; gap: 12px; }
.top-date { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.nav-count.is-alert { background: #b64849; color: #fff; }
.nav-count.is-amber { background: #c2953f; color: #1d1a12; }
.sidebar-bottom .sidebar-user { border-top: 1px solid #37555c; }

/* Segmented control */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; flex-shrink: 0; }
.seg a { padding: 7px 12px; font-size: 12.5px; font-weight: 600; color: var(--muted); text-decoration: none; white-space: nowrap; }
.seg a + a { border-left: 1px solid var(--line); }
.seg a.on { background: var(--primary); color: #fff; }
.seg a:hover:not(.on) { background: #f3f6f4; text-decoration: none; }
.board-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 14px; }
.board-toolbar .filter-form { flex: 1 1 340px; width: auto; flex-wrap: nowrap; }
.board-toolbar .filter-form input[name=q] { flex: 1; min-width: 0; }
.filter-form .checkbox-row { align-items: center; }
.filter-form .checkbox-row input { margin-top: 0; }

/* Pipeline: total and value by step */
.pipeline-strip { display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: 14px; margin-bottom: 18px; }
.pipeline-total { background: var(--sidebar); color: #e2eeec; border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; }
.pipeline-total .kpi-label, .pipeline-total .kpi-meta { color: #9fc1bc; }
.pipeline-number { font-size: 32px; font-weight: 700; letter-spacing: -.8px; color: #fff; font-variant-numeric: tabular-nums; line-height: 1.2; }
.pipeline-detail { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; align-items: center; min-width: 0; }
.pipe { display: grid; gap: 10px; width: 100%; }
.pipe-bar { display: flex; gap: 2px; height: 14px; border-radius: 4px; overflow: hidden; background: var(--line-soft); }
.pipe-bar i { display: block; min-width: 4px; background: var(--stage); }
.pipe-bar.is-empty i { flex: 1; background: var(--line-soft); }
.pipe-legend { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.pipe-legend div { display: flex; flex-direction: column; gap: 1px; min-width: 0; font-size: 11.5px; color: var(--muted); }
.pipe-legend div::before { content: ""; width: 20px; height: 3px; border-radius: 2px; background: var(--stage); margin-bottom: 4px; }
.pipe-legend b { color: var(--ink); font-size: 14px; font-variant-numeric: tabular-nums; }
.kpi-label { font-size: 12.5px; color: var(--muted); }
.kpi-meta { font-size: 11.5px; color: var(--muted); }

/* Leads board */
.lead-board { gap: 12px; margin-top: 0; align-items: flex-start; }
.lead-column { flex: 1 0 250px; min-width: 240px; max-width: 360px; background: var(--board); border-radius: 9px; padding: 0 8px 8px; border-top: 3px solid var(--stage); }
.lead-column-head { display: flex; align-items: center; gap: 8px; padding: 12px 4px 4px; }
.lead-column-head h2 { margin: 0; font-size: 13.5px; font-weight: 700; color: var(--ink); }
.lead-column-head h2 span { margin-left: 6px; color: var(--muted); font-weight: 500; }
.stage-swatch { width: 10px; height: 10px; border-radius: 3px; background: var(--stage); flex-shrink: 0; }
.lead-column-value { margin-left: auto; font-size: 13px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.lead-column-sub { padding: 0 4px 8px; font-size: 11px; color: var(--muted); }
.meter { height: 4px; border-radius: 2px; background: #dce3de; margin-top: 5px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--stage); }
.lead-card { position: relative; background: #fff; border: 1px solid #e2e8e0; border-radius: 8px; padding: 10px 12px 9px; margin-bottom: 8px; display: grid; gap: 5px; box-shadow: 0 1px 2px rgba(25, 63, 47, .03); transition: box-shadow .15s, border-color .15s; }
.lead-card:hover { border-color: #c4d3cc; box-shadow: 0 6px 16px rgba(25, 63, 47, .08); }
.lead-card:focus-within { border-color: #7aa6c8; }
.lead-card.tone-red { box-shadow: inset 3px 0 0 var(--red); }
.lead-card.tone-amber { box-shadow: inset 3px 0 0 #c2953f; }
.lead-card.tone-red:hover { box-shadow: inset 3px 0 0 var(--red), 0 6px 16px rgba(25, 63, 47, .08); }
.lead-card.tone-amber:hover { box-shadow: inset 3px 0 0 #c2953f, 0 6px 16px rgba(25, 63, 47, .08); }
.lead-card-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.lead-name { font-weight: 650; color: var(--ink); font-size: 13.5px; line-height: 1.35; min-width: 0; overflow-wrap: anywhere; }
.lead-name:hover { text-decoration: none; color: var(--ink); }
.stretched::after { content: ""; position: absolute; inset: 0; border-radius: 8px; }
.lead-value { position: relative; z-index: 1; white-space: nowrap; font-weight: 700; font-size: 13px; color: var(--ink); font-variant-numeric: tabular-nums; }
.lead-value small { font-weight: 500; color: var(--muted); margin-left: 2px; font-size: 10.5px; }
.lead-value.add { cursor: pointer; list-style: none; color: var(--stage-enquiry); font-weight: 650; font-size: 12px; border: 1px dashed currentColor; border-radius: 5px; padding: 0 6px; }
.lead-value.add::-webkit-details-marker { display: none; }
.value-pop { position: relative; z-index: 2; }
.value-pop[open] form { position: absolute; right: 0; top: 24px; z-index: 5; display: flex; gap: 6px; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-raised); width: 210px; }
.value-pop input { flex: 1; min-width: 0; border: 1px solid #d5dfdb; border-radius: 6px; padding: 5px 8px; font-size: 13px; }
.lead-what { margin: 0; font-size: 12.5px; color: #55666b; line-height: 1.45; overflow-wrap: anywhere; }
.lead-alert { margin: 0; display: flex; gap: 7px; align-items: baseline; font-size: 12px; font-weight: 650; line-height: 1.4; }
.lead-alert::before { content: ""; flex: 0 0 7px; height: 7px; border-radius: 50%; background: currentColor; transform: translateY(-1px); }
.tone-red.lead-alert, .legend-tone.tone-red { color: var(--red); }
.tone-amber.lead-alert, .legend-tone.tone-amber { color: var(--amber); }
.tone-call.lead-alert, .legend-tone.tone-call { color: var(--stage-call); }
.tone-calm.lead-alert { color: var(--muted); font-weight: 500; }
.tone-calm.lead-alert::before { background: #cfd8d4; }
.lead-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11px; color: #7d8b86; }
.new-tag { color: var(--stage-enquiry); font-weight: 700; }
.avatar-mini { display: inline-grid; place-items: center; width: 21px; height: 21px; border-radius: 50%; background: #e3ebe8; color: var(--ink); font-size: 9.5px; font-weight: 700; flex-shrink: 0; }
.lead-empty { color: #8c9a94; font-size: 12.5px; padding: 6px 4px; margin: 0; }
.board-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin: 2px 0 8px; font-size: 12px; color: var(--muted); }
.legend-tone { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.legend-tone::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.legend-tone.tone-calm { color: var(--muted); }
.legend-tone.tone-calm::before { background: #cfd8d4; }

/* Lead page */
.fact-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.fact-chips > * { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px; font-size: 12.5px; color: var(--text); text-decoration: none; }
.fact-chips a:hover { border-color: #b9cdc5; text-decoration: none; }
.fact-chips .fact-value { border-color: var(--stage, var(--line)); color: var(--stage, var(--ink)); font-weight: 650; background: var(--stage-soft, #fff); }
.fact-chips .fact-value.is-empty { border-style: dashed; background: #fff; }
.lead-page .stepper li.done .step-dot { background: var(--stage-soft); border-color: var(--stage); color: var(--stage); }
.lead-page .stepper li.done .step-text strong { color: var(--ink); }
.lead-page .stepper li.current { background: var(--stage-soft); }
.lead-page .stepper li.current::after { background: var(--stage); }
.lead-page .stepper li.current .step-dot { background: var(--stage); border-color: var(--stage); }
.lead-page .stepper li.current .step-text strong { color: var(--stage); }
.lead-page .step-back { color: var(--muted); }
.lead-page .now-card { border-left: 0; border-top: 3px solid var(--stage); }
.lead-page .now-head { background: var(--stage-soft); }
.lead-page .now-head .panel-title { color: var(--stage); text-transform: uppercase; letter-spacing: .07em; font-size: 12px; }
.lead-page.stage-closed .now-card, .lead-page.stage-started .now-card { border-top-color: var(--stage); }
.doc-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 12px 0 0; font-size: 13px; }
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 220px; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 9px; box-shadow: var(--shadow-raised); display: grid; }
.menu-list a { padding: 8px 10px; border-radius: 6px; color: var(--ink); font-size: 13px; text-decoration: none; }
.menu-list a:hover { background: #f1f5f2; text-decoration: none; }
.menu-list a.danger { color: var(--red); border-top: 1px solid var(--line-soft); margin-top: 4px; border-radius: 0 0 6px 6px; }
.close-panel > summary { cursor: pointer; list-style: none; flex-wrap: wrap; gap: 4px 12px; }
.close-panel > summary::-webkit-details-marker { display: none; }
.close-panel > summary .panel-title::before { content: "▸ "; color: var(--muted); }
.close-panel[open] > summary .panel-title::before { content: "▾ "; }
.close-panel:not([open]) > summary { border-bottom: 0; }

/* Today */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpi { display: flex; flex-direction: column; gap: 2px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 15px; color: inherit; text-decoration: none; box-shadow: var(--shadow); }
.kpi:hover { border-color: #c4d3cc; text-decoration: none; }
.kpi-value { font-size: 26px; font-weight: 700; color: var(--ink); letter-spacing: -.5px; font-variant-numeric: tabular-nums; line-height: 1.25; }
.kpi-value.is-red { color: var(--red); }
.kpi-value.is-amber { color: var(--amber); }
.today-grid { margin-bottom: 22px; }
.agenda-list { display: grid; gap: 8px; }
.agenda-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 12px; border: 1px solid var(--line); border-left: 4px solid var(--stage-call); border-radius: 8px; }
.agenda-row.kind-expert-session { border-left-color: var(--stage-proposal); }
.agenda-row.kind-follow-up-call, .agenda-row.kind-meeting { border-left-color: var(--stage-enquiry); }
.agenda-row.is-past { background: #fffbf2; }
.agenda-row time { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.agenda-main { min-width: 0; }
.agenda-main small { display: block; color: var(--muted); font-size: 12px; }
.count-pill { background: #eef1ef; color: var(--ink); border-radius: 999px; padding: 1px 9px; font-size: 12.5px; font-weight: 650; }
.queue-list { display: grid; }
.queue-item { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 20px; border-bottom: 1px solid var(--line-soft); color: inherit; text-decoration: none; }
.queue-item:hover { background: #fafbf9; text-decoration: none; }
.queue-main strong { display: block; color: var(--ink); font-size: 13.5px; }
.queue-main small { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tone-dot { width: 9px; height: 9px; border-radius: 50%; background: #cfd8d4; }
.tone-dot.tone-red { background: var(--red); } .tone-dot.tone-amber { background: #c2953f; } .tone-dot.tone-new { background: var(--stage-enquiry); }
.queue-empty { padding: 18px 20px; margin: 0; }
.queue-more { padding: 11px 20px; font-size: 13px; font-weight: 600; }
.pipeline-panel { margin-bottom: 22px; }

/* Calls in the step colour for calls; expert sessions are paid work in gold */
.kind-free-consultation { background: var(--stage-call-soft); border-color: var(--stage-call); color: #5b4878; }
.kind-needs-call { background: #ebe5f4; border-color: #5f4c80; color: #4d3d69; }
.kind-expert-session { background: var(--stage-proposal-soft); border-color: var(--stage-proposal); color: #7d5a1d; }
.kind-follow-up-call, .kind-meeting { background: var(--stage-enquiry-soft); border-color: var(--stage-enquiry); color: #34557f; }
.call-card.upcoming .date-tile { border-color: var(--stage-call); background: var(--stage-call-soft); }
.cal-day-head.today strong { background: var(--primary); }

@media (max-width: 900px) {
  .pipeline-strip { grid-template-columns: 1fr; }
  .pipe-legend { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .lead-board { flex-direction: column; overflow: visible; margin-right: 0; padding-right: 0; }
  .lead-column { max-width: none; width: 100%; flex: none; }
  .board-toolbar .filter-form { flex-basis: 100%; }
  .top-date { display: none; }
  .queue-item { padding: 11px 16px; }
}
.page-heading > .actions { flex-shrink: 0; flex-wrap: nowrap; }
.cal-item { display: block; white-space: nowrap; text-overflow: ellipsis; }
.cal-item .cal-time, .cal-item .cal-name { display: inline; }
.cal-item .cal-name { margin-left: 4px; }
.cal-item .cal-kind { display: block; }
@media (max-width: 850px) { .page-heading > .actions { flex-wrap: wrap; } }

/* Future work */
:root { --stage-planned: #5d6e86; --stage-planned-soft: #edf0f4; }
.stage-planned { --stage: var(--stage-planned); --stage-soft: var(--stage-planned-soft); }
.forecast { display: grid; grid-template-columns: repeat(24, minmax(30px, 1fr)); gap: 4px; align-items: end; overflow-x: auto; padding-bottom: 2px; }
.forecast-month { display: grid; grid-template-rows: 16px 120px auto 14px; gap: 3px; text-align: center; color: var(--muted); text-decoration: none; border-radius: 6px; padding: 2px 0; }
.forecast-month:hover, .forecast-month.on { background: #f1f4f2; text-decoration: none; }
.forecast-month.on .forecast-bar i { background: var(--primary); }
.forecast-value { font-size: 10px; font-weight: 650; color: var(--ink); white-space: nowrap; overflow: visible; font-variant-numeric: tabular-nums; }
.forecast-bar { display: flex; align-items: flex-end; justify-content: center; height: 120px; border-bottom: 1px solid var(--line); }
.forecast-bar i { display: block; width: 70%; min-height: 0; border-radius: 3px 3px 0 0; background: var(--stage-planned); }
.forecast-month.empty .forecast-bar i { display: none; }
.forecast-label { font-size: 11px; line-height: 1.2; }
.forecast-label b { display: block; color: var(--ink); font-size: 10.5px; }
.forecast-count { font-size: 10.5px; font-variant-numeric: tabular-nums; }
.bulk-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 20px; border-bottom: 1px solid var(--line-soft); background: #fafbf9; }
.bulk-bar .checkbox-row { margin-right: 6px; align-items: center; }
.bulk-bar .checkbox-row input { margin-top: 0; }
@media (max-width: 760px) { .forecast { grid-template-columns: repeat(24, 34px); } }
.pipeline-future { margin-top: 8px; color: #cfe3df; font-size: 12px; font-weight: 600; }
.pipeline-future:hover { color: #fff; }
.forecast-bar i { background: linear-gradient(to top, var(--primary) 0, var(--primary) var(--live, 0%), var(--stage-planned) var(--live, 0%)); }
.live-note { color: var(--stage-enquiry); font-weight: 600; }
.kpi-meta .live-note { font-weight: 600; }

/* New-lead alerts */
.nav-count.is-new { background: #496e9c; color: #fff; }
.nav-count.is-new + .nav-count { margin-left: 4px; }
.fresh-banner { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; margin-bottom: 16px; border-radius: var(--radius); background: var(--stage-enquiry-soft); border: 1px solid #cddbef; color: var(--ink); }
.fresh-banner strong { display: block; }
.fresh-banner span { font-size: 13px; color: #45607f; }
.fresh-dot { flex: 0 0 10px; height: 10px; margin-top: 5px; border-radius: 50%; background: var(--stage-enquiry); box-shadow: 0 0 0 4px rgba(73, 110, 156, .18); }
.lead-card.is-fresh { border-color: #9db6d8; background: linear-gradient(#f5f8fd, #fff 40%); }
.fresh-tag { position: absolute; top: -8px; right: 10px; z-index: 2; background: var(--stage-enquiry); color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; }
.lead-toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: grid; gap: 8px; width: min(340px, calc(100vw - 32px)); }
.lead-toast { display: grid; gap: 2px; padding: 12px 14px; border-radius: 10px; background: var(--sidebar); color: #e2eeec; text-decoration: none; box-shadow: var(--shadow-raised); border-left: 4px solid #7ea3d4; animation: toast-in .25s ease-out; transition: opacity .5s, transform .5s; }
.lead-toast:hover { text-decoration: none; color: #fff; }
.lead-toast strong { color: #fff; font-size: 14px; }
.lead-toast span { font-size: 12px; color: #a9c4c0; }
.lead-toast.is-leaving { opacity: 0; transform: translateY(8px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.desktop-alerts { font-size: 12.5px; }
@media (prefers-reduced-motion: reduce) { .lead-toast { animation: none; transition: none; } }

/* --- Who's dealing with it, and team notes (6 Nov 2026) ------------------------------------------------ */
.owner-panel .panel-body { display: grid; gap: 12px; }
.owner-now { display: flex; align-items: center; gap: 11px; }
.owner-now strong { display: block; font-size: 15px; color: var(--ink); }
.owner-now small { color: var(--muted); font-size: 12px; }
.owner-now .badge { margin-left: auto; }
.avatar-big { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--stage, var(--teal)); color: #fff; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.owner-form { display: grid; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.owner-form .field { margin: 0; }
.owner-form .field label { font-size: 12px; font-weight: 600; }
.owner-form .field input, .owner-form .field select, .owner-form .field textarea { width: 100%; }
.owner-form .form-footer { margin: 0; }
.owner-form .form-footer .btn { width: 100%; justify-content: center; }
.owner-form.is-handover { background: #fff8eb; margin: 0 -14px; padding: 12px 14px; border-radius: 10px; }
.owner-form.is-handover .btn.primary { background: #b07f2c; border-color: #b07f2c; }
.owner-form p { margin: 0; }
.take-it .btn { width: 100%; justify-content: center; }

.who-next { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.who-next .next-action { flex: 1 1 240px; margin: 0; }
.who-chip { display: inline-flex; align-items: center; gap: 7px; padding: 3px 11px 3px 3px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 12.5px; font-weight: 650; color: var(--ink); white-space: nowrap; }
.who-chip:hover { border-color: var(--stage, var(--teal)); text-decoration: none; }
.who-chip .avatar-mini { width: 24px; height: 24px; font-size: 10px; background: var(--stage, var(--teal)); color: #fff; }
.notice.handed { background: #fff8eb; border-color: #ecd3a3; color: #7a5513; margin-bottom: 10px; font-weight: 600; }

.owner-tag { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; color: #51605b; white-space: nowrap; }
.owner-tag.is-me { color: var(--teal-dark); }
.owner-tag.is-me .avatar-mini { background: var(--teal); color: #fff; }
.lead-card.is-handed { box-shadow: 0 0 0 2px #e0a93b, var(--shadow-raised, 0 2px 6px rgba(0,0,0,.08)); }
.fresh-tag.handed-tag { background: #b07f2c; }
.who-filter select { height: 34px; border-radius: 9px; font-size: 13px; padding: 0 10px; }
.nav-count.is-handed { background: #e0a93b; color: #2b1f05; }
.lead-toast.is-handed { border-left-color: #e0a93b; }

.notes-panel .panel-subtitle { font-size: 12px; }
.note-form { display: grid; gap: 8px; margin-bottom: 14px; }
.note-form textarea { width: 100%; resize: vertical; min-height: 64px; }
.note-form .btn { justify-self: end; }
.note-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; max-height: 560px; overflow-y: auto; }
.note { display: flex; gap: 9px; align-items: flex-start; }
.note .avatar-mini { margin-top: 1px; }
.note-main { flex: 1; min-width: 0; }
.note-meta { font-size: 11.5px; color: var(--muted); }
.note-meta strong { color: var(--ink); }
.note-body { font-size: 13.5px; line-height: 1.5; margin-top: 2px; overflow-wrap: anywhere; }
.note.is-pinned .note-main { background: #fff8eb; border-radius: 8px; padding: 6px 9px; }
.note.is-handover .note-body { color: #3d5a55; }
.note-tools { display: flex; gap: 12px; margin-top: 3px; }
.note-tools .link-button { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.note-tools .link-button:hover { color: var(--teal-dark); }
.note-tools .link-button.danger:hover { color: #b3402f; }

.my-leads .queue-item.is-handed { background: #fff8eb; }
.queue-date { font-size: 12px; font-weight: 600; color: #51605b; white-space: nowrap; }
.queue-date.is-late { color: #b3402f; }
.nav-count + .nav-count { margin-left: 4px; }

/* --- Case lead and handover -------------------------------------------------------------------------- */
.handover-banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin: 0 0 16px; border-radius: 12px; background: #fff8eb; border: 1px solid #ecd3a3; }
.handover-banner > div { flex: 1; min-width: 0; }
.handover-banner strong { display: block; color: #6b4a10; }
.handover-banner small { color: #7a6a4c; font-size: 12.5px; }
.handover-banner .avatar-mini { width: 32px; height: 32px; font-size: 11.5px; background: #e0a93b; color: #2b1f05; }
.handover-banner.is-me { background: #fdf0d5; border-color: #e0a93b; }
.handover-banner.is-returned { background: var(--teal-soft); border-color: #b9dcd3; }
.handover-banner.is-returned strong { color: var(--teal-dark); }
.handover-banner.is-returned .avatar-mini { background: var(--teal); color: #fff; }
.handover-panel .avatar-big { background: var(--teal); }
.avatar-big.is-holder { background: #e0a93b; color: #2b1f05; }
.handover-now { display: grid; gap: 8px; padding: 12px; border-radius: 10px; background: #fff8eb; border: 1px solid #ecd3a3; }
.handover-now .owner-form { border-top-color: #ecd3a3; }
.handover-ask { margin: 0; font-weight: 600; color: var(--ink); }
.handover-start > summary { list-style: none; width: 100%; justify-content: center; }
.handover-start > summary::-webkit-details-marker { display: none; }
.handover-start[open] > summary { display: none; }
.handover-start .owner-form { margin: 0; }
.handover-history summary { font-size: 12.5px; color: var(--muted); cursor: pointer; }
@media (max-width: 640px) { .handover-banner { flex-wrap: wrap; } }

/* Blog editor */
.blog-toolbar{display:flex;flex-wrap:wrap;gap:6px;margin:6px 0 8px}
#blog-content{font-size:1rem;line-height:1.6;width:100%}
.blog-preview{border:1px solid var(--line,#d9e0e0);border-radius:12px;padding:20px 24px;background:#fff;max-width:760px;line-height:1.7}
.blog-preview h2{font-size:1.35rem;margin:1.6em 0 .5em}.blog-preview h3{font-size:1.1rem;margin:1.2em 0 .4em}
.blog-preview blockquote{border-left:4px solid #6ba3a3;margin:1em 0;padding:.5em 1em;font-style:italic;background:#f4f8f8}
.blog-preview ul{padding-left:1.2em}

/* STL Accounting and Finance brand (team.stlaccounting.co.uk) */
body.brand-accounting{--sidebar:#0b3d38;--sidebar-deep:#082e2a;--teal:#00897b;--teal-dark:#02514c;--teal-soft:#e0f2ef;--canvas:#f5f8f7}

/* Waiting for the client to decide */
.waiting-box { margin: 4px 0 14px; padding: 13px 16px; border: 1px solid var(--line, #dfe5e2); border-left: 4px solid #9aa9a4; border-radius: 7px; background: #f6f8f7; }
.waiting-box p { margin: 0 0 10px; }
.waiting-box.is-due { border-left-color: var(--amber, #99712b); background: var(--amber-soft); }
.waiting-box .section-divider { margin-top: 10px; }
.wait-form { display: grid; gap: 10px; margin-top: 10px; }
.wait-form .actions { align-items: center; }
.queue-item.is-new strong .new-tag { margin-right: 4px; }
.nav-item { flex-wrap: wrap; row-gap: 5px; }
.nav-count { white-space: nowrap; }
.nav-count + .nav-count { margin-left: 0; }
.wait-details { margin: 6px 0 12px; }
.now-card .actions + .text-small { margin-top: 10px; }

/* Case steps: the numbered strip, the "this step" card and key dates (12 Nov 2026) */
.case-stepper{grid-template-columns:repeat(7,minmax(0,1fr))}
.case-stepper li{padding:13px 12px;gap:9px}.case-stepper .step-text strong{font-size:12.5px;line-height:1.3}
.case-stepper.is-complete li.done:last-child .step-dot{background:var(--green);border-color:var(--green);color:#fff}
@media(max-width:1300px){.case-stepper{display:flex;overflow-x:auto}.case-stepper li{flex:0 0 150px}}
.step-card{border-left:4px solid var(--teal)}.step-card.is-late{border-left-color:var(--red)}
.step-card .step-head{display:flex;justify-content:space-between;gap:16px;align-items:flex-start;padding:20px 22px 0}
.step-card .step-head h2{margin:0;font-size:21px;color:var(--ink);line-height:1.25}.step-card .step-head .eyebrow{margin-bottom:4px}
.step-due{text-align:right;flex:0 0 auto;padding:8px 12px;border-radius:8px;background:var(--teal-soft);color:var(--teal-dark);max-width:240px}
.step-due strong{display:block;font-size:14px}.step-due small{display:block;font-size:11.5px;color:var(--muted);line-height:1.35;margin-top:2px}
.step-due.is-today{background:var(--amber-soft);color:#86652b}.step-due.is-late{background:var(--red-soft);color:var(--red)}.step-due.is-done{background:var(--green-soft);color:var(--green);font-weight:600}
.step-card .step-why{margin:12px 22px 4px;font-size:14px;color:var(--text);max-width:760px}
.step-card>.section-title,.step-card>.step-brief,.step-card>.step-client,.step-card>.step-list,.step-card>.step-finish,.step-card>details{margin-left:22px;margin-right:22px}
.step-card .section-title{margin-top:20px;margin-bottom:8px}
.step-brief,.step-client{border:1px solid var(--line-soft);background:#fbfcfa;border-radius:8px;padding:4px 14px 12px;margin-top:14px}
.step-client{padding:12px 14px}.step-client p{margin:0 0 6px}.step-client p:last-of-type{margin-bottom:10px}
.step-brief .section-title{display:flex;justify-content:space-between;gap:10px;margin-top:10px}
.record-fields.compact{grid-template-columns:120px minmax(0,1fr);gap:6px 14px;font-size:13px}.record-fields.compact dd{white-space:normal}
.step-list{gap:0;margin-bottom:0}.step-list li{align-items:center;padding:10px 0;gap:12px}.step-list li:last-child{border-bottom:0}
.step-list .tick{flex:0 0 22px;height:22px;border-radius:6px;border:1.5px solid #cfdad6;display:inline-flex;align-items:center;justify-content:center;font-size:12px;font-weight:700;background:#fff}
.step-list li.is-done .tick{background:var(--green);border-color:var(--green);color:#fff}
.step-list .step-item{flex:1;min-width:0}.step-list li.is-done .step-item s{color:var(--muted)}
.step-finish{margin-top:6px;padding:16px 0 4px;border-top:1px solid var(--line)}
.step-finish .btn.primary{white-space:normal;text-align:left}
.step-gate{margin:0 0 12px;color:#86652b;background:var(--amber-soft);border-radius:7px;padding:9px 12px;font-size:13.5px}
.step-ready{margin:0 0 12px;color:var(--green);font-weight:600}
.step-next{margin:14px 0 0;font-size:13px;color:var(--muted);max-width:720px}.step-next strong{color:var(--ink)}
.step-finish .check-list{margin:8px 0 14px}.step-finish .readiness-form{margin-top:0;margin-bottom:10px}
.lodge-form .field{margin:4px 0 12px;max-width:520px}
.step-aside{margin-top:12px;font-size:13px}.step-aside summary{cursor:pointer;color:var(--teal-dark)}.step-aside form{margin-top:10px;max-width:520px}.step-aside .field{margin-bottom:10px}
.step-all{margin-top:16px;margin-bottom:20px;padding-top:12px;border-top:1px solid var(--line-soft);font-size:13px}.step-all summary{cursor:pointer;color:var(--muted)}
.step-overview{padding-left:0;list-style:none;margin:10px 0 0}.step-overview>li{padding:8px 0;border-bottom:1px solid var(--line-soft)}.step-overview>li:last-child{border:0}
.step-overview ul{margin:4px 0 0;padding-left:18px;color:var(--muted)}.step-overview>li.is-current{color:var(--ink)}.step-overview>li.is-current ul{color:var(--text)}
.next-action-line{margin:0 0 6px;font-size:15px;color:var(--ink)}
.scope-details{margin-top:16px;font-size:13px}.scope-details summary{cursor:pointer;color:var(--teal-dark)}.scope-text{margin-top:10px;padding:12px 14px;background:#fbfcfa;border:1px solid var(--line-soft);border-radius:8px;max-height:420px;overflow:auto}
.later-docs{border-top:1px solid var(--line);padding:12px 20px}.later-docs summary{cursor:pointer;color:var(--teal-dark);font-size:13px}.later-docs .table-wrap{margin-top:10px}
.date-list{list-style:none;margin:0;padding:0}.date-list li{display:flex;gap:12px;padding:9px 0;border-bottom:1px solid var(--line-soft);align-items:flex-start}.date-list li:last-child{border:0}
.date-when{flex:0 0 74px;font-weight:650;color:var(--ink);font-size:13px}.date-what{min-width:0;font-size:13px}.date-what strong{display:block;font-weight:600;color:var(--ink)}.date-what small{display:block;color:var(--muted);font-size:12px}
.date-list li.is-late .date-when,.date-list li.is-late .date-what small{color:var(--red)}.date-list li.is-today .date-when{color:#86652b}.date-list li.is-past{opacity:.7}
.date-list li.is-external .date-when::after{content:"External";display:block;font-size:10px;letter-spacing:.6px;text-transform:uppercase;color:var(--purple);font-weight:700}
.ext-key{font-size:10px;letter-spacing:.6px;text-transform:uppercase;color:var(--purple);font-weight:700}
@media(max-width:760px){.step-card .step-head{flex-direction:column;padding:16px 16px 0}.step-due{text-align:left;max-width:none}.step-card .step-why{margin:12px 16px 4px}
.step-card>.section-title,.step-card>.step-brief,.step-card>.step-client,.step-card>.step-list,.step-card>.step-finish,.step-card>details{margin-left:16px;margin-right:16px}}
.step-alert{margin:12px 22px 0;padding:11px 14px;border-radius:8px;background:var(--amber-soft);color:#6f5422;font-size:13.5px;border:1px solid #ecdcb9}
.step-alert.is-urgent{background:var(--red-soft);color:#8d383c;border-color:#ebc8c5}.step-alert strong{display:block;margin-bottom:2px}
@media(max-width:760px){.step-alert{margin:12px 16px 0}}
.step-alert.page-alert{margin:0 0 18px}

/* Guides */
.guide-body h2.guide-step{margin:28px 0 8px;font-size:1.15rem}
.guide-body p,.guide-body li{line-height:1.6}
.guide-body ul{padding-left:20px}
.guide-body blockquote.guide-note{margin:14px 0;padding:12px 16px;border-left:4px solid var(--teal,#0f7f6e);background:#eef6f4;border-radius:8px}

/* Accounting mailbox: three panes */
.mail-app{display:grid;grid-template-columns:200px 340px minmax(0,1fr);height:calc(100vh - 118px);min-height:540px;background:var(--paper);border:1px solid var(--line);border-radius:14px;overflow:hidden;box-shadow:var(--shadow)}
.mail-rail{padding:14px 10px;border-right:1px solid var(--line);background:#fbfcfb;display:flex;flex-direction:column;gap:2px;overflow:auto}
.mail-compose{display:flex;align-items:center;justify-content:center;gap:8px;background:var(--teal);color:#fff!important;border-radius:999px;padding:11px 14px;font-weight:600;text-decoration:none;margin-bottom:12px;box-shadow:0 4px 12px rgba(22,125,127,.25)}.mail-compose:hover{background:var(--teal-dark)}
.mail-rail>a:not(.mail-compose){display:flex;align-items:center;gap:10px;padding:9px 12px;border-radius:9px;color:var(--text);text-decoration:none;font-size:14px}.mail-rail>a:not(.mail-compose):hover{background:var(--line-soft)}.mail-rail>a.on{background:var(--teal-soft);color:var(--teal-dark);font-weight:600}
.mail-rail .ico{width:16px;text-align:center;opacity:.75;font-size:13px}.mail-rail b{margin-left:auto;background:var(--teal);color:#fff;border-radius:999px;font-size:11px;padding:1px 7px}
.mail-refresh{margin-top:auto;padding-top:12px}.mail-refresh button{width:100%;background:none;border:1px solid var(--line);border-radius:9px;padding:8px;color:var(--muted);cursor:pointer;font-size:13px}.mail-refresh button:hover{background:var(--line-soft)}.mail-addr{font-size:11px;color:var(--muted);text-align:center;margin:8px 0 0}
.mail-list-pane{border-right:1px solid var(--line);display:flex;flex-direction:column;min-height:0}
.mail-search{padding:12px;border-bottom:1px solid var(--line-soft)}.mail-search input{width:100%;border:1px solid var(--line);background:#f4f6f4;border-radius:999px;padding:9px 14px;font-size:14px}
.mail-threads{list-style:none;margin:0;padding:0;overflow:auto;flex:1}
.mail-threads li{border-bottom:1px solid var(--line-soft)}.mail-threads li a{display:flex;gap:11px;padding:13px 14px;text-decoration:none;color:var(--text)}.mail-threads li:hover{background:#f8faf8}.mail-threads li.selected{background:var(--teal-soft)}
.mail-threads li.unread{box-shadow:inset 3px 0 0 var(--teal)}.mail-threads li.unread .t-from,.mail-threads li.unread .t-subject{font-weight:700;color:var(--ink)}
.av{flex:none;width:38px;height:38px;border-radius:50%;display:grid;place-items:center;font-size:13px;font-weight:700;color:hsl(var(--h,180) 45% 28%);background:hsl(var(--h,180) 50% 88%)}
.t-body{min-width:0;display:flex;flex-direction:column;gap:2px;flex:1}.t-top{display:flex;justify-content:space-between;gap:8px}.t-from{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:14px}.t-from i{font-style:normal;color:var(--muted);font-size:12px;font-weight:400}.t-top time{flex:none;color:var(--muted);font-size:12px}
.t-subject{font-size:13.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.t-snippet{font-size:12.5px;color:var(--muted);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.t-chips{display:flex;gap:5px;margin-top:3px}.chip{font-style:normal;font-size:11px;padding:2px 8px;border-radius:999px;background:var(--blue-soft);color:var(--blue)}.chip.mine{background:var(--green-soft);color:var(--green)}
.mail-none{display:flex;flex-direction:column;gap:4px;padding:30px 20px;color:var(--muted);text-align:center}
.mail-read-pane{display:flex;flex-direction:column;min-width:0;min-height:0;overflow:auto;background:#fff}
.mail-thread-head{display:flex;align-items:flex-start;gap:12px;padding:18px 24px 8px}.mail-thread-head h1{font-size:20px;margin:0;flex:1;line-height:1.3}.mail-back{display:none}.mail-tools{display:flex;gap:6px}
.mini{display:inline-block;background:#fff;border:1px solid var(--line);border-radius:8px;padding:5px 11px;font-size:12.5px;color:var(--text);cursor:pointer;text-decoration:none}.mini:hover{background:var(--line-soft)}
.mail-handle{display:flex;flex-wrap:wrap;gap:12px;align-items:center;padding:6px 24px 14px;border-bottom:1px solid var(--line-soft)}.mail-handle form{display:flex;align-items:center;gap:6px}.mail-handle label{font-size:12px;color:var(--muted)}.mail-handle select{border:1px solid var(--line);border-radius:8px;padding:5px 8px;font-size:13px;max-width:210px;background:#fff}
.mail-messages{padding:8px 24px;display:flex;flex-direction:column;gap:10px;flex:1}
.msg{border:1px solid var(--line);border-radius:12px;background:#fff}.msg.out{background:#f4faf8;border-color:#cfe5df}
.msg summary{list-style:none;display:flex;align-items:center;gap:12px;padding:12px 14px;cursor:pointer}.msg summary::-webkit-details-marker{display:none}.msg-who{display:flex;flex-direction:column;min-width:0;flex:1}.msg-who small{color:var(--muted);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.msg summary time{color:var(--muted);font-size:12px;flex:none}
.msg-body{padding:0 14px 16px 64px}.mail-text{white-space:pre-wrap;word-break:break-word;line-height:1.6;font-size:14.5px;color:var(--text)}.mail-text a{color:var(--teal-dark)}
.mail-quote{margin-top:10px}.mail-quote summary{display:inline-block;padding:2px 10px;border-radius:999px;background:var(--line-soft);color:var(--muted);font-size:12px;cursor:pointer}.mail-quote div{margin-top:8px;padding-left:12px;border-left:3px solid var(--line);color:var(--muted);font-size:13px;white-space:pre-wrap}
.msg-files{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}.file-chip{border:1px solid var(--line);border-radius:9px;padding:6px 11px;font-size:13px;text-decoration:none;color:var(--text);background:#fff}.file-chip small{color:var(--muted)}.file-chip.off{opacity:.6}
.composer{margin:6px 24px 22px;border:1px solid var(--line);border-radius:12px;background:#fff;box-shadow:var(--shadow)}.reply-bar{list-style:none;padding:14px 16px;cursor:text;color:var(--muted)}.reply-bar::-webkit-details-marker{display:none}.composer[open] .reply-bar{border-bottom:1px solid var(--line-soft);color:var(--ink);font-weight:600}
.composer form{padding:6px 16px 14px}.c-row{display:flex;align-items:center;gap:10px;border-bottom:1px solid var(--line-soft);padding:5px 0}.c-row label{width:56px;font-size:12.5px;color:var(--muted)}.c-row input,.c-row select{flex:1;border:0;background:transparent;padding:6px 0;font-size:14px;outline:none;min-width:0}
.composer textarea{width:100%;border:0;outline:none;resize:vertical;min-height:170px;padding:12px 0;font:inherit;line-height:1.55}.c-foot{display:flex;justify-content:space-between;align-items:center;margin-top:6px}.attach{cursor:pointer;color:var(--muted);font-size:13px}.attach input{display:none}
.mail-empty{margin:auto;text-align:center;color:var(--muted);padding:40px}.mail-empty .big{font-size:48px;opacity:.25}.mail-empty h2{color:var(--ink);margin:8px 0 4px}
@media(max-width:1100px){.mail-app{grid-template-columns:64px 300px minmax(0,1fr)}.mail-rail>a:not(.mail-compose){font-size:0;justify-content:center;padding:11px 0}.mail-rail .ico{font-size:15px}.mail-rail b{display:none}.mail-compose{font-size:0}.mail-compose span{font-size:18px}.mail-refresh,.mail-addr{display:none}}
@media(max-width:760px){.mail-app{display:block;height:auto;min-height:0}.mail-rail{flex-direction:row;overflow-x:auto;border-right:0;border-bottom:1px solid var(--line);padding:8px}.mail-rail>a:not(.mail-compose){font-size:13px;flex:none;padding:8px 12px}.mail-compose{flex:none;margin:0 6px 0 0;font-size:13px;padding:8px 14px}.mail-refresh,.mail-addr{display:none}.mail-list-pane{border-right:0}.mail-app.has-thread .mail-list-pane,.mail-app.has-thread .mail-rail{display:none}.mail-app:not(.has-thread) .mail-read-pane{display:none}.mail-back{display:inline-block;padding-top:4px}.mail-thread-head{flex-wrap:wrap}.msg-body{padding-left:14px}}
.mail-new{max-width:820px}

/* Levy reader feedback */
.levy-feedback{border-left:4px solid var(--line)}.levy-feedback.is-bad{border-left-color:var(--red)}.levy-feedback.is-part{border-left-color:var(--gold)}
.lf-advice{font-size:15px;line-height:1.6;margin:0 0 12px;max-width:78ch}.lf-h{font-size:14px;margin:14px 0 8px}.lf-q{display:flex;flex-direction:column;gap:6px;padding:12px 0;border-top:1px solid var(--line-soft)}
.lf-opts{display:flex;flex-wrap:wrap;gap:8px 16px}.lf-opts label{font-size:14px;display:flex;gap:6px;align-items:center}.lf-q input[type=text]{max-width:420px;border:1px solid var(--line);border-radius:8px;padding:7px 10px}.lf-done{margin:4px 0}

/* What we still need (case page) */
.step-needs{margin:14px 22px 0;padding:10px 14px;border-radius:8px;background:var(--amber-soft);border:1px solid #ecdcb9;font-size:13.5px}.step-needs a{font-weight:600}
.needs-panel .needs-q{margin:0 20px 6px;padding:14px 0 6px;border-bottom:1px solid var(--line-soft)}
.needs-q-head{display:flex;justify-content:space-between;gap:14px;align-items:flex-start;flex-wrap:wrap}.needs-q-head small{display:block;margin-top:4px;color:var(--muted);font-size:13px;max-width:620px}
.needs-q-head .actions{display:flex;gap:6px;flex-wrap:wrap}
.needs-route{list-style:none;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:14px 0 8px;padding:0}
.needs-route li{display:flex;gap:8px;align-items:flex-start;padding:9px 10px;border-radius:8px;background:#f6f8f6;font-size:12.5px;line-height:1.35;color:var(--muted)}
.needs-route li strong{display:block;font-weight:600;color:var(--text)}.needs-route li small{display:block;margin-top:2px;font-size:11.5px}
.needs-route .dot{flex:none;width:20px;height:20px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;background:#e3e8e4;font-size:11px;font-weight:700;color:var(--muted)}
.needs-route li.is-done .dot{background:var(--green-soft);color:#357553}.needs-route li.is-done strong{color:var(--muted);font-weight:500}
.needs-route li.is-now{background:var(--teal-soft);box-shadow:inset 0 0 0 1px var(--teal)}.needs-route li.is-now .dot{background:var(--teal);color:#fff}
.needs-group{padding:12px 20px 4px}.needs-group h3{display:flex;align-items:center;gap:8px;margin:4px 0 2px;font-size:15px}.needs-group>p{margin:0 0 8px}
.needs-list{list-style:none;margin:0 0 8px;padding:0}.needs-list li{display:flex;justify-content:space-between;gap:12px;align-items:center;padding:9px 0;border-bottom:1px solid var(--line-soft)}
.needs-list li:last-child{border-bottom:0}.needs-list li>span:first-child{min-width:0}.needs-list small{display:block;color:var(--muted);font-size:12.5px;margin-top:2px}
.needs-list .actions{display:flex;gap:6px;flex:none}
.needs-later{border-top:1px solid var(--line);padding:12px 20px}.needs-later summary{cursor:pointer;color:var(--teal-dark);font-size:13px}.needs-later .needs-list{margin-top:8px}
.needs-done{margin:14px 20px}
.step-buttons{display:inline-flex;gap:6px;flex:none;align-items:center}
@media (max-width:760px){.needs-route{grid-template-columns:1fr 1fr}.needs-panel .needs-q{margin:0 16px 6px}.needs-group{padding:12px 16px 4px}.step-needs{margin:14px 16px 0}.needs-list li{flex-wrap:wrap}}
.btn.quiet{background:transparent;border-color:transparent;color:var(--muted)}.btn.quiet:hover{color:var(--ink);border-color:var(--line)}
.step-unsent{display:flex;flex-wrap:wrap;gap:8px 12px;align-items:center}.step-unsent strong{display:inline;margin:0}
/* Solutions mailbox (contact@ and each person's own), laid out like Gmail: folders on the left, a full-width list,
   and a conversation that opens in the list's place. Everything is under .gm so the accounting mailbox (.mail-app) is unchanged. */
.gm{--g-bg:#f6f8fc;--g-ink:#1f1f1f;--g-text:#444746;--g-muted:#5f6368;--g-line:#e3e3e3;--g-hover:rgba(68,71,70,.08);--g-active:#d3e3fd;--g-active-ink:#041e49;--g-blue:#0b57d0;--g-blue-dark:#0842a0;--g-search:#e9eef6;--g-read:#f2f6fc;--g-raise:0 1px 2px 0 rgba(60,64,67,.3),0 1px 3px 1px rgba(60,64,67,.15);--g-pop:0 1px 2px 0 rgba(60,64,67,.3),0 2px 6px 2px rgba(60,64,67,.15)}
.gm{display:grid;grid-template-columns:236px minmax(0,1fr);gap:0 8px;height:calc(100vh - 118px);min-height:540px;padding:8px 12px 12px 0;background:var(--g-bg);border-radius:16px;color:var(--g-text);font-family:"Google Sans",Roboto,var(--font);font-size:14px}
.gi{width:20px;height:20px;fill:currentColor;flex:none}
.gm .c-teal,.gm .c-blue,.gm .c-amber,.gm .c-green,.gm .c-red,.gm .c-purple,.gm .c-grey{color:var(--c)}
.gm .chip.lbl{color:var(--c)}
/* Folders */
.gm-rail{display:flex;flex-direction:column;min-height:0;overflow:auto;padding:8px 0}
.gm-boxes{display:flex;gap:4px;margin:0 8px 16px 12px;padding:4px;background:#fff;border-radius:16px;box-shadow:var(--g-raise)}
.gm-boxes a{flex:1;display:flex;align-items:center;justify-content:center;gap:6px;height:44px;border-radius:12px;color:var(--g-text);font-weight:600;text-decoration:none;white-space:nowrap}
.gm-boxes a:hover{background:var(--g-hover)}.gm-boxes a.on{background:#c2e7ff;color:#001d35}.gm-boxes b{font-size:12px}
.gm-folder{position:relative;display:flex;align-items:center;gap:18px;height:32px;margin-right:8px;padding:0 12px 0 24px;border-radius:0 16px 16px 0;color:var(--g-ink);text-decoration:none;flex:none}
.gm-folder:hover{background:var(--g-hover)}.gm-folder.on{background:var(--g-active);color:var(--g-active-ink);font-weight:700}
.gm-folder span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.gm-folder b{font-size:12px;font-weight:700}.gm-folder b.quiet{font-weight:500;color:var(--g-muted)}.gm-folder b.due{color:#b06000}
.gm-rail-head{margin:18px 0 6px 24px;font-size:16px;font-weight:500;color:var(--g-ink)}
.gm-addr{margin:auto 12px 0 24px;padding-top:18px;font-size:12px;line-height:1.5;color:var(--g-muted);word-break:break-all}
/* Search and the white panel */
.gm-main{display:flex;flex-direction:column;gap:8px;min-width:0;min-height:0}
.gm-search{display:flex;align-items:center;gap:4px;max-width:720px;height:48px;padding:0 12px 0 4px;background:var(--g-search);border-radius:24px}
.gm-search:focus-within{background:#fff;box-shadow:var(--g-raise)}
.gm-search input{flex:1;min-width:0;height:100%;border:0;background:transparent;outline:none;color:var(--g-ink);font:inherit;font-size:16px}
.gm-panel{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden;background:#fff;border-radius:16px}
.gm-bar{display:flex;align-items:center;gap:2px;min-height:48px;padding:4px 12px 4px 16px;flex:none}
.gm-bar form{margin:0;display:contents}
.gm-icon{display:inline-grid;place-items:center;width:40px;height:40px;flex:none;border:0;border-radius:50%;background:none;color:var(--g-text);cursor:pointer;list-style:none;text-decoration:none}
.gm-icon::-webkit-details-marker{display:none}.gm-icon:hover{background:var(--g-hover);color:var(--g-ink)}.gm-icon.off{opacity:.38;cursor:default}.gm-icon.off:hover{background:none}
.gm-right{margin-left:auto}
.gm-sep{width:1px;height:20px;margin:0 8px;background:var(--g-line)}
.gm-checked{margin-left:6px;font-size:12px;color:var(--g-muted)}
.gm-filter{margin-left:14px;font-size:13px;color:var(--g-muted)}.gm-filter a{margin-left:4px;color:var(--g-blue)}
.gm-pages{display:flex;align-items:center;gap:2px;font-size:12px;color:var(--g-muted);white-space:nowrap}.gm-pages .gm-icon{width:32px;height:32px}
/* The list */
.gm-list{flex:1;min-height:0;overflow:auto;list-style:none;margin:0;padding:0;border-top:1px solid var(--g-line)}
.gm-row{background:var(--g-read);box-shadow:inset 0 -1px 0 0 rgba(100,121,143,.12)}
.gm-row.unread{background:#fff}
.gm-row:hover{position:relative;z-index:1;box-shadow:inset 1px 0 0 #dadce0,inset -1px 0 0 #dadce0,var(--g-raise)}
.gm-row a{display:grid;grid-template-columns:200px minmax(0,1fr) auto;align-items:center;gap:0 16px;height:40px;padding:0 16px 0 24px;color:var(--g-text);text-decoration:none}
.gm-from{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--g-ink)}
.gm-from i{margin-left:6px;font-style:normal;font-size:12px;font-weight:400;color:var(--g-muted)}
.gm-line{display:flex;align-items:center;gap:6px;min-width:0;overflow:hidden;white-space:nowrap}
.gm-subj{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;color:var(--g-ink)}
.gm-snip{flex:1 1 0;min-width:0;overflow:hidden;text-overflow:ellipsis;color:var(--g-muted)}
.gm-row time{font-size:12px;color:var(--g-text);white-space:nowrap}
.gm-row.unread .gm-from,.gm-row.unread .gm-subj,.gm-row.unread time{font-weight:700;color:var(--g-ink)}
.gm .chip{flex:none;display:inline-flex;align-items:center;font-style:normal;font-size:12px;line-height:18px;padding:0 6px;border-radius:4px;background:#e8eaed;color:#3c4043;text-decoration:none;white-space:nowrap}
.gm .chip.lbl{background:var(--cs)}.gm .chip.due{background:#fce8b2;color:#7a4b00;font-weight:500}.gm .chip.file{background:#e6f4ea;color:#137333}.gm .chip.mine{background:#e8f0fe;color:#174ea6}.gm .chip.case{background:#e8eaed;color:#3c4043}
.gm-none{display:flex;flex-direction:column;gap:4px;padding:48px 20px;text-align:center;color:var(--g-muted)}.gm-none strong{color:var(--g-ink);font-size:16px;font-weight:500}
.gm-foot{flex:none;margin:0;padding:10px 24px;border-top:1px solid var(--g-line);font-size:12px;color:var(--g-muted)}
/* Menus (remind, labels) */
.gm-menu{position:relative}
.gm-pop{position:absolute;top:44px;left:0;z-index:30;width:300px;max-width:calc(100vw - 32px);padding:8px 0;background:#fff;border-radius:8px;box-shadow:var(--g-pop);cursor:default}
.gm-pop form{display:block;margin:0}
.gm-pop-head{margin:4px 16px 6px;font-size:14px;font-weight:500;color:var(--g-ink)}
.gm-mi{display:flex;align-items:center;gap:10px;width:100%;height:36px;padding:0 16px;border:0;background:none;color:var(--g-ink);font:inherit;font-size:14px;text-align:left;cursor:pointer}
.gm-mi:hover{background:var(--g-hover)}.gm-mi small{margin-left:auto;color:var(--g-muted);font-size:12px}
.gm-check{width:16px;text-align:center;color:var(--g-blue);font-weight:700}
.gm-pop-custom{display:flex;flex-direction:column;gap:6px;margin-top:6px;padding:10px 16px 4px;border-top:1px solid var(--g-line)}
.gm-pop-sub{margin:0;font-size:12px;font-weight:500;color:var(--g-muted)}
.gm-pop-row{display:flex;gap:6px}.gm-pop-row input{flex:1;min-width:0}
.gm-pop input{border:1px solid #c4c7c5;border-radius:4px;padding:6px 8px;font:inherit;font-size:13px}
.gm-pop-custom .gm-btn{align-self:flex-start}
.gm-pop-note{margin:8px 16px 4px;font-size:12px;line-height:1.45;color:var(--g-muted)}
.gm-btn{display:inline-flex;align-items:center;gap:6px;height:36px;padding:0 20px;border:1px solid #747775;border-radius:18px;background:#fff;color:var(--g-blue);font:inherit;font-size:14px;font-weight:500;cursor:pointer;white-space:nowrap}
.gm-btn:hover{background:#f0f4f9}.gm-btn.primary{border-color:var(--g-blue);background:var(--g-blue);color:#fff}.gm-btn.primary:hover{background:var(--g-blue-dark);box-shadow:var(--g-raise)}
/* A conversation */
.gm-read{flex:1;min-height:0;overflow:auto;padding-bottom:24px;border-top:1px solid var(--g-line)}
.gm-subject{display:flex;flex-wrap:wrap;align-items:center;gap:6px 8px;padding:20px 24px 6px 72px}
.gm-subject h1{margin:0 6px 0 0;font-size:22px;font-weight:400;line-height:1.35;color:var(--g-ink)}
.gm-subject .chip{padding:1px 6px;font-size:12px}.gm-subject a.chip:hover{background:#dadce0}
.gm-subject .chip.remind{background:#e8eaed;color:#3c4043}.gm-subject .chip.remind.due{background:#fce8b2;color:#7a4b00}
.mbx-chipform{display:inline;margin:0}.mbx-chipform button{background:none;border:0;color:inherit;opacity:.6;cursor:pointer;padding:0 0 0 4px;font-size:14px;line-height:1}.mbx-chipform button:hover{opacity:1}
.gm-state{margin:4px 24px 0 72px;font-size:13px;color:var(--g-muted)}
.gm-handle{display:flex;flex-wrap:wrap;align-items:center;gap:8px 18px;padding:8px 24px 14px 72px;font-size:13px;color:var(--g-muted)}
.gm-handle form{display:flex;align-items:center;gap:8px;margin:0}
.gm-handle select{max-width:240px;height:32px;padding:0 10px;border:1px solid #c4c7c5;border-radius:8px;background:#fff;color:var(--g-ink);font:inherit;font-size:13px}
.gm-handle a{color:var(--g-blue);text-decoration:none}.gm-handle a:hover{text-decoration:underline}
.gm-msg{border-top:1px solid var(--g-line)}
.gm-msg summary{display:grid;grid-template-columns:40px minmax(0,1fr) auto;align-items:start;gap:0 16px;padding:16px 24px 0 16px;list-style:none;cursor:pointer}
.gm-msg summary::-webkit-details-marker{display:none}
.gm-msg .av{width:40px;height:40px;font-size:15px;font-weight:500;color:#fff;background:hsl(var(--h,200) 45% 42%)}
.gm-who{display:flex;flex-direction:column;min-width:0;padding-top:2px}
.gm-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.gm-name strong{color:var(--g-ink);font-weight:700}
.gm-email{font-size:12px;color:var(--g-muted)}
.gm-to{font-size:12px;color:var(--g-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.gm-peek{display:none;color:var(--g-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.gm-msg time{padding-top:2px;font-size:12px;color:var(--g-muted);white-space:nowrap}
.gm-msg details:not([open]) summary{padding-bottom:14px}.gm-msg details:not([open]) .gm-peek{display:block}.gm-msg details:not([open]) .gm-to,.gm-msg details:not([open]) .gm-email,.gm-msg details:not([open]) .gm-ago{display:none}
.gm-body{padding:12px 24px 20px 72px}
.gm .mail-text{font-size:14px;line-height:1.6;color:#222}.gm .mail-text a{color:var(--g-blue)}
.gm .mail-quote summary{display:inline-block;height:14px;padding:0 8px;font-size:0;line-height:0;vertical-align:middle;border-radius:7px;background:#e8eaed;color:#3c4043}.gm .mail-quote summary::before{content:"•••";display:block;font-size:11px;line-height:14px;letter-spacing:1px}.gm .mail-quote summary:hover{background:#dadce0}
.gm-earlier{margin:0;padding:18px 24px 8px 72px;border-top:1px solid var(--g-line);font-size:12px;font-weight:500;letter-spacing:.02em;color:var(--g-muted)}
.gm-earlier+.gm-msg{border-top:0}
/* Reply: a pill under the newest message that opens into a card */
.gm-reply{margin:4px 24px 20px 72px}
.gm-reply>summary{display:inline-flex;align-items:center;gap:8px;height:36px;padding:0 22px 0 16px;border:1px solid #747775;border-radius:18px;color:var(--g-text);font-weight:500;list-style:none;cursor:pointer}
.gm-reply>summary::-webkit-details-marker{display:none}.gm-reply>summary:hover{background:var(--g-hover)}
.gm-reply .r-open{display:none}
.gm-reply[open]{border-radius:16px;background:#fff;box-shadow:var(--g-pop)}
.gm-reply[open]>summary{display:flex;height:auto;padding:14px 18px 6px;border:0;border-radius:16px 16px 0 0;font-weight:400;color:var(--g-muted)}
.gm-reply[open]>summary:hover{background:none}.gm-reply[open] .r-closed{display:none}.gm-reply[open] .r-open{display:inline}.gm-reply[open] .r-open strong{color:var(--g-ink)}
.gm-reply form{padding:0 18px 14px}
.gm-reply .c-row{border-bottom-color:#eceff1}.gm-reply .c-row label{width:56px}
.gm-reply textarea{width:100%;min-height:170px;padding:14px 0;border:0;outline:none;resize:vertical;font:inherit;font-size:14px;line-height:1.55;color:var(--g-ink)}
.gm-reply-note{margin:0 0 10px;font-size:12px;color:var(--g-muted)}
.gm-reply-foot{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.gm-attach{position:relative}.gm-attach input{position:absolute;inset:0;opacity:0;cursor:pointer;width:100%}
.gm-files-note{font-size:12px;color:var(--g-muted)}
/* Attachments and filing (shared with the older layout) */
.c-teal{--c:var(--teal);--cs:var(--teal-soft)}.c-blue{--c:var(--blue);--cs:var(--blue-soft)}.c-amber{--c:#99712b;--cs:var(--amber-soft)}.c-green{--c:var(--green);--cs:var(--green-soft)}.c-red{--c:var(--red);--cs:var(--red-soft)}.c-purple{--c:var(--purple);--cs:var(--purple-soft)}.c-grey{--c:var(--muted);--cs:#eef1ef}
.chip.lbl{background:var(--cs);color:var(--c)}.chip.due{background:var(--amber-soft);color:#99712b;font-weight:600}.chip.file{background:var(--teal-soft);color:var(--teal-dark)}
.mail-rail b.quiet{background:var(--line);color:var(--muted)}.mail-rail b.due{background:var(--gold)}
.mini.primary{background:var(--teal);border-color:var(--teal);color:#fff}.mini.primary:hover{background:var(--teal-dark)}
.mbx-files{display:flex;flex-direction:column;gap:8px;margin-top:14px}.mbx-file{display:flex;flex-wrap:wrap;align-items:center;gap:8px}.mbx-file.is-open{padding:10px;border:1px solid var(--line);border-radius:10px;background:#fbfcfb}
.mbx-filed{font-size:12.5px;color:var(--green)}.mbx-filed.muted{color:var(--muted)}
.mbx-suggest{flex-basis:100%;display:flex;flex-wrap:wrap;gap:10px;justify-content:space-between;align-items:center;padding:9px 12px;border-radius:9px;background:var(--teal-soft)}.mbx-suggest>div{min-width:0;flex:1}.mbx-suggest small{display:block;color:var(--muted);margin-top:2px}.mbx-suggest-what{font-weight:600;color:var(--ink)}.mbx-suggest .badge{margin-left:4px}
.mbx-nosuggest{flex-basis:100%}
.mbx-choose{flex-basis:100%}.mbx-choose summary{cursor:pointer;font-size:12.5px;color:var(--teal-dark);list-style:none;display:inline-block}.mbx-choose summary::-webkit-details-marker{display:none}.mbx-choose form{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}.mbx-choose select{max-width:100%;min-width:0;flex:1 1 260px;border:1px solid var(--line);border-radius:8px;padding:5px 8px;font-size:13px;background:#fff}.mbx-choose input{flex:1 1 160px;border:1px solid var(--line);border-radius:8px;padding:5px 8px;font-size:13px}
.mbx-ask{margin:2px 0 0}
.gm .file-chip{border-radius:8px;border-color:#dadce0}
/* Narrower screens: folders shrink to icons, like Gmail's collapsed menu */
@media(max-width:1100px){
  .gm{grid-template-columns:88px minmax(0,1fr)}
  .gm-boxes{flex-direction:column;margin:0 6px 12px;padding:3px}.gm-boxes a{height:30px;font-size:11px}.gm-boxes b{display:none}
  .gm-folder{justify-content:center;gap:0;margin:0 14px;padding:0;border-radius:16px}.gm-folder span{display:none}
  .gm-folder b{position:absolute;top:0;right:2px;min-width:16px;padding:0 4px;border-radius:8px;background:var(--g-blue);color:#fff;font-size:10px;line-height:16px;text-align:center}.gm-folder b.quiet{background:#c4c7c5;color:#fff}.gm-folder b.due{background:#b06000;color:#fff}
  .gm-rail-head,.gm-addr{display:none}
  .gm-row a{grid-template-columns:150px minmax(0,1fr) auto}
}
/* Phones: folders become a scrolling strip, rows stack, a conversation takes the whole screen */
@media(max-width:760px){
  .gm{display:block;height:auto;min-height:0;padding:0;background:transparent}
  .gm-rail{flex-direction:row;gap:4px;overflow-x:auto;padding:0 0 8px}
  .gm-boxes{flex-direction:row;flex:none;margin:0 4px 0 0;box-shadow:none;background:var(--g-search)}.gm-boxes a{height:32px;padding:0 10px;font-size:13px}
  .gm-folder{flex:none;gap:8px;margin:0;padding:0 12px;border-radius:16px}.gm-folder span{display:inline}.gm-folder b{position:static;background:none;color:inherit;padding:0}.gm-folder b.quiet,.gm-folder b.due{background:none;color:inherit}
  .gm-label-link{display:none}
  .gm.is-open .gm-rail,.gm.is-open .gm-search{display:none}
  .gm-main{gap:8px}.gm-panel{border-radius:12px}.gm-list{max-height:none}
  .gm-row a{grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"from time" "line line";height:auto;gap:2px 8px;padding:10px 16px}
  .gm-from{grid-area:from}.gm-row time{grid-area:time}.gm-line{grid-area:line}
  .gm-subject,.gm-handle,.gm-body,.gm-earlier{padding-left:16px;padding-right:16px}.gm-state{margin-left:16px}
  .gm-msg summary{padding:14px 16px 0}.gm-reply{margin:4px 16px 18px}
  .gm-msg .gm-ago{display:none}
}

/* Leave */
.leave-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 10px; }
.leave-tiles .metric-card { min-height: 0; }
.metric-card.is-negative { border-color: #f1d6d5; background: var(--red-soft); }
.metric-card.is-negative .metric-value { color: var(--red); }
.leave-sub { margin: 0 0 20px; }
.leave-forms { margin-bottom: 20px; }
.leave-sum { margin: 14px 0 2px; font-size: 14px; }
.leave-ask { padding: 14px 0; border-top: 1px solid var(--line-soft); }
.leave-ask:first-child { border-top: 0; padding-top: 0; }
.leave-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.leave-decline { display: flex; gap: 8px; flex: 1; min-width: 260px; }
.leave-decline input { flex: 1; }
.leave-inline { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; align-items: end; }
.text-amber { color: var(--amber); }
.text-red { color: var(--red) !important; }
.leave-cal { display: grid; gap: 2px; align-items: center; font-size: 11px; }
.lc-day { text-align: center; color: var(--muted); }
.lc-day.is-weekend { color: #b3bdb9; }
.lc-day.is-today { color: var(--teal); font-weight: 700; }
.lc-name { font-size: 12.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 6px; }
.lc-cell { height: 20px; border-radius: 3px; background: #f1f4f1; }
.lc-weekend { background: transparent; }
.lc-holiday, .leave-key .lc-holiday { background: var(--green); }
.lc-waiting, .leave-key .lc-waiting { background: var(--amber-soft); box-shadow: inset 0 0 0 1px #e3c98f; }
.lc-off, .leave-key .lc-off { background: #9bb3ac; }
.lc-sick, .leave-key .lc-sick { background: var(--red); }
.lc-wfh, .leave-key .lc-wfh { background: var(--blue-soft); box-shadow: inset 0 0 0 1px #c9d6ea; }
.lc-closed, .leave-key .lc-closed { background: #b9dcc6; }
.lc-bank, .leave-key .lc-bank { background: #c7cfcc; }
.lc-event, .leave-key .lc-event { background: var(--purple-soft); box-shadow: inset 0 0 0 1px #d8cfe6; }
.leave-key { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 14px; font-size: 12px; color: var(--muted); }
.leave-key span { display: inline-flex; align-items: center; gap: 6px; }
.leave-key i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
@media (max-width: 900px) { .leave-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .leave-cal { overflow-x: auto; } }
.metric-card.is-warning { border-color: #f1e3c5; background: var(--amber-soft); }
.metric-card.is-warning .metric-value { color: var(--amber); }
.leave-months { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; margin: 4px 0 8px; }
.leave-months .lm { border: 1px solid var(--line); border-radius: 7px; background: #fff; padding: 6px 4px; text-align: center; font-size: 11.5px; color: var(--muted); }
.leave-months .lm strong { display: block; font-size: 14px; color: var(--ink); font-variant-numeric: tabular-nums; }
.leave-months .lm.is-past { background: #f6f7f4; }
.leave-months .lm.is-past strong { color: var(--muted); }
.leave-months .lm.is-now { border-color: var(--teal); box-shadow: inset 0 0 0 1px var(--teal); }
.leave-months .lm.is-negative strong { color: var(--amber); }
@media (max-width: 900px) { .leave-months { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

/* Lead cards: the phone line, shown whatever else the card says. Booked = a call arranged; due = its time has come and
   nobody has recorded how it went, so the lead needs updating or the call rebooking. */
.lead-call { position: relative; margin: 0; display: flex; align-items: flex-start; gap: 6px; padding: 4px 8px; border-radius: 6px; font-size: 12px; font-weight: 650; line-height: 1.4; }
.lead-call svg, .legend-call svg { flex: none; width: 14px; height: 14px; fill: currentColor; }
.lead-call svg { margin-top: 1px; }
.lead-call.is-booked, .legend-call.is-booked { background: var(--stage-call-soft); color: #5f4a80; }
.lead-call.is-due, .legend-call.is-due { background: var(--amber-soft); color: #7a5512; }
.legend-call { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 6px; font-weight: 600; }

/* Case page: the case lead changes when the current step is due (templates/workspace/_case_step.html). */
.step-due-wrap { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: 0 0 auto; }
.step-due-change { position: relative; }
.step-due-change summary { list-style: none; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--teal-dark); }
.step-due-change summary::-webkit-details-marker { display: none; }
.step-due-pop { position: absolute; right: 0; top: 24px; z-index: 10; width: 310px; display: grid; gap: 10px; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-raised); }
.step-due-pop form { display: grid; gap: 6px; margin: 0; }
.step-due-pop label { font-size: 12px; font-weight: 600; color: var(--muted); }
.step-due-pop input { border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; font: inherit; font-size: 13px; }
.step-due-pop .btn { justify-self: start; }
.step-due-pop p { margin: 0; }
@media (max-width: 760px) { .step-due-wrap { align-items: flex-start; } .step-due-pop { left: 0; right: auto; } }
.ext-deadline-change { margin-top: 10px; }
.ext-deadline-change .step-due-pop { left: 0; right: auto; max-width: 100%; }

/* Report checker (templates/workspace/checker*.html) */
.checker-top { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.checker-form { display: grid; gap: 14px; }
.checker-form .field { display: grid; gap: 5px; }
.checker-form label { font-weight: 600; font-size: 13px; color: var(--ink); }
.checker-form small { color: var(--muted); font-size: 12px; }
.checker-form .field-error, .field-error { color: var(--red); }
.checker-form select, .checker-form textarea, .checker-form input[type=file] { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 13.5px; background: #fff; }
.checker-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.checker-go { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.checker-lib dl { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 0 12px; }
.checker-lib dt { font-size: 22px; font-weight: 700; color: var(--ink); }
.checker-lib dd { margin: 0; font-size: 12.5px; color: var(--muted); }
.checker-wait .panel-body { display: flex; gap: 16px; align-items: flex-start; }
.checker-wait p { margin: 4px 0 0; }
.checker-spinner { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--teal-soft); border-top-color: var(--teal); animation: checker-spin 1s linear infinite; }
@keyframes checker-spin { to { transform: rotate(360deg); } }
.checker-verdict { border-left: 5px solid var(--muted); }
.checker-verdict.tone-green { border-left-color: var(--green); } .checker-verdict.tone-teal { border-left-color: var(--teal); }
.checker-verdict.tone-amber { border-left-color: var(--gold); } .checker-verdict.tone-red { border-left-color: var(--red); }
.checker-verdict-label { display: inline-block; font-size: 18px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.checker-verdict p { margin: 4px 0; line-height: 1.55; }
.checker-h { font-size: 17px; margin: 26px 0 12px; }
.cpoint { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 10px; padding: 14px 18px; margin-bottom: 12px; }
.cpoint.sev-critical { border-left-color: var(--red); } .cpoint.sev-important { border-left-color: var(--gold); } .cpoint.sev-minor { border-left-color: #b9c6c1; }
.cpoint.cpoint-arg { border-left-color: var(--blue); }
.cpoint header { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.cpoint-sev { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.sev-critical .cpoint-sev { color: var(--red); } .sev-important .cpoint-sev { color: #8a6420; } .sev-minor .cpoint-sev { color: var(--muted); }
.cpoint-cat { font-size: 12px; color: var(--muted); }
.cpoint-quote { margin: 0 0 8px; padding: 6px 12px; border-left: 3px solid var(--line); color: #55666b; font-size: 13px; background: #fafbfa; white-space: pre-wrap; }
.cpoint-missing { margin: 0 0 8px; font-size: 12.5px; font-weight: 600; color: #8a6420; }
.cpoint-issue { margin: 0 0 6px; font-weight: 600; color: var(--ink); line-height: 1.5; }
.cpoint-suggest { margin: 0 0 8px; line-height: 1.55; }
.cpoint-wording { background: var(--teal-soft); border-radius: 8px; padding: 10px 12px; margin: 8px 0; }
.cpoint-wording span { display: block; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--teal-dark); margin-bottom: 4px; }
.cpoint-wording p { margin: 0; line-height: 1.55; }
.cpoint-sources { display: grid; gap: 8px; margin-top: 10px; }
.csource { border: 1px solid var(--line-soft); border-radius: 8px; padding: 8px 12px; background: #fbfcfb; }
.csource-head { font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.csource blockquote { margin: 6px 0 0; font-size: 13px; line-height: 1.5; color: #3e5157; font-style: italic; }
.checker-removed { margin: 18px 0; font-size: 13px; } .checker-removed summary { cursor: pointer; color: var(--muted); }
.checker-next { margin-top: 20px; }
.checker-search { display: flex; gap: 8px; flex-wrap: wrap; } .checker-search input { flex: 1; min-width: 220px; border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; font: inherit; }
.checker-search select { border: 1px solid var(--line); border-radius: 8px; padding: 8px; font: inherit; }
.lib-hit { padding: 10px 0; border-bottom: 1px solid var(--line-soft); } .lib-hit:last-child { border-bottom: 0; }
.lib-hit p { margin: 4px 0 0; font-size: 13px; color: #55666b; line-height: 1.5; }
.lib-text { white-space: pre-wrap; font-size: 13.5px; line-height: 1.6; max-width: 900px; overflow-wrap: anywhere; }
.lib-text mark { background: #fff1b8; padding: 1px 0; }
@media (max-width: 900px) { .checker-top { grid-template-columns: 1fr; } .checker-pair { grid-template-columns: 1fr; } }
.checker-h-note { font-size: 12.5px; font-weight: 500; color: var(--muted); margin-left: 8px; }
.cpoint-accept { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--teal-dark); cursor: pointer; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; background: #fff; }
.cpoint-accept:has(input:checked) { background: var(--teal-soft); border-color: var(--teal); }
.cpoint-accepted { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--green); }
.cpoint-sev-arg { color: var(--blue); }
.accept-panel { position: sticky; bottom: 12px; z-index: 5; box-shadow: var(--shadow-raised); }
.accept-panel .field { display: grid; gap: 5px; margin-bottom: 10px; } .accept-panel label { font-weight: 600; font-size: 13px; }
.accept-panel textarea { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 13.5px; }
.accept-go { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.new-version { border-left: 5px solid var(--teal); }
.new-version-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.new-version-head p { margin: 2px 0 0; }
.checker-wait-row { display: flex; gap: 14px; align-items: flex-start; } .checker-wait-row p { margin: 2px 0 0; }
.nv-block { margin-top: 12px; font-size: 13px; } .nv-block ul { margin: 6px 0 0; padding-left: 20px; } .nv-block summary { cursor: pointer; font-weight: 600; }
.nv-confirm { background: var(--amber-soft); border-radius: 8px; padding: 10px 12px; }
.nv-warn { background: var(--red-soft); border-radius: 8px; padding: 10px 12px; }
.accept-panel .panel-body { padding: 12px 16px; }
.accept-row { display: flex; gap: 10px; align-items: flex-start; }
.accept-row textarea { flex: 1; min-height: 38px; height: 38px; resize: vertical; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 13.5px; }
.accept-panel p { margin: 6px 0 0; }
.accept-word-pick { color: var(--teal-dark); text-decoration: underline; cursor: pointer; font-weight: 600; }
.accept-word-pick input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.accept-word-pick:focus-within { outline: 2px solid currentColor; outline-offset: 2px; border-radius: 3px; }
.accept-word-name { color: var(--text); font-weight: 600; }
@media (max-width: 700px) { .accept-row { flex-direction: column; align-items: stretch; } }
.checker-check { display: flex; gap: 8px; align-items: center; font-weight: 500 !important; font-size: 13px; margin-top: 4px; }
.cdocs { list-style: none; margin: 0 0 14px; padding: 0; }
.cdocs li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; }
.cdocs li form { margin: 0; }
.cdocs-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.cdocs-go { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.cdocs-done summary { cursor: pointer; padding: 14px 20px; font-weight: 600; }
.cpoint-doc { margin: 0 0 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.checklist td { vertical-align: top; }

/* checker rules (CR-015) */
.cpoint-reject { margin-left: 6px; }
.cpoint-rejected { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--red, #b3261e); }
.cpoint-reject-note { font-size: 13px; padding: 6px 10px; background: #fbf3f2; border-radius: 8px; }
.cpoint:has(.cpoint-rejected) { opacity: .65; }
.reject-dialog { border: 1px solid var(--line); border-radius: 12px; padding: 20px; max-width: 520px; width: calc(100% - 32px); }
.reject-dialog::backdrop { background: rgba(0,0,0,.35); }
.reject-dialog textarea { width: 100%; }
.rj-opt { display: flex; gap: 8px; align-items: center; font-weight: 400; margin: 4px 0; }
.rj-actions { display: flex; gap: 8px; margin-top: 12px; }
.rules-filter { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.crule-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.crule-off { opacity: .7; }
.crule-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: #55666b; margin: 12px 0 2px; }
.crule-ai { margin: 12px 0; padding: 10px 14px; border-radius: 10px; background: #f3f7f6; }
.crule-ai-disagree { background: #fbf3f2; }
.crule-ai-partly { background: #fcf7ec; }
.crule-change { display: flex; gap: 8px; margin-top: 12px; }
.crule-change input { flex: 1; }
.crule-review { margin-top: 8px; }
.crule-log { margin-top: 12px; font-size: 13px; }

/* Lead numbers and AI values (lead_value.py) */
.lead-stats { display: grid; grid-template-columns: repeat(2, minmax(150px, 1fr)) minmax(260px, 2fr) minmax(170px, 1fr); gap: 12px; margin-bottom: 14px; }
.lead-stat { display: flex; flex-direction: column; gap: 3px; min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); padding: 14px 16px 12px; box-shadow: var(--shadow); }
.lead-stat-number { font-size: 28px; font-weight: 700; letter-spacing: -.6px; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.15; }
.lead-stat .kpi-meta { font-size: 12px; color: var(--muted); }
.lead-stat .kpi-meta.up { color: var(--green); }
.lead-stat .kpi-meta.down { color: var(--red); }
.lead-stat.is-high { border-color: #ecd9b4; background: #fffaf0; }
.lead-stat.is-high .lead-stat-number { color: #8a6420; }
.trend-bars { display: flex; align-items: flex-end; gap: 6px; height: 54px; margin: 4px 0 2px; }
.trend-bar { position: relative; flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.trend-bar i { display: block; width: 100%; min-height: 2px; border-radius: 3px 3px 0 0; background: #b9d6d0; }
.trend-bar.is-current i { background: var(--teal); }
.trend-bar b { position: absolute; top: -2px; font-size: 10.5px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.lead-stats-note { grid-column: 1 / -1; margin: -2px 2px 0; font-size: 12px; color: var(--muted); }
.lead-value.is-high { color: #8a6420; }
.high-tag, .spam-tag { position: relative; z-index: 1; align-self: flex-start; display: inline-block; margin: 2px 0 4px; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 650; }
.high-tag { color: #8a6420; background: #fbefd6; }
.spam-tag { color: var(--muted); background: var(--line-soft); }
.fact-chips .high-tag { margin: 0; align-self: center; }
.high-dot { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--gold); vertical-align: middle; }
.ai-value-note { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 8px; margin-top: 10px; max-width: 820px; font-size: 13px; color: var(--text); }
.ai-value-note > span:nth-child(2) { flex: 1; min-width: 220px; }
.ai-badge { flex-shrink: 0; padding: 1px 6px; border-radius: 5px; font-size: 10.5px; font-weight: 700; letter-spacing: .5px; color: var(--purple); background: var(--purple-soft); }
@media (max-width: 1100px) { .lead-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .lead-trend { grid-column: 1 / -1; } }
@media (max-width: 520px) { .lead-stats { grid-template-columns: 1fr 1fr; gap: 8px; } .lead-stat-number { font-size: 23px; } }

.origin-tag { position: relative; z-index: 1; align-self: flex-start; display: inline-block; margin: 2px 4px 4px 0; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 650; white-space: nowrap; }
.origin-tag.is-ours { color: var(--purple); background: var(--purple-soft); }
.origin-tag.is-client { color: var(--blue); background: var(--blue-soft); }

.parked-note { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 0 0 12px; padding: 9px 14px; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--paper); font-size: 13px; color: var(--muted); }
.parked-note strong { color: var(--text); font-weight: 650; }
.parked-note a { font-weight: 600; }
/* CR-018: case labels beside the client line, particulars and history in Case details */
.case-label{display:inline-block;margin-left:6px;padding:2px 9px;border:1.5px solid var(--teal);border-radius:5px;color:var(--teal);font-size:12.5px;font-weight:600;line-height:1.5;white-space:nowrap;vertical-align:middle}
.case-particulars{margin-bottom:14px}.case-particulars p{margin:4px 0 0;color:var(--ink)}
.case-history{list-style:none;margin:0 0 12px;padding:0;font-size:13.5px}.case-history li{padding:4px 0;border-bottom:1px solid var(--line-soft)}.case-history li:last-child{border:0}
.field div[id^="id_labels"],.field ul[id^="id_labels"]{display:flex;flex-wrap:wrap;gap:8px 18px;list-style:none;padding:0;margin:0}.field div[id^="id_labels"] label,.field ul[id^="id_labels"] label{font-weight:500;display:flex;gap:7px;align-items:center;margin:0}
