:root {
  color-scheme: light dark;
  --bg: #f5f7fa;
  --bg-soft: #eaf0f6;
  --surface: #ffffff;
  --surface-soft: #f7f9fc;
  --surface-muted: #eef3f8;
  --surface-raised: rgba(255, 255, 255, 0.9);
  --border: rgba(54, 68, 84, 0.16);
  --border-strong: rgba(58, 96, 128, 0.28);
  --text: #101820;
  --muted: #526170;
  --soft: #748292;
  --accent: #2f73b8;
  --accent-soft: #dcebf9;
  --accent-strong: #174e84;
  --success: #2d8c67;
  --warning: #a2641b;
  --button-bg: #1e5f9f;
  --button-text: #ffffff;
  --shadow: rgba(24, 37, 52, 0.13);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1016;
    --bg-soft: #121923;
    --surface: #151c25;
    --surface-soft: #101720;
    --surface-muted: #1b2530;
    --surface-raised: rgba(20, 28, 38, 0.92);
    --border: rgba(172, 190, 210, 0.15);
    --border-strong: rgba(132, 169, 201, 0.3);
    --text: #eef4f8;
    --muted: #a7b4c2;
    --soft: #7f8c9a;
    --accent: #7eb0dc;
    --accent-soft: #1e3347;
    --accent-strong: #a9cce8;
    --success: #74c69d;
    --warning: #e3ad67;
    --button-bg: #d9e9f7;
    --button-text: #081019;
    --shadow: rgba(0, 0, 0, 0.36);
  }
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 100%);
  color: var(--text);
}

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

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

[hidden] {
  display: none !important;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  height: 100vh;
  padding: 24px;
  border-right: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-raised) 92%, transparent);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 750;
}

.mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent-soft) 86%, var(--surface)), var(--surface));
  color: var(--accent-strong);
  font-weight: 800;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.nav a:hover,
.nav a[aria-current="page"] {
  border-color: var(--border);
  background: var(--surface-muted);
  color: var(--text);
}

.return-link {
  margin-top: auto;
  color: var(--accent-strong);
}

.sidebar .button {
  width: 100%;
}

.main {
  min-width: 0;
  padding: clamp(20px, 4vw, 42px);
}

.topbar {
  display: none;
}

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

.page-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 10px;
}

.page-title {
  display: grid;
  gap: 10px;
  max-width: 820px;
}

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

h1 {
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0;
}

h3 {
  font-size: 16px;
  line-height: 1.25;
}

p,
li {
  color: var(--muted);
  line-height: 1.6;
}

.eyebrow {
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 750;
}

.badge-row,
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.badge,
.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-soft) 54%, transparent);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.status.neutral {
  border-color: var(--border);
  background: var(--surface-soft);
  color: var(--muted);
}

.status.good {
  border-color: color-mix(in srgb, var(--success) 52%, var(--border));
  background: color-mix(in srgb, var(--success) 12%, transparent);
  color: color-mix(in srgb, var(--success) 82%, var(--text));
}

.status.warning {
  border-color: color-mix(in srgb, var(--warning) 52%, var(--border));
  background: color-mix(in srgb, var(--warning) 12%, transparent);
  color: color-mix(in srgb, var(--warning) 82%, var(--text));
}

.message {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  line-height: 1.5;
}

.message.success {
  border-color: color-mix(in srgb, var(--success) 52%, var(--border));
  background: color-mix(in srgb, var(--success) 11%, var(--surface-raised));
  color: color-mix(in srgb, var(--success) 78%, var(--text));
}

.message.warning {
  border-color: color-mix(in srgb, var(--warning) 52%, var(--border));
  background: color-mix(in srgb, var(--warning) 11%, var(--surface-raised));
  color: color-mix(in srgb, var(--warning) 82%, var(--text));
}

.message.error {
  border-color: color-mix(in srgb, #c85252 52%, var(--border));
  background: color-mix(in srgb, #c85252 10%, var(--surface-raised));
  color: color-mix(in srgb, #c85252 80%, var(--text));
}

.session-box {
  display: grid;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.session-box strong {
  color: var(--text);
}

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

.card {
  display: grid;
  gap: 14px;
  align-content: start;
  min-height: 100%;
  padding: clamp(18px, 2.6vw, 24px);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-raised);
  box-shadow: 0 18px 42px color-mix(in srgb, var(--shadow) 72%, transparent);
}

.dashboard-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15.5rem), 1fr));
  gap: 16px;
  align-items: stretch;
}

