/* Dispatcher workspace: surfaces, hierarchy and layouts for each workflow. */
@font-face { font-family:Manrope; src:url('/static/fonts/Manrope.ttf') format('truetype'); font-weight:200 800; font-style:normal; font-display:swap; }
:root {
  --bg:#f4f6f8; --surface:#fff; --surface-2:#f6f8fa; --surface-3:#e9eef1; --hover:#f3f8f7;
  --ink:#202b38; --muted:#647181; --faint:#73808e; --line:#e4e9ed; --line-strong:#cbd5dd;
  --accent:#087f72; --accent-ink:#fff; --accent-soft:#e7f4f0; --focus:0 0 0 3px #087f7233;
  --shadow:0 2px 4px #202b3803; --shadow-lg:0 16px 48px #182b3926; --radius:12px;
  --nav:#edf1f4; --heading-font:Manrope,system-ui,sans-serif;
}
:root[data-theme="dark"] {
  --bg:#141b22; --surface:#1b252e; --surface-2:#202c36; --surface-3:#2b3944; --hover:#243730;
  --ink:#e7edf1; --muted:#abb8c3; --faint:#92a4b1; --line:#2d3b46; --line-strong:#465a67;
  --accent:#6bd4bc; --accent-ink:#102b25; --accent-soft:#233d36; --focus:0 0 0 3px #6bd4bc40;
  --nav:#17212a; --shadow:0 2px 4px #0000000a;
}
@media(prefers-color-scheme:dark) {
  :root:not([data-theme="light"]) {
    --bg:#141b22; --surface:#1b252e; --surface-2:#202c36; --surface-3:#2b3944; --hover:#243730;
    --ink:#e7edf1; --muted:#abb8c3; --faint:#92a4b1; --line:#2d3b46; --line-strong:#465a67;
    --accent:#6bd4bc; --accent-ink:#102b25; --accent-soft:#233d36; --focus:0 0 0 3px #6bd4bc40;
    --nav:#17212a; --shadow:0 2px 4px #0000000a;
  }
}
body { font-family:Manrope,system-ui,sans-serif; font-size:14px; line-height:1.55; letter-spacing:0; }
h1,h2,h3 { font-family:var(--heading-font); }
h1 { font-weight:750; }
a { text-underline-offset:3px; }
input,select,textarea,button,.btn { font-family:inherit; }
input,select,textarea { min-height:40px; border-color:var(--line-strong); border-radius:8px; padding:9px 12px; }
textarea { line-height:1.65; }
input::placeholder,textarea::placeholder { color:var(--faint); }
/* Safari draws native selects and date fields at its own size: the panel draws them itself. */
select:not([multiple]):not([size]) { -webkit-appearance:none; appearance:none; height:40px; padding-right:34px; line-height:1.3; cursor:pointer;
  background-color:var(--surface); background-repeat:no-repeat; background-size:5px 5px;
  background-image:linear-gradient(45deg,transparent 50%,var(--muted) 50%),linear-gradient(135deg,var(--muted) 50%,transparent 50%);
  background-position:calc(100% - 18px) 52%,calc(100% - 13px) 52%; text-overflow:ellipsis; }
