:root {
  --portal-navy: #0b2f4f;
  --portal-navy-deep: #06233b;
  --portal-blue: #176b9e;
  --portal-blue-bright: #1e84bd;
  --portal-cyan: #79c6e4;
  --portal-ink: #172533;
  --portal-muted: #5f6f7e;
  --portal-line: #d8e0e7;
  --portal-line-strong: #c6d1da;
  --portal-bg: #edf1f4;
  --portal-card: #ffffff;
  --portal-success: #15704e;
  --portal-warning: #9a5b0b;
  --portal-danger: #a43a3a;
  --portal-shadow: 0 10px 28px rgba(13, 42, 64, 0.08);
}

/* Permit ownership and sharing ------------------------------------------ */
.permit-admin-view-note {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #9fd5bd;
  border-left: 4px solid #16865d;
  border-radius: 7px;
  padding: 10px 14px;
  background: #eaf7f1;
  color: #0d6948;
  font-size: 0.8rem;
}

.permit-admin-view-note strong {
  white-space: nowrap;
}

.permit-add-options {
  grid-template-columns: minmax(170px, 1fr) minmax(170px, 0.8fr) minmax(165px, 0.7fr) minmax(235px, 1fr) auto;
}

.permit-scope-field {
  min-width: 180px;
}

.permit-watch-table {
  min-width: 1320px;
}

.permit-watch-table th:nth-child(1) { width: 44px; }
.permit-watch-table th:nth-child(2) { width: 245px; }
.permit-watch-table th:nth-child(3) { width: 110px; }
.permit-watch-table th:nth-child(4) { width: 145px; }
.permit-watch-table th:nth-child(5) { width: 175px; }
.permit-watch-table th:nth-child(6) { width: 205px; }
.permit-watch-table th:nth-child(7) { width: 240px; }
.permit-watch-table th:nth-child(8) { width: 156px; }

.permit-owner-cell > span {
  display: block;
  overflow: hidden;
  font-size: 0.7rem;
  font-weight: 740;
  text-overflow: ellipsis;
  user-select: text;
  white-space: nowrap;
}

.permit-visibility-chip {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  max-width: 100%;
  margin-top: 4px;
  border: 1px solid #d6dde2;
  border-radius: 999px;
  padding: 2px 7px;
  background: #f3f5f7;
  color: #596b78;
  font-size: 0.58rem;
  font-weight: 820;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.permit-visibility-chip.is-selected-users {
  border-color: #bdd8e7;
  background: #edf7fb;
  color: #17658e;
}

.permit-visibility-chip.is-all-portal {
  border-color: #b8dfce;
  background: #eaf7f1;
  color: #0d6948;
}

.permit-row-actions .permit-access-button {
  width: auto;
  min-width: 54px;
  padding: 0 7px;
  font-size: 0.61rem;
}

.permit-access-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  border-left: 3px solid #1e84bd;
  padding: 7px 10px;
  background: #edf7fb;
  color: #17658e;
  font-size: 0.69rem;
}

.permit-access-note.is-admin {
  border-left-color: #16865d;
  background: #eaf7f1;
  color: #0d6948;
}

.permit-access-dialog {
  width: min(94vw, 720px);
  max-height: min(88vh, 820px);
  overflow: auto;
}

.permit-access-dialog > .portal-form {
  display: grid;
  gap: 16px;
  padding: 23px;
}

.permit-access-visibility-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
  padding: 0 !important;
}

.permit-access-visibility-form fieldset {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

.permit-access-visibility-form legend {
  margin-bottom: 8px;
  color: var(--portal-navy-deep);
  font-size: 0.79rem;
  font-weight: 830;
}

.permit-access-visibility-form label {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  border: 1px solid var(--portal-line);
  border-radius: 7px;
  padding: 9px 10px;
  background: #f8fafb;
  cursor: pointer;
}

.permit-access-visibility-form input {
  width: 17px;
  min-height: 17px;
  margin: 2px 0 0;
  padding: 0;
  accent-color: var(--portal-blue);
}

.permit-access-visibility-form label span {
  display: grid;
  gap: 2px;
}

.permit-access-visibility-form label small {
  color: var(--portal-muted);
  font-size: 0.72rem;
  font-weight: 560;
}

.permit-selected-users {
  display: grid;
  gap: 11px;
  border-top: 1px solid var(--portal-line);
  padding-top: 14px;
}

.permit-selected-heading,
.permit-selected-heading > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.permit-selected-heading small,
.permit-selected-heading > span {
  color: var(--portal-muted);
  font-size: 0.7rem;
}

.permit-share-form {
  display: grid !important;
  gap: 6px !important;
  padding: 0 !important;
}

.permit-share-form > label {
  color: var(--portal-muted);
  font-size: 0.72rem;
  font-weight: 780;
}

.permit-share-form > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.permit-share-list {
  display: grid;
  gap: 7px;
  max-height: 245px;
  overflow-y: auto;
}

.permit-share-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--portal-line);
  border-radius: 7px;
  padding: 8px;
  background: #f8fafb;
}

.permit-share-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--portal-navy);
  color: #fff;
  font-weight: 850;
}

.permit-share-row > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.permit-share-row strong,
.permit-share-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.permit-share-row strong {
  font-size: 0.78rem;
  user-select: text;
}

.permit-share-row small,
.permit-share-empty span {
  color: var(--portal-muted);
  font-size: 0.68rem;
}

.permit-share-empty {
  display: grid;
  gap: 3px;
  border: 1px dashed var(--portal-line-strong);
  border-radius: 7px;
  padding: 15px;
  text-align: center;
}

@media (max-width: 1180px) {
  .permit-add-options {
    grid-template-columns: repeat(2, minmax(190px, 1fr));
  }
}

@media (max-width: 700px) {
  .permit-admin-view-note,
  .permit-access-note {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .permit-access-visibility-form,
  .permit-share-form > div {
    grid-template-columns: 1fr;
  }

  .permit-access-visibility-form .portal-button,
  .permit-share-form .portal-button {
    width: 100%;
    justify-content: center;
  }
}

@media print {
  .permit-admin-view-note {
    display: none !important;
  }
}

* {
  box-sizing: border-box;
}

.portal-body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--portal-ink);
  background: var(--portal-bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.portal-body a {
  color: inherit;
  text-decoration: none;
}

.portal-body button,
.portal-body input,
.portal-body select {
  font: inherit;
}

.portal-app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.portal-masthead {
  color: #fff;
  background:
    linear-gradient(100deg, rgba(121, 198, 228, 0.08), transparent 45%),
    var(--portal-navy-deep);
  border-bottom: 3px solid var(--portal-cyan);
}

.masthead-inner {
  width: min(100% - 40px, 1440px);
  min-height: 84px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.portal-brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
  color: #fff;
}

.portal-brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.portal-brand-copy {
  display: grid;
  gap: 2px;
  line-height: 1.1;
}

.portal-brand-copy strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.52rem;
  letter-spacing: 0.01em;
}

.portal-brand-copy small {
  color: #c9dce9;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.masthead-account {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}

.account-copy {
  display: grid;
  justify-items: end;
  gap: 2px;
  max-width: 360px;
  font-size: 0.86rem;
}

.account-copy small {
  color: #aac4d7;
}

.account-copy strong {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-badge {
  color: #cde9f5;
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.masthead-link,
.masthead-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 3px;
  color: #fff;
  background: transparent;
  font-size: 0.82rem;
  font-weight: 750;
  cursor: pointer;
}

.masthead-link:hover,
.masthead-button:hover {
  border-color: rgba(255, 255, 255, 0.65);
  background: rgba(255, 255, 255, 0.08);
}

.calculator-nav {
  min-height: 50px;
  border-bottom: 1px solid var(--portal-line-strong);
  background: #fff;
  box-shadow: 0 3px 10px rgba(18, 46, 67, 0.05);
}

.calculator-nav-inner {
  width: min(100%, 1440px);
  min-height: 49px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: stretch;
  overflow-x: auto;
  scrollbar-width: none;
}

.calculator-nav-inner::-webkit-scrollbar {
  display: none;
}

.calculator-nav-link,
.calculator-nav-disabled {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 49px;
  padding: 0 17px;
  flex: 0 0 auto;
  border: 0;
  border-right: 1px solid #e6ebef;
  color: #334b5d;
  background: #fff;
  font-size: 0.79rem;
  font-weight: 750;
  white-space: nowrap;
}

.calculator-nav-link:first-child {
  border-left: 1px solid #e6ebef;
}

.calculator-nav-link:hover {
  color: var(--portal-blue);
  background: #f4f8fa;
}

.calculator-nav-link.is-active,
.calculator-nav-link[aria-current="page"] {
  color: var(--portal-navy);
  background: #f1f7fa;
}

.calculator-nav-link.is-active::after,
.calculator-nav-link[aria-current="page"]::after {
  position: absolute;
  right: 12px;
  bottom: 0;
  left: 12px;
  height: 3px;
  background: var(--portal-blue-bright);
  content: "";
}

.calculator-nav-disabled {
  gap: 7px;
  color: #8996a0;
  cursor: not-allowed;
}

.calculator-nav-disabled::after {
  padding: 2px 5px;
  border: 1px solid #d2dae0;
  border-radius: 999px;
  content: "Pending";
  color: #7c8993;
  font-size: 0.57rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.login-nav .calculator-nav-inner {
  justify-content: space-between;
  align-items: center;
  color: #536777;
}

.nav-context {
  color: var(--portal-navy);
  font-size: 0.77rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.nav-note {
  font-size: 0.78rem;
}

.portal-workspace {
  width: min(100% - 40px, 1360px);
  margin: 0 auto;
  padding: 30px 0 52px;
  flex: 1;
}

.portal-banner {
  position: relative;
  min-height: 168px;
  margin-bottom: 24px;
  padding: 30px 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  overflow: hidden;
  border: 1px solid #244d6b;
  border-left: 5px solid var(--portal-cyan);
  color: #fff;
  background:
    linear-gradient(90deg, rgba(11, 47, 79, 0.98), rgba(18, 81, 118, 0.92)),
    var(--portal-navy);
  box-shadow: var(--portal-shadow);
}

.portal-banner::after {
  position: absolute;
  top: -80px;
  right: -65px;
  width: 280px;
  height: 280px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  box-shadow: 0 0 0 38px rgba(255, 255, 255, 0.025), 0 0 0 76px rgba(255, 255, 255, 0.018);
  content: "";
}

.portal-banner > * {
  position: relative;
  z-index: 1;
}

.portal-eyebrow {
  margin: 0 0 8px;
  color: var(--portal-blue);
  font-size: 0.71rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.portal-banner .portal-eyebrow {
  color: #9dd8ed;
}

.portal-banner h1 {
  max-width: 820px;
  margin: 0 0 10px;
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.85rem, 3.2vw, 2.8rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.015em;
}

.portal-banner p:not(.portal-eyebrow) {
  max-width: 760px;
  margin: 0;
  color: #d7e5ee;
  line-height: 1.55;
}

.banner-meta {
  display: grid;
  gap: 8px;
  min-width: 205px;
}

.banner-meta span {
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.07);
  color: #e8f2f7;
  font-size: 0.75rem;
  font-weight: 700;
}

.portal-card,
.portal-panel {
  border: 1px solid var(--portal-line);
  border-radius: 4px;
  background: var(--portal-card);
  box-shadow: var(--portal-shadow);
}

.portal-panel {
  padding: 24px;
}

.panel-heading {
  margin-bottom: 20px;
  padding-bottom: 15px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--portal-line);
}

.panel-heading h2,
.portal-panel > h2,
.portal-card h2 {
  margin: 0;
  color: var(--portal-navy);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.55rem;
  font-weight: 600;
  line-height: 1.18;
}

.panel-status {
  padding: 5px 8px;
  border: 1px solid #d3e3ec;
  color: #557083;
  background: #f3f8fa;
  font-size: 0.68rem;
  font-weight: 750;
  white-space: nowrap;
}

.workspace-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 20px;
  align-items: start;
}

.workspace-sidebar {
  display: grid;
  gap: 20px;
}

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

.permission-card {
  position: relative;
  min-height: 184px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--portal-line);
  border-top: 3px solid var(--portal-blue);
  background: #fff;
}

.permission-card.is-locked {
  border-top-color: #aeb8bf;
  background: #f8fafb;
}

.permission-card.is-pending {
  border-top-color: #be8a38;
  background: #fffbf4;
}

.permission-card-number {
  margin-bottom: 12px;
  color: #8a9aa6;
  font-size: 0.67rem;
  font-weight: 850;
  letter-spacing: 0.12em;
}

.permission-card strong {
  display: block;
  margin-bottom: 7px;
  color: var(--portal-navy);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.08rem;
}

.permission-card .portal-muted {
  margin-bottom: 18px;
  flex: 1;
}

.card-action,
.card-status {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--portal-blue);
  border-radius: 3px;
  color: #fff;
  background: var(--portal-blue);
  font-size: 0.74rem;
  font-weight: 800;
}

