:root {
  color-scheme: dark;
  --bg: #07090d;
  --bg-2: #0c1017;
  --panel: rgba(19, 23, 32, 0.88);
  --panel-2: rgba(27, 32, 44, 0.92);
  --panel-3: #0f141d;
  --line: rgba(184, 199, 226, 0.16);
  --line-strong: rgba(214, 225, 247, 0.28);
  --text: #f7f3eb;
  --muted: #9aa4b7;
  --soft: #c6cedb;
  --coral: #ff6d83;
  --cyan: #65e4ee;
  --green: #55d59b;
  --amber: #f5bd63;
  --blue: #7f8cff;
  --danger: #ff7272;
  --violet: #b485ff;
  --shadow: 0 22px 80px rgba(0, 0, 0, 0.42);
  --glow: 0 0 30px rgba(101, 228, 238, 0.1), 0 0 52px rgba(255, 109, 131, 0.06);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 12%, rgba(101, 228, 238, 0.22), transparent 32%),
    radial-gradient(circle at 82% 22%, rgba(245, 189, 99, 0.14), transparent 30%),
    linear-gradient(180deg, #0c121c 0%, #111018 48%, #080a10 100%);
  display: grid;
  grid-template-columns: 280px 1fr;
  letter-spacing: 0;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(101, 228, 238, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 109, 131, 0.045) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.62), transparent 78%);
  animation: gridDrift 26s linear infinite;
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  inset: -12vh -10vw;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(7, 9, 13, 0.08), rgba(7, 9, 13, 0.58)),
    url("/assets/blitz-flow.svg") center / cover no-repeat;
  opacity: 0.78;
  transform: translate3d(0, 0, 0) scale(1.04);
  animation: backgroundFlow 26s ease-in-out infinite alternate;
  z-index: 0;
}

@keyframes gridDrift {
  to { background-position: 54px 54px; }
}

@keyframes backgroundFlow {
  0% { transform: translate3d(-2vw, -1.4vh, 0) scale(1.05); filter: hue-rotate(0deg) saturate(1.2) brightness(1.05); }
  50% { transform: translate3d(1.6vw, 2.2vh, 0) scale(1.09); filter: hue-rotate(18deg) saturate(1.38) brightness(1.16); }
  100% { transform: translate3d(-0.8vw, 2.8vh, 0) scale(1.065); filter: hue-rotate(-12deg) saturate(1.28) brightness(1.1); }
}

.sidebar {
  z-index: 2;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 26px 18px;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(18, 22, 31, 0.82), rgba(10, 13, 19, 0.9)),
    var(--bg-2);
  backdrop-filter: blur(18px);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.03);
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 34px;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(101, 228, 238, 0.16), rgba(255, 109, 131, 0.12), rgba(245, 189, 99, 0.1)),
    rgba(255, 255, 255, 0.045);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  overflow: hidden;
  background: #090d14;
  box-shadow: 0 12px 30px rgba(255, 138, 116, 0.18);
  animation: brandPulse 4.8s ease-in-out infinite;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
}

@keyframes brandPulse {
  0%, 100% { box-shadow: 0 12px 30px rgba(255, 138, 116, 0.18); }
  50% { box-shadow: 0 12px 38px rgba(101, 228, 238, 0.24); }
}

.brand strong {
  display: block;
  font-size: 21px;
  line-height: 1.1;
}

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

nav {
  display: grid;
  gap: 7px;
}

nav a {
  display: flex;
  align-items: center;
  min-height: 46px;
  color: var(--muted);
  text-decoration: none;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
  border-color: var(--line);
  transform: translateX(2px);
}

nav a.active {
  color: var(--text);
  background: linear-gradient(90deg, rgba(127, 140, 255, 0.26), rgba(101, 228, 238, 0.12), rgba(245, 189, 99, 0.08));
  border-color: rgba(127, 140, 255, 0.42);
  box-shadow: inset 3px 0 0 var(--cyan);
}

nav a::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.45;
  box-shadow: 0 0 16px currentColor;
}

main {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1520px;
  display: grid;
  gap: 26px;
  padding: 42px;
}

h1, h2, p { margin: 0; }

h1 {
  font-size: 46px;
  line-height: 1;
  letter-spacing: 0;
  text-wrap: balance;
}

h2 {
  font-size: 19px;
  line-height: 1.2;
}

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

