/* ==========================================================================
   IEC Customer Portal — Core Stylesheet
   WCAG-AA tokens tuned for outdoor jobsite legibility & B2B operations.
   ========================================================================== */

@font-face {
  font-family: 'Section';
  font-style: normal;
  font-weight: 1 349;
  font-display: swap;
  src: url('../fonts/section-light.woff2') format('woff2');
}

@font-face {
  font-family: 'Section';
  font-style: normal;
  font-weight: 350 649;
  font-display: swap;
  src: url('../fonts/section-medium.woff2') format('woff2');
}

@font-face {
  font-family: 'Section';
  font-style: normal;
  font-weight: 650 749;
  font-display: swap;
  src: url('../fonts/section-bold.woff2') format('woff2');
}

@font-face {
  font-family: 'Section';
  font-style: normal;
  font-weight: 750 1000;
  font-display: swap;
  src: url('../fonts/section-black.woff2') format('woff2');
}

:root {
  /* Brand */
  --navy: #002C4E;
  --blue: #00568C;
  --blue-dark: #003A60;
  --red: #EF3340;
  --btn-red: #D42230;
  --red-dark: #B71C28;

  /* Neutrals (WCAG AA) */
  --bg: #f4f6f7;
  --card: #ffffff;
  --ink: #16242c;
  --muted: #46555f;
  --muted2: #54646f;
  --line: #dce2e6;
  --soft: #edf1f4;
  --input-bd: #adb9c2;

  /* Semantic */
  --green: #1d6f3c;
  --green-bg: #e9f5ed;
  --amber: #8a5a00;
  --amber-bg: #fff4db;
  --danger-bg: #fff0f1;

  /* Type & Radii */
  --sans: 'Section', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --shadow: 0 16px 45px rgba(0, 44, 78, 0.08);
  --shadow-sm: 0 1px 3px rgba(0, 44, 78, 0.04);
  --wrap: 1180px;
}

/* --- Base & Accessibility ------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  height: 100%;
}

[hidden] {
  display: none !important;
}

body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-y: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid rgba(0, 86, 140, 0.5);
  outline-offset: 2px;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 300;
  padding: 10px 16px;
  border-radius: var(--r-sm);
  background: var(--navy);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.skip-link:focus {
  left: 12px;
}

.tnum {
  font-variant-numeric: tabular-nums;
}

.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.inline-link {
  color: var(--blue);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.inline-link:hover {
  color: var(--blue-dark);
}

/* --- Shell & Scroll Layout ------------------------------------------------ */

body.portal-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.portal-wrap {
  width: min(var(--wrap), calc(100% - 48px));
  margin: 0 auto;
}

.portal-scroll {
  flex: 1 1 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overflow-anchor: none;
  overscroll-behavior-y: contain;
  scrollbar-gutter: stable;
}

.portal-scroll::-webkit-scrollbar {
  width: 10px;
}

.portal-scroll::-webkit-scrollbar-track {
  background: #edf2f5;
}

.portal-scroll::-webkit-scrollbar-thumb {
  border: 2px solid #edf2f5;
  border-radius: 999px;
  background: #9aaab5;
}

.portal-scroll {
  scrollbar-color: #9aaab5 #edf2f5;
  scrollbar-width: thin;
}

.portal-main {
  position: relative;
  min-height: calc(100% - 60px);
  padding: 28px 0 56px;
  transition: opacity 0.15s ease;
}

.portal-main:focus:not(:focus-visible),
.portal-main h1:focus:not(:focus-visible) {
  outline: none;
}

.portal-main[aria-busy="true"] {
  opacity: 0.62;
  pointer-events: none;
}

.portal-main[aria-busy="true"]::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--blue) 35%,
    var(--red) 65%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: portal-progress 1.1s linear infinite;
}