.card-action:hover {
  border-color: var(--portal-navy);
  background: var(--portal-navy);
}

.card-status {
  border-color: #d3dbe1;
  color: #72808a;
  background: #f1f4f6;
}

.support-panel h2,
.account-panel h2 {
  margin-bottom: 12px;
}

.compact-steps {
  margin: 16px 0;
  padding-left: 22px;
  color: #415463;
}

.compact-steps li {
  margin-bottom: 10px;
  padding-left: 3px;
  line-height: 1.45;
}

.fine-print,
.login-support {
  color: #6a7985;
  font-size: 0.76rem;
  line-height: 1.55;
}

.portal-muted {
  margin: 0 0 18px;
  color: var(--portal-muted);
  font-size: 0.87rem;
  line-height: 1.55;
}

.portal-form {
  display: grid;
  gap: 15px;
}

.portal-form label {
  display: grid;
  gap: 7px;
  color: #314453;
  font-size: 0.79rem;
  font-weight: 780;
}

.portal-form input,
.portal-form select {
  width: 100%;
  min-height: 44px;
  padding: 0 11px;
  border: 1px solid #bdc9d2;
  border-radius: 3px;
  color: #1d2b36;
  background: #fff;
  outline: none;
}

.portal-form input::placeholder {
  color: #929da5;
}

.portal-form input[readonly] {
  color: #506371;
  background: #f1f4f6;
  cursor: not-allowed;
}

.portal-form input:focus,
.portal-form select:focus {
  border-color: var(--portal-blue-bright);
  box-shadow: 0 0 0 3px rgba(30, 132, 189, 0.13);
}

.password-input-wrap {
  position: relative;
  display: block;
  width: 100%;
}

.portal-form .password-input-wrap > input {
  padding-right: 48px;
}

.password-visibility-toggle {
  position: absolute;
  top: 50%;
  right: 5px;
  width: 36px;
  height: 34px;
  padding: 0;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  border: 0;
  border-radius: 4px;
  color: #526979;
  background: transparent;
  cursor: pointer;
}

.password-visibility-toggle:hover,
.password-visibility-toggle.is-visible {
  color: var(--portal-blue);
  background: #eaf3f8;
}

.password-visibility-toggle:focus-visible {
  outline: 3px solid rgba(30, 132, 189, 0.28);
  outline-offset: 1px;
}

.password-eye-icon {
  position: relative;
  display: block;
  width: 20px;
  height: 16px;
}

.password-eye-icon::before {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 8px;
  transform: rotate(45deg);
  border: 2px solid currentColor;
  border-radius: 75% 16%;
  content: "";
}

.password-eye-icon::after {
  position: absolute;
  top: 6px;
  left: 8px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.portal-button,
.danger-button,
.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid #b7c4cd;
  border-radius: 3px;
  color: #2f4656;
  background: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.portal-button:hover {
  border-color: #8597a4;
  background: #f5f8fa;
}

.portal-button.primary {
  border-color: var(--portal-blue);
  color: #fff;
  background: var(--portal-blue);
}

.portal-button.primary:hover {
  border-color: var(--portal-navy);
  background: var(--portal-navy);
}

.danger-button {
  border-color: #ddbbbb;
  color: var(--portal-danger);
  background: #fffafa;
}

.danger-button:hover {
  border-color: var(--portal-danger);
  background: #fff4f4;
}

.text-button {
  min-height: 32px;
  padding: 0 8px;
  border: 0;
  color: var(--portal-blue);
  background: transparent;
}

.full-width {
  width: 100%;
}

.portal-alert {
  display: none;
  margin-bottom: 14px;
  padding: 11px 13px;
  border: 1px solid #e2bcbc;
  border-left: 4px solid var(--portal-danger);
  border-radius: 2px;
  color: #7e2828;
  background: #fff5f5;
  font-size: 0.82rem;
  line-height: 1.45;
}

.portal-alert.is-visible {
  display: block;
}

.portal-alert.portal-success {
  border-color: #b8dccd;
  border-left-color: var(--portal-success);
  color: #175d43;
  background: #f0faf6;
}

.page-alert {
  margin-bottom: 20px;
}

.portal-notice {
  margin-bottom: 20px;
  padding: 14px 17px;
  display: flex;
  align-items: center;
  gap: 13px;
  border: 1px solid #e6cfaa;
  border-left: 4px solid #c58021;
  background: #fffaf0;
  color: #674510;
}

.portal-notice h2,
.portal-notice p {
  margin: 0;
}

.portal-notice h2 {
  font-size: 0.92rem;
}

.portal-notice p {
  margin-top: 3px;
  font-size: 0.8rem;
}

.portal-notice a {
  margin-left: auto;
  color: #7f500e;
  font-size: 0.76rem;
  font-weight: 800;
  text-decoration: underline;
}

.notice-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border: 1px solid #d9ae68;
  border-radius: 50%;
  font-weight: 900;
}

.mfa-status-card.is-mfa-active {
  border-color: #b5ddca;
  border-left-color: var(--portal-success);
  color: #155b40;
  background: #effaf5;
}

.mfa-status-card.is-mfa-active .notice-icon {
  border-color: #8bc8ad;
  color: #116344;
  background: #dff3e9;
}

.mfa-status-card.is-mfa-active a {
  color: #0d6243;
}

.mfa-status-card.is-mfa-inactive {
  border-color: #e3bcbc;
  border-left-color: var(--portal-danger);
  color: #7c2c2c;
  background: #fff3f3;
}

.mfa-status-card.is-mfa-inactive .notice-icon {
  border-color: #d8a1a1;
  color: #8d3030;
  background: #fbe1e1;
}

.mfa-status-card.is-mfa-inactive a {
  color: #8a3030;
}

.mfa-status-card .mfa-remaining {
  font-weight: 750;
}

.login-workspace {
  width: min(100% - 40px, 1120px);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) 430px;
  gap: 24px;
  align-items: stretch;
}

.login-banner {
  min-height: 470px;
  margin: 0;
  align-items: flex-start;
  padding-top: 78px;
}

.login-banner h1 {
  max-width: 600px;
  font-size: clamp(2.15rem, 4.2vw, 3.6rem);
}

.banner-seal {
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  flex: 0 0 112px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.banner-seal span {
  align-self: end;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.75rem;
}

.banner-seal small {
  align-self: start;
  color: #b9dce9;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-card {
  margin: 0;
  padding: 34px;
  align-self: center;
}

.card-heading {
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--portal-line);
}

.card-heading .portal-muted {
  margin: 9px 0 0;
}

.login-support {
  margin: 19px 0 0;
  padding-top: 17px;
  border-top: 1px solid var(--portal-line);
}

.admin-form-grid {
  display: grid;
  gap: 20px;
}

.edit-panel {
  border-top: 4px solid var(--portal-blue);
}

.admin-form {
  gap: 18px;
}

.form-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.portal-form fieldset {
  margin: 0;
  padding: 16px;
  border: 1px solid var(--portal-line);
  border-radius: 3px;
}

.portal-form legend {
  padding: 0 6px;
  color: var(--portal-navy);
  font-size: 0.8rem;
  font-weight: 850;
}

.fieldset-note {
  margin: 0 0 13px;
  color: var(--portal-muted);
  font-size: 0.76rem;
}

.portal-checkboxes {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.portal-checkboxes label,
.check-row {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #344957;
  font-size: 0.76rem;
  font-weight: 700;
}

.portal-checkboxes label {
  padding: 8px 10px;
  border: 1px solid #dce3e8;
  background: #f9fbfc;
}

.portal-checkboxes label.is-unavailable {
  color: #8a959d;
  background: #f3f5f6;
}

.portal-checkboxes input,
.check-row input {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  accent-color: var(--portal-blue);
}

.form-options {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
}

.users-panel {
  margin-top: 20px;
}

.user-table-wrap {
  overflow-x: auto;
}

.user-table {
  width: 100%;
  min-width: 960px;
  border-collapse: collapse;
}

.user-table th,
.user-table td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--portal-line);
  color: #354957;
  text-align: left;
  vertical-align: top;
}