.topbar p,
.fineprint,
.panel-head span {
  color: var(--muted);
}

.topbar p {
  margin-top: 8px;
  font-size: 17px;
}

.topbar-tags,
.trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.topbar-tags {
  margin-top: 16px;
}

.topbar-tags span,
.trust-strip span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 6px 9px;
  border: 1px solid rgba(214, 225, 247, 0.14);
  border-radius: 999px;
  color: #d7fbff;
  background: rgba(8, 11, 16, 0.44);
  font-size: 12px;
  font-weight: 900;
}

.health {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(85, 213, 155, 0.12), rgba(101, 228, 238, 0.05)),
    rgba(18, 22, 31, 0.78);
  box-shadow: var(--shadow), var(--glow);
}

#mode-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(85, 213, 155, 0.12);
}

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

.panel {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(101, 228, 238, 0.1), rgba(255, 109, 131, 0.055) 44%, rgba(245, 189, 99, 0.06)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.012)),
    rgba(16, 21, 32, 0.82);
  border: 1px solid rgba(214, 225, 247, 0.2);
  border-radius: var(--radius);
  box-shadow: var(--shadow), var(--glow);
  padding: 24px;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.panel:hover {
  transform: translateY(-2px);
  border-color: rgba(101, 228, 238, 0.24);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.46), 0 0 42px rgba(101, 228, 238, 0.14), 0 0 70px rgba(255, 109, 131, 0.08);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(101, 228, 238, 0.48), rgba(255, 109, 131, 0.34), transparent);
  pointer-events: none;
  animation: panelLine 6s ease-in-out infinite;
}

.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 0%, rgba(255, 255, 255, 0.055) 44%, transparent 58%);
  transform: translateX(-120%);
  animation: panelSweep 11s ease-in-out infinite;
}

@keyframes panelLine {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

@keyframes panelSweep {
  0%, 72% { transform: translateX(-120%); }
  100% { transform: translateX(120%); }
}

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

.panel-head span {
  display: block;
  margin-top: 4px;
}

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

.form-panel {
  border-color: rgba(101, 228, 238, 0.26);
}

.subscription-mini {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid rgba(101, 228, 238, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(101, 228, 238, 0.08), rgba(245, 189, 99, 0.06)),
    rgba(8, 11, 16, 0.62);
}

.subscription-mini strong {
  color: var(--text);
}

.subscription-mini span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.subscription-mini a {
  color: #d7fbff;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent),
    rgba(5, 8, 13, 0.86);
  color: var(--text);
  border-radius: 8px;
  padding: 13px 14px;
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

input::placeholder { color: rgba(154, 164, 183, 0.62); }

input:focus,
select:focus {
  outline: 2px solid rgba(101, 228, 238, 0.22);
  border-color: rgba(101, 228, 238, 0.72);
}

.route-grid {
  display: grid;
  grid-template-columns: 1fr 46px 1fr;
  gap: 12px;
  align-items: center;
}

.asset-route-grid {
  align-items: stretch;
}

.asset-field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

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

.asset-picker {
  position: relative;
  min-width: 0;
}

.asset-picker-trigger {
  width: 100%;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  text-align: left;
  border-color: rgba(214, 225, 247, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018)),
    rgba(18, 22, 31, 0.76);
}

.asset-picker-current {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.asset-picker-current span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.asset-picker-current strong,
.asset-picker-current small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-picker-current strong {
  color: var(--text);
  font-size: 18px;
  line-height: 1;
}

.asset-picker-current small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.asset-picker-caret {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(101, 228, 238, 0.08);
  transition: transform 0.16s ease;
}

.asset-picker-caret::before {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--cyan);
  border-bottom: 2px solid var(--cyan);
  transform: translateY(-1px) rotate(45deg);
}

.asset-picker.open .asset-picker-caret {
  transform: rotate(180deg);
}

.asset-picker-panel {
  z-index: 4;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  display: none;
  gap: 9px;
  padding: 10px;
  border: 1px solid rgba(101, 228, 238, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(101, 228, 238, 0.12), rgba(255, 109, 131, 0.08)),
    rgba(10, 13, 19, 0.98);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.48), var(--glow);
}

.asset-picker.open .asset-picker-panel {
  display: grid;
}

.asset-search {
  min-height: 40px;
  padding: 9px 10px;
}

.asset-choice-list {
  max-height: 264px;
  overflow-y: auto;
  display: grid;
  gap: 7px;
}

