:root {
  color-scheme: light;
  --bg: #f5fbfb;
  --panel: #ffffff;
  --soft: #f7fbfb;
  --text: #162033;
  --muted: #6b778c;
  --line: #e8eef2;
  --line-strong: #d8e3e9;
  --brand: #13b8a6;
  --brand-strong: #0f9d90;
  --brand-soft: #e8fbf7;
  --brand-tint: #d6f7f1;
  --green: #10a669;
  --amber: #c9821b;
  --red: #e04b4b;
  --purple: #8b5cf6;
  --cyan-bg: #eaf9f8;
  --sidebar: #ffffff;
  --sidebar-soft: #eaf9f6;
  --shadow: 0 14px 38px rgba(31, 54, 68, 0.08);
  --shadow-soft: 0 8px 22px rgba(31, 54, 68, 0.06);
  --radius: 18px;
  --radius-sm: 12px;
  --control-height: 42px;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-width: 320px;
  min-height: 100%;
  background:
    linear-gradient(115deg, #f8fcfc 0%, #edfafa 38%, #f8fbfd 100%);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: var(--control-height);
  border: 1px solid var(--brand);
  border-radius: 11px;
  padding: 0 15px;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
  font-weight: 700;
  box-shadow: 0 7px 16px rgba(19, 184, 166, 0.14);
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

button > svg {
  width: 15px;
  height: 15px;
  margin-right: 6px;
  vertical-align: -2px;
}

.icon-btn > svg,
.sidebar-toggle > svg {
  margin-right: 0;
}

button:hover {
  background: var(--brand-strong);
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(19, 184, 166, 0.18);
}

button:disabled,
button[aria-busy="true"] {
  cursor: not-allowed;
  opacity: 0.72;
}

button:disabled[data-copy-value],
button:disabled[data-copy-redemption-code],
button:disabled[data-copy-filtered-codes] {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #94a3b8;
  box-shadow: none;
}

button.is-loading {
  position: relative;
  padding-left: 34px;
}

button.is-loading::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  width: 13px;
  height: 13px;
  margin-top: -7px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  animation: spin 0.75s linear infinite;
}

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

button.secondary {
  border-color: var(--line);
  background: #fff;
  color: var(--text);
  box-shadow: 0 3px 9px rgba(31, 54, 68, 0.035);
}

button.secondary:hover {
  border-color: var(--brand-tint);
  background: var(--brand-soft);
  color: var(--brand-strong);
}

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

button.secondary.blue {
  border-color: var(--brand-tint);
  background: var(--brand-soft);
  color: var(--brand-strong);
}

button.ghost {
  border-color: var(--line);
  background: #fff;
  color: var(--muted);
  box-shadow: none;
}

button.wide {
  width: 100%;
}

input,
select {
  width: 100%;
  min-height: var(--control-height);
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  color: var(--text);
  padding: 0 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

input::placeholder,
textarea::placeholder {
  color: #a7b3bf;
}

input:disabled,
textarea:disabled,
select:disabled {
  border-color: #e2e8f0;
  background: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
  opacity: 1;
}

input:focus,
select:focus {
  outline: 3px solid rgba(19, 184, 166, 0.13);
  border-color: var(--brand);
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1,
h2,
h3 {
  margin: 0;
}

small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 42% 12%, rgba(163, 230, 222, 0.42), transparent 34%),
    linear-gradient(115deg, #f8fcfc 0%, #eaf8f7 48%, #fbfcfd 100%);
}

.tenant-login {
  align-items: center;
  padding: 28px 18px;
  background:
    radial-gradient(circle at 50% 4%, rgba(120, 221, 209, 0.32), transparent 34%),
    linear-gradient(180deg, #ecfaf8 0%, rgba(248, 252, 252, 0.86) 260px),
    var(--bg);
}

.login-card {
  width: min(920px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.tenant-login-card {
  width: min(420px, 100%);
  display: block;
  padding: 30px;
  overflow: visible;
  border-color: var(--line);
  box-shadow: 0 22px 52px rgba(31, 54, 68, 0.12);
}

.login-copy {
  min-height: 420px;
  padding: 42px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: linear-gradient(145deg, #103f4a, #0f9d90);
  color: #fff;
}

.tenant-login .login-copy {
  min-height: auto;
  padding: 0 0 24px;
  align-items: center;
  text-align: center;
  background: transparent;
  color: var(--text);
}

.tenant-login-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border-radius: 15px;
  border: 1px solid var(--brand-tint);
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 16px;
  font-weight: 900;
}

.login-copy h1 {
  font-size: 36px;
  line-height: 1.2;
}

.tenant-login .login-copy h1 {
  font-size: 28px;
}

.login-copy p {
  max-width: 420px;
  color: rgba(255, 255, 255, 0.74);
  line-height: 1.8;
}

.tenant-login .login-copy p {
  max-width: 300px;
  margin: 10px auto 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.eyebrow {
  color: #bff4eb;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.tenant-login .eyebrow {
  color: var(--brand);
  margin-bottom: 10px;
  text-transform: none;
}

.login-form {
  padding: 34px;
  align-self: center;
}

.tenant-login .login-form {
  padding: 0;
}

.tenant-login .split {
  grid-template-columns: 1fr;
  gap: 0;
}

.tenant-login .field {
  margin: 0 0 16px;
}

.tenant-login .field label {
  color: #334155;
  font-weight: 700;
}

.tenant-login input {
  min-height: 44px;
  border-color: var(--line-strong);
  border-radius: 12px;
  background: #fbfefd;
  padding: 0 12px;
}

.tenant-login .primary.wide {
  min-height: 46px;
  margin-top: 4px;
  font-weight: 800;
}

.auth-switch {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 14px;
}

.auth-switch button {
  min-height: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--brand-strong);
  box-shadow: none;
  font-weight: 800;
}

.auth-switch button:hover {
  color: var(--brand);
  transform: none;
  box-shadow: none;
}

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

.field {
  display: grid;
  gap: 7px;
  margin: 12px 0;
}

.field label {
  color: var(--muted);
  font-size: 13px;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.error {
  padding: 10px 12px;
  border: 1px solid #fecaca;
  border-radius: 12px;
  background: #fff1f2;
  color: var(--red);
  margin-bottom: 14px;
}

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

.shell.collapsed {
  grid-template-columns: 78px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px 12px 16px;
  background: var(--sidebar);
  color: var(--text);
  border-right: 1px solid var(--line);
  box-shadow: 8px 0 30px rgba(31, 54, 68, 0.04);
}

.brand {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 46px;
  padding: 0 8px 16px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background:
    linear-gradient(135deg, #102a52, #1467b6 45%, var(--brand) 100%);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(19, 184, 166, 0.22);
}

.brand strong,
.brand span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.collapsed .brand {
  grid-template-columns: 40px;
}

.collapsed .brand div:last-child,
.collapsed .nav span,
.collapsed #logoutBtn span {
  display: none;
}

.nav-icon {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border-radius: 10px;
  background: transparent;
  color: #7a869a;
}

.nav-icon svg {
  width: 17px;
  height: 17px;
}

.sidebar-close,
.mobile-sidebar-scrim {
  display: none;
}

.nav {
  display: grid;
  gap: 6px;
  flex: 1;
  align-content: start;
}

.nav button {
  width: 100%;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-start;
  border-color: transparent;
  background: transparent;
  color: #5f6b7c;
  text-align: left;
  box-shadow: none;
  font-weight: 700;
}

.nav button:hover,
.nav button.active {
  background: var(--sidebar-soft);
  color: var(--brand-strong);
  transform: none;
  box-shadow: none;
}

.collapsed .nav button {
  justify-content: center;
  padding: 0;
  min-height: 44px;
}

.collapsed .nav-icon {
  display: grid;
}

.collapsed .nav button.active .nav-icon,
.nav button:hover .nav-icon {
  background: var(--brand-tint);
  color: var(--brand-strong);
}

.collapsed .nav-icon {
  display: grid;
}

.content {
  min-width: 0;
  padding: 0 28px 28px;
  background:
    linear-gradient(105deg, rgba(246, 252, 252, 0.96), rgba(235, 249, 248, 0.88) 44%, rgba(249, 251, 253, 0.98));
}

.topbar {
  min-height: 64px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin: 0 -28px 26px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}

.topbar h1 {
  font-size: 22px;
}

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

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  min-width: 0;
}

.sidebar-toggle {
  min-width: 40px;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-color: var(--line);
  background: #fff;
  color: var(--brand-strong);
  font-weight: 800;
  box-shadow: var(--shadow-soft);
}

.sidebar-toggle:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.icon-btn {
  width: 40px;
  min-width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border-radius: 12px;
}

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

.icon-btn.subtle {
  border-color: var(--line);
  background: var(--soft);
  color: var(--muted);
}

.icon-btn.subtle:hover {
  border-color: var(--brand);
  background: #eff6ff;
  color: var(--brand-strong);
}

.toggle-icon {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
}

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

.notice {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--brand-tint);
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 700;
}

.help-dot {
  width: 16px;
  min-width: 16px;
  height: 16px;
  display: inline-grid;
  place-items: center;
  margin-left: 5px;
  padding: 0;
  border: 1px solid #dbe5ea;
  border-radius: 50%;
  background: #f8fafb;
  color: #7a8a99;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  box-shadow: none;
  vertical-align: middle;
}

.help-dot:hover,
.help-dot:focus-visible {
  border-color: var(--brand-tint);
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.top-pill,
.top-user-badge {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 5px 14px rgba(31, 54, 68, 0.04);
}

.top-pill svg {
  width: 16px;
  height: 16px;
  color: var(--brand-strong);
}

.balance-pill {
  border-color: var(--brand-tint);
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.top-user-badge {
  padding: 3px 10px 3px 4px;
}

.top-user-badge b {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--brand);
  color: #fff;
}

.top-user-badge span {
  display: grid;
  line-height: 1.1;
}

.top-user-badge small {
  margin: 2px 0 0;
  font-size: 11px;
  font-weight: 600;
}

#logoutBtn {
  justify-content: flex-start;
  gap: 10px;
}

.collapsed #logoutBtn {
  justify-content: center;
  padding: 0;
}

#logoutBtn:hover .nav-icon {
  background: var(--brand-tint);
  color: var(--brand-strong);
}

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

.agent-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(330px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.agent-kpi-grid {
  margin-bottom: 18px;
}

.quota-hero,
.quick-panel,
.active-user-panel,
.stat-strip {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.quota-hero {
  min-height: 300px;
  padding: 22px;
  display: grid;
  gap: 18px;
}

.quota-hero-head,
.hero-actions,
.dashboard-stat-row,
.hero-facts,
.quick-panel {
  display: grid;
  gap: 12px;
}

.quota-hero-head {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.hero-actions {
  grid-auto-flow: column;
  justify-content: end;
}

.sync-pill {
  align-self: start;
  border: 1px solid var(--brand-tint);
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 800;
  padding: 8px 12px;
  white-space: nowrap;
}

.section-kicker {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
}

.quota-hero h2 {
  font-size: 42px;
  line-height: 1.05;
  color: var(--brand-strong);
}

.quota-hero p {
  margin: 10px 0 0;
  color: var(--muted);
}

.hero-progress {
  align-self: end;
}

.sync-warning {
  padding: 10px 12px;
  border: 1px solid #fde68a;
  border-radius: 12px;
  background: #fffbeb;
  color: #92400e;
  font-size: 13px;
  line-height: 1.6;
}

.coverage-warning {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid #fed7aa;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #fffdf7, #fff7ed);
  color: #7c2d12;
  box-shadow: 0 8px 22px rgba(194, 120, 3, 0.06);
}

.coverage-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #ffedd5;
  color: #c2410c;
}

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

.coverage-warning strong {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.coverage-warning strong span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #ffedd5;
  color: #c2410c;
  font-size: 12px;
}

.coverage-warning p {
  margin: 0;
  color: #9a3412;
  line-height: 1.6;
}

.availability-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #fef3c7;
  color: var(--amber);
  font-size: 12px;
  font-weight: 800;
  vertical-align: middle;
}

.availability-badge.ok {
  background: #dcfce7;
  color: var(--green);
}

.availability-badge.off {
  background: #fee2e2;
  color: var(--red);
}

.availability-badge.warn {
  background: #fef3c7;
  color: var(--amber);
}

.unavailable-row {
  background: #fff7ed;
}

.unavailable-row strong,
.unavailable-row td {
  color: #7c2d12;
}

.unavailable-panel {
  border-color: #fed7aa;
  background: #fffaf4;
}

.danger-text {
  color: var(--red);
}

.hero-facts {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding-top: 4px;
}

.hero-facts div {
  min-height: 68px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--soft);
}

.hero-facts span,
.stat-strip span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}

.hero-facts strong {
  display: block;
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
}

.dashboard-side {
  display: grid;
  gap: 18px;
}

.quick-panel {
  padding: 20px;
}

.quick-panel h2 {
  font-size: 19px;
}

.active-user-panel {
  width: 100%;
  min-height: 150px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 18px;
  background: var(--panel);
  color: var(--text);
  text-align: left;
}

.active-user-panel:hover {
  border-color: var(--brand-tint);
  background: var(--brand-soft);
}

.active-user-panel strong {
  font-size: 34px;
}

.active-user-panel small {
  color: var(--muted);
  font-size: 13px;
}

.dashboard-stat-row {
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.stat-strip {
  min-height: 108px;
  padding: 18px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  align-content: center;
  gap: 4px 12px;
}

.stat-strip .metric-icon {
  grid-row: 1 / 4;
}

.stat-strip strong {
  font-size: 28px;
}

.metric {
  min-height: 108px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  gap: 4px 12px;
  align-content: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.metric-icon {
  grid-row: 1 / 4;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.metric:nth-child(2n) .metric-icon {
  background: #eef2ff;
  color: #4f46e5;
}

.metric:nth-child(3n) .metric-icon {
  background: #ecfdf5;
  color: var(--green);
}

.metric:nth-child(4n) .metric-icon {
  background: #f5f3ff;
  color: var(--purple);
}

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

.metric-button {
  width: 100%;
  min-height: 104px;
  border-color: var(--line);
  background: var(--panel);
  color: var(--text);
  text-align: left;
  box-shadow: var(--shadow-soft);
}

.metric-button:hover {
  border-color: var(--brand-tint);
  background: var(--brand-soft);
}

.metric span,
.metric small {
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  font-size: 26px;
}

.compact-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.compact-metrics .metric {
  min-height: 90px;
}

.grid {
  display: grid;
  gap: 18px;
}

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

.customer-dashboard-grid {
  grid-template-columns: minmax(620px, 1.35fr) minmax(320px, 0.65fr);
  align-items: start;
}

.grid.customers-layout {
  grid-template-columns: minmax(620px, 1.2fr) minmax(420px, 0.8fr);
  align-items: start;
}

.panel {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 10px 28px rgba(31, 54, 68, 0.055);
}

.panel + .panel {
  margin-top: 18px;
}

.panel.narrow {
  max-width: 640px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-head h2 {
  font-size: 18px;
}

.panel h3 {
  font-size: 15px;
  margin: 16px 0 10px;
}

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

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

.kv dt {
  color: var(--muted);
}

.kv dd {
  margin: 0;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

th {
  background: #f7fafb;
  color: #667085;
  font-weight: 800;
  font-size: 12px;
}

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

tbody tr.selected {
  background: var(--brand-soft);
}

tbody tr:hover {
  background: #fbfefd;
}

td strong {
  display: block;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

td small {
  display: block;
  max-width: 280px;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

td button + button {
  margin-left: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: #fff7dc;
  color: var(--amber);
  font-size: 12px;
  font-weight: 800;
}

.badge.ok {
  background: #dcfce7;
  color: var(--green);
}

.badge.off {
  background: #fee2e2;
  color: var(--red);
}

.badge.warn {
  background: #fef3c7;
  color: var(--amber);
}

.progress {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2f5;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), #6ee7d8);
}

.progress-label {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 12px;
  align-items: end;
}

.model-select {
  min-height: 42px;
}

.model-select[multiple] {
  min-height: 118px;
  padding: 8px;
}

.model-multiselect {
  position: relative;
  min-width: min(100%, 280px);
  width: 100%;
}

.model-select[multiple] + .model-multiselect,
.field .model-select[multiple] {
  margin-top: 8px;
}

.field .model-select[multiple]:has(+ .model-multiselect) {
  display: none;
}

.model-multiselect-trigger {
  width: 100%;
  min-height: 42px;
  justify-content: space-between;
  padding: 0 38px 0 12px;
  border-color: var(--line);
  background: #fff;
  color: #263745;
  text-align: left;
  box-shadow: 0 4px 10px rgba(31, 54, 68, 0.035);
  position: relative;
}

.model-multiselect-trigger::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 1.8px solid #94a3b8;
  border-bottom: 1.8px solid #94a3b8;
  transform: translateY(-65%) rotate(45deg);
}

.model-multiselect-trigger[aria-expanded="true"] {
  border-color: var(--brand-tint);
  background: #f8fffd;
  color: var(--brand-strong);
}

.model-multiselect-trigger[aria-expanded="true"]::after {
  transform: translateY(-30%) rotate(225deg);
  border-color: var(--brand-strong);
}

.model-multiselect-panel {
  position: absolute;
  z-index: 12;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: min(320px, 52vh);
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
}

.model-multiselect-panel[hidden] {
  display: none;
}

.model-multiselect-panel label {
  min-width: 0;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 8px 9px;
  border-radius: 10px;
  color: #334155;
  font-size: 13px;
  line-height: 1.35;
  cursor: pointer;
}

.model-multiselect-panel label:hover {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.model-multiselect-panel input {
  width: 15px;
  height: 15px;
  accent-color: var(--brand);
}

.model-multiselect-panel label:has(input:checked) {
  background: #ecfdf5;
  color: var(--brand-strong);
  font-weight: 800;
}

.model-multiselect-summary,
.model-summary-text {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.field small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.model-price-cell {
  min-width: 230px;
  color: #334155;
  font-size: 13px;
  line-height: 1.5;
}

.dashboard-filter-card {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-soft);
}

.filter-copy {
  display: grid;
  gap: 5px;
}

.filter-copy strong {
  font-size: 15px;
}

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

.token-create-panel .form-grid,
.group-markup-form,
.query-form,
.user-toolbar {
  position: relative;
}

.stack-form {
  display: grid;
  gap: 10px;
}

.inline-form,
.compact-form,
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.panel-head .action-row,
.quota-actions,
.balance-actions,
.dashboard-actions {
  justify-content: flex-end;
}

.panel-head .action-row button,
.quota-actions button,
.balance-actions button,
.dashboard-actions button {
  flex: 0 0 auto;
}

.compact-form {
  margin-bottom: 12px;
}

.inline-form input,
.inline-form select,
.compact-form input,
.compact-form select {
  width: auto;
  min-width: 150px;
  flex: 1;
}

.mini-input {
  max-width: 92px;
}

.price-input {
  width: 110px;
  max-width: 120px;
}

.hint {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.field:has(input:disabled),
.field:has(select:disabled) {
  color: #64748b;
}

.field:has(input:disabled) label,
.field:has(select:disabled) label {
  color: #7b8794;
}

.field:has(input:placeholder-shown) label,
.field:has(textarea:placeholder-shown) label {
  color: #475569;
}

.field small,
.form-help,
.disabled-copy-note,
.copy-disabled-note {
  overflow-wrap: break-word;
}

.form-grid .field .hint {
  max-width: 32ch;
}

.save-action {
  background: #f8fafb;
  border-color: var(--line);
  color: #6b7280;
  box-shadow: none;
}

.save-action.dirty {
  background: linear-gradient(180deg, #18c2b0, var(--brand-strong));
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 8px 18px rgba(19, 184, 166, 0.16);
}

.redeem-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

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

.package-progress,
.package-bar {
  display: grid;
  gap: 10px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(31, 54, 68, 0.035);
}

.package-progress-head,
.package-bar-head,
.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.package-bar-head span {
  color: var(--brand-strong);
  font-weight: 800;
}

.package-bar-head strong {
  display: block;
  margin-bottom: 3px;
}

.package-bar-head small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.package-bar .progress-meta {
  padding-top: 2px;
  border-top: 1px dashed #dfe8ec;
}

.package-cycle-note,
.package-refresh-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.progress-meta {
  color: var(--muted);
  font-size: 12px;
}

.package-note {
  margin-top: 0;
}

.quota-package-list,
.quota-card-list {
  display: grid;
  gap: 12px;
}

.quota-package-card {
  position: relative;
  overflow: hidden;
  gap: 12px;
  padding: 14px;
  border-color: #d8f3ee;
  background: linear-gradient(180deg, #ffffff 0%, #f7fffd 100%);
}

.quota-package-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--brand), #7dd3fc);
}

.quota-package-card > div:first-child {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: start;
  padding-left: 2px;
}

.quota-package-card > div:first-child strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 15px;
}

.quota-package-card > div:first-child span {
  max-width: 100%;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.quota-package-card .subscription-total-box,
.quota-total-box {
  gap: 8px;
  padding: 11px 12px;
  border-radius: 12px;
  background: #f0fdfa;
}

.quota-package-card .subscription-total-box > div:first-child,
.quota-total-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.quota-package-card .subscription-total-box strong,
.quota-total-box strong {
  color: var(--brand-strong);
  font-size: 17px;
}

.quota-package-card .progress,
.quota-total-box .progress {
  height: 8px;
  background: #dbeafe;
}

.quota-package-card .progress-label {
  margin-top: 5px;
}

.quota-package-card .cycle-limit-list {
  gap: 7px;
}

.quota-package-card .cycle-limit-row {
  grid-template-columns: minmax(170px, 0.9fr) minmax(180px, 1fr) auto;
  padding: 9px 10px;
  border-color: #e5edf0;
  background: #fff;
}

.quota-package-card .cycle-limit-row > div:first-child {
  min-width: 0;
}

.quota-package-card .cycle-limit-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quota-package-card .cycle-limit-row span,
.quota-countdown {
  display: block;
  margin-top: 3px;
  color: #64748b;
  font-size: 12px;
}

.quota-package-card input::placeholder,
.quota-side-panel input::placeholder {
  color: #a8b4bf;
}

.quota-package-card .hint,
.quota-side-panel .hint,
.quota-side-panel .form-help {
  color: #738295;
  font-size: 12px;
  line-height: 1.45;
}

.quota-package-card .badge {
  justify-self: end;
}

.inline-empty {
  padding: 18px;
  text-align: left;
}

.model-group-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.model-group-tabs button {
  border-color: var(--line);
  background: #fff;
  color: var(--text);
  display: inline-grid;
  gap: 2px;
  text-align: left;
  box-shadow: none;
}

.model-group-tabs button.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.model-group-tabs button span {
  font-size: 11px;
  color: inherit;
  opacity: 0.78;
}

.model-group-tabs button.is-unavailable {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.model-group-tabs button.is-unavailable.active {
  border-color: #ea580c;
  background: #ea580c;
  color: #fff;
}

.model-workbench {
  display: grid;
  grid-template-columns: minmax(440px, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
  align-items: start;
}

.model-group-panel,
.model-price-panel {
  min-height: 420px;
}

.model-workbench .model-group-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.model-workbench .model-group-tabs button {
  min-height: 58px;
  align-content: center;
  white-space: normal;
  line-height: 1.35;
}

.model-group-panel .console-table th,
.model-group-panel .console-table td {
  padding: 10px 12px;
}

.model-group-panel .data-table {
  min-width: 680px;
  table-layout: fixed;
}

.model-group-panel .console-table th:first-child,
.model-group-panel .console-table td:first-child {
  width: 300px;
}

.model-group-panel .console-table td:first-child strong,
.model-group-panel .console-table td:first-child small {
  max-width: 260px;
}

.model-group-panel .console-table th:nth-child(2),
.model-group-panel .console-table td:nth-child(2),
.model-group-panel .console-table th:nth-child(3),
.model-group-panel .console-table td:nth-child(3),
.model-group-panel .console-table th:nth-child(4),
.model-group-panel .console-table td:nth-child(4) {
  width: 84px;
}

.model-group-panel .console-table th:last-child,
.model-group-panel .console-table td:last-child {
  width: 104px;
}

.model-price-panel .table-wrap {
  overflow-x: auto;
}

.model-price-panel .data-table {
  min-width: 920px;
  table-layout: fixed;
}

.model-name-cell {
  min-width: 220px;
  max-width: 320px;
}

.model-name-cell strong {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

.group-markup-form {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--soft);
}

.user-admin {
  min-width: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.user-admin-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.user-admin-head h2 {
  font-size: 18px;
}

.user-admin-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.user-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.user-summary span,
.soft-pill,
.money-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafb;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

.user-summary strong {
  margin-left: 4px;
  color: var(--text);
}

.money-pill {
  border-color: var(--brand-tint);
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.soft-pill + .soft-pill {
  margin-left: 5px;
}

.user-toolbar {
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) minmax(160px, 220px) auto auto;
  gap: 8px;
  align-items: center;
  padding: 14px 20px;
}

.user-admin .table-wrap {
  border-width: 1px 0 0;
  border-radius: 0 0 var(--radius) var(--radius);
}

.user-admin .data-table {
  min-width: 1160px;
  table-layout: fixed;
}

.user-admin .data-table th:nth-child(1),
.user-admin .data-table td:nth-child(1) {
  width: 92px;
}

.user-admin .data-table th:nth-child(2),
.user-admin .data-table td:nth-child(2) {
  width: 260px;
}

.user-admin .data-table th:nth-child(4),
.user-admin .data-table td:nth-child(4),
.user-admin .data-table th:nth-child(5),
.user-admin .data-table td:nth-child(5),
.user-admin .data-table th:nth-child(7),
.user-admin .data-table td:nth-child(7) {
  width: 170px;
}

.user-admin .data-table th:last-child,
.user-admin .data-table td:last-child {
  width: 260px;
}

.user-admin .data-table td:nth-child(2) strong,
.user-admin .data-table td:nth-child(2) small {
  max-width: 230px;
}

.plan-user-button,
button[data-view-plan-users],
button[data-open-plan-users] {
  border-color: var(--brand-tint);
  background: #f8fffd;
  color: var(--brand-strong);
}

.plan-user-button:hover,
button[data-view-plan-users]:hover,
button[data-open-plan-users]:hover {
  background: var(--brand-soft);
}

.plan-users-list,
.modal-user-list {
  display: grid;
  gap: 8px;
}

.plan-user-row,
.modal-user-row,
.modal-body .active-user-panel {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}

.plan-user-row strong,
.modal-user-row strong,
.plan-user-row small,
.modal-user-row small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-actions {
  white-space: nowrap;
  min-width: 148px;
}

.ghost-action {
  min-height: 30px;
  border-color: var(--line);
  background: #fff;
  color: #475569;
  font-size: 12px;
  border-radius: 9px;
  box-shadow: none;
}

.ghost-action:hover,
.ghost-action.blue {
  border-color: var(--brand-tint);
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.ghost-action.accent {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.danger.ghost-action {
  border-color: #fecaca;
  background: #fff1f2;
  color: var(--red);
}

.pill-button {
  border-radius: 999px;
}

.bulk-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.bulk-toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.bulk-toolbar input,
.code-select {
  width: auto;
  min-height: auto;
}

.query-form {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--soft);
}

.filter-bar {
  margin-bottom: 14px;
  align-items: center;
}

.filter-bar input,
.filter-bar select {
  background: #fff;
}

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

.quick-action {
  width: 100%;
  min-height: 66px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-color: var(--line);
  background: #f8fafb;
  color: var(--text);
  text-align: left;
  box-shadow: none;
}

.quick-action:hover {
  border-color: var(--brand-tint);
  background: var(--brand-soft);
  color: var(--text);
}

.quick-action span {
  display: grid;
  gap: 3px;
}

.quick-action strong {
  font-size: 14px;
}

.quick-action small {
  margin: 0;
}

.domain-guide {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--brand-tint);
  border-radius: 14px;
  background: var(--brand-soft);
  color: #0f766e;
  font-size: 13px;
  line-height: 1.6;
}

.domain-guide strong {
  color: var(--brand-strong);
}

.domain-guide span {
  color: #334155;
}

.domain-warning {
  margin-top: 2px;
  color: var(--amber) !important;
  font-weight: 800;
}

.domain-blocker {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  padding: 13px 14px;
  border: 1px solid #fed7aa;
  border-radius: 14px;
  background: #fff7ed;
  color: #9a3412;
}

.domain-blocker strong {
  color: #7c2d12;
}

.domain-blocker span {
  color: #9a3412;
  font-size: 13px;
  line-height: 1.7;
}

.domain-blocker code {
  padding: 2px 5px;
  border-radius: 6px;
  background: #ffedd5;
  color: #7c2d12;
}

.domain-field-warning,
.domain-result-tip {
  display: grid;
  gap: 5px;
  padding: 11px 12px;
  border: 1px solid #fecaca;
  border-radius: 12px;
  background: #fff1f2;
  color: #991b1b;
  font-size: 13px;
  line-height: 1.6;
}

.domain-field-warning strong,
.domain-result-tip strong {
  color: #7f1d1d;
}

.domain-field-warning code {
  padding: 2px 5px;
  border-radius: 6px;
  background: #ffe4e6;
}

.domain-wizard {
  display: grid;
  gap: 14px;
  position: relative;
}

.domain-step {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #fff, #fbfefd);
  box-shadow: 0 5px 16px rgba(31, 54, 68, 0.04);
}

.domain-step h3 {
  margin: 0;
  font-size: 17px;
}

.domain-step p {
  margin: 6px 0 0;
  color: #475569;
  line-height: 1.7;
}

.domain-flow-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.domain-flow-strip div {
  min-height: 64px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.domain-flow-strip b {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 13px;
}

.domain-flow-strip span {
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

.step-index {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--brand);
  color: #fff;
  font-weight: 900;
}

.step-body {
  min-width: 0;
}

.domain-bind-inline {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
  margin-top: 12px;
}

.domain-verify-inline {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #ccfbf1;
  border-radius: 14px;
  background: #f0fdfa;
}

.domain-bind-inline input,
.domain-bind-inline button,
.domain-verify-inline input,
.domain-verify-inline button {
  min-height: 42px;
}

.domain-inline-feedback {
  display: none;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #ccfbf1;
  border-radius: 12px;
  background: #f0fdfa;
  color: #0f766e;
  font-size: 13px;
  font-weight: 800;
}

.domain-inline-feedback.show {
  display: block;
}

.wizard-dns-grid {
  margin-top: 12px;
}

.domain-fill-example {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid #e0f2fe;
  border-radius: 13px;
  background: #f0f9ff;
}

.domain-fill-example span {
  display: block;
  color: #0369a1;
  font-size: 12px;
  font-weight: 900;
}

.domain-fill-example p {
  margin-top: 5px;
  color: #0f172a;
}

.wizard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.wizard-actions button,
.domain-card-actions button,
.api-ready-box button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.domain-help {
  padding: 9px 10px;
  border: 1px solid var(--brand-tint);
  border-radius: 12px;
  background: var(--brand-soft);
  color: #0f766e !important;
  font-size: 13px;
}

.domain-status-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.domain-local-note {
  display: grid;
  gap: 5px;
  margin-top: 10px;
  padding: 11px 12px;
  border: 1px solid #fde68a;
  border-radius: 12px;
  background: #fffbeb;
  color: #92400e;
  font-size: 13px;
  line-height: 1.6;
}

.domain-local-note strong {
  color: #78350f;
}

.bound-domain-card {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--soft);
}

.domain-card-actions .ghost-action svg,
.wizard-actions .secondary svg,
.gateway-summary button svg,
.api-ready-box button svg {
  width: 15px;
  height: 15px;
}

.bound-domain-card strong,
.bound-domain-card code,
.api-ready-box strong {
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-word;
}

.bound-domain-card small {
  color: var(--muted);
}

.bound-domain-card code {
  grid-column: 1 / -1;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #0f172a;
}

.domain-card-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.api-ready-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: center;
  margin-top: 12px;
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  background: var(--soft);
}

.api-ready-box.ready {
  border-style: solid;
  border-color: #86efac;
  background: #f0fdf4;
}

.api-ready-box span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.api-ready-box strong {
  font-size: 18px;
}

.domain-advanced {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}

.domain-advanced summary {
  cursor: pointer;
  padding: 12px 14px;
  color: #334155;
  font-weight: 800;
}

.domain-advanced .table-wrap {
  border-width: 1px 0 0;
  border-radius: 0;
}

.domain-advanced .data-table {
  min-width: 960px;
  table-layout: fixed;
}

.domain-advanced .data-table th:nth-child(1),
.domain-advanced .data-table td:nth-child(1),
.domain-advanced .data-table th:nth-child(3),
.domain-advanced .data-table td:nth-child(3) {
  width: 280px;
}

.domain-advanced .data-table th:last-child,
.domain-advanced .data-table td:last-child {
  width: 190px;
}

.domain-advanced .data-table td:nth-child(1),
.domain-advanced .data-table td:nth-child(3) {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gateway-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--brand-tint);
  border-radius: 15px;
  background: var(--brand-soft);
}

.gateway-box span {
  grid-column: 1 / -1;
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 800;
}

.gateway-box strong {
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
  color: #0f172a;
  font-size: 20px;
}

.gateway-box small {
  grid-column: 1 / -1;
  color: #475569;
  line-height: 1.6;
}

.dns-record-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.dns-record-grid div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--soft);
}

.dns-record-grid span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.dns-record-grid strong {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

.frontend-hosting-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.frontend-hosting-flow div {
  min-width: 0;
  display: grid;
  gap: 6px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--soft);
}

.frontend-hosting-flow strong {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 12px;
}

.frontend-hosting-flow span,
.frontend-upload-placeholder span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.frontend-command-card,
.gateway-summary {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--brand-tint);
  border-radius: 16px;
  background: linear-gradient(180deg, #f6fffd, var(--brand-soft));
}

.frontend-command-card > div,
.gateway-summary > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.frontend-command-card strong,
.gateway-summary strong {
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
  color: var(--text);
}

.frontend-command-card span,
.gateway-summary span,
.gateway-summary small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.gateway-summary {
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 14px;
}

.frontend-entry-list {
  display: grid;
  gap: 8px;
  max-width: 100%;
  overflow: hidden;
}

.frontend-entry-list div {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) 34px;
  gap: 8px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}

.frontend-entry-list span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.frontend-entry-list strong {
  min-width: 0;
  color: var(--text);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

.form-help {
  margin: -4px 0 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.frontend-upload-placeholder,
.frontend-release-status {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 13px;
  border: 1px dashed var(--brand-tint);
  border-radius: 15px;
  background: #fbfefd;
}

.frontend-upload-placeholder span {
  min-width: 0;
}

.frontend-upload-placeholder button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.frontend-release-status {
  grid-template-columns: 100px minmax(0, 1fr);
  border-style: solid;
  background: var(--soft);
}

.frontend-release-status span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.frontend-release-status strong,
.frontend-release-status small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

.frontend-release-status small {
  grid-column: 2;
  color: var(--muted);
  font-size: 12px;
}

.result-list {
  display: grid;
  gap: 8px;
}

.result-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.result-row span {
  color: var(--muted);
}

.result-row strong {
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-word;
}

.mini-chart {
  height: 120px;
  display: flex;
  align-items: end;
  gap: 4px;
  margin-top: 18px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--soft);
}

.mini-chart.tall {
  height: 188px;
}

.mini-chart span {
  position: relative;
  flex: 1;
  min-width: 5px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, #56dfd0, var(--brand-strong));
}

.mini-chart span em {
  position: absolute;
  left: 50%;
  bottom: -24px;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  white-space: nowrap;
}

.mini-chart.hourly {
  min-width: 960px;
  margin-top: 0;
  padding-bottom: 34px;
}

.mini-chart.hourly span {
  min-width: 30px;
}

.chart-scroll {
  overflow-x: auto;
  padding-bottom: 6px;
}

.usage-panel {
  display: grid;
  gap: 12px;
}

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

.usage-summary-row div,
.settings-summary div {
  min-height: 66px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--soft);
}

.usage-summary-row span,
.settings-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.usage-summary-row strong,
.settings-summary strong {
  font-size: 16px;
}

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

.dashboard-lower-grid {
  grid-template-columns: minmax(620px, 1.45fr) minmax(320px, 0.55fr);
  align-items: start;
  margin-top: 18px;
}

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

.recent-usage-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 13px 14px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: #f8fafb;
}

.recent-usage-item > div {
  min-width: 0;
}

.recent-usage-item strong,
.recent-usage-item span {
  display: block;
}

.recent-usage-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.recent-cost {
  text-align: right;
}

.recent-cost strong {
  color: var(--green);
  font-size: 17px;
}

.dashboard-quick-panel {
  margin-top: 0;
}

.quota-side-panel {
  min-height: 0;
  max-height: clamp(520px, 72vh, 760px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  overflow: hidden;
}

.quota-side-panel .panel-head {
  min-width: 0;
}

.quota-side-scroll,
.quota-side-panel .quota-package-list,
.quota-side-panel .quota-card-list {
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 2px 6px 2px 2px;
  border-block: 1px solid rgba(216, 227, 233, 0.78);
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.quota-side-panel .quota-package-list,
.quota-side-panel .quota-card-list {
  max-height: clamp(280px, 44vh, 430px);
}

.quota-side-scroll::-webkit-scrollbar,
.quota-side-panel .quota-package-list::-webkit-scrollbar,
.quota-side-panel .quota-card-list::-webkit-scrollbar {
  width: 8px;
}

.quota-side-scroll::-webkit-scrollbar-thumb,
.quota-side-panel .quota-package-list::-webkit-scrollbar-thumb,
.quota-side-panel .quota-card-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #cbdde3;
}

.quota-side-scroll::-webkit-scrollbar-track,
.quota-side-panel .quota-package-list::-webkit-scrollbar-track,
.quota-side-panel .quota-card-list::-webkit-scrollbar-track {
  background: transparent;
}

.quota-side-panel .quota-package-list::before,
.quota-side-panel .quota-card-list::before,
.quota-side-scroll::before {
  content: "";
  position: sticky;
  z-index: 1;
  top: -2px;
  display: block;
  height: 1px;
  margin-bottom: -1px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.08), rgba(15, 23, 42, 0));
}

.quota-side-panel .redeem-bar {
  min-width: 0;
  padding-top: 2px;
}

.rank {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.rank:last-child {
  border-bottom: 0;
}

.quota-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 10px;
  background: var(--soft);
}

.quota-card div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.quota-card div:first-child span {
  color: var(--muted);
  font-size: 12px;
}

.token-admin {
  min-width: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.token-create-panel {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: #fbfefd;
}

.token-create-panel > div:first-child {
  align-self: start;
  padding: 14px;
  border: 1px solid var(--brand-tint);
  border-radius: 16px;
  background: var(--brand-soft);
}

.token-create-panel h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.token-create-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.token-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(140px, 180px) minmax(120px, 160px) auto auto;
  gap: 8px;
  align-items: center;
  padding: 14px 20px;
  background: #fff;
}

.token-admin .table-wrap {
  border-width: 1px 0 0;
  border-radius: 0 0 var(--radius) var(--radius);
}

.redemption-metrics {
  margin-bottom: 18px;
}

.redemption-admin {
  display: grid;
  grid-template-columns: minmax(340px, 0.72fr) minmax(0, 1.28fr);
  gap: 18px;
  align-items: start;
}

.redemption-create-card,
.redemption-batch-card,
.redemption-code-card {
  margin-top: 0 !important;
}

.redemption-create-card {
  position: sticky;
  top: 82px;
}

.redemption-create-card .form-grid {
  grid-template-columns: repeat(2, minmax(180px, 1fr));
}

.redemption-create-card .field:has(select:disabled),
.redemption-create-card .field:has(input:disabled) {
  position: relative;
  padding: 10px;
  border: 1px dashed #dbe4ea;
  border-radius: 13px;
  background: #f8fafc;
}

.redemption-create-card .field:has(select:disabled)::after,
.redemption-create-card .field:has(input:disabled)::after {
  content: "当前类型不需要填写，提交时会自动忽略";
  display: block;
  margin-top: 6px;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.35;
}

.redemption-code-card {
  grid-column: 1 / -1;
}

.redemption-batch-card .data-table {
  min-width: 980px;
  table-layout: fixed;
}

.redemption-batch-card .data-table th:first-child,
.redemption-batch-card .data-table td:first-child {
  width: 300px;
}

.redemption-batch-card .data-table th:last-child,
.redemption-batch-card .data-table td:last-child {
  width: 250px;
}

.redemption-batch-card .data-table td:first-child strong,
.redemption-batch-card .data-table td:first-child small {
  max-width: 270px;
}

.redemption-code-card .data-table {
  min-width: 1040px;
  table-layout: fixed;
}

.redemption-code-card .data-table th:first-child,
.redemption-code-card .data-table td:first-child {
  width: 48px;
}

.redemption-code-card .data-table th:nth-child(2),
.redemption-code-card .data-table td:nth-child(2) {
  width: 360px;
}

.redemption-code-card .data-table th:last-child,
.redemption-code-card .data-table td:last-child {
  width: 310px;
}

.redemption-code-cell.is-masked {
  padding: 8px;
  border: 1px dashed #dbe4ea;
  border-radius: 12px;
  background: #f8fafc;
}

.redemption-code-cell.is-masked small {
  color: #7b8794;
}

.disabled-copy-note,
.copy-disabled-note,
.copy-unavailable-note,
.redemption-copy-hint {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  padding: 9px 10px;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: #eff6ff;
  color: #475569;
  font-size: 12px;
  line-height: 1.5;
}

.disabled-copy-note strong,
.copy-disabled-note strong,
.copy-unavailable-note strong,
.redemption-copy-hint strong {
  color: #2563eb;
  font-size: 12px;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(420px, 0.95fr) minmax(460px, 1.05fr);
  gap: 18px;
  align-items: start;
}

.agent-settings-grid {
  grid-template-columns: minmax(420px, 0.95fr) minmax(460px, 1.05fr);
  grid-auto-flow: dense;
}

.settings-card {
  display: grid;
  align-content: start;
  gap: 14px;
}

.settings-profile-card {
  align-self: start;
}

.frontend-hosting-card {
  grid-column: 2;
  grid-row: span 2;
}

.api-domain-card {
  grid-column: 1 / -1;
}

.agent-settings-grid .api-domain-card {
  grid-column: 1;
}

.guide-page {
  display: grid;
  gap: 14px;
}

.guide-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
}

.guide-hero h2 {
  margin: 6px 0 8px;
  font-size: 24px;
}

.guide-hero p,
.guide-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.eyebrow {
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 800;
}

.guide-actions,
.frontend-release-mock {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

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

.guide-card {
  display: grid;
  gap: 12px;
}

.guide-card h3 {
  margin: 0;
  font-size: 18px;
}

.guide-card pre {
  margin: 0;
  padding: 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #0f172a;
  color: #e2e8f0;
}

.file-tree,
.flow-steps,
.plain-list {
  display: grid;
  gap: 8px;
}

.file-tree span,
.flow-steps span {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

.flow-steps {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.plain-list {
  margin: 0;
  padding-left: 18px;
  color: #334155;
  line-height: 1.7;
}

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

.modal-hint {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--brand-tint);
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  line-height: 1.6;
}

.newapi-bind-form {
  gap: 12px;
}

.sync-intro {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--soft);
}

.sync-intro strong {
  color: var(--text);
}

.sync-intro span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.or-line {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.or-line::before,
.or-line::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.code-box {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.code-box code {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
}

.new-code-panel {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--brand-tint);
  border-radius: 15px;
  background: #f7fffd;
}

.new-code-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.new-code-head div {
  display: grid;
  gap: 3px;
}

.new-code-head small {
  color: var(--muted);
}

.code-textarea {
  width: 100%;
  min-height: 168px;
  resize: vertical;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.65;
}

.redemption-code-cell {
  display: grid;
  gap: 4px;
  min-width: 320px;
}

.redemption-code-cell code {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--brand-tint);
  border-radius: 10px;
  background: #f8fffd;
  color: #0f766e;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

.redemption-code-cell small {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.redemption-code-cell.is-masked code {
  border-color: var(--line);
  background: var(--soft);
  color: #64748b;
}

.redemption-code-cell small {
  color: var(--muted);
}

.empty {
  min-height: 54px;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.switch {
  position: relative;
  display: inline-flex;
  width: 42px;
  height: 24px;
}

.switch input {
  display: none;
}

.switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #cbd5e1;
}

.switch span::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s ease;
}

.switch input:checked + span {
  background: var(--brand);
}

.switch input:checked + span::after {
  transform: translateX(18px);
}

.segmented {
  display: flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #f8fafb;
}

.segmented button {
  min-height: 34px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}

.segmented button.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(4px);
  z-index: 10;
}

.modal {
  width: min(720px, 100%);
  max-height: 86vh;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 28px 68px rgba(15, 23, 42, 0.24);
}

.modal-head,
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.modal-head h2 {
  font-size: 20px;
}

.modal-body {
  min-width: 0;
  overflow: auto;
  padding: 20px;
}

.modal-footer {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  border-bottom: 0;
  background: #fbfefd;
}

.code-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #0f172a;
}

.modal pre {
  overflow: auto;
  padding: 12px;
  border: 0;
  border-radius: 0;
  background: #0f172a;
  color: #e5e7eb;
  line-height: 1.5;
}

.validation-modal {
  display: grid;
  gap: 12px;
}

.validation-summary {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.validation-summary strong,
.validation-summary span {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.validation-summary strong {
  background: #fee2e2;
  color: #991b1b;
}

.validation-summary span {
  background: #dcfce7;
  color: #166534;
}

.validation-list {
  display: grid;
  gap: 8px;
}

.validation-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 4px 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--soft);
}

.validation-row span {
  grid-row: span 2;
  width: fit-content;
  align-self: start;
  padding: 4px 7px;
  border-radius: 6px;
  background: #fee2e2;
  color: #991b1b;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  font-weight: 800;
}

.validation-row strong {
  color: var(--text);
}

.validation-row p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.validation-extra {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}

.validation-extra strong {
  display: block;
  margin-bottom: 6px;
}

.validation-extra ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  justify-content: flex-end;
  background: rgba(15, 23, 42, 0.38);
  backdrop-filter: blur(3px);
}

.drawer {
  width: min(680px, 100%);
  height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: #f8fbfb;
  box-shadow: -22px 0 44px rgba(15, 23, 42, 0.22);
}

.drawer-head,
.drawer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.drawer-footer {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.drawer-head h2 {
  font-size: 19px;
}

.drawer-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-bottom: 7px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 800;
}

.drawer-close {
  width: 36px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
}

.drawer-body {
  min-width: 0;
  overflow: auto;
  padding: 18px;
}

.drawer .table-wrap {
  max-width: 100%;
}

.drawer-stack {
  display: grid;
  gap: 12px;
}

.drawer-card {
  min-width: 0;
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 5px 16px rgba(31, 54, 68, 0.04);
}

.drawer-card-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.drawer-card-head h3 {
  margin: 0;
  font-size: 15px;
}

.drawer-card-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.drawer-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 900;
}

.drawer-icon.green {
  background: #dcfce7;
  color: var(--green);
}

.drawer-icon.amber {
  background: #fef3c7;
  color: #92400e;
}

.drawer-icon.purple {
  background: #f3e8ff;
  color: #7e22ce;
}

.explain-box {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--brand-tint);
  border-radius: 14px;
  background: #f7fffd;
  color: #33515a;
  font-size: 12px;
  line-height: 1.65;
}

