:root {
  color-scheme: light;
  font-family:
    "Segoe UI",
    -apple-system,
    BlinkMacSystemFont,
    Arial,
    sans-serif;
  color: #18232e;
  background: #f4f6f8;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
::selection {
  background: #c9e8db;
  color: #153f32;
}
.portal-admin ::selection {
  background: #d9def8;
  color: #1c275f;
}
html {
  scrollbar-color: #c5d0db transparent;
}
a {
  color: #136b52;
  text-underline-offset: 3px;
}
.portal-admin a {
  color: #24368a;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  touch-action: manipulation;
}
input,
textarea {
  caret-color: #136b52;
}
.portal-admin input,
.portal-admin textarea {
  caret-color: #3346a8;
}
:focus-visible {
  outline: 3px solid #5c91cc;
  outline-offset: 3px;
}
.skip {
  position: fixed;
  left: 16px;
  top: -100px;
  z-index: 1600;
  background: white;
  padding: 12px;
}
.skip:focus {
  top: 12px;
}
/* The same HTML is a usable fallback when JavaScript is unavailable. */
body > header {
  padding: 20px 32px;
  background: white;
  border-bottom: 1px solid #e3e8ee;
}
body > header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
body > main {
  max-width: 1180px;
  margin: 32px auto;
  padding: 0 24px;
}
body > main form {
  margin: 20px 0;
}
body > main input:not([type="hidden"]),
body > main select,
body > main textarea {
  padding: 10px;
  display: block;
  max-width: 100%;
  margin: 8px 0 16px;
  border: 1px solid #c7d0da;
  border-radius: 8px;
}
body > main button {
  padding: 10px 16px;
  cursor: pointer;
}
.panel {
  min-width: 0;
}
.mono,
code {
  overflow-wrap: anywhere;
  word-break: break-all;
}
pre {
  white-space: pre;
  overflow: auto;
  max-width: 100%;
}
.table-wrap {
  max-width: 100%;
  overflow: auto;
}
.top .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}
.brand-mark {
  display: block;
  flex: none;
  color: #136b52;
}
.portal-admin .brand-mark {
  color: #3346a8;
}
.portal-name {
  font-size: 14px;
  font-weight: 500;
  color: #5b6877;
  margin-left: 4px;
}
.wordmark {
  display: block;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: #18232e;
}
.brand-caption {
  display: block;
  margin-top: 2px;
  color: #5b6877;
  font-size: 12px;
  font-weight: 500;
}
a.sidebar-brand {
  color: inherit;
  text-decoration: none;
}
.workspace-title {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: #18232e;
}
#mui-portal {
  min-height: 100dvh;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 30px 24px 24px;
}
.sidebar-brand svg {
  font-size: 30px;
}
.workspace-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  margin: 0 16px 16px;
  border: 1px solid #e3e8ee;
  border-radius: 12px;
}
.sidebar-list {
  padding: 0 12px !important;
}
.sidebar-list .MuiListItemButton-root {
  border-radius: 8px;
  margin-bottom: 3px;
  padding: 9px 14px;
}
.sidebar-list .Mui-selected {
  color: #136b52;
  background: #e7f2ec !important;
}
.portal-admin .sidebar-list .Mui-selected {
  color: #3346a8;
  background: #eceffd !important;
}
.sidebar-list .Mui-selected svg {
  color: inherit;
}
.sidebar-bottom {
  margin-top: auto;
  padding: 20px 24px;
  border-top: 1px solid #e3e8ee;
  overflow-wrap: anywhere;
}
.sidebar-bottom .portal-form {
  padding: 4px 0 0;
  margin: 0;
  border: 0;
  background: none;
}
.sidebar-bottom .MuiButton-root {
  justify-content: flex-start;
  padding-left: 0;
}
.workspace {
  margin-left: 252px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.MuiDrawer-paper {
  background: #fbfcfd;
  border-right: 1px solid #e3e8ee;
}
.workspace-header {
  height: 76px;
  flex-shrink: 0;
  background: #fff;
  border-bottom: 2px solid #136b52;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 40px;
}
.portal-admin .workspace-header {
  border-bottom-color: #3346a8;
}
.page-content {
  width: 100%;
  max-width: 1280px;
  padding: 36px 40px 48px;
  margin: 0 auto;
  flex: 1;
  min-width: 0;
}
.page-content > h1,
.page-content > .panel > h1 {
  margin: 0 0 8px;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.page-content .lead {
  margin-top: 0;
  font-size: 16px;
  line-height: 1.55;
  max-width: 62ch;
}
.page-content h2 {
  margin: 32px 0 16px;
}
.page-content h3 {
  margin: 24px 0 12px;
}
.page-content p {
  margin: 12px 0;
  max-width: 80ch;
  line-height: 1.65;
}
.page-content .MuiAlert-root {
  margin: 16px 0;
}
.page-content > .MuiAlert-root:first-child {
  margin-top: 0;
}
.workspace-footer {
  padding: 0 40px 24px;
  color: #687482;
  font-size: 12px;
}
.portal-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 660px;
  padding: 24px;
  margin: 22px 0;
  background: white;
  border: 1px solid #e3e8ee;
  border-radius: 12px;
}
.portal-form .MuiButton-root {
  align-self: flex-start;
}
.portal-form .MuiFormControlLabel-root {
  margin-left: -9px;
}
.portal-form p {
  margin: 0;
}
.portal-field {
  width: 100%;
  min-width: 0;
}
.portal-fieldset {
  padding: 0;
  border: 0;
  margin: 24px 0;
  min-width: 0;
}
.portal-fieldset > legend {
  font-size: 20px;
  font-weight: 650;
  margin-bottom: 0;
}
.portal-fieldset .portal-form {
  margin-top: 16px;
}
.portal-table {
  background: #fff;
  border: 1px solid #e3e8ee;
  border-radius: 12px;
  margin: 20px 0;
}
.portal-table th {
  white-space: nowrap;
}
.portal-table .MuiTableCell-head {
  background: #f7f9fb;
  color: #3e4c5c;
  font-size: 12px;
  font-weight: 650;
}
.portal-table .MuiTableCell-root {
  padding: 12px 16px;
}
.portal-table td {
  vertical-align: top;
  max-width: 440px;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}
.portal-table caption {
  padding: 12px 18px;
  color: #687482;
  font-size: 12px;
  text-align: left;
}
.portal-table .portal-form {
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  gap: 8px;
  background: none;
}
.portal-table .MuiButton-root {
  font-size: 12px;
  min-height: 34px;
  white-space: nowrap;
}
.portal-table .MuiTableRow-root:hover td {
  background: #fafbfc;
}
.table-wrap .portal-table {
  margin: 0;
}
.facts {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(0, 2fr);
  gap: 12px 24px;
  margin: 24px 0;
  font-size: 14px;
  max-width: 850px;
}
.facts dt {
  color: #617082;
}
.facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.overview-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px 24px;
  margin: 8px 0 28px;
  padding: 20px 24px;
  background: #fff;
  border: 1px solid #e3e8ee;
  border-radius: 12px;
}
.overview-stats .MuiTypography-body2 {
  min-height: 2.6em;
  line-height: 1.35;
}
.stat-number {
  font-size: 34px !important;
  letter-spacing: -0.025em;
  font-weight: 650 !important;
  margin: 6px 0 0 !important;
  font-variant-numeric: tabular-nums;
  color: #136b52;
}
.portal-admin .stat-number {
  color: #3346a8;
}
.sim-choice {
  display: grid;
  gap: 12px;
  max-width: 40rem;
  margin: 16px 0 24px;
}
.sim-choice form {
  margin: 0;
}
.checks {
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0;
  max-width: 640px;
}
.checks li {
  padding: 12px 0;
  border-top: 1px solid #e3e8ee;
}
.checks a {
  font-weight: 650;
}
.MuiButton-root:active {
  transform: translateY(1px);
}
.setup-step {
  display: flex;
  align-items: center;
  gap: 12px;
}
.onboarding {
  background: #fff;
  border: 1px solid #e3e8ee;
  border-radius: 16px;
  padding: 28px;
  margin: 24px 0;
}
.onboarding h2 {
  margin: 0 0 12px;
}
.onboarding .trail {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  counter-reset: step;
}
.onboarding .trail li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr);
  column-gap: 12px;
  padding: 16px 0;
  border-top: 1px solid #e3e8ee;
}
.onboarding .trail li::before {
  content: counter(step);
  grid-column: 1;
  grid-row: 1 / span 2;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #136b52;
}
.portal-admin .onboarding .trail li::before {
  color: #3346a8;
}
.onboarding strong {
  display: block;
  grid-column: 2;
  grid-row: 1;
}
.onboarding .trail span {
  grid-column: 2;
  grid-row: 2;
  color: #3e4c5a;
}
.onboarding .MuiButton-root {
  margin-top: 10px;
}
.step-section {
  background: #fff;
  border: 1px solid #e3e8ee;
  border-radius: 14px;
  padding: 28px;
  margin: 24px 0;
  min-width: 0;
}
.step-section > h2:first-child {
  margin-top: 0;
}
.step-section .portal-form {
  border: 0;
  padding: 0;
  margin: 22px 0 0;
}
.step-section .portal-form .MuiTextField-root {
  max-width: 600px;
}
.step-section details {
  margin-top: 20px;
}
.step-section .portal-fieldset {
  margin: 0;
}
.copy-value {
  padding: 16px;
  background: #f4f7fa;
  border-radius: 10px;
  font-family: monospace;
}
.copy-value code {
  font-size: 14px;
}
.code-block {
  max-width: 100%;
  margin: 14px 0;
  border: 1px solid #dce3e9;
  border-radius: 12px;
  overflow: hidden;
  background: #f7f9fb;
}
.code-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: white;
  border-bottom: 1px solid #e3e8ee;
}
.code-block pre {
  margin: 0;
  padding: 20px;
  font-size: 13px;
  line-height: 1.7;
  tab-size: 2;
  color: #24394b;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}
.secret-block pre {
  white-space: pre-wrap;
  word-break: break-all;
}
.example-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 8px;
}
.pair-setup {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 32px;
  align-items: center;
  background: white;
  border: 1px solid #e3e8ee;
  border-radius: 16px;
  padding: 28px;
  margin: 24px 0;
}
.qr-surface {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 260px;
  background: #fff;
}
.pair-setup .MuiChip-root {
  align-self: flex-start;
}
.pair-setup .MuiButton-root {
  align-self: flex-start;
}
.pair-setup p {
  margin: 0;
}
.pair-setup.is-ready {
  grid-template-columns: 1fr;
}
.pair-confirm {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pair-confirm form,
#pair-confirm {
  margin: 0;
}
.pair-confirm .MuiButton-root,
#pair-confirm button {
  min-height: 48px;
  padding: 12px 20px;
  border: 0;
  border-radius: 12px;
  background: #136b52;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}
