@font-face {
  font-family: "Saira Condensed";
  src: url("/fonts/saira-condensed-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --mh-sky-700: #0f59a1;
  --mh-sky-500: #3585c8;
  --mh-dune-600: #c24a12;
  --mh-dune-500: #df5515;
  --mh-river-500: #676642;
  --mh-navy-900: #0d2b3e;
  --mh-navy-800: #143c56;
  --mh-ink-900: #1d1e1b;
  --mh-ink-700: #343630;
  --mh-ink-600: #4a4c47;
  --mh-paper-50: #f7f3ea;
  --mh-paper-100: #f0e9da;
  --mh-paper-200: #e4dac5;
  --mh-tile-border: #8a8770;
  --mh-white: #ffffff;
  --risk-low: #43b05c;
  --risk-medium: #f2c230;
  --risk-high: #e0742b;
  --risk-extreme: #b3401e;
  --status-ok: #43b05c;
  --status-warn: #e0742b;
  --status-fail: #b3401e;
  --shadow-card: 0 1px 2px rgba(29, 30, 27, 0.06), 0 4px 14px rgba(29, 30, 27, 0.07);
  --wrap-max: 1180px;
  --wrap-pad: clamp(18px, 4vw, 48px);
  --bottom-space: calc(100px + env(safe-area-inset-bottom));
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: clip;
  max-width: 100%;
  min-height: 100%;
  background: var(--mh-paper-50);
  color: var(--mh-ink-600);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  overflow-x: clip;
  max-width: 100%;
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(20, 60, 86, 0.04), rgba(20, 60, 86, 0) 220px),
    var(--mh-paper-50);
}

a {
  color: var(--mh-sky-700);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  touch-action: manipulation;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: calc(12px + env(safe-area-inset-top)) var(--wrap-pad) 12px;
  border-bottom: 1px solid rgba(228, 218, 197, 0.9);
  background: rgba(247, 243, 234, 0.96);
  backdrop-filter: blur(12px);
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  color: var(--mh-ink-900);
  text-decoration: none;
}

.brand-icon {
  width: 46px;
  height: 46px;
  border-radius: 22%;
  box-shadow: var(--shadow-card);
}

.brand-text {
  display: grid;
  gap: 0;
  margin-left: 14px;
  color: var(--mh-ink-900);
  font-family: "Saira Condensed", "Arial Narrow", sans-serif;
  font-size: 24px;
  font-weight: 700;
  line-height: 0.92;
}

.status-pill,
.doc-count,
.eyebrow,
.summary-label,
.login-form label,
.search-field span,
.field-label > span,
.choice-group legend,
.record-type,
.record-stamp,
.sync-badge,
.card-sub {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--mh-paper-200);
  border-radius: 999px;
  background: var(--mh-white);
  color: var(--mh-ink-600);
  font-size: 12px;
}

.status-pill.is-online {
  border-color: rgba(67, 176, 92, 0.35);
  background: rgba(67, 176, 92, 0.12);
  color: #245f32;
}

.status-pill.is-offline {
  border-color: rgba(224, 116, 43, 0.4);
  background: rgba(224, 116, 43, 0.12);
  color: var(--status-fail);
}

.status-pill.is-local {
  border-color: rgba(109, 108, 93, 0.35);
  background: rgba(109, 108, 93, 0.1);
  color: var(--mh-ink-600);
}

.app-main {
  width: min(var(--wrap-max), 100%);
  margin: 0 auto;
  padding: 32px var(--wrap-pad) var(--bottom-space);
}

.auth-panel,
.shell,
.screen-root,
.field-form {
  display: grid;
  gap: 24px;
}

.auth-panel {
  max-width: 560px;
  min-height: calc(100vh - 180px);
  align-content: center;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  padding: 28px;
  border: 1px solid var(--mh-paper-200);
  border-radius: 8px;
  background: var(--mh-white);
  box-shadow: var(--shadow-card);
}

.compact-hero {
  align-items: start;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--mh-navy-800);
  font-size: 12px;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--mh-ink-900);
  font-family: "Saira Condensed", "Arial Narrow", sans-serif;
  font-weight: 700;
  line-height: 0.98;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(40px, 7vw, 68px);
}

h2 {
  font-size: clamp(26px, 4vw, 38px);
}

h3 {
  font-size: 22px;
}

p {
  line-height: 1.55;
}

.lede {
  max-width: 680px;
  margin: 16px 0 0;
  color: var(--mh-ink-600);
  font-size: 19px;
  line-height: 1.55;
}

.login-form,
.toolbar {
  display: grid;
  gap: 14px;
  max-width: 560px;
}

.login-form label,
.search-field span,
.field-label > span,
.choice-group legend {
  display: block;
  color: var(--mh-ink-900);
  font-size: 12px;
}

.field-label {
  display: block;
  min-width: 0;
}

.login-form input,
.search-field input,
.field-label input:not([type="checkbox"]):not([type="radio"]),
.field-label select,
.field-label textarea,
.app-table input:not([type="checkbox"]):not([type="radio"]),
.app-table textarea {
  width: 100%;
  min-height: 54px;
  margin-top: 8px;
  padding: 12px 14px;
  border: 1px solid #8a8770;
  border-radius: 8px;
  background: var(--mh-white);
  color: var(--mh-ink-900);
  font-size: 16px;
}

textarea,
.field-label textarea,
.app-table textarea {
  min-height: 92px;
  resize: vertical;
}

.auto-grow {
  overflow: hidden;
  resize: none;
}

.login-form input:focus,
.search-field input:focus,
.field-label input:focus,
.field-label select:focus,
.field-label textarea:focus,
.app-table input:focus,
.app-table textarea:focus,
.btn:focus-visible,
.doc-link:focus-visible,
.action-card:focus-visible,
.choice input:focus-visible,
.table-check input:focus-visible {
  outline: 3px solid rgba(53, 133, 200, 0.45);
  outline-offset: 2px;
}

.btn,
.doc-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

/* Honour the HTML hidden attribute on buttons/links (the display above would otherwise
   override it), so the install controls actually hide until beforeinstallprompt fires. */
.btn[hidden],
.doc-link[hidden] {
  display: none;
}

.btn-primary {
  background: #c24a12;
  color: var(--mh-white);
}

.btn-primary:hover,
.btn-primary:active {
  background: #a3380d;
}

.btn-secondary,
.doc-link {
  border-color: var(--mh-paper-200);
  background: var(--mh-white);
  color: var(--mh-navy-800);
}

.btn-secondary:hover,
.doc-link:hover {
  border-color: rgba(53, 133, 200, 0.45);
}

.btn:disabled {
  opacity: 0.68;
  cursor: wait;
}

.sync-spinner {
  width: 16px;
  height: 16px;
  margin-right: 8px;
  border: 2px solid rgba(20, 60, 86, 0.25);
  border-top-color: var(--mh-navy-800);
  border-radius: 50%;
  animation: sync-spin 0.8s linear infinite;
}

