/* Operating views preserve the existing LeadFlow appearance and components. */
:root{--leadflow-operating-styles:ready}
/* Active content uses the normal surface across Leads, Team, Reports and health. */
.metric{background:var(--surface)}
.work-table tbody tr:hover{background:var(--surface)}
.duplicate-comparison-wrap{max-width:100%;overflow-x:auto;margin:12px 0}
.duplicate-comparison{width:100%;min-width:650px;border-collapse:collapse;table-layout:fixed;font-size:14px}
.duplicate-comparison caption{text-align:left;padding:8px 0;color:var(--muted)}
.duplicate-comparison th,.duplicate-comparison td{text-align:left;vertical-align:top;padding:12px 10px;border-bottom:1px solid var(--line);overflow-wrap:anywhere}
.duplicate-comparison thead th{background:var(--surface-2);font-size:12px}
.duplicate-comparison th:first-child{width:18%}
.duplicate-comparison th:last-child{width:18%}
.work-table tbody tr.dispatch-complete{background:var(--line)}
@media(max-width:760px){.work-table tr{background:var(--surface)}}
/* Compact queue cards retain the desktop table and its labelled cells. */
/* Recent-run cards use the full phone width instead of stacking eight fields. */
@media(max-width:760px){
  .run-table tr{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px 12px}
  .run-table td{width:auto;min-width:0;padding:0;font-size:13px;line-height:1.45;overflow-wrap:anywhere}
  .run-table td::before{font-size:11px;margin-bottom:2px}
  .run-table td:nth-child(1){grid-column:span 4;font-size:15px;font-weight:650}
  .run-table td:nth-child(1)::before,.run-table td:nth-child(2)::before{display:none}
  .run-table td:nth-child(2){grid-column:span 2;text-align:right;font-weight:600}
  .run-table td:nth-child(3),.run-table td:nth-child(4),.run-table td:nth-child(5){grid-column:span 2;font-size:17px;font-weight:650;font-variant-numeric:tabular-nums}
  .run-table td:nth-child(6),.run-table td:nth-child(7){grid-column:span 3;border-top:1px solid var(--line);padding-top:8px}
  .run-table td:nth-child(8){grid-column:1/-1;color:var(--muted)}
  .run-table td:nth-child(8)::before{display:inline;margin-right:6px}
}
@media(max-width:760px){
  .lead-queue tr{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px 12px;align-items:start;background:var(--surface)}
  .lead-queue tr.dispatch-complete{background:var(--line)}
  .lead-queue tbody tr:not(.dispatch-complete):hover{background:var(--surface)}
  .lead-queue td{min-width:0;width:auto;padding:0;font-size:13px;line-height:1.45}
  .lead-queue td::before{display:inline;margin-right:5px;font-size:11px}
  .lead-queue .lead-customer{grid-column:1;grid-row:1}
  .lead-queue .lead-customer strong{font-size:15px;line-height:1.4}
  .lead-queue .lead-customer small{font-size:11px;line-height:1.5;margin-top:3px;overflow-wrap:anywhere}
  .lead-queue .lead-stage{grid-column:2;grid-row:1;justify-self:end}
  .lead-queue .lead-stage .badge{font-size:11px;white-space:normal;text-align:center;max-width:115px}
  .lead-queue .lead-received{grid-column:1/-1;grid-row:2;color:var(--muted)}
  .lead-queue .lead-owner{grid-column:1/-1;grid-row:3}
  .lead-queue .lead-owner.unassigned{display:none}
  .lead-queue .lead-next{grid-column:1;grid-row:4;align-self:center;overflow-wrap:anywhere}
  .lead-queue .lead-next::before{display:none}
  .lead-queue .lead-open{grid-column:2;grid-row:4;align-self:end}
  .lead-queue .lead-open button{min-width:72px;min-height:44px;padding:8px 12px}
  .lead-queue .lead-customer::before,.lead-queue .lead-stage::before,.lead-queue .lead-open::before{display:none}
}
.operating-summary{display:flex;gap:1.5rem;flex-wrap:wrap;margin:1rem 0 1.5rem;font-variant-numeric:tabular-nums}
.operating-summary strong{display:block;font-size:1.7rem}
.operating-summary span{color:var(--muted);font-size:.85rem}
.handoff-text{width:100%;min-height:14rem;font:inherit;white-space:pre-wrap}
.responsibility{padding:1rem 0;display:grid;gap:.5rem;border-top:1px solid var(--line);margin-top:1rem}
.responsibility time{font-variant-numeric:tabular-nums}
.operating-actions form+form{margin-top:1.5rem;padding-top:1.5rem;border-top:1px solid var(--line)}
.operating-actions label+label{margin-top:.8rem}
.operating-actions .button-row{margin-top:1rem}
.operating-actions .checkbox span{margin:0}
.operating-roster{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 2rem;padding:0;list-style:none}
.operating-roster li{padding:1rem 0;border-bottom:1px solid var(--line)}
.operating-roster small{display:block;color:var(--muted)}
.main:has(.operating-detail){max-width:1100px}
.operating-detail{display:flex;flex-direction:column;gap:20px;min-width:0}
.operating-detail>.panel{margin:0}
.handover-correction,.handover-followup{border-top:1px solid var(--line);padding-top:16px;margin-top:20px}
.handover-correction>summary{display:list-item;min-height:44px;align-content:center;color:var(--muted);font-size:14px;cursor:pointer}
.handover-correction>summary:hover{color:var(--ink)}
.handover-correction[open]>summary{margin-bottom:12px}
.operating-history{list-style:none;padding:0;margin:24px 0 0}
.operating-history .timeline-event{position:relative;padding:0 0 28px 28px;min-width:0}
.operating-history .timeline-event+li{margin-top:0}
.operating-history .timeline-event:last-child{padding-bottom:0}
.timeline-event::before{content:"";position:absolute;top:5px;left:0;width:10px;height:10px;border-radius:50%;border:2px solid var(--blue);background:var(--surface);z-index:1;box-sizing:border-box}
.timeline-event:not(:last-child)::after{content:"";position:absolute;left:4px;top:15px;bottom:0;width:2px;background:var(--line)}
.timeline-event.timeline-sent::before{background:var(--green);border-color:var(--green)}
.timeline-event.timeline-correction::before{border-color:var(--amber)}
.timeline-heading{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px 24px;align-items:baseline}
.timeline-heading strong{font-size:15px;line-height:1.5;font-weight:650}
.timeline-heading time{font-size:13px;line-height:1.5;color:var(--muted);font-variant-numeric:tabular-nums}
.timeline-event>p{margin:4px 0 0;color:var(--muted);font-size:14px;line-height:1.5;max-width:70ch;overflow-wrap:anywhere}
@media(max-width:640px){.timeline-heading{grid-template-columns:1fr;gap:2px}.operating-history .timeline-event{padding-left:24px}.timeline-event>p{margin-top:6px}}
button:active:not(:disabled){transform:translateY(1px)}
@media(max-width:640px){.operating-roster{grid-template-columns:1fr}.operating-summary{gap:1rem}.operating-summary>div{flex:1 1 40%}}
/* Reuse the demo table, filters, overview and stacked panels without new visual tokens. */
.view-tabs>a{display:inline-flex;align-items:center;gap:6px;padding:8px 12px;color:var(--muted);text-decoration:none;white-space:nowrap}
.view-tabs>a:hover{color:var(--blue)}
.view-tabs>a span{font-variant-numeric:tabular-nums}
.operating-actions details>form,.assignment-panel details>form{margin-top:1rem}
.rep-picker{position:relative;min-width:0}
.rep-picker>label{display:block;margin-bottom:6px;font-weight:650}
.rep-combobox{position:relative}
.rep-combobox input{width:100%;padding-right:48px}
.rep-combobox .rep-toggle{position:absolute;inset:1px 1px 1px auto;width:44px;min-height:0;padding:0;border:0;background:transparent;box-shadow:none}
.rep-toggle span{font-size:22px;line-height:1}
.rep-popup{position:absolute;top:100%;left:0;right:0;z-index:30;margin-top:4px;padding:4px;background:var(--surface);border:1px solid var(--line);border-radius:11px;box-shadow:0 8px 24px rgb(0 0 0 / .12)}
.rep-popup[hidden],.rep-popup [hidden]{display:none}
.rep-popup [role=listbox]{max-height:264px;overflow-y:auto;overscroll-behavior:contain}
.rep-popup [role=option]{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:44px;padding:10px 12px;border:0;border-radius:7px;text-align:left;font-weight:500;background:transparent}
.rep-popup [role=option]:hover,.rep-popup [role=option][aria-selected=true]{background:var(--blue-soft);color:var(--blue)}
.rep-popup [role=option]>span{min-width:0;overflow-wrap:anywhere}
.rep-popup small{min-width:0;flex-shrink:1;color:var(--muted);font-size:12px;overflow-wrap:anywhere}
@media(max-width:760px){.rep-popup [role=option]{flex-direction:column;align-items:stretch;gap:2px}}
.rep-empty{margin:0;padding:12px;color:var(--muted)}
.rep-picker .sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
.review-head h1,.health-head h1{font-size:28px;line-height:1.2;letter-spacing:-.025em}
.review-head p{font-size:14px;line-height:1.5;max-width:65ch}
.review-count{font-size:14px;color:var(--muted);vertical-align:middle;margin-left:8px}
.review-card{padding:0;overflow:hidden}
.duplicate-review .panel-head{align-items:center}
.duplicate-pairs{list-style:none;padding:0;margin:12px 0 0}
.duplicate-pair{border-top:1px solid var(--line);padding:14px 0}
.duplicate-pair:first-child{border-top:0;padding-top:0}
.duplicate-member{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 16px;padding:8px 0}
.duplicate-member>a{display:grid;gap:3px;text-decoration:none}
.duplicate-member>a strong{color:var(--ink)}
.duplicate-member>a small,.duplicate-member>small,.duplicate-match{color:var(--muted);font-size:13px}
.duplicate-match{margin:8px 0 0}
.review-summary{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px 20px;padding:18px 20px;cursor:pointer;list-style:none}
.review-summary::-webkit-details-marker{display:none}
.review-title{font-size:16px;font-weight:650;overflow-wrap:anywhere}
.review-meta,.review-reason,.review-deadline{font-size:13px;line-height:1.5;color:var(--muted);overflow-wrap:anywhere}
.review-meta,.review-reason{grid-column:1}
.review-deadline{grid-column:2;grid-row:1 / span 2;text-align:right}
.review-deadline.error{color:var(--red)}
.review-open{grid-column:2;grid-row:3;color:var(--blue);font-size:13px;text-align:right}
.review-open::after{content:' ↓'}
.review-card[open] .review-open::after{content:' ↑'}
.review-body{display:grid;grid-template-columns:minmax(0,.85fr) minmax(0,1.15fr);gap:24px;padding:20px;border-top:1px solid var(--line)}
.review-body h3{font-size:14px;margin:0 0 12px}
.review-source .message{font-size:14px;line-height:1.6;white-space:pre-wrap;overflow-wrap:anywhere;margin:0}
.mobile-review-source{display:none}
.mobile-review-source>summary{min-height:44px;align-content:center;font-size:14px;font-weight:600;cursor:pointer}
.mobile-review-source[open]>.message{margin-top:10px}
.review-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.review-body label{font-size:13px;min-width:0}
.review-body label>span{display:block;margin-bottom:6px}
.review-body input:not([type=checkbox]),.review-body textarea{width:100%;font-size:16px;font-weight:400;min-height:44px}
.review-body textarea{min-height:88px;resize:vertical}
.review-decision form>label{display:block;margin-top:12px}
.review-body .checkbox{display:flex;gap:8px;align-items:flex-start;line-height:1.5}
.review-body .helper{font-size:13px;line-height:1.5}
.review-body .button-row{margin-top:14px}
.review-exclude{border-top:1px solid var(--line);margin-top:20px;padding-top:16px}
.review-exclude>summary{font-size:13px;color:var(--muted);cursor:pointer}
@media(max-width:640px){.review-head h1,.health-head h1{font-size:24px}.review-summary{padding:16px;grid-template-columns:minmax(0,1fr)}.review-meta,.review-reason,.review-deadline,.review-open{grid-column:1;grid-row:auto;text-align:left}.review-body{grid-template-columns:minmax(0,1fr);padding:16px;gap:20px}.review-fields{grid-template-columns:minmax(0,1fr)}.review-body .button-row button{width:100%}.duplicate-member{grid-template-columns:minmax(0,1fr);gap:4px}}

