:root {
  --ink: #14211b;
  --muted: #52665c;
  --line: #bed3c8;
  --paper: #eef8f2;
  --white: #ffffff;
  --teal: #16884a;
  --teal-dark: #0f3b2d;
  --amber: #d49a2f;
  --sage: #dff3e8;
  --rose: #b7475d;
  --navy: #12362b;
  --navy-2: #0b281f;
  --gold: #17aa56;
  --slate: #e8f4ed;
  --radius: 7px;
  --shadow: 0 18px 48px rgba(10, 64, 40, 0.14);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(236, 248, 241, 0.96), rgba(250, 253, 251, 0.98) 42%, rgba(222, 241, 231, 0.94)),
    url("./public/assets/civicport-civic-map.png") center top / cover fixed;
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.shell {
  min-height: 100vh;
}

.anchor-target {
  position: relative;
  top: -80px;
}

.login-gate {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.75fr);
  gap: 24px;
  width: min(1180px, calc(100% - 28px));
  min-height: calc(100vh - 104px);
  margin: 18px auto;
  padding: clamp(28px, 6vw, 72px);
  align-items: center;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.86) 54%, rgba(238, 244, 247, 0.82)),
    url("./public/assets/civicport-dashboard.png") center / cover;
  border: 1px solid #bfc9d2;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.login-copy {
  max-width: 690px;
}

.login-copy h1 {
  max-width: 620px;
  margin: 12px 0 14px;
  font-size: clamp(44px, 8vw, 86px);
  line-height: 0.95;
}

.login-copy p {
  max-width: 560px;
  color: #344451;
  font-size: 18px;
  line-height: 1.6;
}

.login-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 26px;
}

.login-button {
  min-width: 148px;
}

.login-button:disabled {
  color: #87919b;
  background: #edf1f4;
  border-color: #d8e0e7;
  cursor: not-allowed;
}

.login-note {
  max-width: 360px;
  margin: 0;
  color: var(--rose);
  font-size: 14px;
  font-weight: 800;
}

.login-panel {
  padding: 24px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #c8d2da;
  border-radius: var(--radius);
  box-shadow: 0 18px 42px rgba(15, 36, 54, 0.1);
}

.login-panel strong {
  display: block;
  color: var(--ink);
  font-size: 18px;
}

.login-panel p {
  color: var(--muted);
  line-height: 1.55;
}