@keyframes portal-progress {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

.portal-footer {
  border-top: 1px solid var(--line);
  background: #fff;
  color: var(--muted2);
  font-size: 13px;
}

.portal-footer .portal-wrap {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.portal-footer__links {
  display: flex;
  align-items: center;
  gap: 18px;
}

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

.portal-footer a:hover {
  text-decoration: underline;
}

/* --- Typography & Page Headers -------------------------------------------- */

.eyebrow,
.kicker {
  display: block;
  color: var(--red);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.page-heading h1 {
  margin: 6px 0 6px;
  color: var(--navy);
  font-size: 28px;
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.015em;
}

.page-heading p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.account-code {
  flex: 0 0 auto;
  padding: 7px 12px;
  border-radius: var(--r-sm);
  background: var(--navy);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

/* --- Cards & Panels ------------------------------------------------------- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

.panel {
  padding: 24px 26px;
  margin-bottom: 20px;
}

.panel--muted {
  opacity: 0.65;
}

.panel__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel__heading h2 {
  margin: 4px 0 0;
  color: var(--navy);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.22;
}

.panel__heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.panel__heading > a {
  flex: 0 0 auto;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.panel__heading > a:hover {
  text-decoration: underline;
}

/* --- Buttons -------------------------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

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

.button--primary:hover:not(:disabled) {
  background: var(--blue-dark);
}

.button--secondary {
  background: #fff;
  border-color: var(--input-bd);
  color: var(--navy);
}

.button--secondary:hover:not(:disabled) {
  border-color: var(--blue);
  background: #f2f7fa;
  color: var(--blue);
}

.button--danger {
  background: var(--btn-red);
  color: #fff;
}

.button--danger:hover:not(:disabled) {
  background: var(--red-dark);
}

.button--danger-outline {
  background: #fff;
  border-color: #e4aeb3;
  color: var(--red-dark);
}

.button--danger-outline:hover:not(:disabled) {
  border-color: var(--btn-red);
  background: #fff4f5;
}

.button--small {
  min-height: 36px;
  padding: 7px 13px;
  border-radius: var(--r-sm);
  font-size: 13px;
}

.button--xs {
  min-height: 30px;
  padding: 5px 10px;
  border-radius: var(--r-sm);
  font-size: 12px;
}

.button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.2);
  opacity: 0.45;
}

.link-button {
  border: 0;
  background: none;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  padding: 4px 6px;
  border-radius: var(--r-sm);
}

.link-button:hover {
  background: #eef5f9;
  color: var(--blue-dark);
}

/* --- Status Pills & Chips ------------------------------------------------- */

.status-pill {
  display: inline-flex;
  align-items: center;
  width: max-content;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.status-pill--active,
.status-pill--approved,
.status-pill--completed,
.status-pill--promised,
.status-pill--signed,
.status-pill--resolved {
  background: var(--green-bg);
  color: var(--green);
}

.status-pill--pending,
.status-pill--pending_review,
.status-pill--pending_signature,
.status-pill--submitted,
.status-pill--draft,
.status-pill--waiting_parts,
.status-pill--in_progress,
.status-pill--scheduled,
.status-pill--open,
.status-pill--new {
  background: var(--amber-bg);
  color: var(--amber);
}

.status-pill--rejected,
.status-pill--cancelled,
.status-pill--declined,
.status-pill--voided,
.status-pill--machine_down,
.status-pill--urgent {
  background: #ffeaec;
  color: var(--red-dark);
}

.status-dot {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-dot--on_file {
  color: var(--green);
}

.status-dot--missing,
.status-dot--expired {
  color: var(--red-dark);
}

.status-dot--expiring_soon {
  color: var(--amber);
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.meta-chip--blue {
  background: #e8f2f8;
  color: var(--blue);
}

/* --- Toasts --------------------------------------------------------------- */

.toast-region {
  position: fixed;
  z-index: 120;
  top: 20px;
  right: 24px;
  display: grid;
  gap: 10px;
  width: min(400px, calc(100vw - 32px));
  pointer-events: none;
}

.portal-shell--focused .toast-region {
  top: 90px;
}

.toast {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 15px 13px 16px;
  border: 1px solid;
  border-left-width: 4px;
  border-radius: var(--r-md);
  background: #fff;
  box-shadow: 0 14px 36px rgba(0, 44, 78, 0.16);
  font-size: 14px;
  line-height: 1.4;
  pointer-events: auto;
  animation: toast-enter 0.2s ease-out;
}

.toast--success {
  border-color: #91cba4;
  border-left-color: var(--green);
  color: #16552e;
}

.toast--error {
  border-color: #efb1b6;
  border-left-color: var(--btn-red);
  color: #8f1d27;
}

.toast button {
  flex: 0 0 auto;
  margin: -4px -4px 0 0;
  padding: 2px 6px;
  border: 0;
  background: transparent;
  color: currentColor;
  font-size: 22px;
  line-height: 1;
  opacity: 0.7;
}

.toast button:hover {
  opacity: 1;
}

.toast.is-leaving {
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

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

/* --- Dashboard: Triage, KPIs, Quick Actions & Panels ---------------------- */

.triage-strip {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}

.triage-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: var(--r-md);
  background: #fff;
}

.triage-alert--danger {
  border-color: #f0bcc1;
  border-left-color: var(--btn-red);
  background: #fff8f8;
}

.triage-alert--warning {
  border-color: #e9cf8b;
  border-left-color: var(--amber);
  background: #fffdf5;
}

.triage-alert--info {
  border-color: #b7d2e4;
  border-left-color: var(--blue);
  background: #f5fafe;
}

.triage-alert__copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.triage-alert__copy strong {
  color: var(--navy);
  font-size: 14px;
  font-weight: 800;
}

.triage-alert__copy span {
  color: var(--muted);
  font-size: 13px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.metric-card {
  display: flex;
  flex-direction: column;
  min-height: 132px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.metric-card:hover {
  border-color: #a9c3d4;
  box-shadow: 0 8px 22px rgba(0, 44, 78, 0.08);
  transform: translateY(-1px);
}

.metric-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metric-card__icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--blue);
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.metric-card strong {
  margin: 12px 0 auto;
  color: var(--navy);
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
}

.metric-card__status {
  font-size: 20px !important;
}

.metric-card--ok strong {
  color: var(--green);
}

.metric-card--warn {
  border-color: #e6c677;
  background: #fffdf7;
}

.metric-card--warn strong {
  color: var(--amber);
}

.metric-card small {
  margin-top: 10px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

.content-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 20px;
  align-items: start;
}

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

.fleet-overview {
  display: grid;
  gap: 14px;
}

.fleet-overview__group {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  background: #fbfcfd;
}

.fleet-overview__job {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--soft);
  font-size: 13px;
}

.fleet-overview__job strong {
  color: var(--navy);
}

.fleet-overview__job span {
  color: var(--muted2);
  font-size: 12px;
  font-weight: 700;
}

.fleet-overview__group .data-list {
  padding: 0 14px;
  background: #fff;
}

.data-row--fleet {
  padding: 11px 0;
}

.fleet-overview__unit-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

.fleet-overview__model {
  color: var(--ink) !important;
  font-size: 14px !important;
  font-weight: 600;
}

.fleet-overview__right {
  display: flex;
  flex-direction: row !important;
  align-items: center;
  gap: 10px !important;
}

.activity-row__head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.activity-row__head a:hover {
  color: var(--blue);
  text-decoration: underline;
}

.activity-kind {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: var(--r-sm);
  background: var(--soft);
  color: var(--navy);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.activity-kind--service {
  background: #e6f2fa;
  color: var(--blue-dark);
}

.activity-kind--calloff {
  background: #ffecee;
  color: var(--red-dark);
}

.activity-kind--payment {
  background: var(--green-bg);
  color: var(--green);
}

/* --- Data Lists ----------------------------------------------------------- */

.data-list {
  display: flex;
  flex-direction: column;
}

.data-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.data-row:first-child {
  border-top: 0;
}

.data-row > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.data-row span {
  color: var(--muted);
  font-size: 13px;
}

.align-right {
  text-align: right;
  align-items: flex-end;
  flex: 0 0 auto;
}

.empty-inline {
  padding: 16px 0;
  color: var(--muted);
  font-size: 14px;
}

/* --- Forms ---------------------------------------------------------------- */

.form-stack-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-context-note {
  margin: 0;
  padding: 12px 15px;
  border: 1px solid #c5dbe8;
  border-radius: var(--r-md);
  background: #f2f8fc;
  color: var(--navy);
  font-size: 13px;
  line-height: 1.45;
}

.form-section {
  min-width: 0;
  margin: 0;
  padding: 20px 22px 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #f8fafb;
}

.form-section > legend {
  padding: 0 8px;
  color: var(--navy);
  font-size: 17px;
  font-weight: 800;
}

.form-section > legend small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

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

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

.form-grid--spacer {
  margin-top: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: #2d404c;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
}

.field--wide {
  grid-column: span 2;
}

.field-label {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  min-height: 18px;
}

.field small,
.field-label small {
  color: var(--muted2);
  font-size: 12px;
  font-weight: 400;
}

.field input,
.field select,
.field textarea,
.amount-input {
  width: 100%;
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid var(--input-bd);
  border-radius: var(--r-md);
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  outline: none;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.field textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.45;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.amount-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 86, 140, 0.14);
}

.field input[readonly] {
  background: #eef3f6;
  color: var(--muted);
  cursor: not-allowed;
}

.field-reset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.field-reset legend {
  padding: 0;
}

.field-error {
  margin-top: -2px;
  color: var(--red-dark);
  font-size: 12px;
  font-weight: 700;
}

.check-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}

.check-field input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin-top: 2px;
  accent-color: var(--blue);
}

.self-gc-check {
  margin-bottom: 16px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #fff;
}

.form-actions {
  display: flex;
  justify-content: flex-start;
  gap: 12px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.form-actions .button {
  min-width: 170px;
}

.form-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.stack-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.section-help {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

/* --- Choice Strips & Switch Toggles --------------------------------------- */

.choice-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-height: 44px;
  padding: 3px;
  border: 1px solid var(--input-bd);
  border-radius: var(--r-md);
  background: #fff;
  gap: 3px;
}

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

.choice-strip--four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.choice-strip label {
  position: relative;
  display: flex;
  min-width: 0;
}

.choice-strip input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 1px;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.choice-strip span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 7px 8px;
  border-radius: var(--r-sm);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}

.choice-strip label:hover span {
  color: var(--blue);
  background: #f2f7fa;
}

.choice-strip input:checked + span {
  background: var(--navy);
  color: #fff;
}

.choice-strip label:hover input:checked + span {
  color: #fff;
  background: var(--navy);
}

.choice-strip__danger input:checked + span,
.choice-strip__danger:hover input:checked + span {
  background: var(--btn-red);
  color: #fff;
}

.choice-strip input:focus-visible + span {
  outline: 3px solid rgba(0, 86, 140, 0.25);
  outline-offset: 1px;
}

.toggle-field {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 13px;
  cursor: pointer;
}

.toggle-field > input {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
}

.toggle-field__control {
  position: relative;
  width: 44px;
  height: 25px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #b9c6cd;
  transition: background 0.18s ease;
}

.toggle-field__control::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 44, 78, 0.25);
  transition: transform 0.18s ease;
}

.toggle-field > input:checked + .toggle-field__control {
  background: var(--blue);
}

.toggle-field > input:checked + .toggle-field__control::after {
  transform: translateX(19px);
}

.toggle-field > input:focus-visible + .toggle-field__control {
  outline: 3px solid rgba(0, 86, 140, 0.25);
  outline-offset: 2px;
}

.toggle-field > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--ink);
  font-size: 14px;
}

.toggle-field small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.bond-fields {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

/* --- Secret Inputs -------------------------------------------------------- */

.secret-input {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.secret-input input {
  padding-right: 74px;
}

.secret-input__toggle {
  position: absolute;
  right: 7px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #f5f8fa;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.secret-input__toggle:hover:not(:disabled) {
  border-color: var(--blue);
  background: #eaf3f8;
}

.secret-input__toggle:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* --- Service Tickets, Emergency Dispatch & Stepper ------------------------ */

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

.service-ticket-list {
  display: grid;
  gap: 10px;
}

.service-ticket-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.service-ticket-row:hover {
  border-color: var(--blue);
  background: #f8fbfd;
  box-shadow: 0 4px 12px rgba(0, 44, 78, 0.06);
}

.service-ticket-row__copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.service-ticket-row__badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.service-ticket-row__copy strong {
  color: var(--navy);
  font-size: 15px;
  font-weight: 800;
}

.service-ticket-row__meta {
  color: var(--muted);
  font-size: 13px;
}

.service-ticket-row__right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.service-ticket-row__arrow {
  color: var(--blue);
  font-weight: 800;
}

.emergency-dispatch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding: 15px 18px;
  border: 1px solid #ebb0b5;
  border-left: 4px solid var(--btn-red);
  border-radius: var(--r-md);
  background: #fff4f5;
}

.emergency-dispatch__copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.emergency-dispatch__copy strong {
  color: var(--red-dark);
  font-size: 14px;
}

.emergency-dispatch__copy span {
  color: #5b2b30;
  font-size: 13px;
}

.emergency-dispatch__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.service-stepper {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 22px;
  padding: 16px;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #f8fafb;
}

.service-stepper__step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  text-align: center;
}

.service-stepper__dot {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #c3d0d9;
  background: #fff;
  color: var(--muted2);
  font-size: 12px;
  font-weight: 800;
}

.service-stepper__label {
  color: var(--muted2);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.service-stepper__step.is-complete .service-stepper__dot {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.service-stepper__step.is-complete .service-stepper__label {
  color: var(--green);
}

.service-stepper__step.is-current .service-stepper__dot {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(0, 86, 140, 0.16);
}

.service-stepper__step.is-current .service-stepper__label {
  color: var(--navy);
  font-weight: 800;
}

.service-cancelled-note {
  margin-bottom: 18px;
  padding: 13px 16px;
  border: 1px solid #f0bcc1;
  border-radius: var(--r-md);
  background: #fff5f6;
  color: var(--red-dark);
  font-size: 14px;
}

.service-description-block {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.service-description-block h3 {
  margin: 0 0 8px;
  color: var(--navy);
  font-size: 15px;
}

.service-message {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
}

.service-detail-actions {
  margin-top: 18px;
}

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

.spec-grid > div {
  padding: 11px 13px;
  border-radius: var(--r-md);
  background: var(--soft);
}

.spec-grid dt {
  color: var(--muted2);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.spec-grid dd {
  margin: 4px 0 0;
  color: var(--navy);
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.support-card {
  height: max-content;
  padding: 22px 24px;
  border-radius: var(--r-lg);
  background: var(--navy);
  color: #fff;
}

.support-card .kicker {
  color: #ff8089;
}

.support-card h2 {
  margin: 6px 0 8px;
  font-size: 21px;
  font-weight: 800;
}

.support-card p {
  margin: 0 0 16px;
  color: #c8d8e3;
  font-size: 14px;
  line-height: 1.5;
}

.support-card__phones {
  display: grid;
  gap: 8px;
}

.support-card__phones a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 13px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  font-size: 13px;
}

.support-card__phones a:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

.request-section {
  margin-bottom: 18px;
}

.request-section .panel__heading {
  align-items: center;
  margin-bottom: 14px;
}

/* --- Account & Docs Page -------------------------------------------------- */

.account-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

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

.account-kv dt {
  color: var(--muted2);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.account-kv dd {
  margin: 4px 0 0;
  color: var(--navy);
  font-size: 15px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.account-kv__sub {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.account-inline-switcher {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.account-inline-switcher .field {
  flex: 1;
}

.account-branches {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.account-branches__links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}

.account-branches__links a {
  color: var(--blue);
  font-weight: 700;
}

.tax-exemption-note {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--soft);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.tax-exemption-note a {
  color: var(--blue);
  font-weight: 700;
}

.ach-auth-actions {
  display: flex;
  flex-direction: row !important;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px !important;
}

.resource-link-list {
  display: grid;
  gap: 10px;
}

.resource-link-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #f8fafb;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.resource-link-card:hover {
  border-color: var(--blue);
  background: #f0f6fa;
}

.resource-link-card strong {
  display: block;
  color: var(--navy);
  font-size: 15px;
}

.resource-link-card span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.resource-link-card__arrow {
  color: var(--blue);
  font-size: 18px;
  font-weight: 800;
  flex: 0 0 auto;
}

/* --- Sign-In, Select Account, Onboarding & Modals ------------------------- */

.auth-layout {
  min-height: 540px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 56px;
}

.auth-copy h1 {
  max-width: 640px;
  margin: 12px 0 18px;
  color: var(--navy);
  font-size: 46px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.auth-copy > p {
  max-width: 560px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.check-list {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  gap: 11px;
}

.check-list li {
  font-weight: 700;
  color: var(--navy);
}

.check-list li::before {
  content: "✓";
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--green-bg);
  color: var(--green);
}

.auth-card {
  padding: 32px;
  border-radius: var(--r-lg);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.auth-card__title {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 10px;
}

.auth-card__title h2 {
  margin: 0;
  color: var(--navy);
  font-size: 26px;
}

.iec-face-mark {
  width: 78px;
  height: 82px;
  object-fit: contain;
  flex: 0 0 auto;
}

.auth-card > p {
  color: var(--muted);
  line-height: 1.5;
}

.provider-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
  padding: 13px 16px;
  border: 1px solid var(--input-bd);
  border-radius: var(--r-md);
  font-weight: 800;
  text-align: center;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.provider-button > img {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  object-fit: contain;
}

.provider-button:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: #f5f9fb;
}

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

.provider-button--microsoft:hover {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
  color: #fff;
}

.auth-card .auth-card__new {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.empty-state {
  max-width: 640px;
  margin: 40px auto;
  padding: 40px 32px;
  text-align: center;
}

.empty-state h1,
.empty-state h2 {
  margin: 10px 0 8px;
  color: var(--navy);
}

.empty-state p {
  margin: 0 auto 22px;
  max-width: 480px;
  color: var(--muted);
  line-height: 1.5;
}

.account-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.account-choice-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
}

.account-choice-card__copy h2 {
  margin: 8px 0 5px;
  color: var(--navy);
  font-size: 22px;
}

.account-choice-card__copy p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.account-choice-card form {
  margin: 0;
}

.account-choice-card .button {
  width: 100%;
}

/* --- Onboarding Specific Components --------------------------------------- */

.onboarding-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 22px;
  border: 1px solid #dce5ea;
  border-radius: var(--r-md);
  overflow: hidden;
  background: #e8eef2;
}

.onboarding-steps span {
  position: relative;
  padding: 14px 18px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.onboarding-steps span.is-active {
  background: var(--navy);
  color: #fff;
}

.onboarding-steps span.is-complete {
  background: var(--green-bg);
  color: var(--green);
}

.onboarding-steps b {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-right: 7px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 12px;
}

.onboarding-steps span.is-complete b {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.onboarding-steps span + span::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 1px;
  background: rgba(0, 44, 78, 0.1);
}

.setup-panel {
  margin-bottom: 20px;
  scroll-margin-top: 90px;
}

.setup-panel--muted {
  opacity: 0.62;
}

.setup-panel__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 26px;
  list-style: none;
  cursor: pointer;
}

.setup-panel__summary::-webkit-details-marker {
  display: none;
}

.setup-panel__summary h2 {
  margin: 5px 0 3px;
  color: var(--navy);
  font-size: 21px;
}

.setup-panel__summary p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.setup-panel__action {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
}

.setup-panel__action strong {
  color: var(--green);
}

.setup-panel__chevron {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  transition: transform 0.18s ease;
}

.setup-panel[open] .setup-panel__chevron {
  transform: rotate(180deg);
}

.setup-panel__body {
  padding: 4px 26px 26px;
  border-top: 1px solid var(--line);
}

.setup-panel__body .form-stack-layout {
  padding-top: 22px;
}

.review-callout {
  margin-bottom: 20px;
  padding: 24px 26px;
}

.review-callout h2 {
  margin: 6px 0 8px;
  color: var(--navy);
  font-size: 23px;
}

.review-callout p {
  max-width: 740px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.review-callout__note {
  margin-top: 12px !important;
  color: var(--blue) !important;
  font-size: 14px !important;
  font-weight: 700;
}

.review-callout--rejected {
  border-left: 5px solid var(--btn-red);
}

.review-callout__reason {
  margin: 14px 0 !important;
  padding: 13px 16px;
  border: 1px solid #f2c9cd;
  border-radius: var(--r-md);
  background: #fff5f6;
  color: var(--ink) !important;
}

.review-callout__contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.review-data-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px 22px;
  margin: 0;
  padding-top: 20px;
}

.review-data-grid > div {
  min-width: 0;
}

.review-data-grid__wide {
  grid-column: span 2;
}

.review-data-grid dt {
  margin-bottom: 4px;
  color: var(--muted2);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.review-data-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--navy);
  font-size: 14px;
  font-weight: 700;
}

.review-principals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.review-principals > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
  padding: 13px;
  border-radius: var(--r-md);
  background: var(--soft);
}

.review-principals span {
  overflow-wrap: anywhere;
  color: var(--navy);
  font-size: 14px;
  font-weight: 700;
}

.review-principals small {
  color: var(--muted);
  font-size: 12px;
}

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

.principal-panel {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
}

.principal-panel summary {
  display: flex;
  justify-content: space-between;
  padding: 14px 16px;
  color: var(--navy);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.principal-panel summary span {
  color: var(--muted2);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.principal-panel .form-grid {
  padding: 4px 16px 18px;
}

.signing-handoff {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 22px;
  border: 1px solid #b8cfdd;
  border-radius: var(--r-md);
  background: #f1f7fa;
}

.signing-handoff strong {
  color: var(--navy);
  font-size: 16px;
}

.signing-handoff p {
  max-width: 640px;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.signing-handoff .button {
  flex: 0 0 auto;
}

.signing-redirect {
  max-width: 680px;
  margin: 56px auto;
  padding: 40px 32px;
  text-align: center;
}

.signing-redirect h1 {
  margin: 10px 0;
  color: var(--navy);
  font-size: 28px;
}

.signing-redirect p {
  margin: 0 auto 22px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.signer-progress {
  padding-top: 20px;
}

.signer-progress__heading h3 {
  margin: 0;
  color: var(--navy);
  font-size: 19px;
}

.signer-progress__heading p {
  max-width: 740px;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.signer-progress__list {
  display: grid;
  gap: 10px;
  margin: 18px 0;
  padding: 0;
  list-style: none;
}

.signer-progress__item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #f8fafb;
}

.signer-progress__number {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #dfe8ed;
  color: var(--navy);
  font-weight: 800;
}

.signer-progress__item > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.signer-progress__item strong {
  color: var(--navy);
  font-size: 15px;
}

.signer-progress__item span:not(.signer-progress__number) {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 13px;
}

.signer-progress__item small {
  color: var(--muted2);
  font-size: 12px;
}

.signer-progress__item--completed {
  border-color: #b9dbc4;
  background: #f2f9f4;
}

.signer-progress__item--completed .signer-progress__number {
  background: var(--green);
  color: #fff;
}

.signer-progress__item--sent,
.signer-progress__item--delivered {
  border-color: #b8cfdd;
  background: #f2f7fa;
}

.signer-progress__item--sent .signer-progress__number,
.signer-progress__item--delivered .signer-progress__number {
  background: var(--blue);
  color: #fff;
}

.signer-reminder {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.signer-reminder p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.coi-requirements {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 18px;
  margin: 0 0 18px;
  padding: 18px 20px;
  border: 1px solid #e6c36a;
  border-radius: var(--r-md);
  background: #fff9e9;
}

.coi-requirements h3 {
  margin: 4px 0;
  color: var(--navy);
  font-size: 17px;
}

.coi-requirements p {
  margin: 0;
  color: #6b521c;
  font-size: 13px;
}

.coi-requirements__copy {
  grid-column: 1 / -1;
  margin-top: 8px;
  padding: 14px;
  border: 1px solid #ead9aa;
  border-radius: var(--r-sm);
  background: #fff;
  color: #2d404c;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
}

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

.upload-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 13px;
  min-height: 136px;
  padding: 18px;
  border: 2px dashed #bdccd5;
  border-radius: var(--r-md);
  background: #f8fafb;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.upload-card:hover,
.upload-card.is-dragging {
  border-color: var(--blue);
  background: #f1f7fa;
}

.upload-card.is-uploaded {
  border-style: solid;
  border-color: #abd3b8;
  background: #f3faf5;
}

.upload-card.has-selection {
  border-style: solid;
  border-color: var(--blue);
  background: #eef6fb;
  box-shadow: 0 0 0 3px rgba(0, 86, 140, 0.1);
}

.upload-card input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.upload-card__icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-size: 17px;
  font-weight: 900;
}

.upload-card.is-uploaded .upload-card__icon {
  background: var(--green);
}

.upload-card.has-selection .upload-card__icon {
  background: var(--blue);
}

.upload-card__copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.upload-card__copy strong {
  color: var(--navy);
  font-size: 15px;
}

.upload-card__copy small {
  color: var(--muted);
  font-size: 12px;
}

.upload-card__copy em {
  margin-top: 6px;
  overflow: hidden;
  color: var(--blue);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  text-overflow: ellipsis;
}

.coi-upload-fields {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(220px, 0.4fr) 1fr;
  gap: 16px;
  align-items: end;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #f8fafb;
}

.coi-upload-fields.is-required {
  border-color: #d5aa3c;
  background: #fffaf0;
}

.document-upload-form > .form-actions {
  grid-column: 1 / -1;
}

.onboarding-submit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.onboarding-submit p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.document-review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.document-review-card {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border: 1px solid #cfe1d5;
  border-radius: var(--r-md);
  background: #f7fbf8;
  flex-wrap: wrap;
}

.document-review-card__copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 3px;
}

.document-review-card__copy strong {
  color: var(--navy);
  font-size: 14px;
}

.document-review-card__copy small {
  color: var(--muted);
  font-size: 12px;
}

.document-review-card__copy span {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-review-card__actions {
  display: flex;
  flex: 0 0 100%;
  gap: 12px;
  margin-top: 4px;
  padding-left: 46px;
}

.document-review-card__actions a,
.document-review-card__actions button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

/* --- Document Preview Dialog ---------------------------------------------- */

.document-preview {
  width: min(1040px, calc(100vw - 40px));
  height: min(820px, calc(100vh - 40px));
  padding: 0;
  border: 0;
  border-radius: var(--r-lg);
  background: #fff;
  box-shadow: 0 26px 80px rgba(0, 32, 57, 0.28);
}

.document-preview::backdrop {
  background: rgba(0, 30, 52, 0.62);
}

.document-preview__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 56px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  color: var(--navy);
}

.document-preview__controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.document-preview__header button {
  padding: 2px 8px;
  border: 0;
  background: transparent;
  color: var(--navy);
  font-size: 26px;
  line-height: 1;
}

.document-preview iframe {
  width: 100%;
  height: calc(100% - 56px);
  border: 0;
  background: #eef2f5;
}

/* --- Responsive Breakpoints ----------------------------------------------- */

@media (max-width: 1120px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-grid,
  .content-grid--balanced,
  .account-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1023px) {
  html,
  body {
    height: auto;
  }

  body.portal-shell {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  .portal-scroll {
    overflow: visible;
    scrollbar-gutter: auto;
  }

  .portal-main {
    min-height: 0;
    padding: 20px 0 40px;
  }

  .toast-region {
    top: 66px;
    right: 12px;
  }
}

@media (max-width: 760px) {
  .portal-wrap {
    width: min(100% - 28px, var(--wrap));
  }

  .page-heading {
    flex-direction: column;
    gap: 12px;
    margin-bottom: 18px;
  }

  .page-heading h1 {
    font-size: 24px;
  }

  .panel {
    padding: 18px 18px 20px;
  }

  .form-section {
    padding: 16px;
  }

  .form-grid,
  .form-grid--three,
  .narrow-layout,
  .auth-layout,
  .review-data-grid,
  .review-principals,
  .document-upload-form,
  .coi-upload-fields,
  .account-kv {
    grid-template-columns: 1fr;
  }

  .field--wide,
  .review-data-grid__wide {
    grid-column: auto;
  }

  .form-actions .button {
    width: 100%;
  }

  .choice-strip--four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .triage-alert,
  .service-ticket-row,
  .data-row,
  .signing-handoff,
  .onboarding-submit,
  .signer-reminder,
  .account-inline-switcher {
    flex-direction: column;
    align-items: flex-start;
  }

  .triage-alert .button,
  .signing-handoff .button,
  .onboarding-submit .button,
  .signer-reminder .button,
  .account-inline-switcher .button {
    width: 100%;
  }

  .align-right {
    align-items: flex-start;
    text-align: left;
  }

  .auth-copy h1 {
    font-size: 34px;
  }

  .auth-card {
    padding: 24px 20px;
  }

  .onboarding-steps {
    grid-template-columns: 1fr;
  }

  .onboarding-steps span + span::before {
    inset: 0 0 auto 0;
    width: auto;
    height: 1px;
  }

  .coi-requirements {
    grid-template-columns: 1fr;
  }

  .portal-footer .portal-wrap {
    flex-direction: column;
    justify-content: center;
    padding: 14px 0;
    gap: 6px;
  }

  .document-preview {
    width: calc(100vw - 16px);
    height: calc(100vh - 16px);
  }
}

@media (max-width: 460px) {
  .metric-grid {
    grid-template-columns: 1fr;
  }

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

@media (prefers-reduced-motion: reduce) {
  .portal-main[aria-busy="true"]::before {
    animation: none;
    background: var(--blue);
  }

  .metric-card,
  .service-ticket-row,
  .button {
    transition: none;
  }
}

/* --- Print Styles --------------------------------------------------------- */

@media print {
  html,
  body,
  body.portal-shell,
  .portal-workspace,
  .portal-workspace__body,
  .portal-scroll {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    display: block !important;
    background: #fff !important;
  }

  .portal-rail,
  .portal-header,
  .portal-bottom-nav,
  .portal-data-source,
  .portal-footer,
  .toast-region,
  .payment-cart,
  .batch-bar,
  .quick-actions,
  .sub-nav,
  .billing-tabs {
    display: none !important;
  }

  .portal-main {
    padding: 0 !important;
    min-height: 0 !important;
  }

  .portal-wrap {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
  }

  .card {
    box-shadow: none !important;
    break-inside: avoid;
  }
}
