/* TECTUM CRM design-v1 — observed website tokens, not an official brand manual.
   Navy #00022C · action #0048BA · red #C10405 · canvas #F4F6FA
   Provenance: brand/PROVENANCE.txt */

:root {
  --navy: #00022c;
  --action: #0048ba;
  --action-press: #003a96;
  --red: #c10405;
  --canvas: #f3f2ef;
  --surface: #ffffff;
  --surface-2: #eef2f7;
  --text: #17213a;
  --muted: #596579;
  --border: #dde3ed;
  --shadow: 0 1px 2px rgba(23, 33, 58, 0.06), 0 8px 24px rgba(23, 33, 58, 0.06);
  --ok: #157a3a;
  --ok-bg: #e7f6ec;
  --warn: #9a6200;
  --warn-bg: #fff4d6;
  --danger: #c10405;
  --danger-bg: #fdecec;
  --focus: #0048ba;
  --link: #0048ba;
  --control-outline: #b7c3d4;
  --sidebar: #00022c;
  --sidebar-text: #f4f6fa;
  --sidebar-muted: #b7c0d1;
  --sidebar-active: #ffffff;
  --sidebar-marker: #0048ba;
  --radius: 10px;
  --radius-sm: 8px;
  --space: 8px;
  --page: 24px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Menlo, monospace;
}

html[data-theme="dark"] {
  --canvas: #0e1420;
  --surface: #161d2b;
  --surface-2: #1e2738;
  --text: #e8edf5;
  --muted: #9aa6b8;
  --border: #2c3648;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 10px 28px rgba(0, 0, 0, 0.28);
  --ok: #5dca86;
  --ok-bg: #163423;
  --warn: #e2b34d;
  --warn-bg: #3a2d12;
  --danger: #ff6b6b;
  --danger-bg: #3a1518;
  --focus: #8cb6ff;
  --link: #8cb6ff;
  --control-outline: #6b7a94;
  --sidebar: #00022c;
  --sidebar-text: #f4f6fa;
  --sidebar-muted: #b7c0d1;
  --sidebar-active: #ffffff;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  background: var(--canvas);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--link); }
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.preview-notice {
  position: sticky;
  top: 0;
  z-index: 40;
  text-align: center;
  background: var(--navy);
  color: #f4f6fa;
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 6px 12px;
  border-bottom: 2px solid var(--red);
}

.app-shell { display: flex; min-height: calc(100vh - 30px); }
.sidebar {
  width: 268px;
  flex: 0 0 268px;
  background: var(--sidebar);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  padding: 16px 12px 20px;
  min-height: calc(100vh - 30px);
}
.drawer-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.drawer-close {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
  color: var(--sidebar-text);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.brand { padding: 4px 8px 16px; }
.brand img { display: block; width: 148px; height: auto; }
.brand small {
  display: block;
  margin-top: 8px;
  color: var(--sidebar-muted);
  font-size: 11px;
  font-weight: 400;
}

.nav-label {
  margin: 4px 10px 8px;
  color: #aebcdb;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.nav { display: flex; flex-direction: column; gap: 0; flex: 1; overflow: auto; }
.nav-dept { border-bottom: 1px solid #25294f; padding: 2px 0; }
.nav-dept summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #e4eaff;
  padding: 12px 8px;
  min-height: 44px;
}
.nav-dept summary::-webkit-details-marker { display: none; }
.nav-dept summary::before {
  content: "›";
  font-size: 18px;
  line-height: 1;
  transition: transform 0.15s ease;
}
.nav-dept[open] > summary { color: #fff; }
.nav-dept[open] > summary::before { transform: rotate(90deg); }
.nav-children {
  border-left: 1px solid #465278;
  margin: 0 0 8px 16px;
  padding-left: 8px;
}
.nav .group {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sidebar-muted);
  margin: 14px 10px 6px;
}
.nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: var(--sidebar-text);
  min-height: 40px;
  padding: 8px 10px 8px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  position: relative;
}
.nav button svg { flex: 0 0 18px; width: 18px; height: 18px; stroke: currentColor; fill: none; }
.nav button:hover { background: rgba(255, 255, 255, 0.06); }
.nav button.active {
  background: rgba(0, 72, 186, 0.28);
  color: var(--sidebar-active);
}
.nav button.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--sidebar-marker);
}

