:root {
  color-scheme: dark;
  --console-bg: #000000;
  --surface: #0a0a0a;
  --surface-hover: #111111;
  --surface-active: #0a0a0a;
  --surface-muted: #050505;
  --line: #1c1c1c;
  --line-strong: #2e2e2e;
  --line-hover: #3a3a3a;
  --text: #f5f5f5;
  --text-muted: #a3a3a3;
  --text-faint: #737373;
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
  --sidebar-expanded: 240px;
  --sidebar-collapsed: 72px;
  --radius: 6px;
  --font-sans: Inter, "Geist Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--console-bg);
  color-scheme: dark;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  background: var(--console-bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

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

::selection {
  background: #262626;
  color: #f5f5f5;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: transparent;
  transition: background-color 180ms ease;
}

*:hover::-webkit-scrollbar-thumb {
  background: rgba(82, 82, 82, 0.65);
}

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--console-bg);
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  width: var(--sidebar-expanded);
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background: #000000;
  transition:
    width 300ms ease,
    transform 420ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 280ms ease;
  will-change: width, transform;
}

.sidebar-header {
  height: 64px;
  display: flex;
  flex: 0 0 64px;
  align-items: center;
  padding: 0 8px;
}

.brand-entry {
  --brand-mark-offset: 28px;
  --brand-mark-start-scale: 0.66;
  --brand-mark-peak-scale: 1.045;
  width: 100%;
  min-width: 0;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: inherit;
  text-align: left;
  transition: background-color 150ms ease;
}

.brand-entry:hover,
.brand-entry:focus-visible {
  background: #0a0a0a;
}

.brand-logo-mark {
  width: 34px;
  height: 34px;
  display: inline-flex;
  flex: 0 0 34px;
  align-items: center;
  justify-content: center;
  overflow: visible;
  opacity: 0;
  filter: blur(1px);
  transform: translateX(var(--brand-mark-offset)) scale(var(--brand-mark-start-scale));
  transform-origin: center;
  will-change: opacity, filter, transform;
}

.brand-logo-svg {
  width: 34px;
  height: 34px;
  display: block;
  overflow: visible;
  filter: invert(1);
}

.brand-name-mask {
  min-width: 0;
  max-width: 160px;
  display: inline-flex;
  overflow: hidden;
  padding-block: 2px;
  margin-block: -2px;
  opacity: 1;
  transition:
    max-width 200ms ease,
    opacity 120ms ease,
    transform 120ms ease;
}

.brand-name {
  display: inline-block;
  color: #ffffff;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
  opacity: 0;
  transform: translateX(-24px);
  will-change: opacity, transform;
}

.brand-entry.is-brand-ready .brand-logo-mark {
  animation: brand-entry-mark 680ms cubic-bezier(0.16, 1, 0.3, 1) 90ms both;
}

.brand-entry.is-brand-ready .brand-name {
  animation: brand-entry-name 560ms cubic-bezier(0.16, 1, 0.3, 1) 360ms both;
}

.sidebar-nav {
  min-height: 0;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 18px;
  padding: 8px 8px 16px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
}

.sidebar-nav::-webkit-scrollbar {
  display: none;
}