.auth-shell {
  min-height: 100dvh;
  max-width: 570px;
  margin: auto;
  padding: 48px 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  justify-content: center;
}
.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.auth-brand svg {
  font-size: 32px;
}
.auth-card {
  padding: 36px !important;
  border: 1px solid #e3e8ee !important;
  border-radius: 16px !important;
}
.auth-card h1 {
  font-size: 26px;
  margin-bottom: 12px;
}
.auth-card p {
  line-height: 1.65;
  color: #5b6877;
}
.auth-card .portal-form {
  border: 0;
  padding: 0;
  margin: 28px 0;
  max-width: none;
}
.auth-card .portal-form .MuiButton-root {
  width: 100%;
  margin-top: 2px;
}
.auth-card .guest-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 13px;
  margin-top: 16px;
}
.auth-card .MuiAlert-root {
  margin-bottom: 20px;
}
.auth-card .portal-switch {
  font-size: 13px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #e3e8ee;
}
.page-content .panel > details {
  margin: 20px 0;
  padding: 2px 18px 8px;
  background: #fff;
  border: 1px solid #e3e8ee;
  border-radius: 12px;
}
details {
  margin: 20px 0;
}
summary {
  cursor: pointer;
  font-weight: 600;
  color: #344657;
  padding: 10px 0;
}
details > p {
  font-size: 14px;
}
.help-list {
  padding-left: 22px;
  color: #506173;
  line-height: 1.8;
}
.help-list li {
  padding: 4px 0;
}
.status-note {
  color: #526270;
  font-size: 14px;
}
@media (max-width: 900px) {
  .workspace {
    margin-left: 0;
  }
  .workspace-header {
    padding: 0 20px;
    height: 64px;
  }
  .page-content {
    padding: 28px 20px;
  }
  .workspace-footer {
    padding: 0 20px 20px;
  }
  .pair-setup {
    grid-template-columns: 1fr;
  }
  .overview-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 40rem) {
  .auth-shell {
    padding: 24px 16px;
  }
  .auth-card {
    padding: 24px !important;
  }
  .page-content h1 {
    font-size: 26px;
  }
  .step-section,
  .onboarding {
    padding: 20px;
  }
  .portal-form {
    padding: 20px;
  }
  .example-fields {
    grid-template-columns: minmax(0, 1fr);
  }
  .workspace-header .MuiChip-icon {
    display: none;
  }
  .workspace-header .MuiChip-label {
    font-size: 11px;
  }
  .facts {
    grid-template-columns: minmax(100px, 1fr) minmax(0, 1.5fr);
    gap: 12px;
  }
  .code-tools {
    flex-wrap: wrap;
  }
  .code-block pre {
    padding: 14px;
    font-size: 12px;
  }
  .pair-setup {
    padding: 18px;
  }
  .pair-setup svg {
    max-width: 100%;
    height: auto;
  }
  .overview-stats {
    gap: 20px;
  }
  .stat-number {
    font-size: 28px !important;
  }
  .portal-table,
  .portal-table.MuiTableContainer-root {
    overflow-x: auto;
    max-width: 100%;
  }
  .portal-table table,
  .portal-table .MuiTable-root {
    min-width: 0;
    width: 100%;
  }
  .portal-table .MuiTableCell-root {
    padding: 10px 8px;
  }
  .portal-table .MuiButton-root {
    white-space: normal;
    min-width: 0;
    line-height: 1.2;
  }
  .page-content {
    padding: 24px 16px;
  }
  .workspace-header {
    padding: 0 12px;
  }
  .portal-table .mono {
    max-width: 200px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .MuiButton-root:active {
    transform: none;
  }
}

.async-controls {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.async-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #5b6877;
  font-size: 13px;
}
.async-form[aria-busy="true"] button {
  opacity: 0.6;
}
.sidebar-list svg {
  width: 22px;
  height: 22px;
}
.sidebar-brand svg,
.auth-brand svg {
  width: 32px;
  height: 32px;
}
.choice-field {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  min-width: 0;
}
.choice-label {
  font-size: 13px;
  font-weight: 600;
  color: #18232e;
}
.choice-trigger.MuiButton-root,
.choice-row.MuiButton-root {
  width: 100%;
  justify-content: space-between;
  min-height: 48px;
  color: #18232e;
  border-color: #e3e8ee;
  background: #fff;
  font-weight: 600;
  text-align: left;
}
.choice-trigger.MuiButton-root {
  width: 100%;
}
.choice-trigger.MuiButton-root:hover,
.choice-row.MuiButton-root:hover {
  border-color: #136b52;
  background: #e7f2ec;
}
.portal-admin .choice-trigger.MuiButton-root:hover,
.portal-admin .choice-row.MuiButton-root:hover,
.portal-admin .choice-row.is-selected {
  border-color: #3346a8;
  background: #eceffd;
}
.choice-row.is-selected {
  border-color: #136b52;
  background: #e7f2ec;
}
.choice-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
  text-align: left;
}
.choice-search {
  margin: 0 0 12px;
}
.choice-help {
  margin: 0 0 12px;
}
.choice-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(60dvh, 420px);
  overflow: auto;
}
.choice-dialog .MuiDialog-paper {
  background-color: #fff;
  background-image: none;
  color: #18232e;
  border: 1px solid #e3e8ee;
  box-shadow: 0 18px 40px rgb(24 35 46 / 16%);
}
.choice-dialog .MuiBackdrop-root {
  background-color: rgb(24 35 46 / 48%);
}
.sim-pick {
  margin: 0;
}
.sim-pick .MuiButton-root {
  width: 100%;
}
.example-fields .choice-field {
  grid-column: 1 / -1;
}
.MuiDialog-paper {
  border-radius: 12px;
}
.MuiDialog-paperFullScreen {
  border-radius: 0;
}

