:root {
  --bg: #f3f1ea;
  --surface: #fbfaf6;
  --surface-strong: #ffffff;
  --surface-soft: #eeece4;
  --text: #252921;
  --muted: #62675e;
  --line: #d9d8ce;
  --line-strong: #c6c8bc;
  --primary: #3f7048;
  --primary-hover: #315b39;
  --primary-soft: #e3eee3;
  --on-primary: #ffffff;
  --success: #347148;
  --success-soft: #e4f0e5;
  --warning: #8c6725;
  --warning-soft: #f5ecd8;
  --danger: #ad4438;
  --danger-hover: #90372e;
  --danger-soft: #f6e5e1;
  --shadow: 0 18px 48px rgba(54, 59, 45, 0.08);
  --radius-panel: 18px;
  --radius-control: 10px;
  color-scheme: light;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

html.dark {
  --bg: #141711;
  --surface: #1b2018;
  --surface-strong: #20261d;
  --surface-soft: #272d23;
  --text: #f0f2e9;
  --muted: #adb4a7;
  --line: #343b30;
  --line-strong: #46503f;
  --primary: #88ba8d;
  --primary-hover: #a2cba5;
  --primary-soft: #263a28;
  --on-primary: #102013;
  --success: #8fc79a;
  --success-soft: #223628;
  --warning: #d4ab60;
  --warning-soft: #3b3120;
  --danger: #ee8a7e;
  --danger-hover: #f3a097;
  --danger-soft: #412723;
  --shadow: 0 20px 56px rgba(0, 0, 0, 0.24);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100dvh;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

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

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

button,
a {
  touch-action: manipulation;
}

a {
  color: inherit;
}

.hidden {
  display: none !important;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 84%, transparent);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.header-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  width: min(1180px, calc(100% - 40px));
  min-height: 72px;
  margin: 0 auto;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: max-content;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: var(--on-primary);
  background: var(--primary);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.04em;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--primary) 20%, transparent);
}

.brand-copy b,
.brand-copy small {
  display: block;
}

.brand-copy b {
  font-size: 17px;
  letter-spacing: 0.01em;
}

.brand-copy small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.nav-link {
  min-width: max-content;
  padding: 9px 12px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
  transition: color 160ms ease, background-color 160ms ease;
}

.nav-link:hover {
  color: var(--text);
  background: var(--surface-soft);
}

.nav-link[aria-current="page"] {
  color: var(--primary);
  background: var(--primary-soft);
}

.header-actions,
.toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.queue-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 134px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
}

.queue-chip > span:last-child,
.queue-chip b,
.queue-chip small {
  display: block;
}

.queue-chip b {
  font-size: 12px;
  line-height: 1.25;
}

.queue-chip small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
}

.queue-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: var(--warning);
  box-shadow: 0 0 0 4px var(--warning-soft);
}

.queue-dot.live {
  background: var(--success);
  box-shadow: 0 0 0 4px var(--success-soft);
}

.theme-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  color: var(--text);
  background: var(--surface);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.theme-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 28px;
}

.announcement {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  margin-bottom: 24px;
  padding: 12px 15px;
  border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--line));
  border-radius: 12px;
  background: var(--primary-soft);
  font-size: 13px;
}

.announcement b {
  color: var(--primary);
  white-space: nowrap;
}

.announcement span {
  overflow-wrap: anywhere;
}

.view {
  animation: view-enter 220ms ease both;
}

.page-heading,
.admin-toolbar,
.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

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

.page-heading h1,
.admin-toolbar h1,
.auth-copy h1 {
  margin: 4px 0 7px;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.page-heading h1:focus,
.admin-toolbar h1:focus {
  outline: none;
}

.page-heading p,
.auth-copy p,
.panel-heading p {
  max-width: 64ch;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.eyebrow,
.form-heading > span,
.modal-heading > span {
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.page-meta {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.recharge-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  align-items: start;
  gap: 20px;
}

.flow-rail,
.panel,
.result-card,
.subscription-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface);
}

.flow-rail {
  padding: 22px;
}

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

.progress-list li {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 11px;
  min-height: 72px;
  color: var(--muted);
}

.progress-list li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 32px;
  bottom: 5px;
  left: 14px;
  width: 1px;
  background: var(--line);
}