.dashboard-card {
  display: grid;
  gap: 12px;
  align-content: start;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-raised);
  box-shadow: 0 12px 28px color-mix(in srgb, var(--shadow) 46%, transparent);
}

.dashboard-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.dashboard-card h2 {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.dashboard-number,
.dashboard-primary {
  color: var(--text);
  line-height: 1.05;
}

.dashboard-number {
  font-size: 34px;
}

.dashboard-primary {
  font-size: 22px;
}

.dashboard-muted,
.dashboard-checks {
  color: var(--muted);
  line-height: 1.45;
}

.dashboard-checks {
  display: grid;
  gap: 6px;
  font-size: 13px;
}

.dashboard-check {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.dashboard-check::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--warning);
}

.dashboard-check[data-complete="true"]::before {
  background: var(--success);
}

.dashboard-link {
  justify-self: start;
  margin-top: 2px;
  color: var(--accent-strong);
  font-weight: 750;
}

.span-12 {
  grid-column: span 12;
}

.span-8 {
  grid-column: span 8;
}

.span-6 {
  grid-column: span 6;
}

.span-4 {
  grid-column: span 4;
}

.device-groups {
  display: grid;
  gap: 16px;
}

.license-card {
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.account-details-card {
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.account-card-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 16px;
  align-items: center;
  width: 100%;
  padding: clamp(16px, 2.4vw, 22px);
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.account-card-header[aria-expanded="false"] {
  border-bottom: 0;
}

.account-card-header span:first-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.account-card-header strong {
  color: var(--text);
  font-size: 20px;
}

.account-card-header small {
  color: var(--muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

[data-account-collapse-icon] {
  transition: transform 160ms ease;
}

.account-card-header[aria-expanded="false"] [data-account-collapse-icon] {
  transform: rotate(-90deg);
}

.account-card-body {
  display: grid;
  gap: 14px;
  padding: clamp(16px, 2.4vw, 22px);
}

.license-card-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  width: 100%;
  padding: clamp(16px, 2.4vw, 22px);
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.license-card-header[aria-expanded="false"] {
  border-bottom: 0;
}

.license-card-title,
.license-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  min-width: 0;
}

.license-card-title {
  display: grid;
  gap: 4px;
}

.license-card-title strong {
  color: var(--text);
}

.license-card-title span,
.license-card-badges {
  color: var(--muted);
  line-height: 1.45;
}

.license-toggle-label {
  color: var(--accent-strong);
  font-weight: 750;
}

.license-card-body {
  display: grid;
  gap: 14px;
  padding: clamp(16px, 2.4vw, 22px);
}

.license-card-body[hidden] {
  display: none !important;
}

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

.metric strong {
  display: block;
  color: var(--text);
  font-size: 18px;
}

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

.list li,
.row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-soft) 82%, transparent);
}

.list li:has(.reward-redemption-panel) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.reward-redemption-panel {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  padding-top: 4px;
}

.row {
  align-items: center;
}

.row-details {
  display: grid;
  gap: 4px;
}

.row-details strong,
.list strong,
label {
  color: var(--text);
}

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

.section-heading > div {
  display: grid;
  gap: 6px;
}

.quantity-grid {
  display: grid;
  gap: 10px;
}

.quantity-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, auto);
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-soft) 82%, transparent);
}

.quantity-control {
  display: grid;
  grid-template-columns: 36px minmax(76px, 104px) 36px;
  align-items: center;
  gap: 8px;
}

.quantity-control input {
  width: 100%;
  min-height: 38px;
  text-align: center;
}

.icon-button {
  min-width: 36px;
  width: 36px;
  height: 36px;
  padding: 0;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-raised);
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  text-align: left;
}

.device-table {
  min-width: 0;
  table-layout: fixed;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  line-height: 1.45;
  vertical-align: top;
  overflow-wrap: anywhere;
}

th {
  background: color-mix(in srgb, var(--surface-muted) 78%, transparent);
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
}

tr:last-child td {
  border-bottom: 0;
}

.license-id {
  display: inline-block;
  max-width: 240px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  color: var(--text);
  overflow-wrap: anywhere;
  word-break: break-all;
  white-space: normal;
  user-select: all;
}

.license-choice-list {
  display: grid;
  gap: 10px;
}

