:root {
  color-scheme: light;
  font-family:
    "Segoe UI", "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont,
    Arial, sans-serif;
  --page-bg: #06101d;
  --panel-bg: rgba(10, 22, 39, 0.74);
  --panel-strong: rgba(12, 28, 50, 0.94);
  --panel-border: rgba(173, 223, 255, 0.22);
  --text-main: #f4f8ff;
  --text-muted: rgba(225, 236, 255, 0.72);
  --text-soft: rgba(190, 210, 238, 0.62);
  --accent: #59d0ff;
  --accent-hot: #7d63ff;
  --accent-green: #39d98a;
  --accent-warm: #ffb65c;
  --accent-danger: #ff6d7a;
  --shadow-main: 0 36px 100px rgba(2, 8, 18, 0.54);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--page-bg);
}

html:has(body.admin-page) {
  background: #f7f3ea;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
}

a {
  color: inherit;
}

.hidden {
  display: none !important;
}

.customer-page {
  background:
    radial-gradient(circle at 50% -14%, rgba(132, 232, 255, 0.34), transparent 18%),
    radial-gradient(circle at 50% 8%, rgba(87, 118, 255, 0.16), transparent 22%),
    radial-gradient(circle at 12% 18%, rgba(47, 108, 255, 0.26), transparent 24%),
    radial-gradient(circle at 88% 18%, rgba(63, 223, 255, 0.18), transparent 20%),
    radial-gradient(circle at 50% 110%, rgba(13, 59, 126, 0.34), transparent 38%),
    linear-gradient(180deg, #07101d, #071321 16%, #08172a 42%, #06101d 72%, #040a13);
  color: var(--text-main);
  overflow-x: hidden;
}

.customer-page::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(rgba(106, 171, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(106, 171, 255, 0.06) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 50% 36%, #000 38%, rgba(0, 0, 0, 0.72) 58%, transparent 96%);
  opacity: 0.36;
  pointer-events: none;
}

.customer-page::after {
  content: "";
  position: fixed;
  inset: -160px 0 auto 50%;
  width: 1040px;
  height: 620px;
  border-radius: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle at center, rgba(130, 231, 255, 0.28), rgba(90, 208, 255, 0.12) 18%, transparent 72%);
  filter: blur(24px);
  pointer-events: none;
}

.charge-system {
  position: relative;
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
  z-index: 1;
}

.charge-system::before {
  content: "";
  position: absolute;
  top: -24px;
  left: 50%;
  width: min(980px, 94vw);
  height: 420px;
  transform: translateX(-50%);
  background: radial-gradient(circle at center, rgba(126, 227, 255, 0.2), rgba(86, 210, 255, 0.1) 24%, transparent 74%);
  filter: blur(34px);
  pointer-events: none;
}

.hero-panel,
.glass-card,
.metric-card,
.query-panel,
.copy-section,
.table-shell,
.loading-card,
.error-message,
.no-data {
  border: 1px solid var(--panel-border);
  border-radius: 30px;
  background:
    radial-gradient(circle at 50% -14%, rgba(132, 229, 255, 0.11), transparent 26%),
    linear-gradient(180deg, rgba(13, 29, 52, 0.95), rgba(7, 18, 33, 0.94));
  box-shadow:
    inset 0 1px rgba(206, 238, 255, 0.08),
    inset 0 0 64px rgba(55, 112, 255, 0.04),
    var(--shadow-main);
  backdrop-filter: blur(20px);
}

.hero-panel {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 2rem;
  padding: 32px;
  margin-bottom: 24px;
}

.hero-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(136, 223, 255, 0.06), transparent 24%, rgba(102, 182, 255, 0.04)),
    linear-gradient(rgba(96, 176, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(96, 176, 255, 0.05) 1px, transparent 1px);
  background-size: auto, 72px 72px, 72px 72px;
  mask-image: radial-gradient(circle at 50% 26%, #000 34%, rgba(0, 0, 0, 0.68) 54%, transparent 94%);
  opacity: 0.52;
  pointer-events: none;
}

.language-switcher {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 6px;
  border: 1px solid rgba(163, 211, 255, 0.16);
  border-radius: 999px;
  background: rgba(6, 17, 31, 0.52);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.04), 0 12px 30px rgba(3, 10, 20, 0.28);
  backdrop-filter: blur(14px);
}

