@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap");

:root {
  color-scheme: light;
  --bg-1: #fff6ed;
  --bg-2: #ffe8d5;
  --ink: #333333;
  --muted: #6b7280;
  --card: rgba(255, 255, 255, 0.88);
  --line: rgba(31, 41, 55, 0.12);
  --accent: #ff7a00;
  --accent-2: #ffb266;
  --accent-3: #ffb266;
  --danger: #b91c1c;
  --shadow: 0 20px 60px rgba(15, 23, 42, 0.12);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(1200px 800px at 8% 10%, #fff6ed, transparent 60%),
    radial-gradient(900px 700px at 90% 15%, #ffe8d5, transparent 60%),
    linear-gradient(160deg, var(--bg-1), var(--bg-2));
  min-height: 100vh;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto auto 10% -12%;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle at 30% 30%, rgba(255, 122, 0, 0.18), transparent 70%);
  filter: blur(4px);
  z-index: 0;
  animation: float 14s ease-in-out infinite;
  pointer-events: none;
}

body::after {
  inset: -8% -12% auto auto;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle at 70% 30%, rgba(255, 178, 102, 0.22), transparent 70%);
  animation-delay: -4s;
}

.app {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 24px 80px;
}

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

.brand h1 {
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  font-size: 32px;
  margin: 0 0 6px;
}

.brand p {
  margin: 0;
  color: var(--muted);
}

.token-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  min-width: 320px;
}

.grid {
  display: grid;
  gap: 18px;
}

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

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

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  animation: rise 0.5s ease both;
}

.card h2,
.card h3 {
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  margin: 0 0 10px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.field label {
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}

.input,
.select,
.textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.9);
}

.custom-select {
  position: relative;
  width: 100%;
}

.custom-select-native {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
}

.custom-select-trigger {
  position: relative;
  width: 100%;
  padding: 12px 48px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.custom-select-trigger:hover {
  border-color: rgba(255, 122, 0, 0.22);
}

.custom-select.is-open .custom-select-trigger,
.custom-select-trigger:focus-visible {
  outline: none;
  border-color: rgba(255, 122, 0, 0.32);
  box-shadow: 0 0 0 4px rgba(255, 122, 0, 0.1);
}

.custom-select-trigger:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.custom-select-current {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select-arrow {
  position: absolute;
  top: 50%;
  right: 16px;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.18s ease;
  pointer-events: none;
}

.custom-select.is-open .custom-select-arrow {
  transform: translateY(-30%) rotate(-135deg);
}

.custom-select-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 30;
  padding: 8px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.custom-select-options {
  display: grid;
  gap: 6px;
  max-height: 280px;
  overflow-y: auto;
}

.custom-select-option {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(31, 41, 55, 0.08);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 247, 240, 0.94));
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.custom-select-option:hover,
.custom-select-option:focus-visible {
  outline: none;
  transform: translateY(-1px);
  border-color: rgba(255, 122, 0, 0.24);
}

.custom-select-option:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.custom-select-option.is-selected {
  border-color: rgba(255, 122, 0, 0.28);
  background: linear-gradient(180deg, rgba(255, 244, 235, 0.98), rgba(255, 235, 214, 0.94));
}

.custom-select-option-label {
  display: block;
  color: var(--ink);
  font-weight: 600;
}

.custom-select-option-note {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.custom-select-empty {
  padding: 12px;
  border-radius: 12px;
  color: var(--muted);
  background: rgba(255, 247, 240, 0.86);
}

.textarea {
  min-height: 90px;
  resize: vertical;
}

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

.btn {
  appearance: none;
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  background: var(--accent);
  color: white;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 12px 22px rgba(255, 122, 0, 0.25);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn.secondary {
  background: var(--accent-3);
  box-shadow: 0 12px 22px rgba(255, 178, 102, 0.25);
}

.btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
}

.btn.warn {
  background: var(--accent-2);
  box-shadow: 0 12px 22px rgba(255, 178, 102, 0.25);
}

.btn.danger {
  background: var(--danger);
  box-shadow: 0 12px 22px rgba(185, 28, 28, 0.2);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.status {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  background: rgba(255, 122, 0, 0.12);
  color: var(--accent);
}

.status.error {
  background: rgba(185, 28, 28, 0.12);
  color: var(--danger);
}

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

.table th,
.table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
}

.table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: rgba(255, 122, 0, 0.12);
  color: var(--accent);
}

.chip.orange {
  background: rgba(255, 178, 102, 0.22);
  color: #9a4c00;
}

.chip.blue {
  background: rgba(255, 178, 102, 0.18);
  color: #9a4c00;
}

.chip.gray {
  background: rgba(107, 114, 128, 0.16);
  color: #374151;
}

.metric {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line);
}

.metric strong {
  font-size: 18px;
}

.pillbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 12px 0;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(18px);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .grid.cols-2,
  .grid.cols-3 {
    grid-template-columns: 1fr;
  }

  .token-panel {
    width: 100%;
  }
}