@keyframes sync-spin {
  to {
    transform: rotate(360deg);
  }
}

.form-message,
.notice {
  margin: 0;
  color: var(--mh-ink-600);
  line-height: 1.5;
}

.notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(224, 116, 43, 0.35);
  border-radius: 8px;
  background: #fff7ef;
  color: var(--mh-ink-900);
}

.notice-undo {
  border-color: rgba(67, 176, 92, 0.35);
  background: #f0fbf3;
}

.record-sync-warning {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 16px;
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(194, 74, 18, 0.4);
  border-radius: 7px;
  background: #fff7ef;
  color: var(--mh-ink-900);
}

.record-sync-warning strong {
  color: var(--mh-dune-700);
}

.record-sync-warning span {
  color: var(--mh-ink-600);
}

.record-sync-warning .btn {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.library-summary,
.record-stamp {
  display: grid;
  justify-items: end;
  gap: 8px;
  min-width: 130px;
  color: var(--mh-ink-600);
  font-size: 12px;
}

.summary-number {
  color: var(--mh-sky-700);
  font-family: "Saira Condensed", "Arial Narrow", sans-serif;
  font-size: 64px;
  font-weight: 700;
  line-height: 0.9;
}

.summary-label {
  color: var(--mh-ink-600);
  font-size: 12px;
}

.toolbar {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  max-width: none;
}

.document-library {
  display: grid;
  gap: 22px;
}

.doc-group {
  display: grid;
  gap: 10px;
}

.doc-group-header,
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--mh-ink-900);
}

.doc-count {
  color: var(--mh-ink-600);
  font-size: 12px;
}

.doc-list,
.records-list {
  display: grid;
  gap: 8px;
}

.doc-row {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  min-height: 66px;
  padding: 10px 12px;
  border: 1px solid var(--mh-tile-border);
  border-radius: 8px;
  background: var(--mh-white);
  box-shadow: var(--shadow-card);
}

.doc-id {
  color: var(--mh-navy-800);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.doc-title {
  min-width: 0;
  color: var(--mh-ink-900);
  font-weight: 600;
}

.doc-version {
  color: var(--mh-ink-600);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  white-space: nowrap;
}

.document-viewer {
  min-height: 65vh;
  padding: 8px;
  border: 1px solid var(--mh-tile-border);
  border-radius: 10px;
  background: var(--mh-white);
}

.document-frame {
  display: block;
  width: 100%;
  min-height: 65vh;
  border: 0;
  background: #ffffff;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.action-card {
  display: grid;
  gap: 10px;
  min-height: 160px;
  padding: 20px;
  border: 1px solid var(--mh-paper-200);
  border-radius: 8px;
  background: var(--mh-white);
  color: var(--mh-ink-900);
  text-align: left;
  box-shadow: var(--shadow-card);
  cursor: pointer;
}

.action-card-primary {
  border-color: rgba(223, 85, 21, 0.45);
}

.action-card:hover {
  border-color: rgba(53, 133, 200, 0.5);
}

.action-card.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.action-kicker,
.record-type,
.sync-badge {
  color: var(--mh-ink-600);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
}

.action-title {
  font-family: "Saira Condensed", "Arial Narrow", sans-serif;
  font-size: 32px;
  font-weight: 700;
  line-height: 0.98;
  text-transform: uppercase;
}

.action-copy {
  color: var(--mh-ink-600);
  line-height: 1.45;
}

.records-panel,
.account-panel,
.form-section {
  display: grid;
  gap: 16px;
}

.account-panel {
  padding: 18px;
  border: 1px solid var(--mh-paper-200);
  border-radius: 8px;
  background: var(--mh-white);
  box-shadow: var(--shadow-card);
}

.account-actions {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 10px;
}

.account-actions .btn {
  min-width: 0;
}

.photo-panel-head,
.photo-actions,
.photo-detail-grid {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.photo-panel-head {
  justify-content: space-between;
}

.photo-actions {
  align-items: stretch;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.photo-card {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--mh-paper-200);
  border-radius: 8px;
  background: var(--mh-white);
  box-shadow: var(--shadow-card);
}

.photo-card.is-archived {
  opacity: 0.68;
}

.photo-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 0;
  border: 0;
  background: var(--mh-navy-900);
  cursor: pointer;
}

.photo-thumb img,
.photo-viewer img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-card-body {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.photo-card-body h3,
.photo-card-body p {
  margin: 0;
}

.photo-card-body p {
  color: var(--mh-ink-600);
  font-size: 14px;
}

.photo-viewer img {
  height: auto;
  max-height: min(72vh, 900px);
  object-fit: contain;
  border-radius: 8px;
  background: var(--mh-navy-900);
}

.photo-detail-grid {
  align-items: flex-start;
  color: var(--mh-ink-600);
  font-size: 14px;
}

.photo-detail-grid span {
  min-width: min(100%, 240px);
}

.record-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  min-height: 74px;
  padding: 12px;
  border: 1px solid var(--mh-tile-border);
  border-radius: 8px;
  background: var(--mh-white);
  box-shadow: var(--shadow-card);
}

.record-main {
  display: grid;
  gap: 4px;
}

.record-main p {
  margin: 0;
  color: var(--mh-ink-600);
}

.record-meta,
.record-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.record-actions {
  gap: 12px;
}

.status-badge,
.sync-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 12px;
}

.status-draft {
  border-color: rgba(242, 194, 48, 0.65);
  background: #fff8da;
  color: #5f4a00;
}

.status-complete {
  border-color: rgba(67, 176, 92, 0.45);
  background: #edf9f0;
  color: #245f32;
}

.status-archived {
  border-color: #c9c9c9;
  background: #eeeeee;
  color: #555555;
}

.sync-badge {
  border-color: var(--mh-paper-200);
  background: var(--mh-white);
}

.empty-state {
  margin: 0;
  padding: 18px;
  border: 1px dashed var(--mh-paper-200);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.55);
}

.form-section {
  padding: 22px;
  border: 1px solid var(--mh-tile-border);
  border-radius: 8px;
  background: var(--mh-white);
  box-shadow: var(--shadow-card);
}

.form-footer {
  display: flex;
  justify-content: flex-start;
  margin-top: 18px;
}

.form-section p,
.form-section ul {
  margin-top: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.gps-row,
.wx-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.gps-row .hint,
.wx-row .hint,
#fdrStatus,
#jsaPrompt {
  margin: 0;
  font-size: 16px;
}

.field-label-wide {
  grid-column: 1 / -1;
}

.hint {
  color: var(--mh-ink-600);
  font-size: 15px;
}