.language-button {
  min-width: 68px;
  min-height: 38px;
  padding: 0.35rem 0.9rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: rgba(234, 240, 255, 0.74);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.language-button.active {
  color: #75ebff;
  border-color: rgba(101, 231, 255, 0.42);
  background: rgba(89, 208, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(108, 237, 255, 0.12), 0 0 18px rgba(81, 224, 255, 0.18);
}

.hero-copy {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 860px;
  margin: 0 auto;
  text-align: center;
  z-index: 1;
}

.eyebrow,
.panel-kicker {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.85rem;
  border: 1px solid rgba(109, 201, 255, 0.22);
  border-radius: 999px;
  background: rgba(89, 208, 255, 0.1);
  color: rgba(219, 241, 255, 0.9);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-title {
  margin: 18px 0 12px;
  font-size: clamp(1.5rem, 2.8vw, 2.5rem);
  line-height: 1.06;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: linear-gradient(90deg, #7df0ff, #9cb8ff 48%, #fff);
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 18px rgba(125, 240, 255, 0.18), 0 0 36px rgba(156, 184, 255, 0.08);
}

.hero-center-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 24px;
}

.hero-tabs {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.hero-link,
.hero-secondary,
.outline-link,
.ghost-button,
.btn-primary,
.btn-copy,
.primary-button,
.modal-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    opacity 0.25s ease,
    border-color 0.25s ease,
    color 0.25s ease;
}

.hero-link,
.primary-button,
.btn-primary,
.confirm-button {
  border: 2px solid rgba(101, 231, 255, 0.9);
  background: rgba(17, 24, 40, 0.92);
  color: #75ebff;
  box-shadow:
    inset 0 0 0 1px rgba(108, 237, 255, 0.18),
    0 0 24px rgba(81, 224, 255, 0.3),
    0 0 48px rgba(81, 224, 255, 0.12);
}

.hero-tab-button {
  min-width: 160px;
  padding: 0.5rem 1.9rem;
  font-size: 0.9rem;
}

.hero-tab-button.inactive,
.hero-secondary,
.outline-link,
.ghost-button,
.btn-copy {
  border: 2px solid rgba(73, 124, 150, 0.8);
  background: rgba(17, 24, 40, 0.92);
  color: rgba(234, 240, 255, 0.82);
  box-shadow: inset 0 0 0 1px rgba(92, 173, 197, 0.08), 0 0 18px rgba(68, 148, 178, 0.12);
}

.hero-link:hover,
.primary-button:hover:not(:disabled),
.btn-primary:hover:not(:disabled),
.outline-link:hover,
.ghost-button:hover:not(:disabled),
.btn-copy:hover {
  transform: translateY(-2px);
  box-shadow:
    inset 0 0 0 1px rgba(108, 237, 255, 0.22),
    0 0 30px rgba(81, 224, 255, 0.34),
    0 0 56px rgba(81, 224, 255, 0.16);
}

.tutorial-button {
  min-width: 160px;
  padding: 0.5rem 1.9rem;
}

.tab-view {
  display: none;
  position: relative;
  z-index: 1;
}

.tab-view.active {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.info-panel {
  width: 100%;
}

.metric-card,
.glass-card {
  padding: 24px;
}

.progress-shell {
  position: relative;
  padding: 2px 6px 0;
}

.progress-rail {
  position: relative;
  width: 100%;
  height: 5px;
  margin: 0 auto 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}

.progress-rail::after {
  content: "";
  position: absolute;
  left: -12%;
  top: 50%;
  width: 160px;
  height: 22px;
  transform: translateY(-50%);
  background: linear-gradient(90deg, transparent, rgba(220, 239, 255, 0.5), transparent);
  filter: blur(5px);
  animation: railGlow 2.2s linear infinite;
}

.progress-fill {
  position: relative;
  height: 100%;
  width: 25%;
  border-radius: inherit;
  background: linear-gradient(90deg, #66e6ff, #7d63ff 52%, #ff4ea3);
  box-shadow: 0 0 14px rgba(102, 230, 255, 0.45), 0 0 28px rgba(125, 99, 255, 0.22);
  transition: width 0.35s ease;
}

.progress-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.step-circle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(10, 14, 27, 0.45);
  color: rgba(235, 240, 255, 0.46);
  font-size: 0.92rem;
  font-weight: 600;
}

.step-label {
  margin-top: 10px;
  color: rgba(235, 240, 255, 0.52);
  font-size: 0.78rem;
}

.step-item.active .step-circle {
  border-color: #66e6ff;
  color: #66e6ff;
  box-shadow: 0 0 0 1px rgba(102, 230, 255, 0.16), 0 0 18px rgba(102, 230, 255, 0.52);
}

.step-item.active .step-label {
  color: #66e6ff;
  font-weight: 600;
}

.step-item.completed .step-circle {
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

.step-item.completed .step-label {
  color: rgba(235, 240, 255, 0.82);
}

.content-panel {
  width: 100%;
  margin: 0 auto;
}

.recharge-step {
  display: none;
}

.recharge-step.active {
  display: block;
}

.section-head {
  margin-bottom: 24px;
}

.section-head h2,
.panel-head h2,
.copy-section h3 {
  margin: 18px 0 10px;
  color: #79ebff;
  font-size: 1.5rem;
  font-weight: 600;
  text-shadow: 0 0 14px rgba(121, 235, 255, 0.14), 0 0 28px rgba(121, 235, 255, 0.06);
}

.section-head p,
.panel-head p,
.loading-card p,
.no-data,
.error-message {
  margin: 0;
  color: rgba(225, 236, 255, 0.72);
  line-height: 1.75;
}

.split-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.confirm-head {
  align-items: center;
}

.head-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.75rem;
}

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

.field-label,
.panel-label {
  display: block;
  margin: 18px 0 10px;
  color: #79ebff;
  font-weight: 600;
  text-shadow: 0 0 12px rgba(121, 235, 255, 0.12), 0 0 24px rgba(121, 235, 255, 0.05);
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.field-inline-link {
  min-height: 38px;
  padding: 0.35rem 1rem;
  font-size: 0.82rem;
}

.token-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.token-action-grid .session-json-link {
  grid-column: 1 / -1;
}

.account-json-textarea {
  min-height: 260px;
  font-size: 0.98rem;
}

.modern-input,
.modern-textarea,
.query-panel textarea {
  width: 100%;
  border: 1px solid rgba(163, 211, 255, 0.16);
  border-radius: 20px;
  background: rgba(6, 17, 31, 0.82);
  color: #f7fbff;
  padding: 1rem 1.1rem;
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.modern-input {
  min-height: 48px;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.modern-input::placeholder,
.modern-textarea::placeholder,
.query-panel textarea::placeholder {
  color: rgba(190, 210, 238, 0.45);
}

.modern-input:focus,
.modern-textarea:focus,
.query-panel textarea:focus {
  outline: none;
  border-color: rgba(89, 208, 255, 0.65);
  box-shadow: 0 0 0 4px rgba(89, 208, 255, 0.12);
}

.modern-textarea,
.query-panel textarea {
  min-height: 220px;
  resize: vertical;
  font-family: Consolas, "Courier New", monospace;
  line-height: 1.7;
}

.refresh-token-textarea {
  min-height: 160px;
}

.input-error {
  border-color: rgba(255, 109, 122, 0.7);
}

.message-box {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 16px 18px;
  border: 1px solid transparent;
  border-radius: 20px;
  margin-bottom: 18px;
}

.success-box {
  background: rgba(57, 217, 138, 0.1);
  border-color: rgba(57, 217, 138, 0.18);
}

.warning-box {
  background: rgba(255, 182, 92, 0.1);
  border-color: rgba(255, 182, 92, 0.18);
}

.error-box {
  background: rgba(255, 109, 122, 0.1);
  border-color: rgba(255, 109, 122, 0.18);
}

.message-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  font-weight: 800;
  flex-shrink: 0;
}

.message-title {
  color: rgba(225, 236, 255, 0.58);
  font-size: 0.82rem;
}

.mono {
  font-family: Consolas, "Courier New", monospace;
  word-break: break-all;
}

.account-highlight-value,
.confirm-email {
  color: #79ebff;
  text-shadow: 0 0 14px rgba(121, 235, 255, 0.14), 0 0 28px rgba(121, 235, 255, 0.06);
}

.confirm-inline-account {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 14px;
  border: 1px solid rgba(163, 211, 255, 0.1);
  border-radius: 999px;
  background: rgba(124, 180, 242, 0.08);
}

.confirm-label {
  color: rgba(225, 236, 255, 0.58);
  font-size: 0.82rem;
}

.primary-button,
.btn-primary {
  width: 100%;
  min-height: 48px;
  padding: 0.5rem 1.8rem;
  font-size: 0.92rem;
  font-weight: 700;
}

.primary-button:disabled,
.btn-primary:disabled,
.ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.button-content,
.loader-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
}

.button-arrow {
  font-size: 1.1rem;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.26);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.status-card {
  margin-bottom: 20px;
  padding: 28px;
  border-radius: 24px;
  text-align: center;
}

.confirm-step-panel {
  padding: clamp(22px, 3vw, 42px);
}

.processing-card {
  background: rgba(10, 24, 45, 0.86);
  border: 1px solid rgba(89, 208, 255, 0.26);
  box-shadow:
    inset 0 0 0 1px rgba(89, 208, 255, 0.06),
    0 0 34px rgba(89, 208, 255, 0.08);
}

.success-card-state {
  position: relative;
  overflow: hidden;
  background: rgba(57, 217, 138, 0.1);
  border: 1px solid rgba(57, 217, 138, 0.18);
}

.confirm-step-panel .confirm-stage {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.confirm-stage h3 {
  margin: 0 0 clamp(18px, 2.4vw, 30px);
  color: rgba(247, 251, 255, 0.98);
  font-size: clamp(1.6rem, 2.6vw, 2.15rem);
  line-height: 1.15;
}

.confirm-summary-card {
  width: 100%;
  max-width: none;
  display: grid;
  grid-template-columns: minmax(170px, 0.8fr) minmax(260px, 1.2fr) repeat(2, minmax(150px, 0.72fr));
  gap: 12px;
  margin: 0 auto;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.confirm-summary-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  min-height: clamp(118px, 12vh, 148px);
  padding: clamp(18px, 2.2vw, 26px);
  border: 1px solid rgba(89, 208, 255, 0.15);
  border-radius: 22px;
  background: rgba(4, 12, 24, 0.6);
  box-shadow: inset 0 0 0 1px rgba(89, 208, 255, 0.04);
  text-align: left;
}

.confirm-summary-row:last-child {
  border-bottom: 1px solid rgba(89, 208, 255, 0.15);
}

.confirm-value {
  color: rgba(247, 251, 255, 0.96);
  font-size: clamp(1.16rem, 1.6vw, 1.62rem);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.confirm-action-row {
  display: grid;
  grid-template-columns: minmax(140px, 0.24fr) minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  margin-top: 24px;
}

.confirm-back-button {
  width: 100%;
}

.processing-warning {
  margin: 22px auto 26px;
  padding: 24px;
  border: 1px solid rgba(89, 208, 255, 0.36);
  border-radius: 20px;
  background: rgba(10, 39, 62, 0.62);
  text-align: left;
  box-shadow:
    inset 0 0 0 1px rgba(89, 208, 255, 0.08),
    0 0 22px rgba(89, 208, 255, 0.1);
}

.processing-warning strong {
  display: block;
  margin-bottom: 14px;
  color: #9ffff7;
  font-size: 1.18rem;
  line-height: 1.35;
}

.processing-warning p {
  color: rgba(237, 245, 255, 0.84);
  font-size: 1rem;
}

.processing-checklist {
  display: grid;
  gap: 18px;
  width: min(100%, 420px);
  margin: 28px auto 0;
  padding: 0;
  list-style: none;
  color: rgba(237, 245, 255, 0.86);
  font-size: 1rem;
  text-align: left;
}

.processing-checklist li {
  display: flex;
  align-items: center;
  gap: 14px;
}

.processing-checklist li span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #65eaff;
  box-shadow: 0 0 18px rgba(101, 234, 255, 0.62);
  flex: 0 0 auto;
}

.status-card h3 {
  margin: 0 0 10px;
  font-size: 1.45rem;
}

.status-card p {
  margin: 0;
  color: rgba(225, 236, 255, 0.72);
  line-height: 1.75;
}

.status-orb,
.status-badge-icon {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  margin: 0 auto 16px;
  border-radius: 22px;
}

.status-orb {
  background: radial-gradient(circle, rgba(255, 196, 104, 0.95), rgba(255, 158, 61, 0.25) 70%, transparent 72%);
  animation: pulse 1.6s ease-in-out infinite;
}

.status-badge-icon {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.5rem;
  font-weight: 800;
}

.progress-track {
  width: 100%;
  height: 8px;
  margin-top: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #65eaff, #d94cff, #65eaff);
  animation: progressAnimation 2s ease-in-out infinite;
}

.success-fireworks {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.firework {
  position: absolute;
  width: 150px;
  aspect-ratio: 1;
  border-radius: 50%;
  opacity: 0;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.95) 0 4%, transparent 4.2%),
    linear-gradient(0deg, transparent 0 46%, rgba(121, 235, 255, 0.95) 46% 54%, transparent 54%),
    linear-gradient(45deg, transparent 0 46%, rgba(121, 235, 255, 0.95) 46% 54%, transparent 54%),
    linear-gradient(90deg, transparent 0 46%, rgba(121, 235, 255, 0.95) 46% 54%, transparent 54%),
    linear-gradient(135deg, transparent 0 46%, rgba(121, 235, 255, 0.95) 46% 54%, transparent 54%);
  animation: fireworkBurst 2.2s ease-out infinite;
}

.firework-a {
  top: 10px;
  left: 8%;
}

.firework-b {
  top: 18px;
  right: 10%;
  width: 170px;
  animation-delay: 0.55s;
}

.firework-c {
  top: 64px;
  left: 50%;
  width: 130px;
  transform: translateX(-50%);
  animation-delay: 1.1s;
}

.cdk-page {
  position: relative;
  width: min(1320px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.cdk-page.embedded {
  width: 100%;
  padding: 0;
}

.cdk-container {
  padding: 24px;
  border: 1px solid var(--panel-border);
  border-radius: 30px;
  background:
    radial-gradient(circle at 50% -14%, rgba(132, 229, 255, 0.11), transparent 26%),
    linear-gradient(180deg, rgba(13, 29, 52, 0.95), rgba(7, 18, 33, 0.94));
  box-shadow: var(--shadow-main);
}

.query-panel {
  padding: 28px;
}

.query-panel textarea {
  min-height: 220px;
}

.loading-card,
.no-data,
.error-message {
  margin-top: 24px;
  padding: 26px;
  text-align: center;
}

.loading-card .spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 14px;
  border-width: 3px;
  border-top-color: var(--accent);
}

.result-section {
  margin-top: 24px;
}

.copy-section {
  padding: 24px;
}

.copy-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.btn-copy {
  width: 100%;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

.btn-copy.copied {
  color: #75ebff;
  border-color: rgba(101, 231, 255, 0.9);
  box-shadow: inset 0 0 0 1px rgba(108, 237, 255, 0.18), 0 0 24px rgba(81, 224, 255, 0.3);
}

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

.stat-item {
  padding: 22px;
  border: 1px solid rgba(163, 211, 255, 0.14);
  border-radius: 24px;
  background: rgba(124, 180, 242, 0.08);
  text-align: center;
}

.stat-total {
  background: linear-gradient(135deg, rgba(89, 208, 255, 0.18), rgba(35, 124, 255, 0.18));
}

.stat-used {
  background: linear-gradient(135deg, rgba(255, 109, 122, 0.18), rgba(242, 79, 97, 0.18));
}

.stat-unused {
  background: linear-gradient(135deg, rgba(57, 217, 138, 0.18), rgba(21, 158, 97, 0.18));
}

.stat-invalid {
  background: linear-gradient(135deg, rgba(255, 182, 92, 0.18), rgba(255, 154, 61, 0.18));
}

.stat-label {
  display: block;
  margin-bottom: 10px;
  color: rgba(225, 236, 255, 0.6);
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
}

.table-shell {
  overflow-x: auto;
  padding: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  color: #eef6ff;
}

th,
td {
  padding: 16px 14px;
  text-align: left;
}

th {
  color: rgba(225, 236, 255, 0.66);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

tbody tr {
  border-top: 1px solid rgba(163, 211, 255, 0.1);
}

tbody tr:hover {
  background: rgba(124, 180, 242, 0.06);
}

code,
.table-code {
  display: inline-flex;
  padding: 0.3rem 0.55rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.status-used {
  background: rgba(255, 109, 122, 0.14);
  color: #ffadb5;
}

.status-not_used {
  background: rgba(57, 217, 138, 0.14);
  color: #9df0c5;
}

.status-invalid {
  background: rgba(255, 182, 92, 0.14);
  color: #ffd79f;
}

.refresh-feedback {
  margin-top: 18px;
  margin-bottom: 0;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(2, 10, 20, 0.66);
  backdrop-filter: blur(16px);
}

.modal-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 430px;
  max-height: min(90vh, 920px);
  border: 1px solid rgba(163, 211, 255, 0.18);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(13, 29, 52, 0.98), rgba(8, 19, 35, 0.98));
  box-shadow: 0 28px 70px rgba(2, 9, 20, 0.55);
  overflow: hidden;
  animation: modalSlideIn 0.3s ease-out;
}

.modal-header {
  padding: 2rem 2rem 1rem;
  text-align: center;
}

.modal-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 70px;
  height: 70px;
  margin-bottom: 1rem;
  border-radius: 22px;
  color: #fff;
  font-size: 2rem;
  font-weight: 800;
}

.modal-success .modal-icon {
  background: linear-gradient(135deg, #39d98a, #159e61);
  box-shadow: 0 12px 30px rgba(18, 126, 80, 0.35);
}

.modal-error .modal-icon {
  background: linear-gradient(135deg, #ff7c88, #f24f61);
  box-shadow: 0 12px 30px rgba(182, 34, 53, 0.32);
}

.modal-warning .modal-icon {
  background: linear-gradient(135deg, #ffd37a, #f29f35);
  box-shadow: 0 12px 30px rgba(193, 116, 20, 0.3);
}

.modal-info .modal-icon {
  background: linear-gradient(135deg, #59d0ff, #237cff);
  box-shadow: 0 12px 30px rgba(12, 80, 201, 0.34);
}

.modal-title {
  margin: 0;
  color: #f4f8ff;
  font-size: 1.5rem;
}

.modal-body {
  flex: 1;
  min-height: 0;
  padding: 0 2rem 1.8rem;
  overflow: hidden;
}

.modal-body-center {
  text-align: center;
}

.modal-message {
  margin: 0;
  color: rgba(225, 236, 255, 0.78);
  line-height: 1.7;
}

.modal-footer {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  flex-shrink: 0;
  padding: 0 2rem 2rem;
}

.modal-button {
  width: 100%;
  min-height: 48px;
  padding: 0.5rem 1.8rem;
  color: #75ebff;
  font-size: 0.92rem;
  font-weight: 700;
}

.modal-cancel-button {
  border: 2px solid rgba(73, 124, 150, 0.8);
  background: rgba(17, 24, 40, 0.72);
  color: rgba(234, 240, 255, 0.8);
}

.refresh-result-modal-shell {
  margin-top: 18px;
  max-height: min(52vh, 520px);
  overflow: auto;
  border: 1px solid rgba(163, 211, 255, 0.12);
  border-radius: 20px;
  background: rgba(6, 17, 31, 0.28);
}

.refresh-result-table {
  min-width: 720px;
}

.plan-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0.35rem 0.8rem;
  border: 1px solid rgba(89, 208, 255, 0.16);
  border-radius: 999px;
  background: rgba(89, 208, 255, 0.1);
  color: #9eeeff;
  font-size: 0.84rem;
  font-weight: 600;
}

.tutorial-shell {
  position: relative;
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0 42px;
}

.tutorial-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 22px;
  margin-bottom: 18px;
  border: 1px solid rgba(173, 223, 255, 0.26);
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% -8%, rgba(142, 232, 255, 0.16), transparent 30%),
    linear-gradient(180deg, rgba(15, 34, 61, 0.96), rgba(8, 18, 34, 0.94));
  box-shadow: inset 0 1px rgba(206, 238, 255, 0.12), 0 36px 96px rgba(3, 10, 20, 0.48);
}

.tutorial-hero-copy {
  display: grid;
  justify-items: end;
  gap: 8px;
  text-align: right;
}

.tutorial-hero .hero-title {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.08;
}

.tutorial-back {
  flex: 0 0 auto;
  min-width: 132px;
}

.tutorial-card {
  padding: 16px;
  border-radius: 24px;
}

.tutorial-video-frame {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(163, 211, 255, 0.16);
  border-radius: 18px;
  background: #020a14;
  box-shadow: 0 22px 72px rgba(0, 0, 0, 0.32);
}

.tutorial-video {
  display: block;
  width: 100%;
  height: 100%;
  background: #020a14;
}

.tutorial-missing {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 28px;
  background: rgba(2, 10, 20, 0.82);
  color: var(--text-muted);
  text-align: center;
}

.tutorial-missing[hidden] {
  display: none;
}

.tutorial-missing strong {
  color: #79ebff;
  font-size: 20px;
}

.tutorial-hint {
  margin: 16px 0 0;
  color: var(--text-muted);
  line-height: 1.7;
}

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

@keyframes railGlow {
  0% {
    left: -12%;
    opacity: 0;
  }
  10%,
  90% {
    opacity: 0.8;
  }
  100% {
    left: 104%;
    opacity: 0;
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}

@keyframes progressAnimation {
  0% {
    width: 10%;
  }
  60% {
    width: 78%;
  }
  100% {
    width: 100%;
  }
}

@keyframes fireworkBurst {
  0% {
    opacity: 0;
    transform: scale(0.22);
  }
  18% {
    opacity: 1;
  }
  42% {
    opacity: 0.95;
    transform: scale(0.88);
  }
  100% {
    opacity: 0;
    transform: scale(1.28);
  }
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Admin page keeps the previous Claude-like workbench style. */
.admin-page {
  --admin-ink: #1f1a17;
  --admin-soft: #5e564e;
  --admin-muted: #81786f;
  --admin-paper: #fbf8f3;
  --admin-surface: #fffdf8;
  --admin-strong: #f7f1e8;
  --admin-line: #e2d9cd;
  --admin-line-strong: #d2c5b7;
  --admin-teal: #12766f;
  min-height: 100vh;
  background: var(--admin-paper);
  color: var(--admin-ink);
  overflow-x: hidden;
}

.admin-page,
.admin-page * {
  box-sizing: border-box;
}

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

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--admin-line);
  background: rgba(247, 241, 232, 0.82);
  padding: 20px 14px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
}

.brand-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--admin-ink);
  color: #fffaf0;
  font-weight: 800;
}

.brand-mark strong,
.brand-mark small {
  display: block;
}

.brand-mark small {
  color: var(--admin-muted);
  font-size: 12px;
}

.admin-sidebar .brand-mark {
  margin: 0 6px 22px;
}

.admin-nav {
  display: grid;
  gap: 4px;
}

.admin-nav a {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 0 11px;
  border-radius: 8px;
  color: var(--admin-soft);
  font-size: 14px;
  font-weight: 690;
  text-decoration: none;
}

.admin-nav a.is-active,
.admin-nav a:hover {
  background: #fffaf1;
  color: var(--admin-ink);
}

.sidebar-note {
  position: absolute;
  right: 14px;
  bottom: 16px;
  left: 14px;
  padding: 12px;
  border: 1px solid var(--admin-line);
  border-radius: 8px;
  color: var(--admin-muted);
  font-size: 12px;
  line-height: 1.55;
}

.admin-main {
  min-width: 0;
  padding: 24px;
}

.simple-admin-main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 36px;
}

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

.admin-topbar .eyebrow {
  border-color: var(--admin-line);
  background: transparent;
  color: var(--admin-soft);
}

.admin-topbar h1 {
  margin: 0 0 8px;
  font-size: clamp(30px, 4vw, 46px);
}

.admin-topbar p {
  max-width: 740px;
  margin: 0;
  color: var(--admin-soft);
  line-height: 1.6;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--admin-line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.82);
  color: var(--admin-soft);
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
}

.live-pill i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--admin-teal);
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.admin-card,
.admin-panel,
.admin-page .metric-card {
  border: 1px solid var(--admin-line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.92);
  box-shadow: none;
}

.admin-page .metric-card {
  padding: 15px;
}

.admin-page .metric-card span {
  color: var(--admin-muted);
  font-size: 12px;
  font-weight: 760;
}

.admin-page .metric-card strong {
  display: block;
  margin-top: 10px;
  font-size: 26px;
}

.admin-content {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(340px, 460px);
  gap: 14px;
  align-items: start;
  min-width: 0;
}

.simple-admin-content {
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
}

.admin-stack {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.admin-card,
.admin-panel {
  min-width: 0;
  padding: 18px;
}

.admin-content > div {
  min-width: 0;
}

.admin-card + .admin-card {
  margin-top: 14px;
}

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

.simple-admin-content .admin-card + .admin-card {
  margin-top: 0;
}

.admin-section {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.admin-section + .admin-section,
.admin-section + .admin-card {
  padding-top: 20px;
  border-top: 1px solid var(--admin-line);
}

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

.admin-section-head h2,
.response-card h2 {
  margin: 0 0 6px;
  color: var(--admin-ink);
  font-size: 19px;
  line-height: 1.35;
}

.admin-section-head p {
  max-width: 920px;
  margin: 0;
  color: var(--admin-muted);
  font-size: 14px;
  line-height: 1.65;
}

.section-index {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-bottom: 8px;
  padding: 0 8px;
  border: 1px solid rgba(18, 118, 111, 0.22);
  border-radius: 999px;
  background: rgba(18, 118, 111, 0.08);
  color: var(--admin-teal);
  font-size: 12px;
  font-weight: 820;
}

.import-card {
  background: #fffefa;
}

.import-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 18px;
  align-items: start;
}

.admin-card h2,
.admin-panel h2 {
  margin: 0 0 7px;
  font-size: 18px;
}

.admin-card p,
.admin-panel p {
  margin: 0 0 16px;
  color: var(--admin-muted);
  font-size: 14px;
  line-height: 1.55;
}

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

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

.admin-page .field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--admin-ink);
  font-weight: 720;
}

.admin-page input[type="text"],
.admin-page textarea,
.admin-page select {
  width: 100%;
  border: 1px solid var(--admin-line-strong);
  border-radius: 8px;
  background: #fffefa;
  color: var(--admin-ink);
  outline: none;
  padding: 12px 13px;
  line-height: 1.5;
}

.admin-page textarea {
  min-height: 112px;
  resize: vertical;
}

.admin-page select {
  min-height: 48px;
  cursor: pointer;
}

.admin-page .generated-output {
  min-height: 168px;
  font-family: Consolas, "Courier New", monospace;
}

.admin-page input:focus,
.admin-page textarea:focus,
.admin-page select:focus {
  border-color: var(--admin-teal);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(18, 118, 111, 0.13);
}

.admin-note {
  margin: 14px 0 0 !important;
  padding: 11px 12px;
  border: 1px solid rgba(18, 118, 111, 0.18);
  border-radius: 8px;
  background: rgba(18, 118, 111, 0.07);
  color: var(--admin-soft) !important;
}

.mapping-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  min-width: 0;
}