.user-table th {
  color: #647786;
  background: #f5f7f9;
  font-size: 0.68rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.user-table td {
  font-size: 0.8rem;
}

.user-table tbody tr:hover {
  background: #f8fbfc;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 5px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 0 7px;
  border: 1px solid #cbdde7;
  border-radius: 999px;
  color: #3d667e;
  background: #f1f8fb;
  font-size: 0.65rem;
  line-height: 1.2;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.portal-footer {
  width: min(100% - 40px, 1360px);
  min-height: 64px;
  margin: auto auto 0;
  padding: 18px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid #d3dce2;
  color: #687986;
  font-size: 0.73rem;
}

.portal-footer a {
  color: var(--portal-blue);
  font-weight: 750;
}

.compact-banner {
  min-height: 148px;
}

.project-launcher {
  margin-bottom: 20px;
  padding: 24px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  border-left: 5px solid var(--portal-blue-bright);
  background: linear-gradient(110deg, #fff, #f5fafc);
}

.project-launcher-copy {
  min-width: 0;
  flex: 1;
}

.project-launcher-heading,
.inline-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 11px;
}

.project-launcher h2,
.active-project-strip h2 {
  margin: 0;
  color: var(--portal-navy);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.55rem;
  font-weight: 600;
}

.project-launcher .portal-muted {
  margin: 8px 0 0;
}

.project-launcher-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 3px 8px;
  border: 1px solid #d3dce3;
  border-radius: 999px;
  color: #647582;
  background: #f4f6f8;
  font-size: 0.66rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-transform: uppercase;
}

.status-chip.is-active {
  border-color: #a9d5c3;
  color: #146247;
  background: #edf9f4;
}

.status-chip.is-warning {
  border-color: #e2c28c;
  color: #85520d;
  background: #fff8eb;
}

.status-chip.is-neutral {
  border-color: #d2dce3;
  color: #61717d;
  background: #f5f7f8;
}

.project-summary-list {
  margin: 16px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
}

.project-summary-list div {
  min-width: 120px;
}

.project-summary-list dt,
.saved-project-meta dt {
  margin-bottom: 3px;
  color: #7c8b96;
  font-size: 0.63rem;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.project-summary-list dd,
.saved-project-meta dd {
  margin: 0;
  color: #314654;
  font-size: 0.78rem;
  font-weight: 700;
}

.active-project-strip {
  margin-bottom: 20px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border: 1px solid #cfdce4;
  border-left: 5px solid var(--portal-blue);
  background: #fff;
  box-shadow: var(--portal-shadow);
}

.active-project-strip .portal-eyebrow {
  margin-bottom: 5px;
}

.active-project-strip p:last-child {
  margin: 6px 0 0;
  color: var(--portal-muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.active-project-strip p a {
  color: var(--portal-blue);
  font-weight: 800;
  text-decoration: underline;
}

.project-workspace-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr);
  gap: 20px;
  align-items: start;
}

.project-editor {
  border-top: 4px solid var(--portal-blue);
}

.saved-projects-panel {
  position: sticky;
  top: 18px;
}

.project-form fieldset {
  padding: 18px;
}

.project-form-grid {
  display: grid;
  gap: 14px;
}

.project-form-grid.two-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.project-form-grid .span-two {
  grid-column: 1 / -1;
}

.required-mark {
  color: var(--portal-danger);
}

.field-label {
  display: block;
  margin-bottom: 7px;
  color: #314453;
  font-size: 0.79rem;
  font-weight: 780;
}

.field-note {
  color: #72818c;
  font-size: 0.68rem;
  font-weight: 600;
}

.portal-form textarea,
.library-filter-grid input,
.library-filter-grid select {
  width: 100%;
  padding: 10px 11px;
  border: 1px solid #bdc9d2;
  border-radius: 3px;
  color: #1d2b36;
  background: #fff;
  font: inherit;
  outline: none;
}

.portal-form textarea {
  min-height: 105px;
  resize: vertical;
}

.portal-form textarea:focus,
.library-filter-grid input:focus,
.library-filter-grid select:focus {
  border-color: var(--portal-blue-bright);
  box-shadow: 0 0 0 3px rgba(30, 132, 189, 0.13);
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  padding: 4px;
  border: 1px solid #c7d3db;
  border-radius: 4px;
  background: #f3f6f8;
}

.segmented-control label {
  display: block;
}

.segmented-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.segmented-control span {
  min-height: 38px;
  padding: 8px 10px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 3px;
  color: #526573;
  background: transparent;
  font-size: 0.75rem;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
}

.segmented-control input:checked + span {
  border-color: #a9c7d8;
  color: var(--portal-navy);
  background: #fff;
  box-shadow: 0 2px 6px rgba(13, 42, 64, 0.08);
}

.segmented-control input:focus-visible + span {
  outline: 3px solid rgba(30, 132, 189, 0.35);
  outline-offset: 1px;
}

.field-help-card {
  min-height: 44px;
  padding: 10px 12px;
  border-left: 3px solid #8fc5dc;
  color: #526777;
  background: #f2f8fa;
  font-size: 0.75rem;
  line-height: 1.45;
}

.is-secondary-field {
  opacity: 0.76;
}

.resolve-location-row {
  margin-top: 15px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.inline-status {
  color: #697986;
  font-size: 0.74rem;
  line-height: 1.4;
}

.inline-status.is-working {
  color: var(--portal-blue);
  font-weight: 750;
}

.inline-status.is-success {
  color: var(--portal-success);
  font-weight: 750;
}

.inline-status.is-warning {
  color: var(--portal-warning);
  font-weight: 750;
}

.location-disclosure {
  margin: 10px 0 0;
  color: #677986;
  font-size: 0.7rem;
  line-height: 1.5;
}

.geocode-candidates {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #d7c18e;
  background: #fffbf1;
}

.geocode-candidates > strong {
  display: block;
  margin-bottom: 9px;
  color: #6f4b12;
  font-size: 0.8rem;
}

.candidate-list {
  display: grid;
  gap: 7px;
}

.candidate-button {
  width: 100%;
  padding: 10px 12px;
  display: grid;
  gap: 3px;
  border: 1px solid #d7c9a8;
  color: #304553;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.candidate-button:hover {
  border-color: var(--portal-blue);
  background: #f7fbfd;
}

.candidate-button span {
  font-size: 0.78rem;
  font-weight: 800;
}

.candidate-button small {
  color: #71808b;
}

.project-activate-option {
  padding: 10px 12px;
  border: 1px solid #dbe4e9;
  background: #f8fafb;
}

.form-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}

.saved-project-list {
  display: grid;
  gap: 12px;
}

.saved-project-card {
  padding: 17px;
  border: 1px solid var(--portal-line);
  border-left: 4px solid #a7b4bd;
  background: #fff;
}

.saved-project-card.is-active {
  border-left-color: var(--portal-success);
  background: #fbfefc;
}

.saved-project-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.saved-project-card h3 {
  margin: 8px 0 0;
  color: var(--portal-navy);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.08rem;
  line-height: 1.25;
}

.project-card-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.access-chip {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 9px;
  border: 1px solid #d4dee4;
  border-radius: 999px;
  color: #526875;
  background: #f4f7f8;
  font-size: 0.62rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.access-chip.is-owner {
  border-color: #b7d8c7;
  color: #1f6847;
  background: #edf8f2;
}

.access-chip.is-shared {
  border-color: #bdd7e6;
  color: #175f86;
  background: #eef7fc;
}

.project-access-line {
  margin: 8px 0 0;
  color: #3f6174;
  font-size: 0.72rem;
  font-weight: 760;
}

.project-reference,
.saved-project-location {
  margin: 8px 0 0;
  color: #536674;
  font-size: 0.78rem;
  line-height: 1.45;
}

.project-reference {
  color: var(--portal-blue);
  font-weight: 750;
}

.saved-project-meta {
  margin: 14px 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.saved-project-actions .portal-button,
.saved-project-actions .danger-button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.7rem;
}

.share-project-dialog {
  width: min(680px, calc(100vw - 30px));
  max-height: min(760px, calc(100vh - 36px));
  padding: 0;
  border: 1px solid #cdd8df;
  border-radius: 14px;
  color: var(--portal-ink);
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 36, 50, 0.3);
  overflow: auto;
}

.share-project-dialog::backdrop {
  background: rgba(9, 27, 38, 0.64);
  backdrop-filter: blur(3px);
}

.share-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 25px 20px;
  border-bottom: 1px solid #dfe6ea;
  background: linear-gradient(135deg, #f8fbfc, #eef5f8);
}

.share-dialog-head h2 {
  margin: 4px 0 5px;
  color: var(--portal-navy);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
}

.share-dialog-head p:last-child {
  margin: 0;
  color: #5b6f7c;
  font-size: 0.78rem;
  line-height: 1.45;
}

.dialog-close {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border: 1px solid #cfd9df;
  border-radius: 9px;
  color: #314b5b;
  background: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.dialog-close:hover {
  border-color: #96aebc;
  background: #f4f8fa;
}

.share-project-form {
  padding: 22px 25px 18px;
  border-bottom: 1px solid #e2e8ec;
}

.share-email-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
  margin-top: 7px;
}

.share-email-row .portal-button {
  min-width: 138px;
}

.member-list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 25px 10px;
  color: var(--portal-navy);
  font-size: 0.78rem;
}

.member-list-heading span {
  color: #6b7d88;
  font-size: 0.68rem;
  font-weight: 750;
}

.project-member-list {
  display: grid;
  gap: 8px;
  padding: 0 25px 20px;
}

.project-member-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 12px;
  border: 1px solid #dae3e8;
  border-radius: 9px;
  background: #fbfcfd;
}

.member-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--portal-blue);
  font-size: 0.78rem;
  font-weight: 850;
}

.project-member-row strong,
.project-member-row small {
  display: block;
  overflow-wrap: anywhere;
}

.project-member-row strong {
  color: #263f4e;
  font-size: 0.78rem;
}

.project-member-row small {
  margin-top: 3px;
  color: #6c7d87;
  font-size: 0.66rem;
}

.project-member-row .danger-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 0.68rem;
}