.login-steps {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.login-steps span {
  padding: 12px;
  color: #23303b;
  font-size: 14px;
  font-weight: 850;
  background: #f3f6f8;
  border: 1px solid #d8e0e7;
  border-radius: var(--radius);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(18px, 4vw, 56px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 3px solid var(--navy);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 900;
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  display: block;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

body[data-authenticated="false"] .role-select,
body[data-authenticated="false"] .nav-cta:not(.login-button),
body[data-authenticated="false"] .auth-status {
  display: none;
}

.auth-status {
  max-width: 220px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-select {
  width: 132px;
  min-height: 42px;
  padding: 8px 10px;
  background: var(--white);
  font-weight: 800;
}

.nav-cta,
.primary,
.secondary,
.side-link,
.icon-button {
  min-height: 42px;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 900;
}

.nav-cta,
.primary,
.secondary,
.side-link,
.icon-button,
.creative-button {
  --button-bg: #17aa56;
  --button-bg-hover: #19b85e;
  --button-shadow: #119e4d;
  --button-icon: #0a833d;
  position: relative;
  top: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #ffffff;
  background: var(--button-bg);
  border: 0;
  box-shadow: 0 5px var(--button-shadow);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0;
  transition: background 160ms ease, box-shadow 160ms ease, top 160ms ease, transform 160ms ease;
}

.primary,
.secondary {
  padding: 0 18px 0 48px;
}

.nav-cta {
  padding: 0 16px 0 44px;
}

.primary:hover,
.secondary:hover,
.nav-cta:hover,
.side-link:hover,
.icon-button:hover,
.creative-button:hover {
  color: #ffffff;
  background: var(--button-bg-hover);
  box-shadow: 0 3px var(--button-shadow);
  top: 2px;
}

.primary:active,
.secondary:active,
.nav-cta:active,
.side-link:active,
.icon-button:active,
.creative-button:active {
  box-shadow: 0 0 var(--button-shadow);
  top: 5px;
}

.creative-button__icon {
  position: absolute;
  left: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 100%;
  color: var(--button-icon);
  transition: transform 180ms ease, opacity 180ms ease;
  pointer-events: none;
}

.creative-button__icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.creative-button.btn-activated .creative-button__icon {
  animation: creative-move-right 0.5s;
}

.creative-button:disabled,
.review-actions button:disabled {
  color: #e3e9ed;
  background: #aebbc5;
  box-shadow: 0 5px #8d9ca8;
  cursor: not-allowed;
  opacity: 0.78;
}

.compact {
  min-height: 38px;
  padding: 0 14px 0 40px;
  font-size: 14px;
}

.auth-button {
  min-width: 90px;
}

@keyframes creative-move-right {
  80% {
    opacity: 1;
    transform: translateX(250%);
  }
  82% {
    opacity: 0;
    transform: translateX(250%);
  }
  83% {
    opacity: 0;
    transform: translateX(-50%);
  }
  84% {
    opacity: 1;
    transform: translateX(-50%);
  }
  100% {
    transform: translateX(0);
  }
}

.section-kicker {
  display: inline-flex;
  margin-bottom: 12px;
  color: var(--navy);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1.04;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 10px;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.05;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 20px;
  letter-spacing: 0;
}

p {
  color: var(--muted);
  line-height: 1.65;
}

.staff-actions,
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.staff-actions,
.config-form,
.upload-box,
.management-grid,
.document-workspace,
.inspection-workspace,
.workspace-section {
  display: grid;
  gap: 14px;
  align-items: stretch;
}

.staff-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.metric {
  padding: 12px;
  background: #f8fafb;
  border: 1px solid #cbd5de;
  border-top: 3px solid var(--navy);
  border-radius: var(--radius);
}

.metric.urgent {
  border-top-color: var(--amber);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 4px;
  font-size: 26px;
}

.staff-workbench {
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(560px, 1.9fr);
  gap: 16px;
  align-items: start;
}

.review-inbox {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: #ffffff;
  border: 1px solid #cbd5de;
  border-radius: var(--radius);
}

  max-height: 760px;
  overflow: auto;
}

.review-inbox-head,
.review-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.desk-select {
  width: 176px;
  color: var(--muted);
  font-size: 12px;
}

.desk-select .cs-select {
  min-width: 176px;
}

.desk-select .cs-placeholder {
  padding-right: 34px;
}

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

.review-scope button {
  min-height: 34px;
  color: var(--ink);
  background: #f4f7f8;
  border: 1px solid #cbd5de;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.review-scope button.active {
  color: #ffffff;
  background: var(--navy);
  border-color: var(--navy);
}

.review-inbox-list {
  display: grid;
  gap: 10px;
}

.review-inbox-card,
.review-inbox-empty,
.review-application-summary {
  display: grid;
  gap: 9px;
  padding: 13px;
  background: #f8fafb;
  border: 1px solid #d8e0e7;
  border-radius: var(--radius);
}

.review-inbox-card {
  text-align: left;
  cursor: pointer;
}

.review-inbox-card.selected {
  background: #ffffff;
  border-color: var(--navy);
  box-shadow: inset 4px 0 0 var(--gold);
}

.review-inbox-card p,
.review-inbox-empty p,
.review-application-summary p {
  margin: 0;
}

.review-card-meta {
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.review-card-task {
  padding: 9px 10px;
  color: var(--navy);
  background: var(--slate);
  border-left: 3px solid var(--gold);
  font-size: 12px;
  font-weight: 900;
}

.review-card-task strong {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.review-decision-summary {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: #f8fafb;
  border: 1px solid #b8d8c6;
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
}

.staff-record {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: #ffffff;
  border: 1px solid #cbd5de;
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
}

.record-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.record-head-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  align-items: center;
}

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

.record-grid span {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  color: var(--muted);
  background: #f8fafb;
  border: 1px solid #d8e0e7;
  font-size: 12px;
  font-weight: 900;
}

.record-grid strong {
  color: var(--ink);
  font-size: 14px;
}

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

.review-actions button:disabled {
  cursor: not-allowed;
}

.workbench {
  width: min(1320px, calc(100% - 28px));
  margin: 18px auto;
}

.workbench {
  display: grid;
  grid-template-columns: 230px 1fr;
  min-height: calc(100vh - 104px);
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.99), rgba(255, 255, 255, 0.96) 56%, rgba(246, 249, 251, 0.9)),
    url("./public/assets/civicport-civic-map.png") center / cover;
  border: 1px solid #bfc9d2;
  border-radius: var(--radius);
  box-shadow: 0 16px 44px rgba(15, 36, 54, 0.08);
}

.sidebar {
  padding: 18px;
  background: var(--navy);
  border-right: 0;
}

.side-title {
  margin-bottom: 12px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.side-link {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 46px;
  margin: 8px 0;
  padding: 0 14px 0 46px;
  color: #ffffff;
  text-align: left;
  text-decoration: none;
  --button-bg: rgba(23, 170, 86, 0.2);
  --button-bg-hover: #17aa56;
  --button-shadow: rgba(10, 131, 61, 0.7);
  --button-icon: #39d47b;
}

.side-link .creative-button__icon {
  left: 14px;
  width: 20px;
  height: 100%;
}

.side-link .creative-button__icon svg {
  width: 18px;
  height: 18px;
}

.side-link.active,
.side-link:hover {
  color: var(--white);
  background: var(--button-bg-hover);
  box-shadow: 0 5px var(--button-shadow), inset 3px 0 0 var(--gold);
}

.workspace {
  padding: clamp(16px, 2.2vw, 26px);
}

.workspace-head {
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #c9d2da;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

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

body[data-role="applicant"] .dashboard-status-counts {
  display: none;
}

body[data-role="applicant"] [data-staff-only] {
  display: none !important;
}

.stat {
  padding: 18px;
  background: #f8fafb;
  border: 1px solid #cbd5de;
  border-top: 3px solid var(--navy);
  border-radius: var(--radius);
}

.stat span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.stat strong {
  font-size: 34px;
}

.split {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(320px, 0.82fr);
  gap: 22px;
  align-items: start;
}

.queue-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.filter-label {
  width: 170px;
  color: var(--muted);
  font-size: 12px;
}

.filter-label select {
  min-height: 38px;
  padding: 7px 10px;
}

.preview-stack {
  display: grid;
  gap: 14px;
}

.selected-detail {
  padding: 18px;
  background:
    linear-gradient(rgba(248, 250, 251, 0.94), rgba(248, 250, 251, 0.98)),
    url("./public/assets/civicport-civic-map.png") center / cover;
  border: 1px solid #cbd5de;
  border-radius: var(--radius);
}

.ops-card {
  padding: 18px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.96), rgba(246, 249, 251, 0.98)),
    url("./public/assets/civicport-workflow.png") center / cover;
  border: 1px solid #cbd5de;
  border-radius: var(--radius);
}

.check-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.check-list span {
  position: relative;
  padding: 10px 12px 10px 36px;
  background: #f8fafb;
  border: 1px solid #cbd5de;
  border-radius: var(--radius);
  color: var(--ink);
  font-weight: 800;
}

.check-list span::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 14px;
  width: 10px;
  height: 10px;
  background: var(--gold);
  border-radius: 1px;
}

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

.detail-grid span {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.detail-grid strong {
  color: var(--ink);
  font-size: 15px;
}

.next-step {
  margin-top: 14px;
  padding: 12px;
  color: var(--navy);
  background: var(--slate);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 800;
}

.permit-list,
.audit-list,
.timeline,
.document-list {
  display: grid;
  gap: 10px;
}

.permit-card,
.audit-item,
.timeline-item,
.document-item {
  padding: 14px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #cbd5de;
  border-radius: var(--radius);
  backdrop-filter: blur(6px);
}

.permit-card {
  display: grid;
  gap: 10px;
  cursor: pointer;
}

.permit-card.selected {
  border-color: var(--navy);
  box-shadow: inset 4px 0 0 var(--gold);
}

.permit-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.permit-id {
  font-weight: 900;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 2px;
  color: var(--navy);
  background: var(--sage);
  font-size: 12px;
  font-weight: 900;
}

.tag.approved {
  color: #285b32;
  background: #dcebd6;
}

.tag.changes {
  color: #7b4711;
  background: #f4e2bd;
}

.tag.rejected {
  color: var(--rose);
  background: #f5d9d4;
}

.feature-row {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 18px;
  align-items: center;
  margin: 18px 0 22px;
}

.feature-icon {
  display: inline-block;
  width: 74px;
  height: 74px;
  border-radius: var(--radius);
  background-image: url("./public/assets/civicport-icons.png");
  background-repeat: no-repeat;
  background-size: 200% 200%;
  background-color: transparent;
}

.feature-icon.intake {
  background-position: 0 0;
}

.feature-icon.review {
  background-position: 100% 0;
}

.feature-icon.upload {
  background-position: 0 100%;
}

.feature-icon.audit {
  background-position: 100% 100%;
}

.upload-box {
  grid-template-columns: 1fr auto;
  align-items: end;
  padding: 16px;
  background: #f8fafb;
  border: 1px solid #cbd5de;
  border-radius: var(--radius);
}

.upload-box label,
.upload-box input[type="file"] {
  min-width: 0;
  max-width: 100%;
}

.upload-box input[type="file"] {
  width: 100%;
}

.document-workspace {
  grid-template-columns: minmax(300px, 0.9fr) minmax(360px, 1.1fr);
  align-items: start;
}

.inspection-workspace {
  grid-template-columns: minmax(360px, 1fr) minmax(320px, 0.82fr);
  align-items: start;
}

.workspace-section {
  min-width: 0;
  padding: 16px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid #cbd5de;
  border-radius: var(--radius);
}

.workspace-section .document-list {
  min-width: 0;
}

.section-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  min-width: 0;
}

.section-head h3 {
  margin-bottom: 0;
}

.section-kicker {
  display: block;
  margin-bottom: 3px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.config-form {
  max-width: 720px;
}

.payment-entry-form {
  max-width: none;
  margin-top: 2px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.settings-section {
  display: grid;
  gap: 12px;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.management-grid {
  grid-template-columns: minmax(260px, 0.75fr) minmax(320px, 1fr);
  margin-bottom: 18px;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.mini-grid span,
.quiet-link {
  padding: 8px 10px;
  overflow-wrap: anywhere;
  background: #f8fafb;
  border: 1px solid #cbd5de;
  border-radius: var(--radius);
}

.document-item p,
.audit-item p,
.timeline-item p {
  margin-bottom: 0;
}

.checklist-card {
  border-left: 4px solid var(--navy);
}

.requirement-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.requirement-list span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  background: #f8fafb;
  border: 1px solid #d8e0e7;
  color: var(--ink);
  font-weight: 800;
}

.requirement-list span::before {
  content: "Needed";
  color: var(--amber);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.requirement-list span.complete::before {
  content: "Received";
  color: #285b32;
}

.requirement-list span.active::before {
  content: "Active";
  color: var(--navy);
}

.requirement-list span strong {
  color: var(--muted);
  font-size: 12px;
}

.inspection-item,
.payment-summary {
  border-left: 4px solid var(--gold);
}

.modal {
  width: min(820px, calc(100% - 28px));
  max-height: min(820px, calc(100dvh - 24px));
  padding: 0;
  overflow: auto;
  border: 1px solid #aebbc6;
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: 0 22px 54px rgba(15, 36, 54, 0.2);
  transform-origin: 50% 50%;
  will-change: opacity, transform;
}

.modal[open] {
  animation: modal-super-scaled 280ms cubic-bezier(0.2, 0.82, 0.22, 1);
}

.modal[open][data-closing="true"] {
  animation: modal-super-scaled-out 260ms cubic-bezier(0.78, 0, 0.82, 0.2) forwards;
}

.modal::backdrop {
  background: rgba(16, 35, 42, 0.46);
  backdrop-filter: blur(4px);
}

.modal[open]::backdrop {
  animation: backdrop-in 280ms ease-out;
}

.modal[open][data-closing="true"]::backdrop {
  animation: backdrop-out 260ms ease-out forwards;
}

.modal form {
  display: grid;
  gap: 0;
}

#permitModal {
  width: min(1180px, calc(100vw - 32px));
  height: min(900px, calc(100dvh - 32px));
  max-height: calc(100dvh - 32px);
}

#permitModal form {
  min-height: 100%;
  grid-template-rows: auto auto auto 1fr auto;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding: 28px 30px 18px;
  background:
    linear-gradient(135deg, rgba(21, 47, 69, 0.96), rgba(24, 56, 75, 0.92)),
    url("./public/assets/civicport-civic-map.png") center / cover;
  border-bottom: 4px solid var(--gold);
}

.modal-head h2 {
  max-width: 620px;
  margin-bottom: 10px;
  color: var(--white);
  font-size: 34px;
  line-height: 1.05;
  animation: copy-in 180ms ease-out;
}

.modal-head p {
  max-width: 560px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.78);
  animation: copy-in 220ms ease-out;
}

.icon-button {
  flex: 0 0 auto;
  width: 42px;
  padding: 0;
  color: var(--white);
  font-size: 0;
  --button-bg: #17aa56;
  --button-bg-hover: #19b85e;
  --button-shadow: #119e4d;
}

.icon-button .creative-button__icon {
  position: static;
  width: 100%;
  color: #ffffff;
}

.wizard-progress {
  position: relative;
  counter-reset: wizard;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
  padding: 18px 30px 8px;
  background: #f8fafb;
  border-bottom: 1px solid #d8e0e7;
}

.wizard-assist {
  display: grid;
  gap: 12px;
  padding: 16px 30px;
  background: #ffffff;
  border-bottom: 1px solid #d8e0e7;
}

.wizard-assist > div:first-child {
  padding-left: 12px;
  border-left: 3px solid var(--gold);
}

.wizard-assist strong {
  display: block;
  margin-bottom: 4px;
}

.wizard-assist p {
  margin-bottom: 0;
}

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

.assist-grid article {
  padding: 12px;
  background: #f8fafb;
  border: 1px solid #d8e0e7;
}

.assist-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.assist-grid ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--ink);
  line-height: 1.55;
}

