:root {
  color-scheme: light;
  --ink: #202327;
  --muted: #656a70;
  --line: #d9dcdf;
  --paper: #ffffff;
  --canvas: #f4f4f2;
  --fire: #a82024;
  --fire-dark: #7d171a;
  --ready: #23683c;
  --next: #8a5a13;
  --nav: #36434c;
  --nav-active: #b41f25;
  --nav-line: #66727a;
  --question-base: #eceeec;
  --question-tint: #f4f7f8;
}

* { box-sizing: border-box; }

/* Typed controls and toolbar components set display explicitly. Their hidden
   state must still win when the shared conditional rules exclude them. */
.inspection-editor [hidden] { display: none !important; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

a { color: var(--fire-dark); }

.site-header,
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.site-footer {
  color: var(--muted);
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  border-bottom: 0;
  font-size: .875rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}
.brand-logo { display: block; width: 2.6rem; height: 2.6rem; flex: 0 0 auto; object-fit: contain; }

.environment-label,
.status-tag {
  display: inline-block;
  padding: .2rem .55rem;
  border-radius: 0;
  background: #ececeb;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .02em;
}

.page-shell {
  width: min(70rem, calc(100% - 2rem));
  min-height: calc(100vh - 9rem);
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 2rem) 0;
}

.hero { max-width: 52rem; }
.compact-hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.compact-hero .lede { display: none; }
.eyebrow {
  margin: 0 0 .5rem;
  color: var(--fire);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

h1, h2 { line-height: 1.15; }
h1 { margin: 0; font-size: clamp(2.1rem, 6vw, 4.4rem); letter-spacing: -.04em; }
h2 { margin: .75rem 0 .5rem; }
.lede { color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.3rem); }

.status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 3rem 0;
}

.status-card,
.principles,
.message-page {
  padding: 1.4rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 0;
}

