:root {
  color-scheme: light;
  --ink: oklch(0.22 0.018 248);
  --muted: oklch(0.52 0.022 248);
  --soft: oklch(0.64 0.018 248);
  --line: oklch(0.88 0.014 248);
  --line-strong: oklch(0.81 0.018 248);
  --paper: oklch(0.975 0.006 248);
  --panel: oklch(0.995 0.004 248);
  --wash: oklch(0.95 0.012 248);
  --nav: oklch(0.965 0.018 205);
  --nav-soft: oklch(0.91 0.026 205);
  --accent: oklch(0.64 0.12 190);
  --accent-strong: oklch(0.47 0.11 190);
  --blue: oklch(0.56 0.16 255);
  --green: oklch(0.49 0.12 155);
  --amber: oklch(0.58 0.12 74);
  --red: oklch(0.52 0.15 28);
  --shadow: 0 18px 48px oklch(0.27 0.02 248 / 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(180deg, oklch(0.94 0.012 220), oklch(0.97 0.006 248) 42%),
    var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.shell {
  min-height: 100vh;
  padding: 22px;
}

.workspace {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  max-width: 1320px;
  min-height: calc(100vh - 44px);
  margin: 0 auto;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.rail {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 24px 18px;
  background: var(--nav);
  color: var(--ink);
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 4px;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--accent);
  color: oklch(0.19 0.025 222);
  font-weight: 850;
}

.brand strong,
.brand span {
  display: block;
}

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

.steps {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.step {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 56px;
  padding: 10px;
  color: var(--muted);
  background: oklch(0.99 0.004 248 / 0.72);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.step > span {
  display: grid;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  background: var(--wash);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.step strong,
.step small {
  display: block;
}

.step strong {
  color: var(--ink);
  font-size: 14px;
}

.step small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.step.is-active {
  color: var(--ink);
  background: oklch(0.945 0.032 190);
  border-color: oklch(0.72 0.087 190);
}

.step.is-active > span {
  background: var(--accent);
  color: oklch(0.18 0.026 222);
}

.provider-card {
  margin-top: auto;
  padding: 14px;
  background: oklch(0.99 0.004 248 / 0.75);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.provider-card span,
.provider-card strong {
  display: block;
}

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

.provider-card strong {
  margin-top: 6px;
  color: var(--ink);
}

.panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
  background: var(--paper);
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 30px 32px 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

h1,
h2,
p {
  margin-top: 0;
}

h1,
h2 {
  margin-bottom: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 720px;
  font-size: 34px;
  line-height: 1.12;
}

h2 {
  font-size: 17px;
  line-height: 1.25;
}

.lede {
  max-width: 720px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.icon-button {
  display: grid;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  place-items: center;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.icon-button:hover {
  color: var(--ink);
  background: var(--wash);
}

.icon-button:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid oklch(0.76 0.1 190 / 0.38);
  outline-offset: 2px;
}

.icon-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.user-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: end;
  padding: 18px 32px;
  background: oklch(0.965 0.019 190);
  border-bottom: 1px solid oklch(0.86 0.033 190);
}

label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

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

input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input:focus {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 3px oklch(0.76 0.1 190 / 0.18);
}

#statusButton,
#addressButton,
#broadcastButton,
#evmTransactionButton,
#solanaTransactionButton {
  min-height: 42px;
  padding: 0 15px;
  color: oklch(0.98 0.004 248);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  font-weight: 750;
  white-space: nowrap;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

#statusButton:hover,
#addressButton:hover,
#broadcastButton:hover,
#evmTransactionButton:hover,
#solanaTransactionButton:hover {
  background: oklch(0.28 0.02 248);
  border-color: oklch(0.28 0.02 248);
}

#statusButton:active,
#addressButton:active,
#broadcastButton:active,
#evmTransactionButton:active,
#solanaTransactionButton:active {
  transform: translateY(1px);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 13px;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 14px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--soft);
}

.status-pill.is-active {
  color: var(--green);
  border-color: oklch(0.78 0.07 155);
}

.status-pill.is-active .dot {
  background: var(--green);
}

.status-pill.is-pending {
  color: var(--amber);
  border-color: oklch(0.78 0.08 74);
}

.status-pill.is-pending .dot {
  background: var(--amber);
}

.status-pill.is-blocked {
  color: var(--red);
  border-color: oklch(0.76 0.09 28);
}

.status-pill.is-blocked .dot {
  background: var(--red);
}

.work-area {
  padding: 20px 32px 18px;
}

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

.mode-tab {
  display: block;
  min-height: 60px;
  padding: 12px 14px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: left;
  box-shadow: none;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.mode-tab:hover {
  background: var(--wash);
  border-color: var(--line-strong);
}

.mode-tab span,
.mode-tab strong {
  display: block;
}

.mode-tab span {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.mode-tab strong {
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mode-tab.is-active {
  background: oklch(0.96 0.023 190);
  border-color: oklch(0.75 0.08 190);
  box-shadow: inset 0 0 0 1px oklch(0.75 0.08 190);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.88fr);
  gap: 18px;
}

.flow-stack,
.review-stack {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
}

.section-block,
.address-card {
  min-width: 0;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.section-heading {
  margin-bottom: 14px;
}

.token-grid,
.network-list {
  display: grid;
  gap: 9px;
}

.token-card,
.network-item {
  display: grid;
  width: 100%;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 12px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.token-card {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.network-item {
  grid-template-columns: minmax(0, 1fr) auto;
}

.token-card:hover,
.network-item:hover {
  background: var(--wash);
  border-color: var(--line-strong);
}

.token-card.is-selected,
.network-item.is-selected {
  background: oklch(0.965 0.021 190);
  border-color: oklch(0.72 0.087 190);
  box-shadow: inset 0 0 0 1px oklch(0.72 0.087 190);
}

.token-card img {
  width: 34px;
  height: 34px;
}

.token-card strong,
.token-card small,
.network-item strong,
.network-item small {
  display: block;
}

.token-card small,
.network-item small {
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.token-rate {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.transaction-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.payload-preview {
  min-height: 280px;
  max-height: 460px;
  margin: 0;
  overflow: auto;
  padding: 14px;
  color: oklch(0.9 0.02 230);
  background: oklch(0.25 0.025 248);
  border: 1px solid oklch(0.33 0.03 248);
  border-radius: var(--radius);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.58;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.summary-list,
.address-details {
  display: grid;
  gap: 12px;
  margin: 0 0 16px;
}

.summary-list div,
.address-details div {
  min-width: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.summary-list div:last-child,
.address-details div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.summary-list dt,
.address-details dt {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.summary-list dd,
.address-details dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.address-details dd {
  display: flex;
  align-items: center;
  gap: 8px;
}

.address-card {
  background: oklch(0.985 0.005 248);
}

.qr {
  display: grid;
  width: min(100%, 184px);
  aspect-ratio: 1;
  place-items: center;
  margin-bottom: 16px;
  background:
    linear-gradient(90deg, var(--ink) 8px, transparent 8px) 0 0 / 20px 20px,
    linear-gradient(var(--ink) 8px, transparent 8px) 0 0 / 20px 20px,
    var(--panel);
  border: 10px solid var(--panel);
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 1px var(--line), 0 8px 24px oklch(0.27 0.02 248 / 0.1);
}

.qr::after {
  content: "QR";
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  color: oklch(0.19 0.025 222);
  background: var(--accent);
  border-radius: var(--radius);
  font-weight: 850;
}

code {
  min-width: 0;
  color: inherit;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.copy-button {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 10px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 750;
}

.copy-button:hover {
  background: var(--wash);
}

.warning {
  margin: 16px 0 0;
  padding: 12px;
  color: oklch(0.42 0.095 74);
  background: oklch(0.94 0.04 74);
  border: 1px solid oklch(0.82 0.07 74);
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.5;
}

.log {
  min-height: 42px;
  margin-top: auto;
  padding: 10px 32px 18px;
  color: var(--muted);
  font-size: 13px;
}

.log strong {
  color: var(--ink);
}

[hidden] {
  display: none !important;
}

@media (max-width: 980px) {
  .shell {
    padding: 0;
  }

  .workspace {
    grid-template-columns: 1fr;
    min-height: 100vh;
    border: 0;
    border-radius: 0;
  }

  .rail {
    gap: 18px;
    padding: 18px;
  }

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

  .step {
    min-height: 0;
    align-items: flex-start;
  }

  .step small {
    display: none;
  }

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

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

@media (max-width: 680px) {
  .topbar,
  .user-strip,
  .work-area,
  .log {
    padding-left: 16px;
    padding-right: 16px;
  }

  .topbar,
  .user-strip {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }

  h1 {
    font-size: 28px;
  }

  .mode-tabs {
    grid-template-columns: 1fr;
  }

  .input-row,
  .address-details dd {
    flex-direction: column;
    align-items: stretch;
  }

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