:root {
  color-scheme: dark;
  font-family: "Segoe UI Variable", "Segoe UI", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  --bg: #071014;
  --panel: #10191f;
  --panel-2: #0b1216;
  --line: #24333d;
  --line-soft: #1a2a33;
  --text: #eef7f8;
  --muted: #93a4ad;
  --faint: #657780;
  --accent: #2387ff;
  --accent-2: #22c7df;
  --success: #43df86;
  --danger: #ff6660;
  --warning: #f2b950;
  --shadow: 0 18px 64px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: linear-gradient(180deg, #0b141a 0%, var(--bg) 100%);
  color: var(--text);
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
p {
  margin: 0;
}

.shell {
  width: min(900px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 22px 0 28px;
}

.admin-shell {
  width: min(1180px, calc(100vw - 28px));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  margin-bottom: 14px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: linear-gradient(135deg, #0fa5ff, #1458ff);
  box-shadow: 0 12px 30px rgba(20, 88, 255, 0.25);
  color: white;
  font-weight: 800;
}

h1 {
  margin-bottom: 5px;
  font-size: 24px;
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 5px;
  font-size: 16px;
  letter-spacing: 0;
}

p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.state-chip {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(16, 25, 31, 0.92);
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.state-chip.active {
  border-color: rgba(35, 135, 255, 0.58);
  color: var(--text);
}

.redeem-card,
.result-card {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(16, 25, 31, 0.94);
  box-shadow: var(--shadow);
}

.progress-block {
  display: grid;
  gap: 10px;
  padding: 6px 0 4px;
}

.progress-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.progress-copy strong {
  color: var(--text);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.progress-track {
  width: 100%;
  height: 16px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #0a1217;
}

.progress-bar {
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: background-color 200ms ease;
}

.progress-bar.success {
  background: var(--success);
}

.progress-bar.danger {
  background: var(--danger);
}

.progress-bar.cancelled {
  background: var(--muted);
}

.redeem-card {
  padding: 14px;
}

.result-card {
  display: grid;
  gap: 14px;
  margin-top: 12px;
  padding: 16px;
}

form {
  display: grid;
  gap: 13px;
}

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

.card-heading.simple {
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 13px;
}

.heading-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-top: 4px;
  color: var(--accent-2);
}

.tool-button {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0d171d;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.tool-button.muted {
  color: var(--muted);
}

.field {
  display: grid;
  gap: 8px;
}

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

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-2);
  color: var(--text);
  outline: 0;
}

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

textarea {
  min-height: 176px;
  resize: vertical;
  padding: 12px;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
}

input:focus,
textarea:focus {
  border-color: rgba(35, 135, 255, 0.92);
  box-shadow: 0 0 0 4px rgba(35, 135, 255, 0.12);
}

.input-hint {
  min-height: 20px;
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 700;
}

.input-hint.success {
  color: var(--success);
}

.input-hint.warning {
  color: var(--warning);
}

.primary-button {
  min-height: 44px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 14px 30px rgba(35, 135, 255, 0.24);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
}

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

.secondary-button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #111c23;
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
}

.secondary-button:hover:not(:disabled) {
  border-color: var(--accent);
  background: #15232c;
}

.admin-login {
  display: grid;
  gap: 14px;
  width: min(460px, 100%);
}

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

.admin-config,
.stats-card,
.submissions-card {
  display: grid;
  gap: 13px;
}

.submissions-card {
  grid-column: 1 / -1;
}

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

.stats-grid div {
  min-height: 74px;
  display: grid;
  gap: 6px;
  align-content: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(13, 23, 29, 0.72);
}

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

.stats-grid strong {
  font-size: 26px;
}

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

.table-wrap {
  overflow-x: auto;
}

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

th,
td {
  padding: 10px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 800;
}

td {
  overflow-wrap: anywhere;
}

.status-pill {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(13, 23, 29, 0.72);
}

.empty-cell {
  color: var(--muted);
  text-align: center;
}

.hidden {
  display: none !important;
}

.result-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--faint);
}

.dot.active {
  background: var(--accent-2);
  box-shadow: 0 0 0 6px rgba(34, 199, 223, 0.12);
}

.dot.success {
  background: var(--success);
  box-shadow: 0 0 0 6px rgba(67, 223, 134, 0.12);
}

.dot.danger {
  background: var(--danger);
  box-shadow: 0 0 0 6px rgba(255, 102, 96, 0.12);
}

.meta-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.meta-list div {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 10px;
  min-height: 36px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(13, 23, 29, 0.72);
}

dt {
  color: var(--muted);
  font-size: 12px;
}

dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 700;
}