.sidebar-section {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sidebar-group-label {
  height: 24px;
  margin: 0;
  padding: 0 10px;
  overflow: hidden;
  color: #555555;
  font-size: 11px;
  font-weight: 600;
  line-height: 24px;
  white-space: nowrap;
  transition:
    max-width 200ms ease,
    opacity 120ms ease,
    transform 120ms ease;
}

.nav-btn {
  position: relative;
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: #888888;
  font-size: 13px;
  font-weight: 500;
  line-height: 18px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  transition:
    background-color 150ms ease,
    color 150ms ease;
}

.nav-btn:hover {
  background: #0a0a0a;
  color: #ffffff;
}

.nav-btn:focus-visible,
.brand-entry:focus-visible {
  outline: none;
  background: #0a0a0a;
  color: #ffffff;
}

.nav-btn.is-active {
  background: #0a0a0a;
  color: #ffffff;
  font-weight: 600;
}

.nav-btn svg {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  color: #666666;
  transition: color 150ms ease;
}

.nav-btn:hover svg,
.nav-btn.is-active svg {
  color: #ffffff;
}

.nav-btn.is-active svg {
  stroke-width: 2;
}

.nav-label {
  min-width: 0;
  max-width: 160px;
  display: block;
  overflow: hidden;
  opacity: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition:
    max-width 200ms ease,
    opacity 120ms ease,
    transform 120ms ease;
}

.sidebar-footer {
  min-height: 60px;
  display: flex;
  flex: 0 0 60px;
  align-items: center;
  padding: 12px;
  background: #000000;
}

.sidebar-toggle {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: #8a8a8a;
  transition: color 180ms ease;
}

.sidebar-toggle:hover,
.sidebar-toggle:active,
.sidebar-toggle:focus-visible {
  background: transparent;
  color: #ffffff;
  outline: none;
}

.sidebar-toggle-icon,
.sidebar-toggle-icon svg {
  width: 23px;
  height: 20px;
  display: block;
  overflow: visible;
}

.sidebar-toggle-line {
  transform: translateX(0);
  transition: transform 180ms ease;
}

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

.console-workspace {
  position: relative;
  min-height: calc(100vh - 16px);
  min-height: calc(100dvh - 16px);
  margin: 8px 8px 8px var(--sidebar-expanded);
  overflow: clip;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: #000000;
  transition:
    margin-left 420ms cubic-bezier(0.22, 1, 0.36, 1),
    border-radius 300ms ease,
    opacity 280ms ease,
    transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: margin-left;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 32px;
  background: rgba(0, 0, 0, 0.72);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.header-left {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-menu-btn {
  width: 36px;
  height: 36px;
  display: none;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: #a3a3a3;
}

.mobile-menu-btn:hover {
  background: #0a0a0a;
  color: #ffffff;
}

.mobile-menu-btn svg {
  width: 20px;
  height: 20px;
}

.breadcrumb {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #737373;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.breadcrumb-divider {
  color: #404040;
}

.breadcrumb strong {
  overflow: hidden;
  color: #ffffff;
  font-weight: 600;
  text-overflow: ellipsis;
}

.header-service {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #737373;
  font-size: 12px;
  white-space: nowrap;
}

.header-service > span:first-child {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: #525252;
}

.header-service.is-loading > span:first-child {
  border: 1px solid #737373;
  border-right-color: transparent;
  background: transparent;
  animation: spin 800ms linear infinite;
}

.header-service.is-success {
  color: #a3a3a3;
}

.header-service.is-success > span:first-child {
  background: var(--success);
}

.header-service.is-error {
  color: #d4d4d4;
}

.header-service.is-error > span:first-child {
  background: var(--danger);
}

.workspace {
  min-height: calc(100vh - 80px);
  min-height: calc(100dvh - 80px);
  padding: 28px 24px 44px;
  background: #000000;
}

.view {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  animation: view-in 260ms ease both;
}

.view-narrow {
  max-width: 896px;
}

.view-medium {
  max-width: 950px;
}

.page-header {
  min-height: 32px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.page-header-with-action {
  align-items: center;
}

.page-title {
  margin: 0;
  color: #f8fafc;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0;
}

.card {
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: none;
  transition: border-color 150ms ease;
}

.card:hover {
  border-color: #333333;
}

.card + .card,
.settings-stack > .card + .card {
  margin-top: 24px;
}

.card-pad,
.card-body {
  padding: 24px;
}

.card-header,
.card-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 24px;
  border-color: var(--line-strong);
}

.card-header {
  border-bottom: 1px solid var(--line-strong);
}

.card-footer {
  border-top: 1px solid var(--line-strong);
}

.plan-card {
  padding: 20px;
}

.plan-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(220px, 0.7fr);
  gap: 32px;
  align-items: start;
}

.plan-summary {
  max-width: 590px;
}

.meta-label {
  margin-bottom: 6px;
  color: #737373;
  font-size: 11px;
  font-weight: 600;
}

.plan-name {
  margin: 0 0 10px;
  color: #ffffff;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0;
}

.plan-desc {
  max-width: 580px;
  margin: 0;
  color: #a3a3a3;
  font-size: 13px;
  line-height: 1.65;
}

.plan-side {
  justify-self: end;
  min-width: 210px;
  text-align: right;
}

.price-line {
  min-height: 30px;
  color: #ffffff;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.35;
}

.price-sub {
  margin-top: 2px;
  color: #737373;
  font-size: 11px;
}

.account-state {
  margin-top: 13px;
}

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

.segment {
  position: relative;
  min-width: 0;
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #000000;
  color: #d4d4d4;
  text-align: left;
  transition:
    border-color 150ms ease,
    background-color 150ms ease,
    color 150ms ease;
}

.segment:hover {
  border-color: var(--line-hover);
  background: #050505;
  color: #ffffff;
}

.segment b {
  display: block;
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.segment.is-selected b {
  padding-right: 14px;
}

.segment.is-selected {
  border-color: #ffffff;
  background: #ffffff;
  color: #000000;
}

.segment.is-selected::after {
  position: absolute;
  top: 50%;
  right: 11px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #000000;
  content: "";
  transform: translateY(-50%);
}

.section-title {
  margin: 0;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
}

.section-desc {
  margin: 3px 0 0;
  color: #737373;
  font-size: 12px;
}

.section-step,
.badge {
  flex: none;
  padding: 3px 7px;
  border: 0;
  border-radius: 4px;
  background: #000000;
  color: #d4d4d4;
  font-size: 10px;
  font-weight: 700;
}

.field-grid {
  display: grid;
  gap: 14px;
}

.field-grid.two {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

label.field {
  min-width: 0;
  display: grid;
  gap: 7px;
}

label.field > span {
  display: flex;
  align-items: center;
  min-height: 18px;
  color: #a3a3a3;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

label.field > span b {
  width: 18px;
  height: 18px;
  margin-right: 7px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #404040;
  border-radius: 50%;
  color: #a3a3a3;
  font-size: 10px;
  font-weight: 600;
}

input,
textarea {
  width: 100%;
  border: 1px solid #1f1f1f;
  border-radius: var(--radius);
  outline: none;
  background: #000000;
  color: #ffffff;
  box-shadow: none;
  transition:
    border-color 150ms ease,
    background-color 150ms ease;
}

input {
  height: 42px;
  padding: 0 12px;
}

textarea {
  min-height: 118px;
  padding: 11px 12px;
  resize: vertical;
  line-height: 1.55;
}

input::placeholder,
textarea::placeholder {
  color: #525252;
  opacity: 1;
}

input:hover,
textarea:hover {
  border-color: #525252;
}

input:focus,
textarea:focus {
  border-color: #ffffff;
  background: #000000;
  box-shadow: none;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--console-bg) inset;
  box-shadow: 0 0 0 1000px var(--console-bg) inset;
  transition: background-color 9999s ease-out 0s;
}

input:autofill {
  background: var(--console-bg);
  color: var(--text);
  caret-color: var(--text);
}

input.is-invalid,
textarea.is-invalid {
  border-color: var(--danger);
}

textarea.is-valid {
  border-color: #525252;
}

.helper {
  margin: 8px 0 0;
  color: #737373;
  font-size: 11px;
  line-height: 1.5;
}

.helper.is-success {
  color: var(--success);
}

.helper.is-error {
  color: var(--danger);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin: 0;
}

.btn {
  position: relative;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  box-shadow: none;
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    color 150ms ease,
    opacity 150ms ease;
}

.btn svg {
  width: 16px;
  height: 16px;
  flex: none;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.btn-primary {
  background: #ffffff;
  color: #000000;
}

.btn-primary:hover:not(:disabled) {
  opacity: 0.9;
}

.btn-secondary {
  border-color: var(--line-strong);
  background: #000000;
  color: #e5e5e5;
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--line-hover);
  background: #000000;
}

.btn-ghost {
  padding-inline: 10px;
  border-color: transparent;
  background: transparent;
  color: #a3a3a3;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--surface-active);
  color: var(--text);
}

.btn-icon-text {
  min-height: 38px;
  padding-inline: 13px;
}

.btn.is-loading {
  padding-left: 35px;
}

.btn.is-loading::before {
  position: absolute;
  left: 14px;
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  content: "";
  opacity: 0.72;
  animation: spin 700ms linear infinite;
}

.checkout-footer {
  align-items: center;
}

.checkout-actions {
  width: 100%;
}

.checkout-actions .btn-primary {
  order: -1;
  min-width: 108px;
}

.checkout-actions .btn-ghost {
  margin-left: auto;
}

.status-chip {
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 7px;
  border: 0;
  border-radius: 4px;
  background: #000000;
  color: #a3a3a3;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.status-chip::before {
  width: 5px;
  height: 5px;
  flex: none;
  border-radius: 50%;
  background: #737373;
  content: "";
}

.status-chip.ok {
  color: #6ee7b7;
}

.status-chip.ok::before {
  background: var(--success);
}

.status-chip.warn {
  color: #fde68a;
}

.status-chip.warn::before {
  background: var(--warning);
}

.status-chip.err {
  color: #fca5a5;
}

.status-chip.err::before {
  background: var(--danger);
}

.live-box {
  margin: 0 24px 24px;
  padding: 15px;
  border: 1px solid var(--line-strong);
  border-left-width: 3px;
  border-radius: var(--radius);
  background: #000000;
  animation: status-in 220ms ease both;
}

.live-box.is-processing,
.live-box.is-warning {
  border-left-color: var(--warning);
}

.live-box.is-success {
  border-left-color: var(--success);
}

.live-box.is-error {
  border-left-color: var(--danger);
}

.live-heading {
  display: flex;
  align-items: center;
  gap: 9px;
}

.live-indicator {
  width: 9px;
  height: 9px;
  flex: none;
  border: 2px solid var(--warning);
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.is-success .live-indicator,
.is-warning .live-indicator,
.is-error .live-indicator {
  border: 0;
  background: var(--success);
  animation: none;
}

.is-warning .live-indicator {
  background: var(--warning);
}

.is-error .live-indicator {
  background: var(--danger);
}

.live-box h3 {
  margin: 0;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
}

.live-box p {
  margin: 7px 0 0 18px;
  color: #a3a3a3;
  font-size: 11px;
  line-height: 1.55;
}

.progress-track {
  height: 3px;
  margin: 14px 0 0 18px;
  overflow: hidden;
  border-radius: 3px;
  background: #1c1c1c;
}

.progress-track > span {
  width: 0;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--warning);
  transition: width 320ms ease;
}

.is-success .progress-track > span {
  background: var(--success);
}

.is-warning .progress-track > span {
  background: var(--warning);
}

.is-error .progress-track > span {
  background: var(--danger);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 16px;
  margin: 10px 0 0 18px;
  color: #737373;
  font-family: var(--font-mono);
  font-size: 10px;
}

.live-actions {
  margin: 13px 0 0 18px;
}

.orders-card .card-header {
  padding-block: 18px;
}

.orders-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-strong);
  background: var(--surface-muted);
}

.orders-search-group {
  width: min(100%, 540px);
  display: grid;
  flex: 1 1 420px;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.orders-search-group input,
.orders-search-group .btn,
.orders-filter-field .custom-select-trigger {
  height: 38px;
  min-height: 38px;
}

.orders-search-group input {
  min-width: 0;
}

.orders-filter-group {
  display: grid;
  flex: 0 1 390px;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 8px;
}

.orders-filter-field {
  min-width: 0;
}

.orders-filter-field .custom-select {
  min-width: 0;
  font-size: 12px;
}

.orders-card {
  overflow: visible;
}

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

.custom-select {
  position: relative;
  width: 100%;
}

.custom-select-trigger {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 11px 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--console-bg);
  color: var(--text);
  text-align: left;
  transition:
    border-color 150ms ease,
    background-color 150ms ease;
}

.custom-select-trigger:hover {
  border-color: var(--line-hover);
}

.custom-select-trigger:focus-visible,
.custom-select.is-open .custom-select-trigger {
  border-color: #ffffff;
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

.custom-select-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select-chevron {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  color: var(--text-muted);
  transition: transform 150ms ease;
}

.custom-select.is-open .custom-select-chevron {
  transform: rotate(180deg);
}

.custom-select-menu {
  position: absolute;
  z-index: 80;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  display: grid;
  gap: 2px;
  padding: 4px;
  border: 1px solid #525252;
  border-radius: var(--radius);
  background: #050505;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.58);
}

.custom-select-menu[hidden] {
  display: none;
}

.custom-select-option {
  width: 100%;
  min-height: 34px;
  padding: 7px 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #f5f5f5;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  transition:
    background-color 120ms ease,
    color 120ms ease;
}

.custom-select-option.is-selected {
  outline: none;
  background: #262626;
  color: #ffffff;
  font-weight: 650;
}

.custom-select-option:not(.is-selected):hover,
.custom-select-option:not(.is-selected):focus-visible {
  outline: none;
  background: #ffffff;
  color: #050505;
}

@media (max-width: 900px) {
  .orders-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .orders-search-group,
  .orders-filter-group {
    width: 100%;
    flex-basis: auto;
  }

  .orders-search-group {
    max-width: none;
  }
}

@media (max-width: 420px) {
  .orders-filter-group {
    grid-template-columns: 1fr;
  }
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.orders-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.orders-table th,
.orders-table td {
  padding: 13px 16px;
  text-align: left;
  vertical-align: middle;
}

.orders-table th {
  border-bottom: 1px solid var(--line-strong);
  background: #0a0a0a;
  color: #737373;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.orders-table td {
  color: #a3a3a3;
  font-size: 12px;
}

.orders-table td:first-child {
  font-family: var(--font-mono);
  font-size: 11px;
}

.orders-table th:last-child,
.orders-table td:last-child {
  text-align: right;
  white-space: nowrap;
}

.orders-table tbody tr {
  transition: background-color 150ms ease;
}

.orders-table tbody tr:hover {
  background: #000000;
}

.orders-table .btn {
  min-height: 32px;
  padding-inline: 8px;
  font-size: 11px;
}

.cdk-code-cell {
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.cdk-copy-btn {
  position: relative;
  width: 28px;
  height: 28px;
  display: inline-grid;
  flex: 0 0 28px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-faint);
  box-shadow: none;
  opacity: 0.78;
  transition:
    color 140ms ease,
    opacity 140ms ease,
    transform 100ms ease;
}

.cdk-copy-btn:hover,
.cdk-copy-btn:focus-visible,
.cdk-copy-btn:active,
.cdk-copy-btn.is-copied {
  border: 0;
  background: transparent;
  color: var(--text);
  box-shadow: none;
  opacity: 1;
}

.cdk-copy-btn:active {
  transform: scale(0.9);
}

.cdk-copy-btn svg {
  grid-area: 1 / 1;
  width: 15px;
  height: 15px;
  transition:
    opacity 140ms ease,
    transform 140ms ease;
}

.cdk-copy-check {
  opacity: 0;
  transform: scale(0.72);
}

.cdk-copy-btn.is-copied .cdk-copy-icon {
  opacity: 0;
  transform: scale(0.72);
}

.cdk-copy-btn.is-copied .cdk-copy-check {
  opacity: 1;
  transform: scale(1);
}

.order-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.order-state::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #737373;
  content: "";
}

.order-state.is-success::before {
  background: var(--success);
}

.order-state.is-processing::before {
  background: var(--warning);
}

.order-state.is-error::before {
  background: var(--danger);
}

.orders-empty {
  margin: 16px;
  padding: 46px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: #737373;
  font-size: 12px;
  text-align: center;
}

.api-inline {
  display: flex;
  align-items: center;
  gap: 9px;
}

.api-inline input {
  min-width: 0;
  flex: 1;
  font-family: var(--font-mono);
  font-size: 12px;
}

.service-row {
  padding: 16px 24px;
  border-top: 1px solid var(--line-strong);
}

.service-row-label {
  color: #737373;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.service-meta {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 5px 0 0;
  color: #a3a3a3;
  font-size: 11px;
  line-height: 1.5;
}

.service-meta > span {
  width: 6px;
  height: 6px;
  margin-top: 5px;
  flex: none;
  border-radius: 50%;
  background: #737373;
}

.service-meta.is-loading > span {
  border: 1px solid #737373;
  border-right-color: transparent;
  background: transparent;
  animation: spin 800ms linear infinite;
}

.service-meta.is-success > span {
  background: var(--success);
}

.service-meta.is-error {
  color: #fca5a5;
}

.service-meta.is-error > span {
  background: var(--danger);
}

.settings-stack {
  display: grid;
  gap: 24px;
}

.settings-stack > .card + .card {
  margin-top: 0;
}

.setting-row {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 17px 24px;
  border-bottom: 1px solid var(--line-strong);
}

.setting-row:last-child {
  border-bottom: 0;
}

.setting-row h3 {
  margin: 0;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
}

.setting-row p {
  margin: 3px 0 0;
  color: #737373;
  font-size: 11px;
  line-height: 1.45;
}

.switch {
  position: relative;
  width: 38px;
  height: 22px;
  flex: 0 0 38px;
  display: inline-flex;
  cursor: pointer;
}

.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.switch > span[aria-hidden] {
  position: absolute;
  inset: 0;
  border: 1px solid #404040;
  border-radius: 999px;
  background: #171717;
  transition:
    border-color 150ms ease,
    background-color 150ms ease;
}

.switch > span[aria-hidden]::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #a3a3a3;
  content: "";
  transition:
    background-color 150ms ease,
    transform 180ms ease;
}

.switch input:checked + span {
  border-color: #ffffff;
  background: #ffffff;
}

.switch input:checked + span::after {
  background: #000000;
  transform: translateX(16px);
}

.switch input:focus-visible + span {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 80;
  width: max-content;
  max-width: min(420px, calc(100vw - 40px));
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #0a0a0a;
  color: #f5f5f5;
  box-shadow: none;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(7px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast::before {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--success);
  content: "";
}

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

.toast.is-error {
  border-color: rgba(248, 113, 113, 0.36);
  color: #fecaca;
}

.toast.is-error::before {
  background: var(--danger);
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 45;
  border: 0;
  background: rgba(0, 0, 0, 0.58);
  opacity: 0;
  transition: opacity 180ms ease;
}

.app-shell.is-sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed);
}

.app-shell.is-sidebar-collapsed .console-workspace {
  margin-left: var(--sidebar-collapsed);
}

.app-shell.is-sidebar-collapsed .sidebar-header {
  justify-content: center;
  padding-inline: 0;
}

.app-shell.is-sidebar-collapsed .brand-entry {
  --brand-mark-offset: 0px;
  width: 46px;
  flex: 0 0 46px;
  justify-content: center;
  gap: 0;
  padding-inline: 6px;
}

.app-shell.is-sidebar-collapsed .brand-name-mask,
.app-shell.is-sidebar-collapsed .nav-label {
  max-width: 0;
  opacity: 0;
  transform: translateX(-4px);
  pointer-events: none;
}

.app-shell.is-sidebar-collapsed .sidebar-group-label {
  width: 50%;
  height: 1px;
  margin: 11px auto 10px;
  padding: 0;
  background: #2e2e2e;
  color: transparent;
  line-height: 1px;
}

.app-shell.is-sidebar-collapsed .sidebar-nav {
  gap: 18px;
}

.app-shell.is-sidebar-collapsed .nav-btn {
  justify-content: center;
  gap: 0;
  padding-inline: 12px;
}

.app-shell.is-sidebar-collapsed .sidebar-toggle-line {
  transform: translateX(6px);
}

.view[hidden],
[hidden] {
  display: none !important;
}

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

:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

input:focus-visible,
textarea:focus-visible {
  outline: none;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes brand-entry-mark {
  0% {
    opacity: 0;
    filter: blur(1px);
    transform: translateX(var(--brand-mark-offset)) scale(var(--brand-mark-start-scale));
  }
  35% {
    opacity: 1;
    filter: blur(0);
    transform: translateX(var(--brand-mark-offset)) scale(var(--brand-mark-peak-scale));
  }
  52% {
    opacity: 1;
    filter: blur(0);
    transform: translateX(var(--brand-mark-offset)) scale(1);
  }
  100% {
    opacity: 1;
    filter: blur(0);
    transform: translateX(0) scale(1);
  }
}

@keyframes brand-entry-name {
  0% {
    opacity: 0;
    transform: translateX(-24px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

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

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

/* Self-service subscription workspace */
.subscription-view {
  max-width: 1600px;
}

.subscription-page-header {
  align-items: flex-start;
  margin-bottom: 20px;
}

.page-heading-stack {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.page-subtitle {
  max-width: 820px;
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.65;
}

.subscription-card {
  background: var(--surface);
}

.subscription-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr) minmax(0, 0.78fr);
}

.subscription-pane {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.subscription-pane + .subscription-pane {
  border-left: 1px solid var(--line-strong);
}

.subscription-step-header {
  height: 104px;
  min-height: 104px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 24px 18px;
  border-bottom: 1px solid var(--line-strong);
}

.subscription-step-header > div {
  min-width: 0;
}

.subscription-step-header h2 {
  margin: 1px 0 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.45;
}

.subscription-step-header p {
  margin: 3px 0 0;
  color: var(--text-faint);
  font-size: 12px;
  line-height: 1.5;
}

.subscription-pane-body {
  min-height: 0;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  padding: 22px 24px 24px;
}

.redeem-code-block {
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.redeem-code-input {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
}

.redeem-code-input.is-valid {
  border-color: var(--success);
}

.redeem-code-prompt {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin: 8px 0 0;
  color: var(--text-faint);
  font-size: 11px;
  line-height: 1.45;
}

.redeem-code-link {
  min-height: 22px;
  padding: 0 2px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.45;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.redeem-code-link:hover {
  color: var(--text);
}

.redeem-code-hint {
  min-height: 17px;
  margin-top: 1px;
}

.field-section-heading {
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

.btn-compact {
  min-height: 30px;
  padding-inline: 8px;
  font-size: 11px;
}

.btn-compact svg {
  width: 14px;
  height: 14px;
}

.subscription-card-fields {
  gap: 12px;
  margin-top: 7px;
}

.subscription-card-fields .compact-fields {
  gap: 12px;
}

.subscription-plan-block {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.subscription-plans {
  margin-top: 9px;
  padding-top: 0;
  border-top: 0;
}

.session-field textarea {
  min-height: 210px;
}

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

.state-tile {
  min-width: 0;
  min-height: 66px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--console-bg);
}

.state-tile > span {
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 600;
}

.state-tile > strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.state-tile > strong.is-success {
  color: var(--success);
}

.state-tile > strong.is-error {
  color: var(--danger);
}

.state-tile .status-chip {
  width: fit-content;
  padding: 0;
  background: transparent;
  font-size: 11px;
}

.session-helper {
  min-height: 17px;
  margin-top: 9px;
}

.privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: auto;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-muted);
  color: var(--text-faint);
  font-size: 11px;
  line-height: 1.55;
}

.privacy-note svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  margin-top: 1px;
}

.processing-pane-body {
  justify-content: center;
  padding: 20px;
}

.processing-idle {
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 24px 16px;
  color: var(--text-faint);
  text-align: center;
}

.processing-idle-icon {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  margin-bottom: 13px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface-muted);
  color: var(--text-muted);
}

.processing-idle-icon svg {
  width: 20px;
  height: 20px;
}

.processing-idle strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
}

.processing-idle p {
  max-width: 220px;
  margin: 6px 0 0;
  color: var(--text-faint);
  font-size: 11px;
  line-height: 1.55;
}

.processing-pane .live-box {
  width: 100%;
  margin: 0;
  padding: 15px;
}

.processing-pane .live-box p,
.processing-pane .progress-track,
.processing-pane .meta-row,
.processing-pane .live-actions {
  margin-left: 0;
}

.processing-pane .meta-row {
  display: grid;
  gap: 5px;
}

.processing-pane .live-actions .btn {
  width: 100%;
  min-width: 0;
}

.subscription-footer {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 15px 24px;
  border-top: 1px solid var(--line-strong);
  background: var(--surface-muted);
}

.selected-plan-summary {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.selected-plan-summary strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
}

.selected-plan-summary span {
  max-width: 610px;
  color: var(--text-faint);
  font-size: 11px;
  line-height: 1.45;
}

.subscription-footer-actions {
  display: grid;
  flex: none;
  grid-template-columns: repeat(3, 140px);
  gap: 9px;
}

.subscription-footer-actions .btn {
  width: 140px;
  min-width: 140px;
}

.subscription-overview {
  scroll-margin-top: 82px;
}

.subscription-overview-header {
  align-items: center;
}

.subscription-plan-badge {
  min-width: 48px;
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  padding: 4px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
}

.subscription-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 24px;
  padding: 1px;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--line-strong);
}

.subscription-facts > div {
  min-width: 0;
  min-height: 72px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 12px;
  background: var(--surface-muted);
}

.subscription-facts dt,
.subscription-facts dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.subscription-facts dt {
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 600;
}

.subscription-facts dd {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.subscription-facts dd.is-success {
  color: var(--success);
}

.subscription-management-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line-strong);
}