.asset-choice {
  min-width: 0;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  padding: 8px 10px;
  text-align: left;
}

.asset-choice[hidden] {
  display: none;
}

.asset-choice span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.asset-choice strong,
.asset-choice small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-choice strong {
  color: var(--text);
  font-size: 14px;
  line-height: 1;
}

.asset-choice small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.asset-choice.selected {
  border-color: rgba(101, 228, 238, 0.64);
  background:
    linear-gradient(135deg, rgba(101, 228, 238, 0.18), rgba(85, 213, 155, 0.08), rgba(245, 189, 99, 0.08)),
    rgba(8, 11, 16, 0.82);
  box-shadow: inset 0 0 0 1px rgba(101, 228, 238, 0.16), 0 12px 30px rgba(0, 0, 0, 0.22);
}

.route-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(101, 228, 238, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(101, 228, 238, 0.08), rgba(255, 109, 131, 0.055)),
    rgba(8, 11, 16, 0.58);
}

.asset-route,
.amount-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.asset-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  min-height: 30px;
  padding: 5px 10px 5px 6px;
  border: 1px solid rgba(214, 225, 247, 0.18);
  border-radius: 999px;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.018)),
    rgba(8, 11, 16, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  font-size: 13px;
  font-weight: 950;
  line-height: 1;
}

.asset-logo {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.06), 0 10px 20px rgba(0, 0, 0, 0.18);
}

.asset-fallback {
  color: #fff;
  font-size: 12px;
  font-weight: 950;
  background: linear-gradient(135deg, #65e4ee, #7f8cff);
}

.route-arrow {
  color: var(--cyan);
  font-weight: 950;
}

button,
.button-link {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.018)), var(--panel-2);
  padding: 11px 15px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

button:hover,
.button-link:hover {
  border-color: rgba(101, 228, 238, 0.62);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

button:active,
.button-link:active {
  transform: translateY(0);
}

.primary {
  color: #090c12;
  border-color: transparent;
  background: linear-gradient(135deg, #65e4ee, #55d59b 32%, #f5bd63 66%, #ff8a74);
  background-size: 180% 180%;
  box-shadow: 0 16px 36px rgba(101, 228, 238, 0.2), 0 0 28px rgba(245, 189, 99, 0.12);
  animation: primaryShift 7s ease-in-out infinite;
}

.form-panel > .primary {
  min-height: 54px;
  margin-top: 2px;
  font-size: 15px;
}

.trust-strip {
  justify-content: center;
}

@keyframes primaryShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.ghost {
  background: rgba(255, 255, 255, 0.025);
}

.icon-button {
  width: 46px;
  height: 46px;
  align-self: center;
  display: grid;
  place-items: center;
  padding: 0;
  color: #edf7ff;
  border-color: rgba(214, 225, 247, 0.22);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.018)),
    rgba(18, 22, 31, 0.72);
  font-size: 21px;
  line-height: 1;
}

.danger-button {
  color: #ffb7b7;
  border-color: rgba(255, 114, 114, 0.52);
  background: rgba(255, 114, 114, 0.1);
}

.hidden {
  display: none !important;
}

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

.admin-shell {
  display: grid;
  gap: 22px;
}

.admin-login {
  max-width: 520px;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-toolbar > div:first-child {
  display: grid;
  gap: 4px;
}

.admin-toolbar strong {
  font-size: 18px;
}

.admin-toolbar span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

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

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

.admin-card {
  display: grid;
  align-content: start;
  gap: 16px;
  min-height: 190px;
}

.admin-card-wide {
  grid-column: span 2;
}

.admin-metric {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid rgba(214, 225, 247, 0.16);
  border-radius: 8px;
  background: rgba(8, 11, 16, 0.54);
}

.admin-metric span,
.health-check p {
  color: var(--muted);
}

.admin-metric strong {
  font-size: 30px;
  line-height: 1;
}

.secret-box {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(101, 228, 238, 0.3);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(101, 228, 238, 0.12), rgba(85, 213, 155, 0.08)),
    rgba(8, 11, 16, 0.68);
}

.secret-box span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.secret-box strong {
  color: #d7fbff;
  font-size: 22px;
  overflow-wrap: anywhere;
}

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

.health-check {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid rgba(214, 225, 247, 0.13);
  border-radius: 8px;
  background: rgba(8, 11, 16, 0.48);
}