.share-dialog-actions {
  display: flex;
  justify-content: flex-end;
  padding: 16px 25px 22px;
}

.loading-state,
.empty-state {
  padding: 28px 20px;
  border: 1px dashed #cbd6dd;
  color: #647682;
  background: #f8fafb;
  text-align: center;
  font-size: 0.82rem;
  line-height: 1.5;
}

.loading-state {
  color: var(--portal-blue);
  font-weight: 750;
}

.large-loading {
  min-height: 150px;
  display: grid;
  place-items: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 5px;
  color: #344a59;
}

.empty-state p {
  margin: 0;
}

.compact-empty {
  padding: 18px 14px;
}

.filter-panel {
  margin-bottom: 20px;
  padding-bottom: 18px;
}

.filter-heading {
  margin-bottom: 15px;
}

.library-filter-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(5, minmax(135px, 1fr));
  gap: 10px;
}

.library-filter-grid label {
  display: grid;
  gap: 6px;
  color: #435765;
  font-size: 0.69rem;
  font-weight: 800;
}

.library-filter-grid input,
.library-filter-grid select {
  min-height: 42px;
  padding-top: 0;
  padding-bottom: 0;
  font-size: 0.78rem;
}

.filter-summary {
  margin-top: 12px;
  padding-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  border-top: 1px solid #e4e9ed;
  color: #697986;
  font-size: 0.72rem;
}

#source-count {
  color: var(--portal-navy);
  font-weight: 850;
}

.data-library-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 370px;
  gap: 20px;
  align-items: start;
}

.source-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.source-card {
  min-height: 280px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--portal-line);
  border-top: 3px solid var(--portal-blue);
  background: #fff;
}

.source-card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.scope-badge,
.access-badge {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 3px 7px;
  border: 1px solid #cbdce6;
  color: #3d667d;
  background: #f2f8fb;
  font-size: 0.61rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  line-height: 1.15;
  text-transform: uppercase;
}

.access-badge {
  border-color: #d7dde1;
  color: #687781;
  background: #f6f7f8;
}

.access-badge.is-queryable {
  border-color: #add6c5;
  color: #176349;
  background: #eff9f5;
}

.access-badge.is-download {
  border-color: #c6c4e4;
  color: #524c8a;
  background: #f5f4fb;
}

.source-card h3 {
  margin: 15px 0 4px;
  color: var(--portal-navy);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.08rem;
  line-height: 1.27;
}

.source-agency,
.source-description,
.source-coverage {
  margin: 0;
  color: #60717e;
  font-size: 0.76rem;
  line-height: 1.48;
}

.source-agency {
  color: var(--portal-blue);
  font-weight: 750;
}

.source-description {
  margin-top: 9px;
}

.source-coverage {
  margin-top: 10px;
}

.tag-list {
  margin-top: 11px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tag-list span {
  padding: 3px 6px;
  border: 1px solid #dae2e7;
  color: #596c79;
  background: #f7f9fa;
  font-size: 0.61rem;
  font-weight: 700;
}

.source-card-actions {
  margin-top: auto;
  padding-top: 16px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.source-card-actions .portal-button,
.source-card-actions .card-action,
.source-card-actions .card-status {
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.69rem;
}

.lidar-panel {
  position: sticky;
  top: 18px;
}

.lidar-panel .panel-heading {
  display: block;
}

.lidar-panel .panel-status {
  display: inline-flex;
  margin-top: 9px;
}

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

.lidar-output {
  margin-top: 18px;
  padding-top: 17px;
  border-top: 1px solid var(--portal-line);
}

.lidar-result-heading {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #405562;
  font-size: 0.76rem;
}

.lidar-result-heading a {
  color: var(--portal-blue);
  font-weight: 800;
  text-decoration: underline;
}

.lidar-product-list {
  display: grid;
  gap: 9px;
}

.lidar-product-card {
  padding: 13px;
  border: 1px solid #d9e1e6;
  background: #fafcfd;
}

.lidar-product-card h3 {
  margin: 0 0 7px;
  color: var(--portal-navy);
  font-size: 0.84rem;
  line-height: 1.35;
}

.lidar-product-card p {
  margin: 4px 0;
  color: #5f717e;
  font-size: 0.68rem;
  line-height: 1.4;
}

.lidar-product-card .action-row {
  margin-top: 10px;
}

.lidar-product-card .portal-button,
.lidar-product-card .card-status {
  min-height: 32px;
  padding: 0 9px;
  font-size: 0.65rem;
}

.data-output-panel {
  margin-bottom: 20px;
  border-top: 4px solid var(--portal-blue);
}

.report-output {
  color: #2d414f;
}

.print-report-header {
  margin-bottom: 20px;
  padding-bottom: 17px;
  border-bottom: 2px solid var(--portal-navy);
}

.print-report-header h2 {
  margin: 0 0 8px;
  color: var(--portal-navy);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.7rem;
}

.print-report-header > p:last-child {
  margin: 8px 0 0;
  color: #72818c;
  font-size: 0.7rem;
}

.report-project-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 7px 14px;
  color: #4f6472;
  font-size: 0.82rem;
}

.report-project-line strong {
  color: #263d4c;
}

.report-project-identity {
  margin: 7px 0 0;
  color: #536875;
  font-size: 0.74rem;
  font-weight: 700;
}

.report-section-list {
  display: grid;
  gap: 14px;
}

.report-section {
  padding: 18px;
  border: 1px solid #d9e1e6;
  border-left: 4px solid var(--portal-blue);
  background: #fff;
  break-inside: avoid;
}

.report-section.status-empty {
  border-left-color: #a8b3bb;
}

.report-section.status-error {
  border-left-color: var(--portal-warning);
}

.report-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
}

.report-section-heading h3 {
  margin: 7px 0 0;
  color: var(--portal-navy);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.08rem;
}

.report-section-heading a {
  color: var(--portal-blue);
  font-size: 0.7rem;
  font-weight: 800;
  text-decoration: underline;
}

.retrieved-at {
  margin: 8px 0 13px;
  color: #788690;
  font-size: 0.65rem;
}

.result-warnings {
  margin: 12px 0;
  padding: 11px 13px;
  border: 1px solid #e4cda3;
  color: #6f4c17;
  background: #fffaf0;
  font-size: 0.72rem;
  line-height: 1.5;
}

.result-warnings p,
.result-warnings ul {
  margin: 5px 0 0;
}

.result-warnings ul {
  padding-left: 18px;
}

.section-data {
  margin-top: 13px;
}

.result-data-grid {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid #e0e6ea;
  background: #e0e6ea;
}

.result-data-grid > div {
  min-width: 0;
  padding: 10px 11px;
  background: #fff;
}