/* Team management follows the existing lead table and mobile row layout. */
/* Operational metrics and real data charts; no external chart dependency. */
.health-metrics{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:20px;margin:18px 0}.health-metric{display:flex;flex-direction:column;gap:5px}.health-metric strong{font-size:28px;line-height:1.2;font-variant-numeric:tabular-nums}.health-metric span{font-size:13px;color:var(--muted)}.health-charts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:28px}.usage-graph{margin:20px 0;min-width:0}.usage-graph figcaption{font-weight:600;margin-bottom:18px}.usage-graph figcaption span{font-weight:400;margin-left:8px}.usage-bars{display:flex;gap:12px;overflow-x:auto;padding-bottom:8px}.usage-day{flex:1;min-width:36px;text-align:center}.usage-day time,.bar-value{display:block;font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums}.bar-track{height:130px;margin:8px 0;border-bottom:1px solid var(--line)}.bar-track svg{width:100%;height:100%;display:block}.bar-fill{fill:var(--blue,#087bec)}.write-bar{fill:#159a77}.health-quota{margin:20px 0}.health-quota>div{display:flex;justify-content:space-between;gap:16px;font-size:14px}.health-quota meter{width:100%;height:12px;margin-top:8px;accent-color:var(--blue,#087bec)}.report-period{display:block;max-width:320px;margin-bottom:24px}.report-period span{display:block;margin-bottom:8px}.report-period select{width:100%}.health-head p{color:var(--muted);font-size:14px}
@media(max-width:640px){.health-charts{grid-template-columns:1fr}.health-metrics{grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.health-metric strong{font-size:24px}.health-quota>div{flex-direction:column;gap:4px}.usage-bars{gap:8px}.report-period{max-width:none}}
.team-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.team-editor{margin-bottom:24px}.team-table td{overflow-wrap:anywhere}.team-table .button-row{flex-wrap:wrap}.danger{color:var(--red,#b42318)}@media(max-width:640px){.team-fields{grid-template-columns:1fr}.team-table .button-row{justify-content:flex-start}}
@media(min-width:641px){.team-table th:nth-child(1){width:20%}.team-table th:nth-child(2){width:22%}.team-table th:nth-child(3){width:14%}.team-table th:nth-child(4){width:8%}.team-table th:nth-child(5){width:10%}.team-table th:nth-child(6){width:10%}.team-table th:nth-child(7){width:16%}}

.system-lead-id{overflow-wrap:anywhere;user-select:text}

/* Manual uses the existing panels and theme tokens, with a readable text measure. */
.guide-head h1{font-size:32px;line-height:1.2}.guide-head p{max-width:65ch;color:var(--muted);line-height:1.6}
.guide-layout{display:grid;grid-template-columns:260px minmax(0,1fr);gap:24px;align-items:start}
.guide-contents{position:sticky;top:100px;padding:24px}.guide-contents h2{font-size:18px;margin:0 0 12px}
.guide-contents ol{padding-left:22px;margin:0}.guide-contents li{padding:4px 0;color:var(--muted)}
.guide-contents a{display:block;padding:6px 0;color:var(--ink);text-decoration:none;line-height:1.45}.guide-contents a:hover{color:var(--blue);text-decoration:underline}
.guide-body{min-width:0}.guide-section{scroll-margin-top:110px;margin:0 0 20px;padding:28px 32px}
.guide-section h2{display:flex;gap:14px;align-items:baseline;font-size:22px;line-height:1.35;margin:0 0 20px}
.guide-number{font-size:13px;color:var(--blue);font-variant-numeric:tabular-nums;flex-shrink:0}
.guide-section p{max-width:78ch;line-height:1.75;margin:0 0 16px;overflow-wrap:anywhere}.guide-section p:last-child{margin-bottom:0}
@media(max-width:900px){.guide-layout{grid-template-columns:minmax(0,1fr)}.guide-contents{position:static}.guide-contents ol{columns:2;column-gap:32px}.guide-contents li{break-inside:avoid}}
@media(max-width:640px){.guide-head h1{font-size:28px}.guide-contents ol{columns:1}.guide-section{padding:20px}.guide-section h2{font-size:20px}.guide-section p{font-size:15px}.guide-layout{gap:16px}}

/* Completed dispatch stays readable and available to open; avoid disabled opacity. */
.work-table tr.dispatch-complete td{color:var(--ink)}
.work-table tr.dispatch-complete td>strong{font-weight:600}
.work-table tr.dispatch-complete button{color:var(--ink);background:var(--surface);border-color:var(--line)}
.work-table tr.dispatch-complete button:hover{color:var(--ink);background:var(--surface-3)}

/* Mobile navigation and composition; desktop keeps the existing workspace. */
.mobile-only,.mobile-tabbar{display:none}
.mobile-tabbar[hidden]{display:none}
.mobile-menu:not([open]){display:none}
.mobile-menu{border:1px solid var(--line);background:var(--surface);color:var(--ink);border-radius:20px;padding:20px;width:min(420px,calc(100% - 24px));max-height:calc(100dvh - 40px);overflow-y:auto}
.mobile-menu::backdrop{background:rgb(0 0 0 / .35)}
.mobile-menu-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}
.mobile-menu-head h2{margin:0;font-size:22px}
.mobile-menu nav{display:grid;gap:4px}
.mobile-menu nav a{display:flex;align-items:center;gap:14px;min-height:48px;padding:10px 12px;color:var(--ink);text-decoration:none;border-radius:11px;font-weight:600}
.mobile-menu nav a[aria-current=page]{background:var(--blue-soft);color:var(--blue)}
.mobile-menu-settings{border-top:1px solid var(--line);margin-top:16px;padding-top:14px}
.mobile-menu-settings h3{font-size:13px;color:var(--muted);margin:0 0 10px}
.mobile-menu-settings .appearance button{min-height:44px;font-size:14px}
.mobile-menu-settings .button-row{margin-top:12px;display:flex}
.mobile-menu-settings .button-row button{display:flex;align-items:center;justify-content:center;gap:8px;flex:1}
.mobile-icon-button{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;padding:0;border:0;background:transparent;color:var(--ink)}
.mobile-menu-open{overflow:hidden}
.pull-refresh{display:none}
@keyframes pull-refresh-spin{to{transform:rotate(360deg)}}
.sidebar .desktop-app-version{font-size:12px;font-weight:500;color:var(--muted);white-space:nowrap}
@media(min-width:761px){.mobile-only{display:none}}
@media(max-width:760px){
  .desktop-app-version{display:none}
  html{scrollbar-gutter:auto;scroll-padding-top:76px;scroll-padding-bottom:90px;overscroll-behavior-y:contain}
  body{overscroll-behavior-y:contain}
  .pull-refresh.is-visible{position:fixed;top:72px;left:50%;transform:translateX(-50%);z-index:26;display:flex;align-items:center;gap:8px;max-width:calc(100% - 32px);padding:10px 14px;background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:24px;box-shadow:0 5px 16px rgb(0 0 0 / .12);font-size:13px;pointer-events:none;white-space:nowrap}
  .pull-refresh svg{width:20px;height:20px;color:var(--blue)}
  .pull-refresh.is-armed svg{transform:rotate(180deg)}
  .pull-refresh.is-refreshing svg{animation:pull-refresh-spin .8s linear infinite}
  .app-header{display:flex;min-height:60px;padding:8px 14px;gap:8px}
  .sidebar .brand{margin-right:auto;gap:7px}
  .brand strong{font-size:20px}
  .brand-mark{width:32px;height:32px}
  .sidebar nav,.header-tools{display:none}
  .topbar{display:flex;gap:2px;margin-left:auto}
  .account-menu summary{padding:0;width:44px;justify-content:center}
  .account-menu .avatar{width:32px;height:32px}
  .mobile-only{display:inline-flex}
  .mobile-tabbar{position:fixed;inset:auto 0 0;z-index:24;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));padding:6px 8px max(6px,env(safe-area-inset-bottom));background:var(--surface);border-top:1px solid var(--line)}
  .mobile-tabbar a,.mobile-tabbar button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-height:54px;padding:4px 2px;color:var(--muted);font-size:10px;font-weight:600;line-height:1.2;text-align:center;text-decoration:none;border:0;border-radius:9px;background:transparent}
  .mobile-tabbar a[aria-current=page],.mobile-tabbar button.current{color:var(--blue);background:var(--blue-soft)}
  .mobile-tabbar svg{width:22px;height:22px}
  .mobile-tabbar[data-count="4"]{grid-template-columns:repeat(4,minmax(0,1fr))}
  .main{padding:20px 14px calc(94px + env(safe-area-inset-bottom));min-height:calc(100dvh - 60px)}
  h1,.review-head h1,.health-head h1,.guide-head h1{font-size:28px;line-height:1.15}
  h2{font-size:19px;line-height:1.3}
  .page-head{gap:12px;margin-bottom:18px}
  .page-head p{font-size:13px;line-height:1.5;margin-top:6px}
  .panel{padding:15px 13px;border-radius:16px;margin-bottom:14px}
  .panel-head{margin-bottom:12px;gap:8px}
  .helper,.inline-context{font-size:13px;line-height:1.5}
  input:not([type=checkbox]),select,textarea{font-size:16px;min-height:44px}
  .lead-overview.three{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
  .lead-overview.three>button:first-child{grid-column:auto}
  .lead-overview>button{min-width:0;padding:9px 10px}
  .lead-overview strong{font-size:22px}
  .lead-overview span{font-size:10px;line-height:1.3}
  .view-tabs{margin-bottom:12px;padding-bottom:10px;gap:6px}
  .view-tabs button,.view-tabs>a{font-size:12px;padding:8px 10px;min-height:44px}
  .mobile-filter-toggle{min-height:44px;margin-bottom:10px;padding:8px 12px;font-size:13px;background:var(--surface)}
  .filters{gap:10px;margin-bottom:12px}
  .filters label>span{font-size:12px;margin-bottom:4px}
  .filters input[type=search]{font-size:16px}
  #content[data-view=reports]{display:flex;flex-direction:column}
  #content[data-view=reports]>.practice-sales{order:1}
  #content[data-view=reports] .health-metrics{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px 10px}
  #content[data-view=reports] .health-metric span{font-size:11px}
  .table-wrap{overflow:visible}
  .work-table:not(.lead-queue):not(.run-table):not(.team-table):not(.sales-table):not(.archive-source-summary) tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 12px}
  .work-table:not(.lead-queue):not(.run-table):not(.team-table):not(.sales-table):not(.archive-source-summary) td{width:auto;min-width:0;padding:0;font-size:13px;overflow-wrap:anywhere}
  .work-table:not(.lead-queue):not(.run-table):not(.team-table):not(.sales-table):not(.archive-source-summary) td:first-child{grid-column:1/-1;font-weight:650;font-size:15px}
  .work-table:not(.lead-queue):not(.run-table):not(.team-table):not(.sales-table):not(.archive-source-summary) td:first-child::before{display:none}
  .team-table tr{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:7px 12px}
  .team-table td{width:auto;min-width:0;padding:0;font-size:13px;line-height:1.4}
  .team-table td::before{display:inline;font-size:11px;margin-right:5px}
  .team-table td:nth-child(1){grid-column:1;grid-row:1}
  .team-table td:nth-child(1)::before,.team-table td:nth-child(7)::before{display:none}
  .team-table td:nth-child(1) strong{font-size:16px}
  .team-table td:nth-child(1) small{font-size:11px;margin-top:3px}
  .team-table td:nth-child(5){grid-column:2;grid-row:1;text-align:right;font-size:18px;font-weight:650}
  .team-table td:nth-child(5)::before{display:block;font-weight:500;margin:0 0 3px}
  .team-table td:nth-child(2){grid-column:1/-1;grid-row:2;overflow-wrap:anywhere}
  .team-table td:nth-child(3){grid-column:1;grid-row:3}
  .team-table td:nth-child(4){grid-column:2;grid-row:3;text-align:right}
  .team-table td:nth-child(6){grid-column:1/-1;grid-row:4;margin-top:4px}
  .team-table td:nth-child(7){grid-column:1/-1;grid-row:5;margin-top:4px}
  .team-table .button-row{display:flex;gap:8px;flex-wrap:nowrap}
  .team-table .button-row button{width:auto;flex:1;min-height:44px;padding:8px}
  .sales-table tr{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px 12px}
  .sales-table td{width:auto;min-width:0;padding:0;font-size:17px;font-weight:650;font-variant-numeric:tabular-nums}
  .sales-table td:first-child{grid-column:1/-1;font-size:16px}
  .sales-table td:first-child::before{display:none}
  .sales-table td::before{font-size:11px;font-weight:500}
  .work-table.dispatch-table tr{grid-template-columns:repeat(3,minmax(0,1fr))}
  .work-table.dispatch-table td:not(:first-child){font-size:17px;font-weight:650}
  .work-table.dispatch-table td::before{font-size:11px;font-weight:500}
  .health-metrics{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin:10px 0}
  .health-metric{gap:3px}
  .health-metric strong{font-size:23px}
  .health-metric span{font-size:12px}
  .health-charts{gap:14px}
  .usage-graph{margin:12px 0}
  .usage-bars{gap:6px}
  .usage-day{min-width:30px}
  .bar-track{height:90px}
  .health-quota{margin:14px 0}
  .health-quota>div{font-size:12px;gap:8px;flex-wrap:wrap}
  .report-period{max-width:none;margin-bottom:14px}
  .review-summary{padding:14px;gap:5px}
  .review-body{grid-template-columns:minmax(0,1fr)}
  .review-body>.desktop-review-source{display:none}
  .mobile-review-source{display:block;margin-top:12px;padding:8px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
  .review-title{font-size:15px}
  .review-meta,.review-reason,.review-deadline{font-size:12px}
  .review-open{font-size:12px}
  .facts{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
  .facts .fact{min-width:0}
  .facts dt{font-size:11px}
  .facts dd{font-size:14px;overflow-wrap:anywhere}
  .lead-detail-panel .facts .fact:last-child{grid-column:1/-1}
  .guide-contents ol{columns:2;column-gap:18px}
  .guide-contents a{font-size:12px;min-height:44px;align-content:center}
  .guide-section p{font-size:14px;line-height:1.6}
  .guide-section h2{font-size:19px}
  .operating-roster{gap:0}
}

/* Keep the existing details-first DOM order on phones. */
@media(max-width:760px){
  .lead-queue .lead-next{font-weight:650;color:var(--ink)}
  .manual-actions button{min-height:44px}
}
.undo-assignment{margin-top:1rem}
.guide-section{scroll-margin-top:1rem}

@media(max-width:760px){
  .work-table.archive-source-summary tbody tr{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0;padding:10px 0;border:0;border-bottom:1px solid var(--line);border-radius:0;background:transparent}
  .work-table.archive-source-summary td{display:block;padding:0}
  .work-table.archive-source-summary td::before{display:none}
  .work-table.archive-source-summary td:last-child{font-variant-numeric:tabular-nums;font-weight:650}
}

.customer-match{border-top:1px solid var(--line);padding:16px 0}.customer-match:first-of-type{border-top:0}.customer-match form{display:grid;gap:12px;max-width:640px}.customer-match form>button{justify-self:start}.customer-match-panel a{overflow-wrap:anywhere}

#sent-dialog{width:min(560px,calc(100vw - 32px));max-height:calc(100dvh - 32px);overflow-y:auto;box-sizing:border-box}#sent-dialog label{display:flex;align-items:flex-start;gap:10px;line-height:1.5}#sent-dialog input[type="checkbox"]{flex:none;width:20px;height:20px;margin-top:2px}#sent-dialog .handoff-message{max-height:40dvh;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere}#sent-validation{color:var(--danger,#b42318)}

.page-head.lead-detail-head{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:start}
.lead-detail-title{min-width:0;overflow-wrap:anywhere}
.lead-detail-back{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:44px;padding:9px 15px;border:1px solid var(--line);border-radius:8px;background:var(--surface);color:var(--ink);font-weight:650;text-decoration:none;white-space:nowrap}
.lead-detail-back:hover{border-color:var(--blue);background:var(--blue-soft)}
@media(max-width:390px){.page-head.lead-detail-head{gap:12px}.lead-detail-back{padding:9px 12px;font-size:13px}}

/* Compact LeadFlow updates and review summary; preserve the existing portal theme. */
.mobile-menu-head .app-version{margin-left:auto;font-size:.72rem;color:var(--muted,#59636c);white-space:nowrap}
.leads-title-row{display:flex;align-items:baseline;justify-content:space-between;gap:1rem;width:100%;flex-wrap:wrap}
.leads-title-row h1{margin:0}.leads-title-row .workspace-freshness{margin:0;font-size:.75rem;line-height:1.35;max-width:65%}
[data-view=leads] .panel .filters{grid-template-columns:minmax(0,1fr) auto auto}.version-update{margin-bottom:.75rem}
@media(max-width:760px){.leads-title-row{flex-wrap:nowrap}.leads-title-row h1{font-size:1.75rem}.leads-title-row .workspace-freshness{max-width:58%;font-size:.7rem}[data-view=leads] .panel .filters:not(.mobile-open){display:grid;grid-template-columns:minmax(0,1fr) auto;gap:.7rem}[data-view=leads] .panel .filters>label:first-child{display:block;grid-column:1/-1}[data-view=leads] .panel .filters>label:not(:first-child),[data-view=leads] .panel .filters>button{display:block}}

@media(max-width:760px){[data-view=leads] .panel .filters>button{grid-column:auto;min-width:80px}}

.version-details{margin-top:1rem;color:var(--muted);font-size:.8rem}
.version-details summary{cursor:pointer;padding:.5rem 0}
.version-details p{margin:.5rem 0}.version-details code{display:block;overflow-wrap:anywhere;font-size:.75rem}

/* Completed mobile steps derive from saved ownership; desktop remains expanded. */
.mobile-workflow-step>summary{display:none}
@media(max-width:760px){
 .mobile-workflow-step{border:1px solid var(--line);border-radius:14px;background:var(--surface);scroll-margin-top:12px}
 .mobile-workflow-step>summary{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 15px;min-height:60px;cursor:pointer;list-style:none}
 .mobile-workflow-step>summary::-webkit-details-marker{display:none}
 .mobile-workflow-step>summary strong,.mobile-workflow-step>summary small{display:block}
 .mobile-workflow-step>summary small{margin-top:3px;color:var(--muted);font-size:13px}
 .mobile-workflow-step[open] .workflow-chevron{transform:rotate(180deg)}
 .mobile-workflow-step .panel{border:0;margin:0;box-shadow:none;background:transparent}
 .mobile-workflow-step>summary:focus-visible{outline:2px solid var(--accent);outline-offset:3px;border-radius:14px}
 .lead-detail-head:has(~.operating-detail .mobile-workflow-step) h1{font-size:26px;line-height:1.2}
}

/* Intake review uses the existing workspace totals; the badge has no animation. */
.review-badge{display:inline-flex;align-items:center;justify-content:center;min-width:20px;height:20px;padding:0 5px;border-radius:999px;background:#c92333;color:#fff;font-size:12px;font-weight:700;line-height:1;font-variant-numeric:tabular-nums;flex-shrink:0}
#nav .review-badge,#mobile-menu-content .review-badge{margin-left:auto}
.nav-icon{position:relative;display:inline-flex}
@media(max-width:760px){.mobile-tabbar .nav-icon .review-badge{position:absolute;top:-7px;left:14px;min-width:19px;height:19px;border:2px solid var(--surface);box-sizing:content-box;font-size:11px}}

/* Intake review: an obvious action button on every held enquiry, and previously reviewed enquiries kept compact. */
.review-card{border-left:4px solid var(--blue)}
.review-card:hover{box-shadow:0 1px 0 var(--line)}
.review-summary:focus-visible{outline:3px solid var(--blue);outline-offset:-3px}
.review-actions{grid-column:2;grid-row:3;justify-self:end;display:flex;align-items:center;gap:10px}
.review-actions>button{min-height:44px;padding:0 18px}
.review-open{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:0 20px;border-radius:10px;background:var(--blue);color:#fff;font-size:14px;font-weight:650;text-align:center}
.review-open::after,.review-card[open] .review-open::after{font-size:12px}
.review-open::after{content:'▾'}
.review-card[open] .review-open::after{content:'▴'}
.review-card:hover .review-open{filter:brightness(.92)}
.review-body .button-row .primary{min-height:44px;padding:0 22px;font-weight:650}
.review-exclude{border-top:0;margin-top:12px;padding-top:0}
.review-exclude>summary{display:inline-flex;align-items:center;min-height:44px;padding:0 18px;border:1px solid var(--line);border-radius:10px;font-size:14px;font-weight:600;color:var(--ink);cursor:pointer;list-style:none}
.review-exclude>summary::-webkit-details-marker{display:none}
.review-exclude>summary:hover,.review-exclude[open]>summary{border-color:var(--red);color:var(--red)}
.review-exclude[open]>summary{margin-bottom:12px}
.reviewed-panel{padding:0;overflow:hidden;margin-top:24px}
.reviewed-summary{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 20px;min-height:48px;cursor:pointer;list-style:none}
.reviewed-summary::-webkit-details-marker{display:none}
.reviewed-summary h2{margin:0;font-size:15px;font-weight:600}
.reviewed-toggle::after{content:'▸';display:inline-block;color:var(--muted);transition:transform .15s}
.reviewed-panel[open]>.reviewed-summary .reviewed-toggle::after{transform:rotate(90deg)}
.reviewed-list{list-style:none;margin:0;padding:0 20px 6px;border-top:1px solid var(--line)}
.reviewed-row{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:2px 12px;align-items:center;padding:8px 0;border-bottom:1px solid var(--line);font-size:13px}
.reviewed-row:last-child{border-bottom:0}
.reviewed-chip{font-size:11px;font-weight:650;padding:2px 9px;border-radius:999px;background:var(--blue-soft);color:var(--blue);white-space:nowrap}
.reviewed-chip.excluded{background:var(--surface-2);color:var(--muted)}
.reviewed-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.reviewed-date{color:var(--muted);font-variant-numeric:tabular-nums;white-space:nowrap}
.reviewed-link{grid-column:2;font-size:12px}
.reviewed-note{grid-column:2/-1;display:block;color:var(--muted);font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.reviewed-older>summary{padding:10px 20px;font-size:13px;color:var(--blue);cursor:pointer}
.reviewed-older .reviewed-list{border-top:0}
.original-source .message{white-space:pre-wrap;overflow-wrap:anywhere;max-height:28rem;overflow:auto}
.original-badges{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0 12px}
.original-archive{margin-top:20px;padding-top:16px;border-top:1px solid var(--line)}
@media(max-width:640px){.review-body .original-source{display:block}.review-body .button-row button{min-height:44px;flex:1}.original-source .message{max-height:22rem}.original-archive button{width:100%;min-height:44px}}
.session-ended{margin:0 0 16px;padding:12px 14px;border-radius:10px;background:var(--blue-soft);border:1px solid var(--blue)}
.session-ended strong{display:block;margin-bottom:4px}
.session-ended p{margin:0;font-size:14px;line-height:1.5}
@media(max-width:640px){
  .review-actions{grid-column:1;grid-row:auto;justify-self:stretch;width:100%}
  .review-actions>button,.review-actions>.review-open{flex:1;min-width:0;padding:0 12px}
  .review-body .button-row .primary,.review-exclude>summary{width:100%;justify-content:center}
  .reviewed-summary{padding:10px 16px}
  .reviewed-list{padding:0 16px 6px}
  .reviewed-row{grid-template-columns:auto minmax(0,1fr)}
  .reviewed-date{grid-column:2}
  .reviewed-note{display:none}
  .reviewed-older>summary{padding:10px 16px}
}