.choice-group {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.standalone-choice {
  display: grid;
  gap: 8px;
}

.choice-heading {
  margin: 0;
  color: var(--mh-ink-900);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.choice-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.choice-list.stacked {
  display: grid;
}

.choice {
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid var(--mh-tile-border);
  border-radius: 8px;
  background: var(--mh-paper-50);
  color: var(--mh-ink-900);
  line-height: 1.35;
  cursor: pointer;
}

.choice input,
.table-check input {
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  flex: none;
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  max-width: 24px;
  max-height: 24px;
  margin: 0;
  padding: 0;
  border: 2px solid var(--mh-ink-900);
  background: var(--mh-white);
  cursor: pointer;
}

.choice input[type="radio"],
.table-check input[type="radio"] {
  border-radius: 50%;
}

.choice input[type="checkbox"],
.table-check input[type="checkbox"] {
  border-radius: 5px;
}

.choice input:checked,
.table-check input:checked {
  border-color: var(--mh-sky-700);
  background: var(--mh-sky-700);
  box-shadow: inset 0 0 0 5px var(--mh-white);
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.scroll-hint {
  margin: 0 0 8px;
  color: var(--mh-ink-600);
  font-size: 13px;
}

.matrix-scroll {
  max-width: 100%;
  overscroll-behavior-x: contain;
  background:
    linear-gradient(90deg, var(--mh-white) 30%, rgba(255, 255, 255, 0)),
    linear-gradient(270deg, var(--mh-white) 30%, rgba(255, 255, 255, 0)) 100% 0;
  background-size: 24px 100%, 24px 100%;
  background-repeat: no-repeat;
  background-attachment: local, local;
}

.app-table,
.risk-matrix {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  table-layout: fixed;
}

.app-table th,
.app-table td,
.risk-matrix th,
.risk-matrix td {
  border: 1px solid var(--mh-paper-200);
  padding: 10px;
  vertical-align: top;
}

.app-table th,
.risk-matrix th {
  background: var(--mh-paper-100);
  color: var(--mh-ink-900);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  text-transform: uppercase;
}

.hazard-table th:not(:first-child),
.hazard-table td:not(:first-child) {
  width: 92px;
  text-align: center;
}

.table-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  min-height: 52px;
}

.hazard-scan,
.jsa-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.jsa-list {
  gap: 12px;
}

.hazard-card,
.jsa-card {
  border: 1px solid var(--mh-tile-border);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--mh-white);
}

.jsa-card {
  display: grid;
  gap: 12px;
}

.hazard-card-text,
.notification-card-text {
  margin: 0 0 10px;
  font-size: 14px;
}

.hazard-card-text span,
.notification-card-text span {
  color: var(--mh-ink-700);
}

.hazard-card-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.hazard-card-controls .table-check {
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
  min-height: 44px;
}

.jsa-card-num {
  margin: 0 0 8px;
  color: var(--mh-ink-600);
  font-family: var(--mono, "IBM Plex Mono", ui-monospace, monospace);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.signature-placeholder {
  display: inline-flex;
  align-items: center;
  min-height: 54px;
  color: var(--mh-ink-600);
}

.risk-matrix {
  min-width: 720px;
}

.risk-matrix th,
.risk-matrix td {
  text-align: center;
}

.risk-matrix th.axis {
  text-align: left;
  background: var(--mh-white);
}

.risk-matrix td {
  color: var(--mh-ink-900);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.risk-matrix .r-low {
  background: var(--risk-low);
}

.risk-matrix .r-medium {
  background: var(--risk-medium);
}

.risk-matrix .r-high {
  background: var(--risk-high);
  color: var(--mh-ink-900);
}

.risk-matrix .r-extreme {
  background: var(--risk-extreme);
  color: var(--mh-white);
}

.risk-key,
.scales {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--mh-ink-600);
  font-size: 14px;
}

.scales div {
  min-width: 220px;
  flex: 1;
}

.risk-key {
  gap: 8px 14px;
  font-size: 12px;
}

.risk-key span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  min-width: 0;
  white-space: nowrap;
}

.chip,
.rc-chip {
  display: inline-block;
  width: 16px;
  height: 16px;
  min-width: 16px;
  border: 1px solid rgba(29, 30, 27, 0.35);
  vertical-align: -3px;
}

.risk-key .chip {
  width: 12px;
  height: 12px;
  min-width: 12px;
}

.risk-low {
  background: var(--risk-low);
}

.risk-medium {
  background: var(--risk-medium);
}

.risk-high {
  background: var(--risk-high);
}

.risk-extreme {
  background: var(--risk-extreme);
}

.nogo-section {
  border-color: rgba(179, 64, 30, 0.35);
}

.nogo-title,
.todo {
  color: var(--mh-ink-900);
  font-weight: 700;
}

.nogo-title {
  color: var(--risk-extreme);
  font-family: "Saira Condensed", "Arial Narrow", sans-serif;
  font-size: 24px;
  text-transform: uppercase;
}

.todo {
  background: #ffe066;
  padding: 1px 5px;
  border-radius: 4px;
}

.take5-card-head {
  display: inline-flex;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--mh-navy-900);
  color: var(--mh-white);
  font-family: "Saira Condensed", "Arial Narrow", sans-serif;
  font-size: 24px;
  font-weight: 700;
  text-transform: uppercase;
}

.card-sub {
  margin: 0;
  color: var(--mh-ink-600);
  font-size: 11px;
}

.take5-steps {
  display: grid;
  gap: 14px;
}

.take5-step {
  display: grid;
  gap: 8px;
}

.step-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.step-title h2 {
  font-size: 28px;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--mh-sky-700);
  color: var(--mh-white);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-weight: 600;
}

.rules-list {
  display: grid;
  gap: 8px;
  padding-left: 18px;
}

.bottom-bar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  display: flex;
  gap: 10px;
  justify-content: center;
  padding: 12px var(--wrap-pad) calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(228, 218, 197, 0.9);
  background: rgba(247, 243, 234, 0.96);
  backdrop-filter: blur(12px);
}

.bottom-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
}

.bottom-bar .btn {
  min-width: 0;
  min-height: 52px;
  white-space: nowrap;
}

.bottom-primary {
  flex: 1;
}

.bottom-back,
.bottom-sync {
  flex: 0 0 auto;
}

.bottom-bar.is-empty {
  display: none;
}

.admin-hero,
.admin-panel,
.admin-records,
.admin-detail,
.admin-review-panel {
  width: min(1500px, calc(100vw - (2 * var(--wrap-pad))));
  margin-left: 50%;
  transform: translateX(-50%);
}

.admin-panel {
  display: grid;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--mh-paper-200);
  border-radius: 8px;
  background: var(--mh-white);
  box-shadow: var(--shadow-card);
}

.admin-tabs,
.admin-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--mh-paper-200);
  border-radius: 8px;
  background: var(--mh-paper-50);
  color: var(--mh-navy-800);
  font-weight: 600;
  cursor: pointer;
}

.admin-tab.is-active {
  border-color: var(--mh-sky-500);
  background: var(--mh-white);
  color: var(--mh-ink-900);
  box-shadow: inset 0 -3px 0 var(--mh-sky-500);
}