.wizard-progress::before {
  content: "";
  position: absolute;
  top: 35px;
  right: 60px;
  left: 60px;
  height: 2px;
  background: #c4ced7;
}

.wizard-progress span {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 7px;
  min-height: 54px;
  padding: 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  background: transparent;
  border: 0;
  transition: color 180ms ease;
}

.wizard-progress span::before {
  counter-increment: wizard;
  content: counter(wizard);
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--muted);
  background: #f8fafb;
  border: 2px solid #c4ced7;
  border-radius: 2px;
  box-shadow: 0 0 0 6px #f8fafb;
  transition: color 180ms ease, background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.wizard-progress span.active,
.wizard-progress span.complete {
  color: var(--navy);
}

.wizard-progress span.active::before,
.wizard-progress span.complete::before {
  color: var(--white);
  background: var(--navy);
  border-color: var(--navy);
}

.wizard-progress span.active::before {
  animation: progress-pop 220ms ease-out;
}

.wizard-step {
  display: none;
}

.wizard-step.active {
  display: grid;
  gap: 16px;
  min-height: 360px;
  padding: 24px 30px 28px;
  animation: step-forward 220ms ease-out;
}

.modal[data-wizard-direction="back"] .wizard-step.active {
  animation-name: step-back;
}

.address-verify {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 16px;
  background: #f8fafb;
  border: 1px solid #c4ced7;
  border-left: 4px solid var(--gold);
}