.preview-tools {
  margin-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 10px;
  color: var(--sidebar-text);
}
.preview-tools summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--sidebar-muted);
  padding: 8px 8px;
  min-height: 36px;
}
.preview-tools[open] summary { color: var(--sidebar-text); }
.preview-note {
  font-size: 11px;
  color: var(--sidebar-muted);
  padding: 0 8px 8px;
  line-height: 1.4;
}
.preview-tools label {
  display: block;
  font-size: 11px;
  color: var(--sidebar-muted);
  margin: 4px 8px;
}
.preview-tools select {
  width: calc(100% - 16px);
  margin: 0 8px 8px;
  background: #0b1020;
  color: #f4f6fa;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-sm);
  min-height: 40px;
  padding: 8px 10px;
}
.preview-nav { display: flex; flex-direction: column; gap: 2px; padding: 0 4px; }
.preview-nav button {
  text-align: left;
  background: transparent;
  border: 0;
  color: var(--sidebar-text);
  min-height: 36px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.preview-nav button:hover,
.preview-nav button.active { background: rgba(255, 255, 255, 0.08); }

.workspace { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px var(--page) 8px;
  background: var(--canvas);
}
.page-heading { flex: 1; min-width: 0; }
.page-kicker {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.topbar h1, #page-title {
  margin: 2px 0 0;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-tools {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex: 1 1 280px;
  min-width: 0;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.search-box { position: relative; flex: 1; min-width: 140px; }
.search-box input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--control-outline);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}
.search-results {
  position: absolute;
  z-index: 18;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  max-height: 320px;
  overflow: auto;
}
.search-results button,
.quick-menu-list button,
.new-menu-list button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  min-height: 40px;
  padding: 6px 12px;
  cursor: pointer;
  color: var(--text);
}
.search-results button[aria-selected="true"],
.search-results button:hover,
.quick-menu-list button:hover,
.new-menu-list button:hover { background: var(--surface-2); }
.search-hit-type {
  display: block;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.search-empty { padding: 16px; color: var(--muted); }
#btn-create-ai { min-height: 40px; white-space: nowrap; }
.new-menu-list { min-width: 280px; max-height: min(82vh, 720px); overflow: auto; padding: 4px 0; }
.new-group { padding: 2px 0 4px; border-bottom: 1px solid var(--border); }
.new-group:last-child { border-bottom: 0; }
.new-group-label {
  margin: 0;
  padding: 6px 12px 2px;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.new-menu, .quick-menu { position: relative; }
.new-menu summary, .quick-menu summary {
  list-style: none;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--control-outline);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
}
.new-menu summary::-webkit-details-marker,
.quick-menu summary::-webkit-details-marker { display: none; }
.new-menu-list, .quick-menu-list {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 18;
  min-width: 240px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.job-shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: start; }
.job-rail {
  position: sticky;
  top: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  box-shadow: var(--shadow);
}
.job-identity h2 { margin: 0 0 4px; font-size: 16px; overflow-wrap: break-word; }
.job-identity-bar {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  box-shadow: var(--shadow);
}
.job-identity-bar .btn-back-jobs,
.job-identity-bar .btn-fav-current { min-height: 44px; }
.job-nav { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; }
.job-nav button {
  text-align: left;
  background: transparent;
  border: 0;
  color: var(--text);
  min-height: 40px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.job-nav button.active { background: rgba(0, 72, 186, 0.12); color: var(--link); }
.job-body {
  min-width: 0;
  container-type: inline-size;
}
.section-picker {
  display: none;
  width: 100%;
  min-height: 44px;
  margin-bottom: 12px;
}
.section-drawer {
  display: none;
  position: fixed;
  z-index: 32;
  top: 30px;
  right: 0;
  bottom: 0;
  width: min(320px, 92vw);
  background: var(--surface);
  color: var(--text);
  border-left: 1px solid var(--border);
  padding: 16px;
  overflow: auto;
}
.section-drawer .drawer-close {
  display: inline-flex;
  color: var(--text);
  border-color: var(--control-outline);
  background: var(--surface-2);
}
.section-backdrop {
  display: none;
  position: fixed;
  inset: 30px 0 0;
  background: rgba(23, 33, 58, 0.45);
  z-index: 31;
}
body.section-open .section-drawer { display: block; }
body.section-open .section-backdrop { display: block; }
.star-btn {
  min-width: 44px;
  min-height: 40px;
  border: 1px solid var(--control-outline);
  background: var(--surface);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.star-btn[aria-pressed="true"] { color: var(--action); }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.tabs button[aria-selected="true"] { background: var(--action); color: #fff; border-color: var(--action); }
.schedule-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}
.schedule-grid .day {
  min-height: 64px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px;
  background: var(--surface);
  font-size: 12px;
}
.schedule-grid .day.has-appt { border-color: var(--link); }
.schedule-grid .day button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--link);
  cursor: pointer;
  padding: 0;
  min-height: 28px;
}
.fav-row { display: flex; align-items: center; gap: 8px; }
.menu-btn {
  display: none;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  min-width: 44px;
  padding: 8px 12px;
  border: 1px solid var(--control-outline);
  background: var(--surface);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.menu-icon {
  width: 16px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 -5px currentColor, 0 5px currentColor;
}

.theme-switch {
  display: inline-flex;
  border: 1px solid var(--control-outline);
  border-radius: 999px;
  background: var(--surface);
  padding: 2px;
}
.theme-switch button {
  border: 0;
  background: transparent;
  min-height: 32px;
  padding: 4px 12px;
  border-radius: 999px;
  cursor: pointer;
  color: var(--muted);
}
.theme-switch button[aria-pressed="true"] {
  background: var(--action);
  color: #fff;
}

.main { padding: 8px var(--page) 40px; overflow-x: hidden; container-type: inline-size; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
}
.toolbar h1 { display: none; }
.toolbar > select { min-height: 40px; max-width: 280px; }

.btn, button.btn {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--control-outline);
  border-radius: var(--radius-sm);
  min-height: 40px;
  padding: 8px 14px;
  cursor: pointer;
}
.btn:hover { border-color: var(--link); }
.btn.primary { background: var(--action); border-color: var(--action); color: #fff; }
.btn.primary:hover { background: var(--action-press); }
.btn.ok { background: var(--ok-bg); border-color: #b7e0c4; color: var(--ok); }
.btn.warn { background: var(--warn-bg); border-color: #f0d48a; color: var(--warn); }
.btn.danger { background: var(--danger-bg); border-color: #f3b4b4; color: var(--danger); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-touch { min-height: 48px; padding: 12px 16px; font-size: 16px; width: 100%; }

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.kpi-row { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.card h2, .card h3 { margin: 0 0 8px; font-size: 15px; }
.muted { color: var(--muted); font-size: 13px; }
.kpi { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
}
.chip svg { width: 12px; height: 12px; }
.chip.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.chip.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.chip.danger { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
.chip.demo { background: var(--surface-2); }
.chip.emergency { background: var(--danger-bg); color: var(--danger); }

.badge { composes: chip; }
.badge,
.badge.ok, .badge.warn, .badge.danger, .badge.demo, .badge.emergency {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.badge.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.badge.danger, .badge.emergency { background: var(--danger-bg); color: var(--danger); border-color: transparent; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.estimate-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 320px);
  gap: 16px;
  align-items: start;
}
.estimate-table-card { min-width: 0; }
.estimate-table-card .table-wrap { overflow-x: auto; max-width: 100%; }
.estimate-table-card table { width: 100%; min-width: 0; }
.estimate-table-card th:first-child,
.estimate-table-card td:first-child { overflow-wrap: break-word; word-break: normal; }
.estimate-totals-card { width: 100%; }
/* Nearest container: .job-body in a job workspace, .main for company Estimates. */
@container (max-width: 760px) {
  .estimate-layout { grid-template-columns: 1fr; }
}
th { color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
td.num, th.num, .num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 13px; }
.totals { display: grid; gap: 8px; }
.totals div { display: flex; justify-content: space-between; gap: 12px; }
.totals .grand { font-size: 16px; font-weight: 700; padding-top: 8px; border-top: 1px solid var(--border); }

.empty {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  color: var(--muted);
  background: var(--surface);
}
.error-banner, .warn-banner, .ok-banner {
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 14px;
}
.error-banner { background: var(--danger-bg); border: 1px solid #f3b4b4; color: var(--danger); }
.warn-banner { background: var(--warn-bg); border: 1px solid #f0d48a; color: var(--warn); }
.ok-banner { background: var(--ok-bg); border: 1px solid #b7e0c4; color: var(--ok); }

.toast-wrap { position: fixed; right: 16px; bottom: 16px; z-index: 20; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  background: var(--navy);
  color: #f4f6fa;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  max-width: 320px;
  font-size: 13px;
}

.field-layout { max-width: 640px; margin: 0 auto; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mono { font-family: var(--mono); font-size: 12px; }
.hr { border: none; border-top: 1px solid var(--border); margin: 12px 0; }
.hidden { display: none !important; }
.pass { color: var(--ok); }
.fail { color: var(--danger); }
.check-list li { margin: 6px 0; }
.journey-steps { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.journey-steps .step {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.journey-steps .step.done { border-color: #b7e0c4; color: var(--ok); }
.journey-steps .step.current { border-color: var(--link); color: var(--link); }

.photo-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.photo-card { margin: 0; width: 220px; }
.photo-card img {
  width: 100%;
  height: 128px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.photo-card figcaption { font-size: 12px; color: var(--muted); margin-top: 4px; }
.report-doc { line-height: 1.5; }
.report-doc h3 { margin-bottom: 8px; }
.form-card label, .card label { display: block; font-size: 13px; color: var(--muted); margin-top: 8px; }
.form-card .req { color: var(--danger); font-size: 12px; }
.intake-result { margin: 8px 0; }
.worked-example { margin-top: 8px; }
.worked-example summary { cursor: pointer; color: var(--muted); }
.card input, .card select, .card textarea, .toolbar select, .toolbar input {
  width: 100%;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--control-outline);
  border-radius: var(--radius-sm);
  min-height: 40px;
  padding: 8px 10px;
}
.card textarea { min-height: 72px; resize: vertical; }
.conflict-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-top: 8px;
}

.queue-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.queue-item:last-child { border-bottom: 0; }
.queue-item button { justify-self: end; }

.nav-backdrop {
  display: none;
  position: fixed;
  inset: 30px 0 0;
  background: rgba(23, 33, 58, 0.45);
  z-index: 25;
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    z-index: 30;
    top: 30px;
    left: 0;
    bottom: 0;
    transform: translateX(-100%);
    transition: transform 0.2s ease, visibility 0.2s ease;
    min-height: auto;
    overflow: auto;
    visibility: hidden;
  }
  .sidebar:not([inert]) {
    visibility: visible;
  }
  body.nav-open .sidebar { transform: translateX(0); visibility: visible; }
  body.nav-open .nav-backdrop { display: block; }
  .drawer-close { display: inline-flex; }
  .menu-btn { display: inline-flex; }
  .kpi-row { grid-template-columns: 1fr; }
  .topbar {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "menu theme"
      "title title"
      "tools tools";
    align-items: center;
    gap: 8px 12px;
    padding: 12px 16px 8px;
  }
  .menu-btn { grid-area: menu; }
  .topbar-actions { grid-area: theme; justify-self: end; }
  .page-heading { grid-area: title; min-width: 0; }
  .topbar-tools { grid-area: tools; flex-wrap: wrap; }
  #btn-create-ai { min-height: 44px; }
  #page-title {
    overflow: visible;
    white-space: normal;
    word-break: break-word;
    font-size: 20px;
  }
  .job-shell { grid-template-columns: 1fr; }
  .job-rail { display: block; position: static; }
  .job-nav { flex-direction: row; flex-wrap: wrap; }
  .job-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 8px 10px;
    text-decoration: none;
    color: inherit;
  }
  .topbar-actions { flex-wrap: wrap; justify-content: flex-end; max-width: 100%; }
  .topbar h1, .decision-card h2, .home-hello { overflow-wrap: anywhere; }
  .main table { display: block; width: 100%; max-width: 100%; overflow-x: auto; }
  .job-identity-bar { display: block; }
  .section-picker { display: inline-flex; }
  .nav button {
    align-items: flex-start;
    white-space: normal;
    overflow-wrap: break-word;
  }
  .theme-switch button {
    min-height: 44px;
    min-width: 44px;
    padding: 8px 14px;
  }
  .main { padding: 8px 16px 32px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .field-layout { max-width: 100%; }
  .photo-card { width: 100%; }
  .card input, .card select, .card textarea { font-size: 16px; min-height: 44px; }
  .btn, button.btn { min-height: 44px; }
}

@media (max-width: 390px) {
  #page-title { font-size: 20px; }
  .brand img { width: 128px; }
}