.admin-tab span {
  color: var(--mh-ink-600);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
}

.admin-filter-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 14px;
  align-items: end;
}

.admin-archive-toggle {
  margin-top: 8px;
  min-height: 54px;
}

.admin-actions {
  justify-content: flex-end;
}

.admin-actions .doc-count {
  margin-right: auto;
}

.admin-table {
  min-width: 1180px;
  table-layout: auto;
  background: var(--mh-white);
}

.admin-table th,
.admin-table td {
  white-space: nowrap;
}

.admin-table td {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-cell-text {
  display: inline-block;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}

.admin-sort-button {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  text-transform: inherit;
  cursor: pointer;
}

.admin-data-row {
  cursor: pointer;
}

.admin-data-row:hover,
.admin-data-row:focus {
  background: rgba(53, 133, 200, 0.08);
  outline: 2px solid rgba(53, 133, 200, 0.3);
  outline-offset: -2px;
}

.btn-small {
  min-height: 48px;
  padding: 0 12px;
}

.admin-detail {
  display: grid;
  gap: 16px;
}

.admin-detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--mh-ink-900);
}

.admin-detail-head > div {
  min-width: 0;
}

#adminDetailTitle {
  min-width: 0;
  overflow-wrap: anywhere;
}

.admin-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 16px;
}

.admin-field-list,
.admin-json-dl {
  display: grid;
  grid-template-columns: minmax(170px, 0.35fr) minmax(0, 1fr);
  gap: 8px 14px;
  margin: 0;
}

.admin-field-list dt,
.admin-json-dl dt {
  color: var(--mh-ink-900);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-field-list dd,
.admin-json-dl dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.admin-json-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}

.admin-empty-value {
  color: var(--mh-ink-600);
  font-style: italic;
}

.admin-photo-missing {
  display: grid;
  place-items: center;
  min-height: 180px;
  color: var(--mh-white);
}

.is-hidden {
  display: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 900px) {
  .action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .record-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .admin-filter-grid,
  .admin-detail-grid,
  .admin-field-list,
  .admin-json-dl {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-header {
    min-height: 68px;
    padding: calc(12px + env(safe-area-inset-top)) var(--wrap-pad) 12px;
  }

  .brand-icon {
    width: 42px;
    height: 42px;
  }

  .brand-text {
    font-size: 21px;
  }

  .hero-panel,
  .toolbar,
  .doc-row,
  .form-grid,
  .action-grid {
    grid-template-columns: 1fr;
  }

  .hero-panel,
  .form-section {
    padding: 20px;
  }

  .library-summary,
  .record-stamp {
    justify-items: start;
  }

  .doc-row {
    align-items: stretch;
  }

  .doc-link,
  .toolbar .btn,
  .record-actions .btn,
  .photo-actions .btn {
    width: 100%;
  }

  .choice-list {
    display: grid;
  }

  .bottom-bar {
    justify-content: flex-start;
  }

  .bottom-actions {
    flex: 1;
  }

  .bottom-bar .btn {
    min-width: 0;
    padding: 0 14px;
  }

  .admin-hero,
  .admin-panel,
  .admin-records,
  .admin-detail {
    width: 100%;
    margin-left: 0;
    transform: none;
  }

  .admin-actions {
    align-items: stretch;
  }

  .admin-actions .btn,
  .admin-tab {
    width: 100%;
  }
}

/* 2026 candidate visual system. The functional form selectors above remain in
   place so the redesign does not change the IndexedDB payload contract. */
:root {
  --mh-paper-50: #f7f3ea;
  --mh-paper-100: #f0e9da;
  --mh-paper-200: #e4dac5;
  --mh-white: #ffffff;
  --mh-navy-900: #0d2b3e;
  --mh-navy-800: #143c56;
  --mh-ink-900: #1d1e1b;
  --mh-ink-700: #343630;
  --mh-ink-600: #4a4c47;
  --mh-river-500: #676642;
  --mh-dune-600: #c24a12;
  --mh-dune-500: #df5515;
  --mh-tile-border: #8a8770;
  --wrap-max: 1500px;
  --wrap-pad: clamp(16px, 3vw, 42px);
  --bottom-space: calc(104px + env(safe-area-inset-bottom));
}

html,
body {
  background: var(--mh-paper-50);
  color: var(--mh-ink-700);
}

body {
  background-image: none;
}

.app-header {
  min-height: 76px;
  padding: calc(14px + env(safe-area-inset-top)) var(--wrap-pad) 14px;
  border-bottom-color: rgba(138, 135, 112, 0.35);
  background: rgba(247, 243, 234, 0.98);
  backdrop-filter: none;
}

.brand-lockup {
  min-height: 48px;
}

.brand-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  box-shadow: none;
}

.brand-text {
  margin-left: 12px;
  color: var(--mh-navy-800);
  font-size: 25px;
  line-height: 0.9;
  letter-spacing: -0.02em;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-pill {
  min-height: 36px;
  padding: 0 12px;
  border-color: rgba(138, 135, 112, 0.5);
  border-radius: 6px;
  background: var(--mh-white);
  color: var(--mh-navy-800);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.app-main {
  width: min(100%, var(--wrap-max));
  padding: 30px var(--wrap-pad) var(--bottom-space);
}

.shell {
  gap: 18px;
}

.app-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: start;
}

.app-nav {
  position: sticky;
  top: 104px;
  display: grid;
  gap: 16px;
  min-width: 0;
  padding: 8px 0 20px;
}

.nav-section-title,
.section-note,
.nav-footnote {
  color: var(--mh-ink-600);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.09em;
  line-height: 1.4;
  text-transform: uppercase;
}

.nav-section-title {
  padding: 0 14px;
  color: var(--mh-river-500);
}

.app-nav-links,
.mobile-nav-links {
  display: grid;
  gap: 4px;
}

.app-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--mh-navy-800);
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.app-nav-link:hover,
.app-nav-link:focus-visible {
  border-color: rgba(20, 60, 86, 0.28);
  background: rgba(255, 255, 255, 0.6);
}

.app-nav-link.is-active {
  border-color: rgba(103, 102, 66, 0.3);
  background: var(--mh-paper-100);
  box-shadow: inset 4px 0 0 var(--mh-dune-500);
  color: var(--mh-ink-900);
}

.nav-icon {
  display: block;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.nav-footnote {
  margin: 14px 14px 0;
  padding-top: 16px;
  border-top: 1px solid rgba(138, 135, 112, 0.4);
  color: var(--mh-ink-600);
  letter-spacing: 0.03em;
  text-transform: none;
}

.screen-column {
  display: grid;
  min-width: 0;
  gap: 22px;
}

.mobile-nav {
  display: none;
}

.home-hero,
.content-hero,
.record-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: end;
  padding: 8px 0 24px;
  border-bottom: 1px solid rgba(138, 135, 112, 0.55);
}