.subscription-management-section {
  min-width: 0;
  min-height: 158px;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  flex-direction: column;
  gap: 22px;
  padding: 20px 24px;
}

.subscription-management-section + .subscription-management-section {
  border-left: 1px solid var(--line-strong);
}

.subscription-management-section h3 {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
}

.subscription-management-section p {
  margin: 4px 0 0;
  color: var(--text-faint);
  font-size: 11px;
  line-height: 1.55;
}

.subscription-management-section .btn {
  width: 100%;
}

.billing-link-result {
  display: grid;
  gap: 16px;
  padding: 20px 24px 24px;
  border-top: 1px solid var(--line-strong);
}

.billing-link-notice {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border-left: 2px solid var(--success);
  background: var(--surface-muted);
  color: var(--success);
  font-size: 11px;
  font-weight: 600;
}

.billing-link-notice svg {
  width: 15px;
  height: 15px;
  flex: none;
}

.billing-link-field input {
  font-family: var(--font-mono);
  font-size: 11px;
}

.billing-link-actions .btn {
  min-width: 120px;
}

.subscription-card .live-box {
  margin: 0;
}

@media (min-width: 821px) and (max-width: 1400px) {
  .session-state-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .subscription-footer {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }

  .subscription-footer-actions {
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .subscription-footer-actions .btn {
    width: 100%;
    min-width: 0;
  }

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

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

  .subscription-pane + .subscription-pane {
    border-top: 1px solid var(--line-strong);
    border-left: 0;
  }

  .subscription-step-header {
    height: auto;
    min-height: 0;
  }

  .session-field textarea {
    min-height: 180px;
  }

  .privacy-note {
    margin-top: 20px;
  }

  .processing-pane-body {
    min-height: 260px;
  }

  .processing-idle {
    min-height: 220px;
  }
}

@media (max-width: 760px) {
  .subscription-management-grid {
    grid-template-columns: 1fr;
  }

  .subscription-management-section + .subscription-management-section {
    border-top: 1px solid var(--line-strong);
    border-left: 0;
  }
}

@media (max-width: 1023px) {
  .sidebar {
    width: var(--sidebar-expanded);
    transform: translateX(-100%);
  }

  .app-shell.is-mobile-open .sidebar {
    width: var(--sidebar-expanded);
    transform: translateX(0);
  }

  .app-shell.is-mobile-open .sidebar-overlay {
    display: block !important;
    opacity: 1;
  }

  .app-shell.is-sidebar-collapsed .sidebar-header {
    justify-content: initial;
    padding-inline: 8px;
  }

  .app-shell.is-sidebar-collapsed .brand-entry {
    --brand-mark-offset: 28px;
    width: 100%;
    flex: initial;
    justify-content: flex-start;
    gap: 10px;
    padding-inline: 8px;
  }

  .app-shell.is-sidebar-collapsed .brand-name-mask,
  .app-shell.is-sidebar-collapsed .nav-label {
    max-width: 160px;
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  .app-shell.is-sidebar-collapsed .sidebar-group-label {
    width: auto;
    height: 24px;
    margin: 0;
    padding: 0 10px;
    background: transparent;
    color: #555555;
    line-height: 24px;
  }

  .app-shell.is-sidebar-collapsed .nav-btn {
    justify-content: flex-start;
    gap: 8px;
    padding-inline: 10px;
  }

  .sidebar-toggle {
    display: none;
  }

  .console-workspace,
  .app-shell.is-sidebar-collapsed .console-workspace {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .app-header {
    height: 60px;
    padding-inline: 16px;
  }

  .mobile-menu-btn {
    display: grid;
  }

  .breadcrumb {
    display: none;
  }

  .workspace {
    min-height: calc(100vh - 60px);
    min-height: calc(100dvh - 60px);
    padding: 30px 24px 48px;
  }

  .page-header {
    margin-bottom: 24px;
  }

  .toast {
    right: 14px;
    bottom: 14px;
    max-width: calc(100vw - 28px);
  }
}

@media (max-width: 760px) {
  .workspace {
    padding: 26px 18px 42px;
  }

  .plan-hero {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .plan-side {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: 1fr auto;
    justify-self: stretch;
    align-items: end;
    text-align: left;
  }

  .plan-side .meta-label {
    grid-column: 1 / -1;
  }

  .price-sub {
    text-align: right;
  }

  .account-state {
    grid-column: 1 / -1;
    margin-top: 11px;
  }

  .field-grid.two:not(.compact-fields) {
    grid-template-columns: 1fr;
  }

  .api-inline {
    align-items: stretch;
    flex-direction: column;
  }

  .api-inline .btn {
    align-self: flex-end;
  }

  .setting-row {
    gap: 18px;
  }
}

@media (max-width: 520px) {
  .subscription-page-header {
    margin-bottom: 20px;
  }

  .page-subtitle {
    font-size: 12px;
  }

  .subscription-step-header {
    min-height: 0;
    padding: 18px;
  }

  .subscription-pane-body {
    padding: 18px;
  }

  .session-state-grid {
    grid-template-columns: 1fr;
  }

  .subscription-footer {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
    padding: 16px 18px;
  }

  .subscription-footer-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .subscription-footer-actions .btn {
    width: 100%;
    min-width: 0;
    padding-inline: 8px;
    font-size: 11px;
  }

  .subscription-footer-actions .btn svg {
    display: none;
  }

  .subscription-facts {
    grid-template-columns: 1fr;
    margin: 18px;
  }

  .subscription-management-section,
  .billing-link-result {
    padding-right: 18px;
    padding-left: 18px;
  }

  .billing-link-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .billing-link-actions .btn {
    width: 100%;
    min-width: 0;
    padding-inline: 10px;
  }

  .subscription-card .live-box {
    margin: 0;
  }

  .app-header {
    padding-inline: 10px 14px;
  }

  .breadcrumb > span:first-child,
  .breadcrumb-divider {
    display: none;
  }

  .header-service {
    font-size: 11px;
  }

  .workspace {
    padding: 24px 12px 36px;
  }

  .page-title {
    font-size: 25px;
  }

  .card-pad,
  .card-body {
    padding: 18px;
  }

  .card-header,
  .card-footer,
  .service-row,
  .setting-row {
    padding-right: 18px;
    padding-left: 18px;
  }

  .plan-card {
    padding: 18px;
  }

  .plan-name {
    font-size: 24px;
  }

  .segmented {
    gap: 5px;
  }

  .segment {
    min-height: 46px;
    padding: 9px 8px;
  }

  .segment b {
    font-size: 12px;
  }

  .section-step {
    display: none;
  }

  .checkout-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .checkout-actions .btn-primary {
    grid-column: 1 / -1;
  }

  .checkout-actions .btn-ghost {
    margin-left: 0;
  }

  .live-box {
    margin: 0 18px 18px;
  }

  .live-box p,
  .progress-track,
  .meta-row,
  .live-actions {
    margin-left: 0;
  }

  .page-header-with-action .btn span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .page-header-with-action .btn {
    width: 38px;
    padding: 0;
  }

  .setting-row {
    align-items: flex-start;
  }
}

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

  .brand-logo-mark,
  .brand-name {
    opacity: 1;
    filter: none;
    transform: none;
  }
}

/* Header account menu and admin workspace */
.header-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}

.user-menu {
  position: relative;
  flex: none;
}

.user-trigger {
  min-width: 0;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 6px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  text-align: left;
  transition: background-color 150ms ease;
}

.user-trigger:hover,
.user-trigger[aria-expanded="true"] {
  background: var(--surface);
}

.user-avatar {
  width: 32px;
  height: 32px;
  display: inline-grid;
  flex: 0 0 32px;
  place-items: center;
  overflow: hidden;
  border: 0;
  border-radius: 50%;
  background: #ffffff;
  color: #000000;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.user-avatar.is-large {
  width: 48px;
  height: 48px;
  flex-basis: 48px;
  font-size: 14px;
}

.user-trigger-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.user-trigger-copy strong {
  max-width: 132px;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-trigger-copy span {
  color: var(--text-faint);
  font-size: 10px;
  line-height: 1.25;
}

.user-trigger-chevron {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  color: var(--text-faint);
  transition: transform 160ms ease;
}

.user-trigger[aria-expanded="true"] .user-trigger-chevron {
  transform: rotate(180deg);
}

.account-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 70;
  width: 248px;
  overflow: visible;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--console-bg);
  box-shadow: none;
  transform-origin: top right;
  animation: dropdown-in 150ms ease both;
}

.account-dropdown-header {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-strong);
}

