@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap');
/* Shared presentation rules. Keep operational status colors and authored content intact. */
:root {
  --ui-body-font: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ui-heading-font: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ui-text: #15333c;
  --ui-muted: #4b626b;
  --ui-border: #cedad6;
  --ui-accent: #147466;
  --ui-danger: #a03333;
  --ui-radius: 8px;
  --ui-panel-radius: 10px;
  --ui-gap: 8px;
  --ui-panel-padding: 20px;
}
body, #authScreen {
  font-family: var(--ui-body-font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ui-text);
}
body :is(button, input, select, textarea):not(.comm-rich-editor *) { font-family: var(--ui-body-font); }
body :is(h1, h2, h3, h4):not(.comm-rich-editor *) {
  font-family: var(--ui-heading-font);
  line-height: 1.3;
  font-weight: 700;
}
body header h1, #authScreen h1 { font-size: 28px; letter-spacing: -.6px; }
body h2 { font-size: 22px; }
body h3 { font-size: 17px; }
body h4 { font-size: 14px; }
body :is(.muted, .progress-note, .tabs-caption, .fl-description, .map-help, .map-progress) {
  color: var(--ui-muted);
  font-size: 13px;
  line-height: 1.5;
}
body :is(.stat small, .log small, .incident p, .form-card p, .map-layer small) {
  font-size: 12px;
  line-height: 1.5;
}
body :is(.stat label, .context-label) { color: var(--ui-muted); }
body .dark-panel { color: #fff; }
body .dark-panel .muted { color: #c5dcd5; }
body label, #authScreen label {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}
body :is(input, textarea)::placeholder { color: var(--ui-muted); opacity: 1; }
body :is(button, a, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--ui-accent);
  outline-offset: 3px;
}
body .command-bar :is(button, a):focus-visible { outline-color: #b7e7d3; }
/* Only application buttons: map zoom/markers, sort links, and board cells keep their geometry. */
body :is(.console, dialog, #authScreen) button:not(.rl-column-sort):not(.leaflet-control-zoom-in):not(.leaflet-control-zoom-out):not(.leaflet-marker-icon) {
  font-family: var(--ui-body-font);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  border-radius: var(--ui-radius);
}
body :is(#headerActions, .toolbar, .submission-toolbar, .rl-table-tools, .dialog-actions, .details-actions, .comm-recipient-tools, .comm-editor-toolbar) {
  gap: var(--ui-gap);
}
body :is(#headerActions, .dialog-actions, .details-actions) {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}
body :is(#headerActions, .toolbar, .submission-toolbar, .dialog-actions, .details-actions, .account-management) button:not(.rl-column-sort) {
  min-height: 40px;
  padding: 9px 12px;
}
body .rl-table-tools button { min-height: 36px; padding: 7px 10px; }
body :is(.rl-table-tools, .submission-toolbar) span { font-size: 12px; line-height: 1.5; }
body :is(.form-card .actions, .field-controls, .account-action-buttons, .comm-editor-toolbar) button {
  min-height: 36px;
  padding: 7px 10px;
}
body :is(.console, dialog, #authScreen) button.primary {
  color: #fff;
  background: var(--ui-accent);
  border: 1px solid var(--ui-accent);
}
body :is(.console, dialog, #authScreen) button.primary:hover { background: #0e5c50; }
body :is(.console, dialog) button.danger { color: var(--ui-danger); }
body :is(.console, dialog, #authScreen) button:disabled {
  opacity: 1;
  background: #edf1ef;
  color: #52636b;
  border-color: var(--ui-border);
  cursor: not-allowed;
}
body button.link { color: #10685c; text-underline-offset: 3px; }
body button.link:hover { text-decoration: underline; }
body :is(.console, dialog, #authScreen) :is(input, select, textarea):not([type=checkbox]):not([type=radio]):not([type=color]):not([type=range]):not([type=hidden]):not(.rl-column-filter) {
  font-family: var(--ui-body-font);
  font-size: 14px;
  line-height: 1.4;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius);
  color: var(--ui-text);
}
body :is(.console, dialog, #authScreen) :is(input, select, textarea):disabled,
body :is(.console, dialog, #authScreen) input[readonly] {
  background: #f3f6f5;
  color: var(--ui-muted);
}
body :is(.console, dialog, #authScreen) textarea { min-height: 104px; }
/* Dynamic table styles use !important; use the same narrowly scoped override. */
:root .console .rl-column-filter {
  font-family: var(--ui-body-font) !important;
  font-size: 12px !important;
  line-height: 1.4 !important;
  min-height: 34px;
  padding: 7px 8px !important;
  border-radius: 6px;
}
body .console :is(th, td):not(.comm-rich-editor *), body dialog :is(th, td) { line-height: 1.45; }
body .console th:not(.comm-rich-editor *) { font-size: 12px; letter-spacing: .2px; color: var(--ui-muted); }
body .console td:not(.comm-rich-editor *) { font-size: 13px; }
body .console .rl-column-sort { font-family: var(--ui-body-font); font-size: 12px; line-height: 1.4; }
body .console :is(.panel, .stat) { border-radius: var(--ui-panel-radius); }
body .console .panel { padding: var(--ui-panel-padding); margin-bottom: 20px; }
body .console :is(.grid, .catalog, .two-col) { gap: 16px; }
body .console .panel > .row { flex-wrap: wrap; gap: 12px; }
body .console .panel > :is(h2, h3):first-child { margin-top: 0; margin-bottom: 12px; }
body .console .panel > p:last-child { margin-bottom: 0; }
body .console .row > :is(h2, h3, h4) { margin-bottom: 0; }
body .console .stats > .stat label { display: block; min-height: 2.8em; margin: 0; font-size: 13px; }
body .console .stats > .stat strong { font-variant-numeric: tabular-nums; }
body .console .situation-summary .stat label { font-size: 12px; line-height: 1.4; }
body .console .map-sidebar { color: var(--ui-text); }
body .console .map-sidebar :is(.muted, .map-help, .map-progress) { color: var(--ui-muted); }
body .console .map-heading { flex-wrap: wrap; gap: 12px; }
body .console .map-heading button { min-height: 40px; }
body .console .fl-tools { gap: 12px; align-items: end; }
body .console .fl-tools label { margin: 0 0 6px; font-size: 13px; }
body .console .fl-folder { padding: 20px; }
body .console .fl-breadcrumb button { min-height: 32px; }
body .console .account-action-buttons { gap: 8px; }
body .console .account-action-buttons button { margin: 0 !important; min-height: 36px; }
body .console .comm-editor-toolbar { align-items: center; }
body .console .comm-editor-toolbar select { min-height: 36px; }
/* Do not restyle the editor body or email iframe: users choose their message typography. */
body .console .comm-rich-editor { border-color: var(--ui-border); border-radius: var(--ui-radius); }
body .console summary { line-height: 1.5; }
body .console .county-assets > summary { font-family: var(--ui-heading-font); }
body .console footer { color: var(--ui-muted); font-size: 12px; line-height: 1.5; gap: 16px; }
body dialog { padding: 24px; border-radius: var(--ui-panel-radius); }
body .dialog-head { gap: 16px; align-items: start; margin-bottom: 16px; }
body .dialog-head button { min-width: 36px; min-height: 36px; }
body .dialog-actions { margin-top: 24px; }
body :is(#dialogError, #loginStatus.error) { color: var(--ui-danger); font-size: 13px; }
body .organization-bar .context-field label { font-size: 11px; }
body .organization-bar .context-field select { min-height: 40px; height: auto; }
body #authScreen { background: #f4f7f6; }
body #authScreen #login { padding: 32px; border-radius: var(--ui-panel-radius); }
body #authScreen p { color: var(--ui-muted); font-size: 14px; }
body #authScreen button { min-height: 40px; font-weight: 600; }
/* Standalone check-in and invitation setup pages share the same baseline. */
body:has(.checkin), body:has(#setup) { background: #f4f7f6; }
body .checkin, body:has(#setup) > main {
  padding: 24px;
  background: #fff;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-panel-radius);
}
body .checkin p, body:has(#setup) > main p { color: var(--ui-muted); }
body .checkin h1, body:has(#setup) h1 { font-size: 28px; }
body .checkin :is(input, select), body #setup input {
  min-height: 44px;
  font-family: var(--ui-body-font);
  font-size: 16px;
  padding: 10px 12px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius);
  color: var(--ui-text);
}
body .checkin button, body #setup button, body:has(#setup) .button {
  min-height: 44px;
  padding: 10px 16px;
  font-family: var(--ui-body-font);
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--ui-radius);
  background: var(--ui-accent);
  color: #fff;
}
@media (max-width: 760px) {
  :root { --ui-panel-padding: 16px; }
  body .console :is(header, .toolbar, .submission-toolbar) { gap: 12px; }
  body .console #headerActions { width: 100%; }
  body .console #headerActions button { flex: 1 1 auto; }
  body :is(.console, dialog, #authScreen) :is(input, select, textarea):not([type=checkbox]):not([type=radio]):not([type=color]):not([type=range]):not([type=hidden]):not(.rl-column-filter) { font-size: 16px; }
  body .console :is(.toolbar, .submission-toolbar, .rl-table-tools, .dialog-actions) button { min-height: 44px; }
  body .console .toolbar > input:not([type=checkbox]):not([type=radio]) { min-width: 0; flex-basis: 100%; }
  body .console .toolbar > select { min-width: 0; max-width: 100%; }
  body .console footer { flex-wrap: wrap; }
  body #authScreen #login { margin: 24px 16px; padding: 24px; }
  body dialog { padding: 20px; }
}
@media (forced-colors: active) {
  body :is(button, a, input, select, textarea, summary, [tabindex]):focus-visible { outline-color: Highlight; }
}
body .checkin button:disabled, body #setup button:disabled {
  opacity: 1;
  background: #edf1ef;
  color: #52636b;
  cursor: not-allowed;
}
body .console .palette button { min-height: 36px; }

/* Communications heading: keep context and Refresh together above the working form. */
body .console [data-communications-section] > .panel--intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 16px;
  align-items: center;
  padding: 16px 20px;
}
body .console [data-communications-section] > .panel--intro > h3 {
  grid-column: 1; grid-row: 1; margin: 0;
}
body .console [data-communications-section] > .panel--intro > .toolbar {
  grid-column: 2; grid-row: 1; margin: 0;
}
body .console [data-communications-section] > .panel--intro > p {
  grid-column: 1 / -1; margin: 0;
}
/* Scroll only the form body; keep close and Save/Cancel visible. */
body #dialog[open] { overflow: hidden; max-height: 90dvh; }
body #dialogForm {
  display: flex; flex-direction: column;
  max-height: calc(90dvh - 48px); min-height: 0;
}
body #dialogForm > .dialog-head { flex: 0 0 auto; }
body #dialogFields { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 3px 6px 6px 3px; }
body #dialogForm > #dialogError { flex: 0 0 auto; margin: 8px 0 0; }
body #dialogForm > #dialogError:empty { display: none; }
body #dialogForm > .dialog-actions {
  flex: 0 0 auto; margin-top: 16px; padding-top: 12px;
  border-top: 1px solid var(--ui-border); background: #fff; justify-content: flex-end;
}
@media (max-width: 760px) {
  body #dialogForm { max-height: calc(90dvh - 40px); }
  body .console [data-communications-section] > .panel--intro { padding: 16px; }
}

/* Readability pass 1.2: ancillary operational text must remain legible. */
body .console .badge { font-size: 12px; line-height: 1.5; font-weight: 600; white-space: normal; }
body .console .map-sidebar small,
body .console .map-popup small { font-size: 12px !important; line-height: 1.5; color: var(--ui-muted); }
body .console .map-popup { font-family: var(--ui-body-font); font-size: 14px; line-height: 1.5; }
body .console .map-popup b { font-size: 15px; }
body .console .fl-folder small { font-size: 12px; line-height: 1.5; }
body .console .mw-subtle { font-size: 12px; line-height: 1.5; }
body .console [class*="mw-"] label { font-size: 12px !important; line-height: 1.5; }
body .console .context-label,
body .console .eyebrow,
body dialog .eyebrow { font-size: 12px; line-height: 1.5; letter-spacing: 1px; }
body .console .command-account > span { font-size: 12px; }
body .console .stat strong { font-variant-numeric: tabular-nums; line-height: 1.2; }
body .console .situation-summary .stat strong { color: var(--ui-text); }
body .console .rl-sort-arrow { font-size: 12px; }

/* Assignment-picker tables live inside dialogs, outside the console container. */
body dialog th { font-family: var(--ui-body-font); font-size: 12px; line-height: 1.5; color: var(--ui-muted); }
body dialog td { font-family: var(--ui-body-font); font-size: 13px; line-height: 1.5; }
body dialog .rl-column-sort { font-family: var(--ui-body-font); font-size: 12px; line-height: 1.5; }
body dialog .rl-column-filter { font-family: var(--ui-body-font) !important; font-size: 12px !important; min-height: 34px; padding: 7px 8px !important; }
body dialog .rl-sort-arrow { font-size: 12px; }
body dialog .rl-table-tools button { min-height: 36px; padding: 7px 10px; }
body dialog .rl-table-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