.home-hero h1,
.content-hero h1,
.record-hero h1 {
  max-width: 900px;
  color: var(--mh-navy-800);
  font-size: clamp(42px, 6vw, 72px);
  letter-spacing: -0.02em;
  text-transform: none;
}

.home-hero .lede,
.content-hero .lede,
.record-hero .lede {
  max-width: 760px;
  margin-top: 12px;
  color: var(--mh-ink-600);
  font-size: 18px;
}

.home-status,
.content-hero-meta,
.record-stamp {
  display: grid;
  gap: 6px;
  align-content: end;
  min-width: 185px;
  padding-left: 20px;
  border-left: 2px solid var(--mh-river-500);
}

.home-status-label {
  color: var(--mh-navy-800);
  font-size: 18px;
  font-weight: 600;
}

.home-status-copy,
.content-hero-meta,
.record-stamp {
  color: var(--mh-ink-600);
  font-size: 13px;
  line-height: 1.45;
}

.content-hero-meta,
.record-stamp {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.record-hero-main {
  min-width: 0;
}

.record-hero .eyebrow,
.home-hero .eyebrow,
.content-hero .eyebrow {
  margin: 0 0 9px;
  color: var(--mh-river-500);
}

.inline-back,
.text-button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--mh-navy-800);
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.inline-back {
  margin-bottom: 14px;
}

.text-button:hover,
.inline-back:hover {
  color: var(--mh-dune-600);
}

.section-heading {
  align-items: end;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(138, 135, 112, 0.55);
}

.section-heading h2 {
  color: var(--mh-navy-800);
  font-size: clamp(28px, 3.3vw, 42px);
  letter-spacing: -0.01em;
  text-transform: none;
}

.section-note {
  max-width: 260px;
  text-align: right;
  text-transform: none;
}

.home-actions,
.records-panel,
.account-panel,
.form-section,
.document-library {
  gap: 18px;
}

.home-actions,
.records-panel {
  display: grid;
}

.action-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.action-card {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 20px;
  grid-template-areas:
    "icon title arrow"
    "icon copy arrow";
  column-gap: 14px;
  align-items: center;
  min-height: 122px;
  padding: 20px 18px;
  border: 1px solid rgba(138, 135, 112, 0.65);
  border-radius: 10px;
  background: var(--mh-white);
  color: var(--mh-navy-800);
  box-shadow: none;
}

.action-card:hover,
.action-card:focus-visible {
  border-color: var(--mh-navy-800);
  box-shadow: 0 3px 0 rgba(20, 60, 86, 0.12);
  transform: translateY(-1px);
}

.action-card-primary {
  border-color: var(--mh-dune-600);
  background: var(--mh-dune-600);
  color: var(--mh-white);
}

.action-card-primary:hover,
.action-card-primary:focus-visible {
  border-color: var(--mh-dune-600);
  background: var(--mh-dune-500);
  color: var(--mh-white);
}

.action-card > .nav-icon {
  grid-area: icon;
  width: 30px;
  height: 30px;
}

.action-title {
  grid-area: title;
  align-self: end;
  color: inherit;
  font-size: 28px;
  line-height: 0.98;
  text-transform: none;
}

.action-copy {
  grid-area: copy;
  align-self: start;
  color: var(--mh-ink-600);
  font-size: 14px;
  line-height: 1.4;
}

.action-card-primary .action-copy {
  color: rgba(255, 255, 255, 0.92);
}

.action-arrow {
  grid-area: arrow;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.account-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: 18px 0;
  border-top: 1px solid rgba(138, 135, 112, 0.55);
  border-bottom: 1px solid rgba(138, 135, 112, 0.55);
  background: transparent;
  box-shadow: none;
}

.account-status {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.account-status-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--mh-navy-800);
}

.account-status h2 {
  color: var(--mh-navy-800);
  font-size: 25px;
  text-transform: none;
}

.account-status p {
  max-width: 520px;
  margin: 3px 0 0;
  color: var(--mh-ink-600);
  font-size: 13px;
}

.account-actions {
  justify-content: flex-end;
}

.account-actions .btn {
  min-height: 48px;
}

.record-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
  min-height: 72px;
  padding: 14px 0;
  border: 0;
  border-bottom: 1px solid rgba(138, 135, 112, 0.4);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.record-row:last-child {
  border-bottom: 0;
}

.record-type,
.record-stamp,
.sync-badge,
.status-badge {
  letter-spacing: 0.04em;
}

.record-type {
  color: var(--mh-river-500);
}

.record-main h3 {
  color: var(--mh-navy-800);
  font-size: 25px;
  text-transform: none;
}

.record-main p {
  font-size: 13px;
}

.record-meta {
  justify-content: flex-end;
}

.status-badge,
.sync-badge {
  min-height: 28px;
  padding: 0 9px;
  border-radius: 5px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-draft {
  border-color: rgba(194, 74, 18, 0.32);
  background: #fff3e8;
  color: var(--mh-dune-600);
}

.status-complete {
  border-color: rgba(67, 176, 92, 0.4);
  background: #edf9f0;
  color: #245f32;
}

.status-archived {
  border-color: rgba(74, 76, 71, 0.24);
  background: rgba(74, 76, 71, 0.1);
  color: var(--mh-ink-600);
}

.sync-badge {
  border-color: rgba(138, 135, 112, 0.4);
  background: var(--mh-white);
  color: var(--mh-ink-600);
}

.record-actions {
  justify-content: flex-end;
}

.record-actions .btn {
  min-height: 44px;
}

.empty-state {
  padding: 20px;
  border: 1px dashed rgba(138, 135, 112, 0.7);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.42);
}