.health-check > span {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(85, 213, 155, 0.1);
}

.health-check.bad > span {
  background: var(--danger);
  box-shadow: 0 0 0 5px rgba(255, 114, 114, 0.1);
}

.admin-filters {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 220px;
  gap: 12px;
  margin-bottom: 14px;
}

.action-list,
.audit-list {
  display: grid;
  gap: 10px;
}

.action-item,
.audit-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(214, 225, 247, 0.13);
  border-radius: 8px;
  background: rgba(8, 11, 16, 0.48);
}

.action-item > div,
.audit-item {
  min-width: 0;
}

.action-item strong,
.audit-item strong {
  display: block;
  overflow-wrap: anywhere;
}

.action-item span,
.action-item small,
.audit-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  margin-top: 4px;
}

.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(214, 225, 247, 0.14);
  border-radius: 8px;
  background: rgba(8, 11, 16, 0.5);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

.admin-table th,
.admin-table td {
  padding: 13px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(214, 225, 247, 0.1);
  white-space: nowrap;
}

.admin-table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.admin-table td {
  color: var(--soft);
  font-weight: 760;
}

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

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

.quote-panel {
  width: 100%;
  min-width: 0;
  min-height: 480px;
  display: grid;
  align-items: start;
  justify-items: stretch;
  border-color: rgba(127, 140, 255, 0.22);
}

.empty-state,
.quote-loading {
  min-height: 420px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 13px;
  text-align: center;
  color: var(--muted);
}

.empty-state h2,
.quote-loading h2 {
  color: var(--text);
}

.pulse {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(101, 228, 238, 0.34), rgba(85, 213, 155, 0.22), rgba(255, 109, 131, 0.18)),
    rgba(127, 140, 255, 0.22);
  border: 1px solid rgba(101, 228, 238, 0.38);
  transform: rotate(45deg);
  animation: pulseTile 3.8s ease-in-out infinite;
}

@keyframes pulseTile {
  0%, 100% { transform: rotate(45deg) scale(1); opacity: 0.8; }
  50% { transform: rotate(45deg) scale(1.08); opacity: 1; }
}

.quote-loading strong {
  color: var(--text);
  font-size: 30px;
}

.loader-ring {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 6px solid rgba(101, 228, 238, 0.14);
  border-top-color: var(--cyan);
  animation: spin 1s linear infinite;
}

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

.quote-card {
  width: 100%;
  min-width: 0;
  display: grid;
  gap: 18px;
}

.quote-card > .panel-head {
  margin-bottom: 2px;
}

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

.quote-confirmation {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(101, 228, 238, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(101, 228, 238, 0.1), rgba(85, 213, 155, 0.07), rgba(245, 189, 99, 0.07)),
    rgba(8, 11, 16, 0.68);
}

.quote-confirmation > strong {
  grid-column: 1 / -1;
  font-size: 18px;
}

.quote-confirmation div {
  min-width: 0;
  display: grid;
  gap: 6px;
  padding: 13px;
  border: 1px solid rgba(214, 225, 247, 0.14);
  border-radius: 8px;
  background: rgba(8, 11, 16, 0.48);
}

.quote-confirmation span,
.quote-confirmation small,
.metric small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.quote-confirmation b {
  overflow-wrap: anywhere;
  font-size: 19px;
}

.metric,
.status-card > div,
.history-stats > div {
  background:
    linear-gradient(145deg, rgba(101, 228, 238, 0.06), rgba(255, 109, 131, 0.035) 55%, rgba(245, 189, 99, 0.04)),
    rgba(8, 11, 16, 0.74);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.metric:hover,
.status-card > div:hover,
.history-stats > div:hover {
  transform: translateY(-1px);
  border-color: rgba(245, 189, 99, 0.28);
}

.metric span,
.status-card span,
.history-stats span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.metric strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 20px;
  line-height: 1.18;
}

.metric .asset-pill {
  margin-top: 9px;
}

.metric small {
  display: block;
  margin-top: 8px;
}

.deposit-box {
  display: grid;
  min-width: 0;
  gap: 12px;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(101, 228, 238, 0.07), rgba(127, 140, 255, 0.05), rgba(255, 109, 131, 0.04)),
    rgba(8, 11, 16, 0.74);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.address {
  overflow-wrap: anywhere;
  color: #d7fbff;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 18px;
}

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