/* Tables on narrow screens.
   Tablet: the table keeps its columns, scrolls sideways inside its own box and
   the first column (email, date) stays visible.
   Phone: a table whose cells carry data-label turns into one card per row,
   label on the left, value on the right, at a readable size. */
.portal-table,
.portal-table.MuiTableContainer-root {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}
@media (max-width: 900px) {
  .portal-table table,
  .portal-table .MuiTable-root {
    width: max-content;
    min-width: 100%;
  }
  .portal-table td,
  .portal-table th {
    max-width: 260px;
  }
  .portal-table tr > :first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background: #fff;
    box-shadow: 1px 0 0 #e3e8ee;
  }
  .portal-table thead tr > :first-child {
    z-index: 2;
    background: #f7f9fb;
  }
}
@media (max-width: 40rem) {
  .portal-table:has(td[data-label]) {
    border: 0;
    background: none;
    overflow: visible;
  }
  .portal-table table:has(td[data-label]),
  .portal-table table:has(td[data-label]) tbody,
  .portal-table table:has(td[data-label]) tr,
  .portal-table table:has(td[data-label]) td {
    display: block;
    width: 100%;
    min-width: 0;
  }
  .portal-table table:has(td[data-label]) thead {
    display: none;
  }
  .portal-table table:has(td[data-label]) caption {
    display: block;
    padding: 0 0 8px;
  }
  .portal-table table:has(td[data-label]) tr {
    margin: 0 0 12px;
    padding: 8px 14px;
    border: 1px solid #e3e8ee;
    border-radius: 12px;
    background: #fff;
  }
  .portal-table table:has(td[data-label]) tr > :first-child {
    position: static;
    box-shadow: none;
  }
  .portal-table table:has(td[data-label]) td,
  .portal-table table:has(td[data-label]) .MuiTableCell-root {
    max-width: none;
    padding: 6px 0 !important;
    border-bottom: 1px solid #f0f3f6;
    font-size: 15px;
    line-height: 1.4;
    word-break: normal;
    overflow-wrap: anywhere;
  }
  .portal-table table:has(td[data-label]) td:last-child {
    border-bottom: 0;
  }
  .portal-table table:has(td[data-label]) td[data-label] {
    display: grid;
    grid-template-columns: minmax(96px, 38%) minmax(0, 1fr);
    gap: 10px;
  }
  .portal-table table:has(td[data-label]) td[data-label]::before {
    content: attr(data-label);
    color: #5b6876;
    font-size: 13px;
    font-weight: 600;
  }
  .portal-table table:has(td[data-label]) .mono,
  .portal-table table:has(td[data-label]) code {
    max-width: none;
    word-break: normal;
    overflow-wrap: anywhere;
  }
  .portal-table table:has(td[data-label]) .MuiTableRow-root:hover td {
    background: none;
  }
  .filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }
}