.license-choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-soft) 82%, transparent);
}

.license-choice.disabled {
  opacity: 0.68;
}

.license-choice input {
  width: 18px;
  min-height: 18px;
}

.license-choice-details {
  display: grid;
  gap: 3px;
}

.license-choice-details strong {
  color: var(--text);
}

.license-choice-details span {
  color: var(--muted);
  line-height: 1.45;
}

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

.field {
  display: grid;
  gap: 7px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  color: var(--accent-strong);
  font-weight: 750;
  cursor: pointer;
}

.button.primary {
  border-color: transparent;
  background: var(--button-bg);
  color: var(--button-text);
  box-shadow: 0 10px 28px var(--shadow);
}

.button[disabled],
.button.disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.note {
  padding: 14px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent-soft) 44%, transparent);
  color: var(--muted);
  line-height: 1.6;
}

.help-text {
  color: var(--soft);
  font-size: 13px;
  line-height: 1.5;
}

.field-status {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.field-status[data-state="available"] {
  color: var(--success);
}

.field-status[data-state="unavailable"],
.field-status[data-state="error"] {
  color: #c85252;
}

.username-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  max-width: 100%;
}

.username-suggestions > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.username-suggestions .button {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.username-suggestions .button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 42%, transparent);
  outline-offset: 2px;
}