.mapping-actions {
  margin-bottom: 16px;
}

.mapping-meta {
  margin: 4px 0 12px;
  color: var(--admin-muted);
  font-size: 13px;
}

.mapping-table-shell {
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--admin-line);
  border-radius: 8px;
  background: #fffefa;
}

.mapping-table {
  width: 100%;
  min-width: 1100px;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: fixed;
}

.mapping-table th,
.mapping-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--admin-line);
  text-align: left;
  vertical-align: middle;
  color: var(--admin-ink);
}

.mapping-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #5a5047;
  font-size: 12px;
  font-weight: 780;
  background: #f3ece2;
}

.mapping-table th:nth-child(2) {
  width: 86px;
}

.mapping-table th:nth-child(3) {
  width: 27%;
}

.mapping-table th:nth-child(1) {
  width: 82px;
}

.mapping-table th:nth-child(4) {
  width: 28%;
}

.mapping-table th:nth-child(5) {
  width: 104px;
}

.mapping-table th:nth-child(6) {
  width: 160px;
}

.mapping-table th:nth-child(7) {
  width: 160px;
}

.mapping-table th:nth-child(8) {
  width: 180px;
}

.table-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  color: #5a5047;
  font-size: 12px;
  font-weight: 780;
}

.mapping-table td.select-cell {
  display: table-cell;
  text-align: center;
  vertical-align: middle;
}