.explain-box strong {
  color: var(--brand-strong);
  font-size: 13px;
}

.explain-box span {
  color: var(--muted);
}

.subscription-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.subscription-overview div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfefd;
}

.subscription-overview span {
  color: var(--muted);
  font-size: 12px;
}

.subscription-overview strong {
  color: var(--text);
  font-size: 18px;
}

.subscription-package-list {
  display: grid;
  gap: 8px;
}

.subscription-package-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfefd;
}

.subscription-package-card.is-inactive {
  opacity: 0.72;
  background: #f8fafc;
}

.subscription-package-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.subscription-package-head strong {
  display: block;
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  color: var(--text);
}

.subscription-package-head span,
.subscription-rule-note,
.cycle-limit-row span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.package-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.package-actions button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.subscription-total-box {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--brand-tint);
  border-radius: 13px;
  background: #f2fffc;
}

.subscription-total-box span {
  color: var(--muted);
  font-size: 12px;
}

.subscription-total-box strong {
  display: block;
  margin-top: 3px;
  color: var(--brand-strong);
  font-size: 16px;
}

.subscription-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.subscription-meta-grid span {
  padding: 7px 9px;
  border-radius: 10px;
  background: #fff;
  color: #475569;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.subscription-rule-note {
  margin: 0;
}