.status-search {
  display: grid;
  grid-template-columns: 1fr 140px;
  align-items: end;
  gap: 13px;
  margin-bottom: 16px;
}

.status-summary {
  margin-bottom: 16px;
}

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

.status-card strong,
.history-stats strong {
  overflow-wrap: anywhere;
  font-size: 18px;
}

.empty-inline {
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  padding: 16px;
  background: rgba(8, 11, 16, 0.42);
}

.timeline {
  display: grid;
  gap: 10px;
}

.step {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  padding: 14px;
  background:
    linear-gradient(90deg, rgba(245, 189, 99, 0.055), transparent 42%),
    rgba(8, 11, 16, 0.68);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.step-dot {
  width: 11px;
  height: 11px;
  flex: 0 0 auto;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 5px rgba(245, 189, 99, 0.1);
}

.step.done .step-dot,
.step.SUCCESS .step-dot {
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(85, 213, 155, 0.1);
}

.step.done,
.step.SUCCESS {
  background:
    linear-gradient(90deg, rgba(85, 213, 155, 0.08), transparent 46%),
    rgba(8, 11, 16, 0.68);
}

.step.pending {
  opacity: 0.62;
}

.step.pending .step-dot {
  background: var(--line-strong);
  box-shadow: none;
}

.step.failed .step-dot,
.step.FAILED .step-dot,
.step.REFUNDED .step-dot,
.step.CANCELED .step-dot,
.step.EXPIRED .step-dot {
  background: var(--danger);
  box-shadow: 0 0 0 5px rgba(255, 114, 114, 0.1);
}

.step span,
.step small {
  display: block;
  color: var(--muted);
}

.step span {
  margin-top: 4px;
  font-size: 13px;
}

.step small {
  margin-top: 7px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

table {
  width: 100%;
  border-collapse: collapse;
  background:
    linear-gradient(145deg, rgba(127, 140, 255, 0.035), transparent 42%),
    rgba(8, 11, 16, 0.42);
}

th,
td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

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

td small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

tbody tr[data-id] {
  cursor: pointer;
}

tbody tr[data-id]:hover {
  background: rgba(101, 228, 238, 0.045);
}

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

.history-actions select {
  min-width: 190px;
}

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

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

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

.plan-card {
  display: grid;
  gap: 12px;
  min-height: 210px;
  align-content: start;
  text-align: left;
}

.plan-card strong {
  font-size: 42px;
  line-height: 1;
}

.selectable-plan {
  cursor: pointer;
}

.selectable-plan:hover,
.selectable-plan.selected {
  border-color: rgba(101, 228, 238, 0.55);
  transform: translateY(-2px);
}

.plan-kicker {
  width: fit-content;
  padding: 7px 10px;
  border: 1px solid rgba(101, 228, 238, 0.22);
  border-radius: 999px;
  color: #d7fbff;
  background: rgba(101, 228, 238, 0.08);
  font-size: 12px;
  font-weight: 950;
}

.featured-plan {
  border-color: rgba(245, 189, 99, 0.38);
  background:
    linear-gradient(145deg, rgba(245, 189, 99, 0.15), rgba(101, 228, 238, 0.08) 46%, rgba(255, 109, 131, 0.08)),
    rgba(16, 21, 32, 0.8);
}

.subscription-panel {
  max-width: 860px;
}

.subscription-payments {
  display: grid;
  gap: 18px;
}

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

.subscription-steps span {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(4, 7, 12, 0.48);
  font-size: 12px;
  font-weight: 950;
}

.subscription-steps span.active {
  color: #d7fbff;
  border-color: rgba(101, 228, 238, 0.34);
  background: rgba(101, 228, 238, 0.1);
}

.payment-flow,
.payment-options {
  display: grid;
  gap: 16px;
}

.payment-empty {
  min-height: 180px;
  display: grid;
  place-content: center;
  gap: 8px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(4, 7, 12, 0.52);
}

.payment-empty p {
  color: var(--muted);
}

.payment-flow-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1px solid rgba(101, 228, 238, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(101, 228, 238, 0.1), rgba(255, 109, 131, 0.06)),
    rgba(8, 11, 16, 0.66);
}

.payment-flow-head div {
  display: grid;
  gap: 5px;
}

.payment-flow-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.payment-flow-head strong {
  font-size: 24px;
}

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

.crypto-choice {
  display: grid;
  min-height: 128px;
  place-items: center;
  gap: 8px;
  padding: 16px;
}

.crypto-choice img {
  width: 42px;
  height: 42px;
}

.crypto-choice span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.payment-invoice {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(4, 7, 12, 0.7);
}

.payment-plan {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(101, 228, 238, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(101, 228, 238, 0.08), rgba(255, 109, 131, 0.05)),
    rgba(8, 11, 16, 0.6);
}

.payment-plan-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.payment-plan-head div {
  display: grid;
  gap: 5px;
}

.payment-plan-head span,
.payment-wallet span,
.payment-invoice span,
.subscription-code-box span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.payment-plan-head strong {
  font-size: 24px;
}

.payment-plan-head b {
  color: #d7fbff;
}

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

.payment-wallet {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(4, 7, 12, 0.7);
}

.payment-asset {
  display: flex;
  align-items: center;
  gap: 8px;
}

.payment-asset img {
  width: 26px;
  height: 26px;
}

.payment-wallet code,
.payment-invoice code {
  display: block;
  overflow: hidden;
  color: #d7fbff;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.payment-actions button {
  min-height: 40px;
  padding: 8px 10px;
  font-size: 13px;
}

.subscription-code-box {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(85, 213, 155, 0.28);
  border-radius: 8px;
  background: rgba(85, 213, 155, 0.08);
}

.subscription-code-box strong {
  color: #d7fbff;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 24px;
}

.danger-text {
  color: #ffc1c1;
}

.subscription-form {
  grid-template-columns: 1fr 180px;
  align-items: end;
}

.subscription-status {
  margin-top: 16px;
}

.subscription-current {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(85, 213, 155, 0.08), rgba(101, 228, 238, 0.05)),
    rgba(8, 11, 16, 0.66);
}

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