.address-verify p,
.address-card p {
  margin-bottom: 0;
}

.address-result {
  display: grid;
  gap: 12px;
}

.address-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: #ffffff;
  border: 1px solid #c4ced7;
  border-left: 4px solid var(--amber);
}

.address-card.verified {
  border-left-color: #285b32;
}

.address-card.blocked {
  border-left-color: var(--rose);
}

.address-card.warning {
  border-left-color: var(--gold);
}

.address-card .next-step {
  margin-top: 0;
}

.eligibility-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 12px 14px 12px 32px;
  color: #6f3d12;
  background: #fff8e8;
  border: 1px solid #efd49b;
}

.parcel-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.parcel-flags span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  color: var(--muted);
  background: #f8fafb;
  border: 1px solid #cfd8df;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.parcel-flags span.ok {
  color: #285b32;
  background: #edf7ef;
  border-color: #bfd9c5;
}

.parcel-flags span.risk {
  color: #8d2d3a;
  background: #fff1f2;
  border-color: #efc0c6;
}

.address-card.blocked.warning {
  border-left-color: var(--rose);
}

.match-list {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid #d8e0e7;
}

.match-list strong {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.match-list button {
  justify-content: flex-start;
  width: 100%;
}

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

.permit-type-card {
  position: relative;
  min-height: 142px;
  padding: 18px 18px 18px 64px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #c4ced7;
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, background 160ms ease;
}

.permit-type-card::before {
  content: "";
  position: absolute;
  top: 18px;
  left: 18px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--white);
  background: var(--navy);
  border-radius: 2px;
  font-size: 17px;
  font-weight: 900;
}

.permit-type-card[data-permit-type="BUILDING"]::before {
  content: "B";
}

.permit-type-card[data-permit-type="ELECTRICAL"]::before {
  content: "E";
  background: #456a8f;
}

.permit-type-card[data-permit-type="PLUMBING"]::before {
  content: "P";
  background: #417f8d;
}

.permit-type-card[data-permit-type="ZONING"]::before {
  content: "Z";
  background: #7a6a3f;
}