@media (max-width: 720px) {
  .topbar {
    display: grid;
  }

  .card-heading {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .card-heading.simple,
  .admin-grid,
  .stats-grid,
  .customer-actions {
    grid-template-columns: 1fr;
  }

  .tool-button {
    grid-column: 2;
  }
}

/* Customer exchange surface */
.customer-page {
  --matrix-bg: #0a1829;
  --matrix-surface: #112238;
  --matrix-surface-raised: #172943;
  --matrix-line: #344a68;
  --matrix-line-strong: #4b678e;
  --matrix-text: #f0f5ff;
  --matrix-muted: #a2b1c8;
  --matrix-faint: #71819a;
  --matrix-cyan: #2dd7dd;
  --matrix-blue: #4380ff;
  --matrix-violet: #a06dff;
  --matrix-rose: #ff83b3;
  --matrix-green: #48d58a;
  --matrix-red: #ff6e78;
  --matrix-amber: #f1bd5c;
  min-height: 100vh;
  background: linear-gradient(135deg, #091827 0%, #0e1b2d 56%, #171329 100%);
  color: var(--matrix-text);
  font-family: "Segoe UI Variable", "Segoe UI", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

.customer-page *,
.customer-page *::before,
.customer-page *::after {
  letter-spacing: 0;
}

.matrix-background {
  position: fixed;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.matrix-background canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.9;
}

.matrix-energy-haze {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(112deg, rgba(45, 215, 221, 0.105) 0%, transparent 30%, transparent 64%, rgba(255, 131, 179, 0.075) 100%),
    linear-gradient(180deg, rgba(8, 17, 31, 0.01) 0%, rgba(8, 17, 31, 0.1) 70%, rgba(8, 17, 31, 0.25) 100%);
}

.matrix-shell {
  position: relative;
  z-index: 1;
  width: min(1320px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 20px 0 14px;
}

.matrix-header {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.matrix-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 108px;
  min-height: 38px;
  padding: 3px;
  border: 1px solid var(--matrix-line);
  border-radius: 7px;
  background: rgba(8, 19, 33, 0.82);
}

.theme-switch button {
  min-width: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--matrix-muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  transition: background-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.theme-switch button.active {
  background: #243652;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
}

.theme-switch button:focus-visible {
  outline: 2px solid var(--matrix-cyan);
  outline-offset: 2px;
}

.matrix-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border-radius: 6px;
}

.matrix-brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(50, 213, 238, 0.48);
  border-radius: 8px;
  background: #14254b;
  box-shadow: inset 0 0 20px rgba(57, 123, 255, 0.2);
  color: #ffffff;
  font-size: 17px;
  font-weight: 800;
}

.matrix-brand-copy {
  display: grid;
  gap: 1px;
}

.matrix-brand-copy strong {
  font-size: 15px;
  line-height: 1.2;
}

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

.matrix-state {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 15px;
  border: 1px solid rgba(50, 213, 238, 0.42);
  border-radius: 999px;
  background: #0b1725;
  color: #dce9ff;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.matrix-state > span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--matrix-cyan);
  box-shadow: 0 0 12px rgba(50, 213, 238, 0.8);
}

.matrix-state.active {
  border-color: rgba(154, 108, 255, 0.65);
  color: #ffffff;
}

.matrix-state.active > span {
  background: var(--matrix-violet);
  box-shadow: 0 0 12px rgba(154, 108, 255, 0.85);
}

.matrix-hero {
  position: relative;
  display: grid;
  min-height: 154px;
  place-items: center;
  padding: 20px 190px 24px;
  text-align: center;
}

.matrix-hero-visual {
  position: absolute;
  top: 50%;
  left: 48px;
  width: 124px;
  height: 124px;
  padding: 2px;
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(120deg, var(--matrix-cyan), var(--matrix-blue), var(--matrix-violet), var(--matrix-rose), var(--matrix-cyan));
  background-size: 260% 260%;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.36), 0 0 28px rgba(45, 215, 221, 0.14);
  transform: translateY(-50%);
  animation: matrix-avatar-flow 6s ease-in-out infinite;
}

.matrix-hero-visual::after {
  position: absolute;
  inset: 2px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  content: "";
  pointer-events: none;
}

.matrix-hero-visual img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 6px;
  object-fit: cover;
}

.matrix-kicker,
.pane-kicker {
  color: var(--matrix-cyan);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
}

.matrix-hero h1 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 0;
  color: #e8f2ff;
  font-family: Bahnschrift, "Segoe UI Variable", "Segoe UI", sans-serif;
  font-size: 48px;
  font-weight: 700;
  line-height: 1.1;
}