.mapping-checkbox,
.table-check input {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--admin-teal);
}

.admin-page .mapping-table tbody tr {
  border-top: 0;
}

.admin-page .mapping-table tbody tr:nth-child(even) {
  background: rgba(247, 241, 232, 0.42);
}

.admin-page .mapping-table tbody tr:hover {
  background: #f2eee6;
}

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

.mapping-table code {
  display: block;
  width: fit-content;
  max-width: 100%;
  padding: 7px 9px;
  border: 1px solid #d9cabc;
  border-radius: 7px;
  background: #f8f1e8;
  color: #241f1a;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12.5px;
  font-weight: 720;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.mapping-table .time-cell {
  color: #453d36;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12.5px;
  white-space: nowrap;
}

.mapping-table .action-cell {
  text-align: right;
}

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

.tiny-action {
  min-height: 34px;
  border: 1px solid var(--admin-line-strong);
  border-radius: 7px;
  background: #fffefa;
  color: var(--admin-ink);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 820;
  cursor: pointer;
}

.tiny-action:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.danger-action {
  border-color: #e0b1a9;
  background: #fff3f0;
  color: #9b3327;
}

.danger-action:hover:not(:disabled),
.danger-bulk-action:hover:not(:disabled) {
  background: #ffe7e2;
}

.danger-bulk-action {
  border-color: #e0b1a9 !important;
  color: #9b3327 !important;
}

.danger-bulk-action:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.admin-page .status-badge {
  min-width: 72px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.admin-page .status-used {
  border-color: #e6b2a8;
  background: #fff0ed;
  color: #9b3327;
}

.admin-page .status-not_used {
  border-color: #b9decc;
  background: #edf8f2;
  color: #176b4b;
}

.admin-page .status-invalid {
  border-color: #e7cf9b;
  background: #fff7e2;
  color: #80520c;
}

.product-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  padding: 7px 10px;
  border: 1px solid var(--admin-line-strong);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 820;
}

.product-plus {
  border-color: rgba(18, 118, 111, 0.22);
  background: rgba(18, 118, 111, 0.08);
  color: var(--admin-teal);
}

.product-pro {
  border-color: rgba(91, 78, 150, 0.24);
  background: rgba(91, 78, 150, 0.1);
  color: #5b4e96;
}

.debug-card summary {
  cursor: pointer;
  color: var(--admin-ink);
  font-size: 18px;
  font-weight: 800;
}

.debug-card[open] summary {
  margin-bottom: 16px;
}

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

.debug-grid h3 {
  margin: 0;
  font-size: 15px;
}

.diagnostic-card {
  display: flex;
  flex-direction: column;
}

.diagnostic-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.route-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid var(--admin-line-strong);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 820;
  white-space: nowrap;
}

.local-route {
  border-color: rgba(18, 118, 111, 0.22);
  background: rgba(18, 118, 111, 0.08);
  color: var(--admin-teal);
}

.upstream-route {
  border-color: rgba(135, 78, 37, 0.22);
  background: rgba(135, 78, 37, 0.08);
  color: #874e25;
}

.route-note {
  margin: 0 0 16px !important;
  padding: 11px 12px;
  border: 1px solid var(--admin-line);
  border-radius: 8px;
  background: rgba(247, 241, 232, 0.56);
  color: var(--admin-soft) !important;
  font-size: 13px !important;
  line-height: 1.65 !important;
}

.advanced-box {
  margin: 6px 0 18px;
  border: 1px solid var(--admin-line);
  border-radius: 8px;
  background: rgba(247, 241, 232, 0.55);
  padding: 13px;
}

.advanced-box summary {
  color: var(--admin-soft);
  cursor: pointer;
  font-weight: 780;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 14px 0;
  color: var(--admin-soft);
  font-size: 14px;
  line-height: 1.5;
}

.check-row input {
  margin-top: 3px;
  width: 16px;
  height: 16px;
  accent-color: var(--admin-teal);
}

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

.admin-page .primary,
.admin-page .secondary,
.admin-page .ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 780;
  cursor: pointer;
}

.admin-page .primary {
  flex: 1 1 190px;
  background: var(--admin-teal);
  color: #fffefa;
}

.simple-admin-page .mapping-actions .primary,
.simple-admin-page .mapping-actions .secondary,
.simple-admin-page .mapping-actions .ghost {
  flex: 0 0 auto;
}

.admin-page .secondary,
.admin-page .ghost {
  border: 1px solid var(--admin-line-strong);
  background: #fffefa;
  color: var(--admin-ink);
}

.admin-page .ghost {
  background: transparent;
  color: var(--admin-soft);
}

.admin-response {
  position: sticky;
  top: 18px;
}

.response-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.response-card {
  margin-top: 0;
}

.response-card summary {
  cursor: pointer;
  color: var(--admin-ink);
  font-size: 18px;
  font-weight: 800;
}

.response-card[open] summary {
  margin-bottom: 14px;
}

.response-card .response-head p {
  margin: 0;
}

.response-mini {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  color: var(--admin-muted);
  font-size: 12px;
}

.response-mini span {
  padding: 5px 8px;
  border: 1px solid var(--admin-line);
  border-radius: 999px;
}

.admin-response .codebox {
  overflow: auto;
  min-height: 480px;
  max-height: 620px;
  margin: 0;
  padding: 14px;
  border: 1px solid #d9cfc2;
  border-radius: 8px;
  background: #201c18;
  color: #fff8ed;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.simple-admin-page .admin-response .codebox {
  min-height: 360px;
}

.simple-admin-page .response-card .codebox {
  overflow: auto;
  min-height: 220px;
  max-height: 460px;
  margin: 14px 0 0;
  padding: 14px;
  border: 1px solid #d9cfc2;
  border-radius: 8px;
  background: #201c18;
  color: #fff8ed;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.admin-response .codebox.muted {
  color: #b6aa9c;
}

@media (max-width: 1080px) {
  .confirm-summary-card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-content {
    grid-template-columns: 1fr;
  }

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

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

  .mapping-toolbar {
    grid-template-columns: 1fr;
  }

  .import-grid,
  .debug-grid {
    grid-template-columns: 1fr;
  }

  .admin-response {
    position: static;
  }
}

@media (max-width: 900px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .charge-system,
  .cdk-page {
    width: min(calc(100% - 20px), 1320px);
    padding-top: 20px;
  }

  .hero-panel,
  .tutorial-hero,
  .glass-card,
  .metric-card,
  .query-panel,
  .cdk-container,
  .copy-section,
  .table-shell,
  .loading-card,
  .error-message,
  .no-data {
    padding: 22px;
    border-radius: 24px;
  }

  .language-switcher {
    position: static;
    justify-self: center;
    margin: 0 auto 6px;
  }

  .language-button {
    min-width: 60px;
    min-height: 34px;
    padding: 0.3rem 0.75rem;
  }

  .hero-center-actions,
  .hero-tabs {
    flex-direction: column;
    width: 100%;
  }

  .tutorial-shell {
    width: min(calc(100% - 16px), 1080px);
    padding: 12px 0 28px;
  }

  .tutorial-hero {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
    padding: 16px;
    margin-bottom: 14px;
    border-radius: 20px;
  }

  .tutorial-hero-copy {
    justify-items: center;
    text-align: center;
  }

  .tutorial-back {
    min-width: 0;
  }

  .tutorial-card {
    padding: 10px;
    border-radius: 20px;
  }

  .tutorial-video-frame {
    border-radius: 16px;
  }

  .tutorial-missing {
    padding: 18px;
    font-size: 0.9rem;
  }

  .tutorial-missing strong {
    font-size: 17px;
  }

  .progress-rail {
    height: 4px;
    margin-bottom: 18px;
  }

  .progress-steps {
    grid-template-columns: repeat(4, 64px);
    justify-content: space-between;
    gap: 0;
    overflow: hidden;
  }

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

  .step-circle {
    width: 44px;
    height: 44px;
    font-size: 0.8rem;
  }

  .step-label {
    margin-top: 8px;
    font-size: 0.68rem;
  }

  .hero-link,
  .hero-secondary,
  .outline-link,
  .ghost-button {
    width: 100%;
  }

  .split-head {
    flex-direction: column;
  }

  .head-actions {
    width: 100%;
    justify-content: stretch;
  }

  .confirm-inline-account {
    width: 100%;
    justify-content: space-between;
    align-items: center;
    border-radius: 18px;
  }

  .field-label-row {
    align-items: stretch;
  }

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

  .admin-sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--admin-line);
  }

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

  .sidebar-note {
    position: static;
    margin-top: 14px;
  }

  .admin-main {
    padding: 18px 14px 28px;
  }

  .admin-topbar {
    display: grid;
  }

  .admin-actions {
    display: grid;
  }

  .admin-form-grid {
    grid-template-columns: 1fr;
  }

  .admin-form-grid.compact-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .mapping-table-shell {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .mapping-table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0 10px;
    table-layout: auto;
  }

  .mapping-table thead {
    display: none;
  }

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

  .mapping-table tr {
    padding: 10px 12px;
    border: 1px solid var(--admin-line);
    border-radius: 8px;
    background: #fffefa;
  }

  .admin-page .mapping-table tbody tr:nth-child(even),
  .admin-page .mapping-table tbody tr:hover {
    background: #fffefa;
  }

  .mapping-table td {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 9px 0;
    border-bottom: 1px solid rgba(226, 217, 205, 0.72);
  }

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

  .mapping-table td::before {
    content: attr(data-label);
    color: #6a5f55;
    font-size: 12px;
    font-weight: 820;
    line-height: 1.6;
  }

  .mapping-table code {
    width: 100%;
    font-size: 12px;
  }

  .mapping-table .time-cell {
    white-space: normal;
  }

  .mapping-table .action-cell {
    text-align: left;
  }

  .row-actions {
    justify-content: stretch;
  }

  .tiny-action {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .stats-grid,
  .copy-buttons,
  .admin-grid {
    grid-template-columns: 1fr;
  }
}

/* Claude-style admin refresh: quiet ivory surfaces, fewer competing borders, clearer task hierarchy. */
.admin-page {
  --admin-ink: #2b2118;
  --admin-soft: #5f554b;
  --admin-muted: #81766b;
  --admin-paper: #f7f3ea;
  --admin-surface: #fffaf2;
  --admin-strong: #f0e8dc;
  --admin-line: #ded3c4;
  --admin-line-strong: #cfc0ae;
  --admin-teal: #7c4a2d;
  background: var(--admin-paper);
  color: var(--admin-ink);
}

.simple-admin-main {
  width: min(1240px, calc(100% - 36px));
  padding: 28px 0 56px;
}

