: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);
}

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

.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-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.confirm-title-row h2 {
  margin: 0;
}

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

.processing-card {
  background: rgba(255, 182, 92, 0.1);
  border: 1px solid rgba(255, 182, 92, 0.18);
}

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

.ready-card {
  background: rgba(89, 208, 255, 0.08);
  border: 1px solid rgba(89, 208, 255, 0.16);
}

.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, #ffd17d, #ff9a3d);
  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-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 {
  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;
}

.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(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.tutorial-hero {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 32px;
  margin-bottom: 24px;
  border: 1px solid rgba(173, 223, 255, 0.26);
  border-radius: 32px;
  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-back {
  justify-self: start;
}

.tutorial-card {
  padding: 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: 22px;
  background: #020a14;
}

.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.72);
  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, 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);
}

.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-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 {
  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 .generated-output {
  min-height: 168px;
  font-family: Consolas, "Courier New", monospace;
}

.admin-page input:focus,
.admin-page textarea: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: 28%;
}

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

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

.mapping-table th:nth-child(4) {
  width: 110px;
}

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

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

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

.table-check,
.select-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.table-check {
  color: #5a5047;
  font-size: 12px;
  font-weight: 780;
}

.mapping-checkbox,
.table-check input {
  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;
}

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

.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;
  gap: 18px;
  min-width: 0;
}

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

.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 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) {
  .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;
  }

  .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(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(100% - 20px, 1080px);
    padding-top: 20px;
  }

  .tutorial-back {
    justify-self: stretch;
  }

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

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

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

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