.cycle-limit-list {
  display: grid;
  gap: 6px;
}

.cycle-limit-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(180px, 1.2fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.cycle-limit-row strong {
  display: block;
  color: var(--text);
  font-size: 13px;
}

.drawer h3 {
  margin: 10px 0 0;
  font-size: 14px;
}

.quota-mini {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--brand-tint);
  border-radius: 14px;
  background: var(--brand-soft);
}

.quota-mini span,
.quota-mini small {
  color: #475569;
  font-size: 12px;
}

.quota-mini strong {
  color: var(--brand-strong);
  font-size: 24px;
}

.split-inline {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto auto auto;
  align-items: center;
}

.drawer-footer [data-drawer-submit] {
  min-width: 92px;
}

@media (max-width: 1180px) {
  .agent-dashboard {
    grid-template-columns: 1fr;
  }

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

  .grid.two,
  .customer-dashboard-grid,
  .dashboard-lower-grid,
  .settings-grid,
  .grid.customers-layout,
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .model-workbench,
  .redemption-admin {
    grid-template-columns: 1fr;
  }

  .redemption-code-card {
    grid-column: 1 / -1;
  }

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

  .user-admin-head,
  .user-toolbar,
  .token-create-panel,
  .token-toolbar {
    grid-template-columns: 1fr;
  }

  .user-summary {
    justify-content: flex-start;
  }
}