.admin-topbar {
  align-items: end;
  border: 1px solid var(--admin-line);
  border-radius: 12px;
  background: rgba(255, 250, 242, 0.86);
  padding: 22px 24px;
  box-shadow: 0 18px 60px rgba(80, 55, 32, 0.08);
}

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

.admin-topbar p,
.admin-section-head p,
.route-note,
.mapping-meta {
  color: var(--admin-soft);
}

.admin-section,
.admin-card,
.response-card {
  border-radius: 12px;
  background: rgba(255, 250, 242, 0.92);
  border-color: var(--admin-line);
  box-shadow: 0 14px 42px rgba(80, 55, 32, 0.06);
}

.admin-section {
  padding: 22px;
}

.admin-section-head {
  margin-bottom: 18px;
}

.section-index {
  background: #f4e6d4;
  color: #7c4a2d;
  border-color: #e2cdb5;
}

.admin-page input[type="text"],
.admin-page textarea,
.admin-page select,
.mapping-table code,
.codebox {
  border-radius: 10px;
  background: #fffdf8;
}

.admin-page input:focus,
.admin-page textarea:focus,
.admin-page select:focus {
  border-color: #9b6a47;
  box-shadow: 0 0 0 3px rgba(124, 74, 45, 0.14);
}

.admin-page .primary {
  background: #2f261f;
  color: #fffaf2;
}

.admin-page .secondary,
.admin-page .ghost,
.tiny-action {
  background: #fffaf2;
}

.danger-bulk-action,
.danger-action,
.danger-confirm {
  color: #9c3326 !important;
  border-color: #e4b6a9 !important;
  background: #fff3ee !important;
}

.mapping-table-shell {
  border-radius: 10px;
}

.mapping-table th {
  background: #efe7da;
  color: #5a4c3e;
}

.trash-table th:nth-child(3),
.trash-table th:nth-child(4) {
  width: 27%;
}

.trash-table th:nth-child(5),
.trash-table th:nth-child(6) {
  width: 150px;
}

.trash-table th:nth-child(7) {
  width: 110px;
}

.mapping-table-main {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.mapping-table-main th,
.mapping-table-main td {
  padding: 12px 10px;
}

.mapping-table-main th:nth-child(1) {
  width: 56px;
}

.mapping-table-main th:nth-child(2) {
  width: 70px;
}

.mapping-table-main th:nth-child(3),
.mapping-table-main th:nth-child(4) {
  width: 20.5%;
}

.mapping-table-main th:nth-child(5),
.mapping-table-main th:nth-child(6) {
  width: 96px;
}

.mapping-table-main th:nth-child(7),
.mapping-table-main th:nth-child(8) {
  width: 142px;
}

.mapping-table-main th:nth-child(9) {
  width: 106px;
}

.mapping-table-main .tiny-action {
  white-space: nowrap;
}

.mapping-table-main code {
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  overflow-wrap: normal;
  word-break: normal;
  text-overflow: ellipsis;
  box-sizing: border-box;
}

.mapping-table-main .select-cell,
.mapping-table-main .action-cell {
  text-align: center;
}

.mapping-table-main .row-actions {
  justify-content: center;
}

.mapping-table-main .time-cell {
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-stack {
  display: grid;
  gap: 5px;
  justify-items: start;
}

.status-stack small {
  color: var(--admin-muted);
  font-size: 11px;
  font-family: Consolas, "Courier New", monospace;
}

.status-pending,
.status-unknown {
  border-color: #dfd2c4;
  background: #f7f1e8;
  color: #6a5d50;
}

.upstream-loading-badge {
  min-width: 82px;
  gap: 7px;
  border-color: #cfbda8;
  background: #fff8ee;
  color: #6a4930;
}

.upstream-loading-dot {
  width: 12px;
  height: 12px;
  border: 2px solid #d9c8b5;
  border-top-color: #7a4f2e;
  border-radius: 999px;
  animation: adminSpin 0.75s linear infinite;
}

.status-not_found {
  border-color: #e6c4a4;
  background: #fff6eb;
  color: #8a531f;
}

.confirm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(43, 33, 24, 0.34);
  backdrop-filter: blur(6px);
}

.confirm-backdrop[hidden] {
  display: none;
}

.confirm-dialog {
  width: min(420px, 100%);
  border: 1px solid var(--admin-line);
  border-radius: 14px;
  background: #fffaf2;
  padding: 22px;
  box-shadow: 0 24px 80px rgba(43, 33, 24, 0.24);
}

.confirm-dialog h2 {
  margin: 0 0 10px;
  font-size: 20px;
  line-height: 1.25;
}

.confirm-dialog p {
  margin: 0;
  color: var(--admin-soft);
  line-height: 1.65;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

@media (max-width: 760px) {
  .simple-admin-main {
    width: min(100% - 20px, 1240px);
    padding-top: 14px;
  }

  .admin-topbar,
  .admin-section {
    padding: 18px;
  }

  .confirm-actions {
    display: grid;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2rem;
  }

  .step-circle {
    width: 38px;
    height: 38px;
    font-size: 0.74rem;
  }

  .step-label {
    font-size: 0.6rem;
    line-height: 1.4;
  }
}

/* mobile-compact-public */
@media (max-width: 760px) {
  .customer-page,
  .admin-page {
    overflow-x: hidden;
  }

  .customer-page::after {
    height: 420px;
    filter: blur(18px);
  }

  .charge-system,
  .cdk-page {
    width: calc(100vw - 16px);
    max-width: 1080px;
    padding: 12px 0 32px;
  }

  .charge-system::before {
    top: -84px;
    height: 300px;
    filter: blur(28px);
  }

  .hero-panel,
  .glass-card,
  .metric-card,
  .query-panel,
  .cdk-container,
  .copy-section,
  .table-shell,
  .loading-card,
  .error-message,
  .no-data {
    padding: 16px;
    width: 100%;
    max-width: 100%;
    border-radius: 20px;
  }

  .hero-panel {
    gap: 12px;
    margin-bottom: 14px;
  }

  .language-switcher {
    margin-bottom: 6px;
    padding: 4px;
  }

  .language-button {
    min-width: 58px;
    min-height: 34px;
    padding: 0.25rem 0.7rem;
  }

  .eyebrow,
  .panel-kicker {
    padding: 0.32rem 0.72rem;
    font-size: 0.66rem;
    letter-spacing: 0.08em;
  }

  .hero-title {
    margin: 10px 0 8px;
    font-size: clamp(1.75rem, 8vw, 2.15rem);
  }

  .hero-center-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
    margin-top: 12px;
  }

  .hero-tabs {
    display: contents;
  }

  .hero-link,
  .hero-secondary,
  .tutorial-button {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 0.42rem 0.55rem;
    font-size: 0.82rem;
  }

  .tab-view.active {
    gap: 14px;
  }

  .metric-card,
  .glass-card {
    padding: 16px;
    min-width: 0;
  }

  .progress-shell {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 0;
    overflow: hidden;
  }

  .progress-rail {
    height: 4px;
    margin-bottom: 14px;
  }

  .progress-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 8px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    justify-items: center;
    overflow: hidden;
  }

  .step-item {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    align-items: center;
    justify-items: start;
    gap: 8px;
    text-align: left;
  }

  .step-circle {
    width: 36px;
    height: 36px;
    font-size: 0.72rem;
  }

  .step-label {
    width: 100%;
    margin-top: 0;
    font-size: 0.66rem;
    line-height: 1.3;
    overflow: hidden;
  }

  .section-head {
    margin-bottom: 16px;
  }

  .section-head h2,
  .panel-head h2,
  .copy-section h3 {
    margin: 10px 0 8px;
    font-size: 1.25rem;
  }

  .field-block {
    margin-bottom: 14px;
  }

  .modern-input {
    min-height: 46px;
  }

  .modern-textarea,
  .query-panel textarea {
    min-height: 160px;
    border-radius: 16px;
  }

  .token-action-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 14px;
  }

  .token-action-grid .session-json-link {
    grid-column: auto;
  }

  .account-json-textarea {
    min-height: 210px;
    font-size: 0.86rem;
    line-height: 1.6;
  }

  .status-card {
    padding: 18px;
    border-radius: 20px;
  }

  .status-card h3 {
    font-size: 1.22rem;
    text-align: left;
  }

  .confirm-step-panel {
    padding: 16px;
  }

  .confirm-step-panel .confirm-stage {
    padding: 18px;
  }

  .confirm-stage h3 {
    margin-bottom: 18px;
    text-align: center;
  }

  .confirm-summary-card {
    grid-template-columns: 1fr;
    gap: 10px;
    border-radius: 18px;
  }

  .confirm-summary-row {
    gap: 12px;
    min-height: auto;
    padding: 14px;
  }

  .confirm-value {
    font-size: 1.04rem;
  }

  .confirm-action-row {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 16px;
  }

  .processing-warning {
    margin: 18px 0 22px;
    padding: 18px;
    border-radius: 18px;
  }

  .processing-warning strong {
    font-size: 1.05rem;
  }

  .processing-warning p {
    font-size: 0.92rem;
    line-height: 1.7;
  }

  .processing-checklist {
    gap: 14px;
    margin-top: 24px;
    font-size: 0.96rem;
  }

  .query-panel textarea {
    min-height: 168px;
  }

  .copy-buttons {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

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

/* mobile-compact-admin */
@media (max-width: 760px) {
  .simple-admin-main {
    width: calc(100vw - 14px);
    max-width: 1240px;
    padding: 8px 0 28px;
    overflow-x: hidden;
  }

  .admin-topbar {
    display: grid;
    gap: 12px;
    margin-bottom: 12px;
    padding: 16px;
    border-radius: 10px;
  }

  .admin-topbar h1 {
    margin-bottom: 6px;
    font-size: 28px;
  }

  .admin-topbar p,
  .admin-section-head p,
  .route-note,
  .mapping-meta {
    max-width: calc(100vw - 48px);
    font-size: 13px;
    line-height: 1.55;
    overflow-wrap: anywhere;
  }

  .live-pill {
    width: 100%;
    justify-content: center;
  }

  .simple-admin-content {
    gap: 14px;
  }

  .admin-section,
  .admin-card,
  .response-card {
    max-width: 100%;
    min-width: 0;
    border-radius: 10px;
  }

  .admin-section {
    padding: 16px;
  }

  .admin-section + .admin-section,
  .admin-section + .admin-card {
    padding-top: 16px;
  }

  .admin-section-head {
    margin-bottom: 10px;
  }

  .admin-section-head h2,
  .response-card h2 {
    font-size: 18px;
  }

  .admin-card,
  .admin-panel {
    padding: 14px;
  }

  .import-grid,
  .debug-grid {
    gap: 12px;
  }

  .admin-page .field {
    gap: 7px;
    margin-bottom: 12px;
    min-width: 0;
  }

  .admin-page input[type="text"],
  .admin-page textarea,
  .admin-page select {
    min-width: 0;
    padding: 11px 12px;
  }

  .admin-page textarea {
    min-height: 108px;
  }

  .admin-page .generated-output {
    min-height: 132px;
  }

  .admin-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .admin-actions .primary,
  .admin-actions .secondary,
  .admin-actions .ghost,
  .simple-admin-page .mapping-actions .primary,
  .simple-admin-page .mapping-actions .secondary,
  .simple-admin-page .mapping-actions .ghost {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 0 10px;
    flex: none;
  }

  .mapping-toolbar {
    gap: 8px;
  }

  .mapping-actions {
    margin-bottom: 8px;
  }

  .mapping-table tr {
    padding: 10px;
    border-radius: 10px;
  }

  .mapping-table td {
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 8px;
    padding: 8px 0;
  }

  .mapping-table-main code {
    white-space: normal;
    overflow: visible;
    overflow-wrap: anywhere;
    word-break: break-word;
    text-overflow: clip;
  }

  .mapping-table-main .action-cell,
  .mapping-table-main .select-cell {
    text-align: left;
  }

  .mapping-table-main .row-actions {
    justify-content: stretch;
  }

  .response-card .response-head {
    display: grid;
  }

  .response-mini {
    justify-content: flex-start;
  }

  .simple-admin-page .response-card .codebox {
    max-height: 300px;
    min-height: 160px;
  }
}

@media (max-width: 360px) {
  .hero-center-actions,
  .copy-buttons,
  .admin-actions {
    grid-template-columns: 1fr;
  }

  .progress-steps {
    gap: 8px 6px;
  }

  .step-label {
    font-size: 0.62rem;
  }
}

@media (max-width: 480px) {
  .charge-system,
  .cdk-page,
  .simple-admin-main {
    width: 360px;
    max-width: calc(100vw - 16px);
    margin-right: 8px;
    margin-left: 8px;
  }
}

/* admin-loading-feedback-compact */
.admin-status-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--admin-line);
  border-radius: 10px;
  background: #fffdf8;
  color: var(--admin-soft);
  font-size: 13px;
  line-height: 1.45;
}