.danger {
  border-color: color-mix(in srgb, #c85252 44%, var(--border));
  background: color-mix(in srgb, #c85252 9%, var(--surface-raised));
}

.danger-button {
  border-color: color-mix(in srgb, #c85252 58%, var(--border));
  background: color-mix(in srgb, #c85252 14%, var(--surface));
  color: color-mix(in srgb, #c85252 78%, var(--text));
}

.button.danger-button {
  box-shadow: none;
}

.lifecycle-actions,
.lifecycle-wizard,
.license-recovery-list {
  display: grid;
  gap: 14px;
}

.lifecycle-option,
.recovery-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-soft) 82%, transparent);
}

.warning-zone {
  border-color: color-mix(in srgb, var(--warning) 34%, var(--border));
}

.danger-zone {
  border-color: color-mix(in srgb, #c85252 44%, var(--border));
  background: color-mix(in srgb, #c85252 7%, var(--surface-raised));
}

.muted-row {
  opacity: 0.82;
}

.lifecycle-stepper {
  margin-bottom: 16px;
}

.lifecycle-footer {
  margin-top: 16px;
}

.recovery-code {
  max-width: 100%;
  letter-spacing: 0;
}

.auth-wrap {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 28px;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 100%);
}

.auth-card {
  width: min(100%, 460px);
}

.register-card {
  box-sizing: border-box;
  width: min(62rem, calc(100vw - 2rem));
  min-width: 0;
  max-width: 100%;
}

.account-brand-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.auth-card .account-brand-row .account-brand {
  margin-bottom: 0;
}

.button.compact {
  min-height: 36px;
  padding: 7px 11px;
}

.auth-card .brand {
  margin-bottom: 18px;
}

.stepper {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stepper li {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  text-align: center;
}

.stepper li[aria-current="step"] {
  border-color: var(--border-strong);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.guided-form,
.form-step {
  min-width: 0;
}

.form-grid,
.registration-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 1rem;
  row-gap: 1.1rem;
  align-items: start;
}

.registration-field,
.registration-select-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}

.registration-fields-single {
  display: grid;
  gap: 1rem;
}

.registration-field input,
.registration-field select,
.registration-field textarea,
.registration-field [role="combobox"] {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
}

.field-span-full {
  grid-column: 1 / -1;
}

.field-label-row,
.registration-label {
  display: flex;
  align-items: baseline;
}

.required-marker,
.registration-required-marker {
  color: #c85252;
  margin-inline-start: 0.2rem;
  font-weight: 800;
}

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

.choice-group {
  display: grid;
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.choice-group legend {
  padding: 0 6px;
  color: var(--text);
  font-weight: 750;
}

.choice-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.choice-card input,
.check-row input {
  width: auto;
  min-height: 0;
  margin-top: 3px;
}

.choice-card span,
.check-row span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.choice-card small {
  color: var(--muted);
  line-height: 1.45;
}

.form-actions {
  position: sticky;
  bottom: 0;
  z-index: 1;
  display: flex;
  flex-wrap: nowrap;
  justify-content: end;
  gap: 10px;
  padding-top: 12px;
  background: linear-gradient(180deg, transparent, var(--surface-raised) 36%);
}

.registration-select-wrapper {
  position: relative;
}

.registration-select-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 36px 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  position: relative;
}

.registration-select-control:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.registration-select-arrow {
  position: absolute;
  inset-inline-end: 13px;
  width: 0;
  height: 0;
  border-inline: 5px solid transparent;
  border-top: 6px solid currentColor;
}

.registration-dropdown {
  position: absolute;
  inset-inline: 0;
  top: calc(100% + 0.25rem);
  z-index: 20;
  max-height: 16rem;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 16px 36px var(--shadow);
}

.registration-dropdown-search {
  position: sticky;
  top: 0;
  z-index: 1;
  margin-bottom: 4px;
  background: var(--surface);
}

.registration-birthplace-status:empty {
  display: none;
}

.registration-dropdown [role="option"] {
  display: block;
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.registration-dropdown [role="option"]:hover,
.registration-dropdown [role="option"]:focus,
.registration-dropdown [role="option"][aria-selected="true"] {
  background: var(--surface-muted);
}

.summary-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.summary-card dl {
  display: grid;
  grid-template-columns: minmax(120px, 0.4fr) minmax(0, 1fr);
  gap: 8px 12px;
  margin: 0;
}

.summary-card dt {
  color: var(--muted);
  font-weight: 750;
}

.summary-card dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.check-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  color: var(--muted);
  line-height: 1.5;
}

.combobox-results {
  display: grid;
  max-height: 210px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.combobox-results button {
  justify-content: start;
  width: 100%;
  min-height: 40px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.combobox-results button:focus,
.combobox-results button:hover {
  background: var(--surface-muted);
}

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

.identity-item,
.account-data-row {
  display: grid;
  grid-template-columns: minmax(11rem, 18rem) minmax(0, 1fr) 2.75rem;
  gap: 0.75rem;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.identity-item:last-child {
  border-bottom: 0;
}

.identity-item span,
.account-data-label {
  color: var(--muted);
  font-weight: 750;
}

.identity-item strong,
.account-data-value {
  min-width: 0;
  overflow-wrap: anywhere;
}

.account-data-action {
  display: flex;
  justify-content: flex-end;
  min-width: 2.25rem;
}

.value-with-badge {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  overflow-wrap: anywhere;
}

.icon-action {
  position: relative;
  display: inline-grid;
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  color: var(--accent-strong);
  cursor: pointer;
}

.icon-action svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.icon-action:hover,
.icon-action:focus-visible {
  border-color: var(--border-strong);
  background: var(--surface-muted);
  color: var(--text);
  outline: none;
}

.icon-action:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent);
}

.icon-action[disabled],
.icon-action.disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

[data-tooltip] {
  position: relative;
}

[data-tooltip]::after,
[data-tooltip]::before {
  position: absolute;
  z-index: 30;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 120ms ease, transform 120ms ease;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  inset-inline-end: 0;
  bottom: calc(100% + 8px);
  max-width: 13rem;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 12px 24px var(--shadow);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.25;
  white-space: nowrap;
}

[data-tooltip]::before {
  content: "";
  inset-inline-end: 13px;
  bottom: calc(100% + 3px);
  border: 5px solid transparent;
  border-top-color: var(--surface);
}

[data-tooltip]:hover::after,
[data-tooltip]:hover::before,
[data-tooltip]:focus-visible::after,
[data-tooltip]:focus-visible::before {
  opacity: 1;
  transform: translateY(0);
}

.table-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.license-table th,
.invitation-table th {
  white-space: nowrap;
}

.license-table th:last-child,
.license-table td:last-child,
.invitation-table th:last-child,
.invitation-table td:last-child {
  width: 1%;
  white-space: nowrap;
}

.invitation-table {
  table-layout: fixed;
  min-width: 920px;
}

.invitation-table th:nth-child(1) { width: 9.5rem; }
.invitation-table th:nth-child(2) { width: 11rem; }
.invitation-table th:nth-child(3) { width: auto; }
.invitation-table th:nth-child(4) { width: 8rem; }
.invitation-table th:nth-child(5) { width: 8.5rem; }
.invitation-table th:nth-child(6) { width: 11rem; }
.invitation-table th:nth-child(7) { width: 5.75rem; }

.invitation-link {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.plan-card .row-details span {
  color: var(--muted);
}

.modal {
  width: min(100% - 32px, 440px);
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
}

.modal::backdrop {
  background: rgba(8, 16, 25, 0.52);
}

.modal-card {
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 42px var(--shadow);
}

.business-page,
.business-content {
  display: grid;
  gap: 16px;
  min-width: 0;
}

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

.business-summary-item {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--muted);
  text-align: left;
}

button.business-summary-item {
  cursor: pointer;
}

.business-summary-item strong {
  color: var(--text);
  font-size: 24px;
  line-height: 1;
}

.business-workspace {
  display: grid;
  grid-template-columns: minmax(260px, 0.34fr) minmax(0, 0.66fr);
  gap: 16px;
  min-width: 0;
}

.business-panel {
  display: grid;
  gap: 14px;
  align-content: start;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-raised);
  box-shadow: 0 12px 28px color-mix(in srgb, var(--shadow) 42%, transparent);
}

.business-owner-list,
.business-member-list,
.business-owner-chooser,
.business-trial-tree {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.owner-branch-list {
  display: grid;
  gap: 10px;
}

.owner-branch-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.owner-branch-row > strong,
.owner-branch-row > span:not(.status) {
  min-width: 0;
}

.owner-branch-row > span:not(.status) {
  color: var(--muted);
  font-size: 13px;
}

.owner-branch-row .status {
  grid-row: 1 / span 2;
  grid-column: 2;
}

.business-owner-card,
.business-owner-choice {
  display: grid;
  gap: 6px;
  width: 100%;
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-soft) 86%, transparent);
  color: var(--muted);
  text-align: left;
}

.business-owner-card {
  cursor: pointer;
}

.business-owner-card strong,
.business-owner-choice strong,
.business-member-row strong,
.business-trial-owner strong {
  color: var(--text);
}

.business-owner-card[aria-pressed="true"] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 56%, var(--surface));
}