@media (max-width: 980px) {
  .model-workbench,
  .redemption-admin,
  .token-create-panel {
    grid-template-columns: 1fr;
  }

  .redemption-create-card {
    position: static;
  }

  .redemption-create-card .form-grid,
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .login-card,
  .shell,
  .shell.collapsed,
  .grid.two,
  .customer-dashboard-grid,
  .dashboard-lower-grid,
  .settings-grid,
  .grid.customers-layout,
  .model-workbench,
  .redemption-admin,
  .metrics,
  .dashboard-side,
  .dashboard-stat-row,
  .hero-facts,
  .form-grid,
  .split,
  .subscription-overview,
  .subscription-package-head,
  .subscription-meta-grid,
  .cycle-limit-row,
  .quota-package-card > div:first-child,
  .quota-package-card .cycle-limit-row,
  .package-bar-head,
  .package-progress-head {
    grid-template-columns: 1fr;
  }

  .package-actions {
    justify-content: flex-start;
  }

  .panel-head .action-row,
  .quota-actions,
  .balance-actions,
  .dashboard-actions {
    width: 100%;
    justify-content: stretch;
  }

  .panel-head .action-row button,
  .quota-actions button,
  .balance-actions button,
  .dashboard-actions button {
    flex: 1 1 160px;
  }

  .api-domain-card {
    grid-column: auto;
  }

  .frontend-hosting-card,
  .agent-settings-grid .api-domain-card {
    grid-column: auto;
    grid-row: auto;
  }

  .dns-record-grid,
  .gateway-box,
  .gateway-summary,
  .domain-flow-strip,
  .domain-step,
  .domain-bind-inline,
  .domain-verify-inline,
  .bound-domain-card,
  .api-ready-box,
  .frontend-command-card,
  .frontend-hosting-flow,
  .frontend-upload-placeholder,
  .guide-hero,
  .guide-grid,
  .flow-steps {
    grid-template-columns: 1fr;
  }

  .guide-actions,
  .frontend-release-mock {
    justify-content: stretch;
  }

  .quota-hero {
    min-height: auto;
    padding: 18px;
  }

  .quota-hero-head {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    grid-auto-flow: row;
    grid-template-columns: 1fr 1fr;
    justify-content: stretch;
  }

  .redeem-bar {
    grid-template-columns: 1fr;
  }

  .model-multiselect-panel {
    position: fixed;
    left: 14px;
    right: 14px;
    top: auto;
    bottom: 14px;
    max-height: min(420px, 70vh);
  }

  .quota-package-card {
    padding: 12px;
  }

  .quota-side-panel {
    max-height: min(78vh, 620px);
  }

  .quota-side-panel .quota-package-list,
  .quota-side-panel .quota-card-list,
  .quota-side-scroll {
    max-height: min(48vh, 390px);
    padding-right: 4px;
  }

  .quota-package-card > div:first-child span {
    grid-column: 1;
  }

  .quota-package-card .badge {
    justify-self: start;
  }

  .plan-user-row,
  .modal-user-row,
  .modal-body .active-user-panel {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .coverage-warning {
    grid-template-columns: 1fr;
  }

  .dashboard-filter-card {
    display: grid;
    padding: 14px;
  }

  .recent-usage-item {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .recent-cost {
    grid-column: 2;
    text-align: left;
  }

  .redemption-create-card {
    position: static;
  }

  .quota-hero h2 {
    font-size: 38px;
  }

  .shell,
  .shell.collapsed {
    display: block;
  }

  .sidebar {
    position: fixed;
    z-index: 20;
    left: 0;
    top: 0;
    width: min(280px, 82vw);
    height: 100vh;
    transform: translateX(0);
    transition: transform 0.2s ease;
    box-shadow: 20px 0 36px rgba(15, 23, 42, 0.18);
  }

  .sidebar-close {
    position: absolute;
    display: grid;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    place-items: center;
    padding: 0;
    border-color: var(--line);
    background: #fff;
    color: var(--brand-strong);
    font-size: 20px;
    font-weight: 800;
  }

  .shell.collapsed .sidebar {
    transform: translateX(-110%);
  }

  .collapsed .brand div:last-child,
  .collapsed .nav span,
  .collapsed #logoutBtn span {
    display: block;
  }

  .mobile-sidebar-scrim {
    position: fixed;
    inset: 0;
    display: block;
    z-index: 15;
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: rgba(15, 23, 42, 0.28);
  }

  .shell.collapsed .mobile-sidebar-scrim {
    display: none;
  }

  .content {
    padding: 0 14px 18px;
  }

  .topbar {
    height: auto;
    grid-template-columns: auto 1fr;
    margin: 0 -14px 16px;
    padding: 12px 14px;
  }

  .sidebar-toggle {
    min-width: 48px;
    width: 48px;
    height: 42px;
    position: sticky;
    top: 10px;
    z-index: 14;
  }

  .top-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .user-admin-head,
  .user-toolbar,
  .token-create-panel,
  .token-toolbar,
  .usage-summary-row,
  .settings-summary,
  .rank-grid,
  .split-inline {
    grid-template-columns: 1fr;
  }

  .mini-chart.hourly {
    min-width: 780px;
  }

  .drawer {
    width: min(92vw, 680px);
  }

  .modal-backdrop {
    padding: 12px;
  }

  .modal {
    width: 100%;
    max-height: 90vh;
    border-radius: 18px;
  }

  .modal-body {
    padding: 16px;
  }

  .login-copy {
    min-height: auto;
    padding: 30px;
  }
}