.permit-type-card[data-permit-type="OCCUPANCY"]::before {
  content: "O";
  background: #8d4d55;
}

.permit-type-card:hover {
  border-color: var(--navy);
  box-shadow: inset 4px 0 0 var(--gold);
  transform: translateY(-1px);
}

.permit-type-card input {
  position: absolute;
  inset: 18px 18px auto auto;
  width: 22px;
  min-height: 22px;
  accent-color: var(--navy);
}

.permit-type-card span {
  display: block;
  padding-right: 34px;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.15;
}

.permit-type-card small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.permit-type-card:has(input:checked) {
  background: linear-gradient(180deg, #f8fafb, #ffffff);
  border-color: var(--navy);
  box-shadow: inset 4px 0 0 var(--gold), 0 12px 28px rgba(15, 36, 54, 0.08);
  animation: selected-card 180ms ease-out;
}

.permit-type-card:has(input:focus-visible) {
  outline: 3px solid rgba(184, 135, 47, 0.28);
  outline-offset: 2px;
}

.review-card {
  display: grid;
  gap: 14px;
}

.review-summary {
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(248, 250, 251, 0.98), rgba(255, 255, 255, 0.94)),
    url("./public/assets/civicport-workflow.png") right center / auto 100% no-repeat;
  border: 1px solid #c4ced7;
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  animation: review-in 240ms ease-out;
}

.review-summary strong {
  display: block;
  margin-top: 12px;
  font-size: 22px;
}

.review-summary p {
  margin-bottom: 0;
}

.review-list {
  margin: 10px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.7;
}

.confirmation-modal {
  width: min(620px, calc(100% - 28px));
}

.confirmation-content {
  display: grid;
  gap: 14px;
  padding: 28px 30px 8px;
}

.inspection-modal {
  width: min(720px, calc(100% - 28px));
  overflow: visible;
}

.review-decision-modal {
  width: min(860px, calc(100% - 28px));
  max-height: min(920px, calc(100dvh - 24px));
  overflow: hidden;
}

.review-decision-modal .modal-form {
  width: 100%;
  max-width: none;
  max-height: inherit;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.review-decision-modal .modal-content {
  width: 100%;
  min-width: 0;
  overflow: auto;
  padding-bottom: 18px;
}

.review-decision-modal .modal-head > div {
  min-width: 0;
}

.review-decision-modal .modal-head h2,
.review-decision-modal .modal-head p {
  overflow-wrap: anywhere;
}

.modal-form {
  display: grid;
  min-height: 0;
}

.modal-content {
  display: grid;
  gap: 20px;
  padding: 26px 30px 8px;
  overflow: visible;
}

.compact-head {
  min-height: auto;
  padding: 26px 30px;
}

.inspection-modal .input,
.inspection-modal .cs-select {
  z-index: 20;
}

.inspection-modal .input:focus-within,
.inspection-modal .cs-select.cs-active,
.inspection-modal .cs-select:focus,
.inspection-modal .cs-select:focus-within {
  z-index: 80;
}

.modal .modal-actions {
  position: sticky;
  bottom: 0;
  justify-content: flex-end;
  padding: 16px 30px;
  background: rgba(248, 250, 251, 0.96);
  border-top: 1px solid #c4ced7;
  backdrop-filter: blur(10px);
}

.modal .primary,
.modal .secondary {
  min-width: 116px;
}

.review-decision-modal .modal-actions.review-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
  width: 100%;
}

.review-decision-modal .review-actions button {
  width: 100%;
  min-height: 48px;
  justify-self: stretch;
}

.review-decision-modal .review-decision-summary .detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

input:not(.input__field),
select:not(.input__field),
textarea:not(.input__field) {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid #b9c5ce;
  border-radius: var(--radius);
}

select:not(.input__field) {
  padding-right: 38px;
  cursor: pointer;
  appearance: auto;
}

input:not(.input__field):focus,
select:not(.input__field):focus,
textarea:not(.input__field):focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(184, 135, 47, 0.22);
  outline: 0;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

.ichiro-enhanced-label {
  display: block;
  position: relative;
  z-index: 1;
}

.input {
  position: relative;
  z-index: 1;
  display: inline-block;
  width: 100%;
  min-height: 56px;
  vertical-align: top;
}

.input--ichiro {
  margin-top: 16px;
}

.input__field {
  position: relative;
  display: block;
  width: 100%;
  border: 0;
  border-radius: 0;
  font: inherit;
  font-weight: 800;
  -webkit-appearance: none;
  appearance: none;
}

.input__field:focus {
  outline: 0;
}

.input__field--ichiro {
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: 2;
  display: block;
  width: calc(100% - 8px);
  height: calc(100% - 8px);
  min-height: 0;
  padding: 0 12px;
  color: var(--ink);
  background: #f8fafb;
  opacity: 0;
  transform: scale3d(1, 0, 1);
  transform-origin: 50% 100%;
  transition: opacity 0.3s, transform 0.3s;
}

select.input__field--ichiro {
  cursor: pointer;
}

.input--select {
  min-height: 64px;
}

.input--select .input__field--ichiro {
  top: 24px;
  height: calc(100% - 28px);
  min-height: 34px;
  padding: 0 38px 6px 12px;
  background: transparent;
  border: 0;
  opacity: 1;
  transform: none;
  appearance: auto;
}

.input--select .input__label--ichiro {
  pointer-events: none;
}

.input--select .input__label--ichiro::before {
  transform: none;
}