.matrix-hero h1 b {
  color: #b38bff;
  font-weight: 700;
}

.exchange-console {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(380px, 0.92fr);
  overflow: hidden;
  border: 1px solid var(--matrix-line);
  border-radius: 8px;
  background: rgba(17, 34, 56, 0.93);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.38);
  isolation: isolate;
}

.exchange-console::before {
  position: absolute;
  z-index: 2;
  inset: -1px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: linear-gradient(90deg, transparent 0%, transparent 25%, var(--matrix-cyan) 43%, var(--matrix-violet) 55%, transparent 72%, transparent 100%) border-box;
  background-size: 240% 100%;
  content: "";
  pointer-events: none;
  -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: matrix-border-flow 7s linear infinite;
}

.exchange-form-pane,
.exchange-status-pane {
  min-width: 0;
  padding: 32px 34px;
}

.exchange-status-pane {
  border-left: 1px solid var(--matrix-line);
  background: rgba(12, 25, 43, 0.92);
}

.pane-heading,
.status-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.pane-heading h2,
.status-heading h2 {
  margin: 4px 0 0;
  color: var(--matrix-text);
  font-size: 22px;
  line-height: 1.25;
}

.pane-tools {
  display: flex;
  gap: 8px;
}

.matrix-tool-button,
.matrix-primary-button,
.matrix-secondary-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 200ms ease, background-color 200ms ease, color 200ms ease, transform 200ms ease;
}

.matrix-tool-button {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--matrix-line);
  background: #111a2b;
  color: #e7efff;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.matrix-tool-button.muted {
  color: var(--matrix-muted);
}

.matrix-tool-button:hover,
.matrix-tool-button:focus-visible {
  border-color: var(--matrix-cyan);
  color: #ffffff;
}

.customer-page #redeemForm {
  display: grid;
  gap: 16px;
}

.matrix-field {
  display: grid;
  gap: 8px;
}

.matrix-field > span {
  color: #cbd7eb;
  font-size: 13px;
  font-weight: 700;
}

.matrix-field input,
.matrix-field textarea {
  width: 100%;
  border: 1px solid var(--matrix-line);
  border-radius: 6px;
  background: #0a1626;
  color: var(--matrix-text);
  outline: 0;
  transition: border-color 200ms ease, box-shadow 200ms ease, background-color 200ms ease;
}

.matrix-field input {
  min-height: 52px;
  padding: 0 15px;
}

.matrix-field textarea {
  min-height: 146px;
  padding: 14px 15px;
  resize: vertical;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
}

.matrix-field input::placeholder,
.matrix-field textarea::placeholder {
  color: #64738e;
}

.matrix-field input:focus,
.matrix-field textarea:focus {
  border-color: var(--matrix-blue);
  background: #0d1b2e;
  box-shadow: 0 0 0 3px rgba(57, 123, 255, 0.17);
}

.matrix-input-hint,
.customer-page .input-hint {
  min-height: 20px;
  color: var(--matrix-cyan);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}

.customer-page .input-hint.success {
  color: var(--matrix-green);
}

.customer-page .input-hint.warning {
  color: var(--matrix-amber);
}

.matrix-actions {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr);
  gap: 10px;
}

.matrix-primary-button,
.matrix-secondary-button {
  min-height: 52px;
  overflow: hidden;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 800;
}

.matrix-primary-button {
  border: 1px solid #548dff;
  background: #397bff;
  box-shadow: 0 12px 28px rgba(57, 123, 255, 0.25);
  color: #ffffff;
}

.matrix-primary-button::after {
  position: absolute;
  top: -50%;
  left: -45%;
  width: 32%;
  height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.42), transparent);
  content: "";
  pointer-events: none;
  transform: translateX(0) skewX(-18deg);
}

.matrix-primary-button span {
  position: relative;
  z-index: 1;
}

.matrix-primary-button:hover:not(:disabled) {
  background: #4c88ff;
  transform: translateY(-1px);
}

.matrix-primary-button:hover:not(:disabled)::after,
.matrix-primary-button:focus-visible::after {
  animation: matrix-button-flow 1.1s ease-out 1;
}

.matrix-primary-button:active:not(:disabled),
.matrix-secondary-button:active:not(:disabled) {
  transform: translateY(1px);
}