.progress-list li > b {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  z-index: 1;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  font-size: 12px;
}

.progress-list strong,
.progress-list small {
  display: block;
}

.progress-list strong {
  padding-top: 3px;
  color: var(--text);
  font-size: 13px;
}

.progress-list small {
  margin-top: 2px;
  font-size: 11px;
}

.progress-list li.active > b,
.progress-list li.done > b {
  border-color: var(--primary);
  color: var(--on-primary);
  background: var(--primary);
}

.progress-list li.active strong {
  color: var(--primary);
}

.progress-list li.done:not(:last-child)::after {
  background: var(--primary);
}

.trust-note {
  margin-top: 10px;
  padding: 14px;
  border-radius: 12px;
  background: var(--surface-soft);
}

.trust-note strong {
  font-size: 12px;
}

.trust-note p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.panel {
  padding: 24px;
  box-shadow: var(--shadow);
}

.form-panel {
  min-height: 390px;
  padding: clamp(24px, 4vw, 38px);
}

.form-panel form,
.receipt {
  max-width: 690px;
  margin: 0 auto;
}

.form-heading {
  margin-bottom: 24px;
}

.form-heading h2,
.panel-heading h2,
.subscription-hero h2,
.modal-heading h2 {
  margin: 4px 0 6px;
  font-size: 23px;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.form-heading p,
.modal-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.form-heading.centered {
  text-align: center;
}

.field {
  display: block;
  margin-bottom: 18px;
}

.field > span,
.compact-field > span {
  display: block;
  margin-bottom: 7px;
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
}

.field input,
.field textarea,
.field select,
.compact-field input,
.compact-field select {
  display: block;
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  outline: none;
  color: var(--text);
  background: var(--surface-strong);
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.field input,
.field select,
.compact-field input,
.compact-field select {
  min-height: 46px;
  padding: 0 13px;
}

.field textarea {
  min-height: 116px;
  padding: 12px 13px;
  resize: vertical;
}

#sessionInput,
#subscriptionInput,
.code-output {
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  line-height: 1.65;
}

.field input::placeholder,
.field textarea::placeholder,
.compact-field input::placeholder {
  color: color-mix(in srgb, var(--muted) 78%, transparent);
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.compact-field input:focus,
.compact-field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}

.field input[readonly] {
  color: var(--muted);
  background: var(--surface-soft);
}

.verified-plan {
  display: inline-flex;
  margin-top: 8px !important;
  padding: 7px 10px;
  border-radius: 9px;
  color: var(--primary) !important;
  background: var(--primary-soft);
  font-weight: 700;
}

.privacy-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  margin: -4px 0 20px;
  padding: 11px 12px;
  border-left: 3px solid var(--primary);
  border-radius: 0 9px 9px 0;
  background: var(--primary-soft);
  font-size: 12px;
}

.privacy-note span {
  color: var(--muted);
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

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

.centered-actions {
  justify-content: center;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  color: var(--text);
  background: transparent;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 140ms ease, border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:active:not(:disabled) {
  transform: translateY(1px);
}

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

.button.primary {
  color: var(--on-primary);
  background: var(--primary);
}

.button.primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.button.ghost {
  border-color: var(--line-strong);
  background: var(--surface);
}

.button.ghost:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.button.danger {
  color: #ffffff;
  background: var(--danger);
}

html.dark .button.danger {
  color: #24100e;
}

.button.danger:hover:not(:disabled) {
  background: var(--danger-hover);
}

.button.compact {
  min-height: 36px;
  padding: 0 11px;
  font-size: 11px;
}

.button.full {
  width: 100%;
}

.text-button {
  padding: 3px 0;
  border: 0;
  color: var(--primary);
  background: transparent;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.text-button:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.message {
  margin-top: 16px;
  padding: 11px 13px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.message.info {
  border-color: color-mix(in srgb, var(--primary) 28%, transparent);
  color: var(--primary);
  background: var(--primary-soft);
}

.message.success {
  border-color: color-mix(in srgb, var(--success) 28%, transparent);
  color: var(--success);
  background: var(--success-soft);
}

.message.error {
  border-color: color-mix(in srgb, var(--danger) 28%, transparent);
  color: var(--danger);
  background: var(--danger-soft);
}

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

.confirm-grid > div {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.confirm-grid dt,
.detail-grid dt,
.metric dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.confirm-grid dd,
.detail-grid dd,
.metric dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 700;
}

.receipt {
  padding: 10px 0 4px;
  text-align: center;
}

.receipt-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin: 0 auto 18px;
  border-radius: 50%;
  color: var(--on-primary);
  background: var(--primary);
  font-size: 24px;
  font-weight: 800;
}

.receipt-id {
  display: grid;
  justify-items: center;
  gap: 4px;
  width: min(100%, 480px);
  margin: 0 auto 24px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.receipt-id span {
  color: var(--muted);
  font-size: 10px;
}

.receipt-id strong {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 14px;
}

.query-panel {
  margin-bottom: 18px;
}

.query-panel > .field {
  margin-bottom: 14px;
}

.skeleton-list,
.result-list {
  display: grid;
  gap: 12px;
}

.skeleton-card {
  height: 168px;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: linear-gradient(90deg, var(--surface) 20%, var(--surface-soft) 45%, var(--surface) 70%);
  background-size: 220% 100%;
  animation: skeleton 1.2s linear infinite;
}

.result-card {
  padding: 20px;
}

.result-top,
.subscription-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.result-top h2 {
  margin: 0 0 3px;
  font-size: 16px;
  overflow-wrap: anywhere;
}

.result-top small {
  color: var(--muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.status.submitted,
.status.pending {
  color: var(--warning);
  background: var(--warning-soft);
}

.status.manual_review {
  color: var(--primary);
  background: var(--primary-soft);
}

.status.completed,
.status.available {
  color: var(--success);
  background: var(--success-soft);
}

.status.failed,
.status.cancelled {
  color: var(--danger);
  background: var(--danger-soft);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 17px 0 0;
}

.detail-grid > div {
  min-width: 0;
}

.result-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.empty-result {
  box-shadow: none;
}

.empty-state {
  padding: 30px 18px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-panel);
  color: var(--muted);
  text-align: center;
}

.empty-state b {
  color: var(--text);
}

.empty-state p {
  margin: 4px 0 0;
  font-size: 12px;
}

.subscription-card {
  padding: 24px;
  box-shadow: var(--shadow);
}

.subscription-hero {
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.subscription-hero small {
  color: var(--muted);
  font-size: 10px;
}

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

.metric {
  min-width: 0;
  padding: 13px;
  border-radius: 11px;
  background: var(--surface-soft);
}

.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--danger) 34%, var(--line));
  border-radius: 13px;
  background: var(--danger-soft);
}

.danger-zone > div:first-child span,
.danger-zone > div:first-child b {
  display: block;
}

.danger-zone > div:first-child span {
  color: var(--danger);
  font-size: 10px;
  font-weight: 800;
}

.danger-zone > div:first-child b {
  margin-top: 2px;
  overflow-wrap: anywhere;
}

.danger-zone p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.danger-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 36px;
  padding: 20px 2px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  max-width: min(360px, calc(100% - 40px));
  padding: 12px 15px;
  border: 1px solid color-mix(in srgb, var(--text) 12%, transparent);
  border-radius: 11px;
  color: var(--surface-strong);
  background: var(--text);
  box-shadow: var(--shadow);
  font-size: 12px;
  animation: toast-enter 180ms ease both;
}

html.dark .toast {
  color: #151812;
  background: #f0f2e9;
}

.clipboard-helper {
  position: fixed;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

/* Admin */
.admin-header-inner {
  grid-template-columns: minmax(0, 1fr) auto;
}

.admin-mark {
  background: var(--text);
  box-shadow: none;
}

html.dark .admin-mark {
  color: #141711;
  background: #f0f2e9;
}

.admin-shell {
  width: min(1280px, calc(100% - 40px));
}

.auth-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.8fr);
  align-items: center;
  gap: clamp(34px, 8vw, 92px);
  min-height: calc(100dvh - 170px);
  max-width: 980px;
  margin: 0 auto;
}

.auth-form {
  box-shadow: var(--shadow);
}

.auth-form .button {
  width: 100%;
}

.admin-toolbar {
  align-items: flex-end;
  margin-bottom: 22px;
}

.admin-toolbar h1 {
  margin-bottom: 0;
  font-size: clamp(27px, 4vw, 36px);
}

.connection-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface);
  font-size: 10px;
  font-weight: 650;
}