.hero-panel {
  padding: 8px 0 24px;
  border: 0;
  border-bottom: 1px solid rgba(138, 135, 112, 0.55);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.hero-panel h1,
.hero-panel h2 {
  color: var(--mh-navy-800);
  text-transform: none;
}

.library-summary,
.summary-label {
  min-width: 0;
}

.summary-number {
  color: var(--mh-navy-800);
  font-size: 48px;
}

.summary-label {
  letter-spacing: 0.04em;
  text-transform: none;
}

.form-section {
  padding: 22px;
  border: 1px solid rgba(138, 135, 112, 0.55);
  border-left: 1px solid var(--mh-river-500);
  border-radius: 10px;
  background: var(--mh-white);
  box-shadow: none;
}

.form-section h2 {
  color: var(--mh-navy-800);
  font-size: clamp(28px, 3.5vw, 42px);
  letter-spacing: -0.01em;
  text-transform: none;
}

.form-section h3 {
  color: var(--mh-navy-800);
  text-transform: none;
}

.field-label > span,
.login-form label,
.search-field span,
.choice-group legend {
  color: var(--mh-ink-900);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.login-form input,
.search-field input,
.field-label input:not([type="checkbox"]):not([type="radio"]),
.field-label select,
.field-label textarea,
.app-table input:not([type="checkbox"]):not([type="radio"]),
.app-table textarea {
  min-height: 50px;
  margin-top: 7px;
  border-color: rgba(138, 135, 112, 0.72);
  border-radius: 7px;
  box-shadow: none;
}

.choice {
  min-height: 50px;
  border-color: rgba(138, 135, 112, 0.72);
  border-radius: 7px;
  background: var(--mh-paper-50);
}

.choice:hover {
  border-color: var(--mh-navy-800);
}

.btn,
.doc-link {
  min-height: 50px;
  border-radius: 7px;
  font-size: 14px;
}

.btn-primary {
  background: var(--mh-dune-600);
}

.btn-primary:hover,
.btn-primary:active {
  background: var(--mh-dune-500);
}

.btn-secondary,
.doc-link {
  border-color: rgba(20, 60, 86, 0.55);
  background: var(--mh-white);
  color: var(--mh-navy-800);
}

.btn-secondary:hover,
.doc-link:hover {
  border-color: var(--mh-navy-800);
  background: var(--mh-paper-100);
}

.notice,
.form-message {
  border-radius: 7px;
}

.notice {
  border-color: rgba(194, 74, 18, 0.35);
  background: #fff7ef;
}

.notice-undo {
  border-color: rgba(67, 176, 92, 0.35);
  background: #f0fbf3;
}

.doc-row {
  min-height: 62px;
  border-color: rgba(138, 135, 112, 0.58);
  border-radius: 8px;
  box-shadow: none;
}

.doc-row:hover {
  border-color: var(--mh-navy-800);
}

.photo-card,
.admin-panel {
  border-color: rgba(138, 135, 112, 0.58);
  border-radius: 10px;
  box-shadow: none;
}

.admin-review-panel {
  display: grid;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--mh-paper-200);
  border-radius: 8px;
  background: var(--mh-white);
  box-shadow: var(--shadow-card);
}

.admin-review-list {
  display: grid;
  gap: 18px;
}

.admin-review-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--mh-paper-200);
  border-radius: 8px;
  background: var(--mh-paper-50);
}

.admin-review-heading,
.admin-review-actions {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.admin-review-heading h3 {
  margin: 4px 0 0;
}

.admin-review-facts {
  display: grid;
  grid-template-columns: minmax(120px, 0.25fr) minmax(0, 1fr);
  gap: 8px 14px;
  margin: 0;
}

.admin-review-facts dt {
  color: var(--mh-ink-900);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  text-transform: uppercase;
}

.admin-review-facts dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.admin-review-hash {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
}

.admin-review-frame {
  min-height: 420px;
  border: 1px solid var(--mh-paper-200);
}

.admin-review-actions {
  align-items: end;
}

.admin-review-actions .field-label {
  flex: 1 1 240px;
}

.photo-state-note,
.is-disabled {
  color: var(--mh-ink-600);
  cursor: default;
  opacity: 0.8;
}

.take5-card-head {
  border-radius: 7px;
  background: var(--mh-navy-800);
  text-transform: none;
}

.bottom-bar {
  justify-content: center;
  padding: 10px var(--wrap-pad) calc(10px + env(safe-area-inset-bottom));
  border-top-color: rgba(138, 135, 112, 0.55);
  background: rgba(247, 243, 234, 0.98);
  backdrop-filter: none;
}

.bottom-actions {
  max-width: var(--wrap-max);
  margin: 0 auto;
  align-items: center;
}

.bottom-back {
  margin-right: auto;
}

.bottom-primary {
  flex: 0 1 240px;
}

.password-reset,
.password-change-form {
  max-width: 620px;
}

.password-reset-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.auth-panel {
  max-width: 600px;
  min-height: calc(100vh - 190px);
  padding: 32px;
  border: 1px solid rgba(138, 135, 112, 0.58);
  border-left: 1px solid var(--mh-dune-600);
  border-radius: 10px;
  background: var(--mh-white);
  box-shadow: none;
}

.auth-kicker {
  margin: 0 0 10px;
  color: var(--mh-river-500);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-panel h1 {
  color: var(--mh-navy-800);
  text-transform: none;
}

.auth-link {
  justify-self: start;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--mh-navy-800);
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.auth-link:hover {
  color: var(--mh-dune-600);
}

.install-help {
  margin: 0;
  padding: 12px 14px;
  border-left: 1px solid var(--mh-river-500);
  background: var(--mh-paper-100);
  color: var(--mh-ink-900);
  font-size: 13px;
  line-height: 1.45;
}

.app-install-help {
  max-width: 680px;
}

@media (max-width: 900px) {
  .app-layout {
    display: block;
  }

  .app-nav {
    display: none;
  }

  .mobile-nav {
    display: block;
    border: 1px solid rgba(138, 135, 112, 0.58);
    border-radius: 8px;
    background: var(--mh-white);
  }

  .mobile-nav summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 52px;
    padding: 0 16px;
    color: var(--mh-navy-800);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
  }

  .mobile-nav summary::-webkit-details-marker {
    display: none;
  }

  .mobile-nav summary::after {
    width: 9px;
    height: 9px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    content: "";
    transform: rotate(45deg) translateY(-2px);
  }

  .mobile-nav[open] summary {
    border-bottom: 1px solid rgba(138, 135, 112, 0.42);
  }

  .mobile-nav[open] summary::after {
    transform: rotate(225deg) translate(-2px, -1px);
  }

  .mobile-nav-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    padding: 8px;
  }

  .home-hero,
  .content-hero,
  .record-hero {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .home-status,
  .content-hero-meta,
  .record-stamp {
    min-width: 0;
    padding: 12px 0 0;
    border-top: 2px solid var(--mh-river-500);
    border-left: 0;
  }

  .section-note {
    text-align: left;
  }

  .action-grid {
    grid-template-columns: 1fr;
  }

  .account-panel {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .account-actions {
    justify-content: stretch;
  }

  .account-actions .btn {
    flex: 1 1 160px;
  }

  .record-row {
    grid-template-columns: 1fr;
    gap: 12px;
    align-items: stretch;
  }

  .record-meta,
  .record-actions {
    justify-content: flex-start;
  }

  .record-actions .btn {
    flex: 1 1 140px;
  }
}

@media (max-width: 560px) {
  .app-header {
    min-height: 60px;
    padding: calc(8px + env(safe-area-inset-top)) var(--wrap-pad) 8px;
  }

  .brand-lockup {
    min-height: 38px;
  }

  .brand-icon {
    width: 38px;
    height: 38px;
  }

  .brand-text {
    margin-left: 9px;
    font-size: 19px;
  }

  .header-tools .status-pill {
    min-height: 32px;
    padding: 0 9px;
    font-size: 11px;
  }

  .app-main {
    padding-top: 14px;
  }

  .screen-column {
    gap: 12px;
  }

  .mobile-nav summary {
    min-height: 46px;
    padding: 0 14px;
  }

  .mobile-nav-links {
    gap: 2px;
    padding: 4px;
  }

  .mobile-nav-links {
    grid-template-columns: 1fr;
  }

  .mobile-nav .app-nav-link {
    min-height: 44px;
  }

  .home-hero {
    gap: 0;
    padding: 0 0 12px;
  }

  .home-status {
    display: none;
  }

  .home-hero h1,
  .content-hero h1,
  .record-hero h1 {
    font-size: 40px;
  }

  .home-hero .lede,
  .content-hero .lede,
  .record-hero .lede {
    font-size: 16px;
  }

  .action-card {
    min-height: 96px;
    padding: 14px 12px;
  }

  .action-title {
    font-size: 23px;
  }

  .home-actions,
  .account-panel {
    gap: 12px;
  }

  .home-actions .section-heading {
    padding-bottom: 8px;
  }

  .form-section {
    padding: 18px 16px;
  }

  .auth-panel {
    min-height: 0;
    padding: 24px 20px;
  }

  .account-actions,
  .password-reset-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .account-actions .btn,
  .password-reset-actions .btn,
  .bottom-bar .btn {
    width: 100%;
  }

  .bottom-form .bottom-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr) minmax(0, 1.35fr);
    gap: 8px;
    width: 100%;
  }

  .bottom-form .btn {
    min-height: 48px;
    padding: 0 8px;
    font-size: 12px;
  }

  .bottom-back {
    margin-right: 0;
  }

  .bottom-primary {
    flex: none;
  }

  .record-sync-warning {
    grid-template-columns: 1fr;
  }

  .record-sync-warning .btn {
    grid-column: 1;
    grid-row: auto;
    width: 100%;
  }
}