.status-card p,
.principles { color: var(--muted); }
.status-ready { color: var(--ready); background: #e5f2e9; }
.status-next { color: var(--next); background: #f7edd9; }
.status-danger { color: #fff; background: #b41f25; }
.principles { max-width: 52rem; }
.principles h2 { color: var(--ink); }
.principles li + li { margin-top: .45rem; }
.message-page { max-width: 38rem; }
.auth-card { margin-inline: auto; }

.button {
  display: inline-block;
  margin-top: 1rem;
  padding: .65rem 1rem;
  border-radius: 0;
  color: #fff;
  background: var(--fire);
  text-decoration: none;
}

.button:hover { background: var(--fire-dark); }

.stacked-form { display: grid; gap: 1rem; }
.stacked-form label { display: grid; gap: .35rem; font-weight: 700; }
input, select, textarea, button { font: inherit; }
button:not(:disabled),
.button:not([aria-disabled="true"]) { cursor: pointer; }
button:disabled,
.button[aria-disabled="true"] { cursor: not-allowed; }
input, select, textarea { width: 100%; padding: .7rem; border: 1px solid var(--line); border-radius: 0; background: var(--paper); }
.form-error { padding: .7rem; color: #7f1d1d; background: #fee2e2; border-radius: 0; }
.form-success { padding: .7rem; color: #14532d; background: #dcfce7; border-radius: 0; }
.auth-link { margin: 1rem 0 0; }
.link-button { padding: 0; border: 0; color: var(--fire-dark); background: transparent; text-decoration: underline; cursor: pointer; }
.header-menu { position: relative; margin-left: auto; }
.header-menu-toggle { display: grid; width: 2.25rem; height: 2.1rem; place-items: center; padding: 0; color: var(--ink); background: #f0f1f1; border: 1px solid var(--line); border-radius: 0; cursor: pointer; }
.header-menu-toggle:hover, .header-menu-toggle[aria-expanded="true"] { color: #fff; background: var(--fire); border-color: var(--fire); }
.header-menu-toggle svg { width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: square; }
.header-menu-panel { position: absolute; z-index: 30; top: calc(100% + .35rem); right: 0; width: 14rem; color: var(--ink); background: var(--paper); border: 1px solid #aeb3b7; box-shadow: 0 6px 18px rgb(20 25 28 / 18%); }
.header-menu-panel[hidden] { display: none; }
.header-menu-identity { padding: .65rem .75rem; background: #eef0f1; border-bottom: 1px solid var(--line); }
.header-menu-identity strong, .header-menu-identity small { display: block; }
.header-menu-identity small { color: var(--muted); text-transform: capitalize; }
.header-menu-panel nav { display: grid; }
.header-menu-panel nav a, .header-menu-signout button { display: block; width: 100%; padding: .55rem .75rem; color: var(--ink); background: var(--paper); border: 0; border-bottom: 1px solid var(--line); border-radius: 0; text-align: left; text-decoration: none; cursor: pointer; }
.header-menu-panel nav a:hover, .header-menu-panel nav a:focus, .header-menu-signout button:hover, .header-menu-signout button:focus { color: #fff; background: var(--fire); outline: none; }
.header-menu-signout { margin: 0; }
.header-menu-signout button { color: var(--fire-dark); border-bottom: 0; }
.inspection-list { padding-left: 1.2rem; }
.inspection-list li + li { margin-top: .7rem; }
.inspection-list small { display: block; color: var(--muted); }
.inspection-index { margin-top: 1rem; padding: .85rem; background: var(--paper); border: 1px solid var(--line); }
.inspection-index-heading { display: flex; justify-content: space-between; gap: 1rem; align-items: end; }
.inspection-index-heading h2 { margin: 0; }
.inspection-index-heading p { margin: .15rem 0 0; color: var(--muted); font-size: .82rem; }
.inspection-filters { display: grid; grid-template-columns: minmax(12rem, 1.3fr) minmax(10rem, 1fr) minmax(8rem, .75fr) minmax(9rem, .8fr) minmax(7rem, .65fr) minmax(7rem, .65fr) auto; gap: .45rem; align-items: end; margin: .65rem 0; padding: .6rem; background: #eef0f1; }
.inspection-filters label { display: grid; gap: .12rem; font-size: .78rem; font-weight: 700; }
.inspection-filters input, .inspection-filters select { padding: .42rem .48rem; border-radius: 0; }
.inspection-filter-actions { display: flex; gap: .3rem; }
.inspection-filter-actions .button { margin: 0; border-radius: 0; }
.inspection-table { border: 1px solid var(--line); border-bottom: 0; }
.inspection-table-header, .inspection-table-row { display: grid; grid-template-columns: minmax(13rem, 1.6fr) minmax(7rem, .65fr) minmax(10rem, 1fr) minmax(7rem, .65fr) auto; gap: .6rem; align-items: center; }
.inspection-table-shared .inspection-table-header, .inspection-table-shared .inspection-table-row { grid-template-columns: minmax(11rem, 1.45fr) minmax(6.5rem, .6fr) minmax(9rem, 1fr) minmax(8rem, .75fr) minmax(7rem, .65fr) auto; }
.inspection-table-header { padding: .38rem .55rem; color: #fff; background: var(--nav); font-size: .72rem; font-weight: 700; text-transform: uppercase; }
.inspection-table-row { min-height: 3.45rem; padding: .45rem .55rem; border-bottom: 1px solid var(--line); background: var(--question-tint); font-size: .82rem; }
.inspection-table-row:nth-child(odd) { background: var(--question-base); }
.inspection-table-row small { display: block; color: var(--muted); font-size: .72rem; }
.inspection-building strong { display: block; }
.inspection-row-actions { display: flex; justify-content: flex-end; gap: .3rem; align-items: center; }
.row-action { display: inline-block; padding: .3rem .48rem; color: var(--fire-dark); background: #fff; border: 1px solid var(--fire); text-decoration: none; white-space: nowrap; }
.row-action-button { border-radius: 0; font: inherit; cursor: pointer; }
.row-action:hover, .row-action:focus { color: #fff; background: var(--fire); }
.row-action-disabled { color: var(--muted); border-color: #bfc3c5; cursor: default; }
.row-action-disabled:hover { color: var(--muted); background: #fff; }
.trash-form, .clone-form { margin: 0; }
.trash-button { display: grid; width: 1.9rem; height: 1.9rem; place-items: center; padding: 0; color: #9c2024; background: #fff; border: 1px solid #b94b4f; border-radius: 0; cursor: pointer; }
.trash-button:hover, .trash-button:focus { color: #fff; background: #b41f25; }
.trash-button svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: square; stroke-linejoin: miter; }
.inspection-pagination { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: center; margin-top: .65rem; text-align: center; font-size: .82rem; }
.inspection-pagination > :last-child { justify-self: end; }
.inspection-empty { margin: .75rem 0 0; padding: 1rem; color: var(--muted); background: var(--canvas); text-align: center; }
.start-inspection { display: grid; grid-template-columns: 1fr minmax(18rem, 26rem); gap: 1rem 2rem; align-items: end; margin: 1.25rem 0; padding: 1rem; background: var(--paper); border: 1px solid var(--line); border-radius: 0; }
.start-inspection h2 { margin-top: 0; }
.start-inspection p { margin-bottom: 0; color: var(--muted); }
.start-inspection-form { display: grid; gap: .5rem; }
.start-inspection-form label { font-weight: 700; }
.start-inspection-form .button { width: 100%; border: 0; cursor: pointer; }
.search-label { display: block; margin: .5rem 0 .25rem; font-weight: 700; }
.building-results { grid-column: 1 / -1; display: grid; gap: 0; color: var(--muted); }
.building-result { display: flex; justify-content: space-between; align-items: center; gap: .6rem; min-height: 2.45rem; padding: .3rem .5rem; color: var(--ink); background: #eef1f3; border-top: 1px solid var(--line); border-radius: 0; }
.building-result:last-of-type { border-bottom: 1px solid var(--line); }
.building-result:nth-child(even) { background: #f6f6f4; }
.building-result strong { display: block; line-height: 1.15; }
.building-result small { display: block; margin-top: .08rem; color: var(--muted); font-size: .72rem; line-height: 1.15; }
.building-result-actions { display: flex; flex: 0 0 auto; gap: .25rem; align-items: center; }
.building-result-actions .compact-button { padding: .25rem .48rem; font-size: .76rem; }
.building-result-actions .row-action { padding: .22rem .4rem; font-size: .74rem; }
.danger-row-action { color: #8f171b; border-color: #b94b4f; }
.danger-row-action:hover, .danger-row-action:focus { color: #fff; background: #b41f25; }
.selector-message { grid-column: 1 / -1; margin: .5rem 0 0; }
.building-action { margin: 0; }
.compact-button { margin: 0; padding: .35rem .6rem; border: 1px solid var(--fire); font-size: .82rem; white-space: nowrap; cursor: pointer; }
.directory-note { margin: .25rem 0 0; font-size: .85rem; }

.admin-heading { display: flex; justify-content: space-between; gap: 1rem; align-items: end; margin-bottom: 1rem; }
.admin-heading h1 { font-size: 2rem; letter-spacing: -.02em; }
.admin-heading p:last-child { max-width: 52rem; margin: .35rem 0 0; color: var(--muted); }
.report-type-selector { display: grid; grid-template-columns: 10rem minmax(18rem, 36rem) auto; gap: .5rem; align-items: center; padding: .8rem; background: var(--nav); color: #fff; }
.report-type-selector label { font-weight: 700; }
.report-type-selector select { border-radius: 0; }
.admin-message { padding: .65rem .8rem; color: #14532d; background: #dcfce7; border: 1px solid #86c99a; }
.design-version-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin: .8rem 0; padding: .6rem .75rem; background: #e8eaeb; border: 1px solid var(--line); }
.design-version-bar small { display: block; color: var(--muted); }
.design-preview-panel { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .55rem 1rem; align-items: center; margin: .8rem 0; padding: .7rem .8rem; color: #27200e; background: #fff7d6; border: 1px solid #d89b16; }
.design-preview-panel h2, .design-preview-panel p { margin: 0; }
.design-preview-panel h2 { font-size: 1rem; }
.design-preview-panel p { margin-top: .18rem; font-size: .82rem; }
.design-preview-panel > form .button { margin: 0; }
.design-preview-list { display: grid; grid-column: 1 / -1; border-top: 1px solid #ddb95f; }
.design-preview-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: .45rem; align-items: center; padding: .4rem 0; border-bottom: 1px solid #ead79f; }
.design-preview-row:last-child { border-bottom: 0; }
.design-preview-row span, .design-preview-row small { display: block; }
.design-preview-row small { color: #6c5b2d; }
.design-preview-row form { margin: 0; }
.design-preview-row .danger-action { min-height: 1.8rem; padding: .25rem .45rem; cursor: pointer; }
.design-create-draft, .publish-panel { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .7rem .8rem; background: #fff8e8; border: 1px solid #d6aa59; }
.design-create-draft p, .publish-panel p { margin: 0; }
.design-create-draft .button, .publish-panel .button, .design-actions .button { margin: 0; border: 0; cursor: pointer; }
.report-design-form { display: grid; gap: .75rem; margin-top: .75rem; }
.design-panel { padding: .8rem; background: var(--paper); border: 1px solid var(--line); }
.design-panel h2 { margin: 0 0 .65rem; padding-bottom: .35rem; border-bottom: 1px solid var(--line); font-size: 1.05rem; }
.design-panel > label, .design-grid label, .appendix-row label { display: grid; gap: .15rem; font-weight: 700; }
.design-panel > label + label { margin-top: .55rem; }
.design-panel label small { color: var(--muted); font-weight: 400; }
.design-panel input, .design-panel select, .design-panel textarea { padding: .45rem .5rem; border-radius: 0; }
.design-panel textarea { line-height: 1.35; resize: vertical; }
.design-panel :disabled { color: #555; background: #f0f1f1; opacity: 1; }
.design-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem .8rem; }
.wide-field { grid-column: 1 / -1; }
.field-note, .asset-summary { margin: .45rem 0 0; color: var(--muted); font-size: .82rem; }
.appendix-editor { display: grid; gap: .55rem; }
.appendix-row { position: relative; display: grid; grid-template-columns: 1.3fr .8fr 1.7fr .75fr .7fr; gap: .45rem; align-items: end; margin: 0; padding: 2rem .55rem .55rem; border: 1px solid var(--line); background: var(--question-tint); }
.appendix-row legend { max-width: calc(100% - 14rem); padding: 0 .3rem; color: var(--fire-dark); font-weight: 700; }
.appendix-row > small { grid-column: 1 / -1; color: var(--muted); overflow-wrap: anywhere; }
.appendix-row .condition-inactive { opacity: .72; }
.appendix-add { display: grid; grid-template-columns: minmax(12rem, .8fr) minmax(18rem, 1.5fr) auto; gap: .45rem; align-items: end; margin: .55rem 0 .7rem; padding: .55rem; color: #fff; background: var(--nav); }
.appendix-add label { display: grid; gap: .15rem; font-weight: 700; }
.appendix-add input, .appendix-add select { padding: .42rem .5rem; border-radius: 0; }
.appendix-add .button { margin: 0; border-color: #fff; }
.appendix-add > small { grid-column: 1 / -1; }
.appendix-upload-field { grid-column: 1 / 3; }
.appendix-upload-note { margin-top: -.25rem; color: #e7edf0; }
.appendix-row-actions { position: absolute; top: .25rem; right: .45rem; display: flex; gap: .3rem; }
.appendix-row-actions .row-action { min-height: 1.7rem; padding: .18rem .42rem; background: var(--question-tint); cursor: pointer; font-size: .76rem; }
.appendix-row-actions .appendix-move { color: #34434b; border-color: #89949a; }
.appendix-row-actions .appendix-move:hover, .appendix-row-actions .appendix-move:focus { color: #fff; background: var(--nav); border-color: var(--nav); }
.appendix-row-actions .row-action:disabled { cursor: default; opacity: .45; }
.appendix-row-actions .row-action:disabled:hover, .appendix-row-actions .row-action:disabled:focus { color: #34434b; background: var(--question-tint); border-color: #89949a; }
.design-actions { display: flex; justify-content: flex-end; }
.publish-panel { margin-top: .75rem; background: #edf7f0; border-color: #86c99a; }
.design-history { margin-top: .75rem; padding: .7rem .8rem; background: var(--paper); border: 1px solid var(--line); }
.design-history h2 { margin: 0 0 .4rem; font-size: 1rem; }
.design-history ul { margin: 0; padding-left: 1.2rem; }
.design-history li + li { margin-top: .3rem; }
.user-create-panel { margin-bottom: .75rem; }
.user-create-form, .user-edit-form { display: grid; grid-template-columns: 1fr 1.25fr .7fr 1fr auto auto; gap: .55rem; align-items: end; }
.user-create-form label, .user-edit-form label, .signature-form label { display: grid; gap: .15rem; font-weight: 700; }
.user-create-form input, .user-create-form select, .user-edit-form input, .user-edit-form select, .signature-form input { padding: .45rem .5rem; border-radius: 0; }
.user-create-form .button, .user-edit-form .button, .signature-form .button { margin: 0; border: 0; cursor: pointer; }
.active-check { display: flex !important; align-items: center; gap: .35rem !important; min-height: 2.35rem; white-space: nowrap; }
.active-check input { width: auto; }
.user-list { display: grid; gap: .65rem; }
.user-card { padding: .7rem .8rem; background: var(--paper); border: 1px solid var(--line); }
.user-card-heading { display: flex; justify-content: space-between; gap: 1rem; align-items: start; margin-bottom: .55rem; }
.user-card-heading h2 { margin: 0; font-size: 1.05rem; }
.user-card-heading span:not(.status-tag) { color: var(--muted); font-size: .82rem; }
.user-edit-form { grid-template-columns: 1fr 1.25fr .7fr 1fr auto auto; }
.user-edit-form label small { color: var(--muted); font-weight: 400; }
.signature-admin { display: grid; grid-template-columns: 12rem minmax(18rem, 1fr); gap: .5rem .8rem; align-items: center; margin-top: .65rem; padding-top: .55rem; border-top: 1px solid var(--line); }
.signature-preview { display: flex; align-items: center; justify-content: center; height: 4.5rem; color: var(--muted); background: #f0f1f1; border: 1px solid var(--line); font-size: .78rem; }
.signature-preview img { display: block; max-width: 100%; max-height: 4.2rem; object-fit: contain; }
.signature-form { display: grid; grid-template-columns: 1fr auto; gap: .5rem; align-items: end; }
.signature-admin > small { grid-column: 2; color: var(--muted); }
.signature-account-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(20rem, .85fr); gap: .8rem; align-items: start; }
.signature-source-panel, .signature-review-panel { min-width: 0; }
.signature-method h3, .signature-current h3, .signature-proposed h3 { margin: 0; font-size: .9rem; }
.signature-method > p, .signature-preview-note { margin: .15rem 0 .45rem; color: var(--muted); font-size: .8rem; }
.signature-pad { display: block; width: 100%; height: 13rem; background-color: #fff; background-image: linear-gradient(45deg, #edf0f1 25%, transparent 25%), linear-gradient(-45deg, #edf0f1 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #edf0f1 75%), linear-gradient(-45deg, transparent 75%, #edf0f1 75%); background-position: 0 0, 0 10px, 10px -10px, -10px 0; background-size: 20px 20px; border: 1px solid #929da3; border-radius: 0; cursor: crosshair; touch-action: none; }
.signature-controls { display: flex; justify-content: flex-end; gap: .4rem; margin-top: .45rem; }
.signature-controls .button, .signature-method > .button, .signature-save-button { margin: 0; border-radius: 0; cursor: pointer; }
.signature-divider { display: flex; align-items: center; gap: .5rem; margin: .75rem 0; color: var(--muted); font-size: .72rem; font-weight: 700; text-transform: uppercase; }
.signature-divider::before, .signature-divider::after { height: 1px; flex: 1 1 auto; background: var(--line); content: ''; }
.signature-file-label { display: grid; gap: .15rem; margin-bottom: .4rem; font-weight: 700; }
.signature-file-label input { padding: .42rem .5rem; border-radius: 0; }
.signature-review-panel { position: sticky; top: .7rem; }
.signature-current, .signature-proposed { margin-bottom: .7rem; }
.signature-account-preview { display: flex; height: 9rem; align-items: center; justify-content: center; margin-top: .25rem; overflow: hidden; color: var(--muted); background-color: #fff; background-image: linear-gradient(45deg, #edf0f1 25%, transparent 25%), linear-gradient(-45deg, #edf0f1 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #edf0f1 75%), linear-gradient(-45deg, transparent 75%, #edf0f1 75%); background-position: 0 0, 0 10px, 10px -10px, -10px 0; background-size: 20px 20px; border: 1px solid #929da3; font-size: .78rem; }
.signature-account-preview img { display: block; max-width: 94%; max-height: 8rem; object-fit: contain; }
.signature-account-message { min-height: 1.5rem; margin: .35rem 0; font-size: .82rem; }
.signature-account-message[data-tone="ready"] { color: var(--ready); font-weight: 700; }
.signature-account-message[data-tone="warning"], .signature-account-message[data-tone="error"] { color: var(--fire-dark); font-weight: 700; }
.signature-save-button { width: 100%; border: 1px solid var(--fire); }
.signature-save-button:disabled { color: #747b7f; background: #e1e4e5; border-color: #b5bdc1; cursor: not-allowed; }
.activity-filters { display: grid; grid-template-columns: 11rem 11rem minmax(13rem, 1fr) auto; gap: .6rem; align-items: end; padding: .75rem; color: #fff; background: var(--nav); }
.activity-filters label:not(.active-check) { display: grid; gap: .15rem; font-weight: 700; }
.activity-filters input { padding: .42rem .5rem; }
.activity-filters .active-check { align-self: end; }
.activity-filters .button { border-color: #fff; }
.activity-note { margin: .4rem 0 .75rem; color: var(--muted); font-size: .8rem; }
.activity-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: .75rem; border: 1px solid var(--line); background: var(--paper); }
.activity-summary article { padding: .65rem .75rem; border-right: 1px solid var(--line); }
.activity-summary article:last-child { border-right: 0; }
.activity-summary span, .activity-summary strong { display: block; }
.activity-summary span { color: var(--muted); font-size: .72rem; font-weight: 700; text-transform: uppercase; }
.activity-summary strong { margin-top: .12rem; font-size: 1.45rem; line-height: 1.1; }
.activity-summary .activity-total { color: #fff; background: var(--fire); }
.activity-summary .activity-total span { color: #fff; }
.activity-summary-analytics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.activity-breakdowns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; margin-bottom: .75rem; }
.activity-table { font-size: .82rem; }
.activity-breakdown-table > div { display: grid; grid-template-columns: minmax(0, 1fr) 3rem; gap: .5rem; align-items: center; padding: .3rem .4rem; border-bottom: 1px solid var(--line); }
.activity-breakdown-table > div:nth-child(odd), .activity-detail-table > div:nth-child(even) { background: var(--question-tint); }
.activity-breakdown-table strong { text-align: right; }
.activity-empty { margin: .35rem 0; color: var(--muted); }
.activity-detail { margin-top: 0; }
.activity-detail-table > div { display: grid; grid-template-columns: 8rem minmax(12rem, 1.4fr) minmax(10rem, 1fr) minmax(9rem, 1fr); gap: .6rem; align-items: center; padding: .38rem .45rem; border-bottom: 1px solid var(--line); }
.activity-detail-table .activity-table-heading { color: #fff; background: var(--nav); font-size: .7rem; font-weight: 700; text-transform: uppercase; }
.activity-detail-table small { display: block; color: var(--muted); font-size: .7rem; }
.activity-detail-table > div > strong { text-align: right; }
.activity-archived { color: var(--muted); }
.private-audit-filters { grid-template-columns: 11rem 11rem minmax(10rem, 1fr) auto; }
.private-audit-filters > span { align-self: center; color: #d9e0e3; font-size: .78rem; }
.private-audit-summary { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.private-audit-list { display: grid; gap: .65rem; }
.private-audit-record { padding: .7rem .8rem; background: var(--paper); border: 1px solid var(--line); }
.private-audit-record.private-audit-priority { border-color: #b41f25; }
.private-audit-record > header { display: flex; justify-content: space-between; gap: 1rem; align-items: start; }
.private-audit-record h2 { margin: .35rem 0 .15rem; font-size: 1.05rem; }
.private-audit-record header p { margin: 0; color: var(--muted); font-size: .78rem; }
.private-audit-actors { max-width: 18rem; text-align: right; }
.private-audit-actors strong { display: block; color: var(--ink); }
.private-audit-counts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: .55rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: .76rem; }
.private-audit-counts span { padding: .35rem .45rem; border-right: 1px solid var(--line); }
.private-audit-counts span:last-child { border-right: 0; }
.private-audit-counts strong { margin-right: .18rem; color: var(--fire-dark); }
.private-audit-changes { margin-top: .55rem; }
.private-audit-changes h3 { margin: 0 0 .3rem; font-size: .82rem; text-transform: uppercase; }
.private-audit-changes > div { display: grid; grid-template-columns: 9rem minmax(0, 1fr) 16rem; gap: .5rem; padding: .28rem .4rem; border-bottom: 1px solid var(--line); font-size: .76rem; }
.private-audit-changes > div:nth-child(even) { background: var(--question-tint); }
.private-audit-changes small { color: var(--muted); text-align: right; }
.private-audit-events { margin-top: .5rem; font-size: .76rem; }
.private-audit-events summary { color: var(--fire-dark); cursor: pointer; font-weight: 700; }
.private-audit-events > div { margin-top: .3rem; border-top: 1px solid var(--line); }
.private-audit-events p { display: flex; justify-content: space-between; gap: 1rem; margin: 0; padding: .25rem .4rem; border-bottom: 1px solid var(--line); }
.private-audit-events p:nth-child(odd) { background: var(--question-tint); }
.private-audit-events p span, .private-audit-events small { color: var(--muted); }
.report-management-panel { margin-top: 0; }
.report-management-table .inspection-table-header, .report-management-table .inspection-table-row { grid-template-columns: minmax(14rem, 1.6fr) 5rem minmax(10rem, 1fr) 6rem auto; }

@media (max-width: 760px) {
  .status-grid { grid-template-columns: 1fr; }
  .start-inspection { grid-template-columns: 1fr; }
  .site-footer { align-items: flex-end; flex-direction: column; }
  .site-header { align-items: center; flex-direction: row; }
  .site-header .environment-label { display: none; }
  .report-type-selector, .design-grid, .appendix-row, .appendix-add, .user-create-form, .user-edit-form, .signature-admin, .signature-form, .signature-account-grid, .activity-filters, .activity-summary, .activity-breakdowns, .private-audit-summary { grid-template-columns: 1fr; }
  .wide-field, .appendix-row > small { grid-column: 1; }
  .design-create-draft, .publish-panel { align-items: stretch; flex-direction: column; }
  .design-preview-panel { grid-template-columns: 1fr; }
  .design-preview-panel > form, .design-preview-list { grid-column: 1; }
  .signature-admin > small { grid-column: 1; }
  .appendix-row { padding: .55rem; }
  .appendix-row legend { max-width: 100%; }
  .appendix-row-actions { position: static; grid-column: 1; justify-self: start; }
  .appendix-upload-field { grid-column: 1; }
  .signature-review-panel { position: static; }
  .signature-pad { height: 10rem; }
  .activity-summary article { border-right: 0; border-bottom: 1px solid var(--line); }
  .activity-summary article:last-child { border-bottom: 0; }
  .activity-detail-table .activity-table-heading { display: none; }
  .activity-detail-table > div { grid-template-columns: 1fr 1fr; gap: .35rem .75rem; margin-bottom: .5rem; border: 1px solid var(--line); }
  .activity-detail-table > div > :nth-child(2) { grid-column: 1 / -1; }
  .activity-detail-table [data-column]::before { display: block; color: var(--muted); content: attr(data-column); font-size: .66rem; font-weight: 700; text-transform: uppercase; }
  .private-audit-record > header { display: block; }
  .private-audit-actors { margin-top: .45rem !important; text-align: left; }
  .private-audit-counts { grid-template-columns: 1fr 1fr; }
  .private-audit-counts span:nth-child(2) { border-right: 0; }
  .private-audit-counts span:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .private-audit-changes > div { grid-template-columns: 1fr; gap: .1rem; }
  .private-audit-changes small { text-align: left; }
  .private-audit-events p { display: block; }
  .private-audit-events p span { display: block; margin-top: .08rem; }
  .inspection-index { padding: .55rem; }
  .inspection-filters { grid-template-columns: 1fr 1fr; }
  .inspection-filters > :first-child, .inspection-filter-actions { grid-column: 1 / -1; }
  .inspection-filter-actions .button { flex: 1 1 0; text-align: center; }
  .inspection-table { border: 0; }
  .inspection-table-header { display: none; }
  .inspection-table-row { grid-template-columns: 1fr 1fr; gap: .35rem .75rem; margin-bottom: .5rem; border: 1px solid var(--line); }
  .inspection-table-shared .inspection-table-row { grid-template-columns: 1fr 1fr; }
  .report-management-table .inspection-table-row { grid-template-columns: 1fr 1fr; }
  .inspection-building, .inspection-row-actions { grid-column: 1 / -1; }
  .inspection-table-row [data-column]::before { display: block; color: var(--muted); content: attr(data-column); font-size: .66rem; font-weight: 700; text-transform: uppercase; }
  .inspection-row-actions { justify-content: stretch; }
  .inspection-row-actions .row-action { flex: 1 1 auto; text-align: center; }
  .inspection-row-actions .clone-form { display: flex; flex: 1 1 auto; }
  .inspection-row-actions .clone-form .row-action { width: 100%; }
}

.inspection-page .site-header { padding: .45rem clamp(.75rem, 2vw, 1.5rem); font-size: .86rem; }
.inspection-page .brand-logo { width: 1.9rem; height: 1.9rem; }
.inspection-page .page-shell { width: min(92rem, calc(100% - 1.5rem)); min-height: calc(100vh - 3rem); padding: .55rem 0; }
.inspection-page .site-footer { display: none; }
.inspection-page *:not(input[type="radio"]) { border-radius: 0 !important; }
.inspection-editor h1 { font-size: 1rem; letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.definition-notice { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .9rem; padding: .65rem .75rem; color: #713f12; background: #fffbeb; border: 1px solid #f59e0b; border-radius: 0; font-size: .86rem; }
.definition-notice form { flex: 0 0 auto; }
.definition-notice .button { margin: 0; border: 1px solid var(--fire); }
.preview-inspection-notice { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .45rem; padding: .5rem .65rem; color: #fff; background: #9c1c20; border: 2px solid #ffb000; font-size: .78rem; }
.preview-inspection-notice .button { flex: 0 0 auto; margin: 0; color: #611013; background: #fff; border-color: #fff; }
.inspection-heading { display: flex; justify-content: space-between; gap: 1rem; align-items: center; min-height: 1.8rem; }
.inspection-title { display: flex; min-width: 0; align-items: baseline; gap: .45rem; }
.inspection-title > span { flex: 0 0 auto; color: var(--muted); font-size: .72rem; }
.help-toggle { display: inline-flex; flex: 0 0 auto; align-items: center; gap: .22rem; padding: .12rem .3rem; border: 1px solid var(--fire); color: var(--fire-dark); background: #fff; cursor: pointer; font-size: .68rem; font-weight: 700; line-height: 1.1; white-space: nowrap; }
.help-toggle svg { width: .8rem; height: .8rem; }
.help-toggle[aria-pressed="true"] { color: #fff; background: var(--fire); }
.overall-progress { min-width: 20rem; display: grid; grid-template-columns: auto auto; align-items: center; justify-content: end; gap: 0 .65rem; color: var(--muted); font-size: .74rem; }
.overall-progress strong { color: var(--ink); }
.overall-progress progress { grid-column: 1 / -1; }
progress { width: 100%; height: .35rem; accent-color: var(--ready); }
.connection-strip { display: flex; flex-wrap: wrap; gap: .25rem 1rem; padding: .3rem .45rem; margin: .25rem 0 .45rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); background: #fafbfb; font-size: .72rem; }
.connection-strip > span { display: inline-flex; align-items: center; gap: .32rem; }
.connection-strip > span::before { width: .55rem; height: .55rem; flex: 0 0 auto; border-radius: 50%; background: #00b7ff; box-shadow: 0 0 0 1px #006b94; content: ''; }
.inspection-editor[data-connection-state="online"] .connection-indicator::before, .sync-indicator[data-state="synced"]::before, .review-indicator[data-state="reviewed"]::before { background: #67ff2f; box-shadow: 0 0 0 1px #277d09; }
.inspection-editor[data-connection-state="degraded"] .connection-indicator::before, .sync-indicator[data-state="pending"]::before, .review-indicator[data-state="issues"]::before { background: #ffb000; box-shadow: 0 0 0 1px #9b6200; }
.inspection-editor[data-connection-state="offline"] .connection-indicator::before, .sync-indicator[data-state="conflict"]::before { background: #ff3038; box-shadow: 0 0 0 1px #970007; }
.inspection-workspace { display: grid; grid-template-columns: 13rem minmax(0, 1fr); gap: .65rem; align-items: start; }
.section-navigation { display: grid; gap: .5rem; position: sticky; top: .5rem; max-height: calc(100vh - 1rem); overflow-y: auto; }
.section-list { overflow: hidden; background: var(--nav); }
.section-nav-button { display: grid; width: 100%; grid-template-columns: minmax(0, 1fr) auto; gap: .1rem .35rem; align-items: baseline; text-align: left; padding: .38rem .46rem; border: 0; border-bottom: 1px solid var(--nav-line); border-radius: 0; color: #f6f8f9; background: transparent; cursor: pointer; font-size: .78rem; line-height: 1.15; }
.section-nav-button:last-child { border-bottom: 0; }
.section-nav-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.section-nav-button progress { grid-column: 1 / -1; }
.section-nav-button:hover { background: #414f59; }
.section-nav-button[aria-current="step"] { background: var(--nav-active); }
.section-nav-button[data-state="needsAttention"] { color: #17120a; background: #ffb000; }
.section-nav-button[data-state="needsAttention"] .section-state { color: #3f2b00; }
.section-nav-button[data-state="needsAttention"][aria-current="step"] { color: #fff; background: #d96c00; }
.section-nav-button[data-state="needsAttention"][aria-current="step"] .section-state { color: #fff2d9; }
.section-state { color: #cbd1d5; font-size: .64rem; white-space: nowrap; }
.section-nav-button progress { overflow: hidden; border-radius: 0; background: #222b31; }
.section-nav-button progress::-webkit-progress-bar { background: #222b31; }
.section-nav-button progress::-webkit-progress-value { background: #6fbc87; }
.section-nav-button progress::-moz-progress-bar { background: #6fbc87; }
.section-tools { display: grid; gap: .25rem; }
.inspection-section { padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 0; background: var(--paper); }
.inspection-section > h2 { margin: 0 0 .25rem; font-size: 1.12rem; }
.question { padding: .58rem .55rem; border-top: 1px solid #d8dcdd; background: var(--question-base); font-size: .88rem; }
.question[data-row-tone="tinted"] { background: var(--question-tint); }
.question:focus-within { background: #fff8f5; outline: 1px solid #e8c7c2; outline-offset: -1px; }
.question-group { display: flex; align-items: center; gap: .35rem; margin: .95rem .2rem .12rem; padding: .1rem 0; color: var(--fire-dark); font-size: .72rem; letter-spacing: .035em; text-transform: uppercase; }
.question-group::after { height: 1px; flex: 1 1 auto; margin-left: .15rem; background: #cfd6da; content: ''; }
.question-group-icon { width: .9rem; height: .9rem; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.question > label, .question legend, .question h3, .question-label { font-weight: 700; }
.question > label:not(.photo-picker) { display: block; margin-bottom: .12rem; }
.question fieldset { padding: 0; border: 0; }
.yes-no-field { display: grid; grid-template-columns: 1fr; gap: .12rem; }
.choice-options { display: inline-flex; width: max-content; gap: 0; }
.choice { display: block; margin: 0; white-space: nowrap; }
.choice input { position: absolute; width: 1px; height: 1px; padding: 0; opacity: 0; pointer-events: none; }
.choice-label { display: flex; min-width: 4.25rem; min-height: 2rem; align-items: center; justify-content: center; padding: .3rem .75rem; color: #28343c; background: #fff; border: 1px solid #7c878e; font-weight: 700; line-height: 1; cursor: pointer; }
.choice + .choice .choice-label { margin-left: -1px; }
.choice:hover .choice-label { background: #e7ecef; }
.choice input:checked + .choice-label { position: relative; z-index: 1; color: #fff; background: var(--nav-active); border-color: var(--nav-active); }
.choice input:focus-visible + .choice-label { position: relative; z-index: 2; outline: 3px solid #ffb000; outline-offset: 2px; }
.question[data-question-type="select"], .question[data-question-type="user"], .question[data-question-type="text"], .question[data-question-type="date"], .question[data-question-type="number"] { display: grid; grid-template-columns: 1fr; gap: .12rem; }
.question[data-question-type="select"] > label, .question[data-question-type="user"] > label, .question[data-question-type="text"] > label, .question[data-question-type="date"] > label, .question[data-question-type="number"] > label { margin-bottom: 0; }
.question[data-question-type="select"] > select, .question[data-question-type="user"] > select { max-width: 32rem; }
.question[data-question-type="text"] > input { max-width: 38rem; }
.question[data-question-type="date"] > input { max-width: 15rem; }
.question[data-question-type="number"] > input { max-width: 12rem; }
.question input, .question select, .question textarea { padding: .42rem .5rem; }
.question-help, .question-instruction { margin: .32rem 0 0; color: var(--muted); font-size: .78rem; }
.question-help { max-width: 52rem; margin-top: .12rem; color: #8c3538; line-height: 1.3; white-space: pre-line; }
.question-instruction.warning { color: #b42318; font-weight: 800; }
.question[data-question-type="photoRepeater"] { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .65rem; }
.question[data-question-type="photoRepeater"] h3 { margin: 0; font-size: .88rem; }
.question[data-question-type="photoRepeater"] .photo-rows, .question[data-question-type="photoRepeater"] .question-help { flex: 0 0 100%; }
.photo-picker { position: relative; overflow: hidden; cursor: pointer; }
.photo-picker input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.photo-rows { display: grid; gap: .5rem; }
.photo-row { display: grid; grid-template-columns: 9rem 1fr; gap: 1rem; align-items: center; padding: .75rem; border: 1px solid var(--line); border-radius: 0; }
.photo-row img { width: 9rem; height: 7rem; object-fit: cover; border-radius: 0; }
.photo-row label { display: grid; gap: .35rem; font-weight: 700; }
.question[data-question-type="structuredRepeater"] { padding: .7rem .55rem; }
.structured-repeater-heading, .structured-row-heading { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.structured-repeater-heading h3, .structured-row-heading h4 { margin: 0; }
.structured-rows { display: grid; gap: .65rem; margin-top: .5rem; }
.structured-row { background: #fff; border: 1px solid #c9ced1; }
.structured-row-heading { padding: .35rem .5rem; color: #fff; background: var(--nav); }
.structured-row-heading h4 { font-size: .82rem; }
.structured-field { padding: .45rem .55rem; border-top: 1px solid #e0e3e4; background: var(--question-tint); }
.structured-field:nth-child(odd) { background: var(--question-base); }
.structured-field > label { display: grid; gap: .1rem; font-weight: 700; }
.structured-field input:not([type="radio"]), .structured-field select, .structured-field textarea { width: 100%; max-width: 42rem; padding: .36rem .45rem; }
.structured-field select[multiple] { min-height: 5.5rem; }
.structured-field .choice-options { margin-top: .12rem; }
.structured-photo-field { display: grid; grid-template-columns: minmax(7rem, 10rem) minmax(0, 1fr); gap: .35rem .7rem; align-items: center; }
.structured-photo-field > label:first-of-type { grid-column: 1 / -1; font-weight: 700; }
.structured-photo-field img { width: 10rem; height: 7rem; object-fit: cover; }
.structured-photo-field .photo-picker { width: max-content; margin: 0; }
.text-button { padding: 0; border: 0; color: inherit; background: transparent; font: inherit; text-decoration: underline; cursor: pointer; }
.danger-text { color: #ffb6b8; }
.inspection-editor .button { margin-top: .35rem; padding: .42rem .65rem; font-size: .8rem; }
.secondary-button { color: var(--fire-dark); background: var(--paper); border: 1px solid var(--fire); }
.secondary-button:hover { color: #fff; }
.review-button, .section-navigation .button { width: 100%; margin: 0; text-align: center; border: 1px solid var(--fire); }
.section-actions { display: flex; justify-content: space-between; gap: 1rem; margin-top: .45rem; }
.editor-message { padding: .8rem 1rem; margin-bottom: 1rem; background: #eef2ff; border-radius: 0; }
.editor-message[data-tone="error"] { color: #7f1d1d; background: #fee2e2; }
.editor-message[data-tone="success"] { color: #14532d; background: #dcfce7; }
.review-issues { padding: .8rem 1rem; margin-bottom: 1rem; border: 1px solid #f59e0b; border-radius: 0; background: #fffbeb; }
.review-issues h2 { margin-top: 0; font-size: 1rem; }
.review-issues ul { margin-bottom: 0; padding-left: 1.25rem; }
.review-issue-link { padding: 0; border: 0; color: #92400e; background: transparent; text-align: left; text-decoration: underline; cursor: pointer; }

@media (max-width: 760px) {
  .inspection-page .site-header { align-items: center; flex-direction: row; padding: .35rem .6rem; }
  .inspection-page .site-header .environment-label { display: none; }
  .inspection-page .page-shell { width: calc(100% - .6rem); padding: .3rem 0; }
  .definition-notice { align-items: stretch; flex-direction: column; }
  .inspection-heading { align-items: center; }
  .inspection-editor h1 { font-size: .88rem; }
  .help-toggle { padding: .1rem .25rem; }
  .help-toggle svg { width: .75rem; height: .75rem; }
  .overall-progress { min-width: 7.5rem; grid-template-columns: 1fr; gap: 0; text-align: right; }
  .overall-progress strong { display: none; }
  .overall-progress progress { grid-column: 1; }
  .inspection-workspace { grid-template-columns: 1fr; }
  .section-navigation { position: sticky; z-index: 5; top: 0; display: flex; max-height: none; gap: .4rem; overflow-x: auto; padding: .2rem 0; background: var(--canvas); scrollbar-width: thin; }
  .section-list { display: flex; flex: 0 0 auto; }
  .section-nav-button { flex: 0 0 9rem; border-right: 1px solid var(--nav-line); border-bottom: 0; }
  .section-nav-button:last-child { border-right: 0; }
  .section-tools { display: flex; flex: 0 0 auto; gap: .25rem; }
  .section-navigation .button { flex: 0 0 auto; width: auto; white-space: nowrap; }
  .section-stage { grid-row: 2; }
  .choice-options { justify-content: flex-start; padding-right: 0; }
  .photo-row { grid-template-columns: 1fr; }
  .photo-row img { width: 100%; height: 12rem; }
  .structured-photo-field { grid-template-columns: 1fr; }
  .structured-photo-field img { width: 100%; height: 12rem; }
}