.admin-status-card[hidden] {
  display: none !important;
}

.admin-status-card strong {
  display: block;
  margin-bottom: 2px;
  color: var(--admin-ink);
  font-size: 13px;
}

.admin-status-card p {
  margin: 0;
}

.admin-status-card.is-loading {
  border-color: #cbb79f;
  background: #fff8ee;
}

.admin-status-card.is-success {
  border-color: #b7d7ca;
  background: #f4fbf7;
}

.admin-status-card.is-error {
  border-color: #e4b6a9;
  background: #fff3ee;
}

.status-spinner {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  border: 2px solid #dfd3c4;
  border-top-color: #2f261f;
  border-radius: 999px;
  flex: 0 0 auto;
}

.admin-status-card:not(.is-loading) .status-spinner {
  border-color: #bfae9b;
  background: #2f261f;
}

.admin-status-card.is-loading .status-spinner,
.admin-page button.is-loading::before {
  animation: adminSpin 0.75s linear infinite;
}

.admin-page .is-loading {
  cursor: progress;
}

.admin-page button.is-loading {
  opacity: 0.78;
}

.admin-page button.is-loading::before {
  content: "";
  width: 12px;
  height: 12px;
  margin-right: 6px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 999px;
}

.admin-page textarea.is-loading {
  background-image: linear-gradient(110deg, transparent 0%, rgba(124, 74, 45, 0.08) 45%, transparent 70%);
  background-size: 220% 100%;
  animation: adminShimmer 1.2s ease-in-out infinite;
}

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

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

.simple-admin-content {
  gap: 16px;
}

.admin-section {
  gap: 10px;
}

.admin-section-head {
  margin-bottom: 8px;
}

.simple-admin-page .admin-section,
.simple-admin-page .admin-card,
.simple-admin-page .response-card {
  box-shadow: 0 10px 30px rgba(80, 55, 32, 0.045);
}

.simple-admin-page .admin-section {
  padding: 18px;
}

.simple-admin-page .admin-card,
.simple-admin-page .response-card {
  padding: 16px;
}

.simple-admin-page .admin-page .field,
.simple-admin-page .field {
  margin-bottom: 12px;
}

.simple-admin-page .admin-section-head p,
.simple-admin-page .route-note,
.simple-admin-page .mapping-meta {
  line-height: 1.45;
}

.simple-admin-page .import-grid {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.86fr);
  gap: 14px;
}

.simple-admin-page .debug-grid {
  gap: 14px;
}

.simple-admin-page .import-grid > *,
.simple-admin-page .debug-grid > *,
.simple-admin-page .mapping-toolbar > * {
  min-width: 0;
}

.simple-admin-page .admin-page textarea,
.simple-admin-page textarea {
  min-height: 98px;
}

.simple-admin-page .generated-output {
  min-height: 148px;
}

.simple-admin-page .response-card .codebox {
  max-height: 360px;
}

@media (max-width: 760px) {
  .simple-admin-main {
    width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
    margin: 0 10px;
    padding: 8px 0 24px;
  }

  .simple-admin-content {
    gap: 10px;
  }

  .simple-admin-page .admin-topbar {
    gap: 8px;
    padding: 12px;
    margin-bottom: 10px;
  }

  .simple-admin-page .admin-topbar h1 {
    font-size: 24px;
  }

  .simple-admin-page .admin-topbar p {
    font-size: 12px;
    line-height: 1.35;
  }

  .simple-admin-page .admin-section {
    padding: 12px;
  }

  .simple-admin-page .admin-card,
  .simple-admin-page .response-card {
    padding: 12px;
  }

  .simple-admin-page .admin-section-head {
    margin-bottom: 6px;
  }

  .simple-admin-page .admin-section-head h2,
  .simple-admin-page .response-card h2 {
    font-size: 16px;
  }

  .simple-admin-page .admin-section-head p {
    font-size: 12px;
    line-height: 1.35;
  }

  .simple-admin-page .import-grid,
  .simple-admin-page .debug-grid,
  .simple-admin-page .mapping-toolbar {
    gap: 8px;
  }

  .simple-admin-page .import-grid,
  .simple-admin-page .debug-grid {
    display: block;
  }

  .simple-admin-page .import-grid > * + *,
  .simple-admin-page .debug-grid > * + * {
    margin-top: 8px;
  }

  .simple-admin-page .mapping-toolbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .simple-admin-page .admin-actions,
  .simple-admin-page .mapping-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .simple-admin-page .diagnostic-card .admin-actions,
  .simple-admin-page .response-head {
    grid-template-columns: 1fr;
  }

  .simple-admin-page .admin-actions .primary,
  .simple-admin-page .admin-actions .secondary,
  .simple-admin-page .admin-actions .ghost,
  .simple-admin-page .mapping-actions .primary,
  .simple-admin-page .mapping-actions .secondary,
  .simple-admin-page .mapping-actions .ghost {
    min-height: 40px;
    padding: 0 8px;
    font-size: 12px;
  }

  .simple-admin-page .admin-page textarea,
  .simple-admin-page textarea {
    min-height: 84px;
  }

  .simple-admin-page .generated-output {
    min-height: 104px;
  }

  .simple-admin-page .mapping-table tr {
    padding: 8px 10px;
  }

  .simple-admin-page .mapping-table td {
    grid-template-columns: 70px minmax(0, 1fr);
    padding: 6px 0;
  }

  .simple-admin-page .mapping-table td::before {
    font-size: 11px;
  }

  .simple-admin-page .mapping-table code {
    padding: 6px 8px;
    font-size: 11px;
  }

  .simple-admin-page .status-badge,
  .simple-admin-page .product-badge {
    min-height: 28px;
    padding: 0 10px;
    font-size: 12px;
  }

  .simple-admin-page .admin-status-card {
    margin-top: 8px;
    padding: 9px 10px;
  }
}

@media (max-width: 420px) {
  .simple-admin-main {
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
    margin: 0 8px;
  }

  .simple-admin-page .admin-actions,
  .simple-admin-page .mapping-actions {
    grid-template-columns: 1fr 1fr;
  }

  .simple-admin-page .mapping-actions .danger-bulk-action,
  .simple-admin-page #exportMappings,
  .simple-admin-page #refreshUpstreamStatuses {
    grid-column: span 2;
  }

  .simple-admin-page .mapping-table td {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 6px;
  }
}

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

.admin-spa-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 18px;
  padding: 8px;
  border: 1px solid var(--admin-border, rgba(132, 120, 103, 0.22));
  border-radius: 18px;
  background: var(--admin-surface, rgba(255, 252, 246, 0.78));
  box-shadow: var(--admin-soft-shadow, 0 18px 50px rgba(53, 41, 30, 0.08));
}