.account-dropdown-header strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
}

.account-dropdown-header span {
  overflow: hidden;
  color: var(--text-faint);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu-list {
  position: relative;
  padding: 4px 0;
}

.account-menu-item,
.account-option {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  text-align: left;
  transition:
    background-color 140ms ease,
    color 140ms ease;
}

.account-menu-item:hover,
.account-option:hover,
.account-option:focus-visible,
.account-menu-item[aria-expanded="true"] {
  outline: none;
  background: var(--surface);
  color: var(--text);
}

.account-menu-item > svg:first-child {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  color: var(--text-faint);
}

.account-menu-item:hover > svg:first-child {
  color: currentColor;
}

.account-menu-value {
  min-width: 0;
  margin-left: auto;
  overflow: hidden;
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu-chevron {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  color: var(--text-faint);
  transform: rotate(180deg);
  transition: transform 160ms ease;
}

.account-menu-item[aria-expanded="true"] .account-menu-chevron {
  transform: rotate(180deg);
}

.account-submenu {
  position: absolute;
  right: calc(100% + 8px);
  left: auto;
  z-index: 1;
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 4px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-hover);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.48);
  transform-origin: right top;
  animation: flyout-in 150ms ease both;
}

.account-submenu[hidden] {
  display: none;
}

#languageMenu {
  top: 42px;
  width: 136px;
}