.business-owner-card[data-assignable="false"],
.business-owner-choice:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.business-owner-card[data-drop-active="true"] {
  border-color: var(--success);
  background: color-mix(in srgb, var(--success) 14%, var(--surface));
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--success) 42%, transparent);
}

.business-owner-count,
.business-member-owner {
  color: var(--muted);
  font-weight: 750;
}

.business-filters {
  display: grid;
  grid-template-columns: minmax(14rem, 1fr) minmax(10rem, auto) minmax(10rem, auto) auto;
  gap: 10px;
  align-items: end;
  min-width: 0;
}

.business-member-toolbar,
.business-pagination,
.business-selection-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.business-selection-bar {
  position: sticky;
  top: 10px;
  z-index: 10;
  justify-content: flex-end;
  padding: 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 24px var(--shadow);
}

.business-selection-bar strong {
  margin-right: auto;
}

.business-member-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-soft) 82%, transparent);
}

.business-member-row[data-selected="true"] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 48%, var(--surface));
}

.business-member-row[draggable="true"] {
  cursor: grab;
}

.business-member-check {
  width: 18px;
  min-height: 18px;
  margin-top: 2px;
}

.business-member-states {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.business-trial {
  box-shadow: none;
}

.business-trial-owner,
.business-trial-member {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.business-trial-member {
  margin-left: 18px;
  color: var(--muted);
}

.business-drag-preview {
  position: fixed;
  top: -1000px;
  left: -1000px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 12px 24px var(--shadow);
  font-weight: 750;
}

.business-owner-modal .modal-card {
  max-height: min(76vh, 560px);
  overflow: hidden;
}

.business-owner-chooser {
  max-height: 380px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
}

.business-hierarchy-page,
.business-hierarchy-content {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.business-hierarchy-layout {
  display: grid;
  grid-template-columns: minmax(20rem, 0.58fr) minmax(18rem, 0.42fr);
  gap: 16px;
  min-width: 0;
  align-items: start;
}

.business-hierarchy-tree-panel,
.business-hierarchy-side,
.business-hierarchy-details,
.business-inventory-panel {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.business-hierarchy-side {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.business-parent-reference {
  padding: 10px 12px;
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-muted);
  overflow-wrap: anywhere;
}

.business-hierarchy-tree {
  display: grid;
  gap: 6px;
  min-width: 0;
  max-height: min(68vh, 760px);
  overflow: auto;
  padding-right: 2px;
}

.business-tree-node,
.business-tree-children {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.business-tree-children {
  margin-left: 22px;
  padding-left: 12px;
  border-left: 1px solid var(--border);
}

.business-tree-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
}

.business-tree-row[data-selected="true"] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 58%, var(--surface));
}

.business-tree-row[data-drop-active="true"] {
  border-color: var(--success);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--success) 42%, transparent);
}

