.help-grid {
  display: grid;
  grid-template-columns: minmax(160px, 230px) minmax(0, 1fr);
  align-items: start;
  gap: 16px;
  max-width: 1100px;
}
.help-index { display: grid; gap: 10px; }
.help-section { scroll-margin-top: 180px; }
.help-section dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 14px; }
.help-section dd { margin: 4px 0 0; }
.help-section ol { line-height: 1.6; padding-inline-start: 22px; }
.help-section li + li { margin-top: 7px; }
@media (max-width: 760px) {
  .help-grid { grid-template-columns: minmax(0, 1fr); }
}

@font-face {
  font-family: TT Hoves Pro;
  src: local("TT Hoves Pro");
  font-display: swap;
}
:root {
  --header-height: 62px;
  scroll-padding-top: calc(var(--header-height) + 10px);
  color-scheme: light;
  --primary: #172d49;
  --secondary: #426181;
  --border: #dce4ed;
  --bg: #f5f7fa;
  --surface: #fff;
  --muted: #52657c;
  --selected: #e6edf5;
  --text: #182b41;
  --on-primary: #fff;
  --danger: #a81e27;
  --shadow: 0 1px 2px #172d4912;
  font-family: "TT Hoves Pro", "Segoe UI", sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --primary: #b8d1f1;
  --secondary: #a2bcda;
  --border: #314256;
  --bg: #0f1722;
  --surface: #172333;
  --muted: #a4b5c9;
  --selected: #22364d;
  --text: #ecf2fa;
  --on-primary: #15263a;
  --danger: #ffafb5;
  --shadow: none;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    color-scheme: dark;
    --primary: #b8d1f1;
    --secondary: #a2bcda;
    --border: #314256;
    --bg: #0f1722;
    --surface: #172333;
    --muted: #a4b5c9;
    --selected: #22364d;
    --text: #ecf2fa;
    --on-primary: #15263a;
    --danger: #ffafb5;
    --shadow: none;
  }
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
select,
summary {
  font: inherit;
  color: inherit;
}
button,
summary {
  cursor: pointer;
}
button {
  background: none;
}
:focus-visible {
  outline: 2px solid var(--secondary);
  outline-offset: 3px;
}
.top {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--header-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
}
.brand,
.utilities,
.nav-item,
.button,
.back,
.timeline li {
  display: flex;
  align-items: center;
  gap: 9px;
}
.brand {
  font-weight: 750;
  letter-spacing: 0.04em;
  color: var(--primary);
}
.brand-suffix {
  color: var(--secondary);
  font-weight: 550;
}
.brand-icon,
.login-mark {
  display: grid;
  place-items: center;
  background: var(--primary);
  color: var(--on-primary);
  width: 34px;
  height: 34px;
  border-radius: 8px;
}
.utilities {
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.utilities form {
  margin: 0;
}
.quiet {
  display: block;
  border: 0;
  padding: 7px 8px;
  color: var(--muted);
  border-radius: 6px;
  font-size: 13px;
}
.quiet:hover,
.theme-options a:hover {
  background: var(--selected);
  color: var(--primary);
}
.themes {
  position: relative;
}
.theme-options {
  position: absolute;
  z-index: 2;
  right: 0;
  min-width: 135px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.theme-options a {
  display: block;
  padding: 5px 9px;
  border-radius: 5px;
}
.selected {
  background: var(--selected);
}
.shell {
  display: grid;
  grid-template-columns: clamp(176px, 24vw, 224px) minmax(0, 1fr);
  min-height: calc(100vh - var(--header-height));
}
.sidebar {
  position: sticky;
  top: var(--header-height);
  z-index: 1;
  align-self: start;
  height: calc(100dvh - var(--header-height));
  overflow-y: auto;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 30px 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sidebar p,
.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.sidebar p {
  padding: 0 10px;
}
.nav-item {
  padding: 9px 10px;
  border-radius: 7px;
  font-weight: 600;
  color: var(--primary);
}
.identity {
  margin-top: auto;
  display: grid;
  overflow-wrap: anywhere;
  padding: 12px 10px 0;
  border-top: 1px solid var(--border);
}
.identity span {
  font-size: 13px;
  color: var(--muted);
}
@media (min-width: 761px) and (max-height: 510px) {
  .sidebar {
    padding-block: 12px;
    gap: 6px;
  }
  .sidebar .nav-item {
    padding-block: 6px;
  }
  .sidebar .identity {
    padding-top: 6px;
  }
}
.main {
  padding: 28px clamp(18px, 3vw, 48px);
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 0 0 22px;
}
.page-heading h1,
.login-panel h1 {
  margin: 4px 0 0;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.15;
  font-weight: 680;
  overflow-wrap: anywhere;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 14px;
  flex-wrap: wrap;
}
.search-field {
  position: relative;
  flex: 1 1 240px;
}
.search-field svg {
  position: absolute;
  left: 10px;
  top: 9px;
  width: 17px;
  color: var(--muted);
  pointer-events: none;
}
.search-field input {
  padding-left: 35px;
  width: 100%;
}
input,
select,
.button {
  border: 1px solid var(--border);
  border-radius: 7px;
  min-height: 37px;
  padding: 7px 11px;
  background: var(--surface);
}
input::placeholder {
  color: var(--muted);
}
.button {
  display: inline-flex;
  justify-content: center;
  font-weight: 600;
  white-space: nowrap;
}
.button:hover {
  background: var(--selected);
}
.button svg {
  width: 17px;
  height: 17px;
}
.button.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}
.button.primary:hover {
  filter: brightness(1.13);
}
.reset,
.back {
  color: var(--secondary);
  font-weight: 600;
}
.reset {
  padding: 7px;
}
.back {
  display: inline-flex;
  margin-bottom: 16px;
  font-size: 14px;
}
.back svg {
  width: 16px;
}
.table-wrap {
  overflow-x: auto;
  border-top: 1px solid var(--border);
}
table {
  border-collapse: collapse;
  width: 100%;
  text-align: start;
}
thead {
  background: var(--bg);
}
th,
td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  text-align: start;
}
th {
  font-size: 12px;
  color: var(--muted);
  font-weight: 650;
}
td {
  overflow-wrap: anywhere;
}
td:first-child,
.time {
  white-space: nowrap;
}
.time {
  font-size: 13px;
  color: var(--muted);
}
.record-link {
  color: var(--primary);
  font-weight: 650;
}
.record-link:hover {
  text-decoration: underline;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  background: var(--selected);
  color: var(--primary);
  border-radius: 5px;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}
.badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex: none;
  background: currentColor;
}
.empty {
  text-align: center;
  padding: 30px 14px;
  color: var(--muted);
}
.table-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--muted);
}
.pagination {
  display: flex;
  gap: 9px;
  align-items: center;
}
.pagination .button {
  min-height: 32px;
  padding: 4px 9px;
}
.form {
  display: grid;
  gap: 14px;
}
.form label {
  display: grid;
  gap: 5px;
  font-weight: 600;
}
.form input {
  width: 100%;
  font-weight: 400;
}
.auth-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}
.login-wrap {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 20px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
}
.login-panel {
  width: min(100%, 430px);
  min-width: 0;
  padding: 30px;
}
.login-panel .form,
.login-panel .demo-logins { grid-template-columns: minmax(0, 1fr); }
.login-panel .eyebrow {
  margin-top: 15px;
}
.login-panel .form {
  margin-top: 25px;
}
.draft-dialog,
.draft-page {
  --draft-padding: 24px;
  width: min(100%, 520px);
  background: var(--surface);
  color: var(--text);
}
.draft-dialog {
  width: min(calc(100% - 24px), 520px);
  max-height: calc(100dvh - 24px);
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
}
.draft-dialog::backdrop {
  background: rgb(15 23 34 / 54%);
}
html:has(.draft-dialog[open]) {
  overflow: hidden;
}
.draft-header {
  padding: var(--draft-padding) var(--draft-padding) 0;
}
.draft-header :is(h1, h2) {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}
.draft-header p {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--muted);
}
.draft-form {
  gap: 0;
}
.draft-fields {
  display: grid;
  gap: 16px;
  padding: 20px var(--draft-padding);
}
.draft-field-pair {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 14px;
}
.draft-field {
  display: grid;
  align-content: start;
  gap: 5px;
}
.draft-field input {
  min-height: 42px;
}
.draft-field input[aria-invalid="true"] {
  border-color: var(--danger);
}
.draft-hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
.draft-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px var(--draft-padding);
  border-top: 1px solid var(--border);
}
.draft-cancel {
  border-color: transparent;
}
.request-column {
  width: clamp(104px, 12vw, 148px);
  font-variant-numeric: tabular-nums;
}
.request-subline {
  display: none;
}
@media (max-width: 440px) {
  .draft-dialog,
  .draft-page {
    --draft-padding: 16px;
  }
  .draft-field-pair {
    grid-template-columns: 1fr;
  }
  .draft-field input {
    font-size: 16px;
  }
}
.notice {
  margin: 0;
  color: var(--danger);
  font-size: 14px;
}
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.detail {
  padding: 18px;
  min-width: 0;
}
.detail h2 {
  margin: 0 0 14px;
  font-size: 17px;
}
.detail dl {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) 2fr;
  gap: 8px;
  margin: 0;
}
.detail dt,
.timeline p {
  color: var(--muted);
}
.detail dd,
.timeline p {
  margin: 0;
  overflow-wrap: anywhere;
}
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}
.timeline li {
  align-items: flex-start;
  padding: 8px 0;
}

