:root {
  --ink: #17324d;
  --muted: #5c6f82;
  --line: #d8e5ee;
  --bg: #f7fbff;
  --panel: #ffffff;
  --primary: #0b2d5b;
  --primary-dark: #061f3f;
  --primary-light: #eaf8fb;
  --midnight: #0b2d5b;
  --glacier: #e7fafe;
  --aurora-teal: #00c896;
  --blue: #0b2d5b;
  --green: #087f63;
  --violet: #8b5cf6;
  --red: #b42318;
  --amber: #b7791f;
  --aka-button-primary-bg: #0b2d5b;
  --aka-button-primary-hover: #061f3f;
  --aka-button-primary-active: #04182f;
  --aka-button-primary-text: #fff;
  --aka-button-secondary-bg: #fff;
  --aka-button-secondary-hover: #eaf8fb;
  --aka-button-secondary-active: #d7f3f8;
  --aka-button-secondary-text: #0b2d5b;
  --aka-button-disabled-bg: #e5edf2;
  --aka-button-disabled-text: #435669;
  --aka-focus-strong: #0b2d5b;
  --aka-focus-accent: #38d9e9;
}

* { box-sizing: border-box; }
h1, h2, h3, h4, summary, .admin-brand { font-family: Montserrat, "Avenir Next", ui-sans-serif, system-ui, sans-serif; }
.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;
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: "Source Sans 3", "Avenir Next", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 244px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px;
  background: linear-gradient(180deg, #061f3f, #0b2d5b 72%, #103d70);
  color: white;
}
.admin-brand {
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  font-size: 1.05rem;
  font-weight: 850;
  text-decoration: none;
  max-width: 190px;
  padding: 0;
}
.brand-logo {
  display: block;
  width: auto;
  max-width: 190px;
  max-height: 44px;
  object-fit: contain;
  border-radius: 0;
}
.sidebar nav { display: grid; gap: 6px; }
.sidebar a {
  color: #d8e7ee;
  border-radius: 6px;
  padding: 10px 12px;
  text-decoration: none;
  font-weight: 700;
}
.sidebar .admin-brand {
  padding: 6px 8px;
  background: #fff;
  border: 1px solid rgba(255,255,255,.78);
  border-radius: 8px;
  box-shadow: none;
}
.sidebar .admin-brand:hover { background: #fff; box-shadow: 0 0 0 3px rgba(56,217,233,.35); }
.sidebar .admin-brand .brand-logo { max-height: 64px; }
.sidebar a:hover,
.sidebar a.current { background: rgba(255,255,255,.16); color: white; }
.public-link {
  border-top: 1px solid rgba(255,255,255,.14);
  color: #f3d59d;
}
.logout {
  margin-top: auto;
  width: 100%;
  background: rgba(255,255,255,.1);
  color: white;
  border: 1px solid rgba(255,255,255,.2);
}

.admin-main {
  margin-left: 244px;
  padding: 28px;
}
.customer-health-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-left: 6px solid var(--amber);
  border-radius: 16px;
  padding: clamp(22px, 4vw, 36px);
  background: linear-gradient(120deg, #fff, #f5faff);
  box-shadow: 0 12px 30px rgba(11,45,91,.07);
}
.customer-health-hero.is-healthy { border-left-color: #00a77e; background: linear-gradient(120deg, #fff, #edfdf8); }
.customer-health-hero h2 { margin: 4px 0 8px; color: var(--midnight); font-size: clamp(1.8rem,4vw,2.7rem); }
.customer-health-hero p { margin: 0; color: var(--muted); }
.health-actions { display: grid; justify-items: end; gap: 10px; min-width: 180px; }
.health-actions span { color: var(--amber); font-weight: 800; }
.business-summary-panel .metric-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
.highlight-metric { border-color: rgba(0,200,150,.4) !important; background: #effdf9 !important; }
.simple-plan-list { display: grid; gap: 10px; }
.simple-plan-list > div { display: grid; gap: 3px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.simple-plan-list > div:last-child { border-bottom: 0; }
.simple-plan-list span, .status-copy { color: var(--muted); }
.success-copy { color: #087f63; }
.support-callout { display: flex; align-items: center; justify-content: space-between; gap: 20px; background: linear-gradient(115deg, #eefbff, #f7fbff); }
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 22px;
}
.page-header h1 { margin: 0; font-size: 2rem; }
.eyebrow {
  margin: 0 0 4px;
  color: var(--blue);
  font-size: .78rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}
.metric span { color: var(--muted); font-weight: 750; }
.metric strong { display: block; margin-top: 8px; font-size: 2rem; }
.metric-link { color: inherit; text-decoration: none; }
.metric-link:hover { transform: translateY(-1px); }
.metric-link:focus-visible { outline: 3px solid var(--aka-focus-accent); outline-offset: 2px; }
.two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.quick-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 24px;
}
.card-grid,
.action-list,
.method-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 12px;
}
.summary-card,
.action-list article,
.method-list article {
  display: grid;
  gap: 8px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfd;
  padding: 14px;
}
.summary-card span,
.method-list span,
.action-list small,
.metric small {
  color: var(--muted);
  line-height: 1.45;
}
.dashboard-summary .metric {
  border-top: 4px solid var(--primary);
}
.metric-grid.dashboard-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.summary-card > div:first-child {
  display: grid;
  gap: 3px;
}
.flash-stack {
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
}
.alert {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 12px 14px;
  font-weight: 750;
}
.alert-success { border-color: #b7e4cf; background: #e8f7ef; color: var(--green); }
.alert-info { border-color: #b8d8ea; background: #eaf5fb; color: var(--blue); }
.alert-warning { border-color: #f1d394; background: #fff7e4; color: var(--amber); }
.alert-error { border-color: #f2bbb7; background: #fdebea; color: var(--red); }
.wizard-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}
.wizard-step {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-weight: 850;
  padding: 8px 12px;
}
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 22px;
  border-bottom: 1px solid var(--line);
}
.tabs > a,
.tab-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--muted);
  border-bottom: 3px solid transparent;
  padding: 0 2px 8px;
  text-decoration: none;
  font-weight: 850;
}
.tabs > a:hover,
.tabs > a.current,
.tab-link:hover,
.tab-link.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.fulfillment-steps {
  display: grid;
  gap: 12px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: fulfillment-step;
}
.fulfillment-steps li {
  counter-increment: fulfillment-step;
  display: grid;
  grid-template-columns: 36px minmax(130px, .45fr) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--panel);
}
.fulfillment-steps li::before {
  content: counter(fulfillment-step);
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e8eef4;
  color: var(--primary);
  font-weight: 900;
}
.fulfillment-steps li.complete { border-color: #b7e4cf; background: #f3fbf7; }
.fulfillment-steps li.complete::before { content: "✓"; background: var(--green); color: white; }
.fulfillment-steps li span { color: var(--muted); }

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: .92rem;
}
th {
  color: var(--muted);
  background: #fbfcfd;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: 0;
}
.empty { color: var(--muted); text-align: center; padding: 28px; }
.badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  font-size: .78rem;
  font-weight: 850;
  background: #e9eef3;
  color: var(--muted);
}
.online,
.active,
.completed { background: #e3f4ed; color: var(--green); }
.offline,
.expired,
.failed { background: #fde7e5; color: var(--red); }
.pending,
.sent,
.verification_pending,
.restart_initiated,
.new,
.not_started,
.needs_attention { background: #fff3d8; color: var(--amber); }
.verified,
.ready { background: #e3f4ed; color: var(--green); }
.not_applicable { background: #e9eef3; color: var(--muted); }
.status-green { background: #e3f4ed; color: var(--green); }
.status-yellow,
.warning { background: #fff3d8; color: var(--amber); }
.status-red,
.critical { background: #fde7e5; color: var(--red); }
.status-gray,
.info { background: #e9eef3; color: var(--muted); }
.clickable-row { cursor: pointer; }
.clickable-row:hover td { background: #f7fafc; }
.clickable-row a { color: var(--blue); font-weight: 800; text-decoration: none; }
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}
.portal-promotions-legal,
.portal-promotions-actions {
  margin-top: 24px;
}
.branding-preview {
  display: grid;
  gap: 12px;
  width: min(100%, 560px);
  border: 1px solid rgba(67, 32, 135, .18);
  border-radius: 14px;
  padding: 20px;
  background: #fff;
  background-size: cover;
  background-position: center;
  box-shadow: 0 16px 38px rgba(25, 33, 42, .10);
}
.branding-preview h3 {
  margin: 0;
  color: var(--blue);
  font-size: clamp(1.25rem, 3vw, 2rem);
}
.branding-preview p { margin: 0; line-height: 1.5; }
.branding-preview button { width: 100%; background: var(--blue); }
.branding-preview .portal-logo { max-width: 180px; max-height: 76px; object-fit: contain; }
.branding-preview-topbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(67, 32, 135, .14);
  padding-bottom: 9px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 750;
}
.branding-preview-name { color: var(--blue); font-size: 1.15rem; }
.branding-preview-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.branding-preview-options span { border: 1px solid rgba(67, 32, 135, .18); border-radius: 8px; padding: 10px; background: rgba(255,255,255,.86); color: var(--blue); font-weight: 800; text-align: center; }
.preview-note { margin-bottom: 0; }
.customer-router-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}
.customer-router-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  background: #fff;
}

.property-service-panel { display: grid; gap: 1rem; }
.guest-network-card { border: 1px solid var(--border); border-radius: 18px; padding: clamp(1rem, 2vw, 1.5rem); background: linear-gradient(135deg, #fff 0%, var(--brand-arctic-white) 100%); display: grid; gap: 1rem; }
.guest-network-summary { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.guest-network-summary h3 { margin: .15rem 0; }
.network-state { display: grid; justify-items: end; gap: .35rem; text-align: right; }
.network-capability-list { display: flex; flex-wrap: wrap; gap: .5rem; }
.network-capability-list span { border: 1px solid #cfe3ea; background: #fff; border-radius: 999px; padding: .35rem .65rem; color: var(--muted); font-size: .88rem; }
.equipment-details { border-top: 1px solid var(--border); padding-top: .8rem; }
.equipment-details summary { color: var(--brand-midnight); font-weight: 700; cursor: pointer; }
.equipment-details[open] summary { margin-bottom: .9rem; }
@media (max-width: 680px) { .guest-network-summary { display: grid; } .network-state { justify-items: start; text-align: left; } }
.customer-router-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.hero-panel {
  border-color: rgba(67, 32, 135, .16);
  background:
    radial-gradient(circle at top right, rgba(223, 244, 248, .9), transparent 34%),
    linear-gradient(135deg, #ffffff 0%, #fbf8ff 100%);
  box-shadow: 0 18px 44px rgba(32, 18, 56, .08);
}
.hero-panel h2 {
  max-width: 880px;
  color: var(--midnight);
  font-size: clamp(1.25rem, 2.5vw, 2rem);
}
.hero-panel p {
  max-width: 940px;
  line-height: 1.62;
}
code {
  display: inline-flex;
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
  border-radius: 6px;
  background: #f5f1fb;
  color: var(--primary-dark);
  padding: 2px 6px;
}
.panel h2,
section h2 {
  margin: 0 0 12px;
  font-size: 1.1rem;
}
.customer-dashboard-header {
  margin-bottom: 14px;
}
.getting-started-panel {
  padding: 14px;
  margin-bottom: 16px;
}
.getting-started-panel h2 {
  margin-bottom: 6px;
}
.getting-started-panel > .muted {
  margin: 0 0 8px;
}
.getting-started-table th,
.getting-started-table td {
  padding-top: 8px;
  padding-bottom: 8px;
  vertical-align: middle;
}
.getting-started-table small {
  color: var(--muted);
}
dl {
  display: grid;
  grid-template-columns: minmax(120px, .7fr) 1fr;
  gap: 8px 14px;
  margin: 0;
}
dt { color: var(--muted); font-weight: 800; }
dd { margin: 0; }
.status-list {
  display: grid;
  gap: 8px;
  padding-left: 0;
  margin: 0;
  list-style: none;
}
pre {
  white-space: pre-wrap;
  background: #f7fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.toolbar-form,
.inline-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr)) auto;
  gap: 10px;
  margin-bottom: 18px;
}
.inline-form {
  grid-template-columns: repeat(6, minmax(110px, 1fr)) auto auto;
  margin: 0;
}
input,
select,
button,
textarea {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
  max-width: 100%;
}
.button-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  padding: 8px 12px;
  background: var(--aka-button-primary-bg);
  color: var(--aka-button-primary-text);
  text-decoration: none;
  font-weight: 800;
}
.secondary-link {
  background: var(--aka-button-secondary-bg);
  color: var(--aka-button-secondary-text);
  border: 1px solid var(--line);
}
.header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.muted { color: var(--muted); }
.error-text { color: var(--red); font-weight: 800; }
.wide-table {
  min-width: 1240px;
}
button {
  border: 0;
  background: var(--aka-button-primary-bg);
  color: var(--aka-button-primary-text);
  cursor: pointer;
  font-weight: 800;
}
button:hover,
.button-link:hover,
.button-link:focus-visible {
  background: var(--aka-button-primary-hover);
  color: var(--aka-button-primary-text);
}
button:active,
.button-link:active {
  background: var(--aka-button-primary-active);
  color: var(--aka-button-primary-text);
}
.button-link:visited { color: var(--aka-button-primary-text); }
.secondary-button {
  background: var(--aka-button-secondary-bg);
  color: var(--aka-button-secondary-text);
  border: 1px solid var(--line);
}
.secondary-button:hover,
.secondary-button:focus-visible,
.secondary-link:hover,
.secondary-link:focus-visible {
  background: var(--aka-button-secondary-hover);
  color: var(--aka-button-secondary-text);
}
.secondary-button:active,
.secondary-link:active {
  background: var(--aka-button-secondary-active);
  color: var(--aka-button-secondary-text);
}
.secondary-link:visited { color: var(--aka-button-secondary-text); }
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--aka-focus-strong);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px rgba(56, 217, 233, .72);
}
.danger-button {
  background: var(--red);
  color: #fff;
}
.danger-button:hover,
.danger-button:focus-visible { background: #8f1c14; color: #fff; }
.danger-button:active { background: #73170f; color: #fff; }
button:disabled,
.button[aria-disabled="true"],
.button-link[aria-disabled="true"] {
  border-color: var(--aka-button-disabled-bg);
  background: var(--aka-button-disabled-bg);
  color: var(--aka-button-disabled-text);
  box-shadow: none;
  cursor: not-allowed;
  opacity: 1;
  pointer-events: none;
}
.logout:hover,
.logout:focus-visible { background: rgba(255,255,255,.18); color: #fff; }
.logout:active { background: rgba(255,255,255,.24); color: #fff; }
.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--muted);
  line-height: 1.45;
}
.check input { flex: 0 0 auto; min-height: 22px; width: 22px; margin-top: 1px; }
.field-with-help {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-weight: 750;
}
.field-with-help small {
  color: var(--muted);
  font-weight: 650;
}
.edit-row td { background: #fbfcfd; }
.mini-form {
  display: grid;
  gap: 8px;
  min-width: 180px;
}
.mini-form textarea {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
}
.provisioning-form {
  display: grid;
  gap: 16px;
  margin-bottom: 22px;
}
.responsive-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px;
}
.responsive-fields label,
.provisioning-form label {
  min-width: 0;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 750;
}
.responsive-fields input,
.responsive-fields select,
.responsive-fields textarea,
.url-field {
  width: 100%;
  min-width: 0;
}
.wrap-text,
.url-field,
pre,
td,
dd,
.metric strong,
.badge {
  overflow-wrap: anywhere;
  word-break: normal;
}
table th,
table td {
  min-width: 110px;
  overflow-wrap: normal;
  word-break: normal;
  vertical-align: top;
}
table th:first-child,
table td:first-child {
  min-width: 150px;
}
.secret-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.revealed-secret-value {
  flex: 1 1 180px;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.provision-summary {
  position: sticky;
  bottom: 0;
  z-index: 2;
  box-shadow: 0 -8px 18px rgba(25, 33, 42, .06);
}
.instruction-list { padding-left: 22px; }
.instruction-list li { margin-bottom: 14px; }
.instruction-list .instruction-mac,
.instruction-list .instruction-router,
.instruction-mac,
.instruction-router {
  border-left: 5px solid var(--blue);
  border-radius: 8px;
  padding: 12px 14px;
}
.instruction-list .instruction-router,
.instruction-router {
  border-left-color: var(--primary);
  background: rgba(67, 32, 135, .06);
}
.instruction-list .instruction-mac,
.instruction-mac {
  background: rgba(37, 99, 235, .06);
}
.maintenance-panel {
  border-color: #fed7aa;
  background: #fff7ed;
}
.instruction-list pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.router-install-workflow { min-width: 0; }
.router-install-workflow pre { max-width: 100%; overflow-wrap: anywhere; }
.router-install-workflow button { margin: 4px 0; }
.router-install-workflow .checklist { padding-left: 22px; }
.installer-confirmation {
  display: flex !important;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--ink) !important;
  line-height: 1.45;
  cursor: pointer;
}
.installer-confirmation input {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
}
.installer-copy-control { min-width: 0; margin: 8px 0 14px; }
.installer-copy-control pre {
  margin: 7px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.installer-copy-button { min-height: 44px; }
.copy-feedback {
  display: inline-block;
  min-width: 5em;
  margin-left: 8px;
  color: var(--green);
  font-weight: 800;
}
.installer-expiration { margin: 14px 0; }
.installer-progress ol { display: grid; gap: 8px; padding-left: 0; list-style: none; }
.installer-progress li {
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.installer-progress li.complete { border-color: #86efac; background: #f0fdf4; color: #166534; }
.installer-progress li.pending { background: #f8fafc; color: var(--muted); }
.advanced-installer details { margin-top: 12px; }
@media (max-width: 680px) {
  .router-install-workflow { width: 100%; max-width: 100%; }
  .installer-copy-button { width: 100%; }
  .copy-feedback { display: block; min-height: 1.4em; margin: 4px 0 0; }
  .installer-primary-steps { padding-left: 18px; }
}
.error-list {
  color: #7f1d1d;
  background: #fee2e2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 10px 12px 10px 28px;
}
.modal-dialog {
  width: min(92vw, 560px);
  max-height: min(86vh, 720px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0;
  box-shadow: 0 22px 60px rgba(25, 33, 42, .24);
}
.modal-dialog::backdrop { background: rgba(16, 24, 32, .46); }
.modal-dialog form {
  display: grid;
  gap: 14px;
  padding: 22px;
}
.modal-dialog label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 750;
}
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}
.address-suggestions {
  display: grid;
  gap: 6px;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
  box-shadow: 0 10px 28px rgba(25, 33, 42, .1);
}
.address-suggestion {
  width: 100%;
  justify-content: flex-start;
  background: #f7fafc;
  color: var(--ink);
  text-align: left;
  white-space: normal;
}
.address-suggestion:hover { background: var(--primary-light); color: var(--primary-dark); }
.address-attribution { color: var(--muted); line-height: 1.35; }

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-panel {
  width: min(100%, 420px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
}
.login-logo {
  display: block;
  width: auto;
  max-width: 220px;
  max-height: 100px;
  object-fit: contain;
  margin-bottom: 14px;
}
.login-panel h1 { margin: 0 0 8px; }
.login-panel p { color: var(--muted); line-height: 1.5; }
.login-panel label {
  display: grid;
  gap: 7px;
  margin: 14px 0;
  color: var(--muted);
  font-weight: 750;
}
.login-panel button { width: 100%; margin-top: 8px; }
.mfa-panel { width: min(100%, 520px); }
.mfa-qr-card {
  display: grid;
  place-items: center;
  margin: 16px 0;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.mfa-qr {
  width: min(100%, 220px);
  height: auto;
}
.recovery-code-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0;
  list-style: none;
}
.recovery-code-list code {
  display: block;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafc;
  text-align: center;
  font-weight: 800;
}
.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--aka-button-primary-bg);
  color: var(--aka-button-primary-text);
  text-decoration: none;
  font-weight: 800;
}
.button:visited { color: var(--aka-button-primary-text); }
.button:hover,
.button:focus-visible { background: var(--aka-button-primary-hover); color: var(--aka-button-primary-text); }
.button:active { background: var(--aka-button-primary-active); color: var(--aka-button-primary-text); }
.button.secondary {
  background: var(--aka-button-secondary-bg);
  color: var(--aka-button-secondary-text);
  border: 1px solid var(--line);
}
.button.secondary:visited { color: var(--aka-button-secondary-text); }
.button.secondary:hover,
.button.secondary:focus-visible { background: var(--aka-button-secondary-hover); color: var(--aka-button-secondary-text); }
.button.secondary:active { background: var(--aka-button-secondary-active); color: var(--aka-button-secondary-text); }
.alert {
  background: #fde7e5;
  color: var(--red);
  border-radius: 6px;
  padding: 10px;
  font-weight: 750;
}

@media (max-width: 980px) {
  .sidebar {
    position: static;
    width: auto;
  }
  .admin-brand { max-width: 155px; }
  .brand-logo {
    max-width: 155px;
    max-height: 36px;
  }
  .admin-main { margin-left: 0; padding: 18px; }
  .metric-grid,
  .two-column,
  .detail-grid,
  .responsive-fields,
  .toolbar-form,
  .inline-form { grid-template-columns: 1fr; }
  .metric-grid.dashboard-summary { grid-template-columns: 1fr; }
  table { display: block; overflow-x: auto; max-width: 100%; }
  .page-header { align-items: flex-start; flex-direction: column; gap: 12px; }
  .login-panel { padding: 22px; }
}

@media (max-width: 1180px) {
  .two-column { grid-template-columns: 1fr; }
  table { display: block; overflow-x: auto; max-width: 100%; }
}

@media (max-width: 760px) {
  .fulfillment-steps li { grid-template-columns: 36px 1fr; }
  .fulfillment-steps li span { grid-column: 2; }
  .customer-health-hero,
  .support-callout { align-items: flex-start; flex-direction: column; }
  .health-actions { justify-items: stretch; width: 100%; }
  .business-summary-panel .metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .customer-router-table { display: none; }
  .customer-router-cards { display: grid; gap: 12px; }
  .customer-router-card dl { grid-template-columns: minmax(112px, .7fr) 1fr; }
  .monitoring-table,
  .monitoring-table tbody,
  .monitoring-table tr,
  .monitoring-table td {
    display: block;
    width: 100%;
  }
  .monitoring-table thead { display: none; }
  .monitoring-table tr {
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-bottom: 10px;
    padding: 10px;
    background: #fff;
  }
  .monitoring-table td {
    min-width: 0;
    border: 0;
    padding: 4px 0;
  }
  .monitoring-table td::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 850;
    text-transform: uppercase;
  }
}

.settings-group > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 850;
}
.settings-group[open] > summary { margin-bottom: 16px; }
.request-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.request-actions form { margin: 0; }
.password-strength { display: grid; gap: 7px; margin-top: 7px; }
.password-strength meter { width: 100%; height: 9px; }
.password-strength ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 16px; margin: 0; padding-left: 18px; color: var(--muted); font-size: .8rem; }
.password-strength li.valid { color: var(--success); }
.password-match { min-height: 1.2em; color: var(--muted); font-size: .82rem; }
.password-match.valid { color: var(--success); }
.password-match.invalid { color: var(--danger); }

@media (max-width: 680px) {
  .password-strength ul { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .business-summary-panel .metric-grid { grid-template-columns: minmax(0,1fr); }
}

@media (max-width: 520px) {
  .sidebar nav { grid-template-columns: 1fr; }
  .admin-main { padding: 14px; }
  .panel,
  .metric,
  .login-panel { padding: 16px; }
  .button-link,
  button { width: 100%; }
  .header-actions,
  .quick-actions,
  .secret-controls { width: 100%; }
  dl { grid-template-columns: 1fr; }
}

/* Responsive portal foundation: customer and administrator share components,
   but keep separate navigation shells. */
body.portal-body,
body.portal-body * { min-width: 0; }
.portal-body { min-height: 100vh; }
.sidebar { overflow-y: auto; overscroll-behavior: contain; }
.admin-main { min-width: 0; padding: clamp(18px, 3vw, 32px); }
.portal-content > * { max-width: 100%; }
.portal-mobile-header,
.portal-backdrop,
.portal-noscript-nav { display: none; }
.portal-menu-button {
  width: auto;
  min-width: 76px;
  white-space: nowrap;
  border: 1px solid rgba(255,255,255,.24);
  background: #241238;
}
.portal-menu-button:hover { background: #321566; }
.portal-identity { display: grid; gap: 3px; margin: 18px 16px; padding: 12px; border: 1px solid rgba(255,255,255,.18); border-radius: 8px; color: #fff; overflow-wrap: anywhere; }
.portal-identity span { color: rgba(255,255,255,.78); font-size: .85rem; }
.portal-identity .identity-role { color: #fff; font-weight: 800; }
.mobile-identity { max-width: 34vw; color: #fff; font-size: .78rem; font-weight: 800; overflow-wrap: anywhere; text-align: right; }
.setup-link { display: block; padding: 12px; background: var(--primary-light); overflow-wrap: anywhere; white-space: normal; }
.admin-user-actions { min-width: 280px; vertical-align: top; }
.admin-user-actions .toolbar-form { display: grid; gap: 8px; }
.account-form-panel form { display: grid; gap: 14px; max-width: 520px; }
.account-form-panel label { display: grid; gap: 6px; font-weight: 750; }
.page-header { gap: 16px; min-width: 0; }
.page-header h1 { font-size: clamp(1.55rem, 3vw, 2rem); overflow-wrap: anywhere; }
.metric-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 175px), 1fr)); }
.metric strong { font-size: clamp(1.25rem, 3vw, 2rem); overflow-wrap: anywhere; }
.two-column > *,
.detail-grid > *,
.metric-grid > * { min-width: 0; }
.panel { min-width: 0; overflow-wrap: anywhere; }
.badge { white-space: nowrap; overflow-wrap: normal; word-break: normal; }
.toolbar-form,
.inline-form { grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); align-items: start; min-width: 0; }
.inline-form { grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }
.responsive-fields { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.responsive-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 12px;
  align-items: start;
}
.responsive-form .full,
.stacked-form .full { grid-column: 1 / -1; }
.stacked-form { display: grid; gap: 10px; min-width: min(100%, 260px); }
.summary-toggle { cursor: pointer; color: var(--blue); font-weight: 800; }
.quiet-link { cursor: pointer; color: var(--blue); font-weight: 700; }
.skip-link {
  position: fixed;
  left: 12px;
  top: 8px;
  z-index: 100;
  transform: translateY(-140%);
  background: #fff;
  color: var(--primary-dark);
  padding: 10px 14px;
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.skip-link:focus { transform: translateY(0); }
form > input,
form > select,
form > textarea,
form > button,
form > .button-link,
form > label { min-width: 0; }
form > button,
form > .button-link { white-space: nowrap; }
textarea { min-height: 110px; resize: vertical; }
.table-scroll { max-width: 100%; overflow-x: auto; border-radius: 8px; }
.table-scroll table { min-width: 680px; }
.provisioning-form,
.provisioning-form .panel { min-width: 0; }
.provisioning-form pre,
.provisioning-details pre { max-width: 100%; overflow-x: auto; white-space: pre; }
.provisioning-details { margin: 10px 0; }
.provisioning-details summary { cursor: pointer; color: var(--blue); font-weight: 800; }
.provisioning-instructions,
.provisioning-actions { vertical-align: top; }
.provisioning-actions form { display: grid; gap: 8px; margin: 8px 0; }
.provisioning-actions .button-link,
.provisioning-actions button { width: 100%; }

@media (max-width: 980px) {
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: min(86vw, 310px);
    transform: translateX(-105%);
    transition: transform .2s ease;
    box-shadow: 14px 0 32px rgba(25, 33, 42, .2);
  }
  .portal-menu-open .sidebar { transform: translateX(0); }
  .portal-backdrop { position: fixed; inset: 0; z-index: 30; background: rgba(15, 10, 25, .48); }
  .portal-menu-open .portal-backdrop { display: block; }
  .portal-mobile-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 64px;
    padding: 10px 16px;
    background: #241238;
    color: white;
    box-shadow: 0 2px 10px rgba(25, 33, 42, .12);
  }
  .portal-mobile-header .admin-brand { color: white; }
  .portal-mobile-header .brand-logo {
    max-width: 132px;
    max-height: 52px;
  }
  .portal-mobile-header .admin-brand {
    min-width: 0;
    padding: 4px 6px;
    background: #fff;
    border-radius: 7px;
  }
  .portal-mobile-header .admin-brand > span { display: none; }
  .admin-main { margin-left: 0; padding: 18px; }
  .portal-menu-open { overflow: hidden; }
  table {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
  }
  table:not(.wide-table) { min-width: 0; }
  .wide-table { min-width: 0; }
  .page-header { align-items: flex-start; flex-direction: column; }
  .page-header .header-actions,
  .page-header > .button-link { width: 100%; }
  .page-header .header-actions > * { flex: 1 1 180px; }
  .login-panel { padding: 22px; }
  .admin-user-actions { min-width: 280px; }
}

@media (max-width: 680px) {
  .admin-main { padding: 14px 12px 28px; }
  .metric-grid,
  .two-column,
  .detail-grid,
  .responsive-fields,
  .responsive-form,
  .toolbar-form,
  .inline-form { grid-template-columns: 1fr; }
  .metric,
  .panel { padding: 14px; }
  .button-link,
  button { min-height: 44px; }
  .button-link,
  .header-actions > *,
  .quick-actions > *,
  .modal-actions > *,
  .toolbar-form > button,
  .toolbar-form > .button-link { width: 100%; }
  .provision-summary { position: static; }
  .portal-identity { margin: 12px; }
  .mobile-identity { max-width: 28vw; }
  dl { grid-template-columns: 1fr; gap: 4px; }
  dt { margin-top: 8px; }
  pre { max-width: 100%; overflow-x: auto; }
}

/* A keyboard-accessible fallback remains visible when scripts are disabled. */
noscript .portal-noscript-nav {
  display: flex;
  padding: 12px 16px;
  gap: 8px 14px;
  flex-wrap: wrap;
  background: var(--primary-light);
}
noscript .portal-noscript-nav a { color: var(--primary-dark); font-weight: 800; }

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

.router-command-progress {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--brand-arctic-white, #f5fafc);
}
.router-command-progress-pending { border-color: #8bcfd8; background: #eefafb; }
.router-command-progress-applied { border-color: #8ed9bd; background: #effaf5; }
.router-command-progress-failed,
.router-command-progress-drift { border-color: #e3a5a5; background: #fff4f4; }
.router-command-progress p { margin: 3px 0 8px; color: var(--muted); }
.router-command-spinner {
  width: 22px;
  height: 22px;
  border: 3px solid #cfe3ea;
  border-top-color: var(--primary-dark, #0b2d5b);
  border-radius: 50%;
}
[data-port-profile-progress] .router-command-spinner { animation: router-command-spin .9s linear infinite; }
.router-command-progress-applied .router-command-spinner { border-color: #00a77c; background: #00c896; box-shadow: inset 0 0 0 5px #effaf5; }
.router-command-progress-failed .router-command-spinner,
.router-command-progress-drift .router-command-spinner { border-color: #b42318; border-radius: 5px; }
.router-command-steps { display: flex; flex-wrap: wrap; gap: 6px; }
.router-command-steps span { padding: 3px 8px; border-radius: 999px; background: #e9eef2; color: var(--muted); font-size: .78rem; font-weight: 800; }
.router-command-steps .done { background: #dff6ec; color: #0c6b4f; }
.router-command-steps .current { background: #dff5f8; color: #0b5260; }
.compact-button { width: auto; margin: 0; padding: 8px 12px; white-space: nowrap; }
@keyframes router-command-spin { to { transform: rotate(360deg); } }
@media (max-width: 680px) {
  .router-command-progress { grid-template-columns: auto minmax(0, 1fr); }
  .router-command-progress .compact-button { grid-column: 1 / -1; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  [data-port-profile-progress] .router-command-spinner { animation: none; }
}

.router-glance { display: grid; gap: 16px; margin-bottom: 18px; }
.router-glance h2 { margin: 0; }
.router-glance-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.router-glance-grid a { display: flex; min-height: 72px; padding: 12px; flex-direction: column; justify-content: space-between; gap: 8px; color: var(--text); text-decoration: none; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.router-glance-grid a:hover, .router-glance-grid a:focus-visible { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(11, 45, 91, .12); }
.router-glance-grid span:first-child { color: var(--muted); font-weight: 800; font-size: .82rem; }
.router-locate-control { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding-top: 12px; border-top: 1px solid var(--border); }
.router-locate-control form { margin: 0; }
.lifecycle-danger-zone { grid-column: 1 / -1; padding: 0; }
.lifecycle-danger-zone > summary { display: flex; justify-content: space-between; gap: 16px; padding: 18px; cursor: pointer; }
.lifecycle-danger-zone > summary span { color: var(--muted); font-size: .86rem; }
.lifecycle-danger-zone > .detail-grid { padding: 0 18px 18px; }
.history-toggle { margin-top: 12px; }
@media (max-width: 900px) { .router-glance-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .router-glance-grid { grid-template-columns: 1fr; } .lifecycle-danger-zone > summary { flex-direction: column; } }

/* Shared portal finish: clear hierarchy, calm surfaces, and comfortable touch targets. */
:root {
  --shadow-sm: 0 2px 8px rgba(25, 33, 42, .06);
  --shadow-md: 0 12px 32px rgba(25, 33, 42, .10);
  --radius-sm: 8px;
  --radius-md: 12px;
}
body { line-height: 1.5; }
h1, h2, h3 { text-wrap: balance; }
.sidebar { background: linear-gradient(180deg, #241238 0%, #1c1732 100%); box-shadow: 8px 0 24px rgba(25, 33, 42, .08); }
.sidebar nav { gap: 4px; }
.sidebar a { min-height: 42px; display: flex; align-items: center; border-radius: var(--radius-sm); }
.sidebar a.current { box-shadow: inset 3px 0 0 #d9c5ff; background: rgba(255,255,255,.14); }
.portal-identity { border-radius: var(--radius-md); background: rgba(255,255,255,.06); }
.admin-main { background: var(--bg); }
.page-header { padding-bottom: 4px; }
.page-header h1 { letter-spacing: -.025em; }
.metric, .panel, .summary-card { border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.metric { border-top: 3px solid transparent; }
.metric:hover, .panel:hover { box-shadow: var(--shadow-md); }
.metric span, .metric small { font-size: .88rem; }
.metric strong { letter-spacing: -.03em; }
.panel > h2, .panel > h3 { letter-spacing: -.015em; }
.button-link, button { min-height: 44px; border-radius: var(--radius-sm); transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.button-link:hover, button:hover { box-shadow: var(--shadow-sm); }
.button-link:active, button:active { transform: translateY(1px); }
input, select, textarea { min-height: 44px; border-radius: var(--radius-sm); }
input::placeholder, textarea::placeholder { color: #7b8792; opacity: 1; }
table { border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
th { letter-spacing: .04em; }
td a { text-decoration-thickness: 2px; text-underline-offset: 2px; }
.alert { border-radius: var(--radius-sm); }
.tabs { gap: 16px; }
.tabs > a, .tab-link { min-height: 44px; }
.modal-dialog { border-radius: var(--radius-md); }
.attention-panel { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); padding: 18px; margin-bottom: 18px; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.attention-list { display: grid; gap: 10px; }
.attention-groups { display: grid; gap: 16px; }
.attention-group { display: grid; gap: 8px; }
.attention-group-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.attention-group-heading h3 { margin: 0; font-size: 1rem; }
.attention-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--border); border-left: 4px solid #9ca3af; border-radius: var(--radius-sm); background: #fff; color: inherit; text-decoration: none; }
.attention-item:hover { box-shadow: var(--shadow-sm); }
.attention-item.critical { border-left-color: #b91c1c; }
.attention-item.warning { border-left-color: #b7791f; }
.attention-item.info { border-left-color: var(--primary); }
.attention-item small { display: block; color: var(--muted); margin-top: 3px; overflow-wrap: anywhere; }
.metric-grid.compact .metric strong { font-size: clamp(1.35rem, 3vw, 1.8rem); }
@media (max-width: 760px) {
  .portal-mobile-header { min-height: 68px; padding-inline: 14px; }
  .portal-menu-button { min-height: 44px; }
  .admin-main { padding: 16px 14px 28px; }
  .page-header h1 { font-size: clamp(1.55rem, 7vw, 2rem); }
  .panel, .metric { padding: 16px; }
  .metric-grid { gap: 10px; }
  .metric strong { font-size: 1.45rem; }
  .header-actions, .quick-actions { gap: 8px; }
  .header-actions .button-link, .quick-actions .button-link { flex: 1 1 180px; }
  .modal-dialog { width: calc(100vw - 24px); max-height: calc(100vh - 24px); }
  .section-heading { flex-direction: column; }
  .attention-item { display: grid; }
}
@media (max-width: 420px) {
  .mobile-identity { display: none; }
  .header-actions .button-link, .quick-actions .button-link { flex-basis: 100%; }
  .button-link, button { width: 100%; }
  .recovery-code-list { grid-template-columns: 1fr; }
  .modal-actions { display: grid; }
  .modal-actions > * { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .button-link, button { transition: none; }
  .button-link:active, button:active { transform: none; }
}

/* Guest access workspace: keep daily tasks prominent and configuration secondary. */
.guest-access-header .muted { margin: 5px 0 0; }
.guest-access-overview { margin-bottom: 16px; }
.guest-access-overview .metric { border-top-color: rgba(67, 32, 135, .24); }
.guest-access-overview .metric-status { font-size: 1.55rem; }
.guest-access-tabs { margin-bottom: 16px; }
#issue-access,
#plans,
#free-access,
#history,
#plan-settings { scroll-margin-top: 16px; }
.guest-access-primary-panel {
  border-color: rgba(67, 32, 135, .24);
  border-top: 4px solid var(--primary);
}
.section-heading h2 { margin: 0 0 4px; }
.section-heading p { margin: 0; }
.lead-email-workspace {
  display: grid;
  grid-template-columns: minmax(260px, .72fr) minmax(0, 1.6fr);
  gap: 22px;
  align-items: start;
}
.lead-template-picker,
.lead-template-list,
.lead-email-form { display: grid; gap: 12px; }
.lead-template-picker h3 { margin: 0 0 4px; font-size: 1rem; }
.lead-template-picker p { margin: 0; }
.lead-template-card {
  display: grid;
  gap: 5px;
  width: 100%;
  min-height: 0;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid transparent;
  background: #fff;
  color: var(--midnight);
  text-align: left;
}
.lead-template-card:hover,
.lead-template-card:focus-visible { border-color: rgba(67, 32, 135, .42); background: #faf8ff; }
.lead-template-card.is-selected { border-left-color: var(--primary); background: #f7f3ff; }
.lead-template-card span { color: var(--muted); font-weight: 600; line-height: 1.4; }
.lead-template-card small { color: var(--primary); font-weight: 800; }
.lead-sales-links { display: flex; flex-wrap: wrap; gap: 8px 14px; border-top: 1px solid var(--line); padding-top: 12px; font-size: .9rem; }
.lead-sales-links strong { flex-basis: 100%; }
.lead-email-form { border-left: 1px solid var(--line); padding-left: 22px; }
.lead-email-form label { display: grid; gap: 6px; color: var(--muted); font-weight: 750; }
.lead-email-addresses { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.lead-email-form textarea { min-height: 260px; resize: vertical; line-height: 1.55; }
.lead-email-send-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.lead-email-send-row p { margin: 0; }
.lead-email-send-row button { min-width: 220px; }
@media (max-width: 980px) {
  .lead-email-workspace { grid-template-columns: 1fr; }
  .lead-email-form { border-left: 0; border-top: 1px solid var(--line); padding: 18px 0 0; }
}
@media (max-width: 760px) {
  .lead-email-addresses { grid-template-columns: 1fr; }
  .lead-email-send-row { align-items: stretch; flex-direction: column; }
  .lead-email-send-row button { width: 100%; min-width: 0; }
}
.guest-code-form {
  display: grid;
  grid-template-columns: minmax(220px, 1.25fr) minmax(90px, .35fr) minmax(240px, 1fr) minmax(240px, 1.2fr);
  gap: 12px;
  align-items: end;
}
.guest-code-form label,
.guest-access-settings-form label,
.disclosure-field {
  min-width: 0;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 750;
}
.guest-code-form input,
.guest-code-form select { width: 100%; min-width: 0; }
.guest-code-form .full,
.guest-access-settings-form .full { grid-column: 1 / -1; }
.guest-code-form button { grid-column: 1 / -1; justify-self: start; min-width: 210px; }
.form-disclosure,
.settings-disclosure,
.subsection-disclosure {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f8fafb;
  box-shadow: none;
}
.form-disclosure { padding: 10px 12px; }
.form-disclosure summary,
.settings-disclosure summary,
.subsection-disclosure summary,
.guest-access-details > summary {
  cursor: pointer;
  color: var(--primary-dark);
  font-weight: 850;
}
.form-disclosure summary span,
.subsection-disclosure summary span { color: var(--muted); font-size: .82rem; font-weight: 700; }
.disclosure-field { margin-top: 10px; }
.guest-plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 12px;
}
.guest-plan-card {
  display: grid;
  align-content: start;
  gap: 13px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px;
  background: #fbfcfd;
}
.guest-plan-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.guest-plan-card header > div { display: grid; gap: 3px; min-width: 0; }
.guest-plan-card header strong { overflow-wrap: anywhere; }
.guest-plan-card header span:not(.badge),
.guest-plan-card small { color: var(--muted); line-height: 1.4; }
.guest-plan-card dl { grid-template-columns: minmax(82px, .65fr) 1fr; }
.guest-plan-card .button-link { margin-top: auto; }
.inactive-plan { background: #f7f8f9; box-shadow: none; }
.inactive-plan strong { color: #4f5b66; }
.subsection-disclosure { margin-top: 14px; padding: 13px 14px; }
.subsection-disclosure[open] > summary { margin-bottom: 14px; }
.compact-empty { padding: 18px; }
.compact-empty h3 { margin: 0 0 5px; }
.compact-empty p { margin: 0 0 12px; }
.empty-state-copy { color: var(--muted); }
.guest-access-settings-form .setting-check,
.setting-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: #f8fafb;
}
.guest-access-settings-form input[type="checkbox"],
.setting-check input[type="checkbox"] {
  flex: 0 0 auto;
  width: 22px;
  min-height: 22px;
  margin: 1px 0 0;
}
.setting-check span { display: grid; gap: 2px; color: var(--ink); }
.setting-check small { color: var(--muted); font-weight: 650; line-height: 1.35; }
.settings-disclosure { padding: 13px 14px; }
.settings-disclosure-grid { margin-top: 14px; }
.guest-access-settings-form > button { justify-self: start; min-width: 190px; }
.guest-access-details { margin-top: 18px; }
.guest-access-details[open] > summary { margin-bottom: 14px; }
.guest-method-list { margin-top: 12px; }
.guest-method-list article { box-shadow: none; }
.table-scroll { max-width: 100%; overflow-x: auto; }
.guest-access-history-table { box-shadow: none; }
.plan-edit-disclosure { margin-top: 2px; border-top: 1px solid var(--line); padding-top: 10px; }
.plan-edit-disclosure > summary { color: var(--primary); font-weight: 850; cursor: pointer; }
.plan-editor { margin-top: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.plan-editor .setting-check { align-self: end; }
.plan-editor button { justify-self: start; min-width: 150px; }
.plan-capability-warning { margin: 0; border-left: 3px solid var(--warning); padding: 9px 10px; background: #fff7e6; color: #714a00; font-size: .88rem; line-height: 1.4; }
.plan-readiness { margin: 0; border-left: 3px solid var(--primary); padding: 9px 10px; background: #f2f7fb; color: var(--text); font-size: .88rem; line-height: 1.4; }
.plan-readiness strong, .plan-readiness span { display: block; }
.plan-readiness span { margin-top: 2px; color: var(--muted); }
.plan-readiness.ready { border-left-color: var(--success); background: #ecfdf7; }
.plan-readiness.payout_required { border-left-color: var(--warning); background: #fff7e6; }
.plan-readiness.disabled { border-left-color: #9ca3af; background: #f4f6f8; }
.test-mode-banner { display: flex; align-items: center; justify-content: space-between; gap: 24px; border-color: #cfc1f7; background: linear-gradient(120deg, #f7f3ff, #effcff); }
.test-mode-banner h2, .test-mode-banner p { margin-bottom: 6px; }
.payout-status-card form { margin-top: 16px; }
.transaction-filters { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; margin: 0 0 16px; }
.transaction-filters label { min-width: 180px; }
.plain-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.plain-list li { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding: 8px 0; }
.details-grid { margin-top: 16px; }

@media (max-width: 1180px) {
  .guest-code-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .guest-code-form button { min-width: 0; }
}

@media (max-width: 760px) {
  .plan-editor { grid-template-columns: minmax(0, 1fr); }
  .test-mode-banner { align-items: flex-start; flex-direction: column; }
  .transaction-filters, .transaction-filters label, .transaction-filters button { width: 100%; }
  .guest-access-tabs {
    flex-wrap: nowrap;
    gap: 14px;
    overflow-x: auto;
    scrollbar-width: thin;
  }
  .guest-access-tabs > a { flex: 0 0 auto; }
  .guest-code-form { grid-template-columns: minmax(0, 1fr); }
  .guest-code-form .full { grid-column: auto; }
  .guest-access-settings-form > button { width: 100%; }
  .guest-access-history-table,
  .guest-access-history-table tbody,
  .guest-access-history-table tr,
  .guest-access-history-table td {
    display: block;
    width: 100%;
  }
  .guest-access-history-table thead { display: none; }
  .guest-access-history-table tr {
    display: grid;
    gap: 7px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    padding: 12px;
    background: #fff;
  }
  .guest-access-history-table td {
    display: grid;
    grid-template-columns: minmax(92px, .7fr) 1fr;
    gap: 10px;
    min-width: 0;
    border: 0;
    padding: 0;
  }
  .guest-access-history-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: .78rem;
    font-weight: 850;
    text-transform: uppercase;
  }
  .guest-access-history-table .empty { display: block; text-align: center; }
  .guest-access-history-table .empty::before { content: none; }
}
.router-setup-shell {
  max-width: 820px;
  margin: 0 auto;
  padding-bottom: 3rem;
}
.router-setup-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.router-setup-header h1 { margin: .15rem 0; }
.router-setup-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .5rem;
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
}
.router-setup-steps li {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .65rem;
  border: 1px solid var(--border-color, #d9e1e8);
  border-radius: .7rem;
  color: #65758b;
  background: #fff;
  font-size: .85rem;
  font-weight: 700;
}
.router-setup-steps li span {
  display: grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: #e9eef4;
  color: #31465d;
}
.router-setup-steps li.current {
  border-color: #00a889;
  color: #0b2d5b;
  box-shadow: 0 0 0 2px rgba(0, 168, 137, .12);
}
.router-setup-steps li.current span,
.router-setup-steps li.complete span {
  background: #00a889;
  color: #fff;
}
.router-setup-card { padding: clamp(1.25rem, 4vw, 2.25rem); }
.router-setup-card h2 { margin-top: .2rem; }
.router-setup-card label:not(.setup-choice) {
  display: grid;
  gap: .4rem;
  margin: 1rem 0;
  font-weight: 700;
}
.router-setup-card label small {
  font-weight: 400;
  color: #65758b;
}
.compact-fields { gap: 1rem; }
.compact-fields input[type="color"] {
  width: 100%;
  min-height: 3rem;
  padding: .2rem;
}
.router-setup-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .75rem;
  margin-top: 1.5rem;
}
.setup-choice {
  display: flex;
  align-items: flex-start;
  gap: .8rem;
  padding: 1rem;
  margin: 1rem 0;
  border: 1px solid #d9e1e8;
  border-radius: .75rem;
  cursor: pointer;
  background: #fff;
}
.setup-choice:has(input:checked) {
  border-color: #00a889;
  background: #f0fffb;
  box-shadow: 0 0 0 2px rgba(0, 168, 137, .12);
}
.setup-choice input { margin-top: .3rem; }
.setup-choice span {
  display: grid;
  gap: .25rem;
}
.setup-choice small,
.setup-note,
.router-setup-help { color: #65758b; }
.setup-note {
  padding: .8rem 1rem;
  border-radius: .65rem;
  background: #f3f6f9;
}
.setup-review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  margin: 1.25rem 0;
}
.setup-review-grid article {
  display: grid;
  gap: .2rem;
  padding: 1rem;
  border: 1px solid #e0e6ec;
  border-radius: .7rem;
  background: #fafbfd;
}
.setup-review-grid span {
  color: #65758b;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.setup-complete-callout {
  padding: 1rem;
  border-radius: .75rem;
  background: #ecfff8;
  border: 1px solid #9ee8d2;
}
.setup-complete-callout p { margin: .4rem 0 0; }
.router-setup-help {
  text-align: center;
  margin: 1.2rem 0;
}
@media (max-width: 700px) {
  .router-setup-header { display: block; }
  .router-setup-header .badge {
    display: inline-block;
    margin-top: .5rem;
  }
  .router-setup-steps { grid-template-columns: repeat(2, 1fr); }
  .setup-review-grid,
  .compact-fields { grid-template-columns: 1fr; }
  .router-setup-actions { justify-content: stretch; }
  .router-setup-actions > * {
    flex: 1;
    text-align: center;
  }
}

.intake-safety {
  border-left: .35rem solid #c46b00;
}
.source-links { margin-bottom: 0; }
.intake-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.intake-card-header h2 { margin: .15rem 0; }
.intake-card-actions {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: .55rem;
}
.field-feedback {
  display: block;
  margin-top: .35rem;
  color: #52677e;
  font-size: .82rem;
}
.intake-progress {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: .35rem;
  padding: 0;
  margin: 1.25rem 0;
  list-style: none;
}
.intake-progress li {
  padding: .55rem .35rem;
  border-radius: .45rem;
  background: #edf1f5;
  color: #53657a;
  font-size: .78rem;
  text-align: center;
}
.intake-progress li.current {
  background: #0d3568;
  color: #fff;
  font-weight: 700;
}
.firmware-hash-output {
  display: block;
  overflow-wrap: anywhere;
  padding: .75rem;
  border-radius: .55rem;
  background: #f3f6f9;
  color: #465b73;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .78rem;
}
.automation-split,
.intake-guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.intake-guide-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.intake-guide-step {
  border-top: .3rem solid #cbd5df;
}
.intake-guide-step.current {
  border-color: #0d3568;
  box-shadow: 0 0 0 2px rgba(13, 53, 104, .08), var(--shadow-sm);
}
.intake-guide-step.complete {
  border-color: #00a77c;
}
.guide-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: 1rem;
}
.guide-actions .button-link { flex: 1 1 220px; text-align: center; }
@media (max-width: 800px) {
  .intake-card-header { display: block; }
  .intake-card-actions { align-items: flex-start; margin-top: .7rem; }
  .intake-progress { grid-template-columns: repeat(2, 1fr); }
  .automation-split,
  .intake-guide-grid { grid-template-columns: 1fr; }
  .intake-guide-summary { display: block; }
}
@media print {
  .automation-split,
  .intake-guide-grid { grid-template-columns: 1fr 1fr; }
  .guide-actions,
  .header-actions { display: none !important; }
  .intake-guide-step { break-inside: avoid; box-shadow: none; }
}