.business-tree-row[draggable="true"] {
  cursor: grab;
}

.business-tree-toggle {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text);
  background: transparent;
}

.business-tree-toggle:not(:disabled) {
  cursor: pointer;
}

.business-tree-main {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 0;
  border: 0;
  color: var(--text);
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.business-tree-main strong,
.business-inventory-item strong {
  overflow-wrap: anywhere;
}

.business-tree-main span,
.business-inventory-item span {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.business-tree-actions,
.business-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  min-width: 0;
}

.business-detail-actions {
  justify-content: flex-start;
}

.business-inventory-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}

.business-inventory-columns > div {
  display: grid;
  gap: 10px;
  align-content: start;
  min-width: 0;
}

.business-inventory-columns h3 {
  margin: 0;
  font-size: 14px;
}

.business-inventory-item {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
}

.business-root-onboarding {
  box-shadow: none;
}

.business-hierarchy-modal {
  width: min(100% - 32px, 520px);
}

.business-hierarchy-modal .modal-card {
  max-height: min(82vh, 620px);
  overflow-y: auto;
  overflow-x: hidden;
}

.business-member-devices,
.business-device-list,
.business-device-preview {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.business-member-devices {
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.business-device-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
}

.business-device-preview {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 16px clamp(16px, 4vw, 28px);
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .sidebar .brand,
  .return-link {
    display: none;
  }

  .nav {
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 22px;
  }

  .page-head {
    display: grid;
  }

  .page-actions {
    justify-content: start;
  }

  .span-8,
  .span-6,
  .span-4 {
    grid-column: span 12;
  }

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

  .business-hierarchy-layout {
    grid-template-columns: 1fr;
  }

  .business-filters {
    grid-template-columns: minmax(0, 1fr) minmax(9rem, auto) minmax(9rem, auto) auto;
  }
}

@media (max-width: 620px) {
  .main {
    padding: 20px 16px 30px;
  }

  .actions,
  .button,
  .row,
  .list li,
  .license-choice,
  .metric {
    width: 100%;
  }

  .row,
  .list li,
  .license-choice,
  .lifecycle-option,
  .recovery-code-row,
  .section-heading,
  .metric {
    align-items: start;
    flex-direction: column;
  }

  .license-choice,
  .lifecycle-option,
  .recovery-code-row,
  .quantity-row {
    grid-template-columns: 1fr;
  }

  .quantity-control {
    width: 100%;
    grid-template-columns: 40px minmax(0, 1fr) 40px;
  }

  .license-card-header,
  .account-card-header {
    grid-template-columns: 1fr;
  }

  .badge-row {
    width: 100%;
  }

  .auth-wrap {
    place-items: start center;
    padding: 14px;
  }

  .stepper,
  .form-grid,
  .registration-field-grid,
  .summary-card dl {
    grid-template-columns: 1fr;
  }

  .identity-item,
  .account-data-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 10px;
  }

  .identity-item > span:first-child,
  .account-data-label {
    grid-column: 1 / -1;
  }

  .identity-item > strong,
  .account-data-value {
    grid-column: 1;
  }

  .account-data-action {
    grid-column: 2;
    grid-row: 2;
  }

  .stepper li {
    text-align: left;
  }

  .form-actions {
    justify-content: stretch;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-actions .button:only-child,
  .form-actions .button[data-step-next]:not([hidden]) {
    grid-column: 1 / -1;
  }

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

  .business-filters {
    grid-template-columns: 1fr;
  }

  .business-selection-bar {
    position: static;
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .business-selection-bar .button {
    width: 100%;
  }

  .business-member-toolbar,
  .business-pagination {
    display: grid;
  }

  .business-panel {
    padding: 14px;
  }

  .business-tree-row {
    grid-template-columns: 28px minmax(0, 1fr) auto;
  }

  .business-tree-actions {
    grid-column: 2 / -1;
    justify-content: flex-start;
  }

  .business-inventory-columns {
    grid-template-columns: 1fr;
  }

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

  .business-trial-member {
    margin-left: 0;
  }
}
