:root {
  --ink: #172c3b;
  --muted: #526977;
  --paper: #f3f6f5;
  --card: #fff;
  --line: #dce5e5;
  --teal: #075d61;
  --lime: #d8f58f;
  --danger: #a32725;
  --shadow: 0 4px 6px #14273903, 0 14px 35px #14273906;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  line-height: 1.5;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--teal); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .55; }
button, a, input, textarea, select, summary { outline-offset: 4px; }
:where(button, a, input, textarea, select, summary):focus-visible { outline: 3px solid #bf571d; }
.topbar {
  background: #102632;
  color: #f6f9fa;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px max(28px, calc((100vw - 1460px) / 2));
  gap: 24px;
}
.brand { display: flex; align-items: center; gap: 12px; color: white; text-decoration: none; letter-spacing: .18em; font-size: 9px; font-weight: 600; }
.brand img { width: 40px; height: 40px; }
.brand strong { display: block; font-size: 25px; line-height: 1.3; letter-spacing: -.7px; font-weight: 700; }
.topbar nav { display: flex; gap: 6px; padding: 4px; border: 1px solid #344953; border-radius: 12px; }
.nav { color: #cedadd; border: 0; border-radius: 8px; background: transparent; padding: 10px 18px; font-size: 13px; min-height: 42px; }
.nav:hover { background: #243c46; color: white; }
.nav.active { background: #d8f58f; color: #213b2c; font-weight: 700; }
.pill, .status-badge { display: inline-flex; align-items: center; border: 1px solid #b4cec0; background: #eaf5ef; color: #19543b; border-radius: 30px; padding: 4px 9px; font-size: 10px; line-height: 1.4; font-weight: 700; letter-spacing: .025em; white-space: nowrap; }
.topbar .pill { background: #263d46; color: #d8f58f; border-color: #536646; }
.pill.muted { background: #f0f4f4; color: #536873; border-color: var(--line); }
.pill.urgent, .pill.blocked, .pill.expired, .status-badge.blocked, .status-badge.expired { background: #fff0ee; color: #9b2925; border-color: #efbeb8; }
.pill.high, .pill.warned, .pill.not-yet-valid, .status-badge.warned, .status-badge.not-yet-valid { background: #fff5e1; color: #825008; border-color: #e6cf9a; }
.pill.eligible, .pill.valid, .status-badge.eligible, .status-badge.valid, .status-badge.complete { background: #eaf5ef; color: #19543b; border-color: #b4cec0; }
.status-badge { text-transform: uppercase; font-size: 9px; }
.network { font-size: 11px; min-height: 32px; background: #e7eeeb; padding: 7px 28px; text-align: center; color: #335549; border-bottom: 1px solid #d9e5df; }
.network.stale { background: #fff0d5; color: #804607; }
main { max-width: 1460px; margin: auto; padding: 26px 28px 52px; }
.eyebrow { display: inline-block; font-size: 10px; font-weight: 750; letter-spacing: .14em; color: var(--teal); }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 36px; letter-spacing: -1.4px; line-height: 1.14; margin-bottom: 12px; font-weight: 720; }
h2 { font-size: 22px; letter-spacing: -.6px; line-height: 1.3; margin: 6px 0 16px; font-weight: 690; }
h3 { font-size: 14px; line-height: 1.4; margin-bottom: 10px; font-weight: 700; }
p { line-height: 1.65; color: var(--muted); font-size: 13px; }
.hero { display: grid; grid-template-columns: 1.65fr 1fr; gap: 64px; align-items: center; margin: 8px 0 30px; }
.hero h1 { font-size: 62px; margin: 12px 0 16px; max-width: 720px; letter-spacing: -2.6px; }
.hero > div > p { max-width: 580px; font-size: 15px; margin-bottom: 18px; }
.hero-points { display: flex; gap: 14px; font-size: 11px; color: var(--teal); font-weight: 650; }
.hero-points span { display: inline-flex; align-items: center; gap: 8px; }
.hero-points b { display: inline-grid; place-items: center; width: 25px; height: 25px; border: 1px solid #bbd3c9; border-radius: 50%; font-size: 10px; }
.emergency { background: #ecf1ec; padding: 25px 28px; border: 1px solid #d9e3d7; border-radius: 16px; border-top: 3px solid #a74b24; }
.emergency .eyebrow { color: #97421e; }
.emergency h2 { margin-top: 12px; font-size: 23px; }
.emergency p { font-size: 12px; }
.emergency p:last-child { margin-bottom: 0; }
.emergency a, .sos-card a, .sos-control-notice a {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 4px;
  border-radius: 4px;
}
.sos-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, .7fr);
  gap: 24px;
  align-items: center;
  border: 1px solid #e1b9b1;
  border-top: 3px solid #a84440;
  border-radius: 14px;
  padding: 22px 24px;
  margin: 0 0 22px;
  background: #fff8f6;
}
.sos-card h2 { margin-top: 8px; }
.sos-card p { margin-bottom: 8px; }
.sos-action { display: grid; gap: 8px; }
.sos-hold, .sos-cancel { min-height: 48px; border: 1px solid #8f3934; border-radius: 9px; padding: 10px 14px; font-weight: 700; }
.sos-hold { color: #fff; background: #a84440; }
.sos-hold:active { background: #7e2f2c; }
.sos-cancel { color: var(--ink); background: #fff; border-color: #8a9c9a; }
.sos-progress { height: 7px; overflow: hidden; border-radius: 999px; background: #ecd9d5; }
.sos-progress span { display: block; width: 0; height: 100%; background: #a84440; transition: width .05s linear; }
.sos-status { min-height: 24px; margin: 0; font-size: 12px; }
.sos-control { border-top: 4px solid #a84440; }
.sos-control-notice { border-left: 3px solid #a84440; padding: 12px 14px; background: #fff4f0; color: #4a211d; border-radius: 6px; }
.sos-control-notice a { color: #7c2e28; font-weight: 750; }
.sos-queue { display: grid; gap: 8px; }
.sos-queue-item { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 14px; text-align: left; border: 1px solid #c8d4d0; border-radius: 10px; background: #f7faf7; color: var(--ink); padding: 12px 14px; min-height: 58px; }
.sos-queue-item.priority { border-color: #a84440; box-shadow: 0 0 0 2px #f7ddd7; }
.sos-queue-item strong, .sos-queue-item small { display: block; }
.sos-queue-item small { color: #536561; margin-top: 3px; }
.sos-alert-card { margin-top: 16px; border: 1px solid #c8d4d0; border-radius: 12px; padding: 16px; background: #fbfdfb; }
.sos-alert-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 12px 0 18px; }
.sos-alert-grid div { border: 1px solid #d6e0db; border-radius: 8px; padding: 9px; }
.sos-alert-grid dt { font-size: 11px; color: #52635e; }
.sos-alert-grid dd { margin: 3px 0 0; font-weight: 700; overflow-wrap: anywhere; }
.sos-alert-context { display: grid; gap: 10px; margin: 0 0 18px; }
.sos-alert-context .hint { margin: 0; }
.sos-timeline ol { margin: 0; padding-left: 22px; }
.sos-timeline li { padding: 7px 0 7px 4px; }
.sos-timeline li strong, .sos-timeline li span, .sos-timeline li small { display: block; }
.sos-timeline li span, .sos-timeline li small { color: #536561; font-size: 12px; }
.sos-priority-banner { margin: 12px 0; padding: 14px 16px; border: 2px solid #7c2e28; border-radius: 10px; background: #fff4f0; color: #4a211d; font-weight: 750; }
.sos-priority-banner[hidden] { display: none; }
.sos-map-pin { grid-column: 1 / -1; min-height: 72px; display: grid; align-content: center; gap: 4px; border: 1px dashed #8f3934; border-radius: 8px; background: #fff; padding: 10px; }
.sos-map-pin span { width: 14px; height: 14px; border-radius: 50%; background: #a84440; }
@media (prefers-reduced-motion: reduce) { .sos-priority-banner { animation: none; } }
@media (max-width: 680px) { .sos-alert-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sos-location-prompt { padding: 12px; border: 1px solid #ddc2a0; border-radius: 8px; background: #fffaf0; }
.sos-location-prompt .secondary { width: 100%; margin-top: 8px; }
.resident-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 22px; align-items: start; }
.right-stack { display: grid; gap: 22px; }
.card { min-width: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--card); padding: 24px; box-shadow: var(--shadow); }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 4px; }
.card-heading h2 { margin-bottom: 12px; }
.agent-card { border-top: 3px solid var(--teal); padding-top: 22px; }
label { display: block; font-size: 12px; font-weight: 650; margin: 13px 0 7px; }
input, textarea, select { background: #f9fbfa; border: 1px solid #7b9396; border-radius: 8px; width: 100%; min-width: 0; padding: 10px 12px; color: var(--ink); min-height: 42px; font-size: 12px; }
input::placeholder, textarea::placeholder { color: #627580; opacity: 1; }
textarea { resize: vertical; line-height: 1.5; }
.hint { font-size: 11px; color: var(--muted); line-height: 1.6; }
.form-row { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 400; line-height: 1.6; }
.check input { flex: 0 0 16px; width: 16px; min-height: 16px; accent-color: var(--teal); }
.primary, .secondary { border: 1px solid transparent; border-radius: 8px; padding: 10px 16px; font-weight: 650; font-size: 12px; min-height: 42px; }
.primary { background: var(--teal); color: #fff; box-shadow: 0 2px 2px #075d6110; }
.primary:hover { background: #064a4d; }
.secondary { background: #f7f9f8; border-color: #7b9396; color: var(--ink); }
.secondary:hover { background: #e7efec; border-color: #a6bcb5; }
#report-form > .primary { display: flex; justify-content: space-between; width: 100%; margin-top: 20px; }
.chat-log { display: flex; flex-direction: column; gap: 10px; max-height: 300px; overflow: auto; margin: 14px 0; padding: 2px; scrollbar-width: thin; }
.bubble { border-radius: 12px; padding: 12px 14px; font-size: 12px; margin: 0; max-width: 94%; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
.bubble.agent { background: #eef4f1; color: #2f594c; align-self: flex-start; border-bottom-left-radius: 3px; }
.bubble.resident, .bubble.user { background: #0d5d61; color: white; align-self: flex-end; border-bottom-right-radius: 3px; }
.chat-input { display: flex; gap: 10px; margin-top: 10px; }
.chat-input input { min-width: 0; }
.chat-input button { flex-shrink: 0; }
.success, .error { border: 1px solid transparent; border-radius: 9px; padding: 13px 15px; font-size: 12px; line-height: 1.6; margin-top: 14px; }
.success { background: #ecf6ed; color: #245533; border-color: #c7e0cb; }
.error { background: #fff0ee; color: #983b30; border-color: #efcbc4; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin: 3px 0 18px; }
.section-head h1 { margin-top: 7px; }
.section-head p { margin-bottom: 0; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
#last-refresh { flex-basis: 100%; text-align: right; }
.access-panel { margin-bottom: 16px; }
.access-panel > summary { background: transparent; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 11px; }
.access-panel > summary .hint { font-weight: 400; margin-left: auto; }
.access { display: flex; align-items: center; gap: 14px; padding: 16px; margin-top: 8px; }
.access label { margin: 0; white-space: nowrap; }
.access input { max-width: 330px; }
.access .hint { margin-left: auto; }
.staff-access { margin: 0 0 20px; }
.staff-access > summary { padding: 9px 12px; background: #edf3ef; }
.staff-access-content { margin-top: 10px; }
.staff-identity { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.staff-identity h2 { font-size: 20px; margin: 6px 0; }
.staff-identity p { margin: 0; }
.staff-identity a { text-decoration: none; }
.staff-access-content > form { max-width: 760px; }
.demo-access { margin-top: 20px; padding: 18px; border: 1px solid #ddcc9a; border-radius: 10px; background: #fffaf0; }
.demo-access h3 { margin: 6px 0 0; }
.demo-access > button { margin-top: 14px; }
.admin-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: start; gap: 22px; }
.admin-panel { border-top: 3px solid #bed2c8; }
.admin-panel .card-heading { align-items: flex-start; }
.admin-panel .card-heading h2 { font-size: 21px; margin-bottom: 10px; }
.admin-panel > .hint { margin-top: 0; }
.admin-panel > details { margin-top: 16px; margin-bottom: 0; }
.admin-panel details > form { padding: 0 12px; }
.admin-list { display: grid; gap: 10px; max-height: 210px; overflow: auto; padding-right: 5px; scrollbar-width: thin; }
.admin-list:focus-visible { outline: 3px solid #bf571d; outline-offset: 4px; border-radius: 8px; }
.admin-record { min-width: 0; border: 1px solid var(--line); border-radius: 9px; padding: 12px 14px; background: #fafcfb; overflow-wrap: anywhere; }
.admin-record-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; font-size: 12px; }
.admin-record p { margin: 6px 0 0; font-size: 11px; line-height: 1.6; }
.admin-record .hint { font-size: 10px; }
.admin-record > details { margin-bottom: 0; }
.admin-badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.admin-badges .pill { white-space: normal; font-size: 9px; }
.admin-record-actions { margin-top: 12px; }
.admin-record-actions .secondary { font-size: 10px; padding: 8px 11px; }
.admin-empty { margin: 0; padding: 16px; border: 1px dashed #cbd9d3; border-radius: 9px; background: #f8faf8; }
.json-editor { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; tab-size: 2; line-height: 1.6; }
.role-grid { border: 1px solid var(--line); border-radius: 9px; margin: 18px 0; padding: 10px 14px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 4px 14px; }
.role-grid legend { font-size: 12px; font-weight: 650; padding: 0 6px; }
.role-grid .check { margin: 2px 0; font-size: 11px; overflow-wrap: anywhere; }
.role-grid input { margin: 0; }
.danger-action { color: #983b30; border-color: #c58d85; }
.token-reveal { margin: 0 0 22px; border-color: #d3bd7e; border-left: 4px solid #a66c08; background: #fffdf5; }
.token-reveal h2 { font-size: 20px; }
#admin-new-token { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.admin-metrics .kpi:last-child strong { font-size: 25px; }
#staff-result:empty, [id^="admin-"][id$="-result"]:empty { display: none; }
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { min-width: 0; border: 1px solid var(--line); border-radius: 10px; background: white; padding: 13px 16px; }
.kpi strong { display: block; font-size: 29px; letter-spacing: -.9px; line-height: 1.2; margin: 7px 0 4px; font-variant-numeric: tabular-nums; }
.kpi .label { display: block; font-size: 11px; color: var(--muted); line-height: 1.4; font-weight: 550; }
.kpi small { display: block; font-size: 10px; color: var(--muted); line-height: 1.5; }
#kpis .kpi { display: grid; grid-template-columns: 1fr auto; column-gap: 12px; align-items: center; padding: 11px 16px; }
#kpis .kpi strong { grid-column: 2; grid-row: 1 / 3; font-size: 26px; margin: 0; }
#kpis .kpi small { grid-column: 1; }
.metrics-card { margin-bottom: 20px; padding: 17px 20px 13px; background: linear-gradient(110deg, #f7faf7, #fff); }
.metrics-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 13px; }
.metrics-heading .pill { background: white; }
#outcome-metrics { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0; margin: 0; }
#outcome-metrics .kpi { background: transparent; border: 0; border-right: 1px solid var(--line); border-radius: 0; padding: 0 15px; }
#outcome-metrics .kpi:first-child { padding-left: 0; }
#outcome-metrics .kpi:last-child { border-right: 0; padding-right: 0; }
#outcome-metrics .kpi strong { font-size: 26px; color: #17453f; margin: 8px 0 5px; }
#metrics-method { border-top: 1px solid var(--line); margin: 12px 0 0; padding-top: 9px; font-size: 10px; }
.metric-bar, .metric-split { display: block; width: 100%; height: 4px; overflow: hidden; border-radius: 4px; margin-top: 8px; }
.metric-track { fill: #dfe9e4; }
.metric-fill { fill: #3b7564; }
.offline-emergency { margin-top: 24px; }
.operations-grid { display: grid; grid-template-columns: minmax(0, .78fr) minmax(0, 1.22fr); gap: 22px; align-items: start; }
.filters { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr; gap: 9px; margin-bottom: 16px; }
.filters label { font-size: 10px; margin: 0; }
.filters select { padding: 8px; font-size: 11px; margin-top: 6px; }
.queue { display: flex; flex-direction: column; gap: 10px; max-height: 650px; overflow: auto; padding: 3px; scrollbar-width: thin; }
.queue-item { text-align: left; width: 100%; border: 1px solid var(--line); background: white; border-radius: 10px; padding: 14px; display: block; }
.queue-item:hover { border-color: #8eb8a9; background: #f7faf8; }
.queue-item.selected { border-color: var(--teal); background: #edf5f0; box-shadow: inset 3px 0 var(--teal); }
.queue-item .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.case-ref { font-size: 11px; font-weight: 700; color: var(--teal); font-variant-numeric: tabular-nums; }
.queue-item h3 { font-size: 13px; font-weight: 600; margin: 10px 0 8px; }
.queue-item .meta { font-size: 10px; color: var(--muted); display: flex; gap: 10px; justify-content: space-between; line-height: 1.6; }
.sla-breach { color: var(--danger) !important; font-weight: 650; }
.detail-card { min-height: 350px; }
.detail-head h2 { margin: 8px 0 10px; font-size: 23px; }
.detail-head .case-ref { font-size: 12px; }
.case-description { margin: 12px 0; }
.detail-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; background: #f1f6f3; padding: 14px; border: 1px solid #e3ebe5; border-radius: 9px; margin: 16px 0; font-size: 12px; line-height: 1.5; }
.detail-summary span { display: block; font-size: 10px; color: var(--muted); margin-bottom: 4px; }
.detail-card p { font-size: 12px; }
.detail-actions { display: flex; gap: 9px; flex-wrap: wrap; padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.detail-actions select { max-width: 230px; font-size: 11px; }
.detail-card > h3, .pipeline-section > h3, #decision-timeline > h3 { margin-top: 23px; padding-top: 18px; border-top: 1px solid var(--line); }
details { margin: 10px 0; font-size: 12px; }
summary { display: flex; align-items: center; gap: 9px; cursor: pointer; list-style: none; font-family: inherit; font-size: 12px; font-weight: 650; line-height: 1.5; padding: 10px 12px; border-radius: 7px; background: #f3f7f5; }
summary::-webkit-details-marker { display: none; }
summary::marker { content: ''; }
summary::before { content: ''; flex: 0 0 6px; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); margin-right: 3px; }
details[open] > summary::before { transform: rotate(45deg); }
summary:hover { background: #e8f0eb; }
details[open] > summary { margin-bottom: 12px; }
details > :where(p, ol, ul, label, .secondary, .cert-list) { margin-left: 12px; margin-right: 12px; }
details > select, details > input { width: calc(100% - 24px); margin-left: 12px; }
details > .secondary { margin-top: 12px; }
details li { color: var(--muted); padding: 3px 0; line-height: 1.6; }
.qualification { border: 1px solid #ccdcd3; background: #fcfdfb; padding: 14px; margin: 12px 0; border-radius: 10px; }
.qualification-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12px; }
.eligibility-reasons { list-style: none; padding: 0; margin: 10px 0 12px; display: grid; gap: 5px; }
.eligibility-reasons li { color: #476257; font-size: 11px; line-height: 1.5; display: flex; gap: 8px; }
.eligibility-reasons li::before { content: '·'; color: var(--teal); font-weight: 800; }
.worker-qualification { margin: 8px 0 0; }
.worker-qualification summary { font-size: 11px; font-weight: 600; }
.cert-list { display: grid; gap: 8px; }
.certification { border: 1px solid var(--line); border-radius: 7px; padding: 10px 12px; background: white; }
.certification-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 11px; }
.cert-meta { display: block; color: var(--muted); font-size: 10px; line-height: 1.6; margin-top: 4px; overflow-wrap: anywhere; }
.pipeline-head, .agent-step { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(145px, 1.3fr) 57px 80px; align-items: center; column-gap: 10px; }
.pipeline-head { color: var(--muted); font-size: 9px; font-weight: 650; letter-spacing: .04em; padding: 8px 12px 8px 30px; border-bottom: 1px solid var(--line); }
.agent-run, .agent-run-group { background: #f8faf9; border: 1px solid var(--line); border-radius: 8px; margin: 7px 0; }
.agent-step { position: relative; background: transparent; font-size: 11px; padding: 10px 12px 10px 30px; font-weight: 600; }
.agent-step::before { position: absolute; left: 13px; }
.agent-name { display: flex; gap: 7px; align-items: baseline; }
.agent-name .step-index { color: var(--muted); font-size: 9px; font-variant-numeric: tabular-nums; }
.agent-provider { display: block; color: #315c51; font-size: 10px; line-height: 1.5; font-weight: 550; }
.agent-provider small { display: block; color: var(--muted); font-size: 9px; font-weight: 400; }
.agent-duration { font-size: 10px; font-weight: 500; font-variant-numeric: tabular-nums; }
.agent-duration small { display: block; color: var(--muted); font-size: 9px; }
.agent-status { justify-self: start; white-space: normal; font-size: 9px; padding: 4px 7px; }
.agent-reasoning { padding: 0 12px 4px; }
.agent-reasoning .provider { margin-left: 0; margin-right: 0; }
.agent-draft-history { padding: 0 10px 3px; }
.agent-draft-history > .hint { font-size: 10px; margin: 0 2px 10px; }
.agent-reasoning .hint { overflow-wrap: anywhere; }
.case-evidence { margin-top: 24px; }
.evidence-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.evidence-ticket { font-size: 11px; color: var(--muted); }
.agent-run p { font-size: 11px; margin-bottom: 10px; }
.agent-run .provider { display: block; font-size: 10px; color: #356b5b; margin: 6px 12px; }
.draft { border: 1px solid var(--line); border-radius: 9px; padding: 13px; margin: 10px 0; }
.draft p { white-space: pre-wrap; margin: 10px 0; }
.timeline { position: relative; border-left: 1px solid #c8d9cf; padding-left: 21px; margin-left: 5px; }
.timeline-item { position: relative; padding: 0 0 18px; }
.timeline-item::before { content: ''; position: absolute; left: -26px; top: 4px; border: 3px solid #edf5ef; background: #27645a; width: 9px; height: 9px; border-radius: 50%; }
.timeline-item h3 { font-size: 12px; margin-bottom: 4px; }
.timeline-item p { margin-bottom: 4px; font-size: 11px; }
.timeline-item .hint { font-size: 10px; }
.timeline-source { margin: 4px 0 0; }
.timeline-source summary { background: transparent; font-size: 10px; font-weight: 500; padding: 2px 4px; min-height: 24px; width: fit-content; }
.timeline-source ol { margin: 0; padding-left: 20px; }
.timeline-source li { font-size: 10px; line-height: 1.5; overflow-wrap: anywhere; }
.timeline-source li span { display: block; }
.timeline-source li p { font-size: 10px; margin: 2px 0; }
#alert-items .timeline-item { padding: 10px 12px; margin: 6px 0; background: #fff8e8; border-radius: 8px; }
#alert-items .timeline-item::before { display: none; }
#channel-alerts { margin-bottom: 20px; border-color: #e6cf9a; }
.distribution { display: flex; gap: 8px; flex-wrap: wrap; font-size: 10px; color: var(--muted); padding-top: 15px; }
.distribution span { background: #eef3ef; border-radius: 5px; padding: 5px 8px; }
.outbox-card { margin-top: 22px; }
.table-wrap { overflow-x: auto; scrollbar-width: thin; }
table { border-collapse: collapse; width: 100%; font-size: 11px; text-align: left; }
caption { text-align: left; font-size: 13px; font-weight: 650; padding-bottom: 15px; }
th { color: var(--muted); font-size: 10px; letter-spacing: .04em; font-weight: 650; background: #f4f7f5; }
th, td { border-bottom: 1px solid var(--line); padding: 12px 10px; }
td code { font-size: 10px; }
td small { display: block; color: var(--muted); margin-top: 4px; }
#audit-result { padding: 19px 22px; margin-bottom: 20px; font-size: 13px; font-weight: 600; }
#audit-result.success { border-left: 4px solid #276c48; }
#audit-rows tr:hover { background: #f6f9f7; }
.empty { padding: 32px 18px; text-align: center; color: var(--muted); font-size: 12px; border: 1px dashed #cbd9d3; border-radius: 10px; background: #f9fbf9; }
.loading { opacity: .65; }
.sr-only { position: absolute; clip: rect(0, 0, 0, 0); width: 1px; height: 1px; overflow: hidden; }
.skip { position: absolute; left: 10px; top: -60px; background: white; padding: 12px; z-index: 10; }
.skip:focus { top: 10px; }
footer { border-top: 1px solid var(--line); display: flex; gap: 20px; justify-content: space-between; padding: 22px 28px; font-size: 10px; color: var(--muted); line-height: 1.5; }
[hidden] { display: none !important; }
#report-result:empty, #lookup-result:empty, #action-result:empty { display: none; }
#live-agent, #live-agent elevenlabs-convai { display: block; min-height: 160px; }
.queue-item, .detail-card, .agent-run { overflow-wrap: anywhere; }
@media (max-width: 1100px) {
  .hero { gap: 30px; }
  .hero h1 { font-size: 50px; }
  .access { flex-wrap: wrap; }
  .access .hint { margin-left: 0; }
  #outcome-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 16px; }
  #outcome-metrics .kpi:nth-child(4) { border-right: 0; }
  #outcome-metrics .kpi:nth-child(5) { padding-left: 0; }
  .operations-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); }
  .pipeline-head { display: none; }
  .agent-step { grid-template-columns: minmax(0, 1fr) auto; row-gap: 5px; }
  .agent-provider { grid-column: 1; grid-row: 2; }
  .agent-duration { grid-column: 2; grid-row: 2; }
  .agent-status { grid-column: 2; grid-row: 1; }
}
@media (max-width: 800px) {
  main { padding: 23px 18px 40px; }
  .topbar { padding: 16px 18px 12px; flex-wrap: wrap; gap: 16px; }
  .topbar nav { order: 3; width: 100%; justify-content: space-between; }
  .nav { padding: 10px 8px; font-size: 12px; flex: 1; min-height: 44px; }
  .topbar nav:has([data-view="admin"]:not([hidden])) { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
  .staff-identity { align-items: flex-start; flex-direction: column; gap: 16px; }
  .demo-access { padding: 14px; }
  .admin-grid { grid-template-columns: 1fr; gap: 18px; }
  .admin-record-head { flex-wrap: wrap; gap: 6px; }
  .admin-metrics .kpi:last-child { grid-column: 1 / -1; }
  .admin-panel > details > form { padding: 0 4px; }
  .token-reveal .card-heading { gap: 14px; }
  .network { padding: 8px 18px; font-size: 10px; }
  .hero { grid-template-columns: 1fr; gap: 24px; margin-top: 0; }
  .hero h1 { font-size: 46px; letter-spacing: -1.8px; }
  .hero > div > p { font-size: 14px; }
  .hero-points { flex-wrap: wrap; gap: 10px; font-size: 10px; }
  .hero-points b { width: 21px; height: 21px; font-size: 9px; }
  .resident-grid, .operations-grid { grid-template-columns: 1fr; }
  .section-head { align-items: flex-start; flex-direction: column; gap: 16px; }
  .section-head .actions { width: 100%; }
  #last-refresh { text-align: left; }
  h1 { font-size: 31px; }
  .card { padding: 20px; border-radius: 12px; }
  .agent-card { padding-top: 18px; }
  .card-heading { align-items: flex-start; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; }
  .card-heading h2 { margin-bottom: 6px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  #kpis .kpi { display: block; padding: 12px; }
  #kpis .kpi strong { margin: 6px 0; }
  #kpis .kpi:last-child { grid-column: 1 / -1; }
  .metrics-heading { align-items: flex-start; flex-direction: column; gap: 6px; }
  #outcome-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 0; }
  #outcome-metrics .kpi { padding: 0 12px; }
  #outcome-metrics .kpi:nth-child(odd) { padding-left: 0; }
  #outcome-metrics .kpi:nth-child(even) { border-right: 0; }
  #outcome-metrics .kpi:last-child { border-right: 0; }
  #outcome-metrics .kpi strong { font-size: 25px; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters label:first-child { grid-column: 1 / -1; }
  .access input { max-width: 100%; }
  .access label { width: 100%; white-space: normal; }
  .access-panel > summary { flex-wrap: wrap; }
  .access-panel > summary .hint { margin-left: 19px; }
  .primary, .secondary, input, select, summary { min-height: 44px; }
  footer { flex-direction: column; padding: 20px; gap: 7px; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .emergency { padding: 21px; }
  .emergency h2 { font-size: 21px; }
  .queue { max-height: 450px; }
  .queue-item .row { flex-wrap: wrap; }
  .detail-summary { font-size: 11px; gap: 12px 10px; }
  .detail-head h2 { font-size: 20px; }
  .qualification-head, .certification-head { align-items: flex-start; }
  .qualification { padding: 12px; }
  .worker-qualification summary { font-size: 11px; }
  .agent-name { font-size: 11px; }
  .agent-provider { font-size: 10px; }
  #audit .table-wrap { padding: 14px; }
  #audit table { min-width: 650px; }
  #audit-result { padding: 16px; }
}
@media (prefers-reduced-motion: no-preference) {
  button, summary { transition: background .15s, border-color .15s; }
  .view { animation: appear .2s ease; }
  @keyframes appear { from { opacity: .7; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }
}

.degraded-service { padding:12px clamp(18px,4vw,56px); background:#fff4d6; color:#553a08; border-bottom:1px solid #d9b567; font-size:.9rem; line-height:1.5; }
.degraded-service[hidden] { display:none; }
.spend-cap-banner { padding:12px clamp(18px,4vw,56px); background:#ffe1e1; color:#5c0b0b; border-bottom:1px solid #d98a8a; font-weight:600; text-align:center; }
.spend-cap-banner[hidden] { display:none; }

/* Resident language resources preserve the original two-line hero. */
.hero h1 { white-space: pre-line; }
.language-toolbar { display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin:0 0 18px; }
.language-toolbar label { margin:0; }
.language-toolbar select { width:145px; }
.language-toolbar .hint { margin:0; flex:1 1 300px; }
.check input { flex:0 0 24px; width:24px; height:24px; min-height:24px; margin:0; }
footer a { display:inline-flex; align-items:center; min-height:24px; }
:where(button,a,input,textarea,select,summary,[tabindex]) { scroll-margin:12px; }
.chat-log, .queue, .admin-list { scroll-padding:8px; }
:where(button,a,input,textarea,select,summary,[tabindex]):focus-visible { outline:3px solid #bf571d; outline-offset:3px; }
@media (max-width:360px) {
  .topbar nav { display:grid; grid-template-columns:1fr 1fr; }
  .brand strong { font-size:23px; }
  .topbar { gap:10px; }
  main { padding-inline:12px; }
  .card { padding:16px; }
  .hero h1 { font-size:40px; }
  .hero-points { gap:8px; }
  .detail-summary, .role-grid { grid-template-columns:1fr; }
  .sos-card { grid-template-columns:1fr; padding:18px; }
  .qualification-head, .certification-head { flex-wrap:wrap; }
}
@media (prefers-color-scheme:dark) {
  :root { --ink:#e5edf1; --muted:#b7c8d0; --paper:#101c25; --card:#172832; --line:#425964; --teal:#93dcd6; --danger:#ffb5ac; --shadow:none; color-scheme:dark; }
  a { color:var(--teal); }
  .eyebrow, .case-ref { color:var(--teal); }
  .network { background:#1d342c; color:#d7eee1; border-color:#49645a; }
  .network.stale, .degraded-service { background:#3e3016; color:#ffe4a8; border-color:#9a7d43; }
  .emergency { background:#26332d; border-color:#728979; border-top-color:#efa279; }
  .sos-card { background:#382423; border-color:#956b64; }
  .sos-location-prompt { background:#3a3124; border-color:#a18b57; }
  .emergency .eyebrow { color:#ffc09b; }
  input, textarea, select { background:#11232d; color:var(--ink); border-color:#91a8b0; }
  input::placeholder, textarea::placeholder { color:#b5c5cd; }
  .primary { background:#93dcd6; color:#112b2b; }
  .primary:hover { background:#afeae5; }
  .secondary { background:#263a44; color:var(--ink); border-color:#91a8b0; }
  .secondary:hover { background:#344b55; border-color:#b3c7ce; }
  .pill, .status-badge, .pill.eligible, .pill.valid, .status-badge.eligible, .status-badge.valid, .status-badge.complete { background:#233f33; color:#ceefda; border-color:#6e9580; }
  .pill.muted { background:#2b3f49; color:#d0dde3; border-color:#78909b; }
  .pill.urgent, .pill.blocked, .pill.expired, .status-badge.blocked, .status-badge.expired { background:#492e2b; color:#ffc3b9; border-color:#bb8176; }
  .pill.high, .pill.warned, .pill.not-yet-valid, .status-badge.warned, .status-badge.not-yet-valid { background:#44371e; color:#ffe0a0; border-color:#ac925c; }
  .bubble.agent { background:#274339; color:#d8ece1; }
  .bubble.resident, .bubble.user { background:#245f63; color:#fff; }
  .success { background:#253f2b; color:#d1efcf; border-color:#719873; }
  .error { background:#482e29; color:#ffd0c1; border-color:#ae7a6d; }
  .staff-access > summary, summary { background:#293e37; }
  summary:hover { background:#385147; }
  .demo-access { background:#382f1e; border-color:#a18b57; }
  .admin-record, .qualification, .agent-run, .agent-run-group, .certification, .queue-item, .kpi { background:#1b2e38; }
  .admin-empty, .empty { background:#1b2e2c; border-color:#82998b; }
  .token-reveal { background:#332e1d; border-color:#b8a366; }
  .metrics-card { background:#1b302c; }
  .metrics-heading .pill { background:#263b34; }
  #outcome-metrics .kpi strong { color:#bae9d5; }
  .queue-item:hover, .queue-item.selected { background:#29433a; border-color:#93dcd6; }
  .queue-item.selected { box-shadow:inset 3px 0 #93dcd6; }
  .detail-summary, .distribution span { background:#293f36; border-color:#536f60; }
  .eligibility-reasons li, .agent-provider, .agent-run .provider { color:#b8e0cc; }
  #alert-items .timeline-item { background:#42361f; }
  th { background:#263b34; }
  #audit-rows tr:hover { background:#293f36; }
  .danger-action { color:#ffcbc0; border-color:#bb8d81; }
  .skip { background:#172832; color:#b5ebe5; }
  :where(button,a,input,textarea,select,summary,[tabindex]):focus-visible { outline-color:#ffc183; }
}
/* Round 13 agency board */
.agency-layout { display: grid; grid-template-columns: minmax(260px,1fr) minmax(320px,1.4fr) minmax(280px,1fr); gap: 18px; margin-top: 18px; align-items: start; }
.agency-item { width: 100%; display: grid; gap: 6px; text-align: left; border: 1px solid var(--line); border-radius: 10px; background: #fafcfb; color: var(--ink); padding: 12px 14px; margin-bottom: 10px; }
.agency-item.selected { border-color: var(--teal); box-shadow: inset 3px 0 0 var(--teal); background: #fff; }
.agency-item-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.agency-item small, .aid-row small, .camera-row small, .agency-timeline small { display: block; color: var(--muted); font-size: 11px; line-height: 1.5; }
.agency-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
.agency-chip { font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px; color: var(--ink); background: color-mix(in srgb, var(--agency) 14%, white); border: 1px solid color-mix(in srgb, var(--agency) 55%, white); }
.agency-facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 12px; margin: 14px 0; }
.agency-facts dt { color: var(--muted); font-weight: 650; }
.agency-form { display: grid; gap: 6px; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 12px 0; background: #fafcfb; }
.agency-form button { justify-self: start; margin-top: 6px; }
.aid-row, .camera-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.camera-row.camera-proposed { border-left: 3px solid #c97a12; }
.camera-row.camera-dismissed { opacity: .7; }
.aid-actions, .agency-status-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.agency-timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--line); }
.agency-timeline li { padding: 6px 0 6px 14px; font-size: 12px; }
.agency-timeline li span, .agency-timeline time { color: var(--muted); font-size: 11px; }
.empty-state { text-align: center; padding: 22px 10px; }
@media (max-width: 1100px) { .agency-layout { grid-template-columns: 1fr; } }
.agency-more { margin: 10px 0; }
.agency-more > summary { cursor: pointer; font-size: 12px; font-weight: 700; color: var(--teal); padding: 6px 0; }
/* Round 14 polish: SOS card stacks on phones and small tablets (was squeezed into a narrow column at 390 px). */
@media (max-width: 760px) { .sos-card { grid-template-columns: 1fr; padding: 18px; gap: 14px; } }

/* Public landing (resident view) */
.landing { margin: 4px 0 40px; }
.landing img { display: block; max-width: 100%; height: auto; }
.landing-hero { position: relative; border-radius: 22px; overflow: hidden; background: #0d1f29; color: #f6f9fa; min-height: 520px; display: grid; align-items: end; box-shadow: var(--shadow); }
.landing-hero picture, .landing-hero-img { position: absolute; inset: 0; width: 100%; height: 100%; }
.landing .landing-hero-img { height: 100%; object-fit: cover; object-position: 70% center; }
.landing-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #0b1b24f2 0%, #0b1b24d9 42%, #0b1b2466 75%, #0b1b2433 100%); }
.landing-hero-copy { position: relative; z-index: 1; padding: 56px 52px 44px; max-width: 760px; }
.landing-hero .eyebrow { color: var(--lime); }
.landing-hero h1 { color: #fff; font-size: 48px; letter-spacing: -1.8px; line-height: 1.08; margin: 14px 0 18px; }
.landing-lede { color: #dbe6ea; font-size: 17px; max-width: 640px; }
.landing-cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 22px 0 18px; }
.landing-cta a.primary, .landing-cta a.secondary { display: inline-flex; align-items: center; min-height: 46px; padding: 11px 20px; border-radius: 10px; font-weight: 700; font-size: 14px; text-decoration: none; }
.landing-hero .landing-cta a.primary { background: var(--lime); color: #17301f; border: 0; }
.landing-hero .landing-cta a.secondary { background: transparent; color: #fff; border: 1px solid #9fb3bb; }
.landing-hero .landing-link { color: #e6f1f4; font-size: 14px; }
.landing-hero :focus-visible { outline-color: var(--lime); }
.landing-notice { font-size: 13px; color: #f3e6c4; background: #3a2f12cc; border: 1px solid #8a6d2a; border-radius: 10px; padding: 10px 14px; max-width: 640px; margin: 0; }
.landing-notice strong { color: #fff3cf; }
.landing-steps { margin: 48px 0; }
.landing-steps > h2, .landing-safety h2, .landing-try h2 { font-size: 30px; letter-spacing: -1px; }
.landing-steps ol { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.landing-steps li { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px; box-shadow: var(--shadow); }
.landing-steps li b { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--teal); color: #fff; margin-bottom: 12px; }
.landing-steps h3 { font-size: 16px; }
.landing-steps p, .feature p, .landing-safety p, .landing-try p { font-size: 14px; }
.landing-features { display: grid; gap: 40px; margin: 48px 0; }
.feature { display: grid; grid-template-columns: 1.25fr 1fr; gap: 44px; align-items: center; }
.feature img { border-radius: 14px; border: 1px solid var(--line); box-shadow: var(--shadow); background: #fff; }
.feature.reverse img { order: 2; }
.feature h2 { font-size: 27px; letter-spacing: -.8px; }
.landing-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 48px 0; }
.landing-gallery figure { margin: 0; }
.landing-gallery img { border-radius: 14px; aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.landing-gallery figcaption { font-size: 13px; color: var(--muted); margin-top: 8px; }
.landing-safety { display: grid; grid-template-columns: 1fr 2fr; gap: 40px; background: #102632; color: #f6f9fa; border-radius: 22px; padding: 44px; margin: 48px 0; }
.landing-safety .eyebrow { color: var(--lime); }
.landing-safety h2, .landing-safety h3 { color: #fff; }
.landing-safety p { color: #c9d8dd; }
.landing-safety ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px 30px; }
.landing-try { display: flex; justify-content: space-between; align-items: center; gap: 30px; background: #e4f1d0; border: 1px solid #c7dca6; border-radius: 18px; padding: 30px 36px; }
.landing-try p { color: #33463a; max-width: 720px; margin: 0; }
.landing-try .landing-cta { margin: 0; flex-shrink: 0; }
.landing-try a.primary { background: var(--teal); color: #fff; }
.landing-try a.secondary { background: #fff; color: var(--teal); border: 1px solid var(--teal); }
.hero-title { font-size: 44px; letter-spacing: -1.6px; line-height: 1.1; margin: 12px 0 16px; }
.site-footer { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; padding: 32px max(28px, calc((100vw - 1460px) / 2)); font-size: 13px; background: #102632; color: #c9d8dd; border-top: 0; }
.site-footer strong { color: #fff; display: block; font-size: 16px; margin-bottom: 4px; }
.site-footer nav, .site-footer address { display: flex; flex-direction: column; gap: 4px; font-style: normal; }
.site-footer a { color: #d8f58f; }
@media (max-width: 1000px) {
  .landing-steps ol { grid-template-columns: repeat(2, 1fr); }
  .feature, .feature.reverse { grid-template-columns: 1fr; gap: 18px; }
  .feature.reverse img { order: 0; }
  .landing-safety { grid-template-columns: 1fr; padding: 32px; }
  .landing-try { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 640px) {
  .landing-hero { min-height: 0; border-radius: 16px; }
  .landing-hero-copy { padding: 140px 22px 26px; }
  .landing-hero::after { background: linear-gradient(180deg, #0b1b2455 0%, #0b1b24e6 35%, #0b1b24f7 100%); }
  .landing-hero h1 { font-size: 32px; letter-spacing: -1px; }
  .landing-lede { font-size: 15px; }
  .landing-steps ol, .landing-gallery, .landing-safety ul { grid-template-columns: 1fr; }
  .landing-safety { padding: 24px 20px; }
  .landing-try { padding: 22px; }
  .hero-title { font-size: 32px; }
  .site-footer { grid-template-columns: 1fr; padding: 24px 20px; }
}
.footer-logo { width: 96px; height: 96px; margin-bottom: 8px; border-radius: 14px; }
.brand-mark { border-radius: 8px; }
.landing-link, .site-footer a { display: inline-flex; align-items: center; min-height: 28px; }
.landing-try a.primary { background: #075d61; color: #fff; }
.landing-try a.secondary { background: #fff; color: #075d61; border-color: #075d61; }
.landing-try h2 { color: #172c3b; }
.landing-try p strong { color: #172c3b; }