.admin-nav-button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--admin-muted, #766b5f);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.admin-nav-button:hover,
.admin-nav-button.is-active {
  color: var(--admin-ink, #2f261e);
  border-color: var(--admin-border-strong, rgba(132, 120, 103, 0.34));
  background: var(--admin-panel, #fffaf2);
  box-shadow: 0 10px 30px rgba(53, 41, 30, 0.08);
}

.mapping-table-main th:nth-child(9),
.mapping-table-main td:nth-child(9) {
  width: 150px;
}

.mapping-table-main th:nth-child(10),
.mapping-table-main td:nth-child(10) {
  width: 150px;
}

.mapping-table-main th:nth-child(11),
.mapping-table-main td:nth-child(11) {
  width: 112px;
}

.account-cell {
  max-width: 170px;
  overflow-wrap: anywhere;
  color: var(--admin-ink, #2f261e);
  font-weight: 650;
}

.token-cell {
  white-space: nowrap;
}

.token-copy {
  border: 1px solid var(--admin-border, rgba(132, 120, 103, 0.24));
  border-radius: 999px;
  padding: 7px 10px;
  background: var(--admin-panel, #fffaf2);
  color: var(--admin-muted, #766b5f);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.token-copy:hover {
  border-color: var(--admin-accent, #c97b4b);
  color: var(--admin-accent, #9f4f24);
}

.muted-inline {
  color: var(--admin-muted, #8a7c6a);
}

@media (max-width: 760px) {
  .admin-spa-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
  }

  .admin-nav-button {
    min-height: 44px;
  }
}

.mapping-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0 14px;
}

.mapping-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  color: var(--admin-muted, #766b5f);
  font-size: 13px;
  white-space: nowrap;
}

.page-size-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.page-size-field .admin-select {
  width: 78px;
  min-height: 34px;
  padding: 0 10px;
}

.page-nav {
  min-height: 34px;
  padding: 0 12px;
}

.mapping-table-main th:nth-child(1) {
  width: 52px;
}

.mapping-table-main th:nth-child(2) {
  width: 70px;
}

.mapping-table-main th:nth-child(3) {
  width: 34%;
}

.mapping-table-main th:nth-child(4),
.mapping-table-main th:nth-child(5) {
  width: 96px;
}

.mapping-table-main th:nth-child(6) {
  width: 150px;
}

.mapping-table-main th:nth-child(7) {
  width: 140px;
}

.mapping-table-main th:nth-child(8) {
  width: 150px;
}

.cdk-pair {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 6px 8px;
  align-items: center;
}

.cdk-pair span,
.time-stack b {
  color: var(--admin-muted, #766b5f);
  font-size: 11px;
  font-weight: 700;
}

.time-stack {
  display: grid;
  gap: 5px;
  font-size: 12px;
  line-height: 1.25;
}

.time-stack span {
  display: grid;
  gap: 2px;
}

.record-modal .record-dialog {
  width: min(720px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 32px));
  overflow: auto;
}

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

.record-head h2 {
  margin: 6px 0 0;
}

.icon-close {
  width: 36px;
  height: 36px;
  border: 1px solid var(--admin-border, rgba(132, 120, 103, 0.24));
  border-radius: 999px;
  background: var(--admin-panel, #fffaf2);
  color: var(--admin-ink, #2f261e);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.record-list {
  display: grid;
  gap: 10px;
  margin: 0 0 14px;
}

.record-list > div {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--admin-border, rgba(132, 120, 103, 0.2));
  border-radius: 12px;
  background: rgba(255, 252, 246, 0.7);
}

.record-list dt {
  color: var(--admin-muted, #766b5f);
  font-size: 12px;
  font-weight: 800;
}

.record-list dd {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.record-list code {
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
}

.record-raw-box {
  margin-top: 10px;
}

.record-raw-box .codebox {
  max-height: 280px;
  overflow: auto;
}

@media (max-width: 760px) {
  .mapping-list-head,
  .mapping-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .mapping-pagination {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .page-size-field,
  #mappingPageInfo {
    grid-column: span 2;
  }

  .record-list > div {
    grid-template-columns: 1fr;
  }
}

/* Manual recharge and ops pages */
.manual-recharge-page {
  min-height: 100vh;
  background:
    linear-gradient(rgba(89, 214, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(89, 214, 255, 0.045) 1px, transparent 1px),
    radial-gradient(circle at 50% 0%, rgba(76, 211, 255, 0.18), transparent 46%),
    #06101e;
  background-size:
    36px 36px,
    36px 36px,
    auto,
    auto;
}

.manual-shell {
  width: min(980px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 46px;
}

.manual-hero,
.manual-panel {
  border: 1px solid rgba(95, 185, 228, 0.34);
  border-radius: 24px;
  background: linear-gradient(160deg, rgba(18, 43, 72, 0.9), rgba(7, 17, 31, 0.96));
  box-shadow: 0 24px 80px rgba(0, 10, 24, 0.45);
}

.manual-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
  margin-bottom: 22px;
}

.manual-back {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(96, 217, 244, 0.45);
  border-radius: 999px;
  color: #d5f6ff;
  text-decoration: none;
}

.manual-kicker {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  padding: 0 12px;
  border: 1px solid rgba(96, 217, 244, 0.38);
  border-radius: 999px;
  color: #83edff;
  font-size: 12px;
  letter-spacing: 0;
}

.manual-hero h1,
.manual-result h2 {
  margin: 14px 0 10px;
  color: #eaf8ff;
  font-size: clamp(30px, 4vw, 48px);
  letter-spacing: 0;
}

.manual-hero p,
.manual-result dt {
  margin: 0;
  color: rgba(220, 235, 255, 0.7);
}

.manual-panel {
  padding: 24px;
}

.manual-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}

.manual-steps span {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(92, 145, 176, 0.38);
  border-radius: 999px;
  color: rgba(220, 235, 255, 0.62);
  background: rgba(6, 14, 28, 0.54);
}

.manual-steps span.is-active,
.manual-steps span.is-done {
  border-color: rgba(88, 224, 255, 0.86);
  color: #7ef0ff;
  box-shadow: 0 0 28px rgba(87, 226, 255, 0.2);
}

.manual-form {
  display: grid;
  gap: 18px;
}

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

.manual-field {
  display: grid;
  gap: 8px;
  color: #8eeeff;
  font-weight: 700;
}

.manual-field input,
.manual-field textarea {
  width: 100%;
  border: 1px solid rgba(90, 152, 188, 0.52);
  border-radius: 18px;
  background: rgba(3, 12, 25, 0.78);
  color: #eff8ff;
  font: inherit;
  padding: 16px 18px;
  outline: none;
  resize: vertical;
}

.manual-field input:focus,
.manual-field textarea:focus {
  border-color: #61e7ff;
  box-shadow: 0 0 0 3px rgba(97, 231, 255, 0.14);
}

.manual-detected {
  align-self: end;
  min-height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(90, 152, 188, 0.52);
  border-radius: 18px;
  color: rgba(220, 235, 255, 0.7);
  background: rgba(3, 12, 25, 0.58);
}

.manual-detected[data-type="plus"],
.manual-detected[data-type="pro5x"],
.manual-detected[data-type="pro20x"] {
  color: #84f5ff;
  border-color: rgba(98, 229, 255, 0.76);
}

.manual-alert {
  border: 1px solid rgba(255, 134, 134, 0.42);
  border-radius: 16px;
  padding: 14px 16px;
  color: #ffd2d2;
  background: rgba(90, 20, 38, 0.28);
}

.manual-alert[data-type="info"] {
  border-color: rgba(99, 222, 255, 0.42);
  color: #b9f4ff;
  background: rgba(22, 75, 98, 0.22);
}

.manual-alert[data-type="success"] {
  border-color: rgba(99, 230, 171, 0.42);
  color: #bfffe0;
  background: rgba(18, 92, 58, 0.22);
}

.manual-submit {
  min-height: 58px;
  border: 2px solid #62e7ff;
  border-radius: 999px;
  color: #79efff;
  background: rgba(16, 24, 42, 0.88);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 42px rgba(70, 224, 255, 0.18);
}

.manual-submit.is-loading::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 8px;
  border: 2px solid rgba(126, 240, 255, 0.28);
  border-top-color: #7ef0ff;
  border-radius: 999px;
  animation: adminSpin 0.75s linear infinite;
}

.manual-result {
  margin-top: 22px;
  padding: 22px;
  border: 1px solid rgba(99, 230, 171, 0.36);
  border-radius: 20px;
  background: rgba(9, 45, 34, 0.24);
}

.manual-result dl {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 18px 0 0;
}

.manual-result div {
  border: 1px solid rgba(101, 164, 194, 0.28);
  border-radius: 14px;
  padding: 14px;
  background: rgba(5, 15, 29, 0.42);
}

.manual-result dd {
  margin: 8px 0 0;
  color: #eef8ff;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.ops-page {
  min-height: 100vh;
  background: #f7f3ea;
}

.ops-shell {
  width: min(1240px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 22px 0 44px;
}

.ops-topbar,
.ops-panel {
  border: 1px solid var(--admin-line);
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: 0 18px 50px rgba(80, 55, 32, 0.07);
}

.ops-topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  margin-bottom: 14px;
}

.ops-topbar h1 {
  margin: 8px 0;
  font-size: 30px;
  letter-spacing: 0;
}

.ops-topbar p,
.ops-meta {
  margin: 0;
  color: var(--admin-soft);
}

.ops-panel {
  padding: 18px;
}

.ops-workbench {
  display: grid;
  grid-template-columns: minmax(320px, 410px) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.ops-queue-panel,
.ops-detail-panel {
  min-width: 0;
  border: 1px solid var(--admin-line);
  border-radius: 16px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: 0 18px 44px rgba(64, 44, 28, 0.08);
}

.ops-queue-panel,
.ops-detail-panel {
  padding: 16px;
}

.ops-panel-head,
.ops-detail-head,
.ops-json-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.ops-panel-head h2,
.ops-detail-head h2,
.ops-detail-empty h2,
.ops-json-head h3 {
  margin: 6px 0 0;
  color: var(--admin-ink);
  letter-spacing: 0;
}

.ops-toolbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: end;
  margin: 16px 0 14px;
}

.ops-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--admin-line);
  border-radius: 999px;
  background: #f3eadf;
}

.ops-tabs button {
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  padding: 0 15px;
  color: var(--admin-soft);
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.ops-tabs button.is-active {
  color: #fffaf2;
  background: #2f261f;
}

.ops-search {
  display: grid;
  gap: 7px;
}

.ops-search span {
  color: var(--admin-muted);
  font-size: 12px;
  font-weight: 700;
}

.ops-search input {
  min-height: 46px;
}

.ops-order-list {
  display: grid;
  gap: 10px;
  max-height: min(62vh, 680px);
  overflow: auto;
  padding-right: 2px;
}

.ops-order-card {
  width: 100%;
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(210, 194, 172, 0.92);
  border-radius: 14px;
  background: rgba(255, 251, 244, 0.84);
  color: var(--admin-ink);
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.ops-order-card:hover,
.ops-order-card.is-active {
  border-color: rgba(86, 64, 44, 0.56);
  box-shadow: 0 10px 24px rgba(64, 44, 28, 0.1);
  transform: translateY(-1px);
}

.ops-order-card.is-active {
  background: #fff9ef;
}

.ops-order-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.ops-order-top strong,
.ops-order-main {
  font-weight: 900;
}

.ops-order-top em,
.ops-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(62, 130, 93, 0.26);
  border-radius: 999px;
  background: rgba(225, 246, 234, 0.82);
  color: #16613d;
  font-style: normal;
  font-size: 0.82rem;
  font-weight: 900;
  white-space: nowrap;
}

.ops-status-pill[data-status="completed"] {
  border-color: rgba(129, 105, 71, 0.22);
  background: rgba(244, 236, 224, 0.88);
  color: #6b4f2f;
}

.ops-order-sub,
.ops-order-time,
.ops-detail-empty p,
.ops-json-head p {
  color: var(--admin-soft);
}

.ops-empty,
.ops-detail-empty {
  padding: 22px;
  border: 1px dashed rgba(174, 150, 120, 0.72);
  border-radius: 16px;
  background: rgba(255, 250, 242, 0.72);
  color: var(--admin-soft);
}

.ops-detail-empty {
  display: grid;
  align-content: center;
  min-height: 420px;
}

.ops-detail-content {
  display: grid;
  gap: 16px;
}

.ops-detail-content[hidden],
.ops-detail-empty[hidden] {
  display: none !important;
}

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

.ops-summary-grid div {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(210, 194, 172, 0.78);
  border-radius: 14px;
  background: rgba(255, 250, 243, 0.72);
}

.ops-summary-grid dt {
  color: var(--admin-muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.ops-summary-grid dd {
  margin: 7px 0 0;
  color: var(--admin-ink);
  font-weight: 900;
  overflow-wrap: anywhere;
}

.ops-json-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(210, 194, 172, 0.82);
  border-radius: 16px;
  background: rgba(255, 250, 243, 0.78);
}

.ops-json-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.ops-json-actions button {
  min-height: 38px;
}

.ops-json-raw {
  min-height: 320px;
  max-height: min(48vh, 520px);
  margin: 0;
  white-space: pre-wrap;
  overflow: auto;
}

.ops-detail-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.ops-detail-actions button {
  min-height: 46px;
}

.ops-table-shell {
  margin-top: 12px;
  overflow: auto;
  border: 1px solid var(--admin-line);
  border-radius: 12px;
}

.ops-table {
  min-width: 980px;
}

.ops-complete {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.ops-complete input {
  width: 18px;
  height: 18px;
}

.ops-pagination {
  margin-top: 14px;
}

.manual-admin-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) 140px;
  gap: 12px;
}

.manual-cards-table {
  min-width: 900px;
}

.admin-page .status-submitted {
  border-color: #d9c49a;
  background: #fff6df;
  color: #7d4d13;
}

.admin-page .status-completed {
  border-color: #b9decc;
  background: #edf8f2;
  color: #077953;
}

@media (max-width: 760px) {
  .manual-shell,
  .ops-shell {
    width: min(100% - 20px, 760px);
    padding-top: 12px;
  }

  .manual-hero,
  .ops-topbar {
    display: grid;
  }

  .manual-hero,
  .manual-panel,
  .ops-panel,
  .ops-queue-panel,
  .ops-detail-panel {
    padding: 14px;
    border-radius: 18px;
  }

  .manual-grid,
  .manual-admin-grid,
  .manual-result dl,
  .ops-toolbar,
  .ops-workbench,
  .ops-summary-grid,
  .ops-detail-actions {
    grid-template-columns: 1fr;
  }

  .manual-steps {
    grid-template-columns: 1fr;
  }

  .manual-steps span {
    min-height: 36px;
  }

  .ops-tabs {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-radius: 12px;
  }

  .ops-tabs button {
    padding: 0 8px;
  }

  .ops-table {
    min-width: 0;
  }

  .ops-order-list {
    max-height: none;
  }

  .ops-panel-head,
  .ops-detail-head,
  .ops-json-head {
    display: grid;
  }

  .ops-json-actions {
    justify-content: stretch;
  }

  .ops-json-actions button {
    flex: 1 1 140px;
  }

  .ops-json-raw {
    min-height: 240px;
  }
}

/* auto-recharge-maintenance-and-queue */
.auto-maintenance-active {
  min-height: 100vh;
  overflow: hidden;
}

.auto-maintenance-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 20%, rgba(82, 215, 255, 0.2), transparent 38%),
    rgba(4, 10, 20, 0.9);
  backdrop-filter: blur(18px);
}

.auto-maintenance-card {
  width: min(620px, 100%);
  padding: clamp(28px, 5vw, 44px);
  border: 1px solid rgba(96, 217, 244, 0.38);
  border-radius: 28px;
  background: linear-gradient(160deg, rgba(18, 43, 72, 0.96), rgba(7, 17, 31, 0.98));
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.08),
    0 30px 90px rgba(0, 8, 20, 0.58),
    0 0 70px rgba(89, 214, 255, 0.12);
  text-align: center;
}

.auto-maintenance-card h1 {
  margin: 16px 0 12px;
  color: #eaf8ff;
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.auto-maintenance-card p {
  max-width: 480px;
  margin: 0 auto 24px;
  color: rgba(220, 235, 255, 0.72);
  line-height: 1.8;
}

.auto-maintenance-link {
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  text-decoration: none;
}

.manual-recharge-page .manual-shell {
  width: min(1120px, calc(100vw - 28px));
  padding: clamp(18px, 4vw, 34px) 0 clamp(30px, 6vw, 54px);
}

.manual-recharge-page .manual-hero,
.manual-recharge-page .manual-panel,
.manual-guide-card,
.manual-status-card {
  border-color: rgba(96, 217, 244, 0.32);
  border-radius: 28px;
  background:
    radial-gradient(circle at 50% 0%, rgba(89, 214, 255, 0.12), transparent 34%),
    linear-gradient(160deg, rgba(18, 43, 72, 0.92), rgba(7, 17, 31, 0.97));
}

.manual-recharge-page .manual-hero {
  display: grid;
  justify-items: center;
  gap: 0;
  padding: clamp(26px, 5vw, 42px);
  margin-bottom: 18px;
  text-align: center;
}

.manual-recharge-page .manual-hero h1 {
  margin: 16px 0 12px;
  font-size: clamp(2rem, 6vw, 3.4rem);
  line-height: 1.05;
}

.manual-recharge-page .manual-hero p {
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.75;
}

.manual-recharge-page .manual-panel {
  padding: clamp(18px, 4vw, 28px);
}

.manual-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.manual-workspace {
  display: grid;
  gap: 18px;
}

.manual-guide-card,
.manual-status-card {
  border: 1px solid rgba(96, 217, 244, 0.32);
  padding: clamp(18px, 3vw, 24px);
}

.manual-guide-card h2,
.manual-status-card h2 {
  margin: 0 0 8px;
  color: #eaf8ff;
  font-size: clamp(1.35rem, 3vw, 1.8rem);
  line-height: 1.18;
}

.manual-guide-card p,
.manual-status-card p {
  margin: 0;
  color: rgba(220, 235, 255, 0.72);
  line-height: 1.7;
}

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

.manual-guide-list li {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 14px;
  padding: 16px 0;
  border-top: 1px solid rgba(101, 164, 194, 0.22);
}

.manual-guide-list li:first-child {
  border-top: 0;
  padding-top: 0;
}

.manual-guide-list strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(6, 13, 28, 0.92);
  color: #f6fbff;
  font-weight: 900;
  letter-spacing: 0;
}

.manual-guide-list h3 {
  margin: 0 0 4px;
  color: #eaf8ff;
  font-size: 1rem;
  line-height: 1.25;
}

.manual-guide-list a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  margin-top: 10px;
  padding: 0 14px;
  border-radius: 9px;
  background: #3264f4;
  color: #ffffff;
  font-weight: 800;
  text-decoration: none;
}

.manual-status-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px;
  gap: 14px;
  align-items: end;
}

.manual-status-card > div:first-child,
.manual-status-card .manual-alert,
.manual-status-result {
  grid-column: 1 / -1;
}

.manual-status-card .manual-field {
  grid-column: 1 / 2;
}

.manual-status-button {
  grid-column: 2 / 3;
  min-height: 52px;
}

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

.manual-status-result[hidden] {
  display: none !important;
}

.manual-status-result div {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(101, 164, 194, 0.24);
  border-radius: 14px;
  background: rgba(5, 15, 29, 0.42);
}

.manual-status-result span {
  display: block;
  color: rgba(220, 235, 255, 0.62);
  font-size: 0.86rem;
}

.manual-status-result strong {
  display: block;
  margin-top: 6px;
  color: #eef8ff;
  font-size: 0.98rem;
  overflow-wrap: anywhere;
}

.manual-recharge-page .manual-steps {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.manual-recharge-page .manual-steps span {
  min-height: 44px;
  font-weight: 800;
}

.manual-recharge-page .manual-form {
  gap: 16px;
}

.manual-panel-view {
  display: grid;
  gap: 16px;
}

.manual-panel-view[hidden] {
  display: none !important;
}

.manual-recharge-page .manual-field {
  color: #8eeeff;
}

.manual-field-cdk {
  position: relative;
}

.manual-field-cdk input {
  padding-right: 170px;
}

.manual-field-cdk .manual-detected {
  position: absolute;
  right: 10px;
  bottom: 10px;
  min-width: 146px;
  min-height: 40px;
  border-radius: 999px;
  font-size: 0.92rem;
}

.manual-recharge-page .manual-field textarea {
  min-height: 190px;
}

.manual-recharge-page .manual-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 58px;
  text-align: center;
}

.manual-secondary {
  min-height: 54px;
  border: 1px solid rgba(96, 217, 244, 0.38);
  border-radius: 999px;
  background: rgba(16, 24, 42, 0.7);
  color: rgba(220, 235, 255, 0.82);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

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

.manual-confirm-card {
  padding: clamp(18px, 4vw, 28px);
  border: 1px solid rgba(90, 152, 188, 0.42);
  border-radius: 22px;
  background: rgba(4, 12, 24, 0.52);
  text-align: center;
}

.manual-confirm-card h2 {
  margin: 14px 0 18px;
  color: #eaf8ff;
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  line-height: 1.12;
}

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

.manual-summary-grid div {
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(101, 164, 194, 0.26);
  border-radius: 16px;
  background: rgba(5, 15, 29, 0.46);
}

.manual-summary-grid dt,
.manual-progress-list {
  color: rgba(220, 235, 255, 0.68);
}

.manual-summary-grid dd {
  margin: 8px 0 0;
  color: #eef8ff;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.manual-recharge-page .manual-result {
  text-align: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(90, 255, 186, 0.12), transparent 35%),
    rgba(9, 45, 34, 0.24);
}

.manual-recharge-page .manual-result h2 {
  margin-top: 12px;
  font-size: clamp(1.7rem, 4vw, 2.4rem);
}

.manual-recharge-page .manual-result p {
  margin: 0 auto 16px;
  color: rgba(220, 235, 255, 0.78);
}

.manual-progress-list {
  display: grid;
  gap: 10px;
  width: min(100%, 480px);
  margin: 0 auto 18px;
  padding: 0;
  list-style: none;
  text-align: left;
}

.manual-progress-list li {
  position: relative;
  min-height: 38px;
  padding: 9px 12px 9px 36px;
  border: 1px solid rgba(101, 164, 194, 0.24);
  border-radius: 999px;
  background: rgba(5, 15, 29, 0.36);
}

.manual-progress-list li::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  width: 10px;
  height: 10px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: rgba(126, 240, 255, 0.42);
}

.manual-progress-list li.is-done::before {
  background: #63e6ab;
}

.manual-progress-list li.is-active::before {
  background: #7ef0ff;
  box-shadow: 0 0 18px rgba(126, 240, 255, 0.62);
}

.manual-recharge-page .manual-result dl {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.manual-recharge-page .manual-result div {
  text-align: center;
}

.manual-recharge-page .manual-result dd {
  font-size: clamp(1rem, 2.4vw, 1.2rem);
}

@media (max-width: 620px) {
  .auto-maintenance-overlay {
    padding: 14px;
  }

  .manual-recharge-page .manual-shell {
    width: min(100% - 16px, 620px);
    padding-top: 10px;
  }

  .manual-recharge-page .manual-hero,
  .manual-recharge-page .manual-panel,
  .manual-guide-card,
  .manual-status-card {
    border-radius: 22px;
  }

  .manual-layout,
  .manual-status-card,
  .manual-status-result {
    grid-template-columns: 1fr;
  }

  .manual-status-card .manual-field,
  .manual-status-button {
    grid-column: 1 / -1;
  }

  .manual-guide-card {
    order: 2;
  }

  .manual-workspace {
    order: 1;
  }

  .manual-recharge-page .manual-steps,
  .manual-summary-grid,
  .manual-recharge-page .manual-result dl {
    grid-template-columns: 1fr;
  }

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

  .manual-field-cdk input {
    padding-right: 18px;
  }

  .manual-field-cdk .manual-detected {
    position: static;
    width: 100%;
    margin-top: 0;
  }

  .manual-recharge-page .manual-field textarea {
    min-height: 220px;
  }
}