.result-data-grid dt {
  margin-bottom: 5px;
  color: #75848e;
  font-size: 0.62rem;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.result-data-grid dd {
  min-width: 0;
  margin: 0;
  color: #324855;
  font-size: 0.74rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.result-data-grid .result-data-grid {
  grid-template-columns: 1fr;
}

.result-list {
  margin: 0;
  padding-left: 19px;
}

.result-list li + li {
  margin-top: 6px;
}

.empty-value {
  color: #8a969e;
  font-style: italic;
}

.report-disclaimer {
  margin: 18px 0 0;
  padding-top: 12px;
  border-top: 1px solid #dce3e8;
  color: #6d7d88;
  font-size: 0.68rem;
  line-height: 1.55;
}

.hidden {
  display: none !important;
}

.portal-body :focus-visible {
  outline: 3px solid rgba(30, 132, 189, 0.35);
  outline-offset: 2px;
}

@media (max-width: 1100px) {
  .workspace-layout {
    grid-template-columns: 1fr;
  }

  .workspace-sidebar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .login-workspace {
    grid-template-columns: 1fr 390px;
  }

  .portal-checkboxes {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .project-workspace-layout {
    grid-template-columns: minmax(0, 1fr) 340px;
  }

  .library-filter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .filter-search {
    grid-column: span 2;
  }

  .data-library-layout {
    grid-template-columns: 1fr;
  }

  .lidar-panel {
    position: static;
  }
}

@media (max-width: 820px) {
  .masthead-inner {
    width: min(100% - 28px, 1440px);
    padding: 13px 0;
    align-items: flex-start;
  }

  .masthead-account {
    flex-wrap: wrap;
    gap: 8px;
  }

  .account-copy {
    width: 100%;
    justify-items: end;
  }

  .portal-workspace,
  .portal-footer {
    width: min(100% - 28px, 1360px);
  }

  .portal-banner {
    align-items: flex-start;
  }

  .banner-meta {
    display: none;
  }

  .login-workspace {
    grid-template-columns: 1fr;
  }

  .login-banner {
    min-height: 285px;
    padding-top: 44px;
  }

  .banner-seal {
    display: none;
  }

  .login-card {
    width: min(100%, 520px);
    justify-self: center;
  }

  .form-columns,
  .portal-checkboxes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-launcher,
  .active-project-strip {
    align-items: flex-start;
  }

  .project-launcher {
    display: grid;
  }

  .project-launcher-actions {
    justify-content: flex-start;
  }

  .project-workspace-layout {
    grid-template-columns: 1fr;
  }

  .saved-projects-panel {
    position: static;
  }

  .library-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .source-card-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .portal-brand-mark {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }

  .portal-brand-copy strong {
    font-size: 1.23rem;
  }

  .portal-brand-copy small {
    font-size: 0.62rem;
  }

  .masthead-link {
    display: none;
  }

  .account-copy {
    display: none;
  }

  .login-nav .calculator-nav-inner {
    justify-content: center;
  }

  .nav-note {
    display: none;
  }

  .portal-workspace {
    padding-top: 18px;
  }

  .portal-banner {
    min-height: auto;
    padding: 23px 21px;
  }

  .portal-banner h1 {
    font-size: 1.8rem;
  }

  .portal-panel,
  .login-card {
    padding: 20px;
  }

  .permission-grid,
  .workspace-sidebar,
  .form-columns,
  .portal-checkboxes {
    grid-template-columns: 1fr;
  }

  .permission-card {
    min-height: 160px;
  }

  .panel-heading {
    display: block;
  }

  .panel-status {
    display: inline-flex;
    margin-top: 10px;
  }

  .portal-notice {
    align-items: flex-start;
  }

  .portal-notice a {
    display: inline-flex;
    margin-top: 8px;
  }

  .portal-footer {
    display: grid;
    justify-content: start;
  }

  .active-project-strip {
    display: grid;
  }

  .project-launcher-actions .portal-button,
  .active-project-strip .portal-button {
    flex: 1 1 auto;
  }

  .project-form-grid.two-columns,
  .library-filter-grid,
  .result-data-grid {
    grid-template-columns: 1fr;
  }

  .filter-search {
    grid-column: auto;
  }

  .segmented-control {
    grid-template-columns: 1fr;
  }

  .filter-summary,
  .report-section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .saved-project-meta,
  .bbox-grid {
    grid-template-columns: 1fr;
  }

  .share-dialog-head,
  .share-project-form,
  .member-list-heading,
  .project-member-list,
  .share-dialog-actions {
    padding-left: 17px;
    padding-right: 17px;
  }

  .share-email-row {
    grid-template-columns: 1fr;
  }

  .share-email-row .portal-button {
    width: 100%;
  }

  .project-member-row {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .project-member-row .danger-button {
    grid-column: 2;
    justify-self: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

@media print {
  @page {
    size: auto;
    margin: 0.55in;
  }

  .printing-data {
    color: #111;
    background: #fff;
  }

  .printing-data .portal-masthead,
  .printing-data .calculator-nav,
  .printing-data .portal-banner,
  .printing-data .active-project-strip,
  .printing-data .filter-panel,
  .printing-data .data-library-layout,
  .printing-data .portal-footer,
  .printing-data .data-output-panel:not(.print-target),
  .printing-data .no-print {
    display: none !important;
  }

  .printing-data .portal-workspace {
    width: 100%;
    margin: 0;
    padding: 0;
  }

  .printing-data .print-target {
    display: block !important;
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  .printing-data .report-section {
    padding: 12px;
    border-color: #999;
    box-shadow: none;
  }

  .printing-data .result-data-grid {
    border-color: #aaa;
    background: #aaa;
  }

  .printing-data a {
    color: #111;
    text-decoration: none;
  }
}

/* Permit Tracker ledger --------------------------------------------------- */

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.permit-ledger-workspace {
  width: min(100% - 36px, 1540px);
  gap: 18px;
}

.permit-ledger-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 12px 2px 4px;
}

.permit-ledger-heading h1 {
  margin: 2px 0 6px;
  color: var(--portal-navy-deep);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3.35rem);
  line-height: 1;
}

.permit-ledger-heading > div > p:last-child {
  max-width: 800px;
  margin: 0;
  color: var(--portal-muted);
  font-size: 0.96rem;
}

.permit-heading-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.permit-add-panel {
  padding: 18px;
}

.permit-add-heading,
.permit-ledger-toolbar,
.permit-add-options {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
}

.permit-add-heading h2,
.permit-ledger-toolbar h2 {
  margin: 2px 0 0;
  color: var(--portal-navy-deep);
  font-size: 1.12rem;
}

.permit-inline-search {
  display: grid;
  grid-template-columns: minmax(190px, 0.7fr) minmax(320px, 2fr) auto;
  align-items: end;
  gap: 10px;
  margin-top: 14px;
}

.permit-inline-search label,
.permit-add-options label {
  display: grid;
  min-width: 0;
  gap: 5px;
  color: var(--portal-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.permit-inline-search input,
.permit-inline-search select,
.permit-add-options input,
.permit-add-options select,
.permit-ledger-filters input,
.permit-ledger-filters select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--portal-line-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--portal-ink);
  outline: none;
}

.permit-inline-search input,
.permit-add-options input,
.permit-ledger-filters input {
  padding: 0 12px;
}

.permit-inline-search select,
.permit-add-options select,
.permit-ledger-filters select {
  padding: 0 34px 0 10px;
}

.permit-inline-search input:focus,
.permit-inline-search select:focus,
.permit-add-options input:focus,
.permit-add-options select:focus,
.permit-ledger-filters input:focus,
.permit-ledger-filters select:focus {
  border-color: var(--portal-blue-bright);
  box-shadow: 0 0 0 3px rgba(30, 132, 189, 0.12);
}

.permit-add-options {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(180px, 0.85fr) minmax(180px, 0.75fr) auto;
  align-items: end;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--portal-line);
}

.permit-add-options label span small {
  color: #8996a1;
  font-weight: 600;
  text-transform: none;
}

.permit-found-panel {
  margin-top: 12px;
}

.permit-found-panel .permit-candidate-fieldset {
  margin: 0;
}

.permit-found-panel .permit-candidate-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 8px;
  max-height: 190px;
  overflow: auto;
}

.permit-found-panel .permit-candidate-card {
  min-height: 74px;
  padding: 10px;
}

.permit-ledger-card {
  overflow: visible;
  padding: 0;
}

.permit-ledger-toolbar {
  align-items: center;
  padding: 15px 16px 13px;
  border-bottom: 1px solid var(--portal-line);
}

.permit-connector-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  border: 1px solid #d6dde2;
  border-radius: 999px;
  padding: 3px 8px;
  background: #f3f5f7;
  color: #667682;
  font-size: 0.64rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.permit-connector-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.permit-connector-status.is-online {
  border-color: #b8dfce;
  background: #eaf7f1;
  color: #0d6948;
}

.permit-connector-status.is-offline {
  border-color: #e6c995;
  background: #fff8e8;
  color: #855b12;
}

.permit-connector-status.is-not-configured {
  border-color: #e4b0b0;
  background: #fff0f0;
  color: #9b3030;
}

.permit-ledger-filters {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.permit-filter-search {
  width: min(300px, 34vw);
}

.permit-ledger-filters select {
  min-width: 165px;
}

.permit-status-filter {
  position: relative;
  min-width: 205px;
  color: var(--portal-ink);
}

.permit-status-filter summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  border: 1px solid var(--portal-line-strong);
  border-radius: 7px;
  padding: 0 11px;
  background: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.permit-status-filter summary::-webkit-details-marker {
  display: none;
}

.permit-status-filter summary:focus-visible {
  border-color: var(--portal-blue-bright);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(30, 132, 189, 0.12);
}

.permit-filter-chevron {
  width: 8px;
  height: 8px;
  border-right: 2px solid #6a7b87;
  border-bottom: 2px solid #6a7b87;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 120ms ease;
}

.permit-status-filter[open] .permit-filter-chevron {
  transform: translateY(2px) rotate(225deg);
}

.permit-status-options {
  position: absolute;
  z-index: 12;
  top: calc(100% + 6px);
  right: 0;
  display: grid;
  width: max(100%, 235px);
  max-height: 290px;
  overflow-y: auto;
  border: 1px solid var(--portal-line-strong);
  border-radius: 8px;
  padding: 6px;
  background: #fff;
  box-shadow: 0 14px 32px rgba(15, 43, 61, 0.18);
}

.permit-status-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border-radius: 5px;
  padding: 6px 8px;
  color: var(--portal-ink);
  font-size: 0.75rem;
  font-weight: 680;
  cursor: pointer;
}

.permit-status-option:hover {
  background: #edf7fb;
}

.permit-status-option input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--portal-blue);
}

.permit-status-option.is-all {
  margin-bottom: 4px;
  border-bottom: 1px solid var(--portal-line);
  border-radius: 5px 5px 0 0;
  padding-bottom: 9px;
}

.permit-status-option.is-check-result {
  margin-top: 4px;
  border-top: 1px solid var(--portal-line);
  border-radius: 0 0 5px 5px;
  padding-top: 9px;
  color: #9a3434;
}

.permit-ledger-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(125px, 1fr)) minmax(190px, auto);
  align-items: center;
  min-height: 58px;
  border-bottom: 1px solid var(--portal-line);
  background: #f8fafb;
}

.permit-ledger-summary > div {
  display: grid;
  gap: 1px;
  min-height: 38px;
  padding: 5px 14px;
  border-right: 1px solid var(--portal-line);
}