.matrix-secondary-button {
  border: 1px solid var(--matrix-line-strong);
  background: #121b2d;
  color: #e7efff;
}

.matrix-secondary-button:hover:not(:disabled) {
  border-color: var(--matrix-violet);
  background: #18233a;
}

.matrix-tool-button:focus-visible,
.matrix-primary-button:focus-visible,
.matrix-secondary-button:focus-visible,
.matrix-brand:focus-visible {
  outline: 2px solid var(--matrix-cyan);
  outline-offset: 3px;
}

.security-note {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 16px;
  color: var(--matrix-faint);
  font-size: 12px;
}

.security-note > span {
  width: 7px;
  height: 7px;
  border: 1px solid var(--matrix-cyan);
  border-radius: 50%;
}

.auto-query-badge {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--matrix-line);
  border-radius: 999px;
  color: var(--matrix-muted);
  font-size: 11px;
  white-space: nowrap;
}

.result-summary {
  min-height: 78px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--matrix-line);
}

.customer-page .result-heading {
  gap: 10px;
  margin-bottom: 8px;
}

.customer-page .result-heading strong {
  color: var(--matrix-text);
  font-size: 17px;
}

.customer-page #resultMessage {
  color: var(--matrix-muted);
  font-size: 13px;
}

.customer-page .dot {
  width: 10px;
  height: 10px;
  background: var(--matrix-faint);
}

.customer-page .dot.active {
  background: var(--matrix-cyan);
  box-shadow: 0 0 0 5px rgba(50, 213, 238, 0.11), 0 0 16px rgba(50, 213, 238, 0.55);
}

.customer-page .dot.success {
  background: var(--matrix-green);
  box-shadow: 0 0 0 5px rgba(72, 213, 138, 0.11), 0 0 16px rgba(72, 213, 138, 0.5);
}

.customer-page .dot.danger {
  background: var(--matrix-red);
  box-shadow: 0 0 0 5px rgba(255, 110, 120, 0.11), 0 0 16px rgba(255, 110, 120, 0.5);
}

.matrix-progress-block {
  display: grid;
  gap: 12px;
  padding: 24px 0 22px;
}

.matrix-progress-copy {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  color: #cbd7eb;
  font-size: 14px;
  font-weight: 700;
}

.matrix-progress-copy strong {
  color: #ffffff;
  font-family: Bahnschrift, "Segoe UI Variable", "Segoe UI", sans-serif;
  font-size: 34px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.matrix-progress-track {
  position: relative;
  width: 100%;
  height: 24px;
  overflow: hidden;
  border: 1px solid var(--matrix-line-strong);
  border-radius: 6px;
  background: #081321;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.45);
}

.matrix-progress-track::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 24%, rgba(255, 255, 255, 0.06) 25%, transparent 26%, transparent 49%, rgba(255, 255, 255, 0.06) 50%, transparent 51%, transparent 69%, rgba(255, 255, 255, 0.06) 70%, transparent 71%, transparent 84%, rgba(255, 255, 255, 0.06) 85%, transparent 86%);
  content: "";
  pointer-events: none;
}

.customer-page .progress-bar {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: linear-gradient(90deg, #2b72ff, #32d5ee, #8b68ff);
  background-size: 220% 100%;
  box-shadow: 0 0 20px rgba(57, 123, 255, 0.45);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 500ms cubic-bezier(0.16, 1, 0.3, 1), background-color 200ms ease;
  animation: matrix-progress-flow 2.4s linear infinite;
}

.customer-page .progress-bar::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.36), transparent);
  content: "";
  transform: translateX(-100%);
  animation: matrix-progress-scan 2.1s ease-in-out infinite;
}

.customer-page .progress-bar.success {
  background: var(--matrix-green);
}

.customer-page .progress-bar.danger {
  background: var(--matrix-red);
}

.customer-page .progress-bar.cancelled {
  background: var(--matrix-faint);
}

.progress-stages {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  color: var(--matrix-faint);
  font-size: 11px;
  text-align: center;
}

.progress-stages span:first-child {
  text-align: left;
}

.progress-stages span:last-child {
  text-align: right;
}

.matrix-meta-list {
  display: grid;
  margin: 0;
}

.matrix-meta-list > div {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 14px;
  min-height: 48px;
  align-items: center;
  border-top: 1px solid var(--matrix-line);
}

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

.matrix-meta-list dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: #e7efff;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
}

.matrix-footer {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: #5d6e89;
  font-size: 11px;
}