.subscription-current strong {
  font-size: 24px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(154, 164, 183, 0.12);
  color: var(--soft);
  font-size: 12px;
  font-weight: 900;
}

.status-pill.SUCCESS {
  background: rgba(85, 213, 155, 0.15);
  color: #a8f5d2;
}

.status-pill.PROCESSING,
.status-pill.KNOWN_DEPOSIT_TX {
  background: rgba(245, 189, 99, 0.15);
  color: #ffdca8;
}

.status-pill.FAILED,
.status-pill.REFUNDED,
.status-pill.CANCELED,
.status-pill.EXPIRED {
  background: rgba(255, 114, 114, 0.15);
  color: #ffc1c1;
}

.link-button {
  min-height: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: #d7fbff;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.toast {
  z-index: 5;
  position: fixed;
  right: 22px;
  bottom: 22px;
  min-width: 280px;
  max-width: min(440px, calc(100vw - 32px));
  padding: 13px 15px;
  color: var(--text);
  background: rgba(13, 17, 24, 0.94);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1180px) {
  body {
    grid-template-columns: 230px 1fr;
  }

  main {
    padding: 30px;
  }

  .workspace,
  .quote-summary,
  .quote-confirmation,
  .status-card,
  .history-stats,
  .stats-grid,
  .admin-grid,
  .admin-split,
  .plans-grid {
    grid-template-columns: 1fr;
  }

  .admin-card-wide {
    grid-column: auto;
  }

  .admin-toolbar,
  .action-item {
    align-items: stretch;
    flex-direction: column;
  }

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

  .payment-wallets {
    grid-template-columns: 1fr;
  }

  .crypto-choice-grid,
  .subscription-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .payment-flow-head {
    display: grid;
  }

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

@media (max-width: 760px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 16px;
  }

  .brand {
    margin-bottom: 14px;
  }

  nav {
    grid-template-columns: repeat(5, 1fr);
  }

  nav a {
    justify-content: center;
    min-height: 42px;
    padding: 9px 8px;
  }

  nav a::before {
    display: none;
  }

  main {
    padding: 22px 16px;
  }

  h1 {
    font-size: 32px;
  }

  .topbar-tags,
  .trust-strip {
    gap: 6px;
  }

  .topbar,
  .panel-head,
  .history-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .status-search,
  .route-grid,
  .plans-grid,
  .subscription-form {
    grid-template-columns: 1fr;
  }

  .asset-picker-panel {
    position: static;
    margin-top: 8px;
  }

  .subscription-mini {
    align-items: flex-start;
    flex-direction: column;
  }
}