.utilities .utility-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  cursor: pointer;
  list-style: none;
}
.utility-icon::-webkit-details-marker {
  display: none;
}
.identity {
  color: inherit;
  text-decoration: none;
}
.identity:hover strong {
  text-decoration: underline;
}
.demo-logins {
  display: grid;
  gap: 8px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.demo-logins h2 {
  margin: 0 0 2px;
  font-size: 15px;
}
.demo-login-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.demo-login-controls select {
  flex: 1 1 170px;
  min-width: 0;
  max-width: 100%;
}
.security-return {
  margin-bottom: 16px;
}
.security-return summary {
  cursor: pointer;
  font-weight: 650;
}
.security-return .form {
  margin-top: 12px;
  max-width: 560px;
}
.security-return p {
  margin: 0;
}
.kiosk-main {
  max-width: 900px;
  margin: 0 auto;
}
.crew-field {
  margin-top: 18px;
  max-width: 100%;
}
.crew-field [hidden] {
  display: none;
}
.crew-field h3, .crew-field p {
  margin: 0;
}
.crew-field-capture {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(min(100%,245px),1fr));
  gap: 12px;
}
.crew-field-capture > div {
  min-width: 0;
}
.crew-field-capture canvas, .crew-field-capture video {
  max-width: 100%;
  height: auto;
  margin-block: 5px;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.crew-field-capture [data-stroke] {
  touch-action: none;
  background: white;
}
.crew-field > button[type="submit"] {
  justify-self: start;
  white-space: normal;
}
.security-return button {
  justify-self: start;
}
.permit-progress {
  margin-bottom: 16px;
}
.nav-lightning > span:first-of-type {
  flex: 1;
}
.nav-unread {
  min-width: 22px;
  padding: 1px 5px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--on-primary);
  text-align: center;
  font-size: .75rem;
  font-variant-numeric: tabular-nums;
}
.profile-card {
  overflow: hidden;
  margin-bottom: 22px;
}
.profile-hero {
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 28px);
  padding: clamp(18px, 4vw, 34px);
  background: #152b46;
  color: #fff;
}
.profile-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  width: clamp(62px, 14vw, 96px);
  aspect-ratio: 1;
  border: 2px solid #91abc7;
  border-radius: 20%;
  background: #dce9f4;
  color: #172d49;
  font-size: clamp(1.25rem, 4vw, 2rem);
  font-weight: 700;
}
.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
}
.profile-heading {
  min-width: 0;
  overflow-wrap: anywhere;
}
.profile-heading p {
  margin: 0 0 6px;
  color: #dce9f4;
}
.profile-heading h1 {
  margin: 0;
  font-size: clamp(1.3rem, 3vw, 2.35rem);
}
.profile-heading > span {
  display: block;
  margin-top: 6px;
  color: #dce9f4;
}
.profile-info {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(195px, 1fr);
  gap: 18px;
  padding: clamp(16px, 4vw, 30px);
}
.profile-info dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
}
.profile-info dt,
.profile-identifier > span {
  font-size: .83rem;
  color: var(--muted);
}
.profile-info dd {
  margin: 4px 0 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.profile-identifier {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
}
.profile-code {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin: 4px 0;
}
.profile-code > span {
  font-size: .72rem;
  font-weight: 650;
  color: var(--muted);
}
.profile-code code {
  font-size: clamp(1rem, 3vw, 1.3rem);
  font-weight: 700;
  letter-spacing: .08em;
}
.profile-identifier summary {
  display: flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  padding-block: 6px;
  cursor: pointer;
  font-size: .85rem;
}
.profile-identifier summary svg {
  width: 15px;
  height: 15px;
}
.profile-dex {
  padding-top: 6px;
  border-top: 1px solid var(--border);
}
.profile-section-title {
  margin: 0 0 10px;
  font-size: 1.1rem;
}
@media (max-width: 640px) {
  .profile-info {
    grid-template-columns: minmax(0, 1fr);
  }
}
.permit-progress-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
}
.permit-progress-heading h2 {
  margin: 0;
}
.permit-progress-list,
.profile-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 145px), 1fr));
  gap: 8px;
}
.permit-progress-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.permit-stage {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 9px;
  font-size: 13px;
  color: var(--muted);
}
.permit-stage-number {
  display: grid;
  place-items: center;
  flex: 0 0 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid currentColor;
  font-variant-numeric: tabular-nums;
}
.permit-stage-done {
  color: var(--text);
  background: var(--selected);
}
.permit-stage-current {
  color: var(--on-primary);
  background: var(--primary);
  border-color: var(--primary);
  font-weight: 650;
}
.permit-stage-action {
  padding: 0;
  border-color: var(--secondary);
}
.permit-training-note {
  margin: 0 0 10px;
}
.permit-heading-actions {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.permit-heading-actions > .badge {
  margin-top: 6px;
}
.permit-pdf-action {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
}
.permit-stage-link {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  padding: 5px 9px;
  color: var(--primary);
  font-weight: 650;
  border-radius: inherit;
}
.permit-stage-link:hover {
  background: var(--selected);
}
.permit-stage-link svg {
  width: 15px;
  height: 15px;
  flex: none;
  margin-inline-start: auto;
}
.draft-responsibles {
  margin: 0 var(--draft-padding) 15px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 0;
}
.draft-responsibles legend {
  padding-inline: 5px;
  font-weight: 650;
}
.permit-responsibles .permit-responsible-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  gap: 12px;
}
.draft-responsible-grid {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.draft-responsible-grid .draft-field {
  grid-template-columns: minmax(112px, 1fr) minmax(0, 3fr);
  align-items: center;
  gap: 8px;
}
.draft-responsible-grid .notice {
  grid-column: 1 / -1;
}
.draft-responsible-grid select {
  width: 100%;
  min-width: 0;
  min-height: 42px;
}
@media (max-width: 440px) {
  .draft-responsible-grid .draft-field {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }
}
.permit-responsibles {
  margin-block: 14px;
}
.permit-responsible-grid > div {
  min-width: 0;
}
.permit-responsible-grid dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}
[id="permit-issue"], #permit-review, #readiness {
  scroll-margin-top: var(--header-height);
}
.profile-metrics {
  gap: 12px;
}
.profile-metric {
  display: grid;
  gap: 5px;
  text-decoration: none;
  color: inherit;
}
.profile-metric strong {
  font-size: 28px;
  font-variant-numeric: tabular-nums;
}
.profile-metric:hover span {
  text-decoration: underline;
}
.signed-document-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-block: 8px;
}
.home-heading {
  margin-bottom: 26px;
}
.home-user {
  margin: 6px 0 0;
}
.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(218px, 294px);
  align-items: start;
  gap: 22px;
}
.home-main {
  min-width: 0;
  display: grid;
  gap: 26px;
}
.home-main h2 {
  font-size: 19px;
  margin: 0 0 12px;
}
.home-section-heading {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: baseline;
}
.home-section-heading a {
  font-size: 13px;
  color: var(--secondary);
}
.home-task {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}
.home-task-sign {
  background: var(--selected);
}
.home-task:hover,
.home-actions a:hover {
  border-color: var(--secondary);
  background: var(--bg);
}
.home-task-icon {
  display: grid;
  place-items: center;
  flex: 0 0 37px;
  height: 37px;
  color: var(--primary);
  background: var(--surface);
  border-radius: 8px;
}
.home-task-text,
.home-task > strong {
  flex: 1;
  min-width: 0;
}
.home-task-text > span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}
.home-task > svg,
.home-actions svg {
  flex-shrink: 0;
  color: var(--secondary);
}
.home-count {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 20px;
  padding: 2px 9px;
  font-variant-numeric: tabular-nums;
}
.home-actions a {
  display: grid;
  grid-template-columns: 22px 1fr 20px;
  gap: 9px;
  align-items: center;
  padding: 11px 4px;
  border-top: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
}
.home-records table {
  min-width: 0;
}
.home-records tbody td:nth-child(2) {
  overflow-wrap: anywhere;
}
@media (max-width: 1080px) {
  .home-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 520px) {
  .home-record-site {
    display: none;
  }
  .home-records :is(th, td) {
    padding-inline: 8px;
  }
}
.event-icon {
  color: var(--secondary);
  background: var(--selected);
  padding: 5px;
  border-radius: 50%;
  display: grid;
}
.event-icon svg {
  width: 16px;
  height: 16px;
}
@media (max-width: 760px) {
  .top {
    position: static;
  }
  .shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1fr;
  }
  .sidebar {
    top: 0;
    height: auto;
    overflow-y: visible;
    padding: 8px 18px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  .sidebar p {
    display: none;
  }
  .identity {
    margin: 0;
    padding: 0;
    border: 0;
    text-align: right;
  }
  .main {
    padding-top: 21px;
  }
  .detail-grid {
    grid-template-columns: 1fr;
  }
}