.customer-page[data-theme="light"] {
  --matrix-surface: #ffffff;
  --matrix-surface-raised: #f7f9ff;
  --matrix-line: #d6dfef;
  --matrix-line-strong: #bdcae1;
  --matrix-text: #18213a;
  --matrix-muted: #68718a;
  --matrix-faint: #8791a8;
  --matrix-cyan: #328da4;
  --matrix-blue: #4776f6;
  --matrix-violet: #795be7;
  background: linear-gradient(135deg, #f5f7ff 0%, #eef3ff 58%, #f4efff 100%);
  color: var(--matrix-text);
}

.customer-page[data-theme="light"] .matrix-background canvas {
  opacity: 0.78;
}

.customer-page[data-theme="light"] .matrix-energy-haze {
  background:
    linear-gradient(112deg, rgba(72, 143, 234, 0.09) 0%, transparent 32%, transparent 66%, rgba(157, 105, 235, 0.075) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(239, 244, 255, 0.18) 72%, rgba(235, 241, 253, 0.36) 100%);
}

.customer-page[data-theme="light"] .matrix-brand-mark {
  border-color: rgba(71, 118, 246, 0.35);
  background: linear-gradient(135deg, #4776f6, #745fe6);
  box-shadow: 0 10px 24px rgba(71, 118, 246, 0.2);
}

.customer-page[data-theme="light"] .matrix-brand-copy strong {
  color: #1c2740;
}

.customer-page[data-theme="light"] .theme-switch {
  border-color: #d4deef;
  background: rgba(242, 246, 255, 0.8);
}

.customer-page[data-theme="light"] .theme-switch button {
  color: #77819a;
}

.customer-page[data-theme="light"] .theme-switch button.active {
  background: rgba(255, 255, 255, 0.96);
  color: #3d5fc4;
  box-shadow: 0 3px 10px rgba(64, 83, 125, 0.12);
}

.customer-page[data-theme="light"] .matrix-state {
  border-color: rgba(40, 167, 107, 0.28);
  background: rgba(244, 255, 249, 0.84);
  color: #23714e;
}

.customer-page[data-theme="light"] .matrix-state > span {
  background: #2eb875;
  box-shadow: 0 0 10px rgba(46, 184, 117, 0.38);
}

.customer-page[data-theme="light"] .matrix-state.active {
  border-color: rgba(121, 91, 231, 0.36);
  color: #5e4cb8;
}

.customer-page[data-theme="light"] .matrix-state.active > span {
  background: #795be7;
  box-shadow: 0 0 10px rgba(121, 91, 231, 0.34);
}

.customer-page[data-theme="light"] .matrix-hero h1 {
  color: #18213a;
}

.customer-page[data-theme="light"] .matrix-hero h1 b {
  color: #6756d8;
}

.customer-page[data-theme="light"] .matrix-hero-visual {
  box-shadow: 0 14px 34px rgba(61, 78, 126, 0.17), 0 0 22px rgba(71, 118, 246, 0.1);
}

.customer-page[data-theme="light"] .exchange-console {
  border-color: rgba(188, 202, 226, 0.9);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 24px 60px rgba(54, 74, 113, 0.14);
}

.customer-page[data-theme="light"] .exchange-status-pane {
  border-color: #d8e1f0;
  background: rgba(246, 249, 255, 0.86);
}

.customer-page[data-theme="light"] .matrix-tool-button {
  border-color: #cfdaec;
  background: rgba(255, 255, 255, 0.88);
  color: #34405b;
}

.customer-page[data-theme="light"] .matrix-tool-button.muted {
  color: #748099;
}

.customer-page[data-theme="light"] .matrix-field > span,
.customer-page[data-theme="light"] .matrix-progress-copy {
  color: #4b5771;
}

.customer-page[data-theme="light"] .matrix-field input,
.customer-page[data-theme="light"] .matrix-field textarea {
  border-color: #cdd8e9;
  background: rgba(255, 255, 255, 0.9);
  color: #18213a;
}

.customer-page[data-theme="light"] .matrix-field input::placeholder,
.customer-page[data-theme="light"] .matrix-field textarea::placeholder {
  color: #8b96ac;
}

.customer-page[data-theme="light"] .matrix-field input:focus,
.customer-page[data-theme="light"] .matrix-field textarea:focus {
  border-color: #4776f6;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(71, 118, 246, 0.13);
}

.customer-page[data-theme="light"] .matrix-secondary-button {
  border-color: #c6d2e7;
  background: rgba(255, 255, 255, 0.8);
  color: #34405b;
}

.customer-page[data-theme="light"] .matrix-secondary-button:hover:not(:disabled) {
  border-color: #795be7;
  background: #f6f4ff;
}

.customer-page[data-theme="light"] .security-note {
  color: #7b869d;
}

.customer-page[data-theme="light"] .auto-query-badge {
  background: rgba(255, 255, 255, 0.66);
}

.customer-page[data-theme="light"] .result-summary,
.customer-page[data-theme="light"] .matrix-meta-list > div {
  border-color: #d8e1f0;
}

.customer-page[data-theme="light"] .customer-page #resultMessage,
.customer-page[data-theme="light"] #resultMessage {
  color: #68718a;
}

.customer-page[data-theme="light"] .matrix-progress-copy strong {
  color: #18213a;
}

.customer-page[data-theme="light"] .matrix-progress-track {
  border-color: #c8d4e7;
  background: #e9eef8;
  box-shadow: inset 0 2px 7px rgba(71, 88, 125, 0.1);
}

.customer-page[data-theme="light"] .matrix-progress-track::after {
  opacity: 0.42;
}

.customer-page[data-theme="light"] .progress-stages,
.customer-page[data-theme="light"] .matrix-meta-list dt {
  color: #77829a;
}

.customer-page[data-theme="light"] .matrix-meta-list dd {
  color: #303c56;
}

.customer-page[data-theme="light"] .matrix-footer {
  color: #8993a9;
}

@keyframes matrix-border-flow {
  from { background-position: 140% 0; }
  to { background-position: -140% 0; }
}

@keyframes matrix-avatar-flow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes matrix-button-flow {
  from { transform: translateX(0) skewX(-18deg); }
  to { transform: translateX(500%) skewX(-18deg); }
}

@keyframes matrix-progress-flow {
  from { background-position: 0 0; }
  to { background-position: 220% 0; }
}

@keyframes matrix-progress-scan {
  0%, 20% { transform: translateX(-100%); }
  80%, 100% { transform: translateX(100%); }
}

@media (max-width: 960px) {
  .matrix-shell {
    width: min(760px, calc(100vw - 32px));
  }

  .matrix-hero h1 {
    font-size: 38px;
  }

  .matrix-hero {
    min-height: 132px;
    padding-right: 130px;
    padding-left: 130px;
  }

  .matrix-hero-visual {
    left: 18px;
    width: 96px;
    height: 96px;
  }

  .exchange-console {
    grid-template-columns: 1fr;
  }

  .exchange-status-pane {
    border-top: 1px solid var(--matrix-line);
    border-left: 0;
  }
}

@media (max-width: 600px) {
  .matrix-shell {
    width: min(100% - 24px, 560px);
    padding-top: 14px;
  }

  .matrix-header {
    min-height: 48px;
    align-items: start;
  }

  .matrix-header-actions {
    display: grid;
    justify-items: end;
    gap: 6px;
  }

  .theme-switch {
    width: 104px;
    min-height: 34px;
  }

  .matrix-brand-mark {
    width: 40px;
    height: 40px;
  }

  .matrix-state {
    min-height: 34px;
    padding: 0 10px;
    font-size: 10px;
  }

  .matrix-hero {
    min-height: auto;
    gap: 14px;
    padding: 20px 8px 24px;
  }

  .matrix-hero-visual {
    position: relative;
    top: auto;
    left: auto;
    width: 82px;
    height: 82px;
    transform: none;
  }

  .matrix-hero h1 {
    display: grid;
    gap: 5px;
    font-size: 32px;
  }

  .exchange-form-pane,
  .exchange-status-pane {
    padding: 20px 16px;
  }

  .pane-heading,
  .status-heading {
    display: grid;
    margin-bottom: 18px;
  }

  .pane-tools {
    width: 100%;
  }

  .matrix-tool-button {
    min-height: 44px;
    flex: 1;
  }

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

  .matrix-primary-button,
  .matrix-secondary-button {
    min-height: 50px;
  }

  .matrix-progress-copy strong {
    font-size: 30px;
  }

  .matrix-progress-track {
    height: 22px;
  }

  .progress-stages {
    font-size: 10px;
  }

  .matrix-footer {
    justify-content: center;
  }

  .matrix-footer span:last-child {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .exchange-console::before,
  .matrix-hero-visual,
  .matrix-primary-button::after,
  .customer-page .progress-bar,
  .customer-page .progress-bar::after {
    animation: none;
  }

  .customer-page *,
  .customer-page *::before,
  .customer-page *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