.permit-ledger-summary span {
  color: var(--portal-muted);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.permit-ledger-summary strong {
  color: var(--portal-navy-deep);
  font-size: 1.08rem;
}

.permit-ledger-loaded {
  padding: 0 14px;
  text-align: right;
  text-transform: none !important;
}

.permit-table-scroll {
  height: clamp(390px, calc(100vh - 410px), 720px);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.permit-watch-table {
  width: 100%;
  min-width: 1120px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.permit-watch-table th:nth-child(1) { width: 44px; }
.permit-watch-table th:nth-child(2) { width: 270px; }
.permit-watch-table th:nth-child(3) { width: 118px; }
.permit-watch-table th:nth-child(4) { width: 155px; }
.permit-watch-table th:nth-child(5) { width: 190px; }
.permit-watch-table th:nth-child(6) { width: 225px; }
.permit-watch-table th:nth-child(7) { width: 88px; }

.permit-watch-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  height: 42px;
  padding: 0 10px;
  border-bottom: 1px solid var(--portal-line-strong);
  background: #f2f6f8;
  color: #60717e;
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.055em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.permit-watch-table thead th button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}

.permit-watch-table thead th button:hover,
.permit-watch-table thead th button:focus-visible {
  color: var(--portal-blue);
}

.sort-indicator {
  width: 10px;
  color: var(--portal-blue);
  font-size: 0.62rem;
}

.permit-ledger-row {
  height: 66px;
  background: #fff;
  transition: background 120ms ease, box-shadow 120ms ease;
}

.permit-ledger-row:hover,
.permit-ledger-row.is-expanded {
  background: #f5fafc;
}

.permit-ledger-row.is-expanded {
  box-shadow: inset 3px 0 var(--portal-blue-bright);
}

.permit-ledger-row > td {
  overflow: hidden;
  padding: 7px 10px;
  border-bottom: 1px solid var(--portal-line);
  color: var(--portal-ink);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.permit-ledger-row td > time {
  display: block;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
  font-weight: 730;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.permit-ledger-row td > small {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: var(--portal-muted);
  font-size: 0.66rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.permit-expand-cell {
  text-align: center;
}

.permit-expand-cell button,
.permit-row-actions button {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--portal-line);
  border-radius: 6px;
  background: #fff;
  color: var(--portal-navy);
  font-weight: 850;
  cursor: pointer;
}

.permit-expand-cell button:hover,
.permit-row-actions button:hover {
  border-color: var(--portal-blue-bright);
  background: #edf7fb;
}

.permit-number-line {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.permit-number-line strong {
  min-width: 0;
  overflow: hidden;
  color: var(--portal-navy-deep);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.79rem;
  text-overflow: ellipsis;
  user-select: text;
  white-space: nowrap;
}

.permit-number-description,
.permit-row-cdn {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: var(--portal-muted);
  font-size: 0.63rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.permit-row-cdn {
  color: #536b7b;
  font-variant-numeric: tabular-nums;
}

.permit-row-cdn b {
  color: var(--portal-blue);
  font-size: 0.58rem;
  letter-spacing: 0.06em;
}

.permit-copy-button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  border: 1px solid var(--portal-line);
  border-radius: 5px;
  padding: 0 6px;
  background: #fff;
  color: #607482;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}

.permit-copy-button:hover,
.permit-copy-button:focus-visible {
  border-color: var(--portal-blue-bright);
  background: #edf7fb;
  color: var(--portal-blue);
}

.permit-copy-button.is-copied {
  border-color: #9bd4bd;
  background: #eaf7f1;
  color: #0d6948;
}

.permit-copy-button.is-copy-error {
  border-color: #e4b0b0;
  background: #fff0f0;
  color: #9b3030;
}

.permit-copy-icon {
  position: relative;
  width: 13px;
  height: 13px;
}

.permit-copy-icon::before,
.permit-copy-icon::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 8px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
  background: inherit;
}

.permit-copy-icon::before {
  top: 1px;
  left: 1px;
}

.permit-copy-icon::after {
  right: 1px;
  bottom: 1px;
  background: #fff;
}

.permit-copy-button.is-copied .permit-copy-icon::after {
  background: #eaf7f1;
}

.permit-copy-feedback {
  max-width: 0;
  overflow: hidden;
  font-size: 0.61rem;
  font-weight: 850;
  opacity: 0;
  transition: max-width 120ms ease, margin-left 120ms ease, opacity 120ms ease;
  white-space: nowrap;
}

.permit-copy-button.is-copied .permit-copy-feedback,
.permit-copy-button.is-copy-error .permit-copy-feedback {
  max-width: 62px;
  margin-left: 5px;
  opacity: 1;
}

.permit-watch-table .permit-status-chip {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  padding: 5px 8px;
  font-size: 0.66rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.permit-check-result {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.68rem;
  font-weight: 850;
  white-space: nowrap;
}

.permit-check-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.permit-last-check-cell .permit-check-result {
  min-height: 20px;
  margin-top: 4px;
  padding: 2px 7px;
  font-size: 0.61rem;
}

.permit-check-result.is-successful {
  border-color: #b8dfce;
  background: #eaf7f1;
  color: #0d6948;
}

.permit-check-result.is-unsuccessful {
  border-color: #ebc0c0;
  background: #fff0f0;
  color: #a23131;
}

.permit-check-result.is-not-checked {
  border-color: #d6dde2;
  background: #f3f5f7;
  color: #667682;
}

.permit-check-result.is-pending {
  border-color: #bdd8e7;
  background: #edf7fb;
  color: #17658e;
}

.permit-row-actions {
  display: table-cell;
  white-space: nowrap;
}

.permit-row-actions button + button {
  margin-left: 4px;
}

.permit-row-actions button:disabled,
.permit-expanded-actions button:disabled {
  border-color: #bdd8e7;
  background: #edf7fb;
  color: #17658e;
  cursor: wait;
  opacity: 1;
}

.permit-expanded-row > td {
  padding: 0;
  border-bottom: 1px solid var(--portal-line-strong);
  background: #f8fbfc;
}

.permit-expanded-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 18px;
  padding: 14px 18px 16px 54px;
  box-shadow: inset 3px 0 var(--portal-blue-bright);
}

.permit-status-history {
  grid-column: 1 / -1;
  min-width: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--portal-line);
}

.permit-status-history-heading {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin-bottom: 10px;
}

.permit-status-history-heading strong {
  color: var(--portal-navy-deep);
  font-size: 0.75rem;
}

.permit-status-history-heading span {
  color: var(--portal-muted);
  font-size: 0.64rem;
}

.permit-status-track {
  display: flex;
  gap: 0;
  min-width: 100%;
  margin: 0;
  padding: 0 0 4px;
  overflow-x: auto;
  list-style: none;
  scrollbar-width: thin;
}

.permit-status-step {
  position: relative;
  display: grid;
  flex: 0 0 min(210px, 45vw);
  grid-template-columns: 18px minmax(0, 1fr);
  column-gap: 7px;
  min-width: 155px;
  padding-right: 18px;
}

.permit-status-step::after {
  content: "";
  position: absolute;
  z-index: 0;
  top: 8px;
  left: 9px;
  right: -9px;
  height: 2px;
  background: #d6dde2;
}

.permit-status-step:last-child::after {
  display: none;
}

.permit-status-node {
  position: relative;
  z-index: 1;
  grid-row: 1 / 4;
  width: 18px;
  height: 18px;
  border: 4px solid #fff;
  border-radius: 50%;
  background: #98a6b0;
  box-shadow: 0 0 0 1px #c8d1d8;
}

.permit-status-step small,
.permit-status-step strong,
.permit-status-step time {
  grid-column: 2;
  min-width: 0;
}

.permit-status-step small {
  color: var(--portal-muted);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.permit-status-step strong {
  overflow: hidden;
  margin-top: 2px;
  color: var(--portal-ink);
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.permit-status-step time {
  margin-top: 2px;
  color: var(--portal-muted);
  font-size: 0.61rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.permit-status-step.is-past::after {
  background: #66b694;
}

.permit-status-step.is-past .permit-status-node,
.permit-status-step.is-terminal .permit-status-node {
  background: #16865d;
  box-shadow: 0 0 0 1px #16865d;
}

.permit-status-step.is-past small,
.permit-status-step.is-terminal small {
  color: #0d6948;
}

.permit-status-step.is-current .permit-status-node {
  background: #ed9b25;
  box-shadow: 0 0 0 1px #d9830d;
}

.permit-status-step.is-current small {
  color: #a86100;
}

.permit-status-step.is-current.is-terminal .permit-status-node {
  background: #16865d;
  box-shadow: 0 0 0 1px #16865d;
}

.permit-status-step.is-current.is-terminal small {
  color: #0d6948;
}

.permit-expanded-summary dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 9px 16px;
  margin: 0;
}

.permit-expanded-summary dl div {
  min-width: 0;
}

.permit-expanded-summary dt {
  color: var(--portal-muted);
  font-size: 0.61rem;
  font-weight: 800;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.permit-expanded-summary dd {
  overflow: hidden;
  margin: 2px 0 0;
  color: var(--portal-ink);
  font-size: 0.74rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.permit-expanded-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  max-width: 390px;
}

.permit-expanded-actions .portal-button,
.permit-expanded-actions .danger-button {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 0.7rem;
}

.permit-row-warning {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  border-left: 3px solid var(--portal-danger);
  padding: 6px 9px;
  background: #fff0f0;
  color: #8f2f2f;
  font-size: 0.7rem;
}

.permit-table-empty {
  padding: 48px 20px;
  text-align: center;
}

.permit-table-empty strong {
  color: var(--portal-navy-deep);
}

.permit-table-empty p {
  margin: 6px 0 14px;
  color: var(--portal-muted);
}

.permit-ledger-detail {
  display: none;
}

.permit-schedule-settings {
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  padding: 12px;
  background: #f7fafb;
}

.permit-schedule-settings strong {
  color: var(--portal-navy-deep);
}

.permit-schedule-settings p {
  margin: 6px 0 0;
  color: var(--portal-muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

@media (max-width: 980px) {
  .permit-inline-search {
    grid-template-columns: 180px minmax(240px, 1fr) auto;
  }

  .permit-add-options {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .permit-ledger-toolbar {
    align-items: start;
    flex-direction: column;
  }

  .permit-ledger-filters {
    width: 100%;
    justify-content: stretch;
  }

  .permit-filter-search {
    width: auto;
    flex: 1 1 240px;
  }

  .permit-ledger-summary {
    grid-template-columns: repeat(4, 1fr);
  }

  .permit-ledger-loaded {
    grid-column: 1 / -1;
    padding: 7px 14px;
    border-top: 1px solid var(--portal-line);
    text-align: left;
  }
}

@media (max-width: 700px) {
  .permit-ledger-workspace {
    width: min(100% - 20px, 1540px);
  }

  .permit-ledger-heading {
    align-items: start;
    flex-direction: column;
  }

  .permit-heading-actions {
    width: 100%;
  }

  .permit-heading-actions .portal-button {
    flex: 1;
  }

  .permit-inline-search,
  .permit-add-options {
    grid-template-columns: 1fr;
  }

  .permit-ledger-filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .permit-filter-search {
    grid-column: 1 / -1;
    width: 100%;
  }

  .permit-status-filter {
    width: 100%;
    min-width: 0;
  }

  .permit-status-options {
    right: auto;
    left: 0;
    width: max(100%, 225px);
  }

  .permit-ledger-summary {
    grid-template-columns: repeat(2, 1fr);
  }

  .permit-ledger-summary > div:nth-child(2) {
    border-right: 0;
  }

  .permit-table-scroll {
    height: 62vh;
  }

  .permit-expanded-content {
    grid-template-columns: 1fr;
    padding-left: 18px;
  }

  .permit-expanded-summary dl {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .permit-expanded-actions {
    justify-content: flex-start;
    max-width: none;
  }
}

@media print {
  .permit-ledger-page .permit-ledger-heading,
  .permit-ledger-page .permit-add-panel,
  .permit-ledger-page .permit-ledger-card,
  .permit-ledger-page .permit-source-note {
    display: none !important;
  }

  .permit-ledger-page .permit-ledger-detail:not(.hidden) {
    display: block !important;
    border: 0;
    box-shadow: none;
  }

  .permit-ledger-page .permit-status-history {
    break-inside: avoid;
    margin: 12px 0;
    padding: 12px 0;
    border-top: 1px solid #c9d1d7;
  }

  .permit-ledger-page .permit-status-track {
    flex-wrap: wrap;
    row-gap: 14px;
    overflow: visible;
  }

  .permit-ledger-page .permit-status-step {
    flex-basis: 32%;
  }
}

/* JaxEPICS permit tracker */
.permit-tracker-workspace {
  width: min(100% - 40px, 1480px);
}

.permit-tracker-banner {
  background:
    linear-gradient(105deg, rgba(121, 198, 228, 0.12), transparent 58%),
    var(--portal-navy);
}

.permit-project-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px;
}

.permit-monitor-strip {
  align-items: center;
}

.permit-schedule-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(92px, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--portal-line);
  border-radius: 4px;
  background: var(--portal-line);
}

.permit-schedule-summary span {
  display: grid;
  gap: 2px;
  min-width: 96px;
  padding: 10px 12px;
  background: #f8fafb;
  text-align: center;
}

.permit-schedule-summary small {
  color: var(--portal-muted);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.permit-schedule-summary strong {
  color: var(--portal-navy);
  font-size: 0.84rem;
}

.permit-project-copy {
  min-width: 0;
}

.permit-project-copy .inline-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.permit-project-copy h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--portal-navy);
}

.permit-project-copy > p:last-child {
  margin: 8px 0 0;
  color: var(--portal-muted);
}

.permit-project-controls {
  display: grid;
  gap: 7px;
  min-width: min(100%, 470px);
}

.permit-project-controls > label {
  color: var(--portal-muted);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.permit-project-select-row {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 8px;
}

.permit-project-select-row select {
  min-width: 250px;
  min-height: 42px;
  flex: 1 1 260px;
  padding: 0 38px 0 12px;
  border: 1px solid var(--portal-line-strong);
  border-radius: 3px;
  color: var(--portal-ink);
  background: #fff;
}

.permit-page-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 160px;
  color: var(--portal-muted);
}

.permit-loading-spinner {
  width: 25px;
  height: 25px;
  border: 3px solid #cbd7df;
  border-top-color: var(--portal-blue);
  border-radius: 50%;
  animation: permit-spin 0.8s linear infinite;
}

@keyframes permit-spin {
  to { transform: rotate(360deg); }
}

.permit-project-required {
  display: flex;
  align-items: center;
  gap: 22px;
  max-width: 880px;
  margin-inline: auto;
  border-top: 4px solid var(--portal-blue);
}

.permit-project-required h2,
.permit-detail-empty h2 {
  margin: 3px 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--portal-navy);
}

.permit-project-required p,
.permit-detail-empty p {
  margin: 0;
  color: var(--portal-muted);
}

.permit-empty-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  border: 1px solid #b8d5e4;
  border-radius: 50%;
  color: var(--portal-blue);
  background: #eef8fc;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  font-weight: 800;
}

.permit-tracker-layout {
  display: grid;
  grid-template-columns: minmax(330px, 410px) minmax(0, 1fr);
  align-items: start;
  gap: 22px;
}

.permit-tracker-sidebar {
  display: grid;
  gap: 16px;
}

.permit-tracker-sidebar .portal-panel,
.permit-detail-panel {
  padding: 21px;
}

.permit-discovery-panel {
  border-top: 4px solid var(--portal-blue-bright);
}

.permit-add-panel {
  border-top: 4px solid var(--portal-navy);
}

.compact-panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 11px;
}

.compact-panel-heading h2 {
  margin: 2px 0 0;
  color: var(--portal-navy);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.2rem;
}

.agency-source-badge,
.permit-freshness-badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 8px;
  border: 1px solid #b9d9e8;
  border-radius: 999px;
  color: #0d5d82;
  background: #edf8fc;
  font-size: 0.67rem;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.permit-control-note,
.permit-owner-note {
  margin: 9px 0 0;
  color: var(--portal-muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.permit-owner-note {
  padding: 10px 11px;
  border-left: 3px solid var(--portal-warning);
  background: #fff8e9;
}

.full-width {
  width: 100%;
  justify-content: center;
}

.permit-add-form,
.permit-search-form {
  display: grid;
  gap: 12px;
}

.permit-add-form label,
.permit-search-form > label,
.permit-search-row label,
.permit-edit-dialog label {
  display: grid;
  gap: 6px;
  color: var(--portal-ink);
  font-size: 0.8rem;
  font-weight: 780;
}

.permit-add-form input,
.permit-add-form select,
.permit-search-form input,
.permit-search-form select,
.permit-edit-dialog input,
.permit-edit-dialog select {
  min-height: 42px;
  width: 100%;
  padding: 0 11px;
  border: 1px solid var(--portal-line-strong);
  border-radius: 3px;
  color: var(--portal-ink);
  background: #fff;
}

.permit-add-form input:focus,
.permit-add-form select:focus,
.permit-search-form input:focus,
.permit-search-form select:focus,
.permit-edit-dialog input:focus,
.permit-edit-dialog select:focus,
.permit-project-select-row select:focus {
  border-color: var(--portal-blue);
  outline: 3px solid rgba(30, 132, 189, 0.15);
}

.permit-search-row {
  display: grid;
  grid-template-columns: minmax(145px, 0.72fr) minmax(0, 1.6fr);
  gap: 10px;
}

.permit-query-label {
  min-width: 0;
}

.permit-monitor-toggle {
  display: grid !important;
  grid-template-columns: 19px minmax(0, 1fr);
  align-items: start;
  gap: 9px !important;
  padding: 10px 11px;
  border: 1px solid var(--portal-line);
  border-radius: 4px;
  background: #f8fafb;
  cursor: pointer;
}

.permit-monitor-toggle input {
  width: 17px !important;
  min-height: 17px !important;
  margin: 2px 0 0;
  padding: 0 !important;
  accent-color: var(--portal-blue);
}

.permit-monitor-toggle span {
  display: grid;
  gap: 2px;
}

.permit-monitor-toggle small {
  color: var(--portal-muted);
  font-size: 0.7rem;
  font-weight: 500;
  line-height: 1.35;
}

.permit-candidate-fieldset {
  min-width: 0;
  margin: 15px 0 11px;
  padding: 0;
  border: 0;
}

.permit-candidate-fieldset legend {
  margin-bottom: 8px;
  color: var(--portal-muted);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.permit-candidate-list {
  display: grid;
  gap: 8px;
  max-height: 380px;
  padding-right: 3px;
  overflow: auto;
}

.permit-candidate-card {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--portal-line);
  border-radius: 4px;
  background: #f8fafb;
  cursor: pointer;
}

.permit-candidate-card:has(input:checked) {
  border-color: var(--portal-blue);
  box-shadow: 0 0 0 2px rgba(23, 107, 158, 0.12);
  background: #f0f8fc;
}

.permit-candidate-card input {
  margin: 3px 0 0;
  accent-color: var(--portal-blue);
}

.permit-candidate-card > span,
.permit-candidate-heading {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.permit-candidate-heading {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.permit-candidate-card b,
.permit-candidate-card small {
  overflow-wrap: anywhere;
}

.permit-candidate-card b {
  color: var(--portal-ink);
  font-size: 0.76rem;
}

.permit-candidate-card small {
  color: var(--portal-muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.tracked-permits-panel {
  min-width: 0;
}

.permit-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: -2px 0 12px;
}

.permit-card-list {
  display: grid;
  gap: 9px;
}

.permit-card {
  position: relative;
  border: 1px solid var(--portal-line);
  border-left: 4px solid #9aabb8;
  border-radius: 4px;
  background: #fff;
  overflow: hidden;
}

.permit-card.is-selected {
  border-color: var(--portal-blue);
  border-left-color: var(--portal-blue);
  box-shadow: 0 5px 18px rgba(23, 107, 158, 0.12);
}

.permit-card-select {
  display: grid;
  width: 100%;
  gap: 6px;
  padding: 12px 13px 10px;
  border: 0;
  color: inherit;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.permit-card-select:hover {
  background: #f5f9fb;
}

.permit-card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.permit-card-select strong,
.permit-card-number,
.permit-card-description,
.permit-card-time {
  overflow-wrap: anywhere;
}

.permit-card-select strong {
  color: var(--portal-navy);
  font-size: 0.91rem;
}

.permit-card-number {
  color: var(--portal-blue);
  font-size: 0.75rem;
  font-weight: 800;
}

.permit-project-chip {
  justify-self: start;
  padding: 3px 7px;
  border: 1px solid #d7e0e6;
  border-radius: 999px;
  color: #526774;
  background: #f3f6f8;
  font-size: 0.63rem;
  font-weight: 800;
}

.permit-card-description {
  color: var(--portal-muted);
  font-size: 0.75rem;
  line-height: 1.35;
}

.permit-card-time {
  color: #788794;
  font-size: 0.68rem;
}

.permit-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 8px 13px 11px;
  border-top: 1px solid #e8edf1;
  background: #fafcfd;
}

.permit-card-actions .text-button {
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 0.72rem;
  cursor: pointer;
}

.permit-card-actions .is-danger {
  color: var(--portal-danger);
}

.permit-card-error,
.permit-refresh-error,
.permit-inline-error {
  margin: 0 12px 10px;
  padding: 9px 10px;
  border-left: 3px solid var(--portal-danger);
  color: #722626;
  background: #fff1f1;
  font-size: 0.75rem;
}

.permit-card-error {
  display: grid;
  gap: 2px;
}

.permit-freshness-badge.is-pending {
  border-color: #e7bd6e;
  color: #744300;
  background: #fff5df;
}

.permit-refresh-error.is-pending {
  border-left-color: var(--portal-warning);
  color: #6b4508;
  background: #fff8e9;
}

.permit-inline-error p,
.permit-refresh-error p {
  margin: 4px 0 8px;
}

.permit-detail-panel {
  position: sticky;
  top: 16px;
  min-height: 610px;
  border-top: 4px solid var(--portal-blue);
}

.permit-detail-empty {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 520px;
  padding: 40px;
  text-align: center;
}

.permit-detail-empty .permit-empty-icon {
  margin-bottom: 12px;
}

.permit-print-header {
  display: none;
}

.permit-detail-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--portal-line);
}

.permit-detail-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}

.permit-detail-heading h2 {
  margin: 2px 0 0;
  color: var(--portal-navy);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.45rem, 2.3vw, 2rem);
}

.permit-detail-number {
  margin: 6px 0 0;
  color: var(--portal-blue);
  font-weight: 820;
}

.permit-status-detail {
  margin: 7px 0 0;
  color: var(--portal-muted);
}

.permit-detail-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 250px;
}

.permit-status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  max-width: 100%;
  padding: 3px 9px;
  border: 1px solid #bdc9d1;
  border-radius: 999px;
  color: #495a67;
  background: #f0f3f5;
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.035em;
  line-height: 1.2;
  text-transform: uppercase;
}

.permit-status-chip.is-small {
  min-height: 22px;
  padding: 2px 7px;
  font-size: 0.59rem;
}

.permit-status-chip.is-active {
  border-color: #82c6aa;
  color: #0c5d3f;
  background: #e7f7ef;
}

.permit-status-chip.is-review {
  border-color: #8fc4df;
  color: #07597e;
  background: #e9f5fb;
}

.permit-status-chip.is-action {
  border-color: #e7bd6e;
  color: #744300;
  background: #fff5df;
}

.permit-status-chip.is-expired,
.permit-status-chip.is-error {
  border-color: #dfa0a0;
  color: #842d2d;
  background: #fff0f0;
}

.permit-status-chip.is-closed {
  border-color: #bdc7ce;
  color: #4e5e69;
  background: #eef1f3;
}

.permit-sync-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 18px 0;
  border: 1px solid var(--portal-line);
  background: var(--portal-line);
}

.permit-sync-strip > div {
  display: grid;
  gap: 3px;
  padding: 11px 12px;
  background: #f8fafb;
}

.permit-sync-strip span,
.permit-sync-strip small {
  color: var(--portal-muted);
  font-size: 0.69rem;
}

.permit-sync-strip strong {
  color: var(--portal-navy);
  font-size: 0.82rem;
}

.permit-refresh-error {
  margin: 0 0 18px;
}

.permit-report-section {
  padding: 17px 0;
  border-top: 1px solid var(--portal-line);
}

.permit-report-section:first-of-type {
  border-top: 0;
}

.permit-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 11px;
}

.permit-section-heading h3 {
  margin: 0;
  color: var(--portal-navy);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.08rem;
}

.permit-section-heading span {
  color: var(--portal-muted);
  font-size: 0.72rem;
}

.permit-summary-grid,
.permit-invoice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  border: 1px solid var(--portal-line);
  background: var(--portal-line);
}

.permit-summary-grid > div,
.permit-invoice-grid > div {
  min-width: 0;
  padding: 10px 11px;
  background: #fff;
}

.permit-summary-grid dt,
.permit-invoice-grid dt {
  margin-bottom: 4px;
  color: var(--portal-muted);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.permit-summary-grid dd,
.permit-invoice-grid dd {
  margin: 0;
  color: var(--portal-ink);
  font-size: 0.81rem;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.permit-report-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.permit-activity-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.permit-activity-item {
  position: relative;
  min-width: 0;
  padding: 10px 11px 10px 18px;
  border: 1px solid var(--portal-line);
  border-radius: 3px;
  background: #fafcfd;
}

.permit-activity-marker {
  position: absolute;
  top: 13px;
  left: 8px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--portal-blue);
}

.permit-activity-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.permit-activity-heading strong {
  color: var(--portal-navy);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.permit-activity-item time,
.permit-activity-item p {
  display: block;
  margin: 4px 0 0;
  color: var(--portal-muted);
  font-size: 0.69rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.permit-section-empty {
  margin: 0;
  padding: 13px;
  border: 1px dashed var(--portal-line-strong);
  color: var(--portal-muted);
  background: #fafcfd;
  font-size: 0.78rem;
}

.permit-report-source,
.permit-source-note {
  padding: 14px 16px;
  border-left: 4px solid var(--portal-blue);
  color: var(--portal-muted);
  background: #edf6fa;
  font-size: 0.77rem;
  line-height: 1.45;
}

.permit-source-note {
  margin-top: 18px;
}

.permit-report-source p,
.permit-source-note p {
  margin: 5px 0;
}

.permit-report-source a,
.permit-source-note a {
  color: var(--portal-blue);
  font-weight: 780;
}

.permit-edit-dialog {
  width: min(92vw, 520px);
  padding: 0;
  border: 0;
  border-radius: 5px;
  color: var(--portal-ink);
  background: #fff;
  box-shadow: 0 24px 80px rgba(5, 26, 43, 0.28);
}

.permit-edit-dialog::backdrop {
  background: rgba(5, 24, 39, 0.58);
}

.permit-edit-dialog form {
  display: grid;
  gap: 16px;
  padding: 23px;
}

.permit-dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.permit-dialog-heading h2 {
  margin: 2px 0 0;
  color: var(--portal-navy);
  font-family: Georgia, "Times New Roman", serif;
}

.dialog-close {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--portal-line);
  border-radius: 50%;
  color: var(--portal-muted);
  background: #fff;
  font-size: 1.4rem;
  cursor: pointer;
}

.permit-dialog-reference {
  margin: -6px 0 0;
  color: var(--portal-blue);
  font-size: 0.8rem;
  font-weight: 800;
}

.permit-dialog-actions {
  justify-content: flex-end;
  margin: 0;
}

@media (max-width: 1080px) {
  .permit-tracker-layout {
    grid-template-columns: 1fr;
  }

  .permit-tracker-sidebar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tracked-permits-panel {
    grid-column: 1 / -1;
  }

  .permit-card-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .permit-detail-panel {
    position: static;
    min-height: 0;
  }
}

@media (max-width: 760px) {
  .permit-tracker-workspace {
    width: min(100% - 24px, 1480px);
  }

  .permit-project-strip,
  .permit-tracker-sidebar,
  .permit-card-list,
  .permit-report-columns {
    grid-template-columns: 1fr;
  }

  .permit-schedule-summary,
  .permit-search-row {
    grid-template-columns: 1fr;
  }

  .permit-schedule-summary span {
    min-width: 0;
  }

  .tracked-permits-panel {
    grid-column: auto;
  }

  .permit-detail-heading {
    display: grid;
  }

  .permit-detail-actions {
    justify-content: flex-start;
    min-width: 0;
  }

  .permit-detail-actions .portal-button,
  .permit-detail-actions .danger-button {
    flex: 1 1 150px;
  }

  .permit-summary-grid,
  .permit-invoice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .permit-sync-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .permit-project-required {
    display: grid;
  }

  .permit-project-select-row,
  .permit-schedule-summary,
  .permit-list-toolbar,
  .permit-section-heading,
  .permit-activity-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .permit-project-select-row select,
  .permit-project-select-row .portal-button {
    width: 100%;
  }

  .permit-tracker-sidebar .portal-panel,
  .permit-detail-panel {
    padding: 17px;
  }

  .permit-summary-grid,
  .permit-invoice-grid {
    grid-template-columns: 1fr;
  }

  .permit-detail-empty {
    min-height: 320px;
    padding: 22px;
  }
}

@media print {
  @page {
    size: letter portrait;
    margin: 0.45in;
  }

  .permit-tracker-page {
    min-width: 0;
    color: #111;
    background: #fff;
    font-family: Arial, Helvetica, sans-serif;
  }

  .permit-tracker-page .portal-masthead,
  .permit-tracker-page .calculator-nav,
  .permit-tracker-page .portal-banner,
  .permit-tracker-page .active-project-strip,
  .permit-tracker-page .permit-page-loading,
  .permit-tracker-page .permit-project-required,
  .permit-tracker-page .permit-tracker-sidebar,
  .permit-tracker-page .permit-detail-empty,
  .permit-tracker-page .permit-source-note,
  .permit-tracker-page .portal-footer,
  .permit-tracker-page .portal-alert,
  .permit-tracker-page dialog,
  .permit-tracker-page .no-print {
    display: none !important;
  }

  .permit-tracker-page .portal-workspace,
  .permit-tracker-page .permit-tracker-layout {
    display: block !important;
    width: 100%;
    margin: 0;
    padding: 0;
  }

  .permit-tracker-page .permit-detail-panel {
    position: static;
    display: block;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  .permit-tracker-page #permit-detail {
    display: block !important;
  }

  .permit-tracker-page .permit-print-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px 18px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 2px solid #0b2f4f;
  }

  .permit-tracker-page .permit-print-header > div {
    min-width: 0;
  }

  .permit-tracker-page .permit-print-header dt {
    color: #555;
    font-size: 7.5pt;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .permit-tracker-page .permit-print-header dd {
    margin: 2px 0 0;
    font-size: 9pt;
    overflow-wrap: anywhere;
  }

  .permit-tracker-page .permit-detail-heading {
    padding-bottom: 10px;
  }

  .permit-tracker-page .permit-detail-heading h2 {
    color: #0b2f4f;
    font-size: 17pt;
  }

  .permit-tracker-page .permit-status-chip {
    border-color: #777;
    color: #111;
    background: #fff;
  }

  .permit-tracker-page .permit-sync-strip,
  .permit-tracker-page .permit-summary-grid,
  .permit-tracker-page .permit-invoice-grid {
    border-color: #999;
    background: #999;
  }

  .permit-tracker-page .permit-sync-strip > div,
  .permit-tracker-page .permit-summary-grid > div,
  .permit-tracker-page .permit-invoice-grid > div {
    background: #fff;
  }

  .permit-tracker-page .permit-report-section,
  .permit-tracker-page .permit-activity-item,
  .permit-tracker-page .permit-report-source {
    break-inside: avoid;
  }

  .permit-tracker-page .permit-report-section {
    padding: 10px 0;
  }

  .permit-tracker-page .permit-report-columns {
    gap: 12px;
  }

  .permit-tracker-page .permit-activity-item {
    padding: 6px 7px 6px 14px;
    border-color: #aaa;
    background: #fff;
  }

  .permit-tracker-page .permit-report-source {
    margin-top: 10px;
    padding: 8px 10px;
    border-color: #0b2f4f;
    color: #333;
    background: #fff;
    font-size: 7.5pt;
  }

  .permit-tracker-page a {
    color: #111;
    text-decoration: none;
  }
}

/* Source-order overrides for the eight-column shared permit ledger. */
.permit-add-options {
  grid-template-columns: minmax(170px, 1fr) minmax(170px, 0.8fr) minmax(165px, 0.7fr) minmax(235px, 1fr) auto;
}

.permit-watch-table {
  min-width: 1320px;
}

.permit-watch-table th:nth-child(1) { width: 44px; }
.permit-watch-table th:nth-child(2) { width: 245px; }
.permit-watch-table th:nth-child(3) { width: 110px; }
.permit-watch-table th:nth-child(4) { width: 145px; }
.permit-watch-table th:nth-child(5) { width: 175px; }
.permit-watch-table th:nth-child(6) { width: 205px; }
.permit-watch-table th:nth-child(7) { width: 240px; }
.permit-watch-table th:nth-child(8) { width: 156px; }

@media (max-width: 1180px) {
  .permit-add-options {
    grid-template-columns: repeat(2, minmax(190px, 1fr));
  }
}

@media (max-width: 700px) {
  .permit-add-options {
    grid-template-columns: 1fr;
  }
}