/* Shared workspace shell and dashboard */
.header-scope {
  display: grid;
  margin-right: auto;
  margin-left: clamp(18px, 4vw, 52px);
  line-height: 1.28;
}
.header-scope span { color: var(--muted); font-size: .8rem; }
.sidebar-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sidebar-heading p { padding: 0 0 0 8px; }
.sidebar-toggle {
  display: grid;
  place-items: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--primary);
  cursor: pointer;
}
.sidebar-toggle:hover, .identity:hover, .identity[aria-current="page"] { background: var(--selected); }
.sidebar .nav-item > svg, .identity > svg { flex: 0 0 20px; }
.sidebar .identity {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: 10px;
  text-align: left;
  min-width: 0;
}
.identity .identity-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--selected);
  color: var(--primary);
  font-weight: 700;
}
.identity-copy { display: grid; flex: 1; min-width: 0; gap: 1px; }
.identity-copy strong, .identity-copy > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.identity-copy strong { font-size: .85rem; color: var(--text); }
.identity-copy > span { font-size: .73rem; }
.identity > svg { width: 15px; height: 15px; }
:root[data-sidebar="collapsed"] .sidebar-heading p,
:root[data-sidebar="collapsed"] .sidebar .nav-label,
:root[data-sidebar="collapsed"] .identity-copy,
:root[data-sidebar="collapsed"] .identity > svg { display: none; }
:root[data-sidebar="collapsed"] .sidebar-heading { justify-content: center; }
:root[data-sidebar="collapsed"] .sidebar .nav-item {
  position: relative;
  justify-content: center;
  min-height: 38px;
  padding-inline: 0;
}
:root[data-sidebar="collapsed"] .sidebar .identity { justify-content: center; padding: 4px; }
:root[data-sidebar="collapsed"] .nav-unread {
  position: absolute;
  right: 1px;
  top: 0;
  min-width: 16px;
  font-size: .62rem;
}
@media (min-width: 761px) {
  :root[data-sidebar="collapsed"] .shell { grid-template-columns: 64px minmax(0, 1fr); }
  :root[data-sidebar="collapsed"] .sidebar { padding-inline: 9px; }
}
@media (max-width: 760px) {
  .header-scope { display: none; }
  .sidebar { gap: 6px; }
  .sidebar nav.nav-workspace {
    display: flex;
    flex: 1;
    flex-wrap: wrap;
    min-width: 0;
  }
  .sidebar .identity { flex: 0 0 auto; }
  .sidebar .sidebar-toggle { width: 42px; height: 42px; }
  :root[data-sidebar="collapsed"] .sidebar .nav-item { min-width: 42px; min-height: 42px; }
}
@media (max-width: 500px) {
  .sidebar .identity-copy, .sidebar .identity > svg { display: none; }
  .sidebar .identity { padding: 4px; }
}
.home-secondary { display: grid; gap: 14px; min-width: 0; }
.home-secondary > section { min-width: 0; }
.home-task { padding: clamp(14px, 2.8vw, 26px); min-height: 92px; }
.home-task-icon, .dashboard-icon {
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--selected);
  color: var(--primary);
}
.dashboard-icon { width: 36px; height: 36px; }
.home-secondary .home-actions a { grid-template-columns: 36px minmax(0, 1fr) 16px; }
.dashboard-metric strong { margin-right: 5px; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.dashboard-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  flex-wrap: wrap;
}
.dashboard-tabs a {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  flex: 1 1 auto;
  padding: 8px 10px;
  border-radius: 7px;
  text-decoration: none;
  color: var(--text);
}
.dashboard-tabs a[aria-current="page"] { background: var(--primary); color: var(--on-primary); }
.dashboard-records { display: grid; gap: 8px; }
.dashboard-record {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto 16px;
  gap: 12px;
  align-items: center;
  padding: 13px;
  color: var(--text);
  text-decoration: none;
}
.dashboard-record:hover { border-color: var(--secondary); }
.dashboard-record-name, .dashboard-record-state { display: grid; gap: 3px; min-width: 0; overflow-wrap: anywhere; }
.dashboard-record small, .dashboard-record-name small { color: var(--muted); }
.dashboard-record > svg { width: 16px; color: var(--muted); }
.workspace-top {
  --workspace-rail-width: clamp(176px, 24vw, 224px);
  display: grid;
  grid-template-columns: var(--workspace-rail-width) minmax(0, 1fr) auto;
  gap: 0;
  padding: 0 24px 0 0;
}
.workspace-top .brand {
  align-self: stretch;
  min-width: 0;
  padding: 0 14px;
  border-right: 1px solid var(--border);
}
.brand-text, .top-profile-copy { display: grid; gap: 2px; min-width: 0; }
.brand-text small, .top-profile-copy small { color: var(--muted); font-size: .72rem; font-weight: 500; letter-spacing: 0; line-height: 1.2; }
.brand-text strong { color: var(--text); }
.workspace-top .header-scope { margin: 0; padding-inline: clamp(16px, 3vw, 34px); min-width: 0; }
.workspace-top .header-scope > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-profile { display: flex; gap: 8px; align-items: center; color: var(--text); text-decoration: none; border-radius: 8px; padding: 3px 6px; }
.top-profile:hover { background: var(--selected); }
.top-avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--selected); color: var(--primary); font-size: .78rem; font-weight: 700; }
.top-profile-copy strong { font-size: .83rem; }
.workspace-dashboard {
  max-width: 1560px;
  margin-inline: auto;
  gap: clamp(18px, 2vw, 30px);
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
}
.workspace-dashboard .home-heading { margin: 0; }
.workspace-dashboard h1 { font-size: clamp(26px, 3vw, 39px); letter-spacing: -.025em; }
.workspace-dashboard .home-user { font-size: 1.02rem; }
.workspace-dashboard .home-main { gap: 20px; }
.workspace-dashboard .home-secondary { gap: 16px; }
.workspace-dashboard .home-actions h2, .workspace-dashboard .home-section-heading h2 { font-size: clamp(17px, 1.55vw, 23px); letter-spacing: -.016em; }
.workspace-dashboard .home-actions > p { margin-block: 10px 2px; }
.workspace-dashboard .home-task {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 14px;
  min-height: 105px;
  border-radius: 13px;
}
.workspace-dashboard .home-task:hover { border-color: var(--border); background: var(--surface); }
.workspace-dashboard .home-task-icon { width: 52px; height: 52px; }
.workspace-dashboard .home-task-icon svg { width: 24px; height: 24px; }
.workspace-dashboard .home-task-text strong { font-size: clamp(1rem, 1.35vw, 1.22rem); }
.dashboard-cta, .dashboard-tabs a[aria-current="page"] { background: light-dark(#24568e, #9dc5f3); color: light-dark(#fff, #102641); }
.dashboard-cta { border-color: transparent; font-weight: 650; }
.dashboard-cta:hover { filter: brightness(1.12); text-decoration: none; }
.dashboard-cta svg { width: 16px; }
.workspace-dashboard .dashboard-tabs { background: var(--bg); }
.workspace-dashboard .dashboard-record { min-height: 88px; border-radius: 12px; }
.workspace-dashboard .dashboard-record-state { justify-items: start; }
.workspace-dashboard .home-actions [href^="/safety/"] .dashboard-icon { background: light-dark(#fff1e5, #493021); color: light-dark(#aa530b, #ffb47d); }
@media (min-width: 761px) {
  :root[data-sidebar="collapsed"] .workspace-top { --workspace-rail-width: 64px; }
  :root[data-sidebar="collapsed"] .workspace-top .brand-text { display: none; }
  :root[data-sidebar="collapsed"] .workspace-top .brand { justify-content: center; padding: 0; }
}
@media (min-width: 761px) and (max-height: 510px) {
  .sidebar { padding-block: 8px; gap: 5px; }
  .sidebar .sidebar-toggle { height: 28px; }
  .sidebar .nav-workspace { gap: 2px; }
  .sidebar .nav-item { line-height: 1.12; min-height: 26px; padding-block: 3px; }
  :root[data-sidebar="collapsed"] .sidebar .nav-item { min-height: 26px; }
}
@media (max-width: 1050px) {
  .workspace-dashboard { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .workspace-top { display: flex; gap: 6px; padding: 0 14px; }
  .workspace-top .brand { border: 0; padding: 0; }
  .workspace-top .brand-text small, .top-profile-copy { display: none; }
  .workspace-top .utilities { gap: 4px; }
}
@media (max-width: 540px) {
  .workspace-dashboard .home-task { grid-template-columns: 42px minmax(0, 1fr); padding: 14px; }
  .workspace-dashboard .home-task-icon { width: 42px; height: 42px; }
  .dashboard-cta { grid-column: 2; justify-self: start; }
}
.permit-status:is([data-stage="issued"], [data-stage="safety_ready"], [data-stage="extended"]) {
  background: light-dark(#fff2cf, #45391f);
  color: light-dark(#6a4700, #ffdf87);
}
.permit-status:is([data-stage="admitted"], [data-stage="in_progress"], [data-stage="completed"], [data-stage="closed"]) {
  background: light-dark(#e4f4e9, #173c31);
  color: light-dark(#285f42, #a6e3bd);
}
.permit-status:is([data-administrative="suspended"], [data-administrative="revoked"]) {
  background: light-dark(#fae7e8, #4b2932);
  color: light-dark(#922e3d, #ffb1b9);
}
.panel.table-wrap,
.detail.panel,
.policy-panel { border-radius: 12px; }
.table-wrap tbody tr:hover { background: color-mix(in srgb, var(--selected) 38%, transparent); }
@media (max-width: 500px) {
  .dashboard-record { grid-template-columns: 36px minmax(0, 1fr) 16px; gap: 8px; }
  .dashboard-record-state { grid-column: 2; grid-row: 2; justify-self: start; }
  .dashboard-record > svg { grid-column: 3; grid-row: 1; }
}
@media (max-width: 500px) {
  .top {
    padding: 8px 14px;
  }
  .quiet {
    font-size: 12px;
    padding: 5px;
  }
  .sidebar {
    padding: 8px 14px;
  }
  .sidebar nav.nav-workspace {
    display: flex;
    flex-wrap: wrap;
  }
  .sidebar .nav-item {
    min-height: 44px;
    padding-inline: 7px;
    gap: 5px;
    font-size: 14px;
  }
  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .toolbar select {
    max-width: 100%;
  }
  .detail dl {
    grid-template-columns: 1fr 1fr;
  }
  .login-panel {
    padding: 22px;
  }
}
@media (max-width: 600px) {
  .request-subline {
    display: block;
    color: var(--muted);
    font-size: 12px;
  }
  .secondary-column {
    display: none;
  }
  th,
  td {
    padding-inline: 9px;
  }
  td .badge {
    overflow-wrap: normal;
    white-space: normal;
  }
}

.issue-form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.issue-form p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.issue-notice {
  margin-bottom: 12px;
}

.nav-item[aria-current="page"],
.nav-item:hover {
  background: var(--selected);
}
.sidebar nav {
  display: grid;
  gap: 3px;
}
.policy-layout {
  display: grid;
  gap: 16px;
}
.policy-panel {
  min-width: 0;
  scroll-margin-block-start: 60px;
}
.policy-header,
.policy-form {
  padding: 14px 16px;
}
.policy-header {
  padding-bottom: 0;
}
.policy-header h2 {
  margin: 0;
  font-size: 18px;
}
.policy-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.policy-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 205px), 1fr));
  gap: 10px 12px;
}
.policy-field {
  display: grid;
  gap: 5px;
}
.policy-fields :is(input, select) {
  min-width: 0;
  width: 100%;
}
.policy-date {
  display: block;
  white-space: nowrap;
}
.policy-panel td:first-child {
  white-space: normal;
}
.employee-create > summary {
  padding: 14px 16px;
  font-weight: 650;
  cursor: pointer;
}
.employee-login {
  display: block;
  color: var(--muted);
  font-size: 0.875em;
}
.safety-recipients {
  max-height: 14rem;
  overflow: auto;
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
}
.lightning-signature canvas {
  display: block;
  width: min(100%, 600px);
  height: auto;
  margin: 6px 0 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  touch-action: none;
}
.safety-form textarea {
  width: 100%;
  min-width: 0;
  resize: vertical;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.management-filter,
.management-summary {
  margin-bottom: 14px;
}
.management-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 14px;
}
.management-permits {
  grid-row: span 2;
}
.management-counts {
  margin: 0;
  padding: 0;
  list-style: none;
}
.management-counts a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 16px;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 6px 3px;
  border-top: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
}
.management-counts a:hover {
  background: var(--bg);
}
.management-counts strong {
  font-variant-numeric: tabular-nums;
}
.management-counts svg {
  width: 16px;
  color: var(--muted);
}
@media (max-width: 760px) {
  .management-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .management-permits {
    grid-row: auto;
  }
}

.issue-form + .issue-form {
  border-top: 0;
  margin-top: 10px;
  padding-top: 0;
}
.detail .certificate-summary {
  margin: 7px 0;
}
.timeline li > div {
  min-width: 0;
}

.form .toggle-field {
  display: flex;
  gap: 8px;
  align-items: center;
}
.form .toggle-field input {
  width: auto;
  min-height: auto;
  margin: 0;
  accent-color: var(--primary);
}
.draft-form > .toggle-field {
  margin: 0 var(--draft-padding) 20px;
}
.readiness-layout {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}
.readiness-panel {
  min-width: 0;
  scroll-margin-top: 8px;
}
.readiness-header,
.readiness-form {
  padding: 14px 16px;
}
.readiness-header {
  padding-bottom: 10px;
}
.readiness-header h2 {
  margin: 0;
  font-size: 18px;
}
.readiness-header p,
.readiness-checklist p,
.readiness-actions p,
.readiness-empty {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.readiness-checklist {
  display: grid;
  gap: 0;
  padding: 0;
  margin: 0;
  list-style: none;
}
.readiness-checklist li {
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.readiness-checklist li:last-child {
  border-bottom: 0;
}
.readiness-panel > .readiness-checklist {
  padding: 0 16px 14px;
}
.readiness-checklist-label {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: baseline;
}
.readiness-checklist-label span {
  color: var(--muted);
  font-size: 13px;
}
.readiness-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  border-top: 1px solid var(--border);
}
.readiness-actions .button:disabled {
  opacity: 0.65;
  cursor: default;
}
.readiness-actions p {
  margin: 0;
}
.gas-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 10px;
}
.gas-fields input {
  min-width: 0;
}
.readiness-empty {
  padding: 3px 16px 14px;
}
.gas-table td:first-child {
  white-space: normal;
}
.page-heading > .badge {
  white-space: normal;
}

@media (max-width: 600px) {
  .gas-table {
    position: relative;
  }
  .gas-table table,
  .gas-table tbody {
    display: block;
  }
  .gas-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .gas-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 4px 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
  }
  .gas-table tbody tr:last-child {
    border-bottom: 0;
  }
  .gas-table td {
    padding: 0;
    border: 0;
  }
  .gas-table td:first-child {
    font-weight: 600;
  }
  .gas-table td:nth-child(n + 3) {
    color: var(--muted);
    font-size: 13px;
  }
}

.crew-panel {
  margin-top: 16px;
}
.crew-panel :is(.crew-members, .crew-picker, .crew-previous) {
  list-style: none;
  margin: 0;
  padding: 0;
}
.crew-members li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  overflow-wrap: anywhere;
}
.crew-members p,
.crew-recorded,
.crew-form-options .muted,
.crew-picker small,
.crew-state .muted {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.crew-state {
  text-align: right;
}
.crew-recorded {
  padding: 8px 16px 10px;
}
.crew-form-options {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}
.crew-form-options summary {
  font-weight: 600;
}
.crew-form-options form,
.crew-panel ul.crew-previous {
  margin-top: 10px;
}
.crew-picker {
  max-height: 240px;
  overflow-y: auto;
}
.crew-picker .toggle-field {
  padding: 7px 3px;
}
.crew-picker small {
  margin: 0;
  display: block;
  font-weight: 400;
}
@media (max-width: 440px) {
  .crew-members li {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }
  .crew-state {
    text-align: left;
  }
  .crew-state p {
    display: inline-block;
    margin: 0 0 0 6px;
  }
}

.work-panel {
  border-top: 1px solid var(--border);
  margin-top: 16px;
  padding-top: 14px;
}
.work-panel h3 {
  margin: 0 0 10px;
  font-size: 16px;
}
.work-form {
  display: grid;
  justify-items: start;
  gap: 7px;
}
.work-form + .work-form {
  margin-top: 12px;
}
.work-form label {
  display: grid;
  gap: 4px;
  font-weight: 600;
  width: min(100%, 320px);
}
.work-form input {
  width: 100%;
  min-width: 0;
}
.work-form .muted {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.closure-digest {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.work-panel .closure-digest {
  word-break: break-all;
}
.closure-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.closure-verify,
.closure-hashes {
  border-top: 1px solid var(--border);
  margin-top: 14px;
  padding-top: 12px;
}
.closure-verify input[type="file"] {
  max-width: 100%;
}
.attachment-panel {
  margin-top: 16px;
  scroll-margin-top: 80px;
}
.attachment-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.attachment-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 18px;
  align-items: baseline;
  border-top: 1px solid var(--border);
  padding: 10px 0;
}
.attachment-list li a {
  overflow-wrap: anywhere;
  font-weight: 600;
}
.attachment-list .muted,
.attachment-form .muted {
  font-size: 13px;
}
.attachment-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--border);
  margin-top: 10px;
  padding-top: 12px;
}
.attachment-form > div {
  min-width: 0;
}
.attachment-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 5px;
}
.attachment-form input {
  max-width: 100%;
}
.attachment-form input::file-selector-button,
.defect-form input::file-selector-button,
.closure-verify input::file-selector-button {
  background: var(--selected);
  border: 0;
  border-radius: 4px;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  margin-inline-end: 8px;
  padding: 3px 8px;
}
.attachment-form .muted {
  margin: 5px 0 0;
}
@media (max-width: 600px) {
  .attachment-list li {
    grid-template-columns: minmax(0, 1fr);
  }
}
.defect-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(145px, 200px) auto auto;
}
.defect-register {
  margin-top: 12px;
}
.defect-register > summary {
  display: inline-flex;
  cursor: pointer;
}
.defect-register .defect-form {
  display: grid;
  width: min(100%, 620px);
  margin-top: 12px;
  gap: 11px;
}
.defect-form textarea {
  width: 100%;
  min-height: 90px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  resize: vertical;
}
.defect-form input[type="file"] {
  max-width: 100%;
}
.defect-form .defect-confirm {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.defect-form button {
  justify-self: start;
}
.defect-photo-hint {
  margin: -6px 0 0;
  font-size: 13px;
}
.defect-description {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.defect-photo-link {
  overflow-wrap: anywhere;
}
.defect-state-resolved {
  background: color-mix(in srgb, #287d53 17%, var(--surface));
}
.defect-state-in_progress {
  background: color-mix(in srgb, #bc8d26 24%, var(--surface));
}
@media (max-width: 700px) {
  .defect-toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .defect-toolbar .search-field,
  .defect-toolbar .reset {
    grid-column: 1 / -1;
  }
}
.verification-match {
  color: var(--text);
  background: color-mix(in srgb, #287d53 17%, var(--surface));
  border: 1px solid color-mix(in srgb, #287d53 44%, var(--border));
  border-radius: 6px;
  padding: 6px 10px;
}
.signing-preview {
  min-width: 0;
}
.signing-preview .closure-downloads {
  margin-top: 0;
}
.signing-preview-frame {
  display: block;
  width: 100%;
  height: min(72vh, 850px);
  min-height: 360px;
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}
@media (max-width: 760px) {
  .signing-preview-frame {
    display: none;
  }
}
.closure-hashes summary {
  cursor: pointer;
  color: var(--muted);
}

@media (max-width: 500px) {
  .work-panel .closure-digest {
    grid-column: 1 / -1;
  }
}
.phone-more, .phone-label, .sidebar .phone-profile { display: none; }
.phone-sections { display: contents; }

body {
  padding-inline: env(safe-area-inset-left, 0px) env(safe-area-inset-right, 0px);
}

@media (max-width: 760px) {
  .top { padding-top: max(8px, env(safe-area-inset-top, 0px)); }
}

@media (max-width: 600px) {
  :root {
    --phone-nav-height: 60px;
    scroll-padding-bottom: calc(var(--phone-nav-height) + env(safe-area-inset-bottom, 0px) + 12px);
  }
  .shell:has(.phone-nav-ready) { grid-template-rows: 1fr; }
  .phone-nav-ready + .main {
    min-width: 0;
    padding: 16px 12px calc(var(--phone-nav-height) + env(safe-area-inset-bottom, 0px) + 18px);
  }
  .sidebar.phone-nav-ready {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 4;
    min-height: var(--phone-nav-height);
    padding: 4px max(6px, env(safe-area-inset-right, 0px)) calc(4px + env(safe-area-inset-bottom, 0px)) max(6px, env(safe-area-inset-left, 0px));
    border-top: 1px solid var(--border);
    border-bottom: 0;
    gap: 2px;
    box-shadow: 0 -4px 18px #172d4910;
  }
  .sidebar.phone-nav-ready .sidebar-heading, .sidebar.phone-nav-ready .identity { display: none; }
  .sidebar.phone-nav-ready .nav-workspace { flex-wrap: nowrap; gap: 2px; }
  .sidebar.phone-nav-ready .phone-primary,
  .sidebar.phone-nav-ready .phone-more {
    flex: 1 1 0;
    min-width: 0;
    min-height: 50px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 3px;
    padding: 4px;
    font-size: .74rem;
    line-height: 1.2;
    white-space: nowrap;
  }
  .sidebar.phone-nav-ready .nav-workspace { flex: 3 1 0; }
  .sidebar .phone-more {
    border: 0;
    border-radius: 7px;
    background: var(--surface);
    color: var(--primary);
    font-weight: 600;
  }
  .sidebar .phone-more[aria-expanded="true"] { background: var(--selected); }
  :root .sidebar.phone-nav-ready .nav-label { display: block; }
  :root .sidebar.phone-nav-ready .phone-registry .nav-label { display: none; }
  .sidebar.phone-nav-ready .phone-label { display: block; }
  .sidebar.phone-nav-ready .nav-unread { position: absolute; top: 3px; left: calc(50% + 5px); right: auto; }
  .sidebar.phone-nav-ready .phone-sections { display: none; }
  .sidebar.phone-menu-open .phone-sections {
    position: absolute;
    inset-inline: max(8px, env(safe-area-inset-left, 0px)) max(8px, env(safe-area-inset-right, 0px));
    bottom: calc(100% + 5px);
    display: grid;
    max-height: 60dvh;
    overflow: auto;
    overscroll-behavior: contain;
    padding: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 4px 20px #172d4933;
  }
  .sidebar.phone-menu-open .phone-sections .nav-item {
    display: flex;
    justify-content: flex-start;
    min-height: 44px;
    gap: 10px;
    padding-inline: 10px;
  }
  .top .utility-icon, .top .top-profile { min-width: 44px; min-height: 44px; justify-content: center; }
  input:not([type="hidden"]), select, textarea { font-size: 16px; min-width: 0; max-width: 100%; }
  .button, .toolbar select, .toolbar input { min-height: 44px; }
  .toolbar { gap: 8px; padding: 10px; }
  .toolbar .search-field { flex-basis: 100%; }
  .toolbar select { flex: 1 1 100px; }
  .toolbar[action="/permits"] .button { flex: 1 1 100%; }
  .permit-list table { min-width: 0; table-layout: fixed; }
  .permit-list th:first-child { width: 76px; }
  .permit-list th:nth-child(5) { width: clamp(86px, 27vw, 118px); }
  .permit-list td { overflow-wrap: anywhere; }
  .permit-list td .badge { overflow-wrap: anywhere; }
  .permit-list .record-link { display: inline-flex; align-items: center; min-height: 44px; }
  .permit-list tbody tr { position: relative; }
  .permit-list .record-link::after { content: ""; position: absolute; inset: 0; }
  .detail, .page-heading, .dashboard-record-name { overflow-wrap: anywhere; }
}

@media (max-width: 350px) {
  .toolbar[action="/permits"] select { flex-basis: 100%; }
}

@media (max-width: 600px), (max-height: 520px) and (pointer: coarse) {
  .auth-layout {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }
  .auth-layout .top {
    gap: 8px;
    padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px;
  }
  .auth-layout .brand { min-width: 0; }
  .auth-layout .brand-icon, .auth-layout .utilities { flex-shrink: 0; }
  .auth-layout .utilities { flex-wrap: nowrap; gap: 2px; }
  .auth-layout .brand-text small { display: none; }
  .auth-layout .utility-icon { width: 44px; height: 44px; }
  .login-wrap {
    align-items: start;
    padding: 16px 12px calc(16px + env(safe-area-inset-bottom, 0px));
  }
  .login-panel { padding: clamp(14px, 5vw, 22px); }
  .login-panel .form { margin-top: 16px; }
  .login-panel .demo-logins { margin-top: 16px; padding-top: 14px; }
  .login-panel .demo-login-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }
  .login-panel .demo-login-controls select { width: 100%; }
  .login-panel :is(input:not([type="hidden"]), select) {
    min-width: 0;
    min-height: 46px;
    font-size: 16px;
  }
  .login-panel .button { min-height: 46px; justify-content: center; }
}

/* UOG Permit preview */
.uog-route { margin-bottom: 16px; scroll-margin-top: 12px; }
.uog-route-columns { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
.uog-route-columns h3 { margin: 0 0 8px; font-size: .94rem; }
.uog-route-checklist, .uog-route-steps { list-style: none; padding: 0; margin: 0; }
.uog-route-checklist li, .uog-route-steps li { display: flex; align-items: center; gap: 8px; min-height: 40px; border-top: 1px solid var(--border); padding: 6px 0; }
.uog-route-checklist li { justify-content: space-between; }
.uog-route-steps li > span { min-width: 25px; text-align: center; padding: 3px; border-radius: 6px; background: var(--selected); color: var(--primary); }
.uog-route-steps li > small { margin-left: auto; color: var(--muted); }
.uog-route-steps .uog-step-current { background: var(--selected); border-radius: 6px; padding-inline: 6px; }
.uog-confirmation .button { min-height: 44px; }
.uog-route-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; border-top: 1px solid var(--border); margin-top: 12px; padding-top: 12px; }
.uog-route-actions p { margin: 0; }
.uog-route-actions .button { min-height: 44px; }
.uog-route-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--primary); text-decoration: underline; }
.uog-route-missing, .uog-route-trial-status { background: light-dark(#fff1d9, #413625); color: light-dark(#72430e, #ffdba0); }
.uog-work-kinds { min-width: 0; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin: 0; }
.uog-work-kinds legend { font-weight: 700; padding-inline: 4px; }
.uog-work-kinds > div { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.uog-work-kinds label { display: flex; align-items: center; gap: 6px; min-height: 44px; }
.uog-work-kinds input { width: 17px; height: 17px; accent-color: var(--primary); }
.uog-work-kinds small { color: var(--muted); }
@media (max-width: 650px) {
  .uog-route-columns { grid-template-columns: minmax(0,1fr); gap: 12px; }
  .uog-route-steps li { flex-wrap: wrap; }
}
.uog-package { margin-bottom: 16px; scroll-margin-top: 12px; }
.uog-package-heading, .uog-package-footer { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.uog-package-heading { justify-content: space-between; margin-bottom: 14px; }
.uog-package-heading h2, .uog-package-heading p { margin: 0; }
.uog-package-heading p { margin-top: 4px; }
.uog-package-ready { background: light-dark(#e2f3e6, #234135); color: light-dark(#225836, #c4e8ce); }
.uog-package-form { display: grid; gap: 14px; }
.uog-ppr-upload { display: grid; gap: 6px; padding: 12px; border: 1px dashed var(--border); border-radius: 8px; }
.uog-ppr-upload input { width: 100%; min-height: 44px; }
.uog-ppr-upload input::file-selector-button {
  margin-inline-end: 8px;
  padding: 5px 8px;
  border: 0;
  border-radius: 5px;
  background: var(--selected);
  color: var(--primary);
  font: inherit;
  cursor: pointer;
}
.uog-ppr-upload small, .uog-package-footer small { color: var(--muted); }
.uog-package-fields, .uog-package dl.uog-package-readonly {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 12px;
}
.uog-package-fields label { display: grid; gap: 5px; min-width: 0; }
.uog-package-fields textarea {
  width: 100%;
  padding: 9px 11px;
  resize: vertical;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.uog-package-footer .button { min-height: 44px; }
.uog-package-readonly dd { white-space: pre-wrap; }
.uog-package-download { display: flex; align-items: center; gap: 8px; min-height: 44px; margin-bottom: 8px; overflow-wrap: anywhere; color: var(--primary); text-decoration: underline; }
.uog-package-download svg { flex-shrink: 0; }
@media (max-width: 600px) {
  .uog-package-fields, .uog-package dl.uog-package-readonly { grid-template-columns: minmax(0,1fr); }
  .uog-package-fields textarea { font-size: 16px; }
  .uog-package-footer .button { width: 100%; justify-content: center; }
}
.uog-brand-mark {
  display: flex;
  justify-content: center;
  align-items: start;
  width: 34px;
  height: 34px;
  flex: none;
  overflow: hidden;
  background: #fff;
  border-radius: 8px;
}
.uog-brand-mark img { flex: none; width: 47px; height: auto; }
.uog .brand-text strong { letter-spacing: 0; }
.uog.auth-layout .top { justify-content: flex-end; }
.uog .login-wrap {
  width: min(100%, 1120px);
  margin-inline: auto;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  gap: clamp(20px, 4vw, 64px);
  padding-inline: clamp(16px, 4vw, 48px);
}
.uog .uog-login-card { width: 100%; padding: clamp(20px, 4vw, 42px); border-radius: 16px; }
.uog-login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.uog-login-brand img {
  flex: none;
  object-fit: contain;
  padding: 5px;
  background: #fff;
  border-radius: 6px;
}
.uog-login-brand strong { display: block; font-size: 18px; line-height: 1.25; }
.uog .uog-login-card .eyebrow { margin: 3px 0 0; }
.uog .uog-login-card .button { min-height: 44px; justify-content: center; }
.uog-login-overview {
  align-self: stretch;
  max-height: 460px;
  min-width: 0;
  margin-block: auto;
  padding: clamp(28px, 6vw, 70px) clamp(26px, 4vw, 50px);
  border-radius: 16px;
  background: radial-gradient(ellipse at 100% 0, #1e5878, transparent 70%), #12304a;
  color: #fff;
}
.uog-login-overview strong { display: block; font-size: clamp(26px, 3vw, 40px); line-height: 1.12; }
.uog-login-overview p { max-width: 330px; margin: 16px 0 0; color: #dbebf4; }
.uog-workspace { max-width: 1280px; margin-inline: auto; }
.uog-workspace .page-heading p { margin: 5px 0 0; }
.uog-dashboard { display: grid; grid-template-columns: minmax(0, 2.3fr) minmax(220px, 1fr); gap: 18px; align-items: start; }
.uog-queue, .uog-summary { border-radius: 12px; }
.uog-queue-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto 20px;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  min-height: 60px;
  border-top: 1px solid var(--border);
}
.uog-queue-row:hover { background: var(--selected); }
.uog-queue-row small { color: var(--muted); }
.uog-draft-metric { display: flex; gap: 12px; align-items: center; padding-block: 8px; border-bottom: 1px solid var(--border); min-height: 44px; }
.uog-draft-metric strong { font-size: 1.6rem; }
.uog-draft-metric svg { margin-inline-start: auto; }
@media (max-width: 900px) {
  .uog-dashboard { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 680px) {
  .uog .login-wrap { grid-template-columns: minmax(0, 1fr); gap: 0; align-content: start; padding-inline: 12px; }
  .uog-login-overview { display: none; }
  .uog .uog-login-card { max-width: 430px; }
}
@media (max-width: 420px) {
  .uog-queue-row { grid-template-columns: minmax(0, 1fr) auto; }
  .uog-queue-row > .dashboard-icon, .uog-queue-row > svg { display: none; }
  .uog-queue-row > .badge { max-width: 114px; white-space: normal; }
}