.connection-chip i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px var(--success-soft);
}

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

.stats-grid article {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.stats-grid span,
.stats-grid strong {
  display: block;
}

.stats-grid span {
  color: var(--muted);
  font-size: 11px;
}

.stats-grid strong {
  margin-top: 5px;
  font-size: 25px;
  line-height: 1;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: start;
  gap: 16px;
}

.task-panel {
  min-width: 0;
  padding: 22px;
}

.panel-heading {
  margin-bottom: 18px;
}

.panel-heading h2 {
  margin: 0 0 4px;
  font-size: 19px;
}

.panel-heading p {
  font-size: 12px;
}

.filter-bar {
  display: flex;
  align-items: end;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-soft);
}

.compact-field {
  min-width: 160px;
}

.compact-field.grow {
  min-width: 0;
  flex: 1;
}

.compact-field > span {
  margin-bottom: 4px;
  font-size: 10px;
}

.compact-field input,
.compact-field select {
  min-height: 38px;
  background: var(--surface);
  font-size: 12px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  scrollbar-width: thin;
}

.admin-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 11px;
}

.admin-table th,
.admin-table td {
  padding: 11px 9px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.admin-table th {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

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

.admin-table td:first-child {
  max-width: 220px;
}

.admin-table td b,
.admin-table td small {
  display: block;
  overflow-wrap: anywhere;
}

.admin-table td small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.admin-actions .button {
  min-height: 32px;
  padding: 0 8px;
  font-size: 9px;
}

.admin-loading {
  display: grid;
  gap: 8px;
  padding: 12px 0;
}

.admin-loading span {
  height: 44px;
  border-radius: 8px;
  background: var(--surface-soft);
  animation: pulse-loading 1s ease-in-out infinite alternate;
}

.admin-sidebar {
  display: grid;
  gap: 16px;
}

.admin-sidebar .panel {
  padding: 20px;
  box-shadow: none;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.code-result {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.code-result > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 10px;
}

.code-result > div:first-child > div {
  display: flex;
  gap: 10px;
}

.code-output {
  max-height: 230px;
  margin: 10px 0 0;
  padding: 11px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  white-space: pre-wrap;
  word-break: break-all;
}

.field-help {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  text-align: right;
}

.switch-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 0 0 16px;
  cursor: pointer;
}

.switch-row input {
  width: 17px;
  height: 17px;
  margin: 2px 0 0;
  accent-color: var(--primary);
}

.switch-row b,
.switch-row small {
  display: block;
}

.switch-row b {
  font-size: 12px;
}

.switch-row small {
  color: var(--muted);
  font-size: 10px;
}

.modal {
  width: min(500px, calc(100% - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.28);
}

.modal::backdrop {
  background: rgba(15, 18, 13, 0.58);
  backdrop-filter: blur(3px);
}

.modal form {
  padding: 24px;
}

.modal-heading {
  margin-bottom: 20px;
}

.modal-heading h2 {
  font-size: 21px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 42%, transparent);
  outline-offset: 3px;
}

@keyframes view-enter {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}

@keyframes toast-enter {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

@keyframes skeleton {
  to { background-position: -220% 0; }
}

@keyframes pulse-loading {
  from { opacity: 0.48; }
  to { opacity: 1; }
}

@media (max-width: 1040px) {
  .header-inner {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px 20px;
    padding: 11px 0;
  }

  .site-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
  }

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

  .header-actions {
    grid-column: 2;
    grid-row: 1;
  }

  .admin-header-inner {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .admin-layout {
    grid-template-columns: minmax(0, 1fr) 310px;
  }
}

@media (max-width: 900px) {
  .recharge-layout,
  .admin-layout,
  .auth-panel {
    grid-template-columns: 1fr;
  }

  .flow-rail {
    padding: 16px 18px;
  }

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

  .progress-list li {
    grid-template-columns: 28px minmax(0, 1fr);
    min-height: 0;
  }

  .progress-list li:not(:last-child)::after {
    display: none;
  }

  .progress-list li > b {
    width: 28px;
    height: 28px;
  }

  .progress-list small,
  .trust-note {
    display: none;
  }

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

  .auth-panel {
    align-content: center;
    max-width: 620px;
    min-height: auto;
    padding: 36px 0;
    gap: 22px;
  }
}

@media (max-width: 720px) {
  .header-inner,
  .shell,
  .admin-shell {
    width: min(100% - 24px, 1120px);
  }

  .brand-copy small,
  .queue-chip {
    display: none;
  }

  .shell {
    padding-top: 24px;
  }

  .page-heading,
  .admin-toolbar,
  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .page-heading h1,
  .auth-copy h1 {
    font-size: 30px;
  }

  .page-meta {
    align-self: flex-start;
  }

  .panel,
  .form-panel,
  .subscription-card,
  .result-card {
    padding: 18px;
  }

  .confirm-grid,
  .detail-grid,
  .metric-grid,
  .stats-grid,
  .admin-sidebar {
    grid-template-columns: 1fr 1fr;
  }

  .filter-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .compact-field {
    min-width: 0;
  }

  .table-wrap {
    overflow: visible;
  }

  .admin-table,
  .admin-table tbody,
  .admin-table tr,
  .admin-table td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .admin-table thead {
    display: none;
  }

  .admin-table tbody {
    display: grid;
    gap: 10px;
  }

  .admin-table tr {
    padding: 10px 13px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-soft);
  }

  .admin-table td,
  .admin-table tbody tr:last-child td {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr);
    gap: 10px;
    max-width: none;
    padding: 8px 0;
    border: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .admin-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 9px;
    font-weight: 750;
  }

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

  .admin-actions .button {
    min-height: 36px;
  }
}

@media (max-width: 520px) {
  .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    font-size: 18px;
  }

  .brand-copy b {
    font-size: 15px;
  }

  .theme-button {
    min-height: 38px;
    padding: 0 10px;
    font-size: 11px;
  }

  .nav-link {
    padding: 8px 10px;
    font-size: 12px;
  }

  .announcement {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .progress-list strong {
    font-size: 11px;
  }

  .progress-list li {
    grid-template-columns: 25px minmax(0, 1fr);
    gap: 7px;
  }

  .progress-list li > b {
    width: 25px;
    height: 25px;
    font-size: 10px;
  }

  .form-actions,
  .danger-zone,
  .danger-actions,
  .toolbar-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .form-actions .button,
  .danger-actions .button,
  .toolbar-actions .button {
    width: 100%;
  }

  .centered-actions {
    align-items: center;
  }

  .confirm-grid,
  .detail-grid,
  .metric-grid,
  .admin-sidebar,
  .field-row {
    grid-template-columns: 1fr;
  }

  .subscription-hero,
  .result-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-footer {
    flex-direction: column;
  }

  .admin-header-inner .header-actions {
    flex-direction: row;
  }

  .admin-header-inner .header-actions .button {
    display: none;
  }

  .stacked-mobile {
    flex-direction: column-reverse;
  }

  .modal form {
    padding: 20px;
  }
}

@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;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .site-header {
    background: var(--bg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}