/* Impeccable release: quiet authentication and a more precise field interface. */
:root {
  --mh-focus: #0f6fbd;
  --mh-line: rgba(20, 60, 86, 0.18);
  --mh-line-strong: rgba(20, 60, 86, 0.36);
  --mh-surface-soft: #fbfaf7;
  --mh-shadow-raised: 0 12px 30px rgba(13, 43, 62, 0.08);
}

::selection {
  background: rgba(53, 133, 200, 0.22);
  color: var(--mh-navy-900);
}

body.auth-only {
  display: grid;
  min-height: 100dvh;
  background: var(--mh-white);
}

body.auth-only .app-header,
body.auth-only .bottom-bar {
  display: none;
}

body.auth-only .app-main {
  display: grid;
  width: 100%;
  min-height: 100dvh;
  padding: max(24px, env(safe-area-inset-top)) max(22px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(22px, env(safe-area-inset-left));
  place-items: center;
}

body.auth-only .auth-panel {
  width: min(100%, 360px);
  max-width: none;
  min-height: 0;
  gap: 20px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.login-form,
.password-reset {
  display: grid;
  width: 100%;
  max-width: none;
  gap: 10px;
}

.login-form label,
.password-reset > label {
  margin-top: 6px;
  color: var(--mh-navy-900);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.login-form input,
.password-reset > input {
  width: 100%;
  min-height: 54px;
  margin: 0 0 4px;
  padding: 12px 14px;
  border: 1px solid var(--mh-line-strong);
  border-radius: 8px;
  background: var(--mh-white);
  color: var(--mh-ink-900);
  font-size: 16px;
  box-shadow: 0 1px 2px rgba(13, 43, 62, 0.04);
}

.login-form input:hover,
.password-reset > input:hover {
  border-color: var(--mh-navy-800);
}

.login-form .btn-primary,
.password-reset .btn-primary {
  width: 100%;
  min-height: 54px;
  margin-top: 6px;
  border-radius: 8px;
  background: var(--mh-navy-800);
  font-size: 15px;
}

.login-form .btn-primary:hover,
.password-reset .btn-primary:hover {
  background: var(--mh-navy-900);
}

.auth-link {
  justify-self: center;
  min-height: 44px;
  color: var(--mh-navy-800);
  font-size: 14px;
  font-weight: 500;
  text-decoration-color: rgba(20, 60, 86, 0.45);
}

.password-reset-actions {
  display: grid;
  gap: 6px;
}

.form-message {
  min-height: 0;
  margin: 2px 0 0;
  color: #8d2d16;
  font-size: 14px;
  line-height: 1.45;
}

.form-message:empty {
  display: none;
}

body:not(.auth-only) .app-header {
  box-shadow: 0 1px 0 rgba(20, 60, 86, 0.06);
}

body:not(.auth-only) .app-main {
  padding-top: clamp(22px, 3vw, 38px);
}

.app-layout {
  grid-template-columns: 208px minmax(0, 1fr);
  gap: clamp(28px, 4vw, 56px);
}

.app-nav {
  gap: 12px;
  padding-top: 2px;
}

.nav-section-title {
  padding: 0 12px 5px;
  color: var(--mh-ink-600);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.app-nav-links {
  gap: 3px;
}

.app-nav-link {
  min-height: 48px;
  padding: 0 12px;
  border-radius: 9px;
  font-size: 14px;
}

.app-nav-link:hover,
.app-nav-link:focus-visible {
  border-color: var(--mh-line);
  background: var(--mh-white);
}

.app-nav-link.is-active {
  border-color: transparent;
  background: var(--mh-navy-800);
  box-shadow: none;
  color: var(--mh-white);
}

.nav-icon {
  width: 22px;
  height: 22px;
  stroke-width: 1.8;
}

.nav-footnote {
  margin: 12px 12px 0;
  color: var(--mh-ink-600);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 12px;
}

.screen-column {
  gap: 20px;
}

.home-hero,
.content-hero,
.record-hero,
.hero-panel {
  padding: 2px 0 20px;
  border-bottom-color: var(--mh-line-strong);
}

.home-hero h1,
.content-hero h1,
.record-hero h1,
.hero-panel h1 {
  font-size: clamp(38px, 4.5vw, 60px);
  line-height: 1;
}

.home-hero .lede,
.content-hero .lede,
.record-hero .lede,
.hero-panel .lede {
  margin-top: 8px;
  font-size: 16px;
  line-height: 1.5;
}

.eyebrow {
  display: none;
}

.home-status,
.content-hero-meta,
.record-stamp {
  border-left-color: var(--mh-dune-600);
}

.section-heading {
  padding-bottom: 10px;
  border-bottom-color: var(--mh-line);
}

.section-heading h2,
.form-section h2 {
  font-size: clamp(27px, 3vw, 38px);
}

.action-grid {
  gap: 14px;
}

.action-card {
  min-height: 116px;
  padding: 19px;
  border-color: var(--mh-line-strong);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(13, 43, 62, 0.03);
}

.action-card:hover,
.action-card:focus-visible {
  border-color: var(--mh-navy-800);
  box-shadow: var(--mh-shadow-raised);
  transform: translateY(-2px);
}

.action-card-primary {
  border-color: var(--mh-navy-800);
  background: var(--mh-navy-800);
}

.action-card-primary:hover,
.action-card-primary:focus-visible {
  border-color: var(--mh-navy-900);
  background: var(--mh-navy-900);
}

.action-title {
  font-size: 26px;
}

.form-section,
.admin-panel,
.admin-review-panel,
.photo-card {
  border-color: var(--mh-line);
  border-left-width: 1px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(13, 43, 62, 0.04);
}

.form-section {
  padding: clamp(18px, 2.5vw, 26px);
}

.field-form {
  gap: 16px;
}

.field-label > span,
.search-field span,
.choice-group legend,
.choice-heading {
  color: var(--mh-navy-900);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.search-field input,
.field-label input:not([type="checkbox"]):not([type="radio"]),
.field-label select,
.field-label textarea,
.app-table input:not([type="checkbox"]):not([type="radio"]),
.app-table textarea {
  border-color: var(--mh-line-strong);
  border-radius: 8px;
  background: var(--mh-white);
}

.choice {
  border-color: var(--mh-line-strong);
  border-radius: 9px;
  background: var(--mh-surface-soft);
}

.choice:has(input:checked) {
  border-color: var(--mh-focus);
  background: rgba(53, 133, 200, 0.08);
}

.btn,
.doc-link {
  border-radius: 8px;
}

.btn-primary {
  background: var(--mh-navy-800);
}

.btn-primary:hover,
.btn-primary:active {
  background: var(--mh-navy-900);
}

.btn-secondary,
.doc-link {
  border-color: var(--mh-line-strong);
}

.btn:focus-visible,
.auth-link:focus-visible,
.app-nav-link:focus-visible,
.mobile-nav summary:focus-visible,
.doc-link:focus-visible,
.action-card:focus-visible,
.choice input:focus-visible,
.table-check input:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(15, 111, 189, 0.38);
  outline-offset: 2px;
}

.record-row,
.doc-row {
  border-color: var(--mh-line);
  border-radius: 10px;
  box-shadow: none;
}

.bottom-bar {
  border-top-color: var(--mh-line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
}

.bottom-bar .btn-primary {
  background: var(--mh-dune-600);
}

.bottom-bar .btn-primary:hover,
.bottom-bar .btn-primary:active {
  background: var(--mh-dune-500);
}

@media (max-width: 900px) {
  .mobile-nav {
    border-color: var(--mh-line-strong);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(13, 43, 62, 0.04);
  }

  .mobile-nav summary {
    min-height: 50px;
  }

  .mobile-nav .app-nav-link.is-active {
    background: var(--mh-navy-800);
  }
}

@media (max-width: 560px) {
  body:not(.auth-only) .app-header {
    min-height: 64px;
    padding-top: calc(10px + env(safe-area-inset-top));
    padding-bottom: 10px;
  }

  body:not(.auth-only) .app-main {
    padding-top: 16px;
  }

  .brand-text {
    font-size: 20px;
  }

  .home-hero h1,
  .content-hero h1,
  .record-hero h1,
  .hero-panel h1 {
    font-size: 38px;
  }

  .action-grid {
    gap: 10px;
  }

  .action-card {
    min-height: 88px;
    padding: 14px;
  }

  .action-card > .nav-icon {
    width: 27px;
    height: 27px;
  }

  .action-title {
    font-size: 23px;
  }

  .action-copy {
    font-size: 13px;
  }

  .form-section {
    padding: 17px 15px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .field-label-wide {
    grid-column: auto;
  }

  .bottom-form .bottom-actions {
    grid-template-columns: 0.8fr 0.9fr 1.3fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

.is-hidden,
[hidden] {
  display: none !important;
}

/* 4 October 2026: complete the existing field-interface polish. */
:root { --mh-line-strong: #859bab; }
input, textarea { caret-color: var(--mh-navy-800); }
input::placeholder, textarea::placeholder { color: #596670; opacity: 1; }
button, a { -webkit-tap-highlight-color: transparent; }
.form-message[data-tone="success"] { color: var(--mh-navy-800); }
.auth-panel .form-message { overflow-wrap: anywhere; }
.auth-link { text-underline-offset: 4px; }
.auth-link:hover { color: var(--mh-sky-700); }
.login-form input, .password-reset > input { box-shadow: none; }
.login-form label:not(:first-child), .password-reset > label:not(:first-child) { margin-top: 14px; }
.screen-column, .form-section, .record-row, .doc-row { min-width: 0; }
.section-heading, .record-meta, .account-actions { flex-wrap: wrap; }
.app-nav-link, .action-card, .btn { transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease; }
.btn:disabled { cursor: not-allowed; }
.form-section, .admin-panel, .admin-review-panel, .photo-card { box-shadow: none; }
.home-status, .content-hero-meta, .record-stamp { border-left-width: 1px; }
.btn:focus-visible, .auth-link:focus-visible, .app-nav-link:focus-visible,
.mobile-nav summary:focus-visible, .doc-link:focus-visible, .action-card:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--mh-sky-700); outline-offset: 3px;
}
.mobile-nav summary { list-style: none; }
.mobile-nav summary::-webkit-details-marker { display: none; }
.mobile-nav summary::after { content: "Open"; float: right; font: 600 13px Inter, sans-serif; }
.mobile-nav[open] summary::after { content: "Close"; }
@media (max-width: 560px) {
  .bottom-form .bottom-actions { display: flex; flex-wrap: wrap; gap: 8px; }
  .bottom-form .bottom-actions .btn { flex: 1 1 auto; min-width: 0; padding-inline: 12px; }
  .bottom-form .bottom-actions .bottom-primary { flex-grow: 2; }
  .record-stamp { overflow-wrap: anywhere; }
}

/* Constrain intrinsic grid widths instead of masking overflow. */
.app-layout, .screen-root, .admin-panel, .admin-filter-grid, .form-grid, .toolbar, .field-label { min-width: 0; }
.app-layout, .screen-root { width: 100%; }
.mobile-nav summary::after, .mobile-nav[open] summary::after {
  width: auto; height: auto; border: 0; transform: none;
}
@media (max-width: 900px) { .app-layout { display: block; grid-template-columns: 1fr; } }
@media (max-width: 560px) {
  .bottom-form .bottom-actions .btn { width: auto; }
  .bottom-form .bottom-actions { flex-wrap: nowrap; }
  .bottom-form .bottom-actions .bottom-primary { white-space: normal; }
}
.admin-hero, .admin-panel, .admin-records, .admin-detail, .admin-review-panel {
  width: 100%; margin-left: 0; transform: none;
}
.screen-root, .admin-panel { grid-template-columns: minmax(0, 1fr); }
.admin-filter-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); }
@media (max-width: 560px) { .admin-filter-grid { grid-template-columns: 1fr; } }
body.auth-only .mobile-nav summary::after { content: none; }