input[type=date] { -webkit-appearance:none; appearance:none; height:40px; display:inline-flex; align-items:center; line-height:1.3; background-color:var(--surface); color:var(--ink); }
input[type=date]::-webkit-date-and-time-value { text-align:left; margin:0; }
input[type=date]::-webkit-datetime-edit { padding:0; }
input[type=date]::-webkit-datetime-edit-fields-wrapper, input[type=date]::-webkit-datetime-edit-text, input[type=date]::-webkit-datetime-edit-day-field, input[type=date]::-webkit-datetime-edit-month-field, input[type=date]::-webkit-datetime-edit-year-field { font-size:inherit; font-family:inherit; }
input[type=date]::-webkit-calendar-picker-indicator { cursor:pointer; opacity:.6; margin-left:4px; }
input[type=date][value=""]:not(:focus) { color:var(--muted); }
button,.btn { min-height:40px; font-size:13px; font-weight:650; padding:9px 15px; border-radius:8px; }
button.small,.btn.small { min-height:32px; padding:5px 10px; }
button:hover,.btn:hover { filter:brightness(.98); }
button.small.primary { background:var(--accent-soft); color:var(--accent); }
:focus-visible { outline:2px solid var(--accent); outline-offset:3px; box-shadow:none; }
.page { max-width:1800px; padding:32px 36px 64px; }
.page-head { align-items:center; justify-content:space-between; gap:16px; margin:0 0 26px; }
.page-head h1 { font-size:28px; font-weight:750; letter-spacing:-.045em; line-height:1.25; }
.page-description { color:var(--muted); margin:8px 0 0; max-width:72ch; font-size:13px; line-height:1.65; }
.page-head > div { min-width:0; }
.top { height:68px; background:var(--surface); box-shadow:none; gap:16px; }
.brand .logo { width:34px; height:38px; border-radius:9px; box-shadow:none; }
.brand .logo .icon { width:20px; height:20px; }
.brand .name { display:flex; flex-direction:column; gap:2px; min-width:0; line-height:1.4; }
.brand .name b { font-size:15px; font-weight:750; letter-spacing:-.02em; }
.brand .name small { font-size:11px; font-weight:450; color:var(--muted); overflow:hidden; text-overflow:ellipsis; }
.avatar { width:34px; height:34px; border-radius:11px; }
.who { gap:4px; }
.who b { font-weight:650; }
.live { padding:5px 9px; border:1px solid var(--line); border-radius:7px; }
.menu-pop { padding:10px; min-width:280px; }
.panel,.form-card,.table-wrap,.tile,.filters { box-shadow:none; }
.panel { padding:24px; }
.panel-title { text-transform:none; color:var(--ink); font-size:16px; letter-spacing:-.015em; font-weight:700; }
.form-card { padding:26px; gap:10px; }
.form-card label { color:var(--ink); gap:7px; font-weight:550; }
.form-card .hint,.hint { color:var(--muted); line-height:1.6; }
.form-card h2 { font-size:18px; letter-spacing:-.025em; }
.form-card h2 .icon { color:var(--accent); margin-right:5px; }
.form-card .narrow { max-width:100%; }
.section-title { font-size:18px; letter-spacing:-.025em; margin:30px 0 16px; scroll-margin-top:90px; }
.section-heading { display:flex; align-items:center; gap:12px; margin:24px 0 14px; }
.section-heading h2 { font-size:17px; margin:0; }
.section-heading > a { margin-left:auto; }
.section-nav { display:flex; gap:6px; border:0; border-bottom:1px solid var(--line); background:none; padding:0 0 12px; margin:0 0 24px; overflow-x:auto; }
.section-nav a { white-space:nowrap; text-decoration:none; color:var(--muted); border-radius:6px; padding:7px 12px; font-size:13px; }
.section-nav a:hover,.section-nav a:focus-visible { background:var(--accent-soft); color:var(--accent); }
.section-nav a span { padding-left:5px; color:var(--faint); font-variant-numeric:tabular-nums; }
.crumb { margin-bottom:18px; }
.notice { border-radius:10px; padding:12px 16px; }
.filters { border-radius:12px; padding:18px; margin-bottom:20px; }
.filters .line { gap:12px; align-items:end; }
.filters .search { flex:1 1 260px; }
.filters .search input { width:100%; min-width:0; }
.filters .field { font-size:11px; font-weight:600; gap:6px; }
.filters .line > select { max-width:280px; flex:0 1 auto; min-width:150px; }
.filter-details { padding-top:14px; margin-top:14px; border-top:1px solid var(--line); }
.filter-details summary { display:flex; align-items:center; gap:8px; cursor:pointer; color:var(--muted); font-size:12px; font-weight:650; list-style:none; }
.filter-details summary::after { content:'+'; margin-left:auto; font-size:18px; }
.filter-details[open] summary::after { content:'−'; }
.filter-details[open] summary { margin-bottom:16px; }
.chips { gap:7px; margin-top:10px; }
.chip { padding:6px 10px; border-radius:6px; font-size:12px; }
.chips-label { min-width:72px; font-size:11px; }
.table-wrap { border-radius:12px; }
table.grid thead th { background:var(--surface-2); text-transform:none; letter-spacing:0; font-weight:600; font-size:11px; padding:13px 16px; }
table.grid td { padding:16px; font-size:13px; }
table.grid td a { text-decoration:none; }
table.grid td a:hover { text-decoration:underline; }
table.grid td .num,table.grid td.num { font-variant-numeric:tabular-nums; }
.result-line { font-size:12px; margin:0 0 12px 2px; gap:6px; }
.result-line strong { color:var(--ink); }
.badge { font-size:11px; padding:6px 9px; font-weight:600; }
.badge.lg { padding:7px 10px; font-size:12px; }
.person-cell,.address-cell,.direction-cell { display:flex; align-items:center; gap:10px; }
.address-cell > .icon { color:var(--muted); width:18px; height:18px; }
.person-cell { min-width:170px; }
.person-cell .avatar { width:30px; height:30px; border-radius:50%; }
.direction-cell .icon { color:var(--accent); width:14px; height:14px; }
.empty-state { display:flex; align-items:center; flex-direction:column; padding:30px 12px; gap:10px; max-width:440px; margin:auto; white-space:normal; }
.empty-state > .icon { width:28px; height:28px; color:var(--faint); margin-bottom:5px; }
.empty-state strong { color:var(--ink); font-size:15px; }
.empty-state p { margin:0; color:var(--muted); font-size:13px; }
.pager { justify-content:flex-end; margin-top:18px; }
.pager a.on { background:var(--accent-soft); color:var(--accent); }
/* Queue: compact totals leave space for addresses and service state. */
.board-page { max-width:none; }
.board-heading { align-items:center; }
.board-heading > div { display:block; }
.board-bar { padding:10px; box-shadow:none; border-radius:10px; }
.board-bar .search input { background:var(--surface-2); }
.board-summary { gap:0; padding:16px 0; background:var(--surface); border:1px solid var(--line); border-radius:10px; margin-bottom:20px; }
.summary-item { padding:0 24px; border:0; border-right:1px solid var(--line); background:none; border-radius:0; box-shadow:none; gap:12px; }
.summary-item:last-child { border:0; }
.summary-icon { width:24px; height:24px; background:none !important; border-radius:0; color:var(--muted); }
.summary-item strong { font-size:26px; font-weight:750; }
.summary-label { font-size:11px; }
.board { grid-template-columns:repeat(6,minmax(238px,1fr)); gap:14px; padding-bottom:16px; scrollbar-width:thin; }
.column { background:transparent; border:0; border-radius:0; max-height:calc(100dvh - 350px); }
.column h2 { padding:8px 6px 14px; justify-content:initial; font-size:12px; }
.column h2::before { content:''; width:7px; height:7px; border-radius:3px; background:var(--c); flex:none; }
.column h2 .count { margin-left:auto; background:var(--surface-3); border-radius:5px; }
.drop { padding:2px 2px 8px; gap:12px; }
.card-item { border-radius:10px; padding:14px; border-left-width:3px; gap:10px; box-shadow:0 2px 3px #202b3804; }
.card-item:hover { transform:none; border-color:var(--line-strong); box-shadow:0 3px 10px #202b3808; }
.card-item header { font-size:11px; gap:6px; }
.card-item header .age { font-size:10px; }
.card-item header .prio-dot { font-size:10px; }
.card-item .addr { font-weight:700; font-size:13px; line-height:1.6; }
.card-item .desc { font-size:12px; line-height:1.6; }
.card-item footer { border-top:1px solid var(--line); padding-top:9px; }
.card-item .actions { display:flex; gap:5px; }
.card-item .actions button { font-size:11px; }
.card-item .tags:empty { display:none; }
.alarm-bar { animation:none; border-radius:8px; font-size:13px; padding:12px 16px; }
/* Request intake and detail. */
.new-request-page { max-width:1360px; }
.intake-form .form-grid { max-width:none; gap:24px; }
.intake-form .panel { gap:10px; padding:28px; }
.intake-form .panel > label:not(.trap-toggle) { color:var(--ink); font-weight:550; }
.intake-form .panel-title { margin-bottom:16px; }
.step-number { width:26px; height:26px; display:inline-grid; place-items:center; border-radius:50%; background:var(--accent-soft); color:var(--accent); font-size:12px; margin-right:5px; }
.intake-footer { max-width:none; margin-top:24px; padding:18px 22px; background:var(--surface); border:1px solid var(--line); border-radius:10px; }
.trap-toggle { margin-bottom:10px; border-style:dashed; }
.card-head { gap:10px; margin-bottom:24px; }
.card-head h1 { font-size:30px; letter-spacing:-.04em; }
.card-head .prio-bar { width:4px; }
.request-page .card-page { grid-template-columns:minmax(0,1fr) 300px; gap:28px; }
.request-page .side { top:90px; }
.request-page .side .panel { padding:22px; }
.request-overview { border-top:3px solid var(--accent); }
dl.facts { gap:14px 22px; grid-template-columns:160px minmax(0,1fr); font-size:13px; }
.request-overview dl.facts dd:first-of-type { font-size:17px; line-height:1.5; }
.timers { gap:12px; }
.timer { padding:18px; border-left-width:3px; }
.timer .t-value { font-size:15px; margin:8px 0 4px; }
.timeline { padding:8px 0; }
.timeline li { padding-bottom:24px; font-size:13px; }
.timeline li .when { display:block; margin-bottom:6px; font-size:11px; }
.inline-form { flex-direction:column; gap:10px; padding-top:20px; border-top:1px solid var(--line); }
.inline-form textarea { width:100%; min-height:94px; }
.inline-form button { align-self:flex-end; }
.files { padding:18px; border:1px dashed var(--line-strong); border-radius:10px; }
/* Conversation review keeps the recording beside the transcript. */
.call-workspace { display:grid; grid-template-columns:minmax(0,1.8fr) minmax(280px,1fr); gap:24px; align-items:start; }
.call-main,.call-context { min-width:0; }
.call-context { position:sticky; top:90px; }
.call-context dl.facts { grid-template-columns:1fr; gap:4px; }
.call-context dl.facts dd { margin-bottom:12px; }
.call-context dl.facts dd:last-child { margin-bottom:0; }
.call-context .panel + .panel { margin-top:18px; }
.call-summary { margin:0; font-size:14px; line-height:1.8; }
.call-main .player { max-width:none; margin:0 0 20px; padding:18px; top:80px; border-radius:12px; }
.player-heading { display:flex; align-items:center; gap:9px; font-weight:650; margin:0 0 10px; font-size:13px; }
.transcript { background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:24px; }
.transcript h2 { margin:0 0 24px; font-size:17px; }
.turns { max-width:none; margin:0; gap:18px; }
.turns li { padding:14px 16px; max-width:90%; border-radius:12px; line-height:1.7; font-size:13px; }
.turns .meta { font-size:10px; line-height:1.6; margin-bottom:5px; }
.turns .tool { overflow-wrap:anywhere; }
.technical-details { margin-top:20px; padding:18px 22px; border:1px solid var(--line); border-radius:10px; background:var(--surface); }
.technical-details summary { cursor:pointer; font-weight:650; font-size:13px; }
.technical-details[open] summary { margin-bottom:20px; }
.technical-details dl.facts { grid-template-columns:150px minmax(0,1fr); }
/* Property directory and guided tools. */
.houses-page .toolbar { padding:14px; border:1px solid var(--line); background:var(--surface); border-radius:10px; gap:10px; }
.houses-page .toolbar .search { flex:1; }
.houses-page .toolbar .search input { width:100%; min-width:220px; }
.house-page { max-width:1600px; }
.house-form { max-width:none; }
.house-head { margin-top:0; }
.house-title h1 { font-size:30px; }
.house-eyebrow { text-transform:none; color:var(--accent); font-weight:650; }
.house-form .panel { border-radius:12px; padding:26px; }
.house-form .panel-title { font-size:17px; }
.house-form .house-description { font-size:12px; }
.house-nav { box-shadow:none; }
.house-foot { box-shadow:0 4px 20px #202b380d; }
.tool-page { max-width:1160px; }
.tool-layout { display:grid; grid-template-columns:minmax(0,1fr) 280px; gap:24px; }
.tool-layout > * { min-width:0; }
.tool-layout .form-card { max-width:none; }
.tool-help { padding:22px; color:var(--muted); font-size:13px; line-height:1.8; }
.tool-help h2 { font-size:14px; color:var(--ink); margin:0 0 10px; }
.tool-help a { display:inline-flex; align-items:center; gap:6px; margin:8px 0; }
.import-steps { display:flex; list-style:none; padding:0; gap:24px; margin:0 0 24px; color:var(--muted); font-size:12px; }
.import-steps li { display:flex; align-items:center; gap:8px; }
.import-steps .current { color:var(--accent); font-weight:700; }
.upload-zone { display:flex; flex-direction:column; align-items:center; text-align:center; gap:14px; padding:36px 20px; border:1px dashed var(--line-strong); border-radius:12px; background:var(--surface-2); }
.upload-zone > .icon { width:30px; height:30px; color:var(--accent); }
.upload-zone input[type=file] { width:100%; min-width:0; border:0; background:none; padding:0; font-size:12px; }
input[type=file]::file-selector-button { border:1px solid var(--line-strong); background:var(--surface); color:var(--ink); padding:10px 14px; border-radius:6px; margin-right:12px; cursor:pointer; }
.import-result { margin-top:28px; }
.import-counts { display:flex; gap:24px; flex-wrap:wrap; padding:18px 0; font-size:12px; color:var(--muted); }
.import-counts strong { font-size:22px; color:var(--ink); display:block; }
.search-test-form { display:flex; flex-direction:column; gap:16px; }
.search-test-form .search input { width:100%; min-width:0; }
.search-test-form button { align-self:flex-start; }
.search-candidates { list-style:none; padding:0; margin:20px 0 0; }
.search-candidates li { display:flex; align-items:center; gap:12px; padding:16px 0; border-top:1px solid var(--line); }
.search-candidates li a { flex:1; font-weight:650; text-decoration:none; }
.search-candidates .score { padding:5px 8px; background:var(--accent-soft); color:var(--accent); border-radius:6px; font-size:12px; }
/* Reports: hierarchy between service, quality and cost. */
.report-section { margin-top:32px; }
.report-section > h2 { margin:0 0 16px; font-size:20px; letter-spacing:-.03em; }
.reports-page .tiles { grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin:0 0 16px; }
.reports-page .tile { padding:22px; border-radius:10px; }
.reports-page .tile .value { font-size:30px; font-weight:750; margin-bottom:7px; }
.reports-page .tile .label { line-height:1.6; }
.reports-page .tile:first-child { background:var(--accent-soft); border-color:transparent; }
.reports-page .tile:first-child .value { color:var(--accent); }
.reports-page .sla-metrics { grid-template-columns:repeat(3,minmax(0,1fr)); }
.reports-page .sla-metrics .tile { background:var(--surface); border:1px solid var(--line); }
.reports-page .sla-metrics .value { font-size:22px; color:var(--ink); }
.chart-grid { display:grid; grid-template-columns:1fr 1fr; gap:20px; margin:24px 0; }
.chart-panel { padding:24px; border:1px solid var(--line); border-radius:12px; background:var(--surface); min-width:0; }
.chart-panel h3 { margin:0 0 22px; font-size:14px; }
table.bars { max-width:none; font-size:12px; }
table.bars th { padding:9px 14px 9px 0; }
.bar { height:8px; border-radius:3px; min-width:0; }
.report-costs { max-width:none !important; }
.report-costs .grid { min-width:520px; }
/* Settings are independent workspaces under a stable local navigation. */
.settings-page { max-width:1540px; }
.settings-page > .tabs { margin:-12px 0 30px; gap:18px; }
.tabs a { font-size:12px; padding:12px 0; margin:0; }
.tabs a.on { color:var(--accent); font-weight:750; }
.settings-page .two { gap:24px; align-items:stretch; }
.settings-page .two > .form-card { max-width:none; }
.invite-grid { margin-top:30px; }
.invite-grid .form-card { position:relative; padding-top:28px; }
.settings-users .grid { min-width:820px; }
.settings-users .grid select { max-width:190px; font-size:12px; }
.settings-users .cell-actions { min-width:130px; }
.district-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); padding:16px 0; margin:0 0 16px; background:var(--surface); border:1px solid var(--line); border-radius:10px; }
.district-summary > div { display:flex; flex-direction:column; gap:3px; padding:0 24px; border-right:1px solid var(--line); min-width:0; }
.district-summary > div:last-child { border:0; }
.district-summary strong { font-size:26px; font-weight:750; line-height:1.15; letter-spacing:-.04em; font-variant-numeric:tabular-nums; }
.district-summary strong small { font-size:15px; font-weight:600; color:var(--muted); letter-spacing:0; }
.district-summary .warn strong { color:var(--warn); }
.coverage { display:block; height:6px; margin-top:6px; max-width:220px; border-radius:3px; background:var(--surface-3); overflow:hidden; }
.coverage span { display:block; height:100%; background:var(--accent); border-radius:3px; }
.district-gap { align-items:center; flex-wrap:wrap; }
.district-gap > a { display:inline-flex; align-items:center; gap:6px; font-weight:650; white-space:nowrap; }
.district-cards { grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); gap:20px; margin-top:20px; }
.district-card { gap:14px; }
.district-card.editing { border-color:var(--accent); box-shadow:var(--focus); }
.district-head { display:flex; align-items:flex-start; gap:12px; }
.district-head h2 { flex:1; min-width:0; display:flex; align-items:center; gap:4px; margin:0; font-size:17px; line-height:1.35; overflow-wrap:anywhere; }
.district-head h2 .icon { flex:none; }
.house-count { display:inline-flex; align-items:center; gap:6px; flex:none; padding:5px 10px; border-radius:7px; background:var(--surface-2); color:var(--ink); font-size:13px; font-weight:700; font-variant-numeric:tabular-nums; text-decoration:none; }
.house-count:hover { background:var(--accent-soft); color:var(--accent); }
.house-count .icon { width:15px; height:15px; color:var(--muted); }
.district-view, .district-edit { display:flex; flex-direction:column; gap:12px; flex:1; }
.district-master { display:flex; align-items:center; gap:12px; padding:12px; border-radius:10px; background:var(--surface-2); }
.district-master > span:nth-child(2) { display:flex; flex-direction:column; gap:2px; flex:1; min-width:0; }
.district-master .avatar { flex:none; width:36px; height:36px; border-radius:50%; }
.district-master.missing { background:var(--warn-soft); }
.district-master.missing strong { color:var(--warn); }
.district-master.missing .avatar { background:transparent; color:var(--warn); }
.district-master.missing .avatar .icon { width:20px; height:20px; }
.district-actions { display:flex; align-items:center; gap:12px; margin-top:auto; padding-top:12px; border-top:1px solid var(--line); }
.district-actions > a { display:inline-flex; align-items:center; gap:6px; font-size:13px; font-weight:650; text-decoration:none; }
.district-actions > a .icon { width:15px; height:15px; }
.district-actions button { margin-left:auto; }
.district-edit form:first-child { display:flex; flex-direction:column; gap:10px; }
.district-edit .row { display:flex; gap:8px; justify-content:flex-end; margin-top:4px; }
.district-edit .row button { margin:0; }
.district-delete { padding-top:12px; border-top:1px solid var(--line); }
.district-delete button { margin:0; }
.create-card { border-style:dashed; background:transparent; }
.create-card h2 { font-size:17px; margin:0; }
.district-hint { display:flex; align-items:center; gap:6px; flex-wrap:wrap; margin-top:16px; }
.filter-chip { display:inline-flex; align-items:center; gap:6px; padding:4px 4px 4px 10px; border-radius:7px; background:var(--accent-soft); color:var(--accent); font-size:12px; font-weight:650; white-space:nowrap; }
.filter-chip .icon { width:14px; height:14px; }
.filter-chip a { display:inline-grid; place-items:center; width:26px; height:26px; border-radius:5px; color:inherit; text-decoration:none; font-size:16px; line-height:1; }
.filter-chip a:hover { background:var(--surface); }
.settings-categories .cards { gap:18px; }
.settings-categories .cards .form-card { padding:22px; }
.sla-table input { max-width:120px; font-variant-numeric:tabular-nums; }
.sla-table table { min-width:760px; }
.settings-audit .grid { table-layout:fixed; min-width:700px; }
.settings-audit th:first-child { width:155px; }
.settings-audit th:nth-child(2) { width:150px; }
.settings-audit th:nth-child(3) { width:210px; }
.audit-change summary { cursor:pointer; color:var(--accent); font-weight:600; }
.audit-change details[open] summary { margin-bottom:10px; }
.audit-change code { display:block; padding:8px; white-space:pre-wrap; overflow-wrap:anywhere; }
.voice-form { max-width:100%; display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:24px; align-items:start; }
.voice-form section { max-width:none; min-width:0; scroll-margin-top:90px; }
#voice-phrases { grid-column:2; grid-row:1 / span 3; }
.voice-form .section-head p { font-size:12px; line-height:1.75; }
.voice-form .phrase { padding-top:16px; border-top:1px solid var(--line); gap:8px; }
.voice-form .phrase-head { align-items:start; }
.voice-form .phrase-head label { font-size:12px; }
.voice-form .preview { padding:16px; gap:12px; }
.voice-form .preview-label { flex-basis:100%; }
.voice-form .preview select { min-width:0; width:100%; }
.voice-form .save-bar { grid-column:1 / -1; margin:0; }
/* Service administration. */
.costs-page .tiles { grid-template-columns:1fr 2fr; max-width:780px; gap:20px; margin:24px 0; }
.costs-page .tile { padding:24px; }
.costs-page .tile .value { font-size:34px; font-weight:750; }
.costs-page .table-wrap { max-height:65vh; }
.costs-page table.grid th { font-size:10px; padding:12px; }
.costs-page table.grid td { padding:14px 12px; font-size:12px; }
.phrases-page { max-width:1320px; }
.phrases-voice { max-width:none; }
.phrases-page .phrase-card { max-width:none; padding:24px; }
.phrase-card-head h3 { font-size:16px; }
.phrase-card .wording { padding:14px; border:1px solid var(--line); border-radius:10px; background:var(--surface-2); }
.phrase-card .wording textarea { background:var(--surface); }
.phrase-card .wording-actions { flex-basis:100%; justify-content:flex-end; }
.phrase-card .phrase-save { padding-top:16px; border-top:1px solid var(--line); }
.phrase-context { padding:12px 0; }
.phrases-help { padding:14px 0 4px; }
.phrases-help summary { cursor:pointer; font-weight:650; font-size:13px; color:var(--muted); }
.phrases-help[open] summary { margin-bottom:14px; }
@media(min-width:1200px) {
  body { padding-left:208px; }
  .brand { width:208px; height:86px; padding:0 20px; background:var(--nav); border-right:0; }
  .top nav.main { width:208px; top:86px; padding:14px 12px; gap:5px; background:var(--nav); border-right:0; }
  .top nav.main a { height:44px; font-size:12px; padding:0 14px; border-radius:8px; }
  .top nav.main a.on { background:var(--surface); color:var(--accent); box-shadow:0 1px 3px #202b3808; font-weight:750; }
}
@media(min-width:761px) and (max-width:1199px) {
  .page { padding:26px 24px 48px; }
  .brand .name { display:none; }
  .summary-item { padding:0 14px; }
  .summary-icon { display:none; }
  .request-page .card-page { display:grid; grid-template-columns:minmax(0,1fr) 260px; gap:18px; }
  .request-page .side { order:0; position:static; }
  .call-workspace { grid-template-columns:minmax(0,1.5fr) minmax(250px,1fr); gap:18px; }
  .voice-form { grid-template-columns:1fr; }
  #voice-phrases { grid-column:auto; grid-row:auto; }
}
@media(max-width:760px) {
  body { padding-left:0; }
  .top { height:60px; padding:0 14px; gap:10px; }
  .top .brand .name { display:none; }
  .top nav.main { background:var(--surface); box-shadow:0 -1px 12px #202b3808; }
  .top nav.main a.on { background:var(--accent-soft); color:var(--accent); }
  .live { padding:5px; border:0; }
  .page { padding:24px 16px calc(96px + env(safe-area-inset-bottom)); }
  .page-head { margin-bottom:22px; align-items:flex-start; gap:14px; }
  .page-head h1 { font-size:25px; }
  .page-description { font-size:12px; margin-top:7px; }
  .page-head > .btn { font-size:12px; }
  input,select,textarea { font-size:16px; }
  .panel,.form-card { padding:20px; }
  .section-nav { gap:0; padding-bottom:10px; }
  .section-nav a { font-size:12px; padding:8px 10px; }
  .filters { padding:14px; }
  .filters .line { gap:10px; }
  .filters .line > select { width:100%; max-width:none; flex:1 1 100%; }
  .filters .line > .field { flex:1 1 100px; }
  .filter-details summary { font-size:11px; }
  .chips-label { flex-basis:100%; }
  .chip { min-height:36px; }
  .board-heading { flex-direction:row; }
  .board-heading > .btn { padding:8px; }
  .board-summary { grid-template-columns:1fr 1fr; padding:0; gap:0; }
  .summary-item { padding:14px 16px; border:0; gap:8px; }
  .summary-item:nth-child(-n+2) { border-bottom:1px solid var(--line); }
  .summary-item:nth-child(odd) { border-right:1px solid var(--line); }
  .summary-item strong { font-size:23px; }
  .summary-icon { display:none; }
  .summary-label { font-size:10px; }
  .board { grid-template-columns:repeat(6,minmax(82vw,1fr)); }
  .column { max-height:none; }
  .board-bar .search { flex-basis:100%; }
  .board-bar .toggle { font-size:12px; min-height:36px; }
  .card-item header .age { font-size:11px; }
  .card-item .addr { font-size:14px; }
  .card-item .actions button { min-height:38px; }
  .intake-form .form-grid { grid-template-columns:1fr; gap:18px; }
  .intake-form .panel { padding:20px; }
  .intake-footer { flex-wrap:wrap; padding:16px; }
  .intake-footer > .muted { flex-basis:100%; }
  .request-page .card-page { display:flex; flex-direction:column; gap:20px; }
  .request-page .side { position:static; order:-1; width:100%; }
  .request-page .main { width:100%; min-width:0; }
  .card-head h1 { font-size:26px; }
  dl.facts { grid-template-columns:1fr; gap:4px; }
  dl.facts dd { margin-bottom:12px; }
  .timers { grid-template-columns:1fr; }
  .timer { display:grid; grid-template-columns:1fr 1fr; gap:6px; padding:14px 16px; }
  .timer .t-value { margin:0; text-align:right; }
  .timer > .muted { grid-column:1 / -1; }
  .call-workspace { display:flex; flex-direction:column; gap:20px; }
  .call-main,.call-context { width:100%; }
  .call-context { position:static; order:-1; }
  .call-context .call-facts { display:grid; grid-template-columns:1fr 1fr; }
  .call-context .call-facts dt,.call-context .call-facts dd { grid-column:auto; }
  .call-main .player { top:70px; }
  .transcript { padding:18px; }
  .turns li { max-width:95%; }
  .technical-details dl.facts { grid-template-columns:1fr; }
  .houses-page .toolbar { padding:12px; }
  .houses-page .toolbar .search { flex-basis:100%; }
  .houses-page .toolbar .search input { min-width:0; }
  .houses-page .toolbar > .btn { flex:1; font-size:11px; }
  .house-title h1 { font-size:25px; }
  .house-form .panel { padding:20px; }
  .tool-layout { grid-template-columns:1fr; gap:16px; }
  .tool-help { padding:8px; }
  .import-steps { gap:12px; font-size:10px; }
  .import-steps .step-number { width:22px; height:22px; margin:0; }
  .upload-zone { padding:26px 14px; }
  .reports-page .tiles { grid-template-columns:1fr 1fr; gap:10px; }
  .reports-page .tile { padding:16px; }
  .reports-page .tile .value { font-size:24px; }
  .reports-page .sla-metrics { grid-template-columns:1fr; }
  .reports-page .sla-metrics .tile { display:flex; align-items:center; gap:16px; }
  .reports-page .sla-metrics .value { margin:0; min-width:70px; font-size:22px; }
  .chart-grid { grid-template-columns:1fr; gap:16px; }
  .chart-panel { padding:20px; }
  .settings-page > .tabs { gap:18px; margin:-8px 0 24px; }
  .settings-page .two { flex-direction:column; gap:18px; }
  .settings-page .two > * { flex:auto; width:100%; min-width:0; }
  .district-cards,.settings-categories .cards { grid-template-columns:1fr; }
  .district-summary { padding:12px 0; }
  .district-summary > div { padding:0 12px; }
  .district-summary strong { font-size:21px; }
  .district-summary strong small { font-size:13px; }
  .district-summary .summary-label { font-size:10px; }
  .district-gap > a { flex-basis:100%; padding-left:24px; }
  .page-head > .btn[href="#new-district"] { padding:8px 12px; }
  .district-edit .row button { flex:1; }
  .voice-form { display:flex; flex-direction:column; gap:18px; }
  .voice-form > * { width:100%; }
  .voice-form .save-bar { bottom:calc(72px + env(safe-area-inset-bottom)); }
  .voice-form .phrase-head { flex-wrap:wrap; gap:8px; }
  .voice-form .preview .play { min-width:100%; }
  .costs-page .tiles { grid-template-columns:1fr 1fr; gap:12px; }
  .costs-page .tile { padding:16px; }
  .costs-page .tile .value { font-size:24px; }
  .phrases-page .phrase-card { padding:18px; }
  .phrase-card .wording { padding:10px; }
  .phrase-card .wording-actions { justify-content:flex-start; }
  .phrase-card textarea { flex-basis:100%; }
}
.dialog { padding:28px; border:1px solid var(--line); border-radius:16px; width:min(460px,100%); gap:12px; }
.dialog h3 { font-size:20px; letter-spacing:-.035em; margin-bottom:8px; }
.dialog .row { margin-top:16px; padding-top:16px; border-top:1px solid var(--line); }
.dialog .reasons { display:flex; flex-direction:column; gap:8px; }
.dialog .reasons label { display:flex; gap:10px; align-items:center; padding:12px; border:1px solid var(--line); border-radius:8px; cursor:pointer; }
.dialog .reasons label:has(input:checked) { background:var(--accent-soft); border-color:var(--accent); color:var(--accent); }
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { scroll-behavior:auto !important; animation:none !important; transition:none !important; } }
.request-page .card-page:has(> .side:not(:has(*))) { grid-template-columns:minmax(0,1fr); max-width:1200px; }
.reports-page .sla-metrics .tile .value { color:var(--ink); }
.turn-tool { margin-top:8px; }
.turn-tool summary { cursor:pointer; color:var(--muted); font-size:11px; }
.voice-form input,.voice-form textarea,.voice-form select { scroll-margin-block:100px 180px; }
.report-section { scroll-margin-top:90px; }
@media(max-width:760px) {
  .call-context { order:0; }
  .table-wrap:has(> .mobile-records) { border:0; background:transparent; overflow:visible; }
  .mobile-records { display:block; background:transparent !important; }
  .mobile-records thead { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
  .mobile-records tbody { display:grid; gap:12px; }
  .mobile-records tbody tr { display:grid; grid-template-columns:1fr 1fr; padding:16px; border:1px solid var(--line); border-radius:10px; background:var(--surface); gap:12px 16px; }
  .mobile-records tbody tr.trapped { border-color:var(--danger); }
  table.grid.mobile-records td { display:block; padding:0; border:0 !important; font-size:12px; white-space:normal; text-align:left; overflow-wrap:anywhere; }
  .mobile-records td[data-label]::before { content:attr(data-label); display:block; color:var(--muted); font-size:10px; margin-bottom:4px; }
  .mobile-records td:first-child { grid-column:1 / -1; font-size:14px; font-weight:650; padding-bottom:10px; border-bottom:1px solid var(--line) !important; }
  .mobile-records td:first-child::before { display:none; }
  .houses-table td:nth-child(4) { grid-column:1 / -1; }
  .mobile-records td.empty-row { grid-column:1 / -1; }
  .mobile-records .empty-state { padding:16px 0; }
}
/* Filters: one period field instead of two floating date labels. */
.filters label.field, .filters .field { align-items:stretch; text-align:left; }
.filters .period { flex:0 1 auto; }
.period-inputs { position:relative; display:flex; align-items:center; gap:6px; color:var(--faint); }
.period-inputs > .icon { position:absolute; left:11px; width:15px; height:15px; color:var(--muted); pointer-events:none; }
.period-inputs input { width:136px; font-size:13px; }
.period-inputs input:first-of-type { padding-left:34px; width:158px; }
.filters .search { flex:1 1 240px; min-width:min(240px,100%); }
.filter-details summary .count { margin-left:4px; background:var(--accent-soft); color:var(--accent); }
/* Registry: the address and what broke are read together; flags only when there are any. */
.registry-table .req-id a { display:block; }
.req-meta { display:flex; align-items:center; gap:4px; margin-top:4px; font-size:11px; }
.req-meta .prio-dot { font-size:11px; }
.req-address { min-width:260px; max-width:520px; }
.req-place { display:block; font-weight:650; color:var(--ink); }
.req-desc { display:-webkit-box; -webkit-line-clamp:1; -webkit-box-orient:vertical; overflow:hidden; margin-top:3px; color:var(--muted); font-size:12px; }
.registry-table tr.trapped td:first-child { box-shadow:inset 3px 0 var(--danger); }
.registry-table td.req-master { white-space:nowrap; }
.registry-table .tag .icon { width:11px; height:11px; }
/* Request card: when and how it came in sits under the number; people on the side. */
.request-page .card-head { margin-bottom:6px; }
.card-meta { display:flex; align-items:center; flex-wrap:wrap; gap:6px; margin:0 0 22px 14px; color:var(--muted); font-size:12px; }
.card-meta .icon { width:14px; height:14px; color:var(--faint); }
.card-meta > span { color:var(--line-strong); }
.side .people { display:flex; flex-direction:column; gap:12px; }
.side .people .panel-title { margin:0; }
.person { display:flex; align-items:center; gap:10px; }
.person > span:last-child { display:flex; flex-direction:column; gap:1px; min-width:0; }
.person .avatar { width:34px; height:34px; border-radius:50%; }
.person.missing .avatar { background:var(--surface-2); color:var(--faint); }
.person.missing strong { color:var(--muted); font-weight:550; }
/* Call journal: the summary line and the request address make a row readable without opening it. */
.call-when a { display:block; }
.call-when .direction-cell { margin-top:4px; gap:5px; font-size:11px; color:var(--muted); }
.call-when .direction-cell.duty .icon { color:var(--warn); }
.call-outcome { min-width:240px; max-width:520px; }
.call-summary-line { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; margin:6px 0 0; color:var(--muted); font-size:12px; line-height:1.55; }
.call-request a { display:block; }
.call-request .small { display:block; margin-top:3px; }
.call-lang { display:block; margin-top:3px; }
.calls-table tr.flagged td:first-child { box-shadow:inset 3px 0 var(--warn); }
@media(max-width:760px) {
  .period-inputs input, .period-inputs input:first-of-type { width:auto; flex:1; min-width:0; font-size:16px; }
  .filters .line > .period { flex:1 1 100%; }
  .mobile-records tbody tr.trapped { background:var(--danger-soft) !important; }
  .mobile-records tr.trapped td { background:transparent !important; }
  .registry-table tr.trapped td:first-child, .calls-table tr.flagged td:first-child { box-shadow:none; }
  .registry-table td.req-id { display:flex !important; align-items:center; justify-content:space-between; gap:8px; }
  .registry-table td.req-id a { font-size:15px; }
  .registry-table .req-meta { margin:0; }
  .registry-table td.req-address, .registry-table td.req-flags { grid-column:1 / -1; max-width:none; min-width:0; }
  .registry-table td.req-address::before, .registry-table td.req-flags::before { display:none !important; }
  .req-place { font-size:14px; }
  .req-desc { -webkit-line-clamp:2; }
  .registry-table td.req-status::before { display:none !important; }
  .registry-table td.req-status { grid-column:1 / -1; }
  .mobile-records td.no-flags { display:none !important; }
  .calls-table td.call-when { display:flex !important; align-items:center; justify-content:space-between; }
  .calls-table td.call-when .direction-cell { margin:0; }
  .calls-table td.call-outcome, .calls-table td.call-flags, .calls-table td.call-request { grid-column:1 / -1; max-width:none; min-width:0; }
  .request-page .side:not(:has(.action)) { order:1; }
  .calls-table td.call-outcome::before, .calls-table td.call-flags::before { display:none !important; }
  .calls-table tr.flagged { border-color:color-mix(in srgb, var(--warn) 45%, var(--line)) !important; }
  .card-meta { margin-left:0; }
}