.input--select .input__label-content--ichiro,
.input--select.input--filled .input__label-content--ichiro,
.input--select .input__field--ichiro:focus + .input__label--ichiro .input__label-content--ichiro {
  padding: 9px 14px 0;
  color: var(--navy);
  transform: none;
}

.input--select.input--filled .input__label--ichiro::before,
.input--select .input__field--ichiro:focus + .input__label--ichiro::before {
  transform: none;
}

textarea.input__field--ichiro {
  min-height: calc(100% - 8px);
  padding-top: 12px;
  line-height: 1.45;
  resize: vertical;
}

.input__label--ichiro {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  color: #4f5e6b;
  font-size: 13px;
  font-weight: 900;
  text-align: left;
  cursor: text;
  user-select: none;
}

.input__label--ichiro::before {
  position: absolute;
  inset: 0;
  content: "";
  background: #ffffff;
  border: 1px solid #b9c5ce;
  border-left: 4px solid var(--gold);
  transform-origin: 50% 100%;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}

.input__label-content--ichiro {
  position: relative;
  display: block;
  width: 100%;
  padding: 19px 14px;
  transform-origin: 0% 50%;
  transition: color 0.3s, transform 0.3s;
}

.input__field--ichiro:focus,
.input--filled .input__field--ichiro {
  opacity: 1;
  transform: scale3d(1, 1, 1);
}

.input__field--ichiro:focus + .input__label--ichiro,
.input--filled .input__label--ichiro {
  cursor: default;
  pointer-events: none;
}

.input__field--ichiro:focus + .input__label--ichiro::before,
.input--filled .input__label--ichiro::before {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(184, 135, 47, 0.18);
  transform: scale3d(1, 1.42, 1);
}

.input__field--ichiro:focus + .input__label--ichiro .input__label-content--ichiro,
.input--filled .input__label-content--ichiro {
  color: var(--navy);
  transform: translate3d(0, -42px, 0) scale3d(0.82, 0.82, 1);
}

.wizard-step .input:has(textarea),
.config-form .input:has(textarea) {
  min-height: 128px;
}

.review-decision-modal .input:has(textarea) {
  min-height: 136px;
  margin-top: 8px;
}

.review-decision-modal .input:has(textarea) .input__label--ichiro::before,
.review-decision-modal .input:has(textarea) .input__field--ichiro:focus + .input__label--ichiro::before,
.review-decision-modal .input:has(textarea).input--filled .input__label--ichiro::before {
  transform: none;
}

.review-decision-modal .input:has(textarea) .input__field--ichiro {
  padding-top: 18px;
  resize: none;
}

.cs-native-select {
  display: none !important;
}

.cs-select {
  position: relative;
  z-index: 4;
  width: 100%;
  min-height: 44px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  text-align: left;
  user-select: none;
}

.role-select + .cs-select {
  width: 132px;
  min-width: 132px;
}

.filter-label .cs-select {
  min-height: 38px;
}

.input--ichiro .cs-select {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(100% - 8px);
  height: calc(100% - 8px);
}

.ichiro-enhanced-label:has(.cs-active),
.ichiro-enhanced-label.select-open,
.input:has(.cs-active),
.input.select-open {
  z-index: 1000;
}

.input--ichiro:has(.cs-select) .input__label--ichiro::before {
  background: transparent;
  border: 0;
  box-shadow: none;
}

.input--ichiro:has(.cs-select) .input__label-content--ichiro {
  display: none;
}

.cs-select:focus {
  outline: 0;
}

.cs-placeholder {
  position: relative;
  display: flex;
  align-items: center;
  min-height: inherit;
  padding: 0 42px 0 13px;
  overflow: hidden;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid #b9c5ce;
  border-left: 4px solid var(--gold);
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 180ms ease, box-shadow 180ms ease, color 180ms ease;
}

.cs-placeholder::after {
  position: absolute;
  top: 50%;
  right: 14px;
  width: 9px;
  height: 9px;
  content: "";
  border-right: 2px solid var(--button-icon, #0a833d);
  border-bottom: 2px solid var(--button-icon, #0a833d);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 180ms ease;
}

.cs-select.cs-active .cs-placeholder,
.cs-select:focus .cs-placeholder,
.cs-select:focus-within .cs-placeholder {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(184, 135, 47, 0.18);
}

.cs-select.cs-active {
  z-index: 1001;
}

.cs-select.cs-active .cs-placeholder::after,
.cs-select:focus .cs-placeholder::after,
.cs-select:focus-within .cs-placeholder::after {
  transform: translateY(-25%) rotate(225deg);
}

.cs-options {
  position: absolute;
  top: var(--cs-options-top, calc(100% + 6px));
  left: var(--cs-options-left, 0);
  z-index: 100000;
  width: max(var(--cs-options-width, 100%), 176px);
  max-height: var(--cs-options-max-height, 240px);
  overflow: auto;
  visibility: hidden;
  background: #ffffff;
  border: 1px solid #b9c5ce;
  box-shadow: 0 18px 38px rgba(15, 36, 54, 0.16);
  opacity: 0;
  transform: translateY(-8px) scale3d(0.98, 0.98, 1);
  transform-origin: 50% 0;
  transition: opacity 180ms ease, transform 180ms ease, visibility 0s 180ms;
}

.cs-options li {
  white-space: nowrap;
}

body > .cs-options {
  position: fixed;
}

.cs-select.cs-active .cs-options,
.cs-select:focus .cs-options,
.cs-select:focus-within .cs-options,
.cs-options.cs-options-active {
  visibility: visible;
  opacity: 1;
  transform: translateY(0) scale3d(1, 1, 1);
  transition: opacity 180ms ease, transform 180ms ease;
}

.cs-options ul {
  margin: 0;
  padding: 6px;
  list-style: none;
}

.cs-options li {
  position: relative;
  display: block;
  padding: 10px 34px 10px 12px;
  color: #23303b;
  cursor: pointer;
  transition: color 140ms ease, background 140ms ease, transform 140ms ease;
}

.cs-options li:hover,
.cs-options li.cs-selected {
  color: #ffffff;
  background: #17aa56;
}

.cs-options li.cs-selected::after {
  position: absolute;
  top: 50%;
  right: 12px;
  content: "";
  width: 9px;
  height: 14px;
  border-right: 3px solid #ffffff;
  border-bottom: 3px solid #ffffff;
  transform: translateY(-60%) rotate(45deg);
}

.topbar {
  background: rgba(255, 255, 255, 0.9);
  border-bottom-color: #0f3b2d;
  box-shadow: 0 8px 24px rgba(10, 64, 40, 0.08);
}

.login-gate,
.workbench,
.modal,
.document-item,
.permit-card,
.metric-card,
.task-panel,
.feature-card,
.report-card,
.audit-item,
.timeline-item,
.selected-detail,
.review-summary,
.address-card {
  border-color: #b8d8c6;
  border-radius: 7px;
  box-shadow: 0 10px 0 rgba(17, 158, 77, 0.08), 0 18px 42px rgba(10, 64, 40, 0.1);
}

.workbench,
.login-gate {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.98), rgba(247, 253, 250, 0.96) 58%, rgba(231, 247, 238, 0.9)),
    url("./public/assets/civicport-civic-map.png") center / cover;
}