#themeMenu {
  top: 80px;
  width: 160px;
}

.account-option {
  min-height: 34px;
  padding: 0 9px;
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 12px;
}

.account-option .account-option-icon,
.account-option .account-option-check {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
}

.account-option .account-option-icon {
  margin: 0;
  color: var(--text-faint);
  opacity: 1;
}

.account-option .account-option-check {
  margin-left: auto;
  opacity: 0;
}

.account-option.is-selected {
  background: var(--surface-active);
  color: var(--text);
}

.account-option.is-selected .account-option-check {
  opacity: 1;
}

.account-menu-danger {
  padding: 4px 0;
  border-top: 1px solid var(--line-strong);
}

.account-menu-item.is-danger {
  color: var(--danger);
}

.account-menu-item.is-danger > svg:first-child {
  color: currentColor;
}

.page-heading-stack {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.page-eyebrow {
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
}

.admin-action-row {
  display: flex;
  align-items: end;
  gap: 12px;
}

.admin-action-field {
  flex: 1 1 auto;
}

.admin-action-row .btn {
  flex: none;
}

.admin-table-header {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 24px;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}

.admin-table-header .meta-label {
  margin: 0;
}

.admin-table-header h3 {
  margin: 3px 0 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.admin-status {
  min-height: 23px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.admin-status::before {
  width: 5px;
  height: 5px;
  flex: none;
  border-radius: 50%;
  background: var(--text-faint);
  content: "";
}

.admin-status.is-ready,
.admin-status.is-success {
  color: var(--success);
}

.admin-status.is-ready::before,
.admin-status.is-success::before {
  background: var(--success);
}

.admin-status.is-processing {
  color: var(--warning);
}

.admin-status.is-processing::before {
  border: 1px solid currentColor;
  border-right-color: transparent;
  background: transparent;
  animation: spin 700ms linear infinite;
}

.admin-status.is-error {
  color: var(--danger);
}

.admin-status.is-error::before {
  background: var(--danger);
}

.admin-empty {
  min-height: 206px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  padding: 32px 20px;
  color: var(--text-faint);
  text-align: center;
}

.admin-empty svg {
  width: 24px;
  height: 24px;
  margin-bottom: 3px;
  color: var(--text-faint);
}

.admin-empty strong {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

.admin-empty span {
  font-size: 11px;
}

.admin-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 12px 16px;
  text-align: left;
  vertical-align: middle;
}

.admin-table th {
  border-bottom: 1px solid var(--line-strong);
  background: var(--surface-muted);
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.admin-table td {
  border-bottom: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 11px;
}

.admin-table tbody tr:last-child td {
  border-bottom: 0;
}

.admin-table td:first-child {
  color: var(--text);
  font-family: var(--font-mono);
}

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

.admin-proxy-card {
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.admin-card-grid > .admin-proxy-card + .admin-proxy-card {
  margin-top: 0;
}

.admin-proxy-card .card-header > div {
  min-width: 0;
}

.admin-proxy-card .admin-status {
  flex: none;
}

.admin-proxy-card .card-body {
  flex: 1 1 auto;
}

.admin-proxy-card .admin-card-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 10px;
}

.admin-proxy-card .admin-card-actions .btn {
  width: 100%;
  min-width: 0;
}

.admin-code-input {
  min-height: 148px;
  font-family: var(--font-mono);
  font-size: 11px;
}

.masked-code {
  max-width: 100%;
  display: inline-block;
  margin-top: 9px;
  padding: 4px 6px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--surface-muted);
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-card-actions {
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 9px;
}

.admin-billing-body {
  display: grid;
}

.admin-select-field {
  max-width: 360px;
}

select {
  width: 100%;
  height: 42px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  background: var(--console-bg);
  color: var(--text);
  color-scheme: dark;
  accent-color: #d4d4d4;
  box-shadow: none;
  transition: border-color 150ms ease;
}

select option {
  background: #050505;
  color: #f5f5f5;
}

select option:checked {
  background: #d4d4d4 linear-gradient(#d4d4d4, #d4d4d4);
  color: #050505;
  box-shadow: 0 0 0 100vmax #d4d4d4 inset;
}

select option:hover,
select option:focus {
  background: #262626 linear-gradient(#262626, #262626);
  color: #ffffff;
}

select:hover {
  border-color: var(--line-hover);
}

select:focus {
  border-color: var(--text);
}

.billing-preview {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--console-bg);
  animation: status-in 180ms ease both;
}

.billing-preview .meta-label {
  margin-bottom: 6px;
}

.billing-preview code {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.account-dialog {
  width: min(480px, calc(100vw - 32px));
  max-height: min(680px, calc(100dvh - 32px));
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--console-bg);
  color: var(--text);
  box-shadow: none;
}

.account-dialog[open] {
  animation: dialog-in 180ms ease both;
}

.account-dialog::backdrop {
  background: rgba(0, 0, 0, 0.68);
  animation: backdrop-in 180ms ease both;
}

.dialog-header {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-strong);
}

.dialog-header h2 {
  margin: 3px 0 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
}

.icon-btn {
  width: 34px;
  height: 34px;
  display: inline-grid;
  flex: 0 0 34px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-faint);
}

.icon-btn:hover {
  background: var(--surface);
  color: var(--text);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.dialog-body {
  padding: 20px;
}

.account-profile-identity {
  display: flex;
  align-items: center;
  gap: 13px;
  padding-bottom: 18px;
}

.account-profile-identity > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.account-profile-identity strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.account-profile-identity span:not(.user-avatar) {
  overflow: hidden;
  color: var(--text-faint);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-profile-list {
  margin: 0;
  border-top: 1px solid var(--line-strong);
}

.account-profile-list > div {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}

.account-profile-list > div:last-child {
  border-bottom: 0;
}

.account-profile-list dt,
.account-profile-list dd {
  margin: 0;
  font-size: 11px;
}

.account-profile-list dt {
  color: var(--text-faint);
}

.account-profile-list dd {
  color: var(--text-muted);
  font-weight: 500;
}

.account-profile-list dd.profile-status {
  color: var(--success);
}

.account-password-form {
  margin-top: 8px;
  padding-top: 18px;
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--line-strong);
}

.account-password-form h3 {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.account-password-form .actions {
  justify-content: flex-end;
}

html[data-theme-transition="out-in"]::view-transition-old(root),
html[data-theme-transition="out-in"]::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

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

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

@keyframes flyout-in {
  from {
    opacity: 0;
    transform: translateX(4px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

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

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

/* Light theme mirrors sub2api's quiet console surfaces. */
html[data-theme="light"] {
  color-scheme: light;
  --console-bg: #fafafa;
  --surface: #ffffff;
  --surface-hover: #f7f7f7;
  --surface-active: #f5f5f5;
  --surface-muted: #fafafa;
  --line: #eeeeee;
  --line-strong: #e4e4e4;
  --line-hover: #cfcfcf;
  --text: #0a0a0a;
  --text-muted: #525252;
  --text-faint: #737373;
  background: var(--console-bg);
}

html[data-theme="light"] body,
html[data-theme="light"] .app-shell,
html[data-theme="light"] .console-workspace,
html[data-theme="light"] .workspace,
html[data-theme="light"] .sidebar,
html[data-theme="light"] .sidebar-footer {
  background: var(--console-bg);
}

html[data-theme="light"] .sidebar {
  border-right-color: rgba(0, 0, 0, 0.07);
}

html[data-theme="light"] .console-workspace {
  border-color: rgba(0, 0, 0, 0.1);
}

html[data-theme="light"] .app-header {
  background: rgba(250, 250, 250, 0.82);
}

html[data-theme="light"] .brand-logo-svg {
  filter: none;
}

html[data-theme="light"] .brand-name,
html[data-theme="light"] .nav-btn:hover,
html[data-theme="light"] .nav-btn:focus-visible,
html[data-theme="light"] .nav-btn.is-active,
html[data-theme="light"] .nav-btn:hover svg,
html[data-theme="light"] .nav-btn.is-active svg,
html[data-theme="light"] .sidebar-toggle:hover,
html[data-theme="light"] .sidebar-toggle:active,
html[data-theme="light"] .sidebar-toggle:focus-visible,
html[data-theme="light"] .mobile-menu-btn:hover,
html[data-theme="light"] .breadcrumb strong,
html[data-theme="light"] .page-title,
html[data-theme="light"] .plan-name,
html[data-theme="light"] .price-line,
html[data-theme="light"] .section-title,
html[data-theme="light"] .setting-row h3,
html[data-theme="light"] .live-box h3 {
  color: var(--text);
}

html[data-theme="light"] .brand-entry:hover,
html[data-theme="light"] .brand-entry:focus-visible,
html[data-theme="light"] .nav-btn:hover,
html[data-theme="light"] .nav-btn:focus-visible,
html[data-theme="light"] .nav-btn.is-active,
html[data-theme="light"] .mobile-menu-btn:hover,
html[data-theme="light"] .btn-ghost:hover:not(:disabled),
html[data-theme="light"] .orders-table tbody tr:hover {
  background: var(--surface-active);
}

html[data-theme="light"] .nav-btn,
html[data-theme="light"] .sidebar-toggle,
html[data-theme="light"] .mobile-menu-btn,
html[data-theme="light"] .plan-desc,
html[data-theme="light"] .setting-row p,
html[data-theme="light"] .orders-table td,
html[data-theme="light"] .service-meta,
html[data-theme="light"] .live-box p {
  color: var(--text-muted);
}

html[data-theme="light"] .nav-btn svg {
  color: #737373;
}

html[data-theme="light"] .card:hover {
  border-color: #d6d6d6;
}

html[data-theme="light"] input,
html[data-theme="light"] textarea,
html[data-theme="light"] select,
html[data-theme="light"] input:focus,
html[data-theme="light"] textarea:focus {
  background: #ffffff;
  color: var(--text);
}

html[data-theme="light"] input:focus,
html[data-theme="light"] textarea:focus {
  border-color: #171717;
}

html[data-theme="light"] select {
  color-scheme: light;
  accent-color: #262626;
}

html[data-theme="light"] select option {
  background: #ffffff;
  color: #171717;
}

html[data-theme="light"] select option:checked {
  background: #262626 linear-gradient(#262626, #262626);
  color: #ffffff;
  box-shadow: 0 0 0 100vmax #262626 inset;
}

html[data-theme="light"] select option:hover,
html[data-theme="light"] select option:focus {
  background: #e5e5e5 linear-gradient(#e5e5e5, #e5e5e5);
  color: #000000;
}

html[data-theme="light"] .custom-select-trigger {
  border-color: #d4d4d4;
  background: #ffffff;
  color: #0a0a0a;
}

html[data-theme="light"] .custom-select-trigger:hover {
  border-color: #737373;
}

html[data-theme="light"] .custom-select-trigger:focus-visible,
html[data-theme="light"] .custom-select.is-open .custom-select-trigger {
  border-color: #171717;
  outline-color: #171717;
}

html[data-theme="light"] .custom-select-menu {
  border-color: #d4d4d4;
  background: #ffffff;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.14);
}

html[data-theme="light"] .custom-select-option {
  color: #171717;
}

html[data-theme="light"] .custom-select-option.is-selected {
  background: #e5e5e5;
  color: #000000;
}

html[data-theme="light"] .custom-select-option:not(.is-selected):hover,
html[data-theme="light"] .custom-select-option:not(.is-selected):focus-visible {
  outline: none;
  background: var(--surface-active);
  color: var(--text);
}

html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder {
  color: #a3a3a3;
}

html[data-theme="light"] input:-webkit-autofill,
html[data-theme="light"] input:-webkit-autofill:hover,
html[data-theme="light"] input:-webkit-autofill:focus,
html[data-theme="light"] input:-webkit-autofill:active {
  -webkit-text-fill-color: #0a0a0a;
  caret-color: #0a0a0a;
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset;
  box-shadow: 0 0 0 1000px #ffffff inset;
}

html[data-theme="light"] input:autofill {
  background: #ffffff;
  color: #0a0a0a;
  caret-color: #0a0a0a;
}

html[data-theme="light"] .btn-primary {
  background: #000000;
  color: #ffffff;
}

html[data-theme="light"] .btn-secondary {
  border-color: var(--line-strong);
  background: #ffffff;
  color: #262626;
}

html[data-theme="light"] .btn-secondary:hover:not(:disabled) {
  border-color: var(--line-hover);
  background: #ffffff;
}

html[data-theme="light"] .btn-ghost {
  color: #737373;
}

html[data-theme="light"] .segment {
  border-color: var(--line-strong);
  background: #ffffff;
  color: #737373;
}

html[data-theme="light"] .segment:not(.is-selected):hover {
  border-color: var(--line-hover);
  background: var(--surface-active);
  color: var(--text);
}

html[data-theme="light"] .segment.is-selected {
  border-color: #000000;
  background: #000000;
  color: #ffffff;
}

html[data-theme="light"] .segment.is-selected::after {
  background: #ffffff;
}

html[data-theme="light"] .section-step,
html[data-theme="light"] .badge,
html[data-theme="light"] .status-chip,
html[data-theme="light"] .masked-code {
  background: var(--surface-muted);
  color: var(--text-muted);
}

html[data-theme="light"] .live-box,
html[data-theme="light"] .billing-preview {
  background: #ffffff;
}

html[data-theme="light"] .progress-track {
  background: #eeeeee;
}

html[data-theme="light"] .orders-table th {
  background: var(--surface-muted);
  color: var(--text-faint);
}

html[data-theme="light"] .orders-empty {
  color: var(--text-faint);
}

html[data-theme="light"] .switch > span[aria-hidden] {
  border-color: #d4d4d4;
  background: #e5e5e5;
}

html[data-theme="light"] .switch > span[aria-hidden]::after {
  background: #737373;
}

html[data-theme="light"] .switch input:checked + span {
  border-color: #000000;
  background: #000000;
}

html[data-theme="light"] .switch input:checked + span::after {
  background: #ffffff;
}

html[data-theme="light"] .toast {
  background: #ffffff;
  color: #171717;
}

html[data-theme="light"] .toast.is-error {
  color: #b91c1c;
}

html[data-theme="light"] .user-avatar {
  background: #000000;
  color: #ffffff;
}

html[data-theme="light"] :focus-visible {
  outline-color: #000000;
}

html[data-theme="light"] ::selection {
  background: #d4d4d4;
  color: #000000;
}

@media (max-width: 900px) {
  .admin-card-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .header-actions {
    gap: 8px;
  }

  .user-trigger-copy,
  .user-trigger-chevron {
    display: none;
  }

  .user-trigger {
    min-height: 38px;
    padding: 3px;
  }

  .account-dropdown {
    width: min(280px, calc(100vw - 28px));
    overflow: hidden;
  }

  .account-menu-list {
    position: static;
  }

  .account-menu-item[aria-expanded="true"] .account-menu-chevron {
    transform: rotate(90deg);
  }

  .account-submenu,
  #languageMenu,
  #themeMenu {
    position: static;
    width: auto;
    margin: 2px 0;
    padding: 3px 0 3px 29px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    background: var(--surface-muted);
    box-shadow: none;
    animation: submenu-in 150ms ease both;
  }

  .admin-action-row {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-action-row .btn {
    align-self: flex-start;
  }

  .admin-table-header {
    padding-inline: 18px;
  }
}

@media (max-width: 520px) {
  .header-service {
    display: none;
  }

  .admin-card-grid {
    gap: 14px;
  }

  .admin-card-actions .btn {
    width: 100%;
  }

  .admin-proxy-card .admin-card-actions {
    grid-template-columns: 1fr;
  }

  .admin-table-header {
    min-height: 64px;
  }

  .admin-table-header .btn {
    width: 38px;
    padding: 0;
  }

  .admin-table-header .btn span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }
}


.admin-login-form {
  display: grid;
  gap: 12px;
}
.auth-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}
.auth-turnstile {
  display: grid;
  gap: 8px;
}
.auth-turnstile .field-label {
  font-size: 13px;
  color: var(--text-muted, var(--text-faint));
}
.auth-code-row .field {
  margin: 0;
}
@media (max-width: 520px) {
  .auth-code-row {
    grid-template-columns: 1fr;
  }
}
.admin-login-form .actions {
  justify-content: flex-end;
}


.header-login-btn {
  border-radius: 999px;
  padding-inline: 16px;
}
.auth-switch {
  margin: 4px 0 0;
  text-align: center;
  color: var(--text-faint);
  font-size: 13px;
}
.link-btn {
  border: 0;
  background: transparent;
  color: var(--green);
  font-weight: 600;
  padding: 0 4px;
  cursor: pointer;
}
.link-btn:hover { text-decoration: underline; }


.auth-gate-card {
  max-width: 520px;
  margin: 48px auto;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel);
  text-align: center;
  display: grid;
  gap: 12px;
}
.auth-gate-card h2 {
  margin: 0;
  font-size: 22px;
}
.auth-gate-card p {
  margin: 0;
  color: var(--text-faint);
  line-height: 1.5;
}
.auth-gate-card .actions {
  justify-content: center;
  margin-top: 8px;
}


.orders-loading {
  color: var(--text-faint);
}
.orders-error {
  display: grid;
  gap: 12px;
  justify-items: center;
  color: var(--danger);
}
.orders-error .btn {
  margin-top: 4px;
}


.admin-inline-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}


.redeem-code-head {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 6px;
}


.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.stat-card {
  border: 1px solid var(--line-strong, rgba(255,255,255,.08));
  background: var(--panel, rgba(255,255,255,.03));
  border-radius: 16px;
  padding: 14px 16px;
}
.stat-card span {
  display: block;
  color: var(--text-faint, #9aa3ad);
  font-size: 12px;
}
.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 22px;
}
.code-box {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(0,0,0,.2);
  border: 1px solid rgba(255,255,255,.06);
  overflow: auto;
  font-size: 12px;
}


.order-help-cell {
  max-width: 280px;
  white-space: normal;
  color: var(--text-faint, #9aa3ad);
  font-size: 12px;
  line-height: 1.4;
}