.sidebar {
  background: linear-gradient(180deg, #0f3b2d, #09271f);
}

.section-kicker,
.workspace-kicker,
.side-title {
  color: #0f7f42;
}

.sidebar .side-title {
  color: rgba(226, 247, 235, 0.72);
}

.panel-head,
.queue-head,
.card-head,
.selected-detail,
.task-panel,
.feature-card,
.document-item,
.audit-item,
.timeline-item {
  border-color: #b8d8c6;
}

.metric-card,
.document-item,
.audit-item,
.timeline-item,
.selected-detail,
.task-panel,
.feature-card,
.report-card {
  background: rgba(255, 255, 255, 0.94);
}

.tag,
.status-tag {
  color: #0c5d32;
  background: #dff6e9;
  border-color: #b7e5ca;
}

.tag.approved,
.status-tag.approved {
  color: #ffffff;
  background: #17aa56;
  border-color: #119e4d;
}

.tag.changes,
.status-tag.changes {
  color: #4d3510;
  background: #ffe6af;
  border-color: #d49a2f;
}

.tag.rejected,
.status-tag.rejected {
  color: #ffffff;
  background: #b7475d;
  border-color: #9f394d;
}

.modal {
  background: #f7fbf8;
  border-top: 6px solid #17aa56;
}

.modal-head {
  background:
    linear-gradient(135deg, rgba(15, 59, 45, 0.96), rgba(23, 170, 86, 0.82)),
    url("./public/assets/civicport-workflow.png") right center / auto 120% no-repeat;
  border-bottom-color: #17aa56;
}

.modal .modal-actions {
  background: rgba(240, 250, 244, 0.97);
  border-top-color: #b8d8c6;
}

.wizard-assist {
  background: #f3fbf6;
  border-color: #b8d8c6;
  border-left-color: #17aa56;
}

.wizard-progress::before {
  background: #b8d8c6;
}

.wizard-progress span::before {
  color: #52665c;
  background: #ffffff;
  border-color: #b8d8c6;
}

.wizard-progress span.active,
.wizard-progress span.complete {
  color: #0f3b2d;
}

.wizard-progress span.active::before,
.wizard-progress span.complete::before {
  color: #ffffff;
  background: #17aa56;
  border-color: #119e4d;
  box-shadow: 0 5px #119e4d;
}

.permit-type-card {
  background: #ffffff;
  border-color: #b8d8c6;
  box-shadow: 0 5px 0 rgba(17, 158, 77, 0.08);
}

.permit-type-card::before {
  background: #17aa56;
  box-shadow: 0 4px #119e4d;
}

.permit-type-card:hover {
  border-color: #17aa56;
  box-shadow: inset 4px 0 0 #17aa56, 0 8px 0 rgba(17, 158, 77, 0.1);
}

.permit-type-card:has(input:checked) {
  background: linear-gradient(180deg, #f3fbf6, #ffffff);
  border-color: #17aa56;
  box-shadow: inset 4px 0 0 #17aa56, 0 10px 0 rgba(17, 158, 77, 0.12);
}

.permit-type-card input {
  accent-color: #17aa56;
}

.permit-card.selected {
  border-color: #17aa56;
  box-shadow: inset 4px 0 0 #17aa56, 0 8px 0 rgba(17, 158, 77, 0.1);
}

.input__label--ichiro::before,
.cs-placeholder {
  border-left-color: #17aa56;
}

.input__field--ichiro:focus + .input__label--ichiro::before,
.input--filled .input__label--ichiro::before,
.cs-select.cs-active .cs-placeholder,
.cs-select:focus .cs-placeholder,
.cs-select:focus-within .cs-placeholder {
  border-color: #17aa56;
  box-shadow: 0 0 0 3px rgba(23, 170, 86, 0.18);
}

.input__field--ichiro:focus + .input__label--ichiro .input__label-content--ichiro,
.input--filled .input__label-content--ichiro {
  color: #0f7f42;
}

.toast {
  background: #0f3b2d;
  box-shadow: 0 5px #119e4d, var(--shadow);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 12px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 20;
  max-width: min(360px, calc(100vw - 36px));
  padding: 14px 16px;
  color: var(--white);
  background: var(--navy);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  visibility: hidden;
  transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

@keyframes modal-super-scaled {
  from {
    opacity: 0;
    transform: scale(2);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes modal-super-scaled-out {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(2);
  }
}

@keyframes backdrop-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes backdrop-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes copy-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes step-forward {
  from {
    opacity: 0;
    transform: translateX(18px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes step-back {
  from {
    opacity: 0;
    transform: translateX(-18px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes progress-pop {
  0% {
    transform: scale(0.86);
  }
  70% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes selected-card {
  0% {
    transform: scale(0.985);
  }
  70% {
    transform: scale(1.012);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes review-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

  .modal[open],
  .modal[open]::backdrop {
    animation: none !important;
  }
}

@media (max-width: 960px) {
  .login-gate {
    grid-template-columns: 1fr;
    align-items: start;
  }

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

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

  .sidebar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .side-title {
    display: none;
  }

  .side-link {
    width: auto;
    white-space: nowrap;
    flex: 0 0 auto;
  }

}

@media (max-width: 720px) {
  .topbar {
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
  }

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

  .role-select {
    width: min(132px, 38vw);
  }

  .login-gate {
    width: calc(100% - 20px);
    min-height: calc(100dvh - 83px);
    padding: 24px;
  }

  .login-copy h1 {
    font-size: 48px;
  }

  .upload-box,
  .management-grid,
  .document-workspace,
  .inspection-workspace,
  .staff-workbench,
  .staff-metrics,
  .assist-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

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

  .wizard-progress {
    grid-template-columns: repeat(6, minmax(76px, 1fr));
    overflow-x: auto;
    padding-right: 18px;
    padding-left: 18px;
  }

  .wizard-progress::before {
    right: 46px;
    left: 46px;
  }

  .modal-actions > * {
    width: 100%;
  }

  .stat-grid,
  .form-grid,
  .detail-grid,
  .record-grid {
    grid-template-columns: 1fr;
  }

  .queue-head {
    display: grid;
  }

  .filter-label {
    width: 100%;
  }

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

  h1 {
    font-size: 42px;
  }
}

@media (max-width: 430px) {
  .topbar {
    gap: 8px;
  }

  .brand {
    gap: 0;
  }

  .brand span:last-child {
    display: none;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .role-select {
    width: 112px;
    min-height: 38px;
    padding: 6px 8px;
    font-size: 13px;
  }

  .nav-cta {
    min-height: 38px;
    padding: 0 12px;
    font-size: 13px;
  }

  .workbench {
    width: 100%;
    margin: 0;
  }

  .workbench {
    min-height: calc(100dvh - 59px);
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .sidebar {
    padding: 8px 10px;
    gap: 6px;
  }

  .side-link {
    min-height: 36px;
    padding: 0 10px;
    font-size: 13px;
  }

  .workspace {
    padding: 14px 12px 20px;
  }

  .section-kicker {
    font-size: 11px;
  }

  h1 {
    font-size: 30px;
  }

  h2 {
    font-size: 26px;
  }

  h3 {
    font-size: 18px;
  }

  .stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 12px 0;
  }

  .stat {
    min-width: 0;
    padding: 10px;
  }

  .stat span {
    font-size: 11px;
  }

  .stat strong {
    font-size: 26px;
  }

  .split {
    gap: 14px;
  }

  .permit-card,
  .selected-detail,
  .ops-card,
  .audit-item,
  .timeline-item,
  .document-item {
    padding: 12px;
  }

  .permit-card-top {
    align-items: flex-start;
  }

  .tag {
    min-height: 24px;
    padding: 0 8px;
    font-size: 11px;
  }

  .ops-card {
    display: none;
  }

  .feature-row {
    gap: 10px;
    margin: 12px 0;
  }

  .feature-icon {
    width: 56px;
    height: 56px;
  }

  .modal {
    width: calc(100% - 16px);
    max-height: calc(100dvh - 16px);
  }

  #permitModal {
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .modal-head {
    padding: 20px 18px 16px;
  }

  .wizard-assist,
  .wizard-step.active {
    padding-right: 18px;
    padding-left: 18px;
  }

  .modal h2 {
    font-size: 28px;
  }

  .modal form {
    gap: 10px;
  }

  .wizard-progress span {
    min-height: 32px;
    padding: 6px 8px;
    font-size: 11px;
  }

  .wizard-progress span::before {
    width: 28px;
    height: 28px;
  }

  .permit-type-card {
    min-height: 112px;
    padding: 14px 14px 14px 56px;
  }

  .permit-type-card::before {
    top: 14px;
    left: 14px;
    width: 30px;
    height: 30px;
  }

  .permit-type-card input {
    inset: 14px 14px auto auto;
  }

  .modal .modal-actions {
    padding: 12px 18px;
  }

  .review-decision-modal .modal-actions.review-actions,
  .review-decision-modal .review-decision-summary .detail-grid {
    grid-template-columns: 1fr;
  }

  .review-actions {
    display: grid;
  }

  .address-verify {
    display: grid;
  }

  input:not(.input__field),
  select:not(.input__field),
  textarea:not(.input__field) {
    min-height: 40px;
  }

  textarea {
    min-height: 96px;
  }
}
