:root {
  color-scheme: dark;
  --accent: #f4811d;
  --accent-strong: #ff9a3d;
  --accent-soft: rgba(244, 129, 29, 0.14);
  --accent-border: rgba(244, 129, 29, 0.38);
  --bg: #101214;
  --bg-elevated: #15181b;
  --panel: #181b1f;
  --panel-strong: #1d2125;
  --editor: #111315;
  --line: #2a2e33;
  --line-strong: #3b4148;
  --text: #f2f4f5;
  --muted: #9ba3ac;
  --subtle: #6c747d;
  --success: #39c58b;
  --success-soft: rgba(57, 197, 139, 0.13);
  --danger: #ff6d61;
  --danger-soft: rgba(255, 109, 97, 0.12);
  --warning: #f5c05a;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.26);
  --radius: 7px;
}

body[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f6f7;
  --bg-elevated: #ffffff;
  --panel: #ffffff;
  --panel-strong: #f8f9fa;
  --editor: #f2f3f4;
  --line: #e2e5e8;
  --line-strong: #cdd2d7;
  --text: #1d2329;
  --muted: #65707a;
  --subtle: #5f6b75;
  --shadow: 0 18px 48px rgba(23, 30, 36, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  transition: background-color 180ms ease, color 180ms ease;
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
  touch-action: manipulation;
}

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

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

svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.9;
}

:focus-visible {
  outline: 3px solid rgba(244, 129, 29, 0.6);
  outline-offset: 2px;
}

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: env(safe-area-inset-top) 5vw 0;
  border-bottom: 1px solid var(--line);
  background: rgba(16, 18, 20, 0.9);
  backdrop-filter: blur(16px);
}

body[data-theme="light"] .topbar {
  background: rgba(245, 246, 247, 0.9);
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  overflow: hidden;
  border: 1px solid var(--accent-border);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
}

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

.brand-mark.is-fallback::after {
  content: attr(data-fallback);
  font-size: 11px;
  font-weight: 800;
}

.brand-mark svg {
  width: 18px;
  height: 18px;
}

.brand-copy {
  display: grid;
  gap: 0;
  line-height: 1.15;
}

.brand-copy strong {
  font-size: 15px;
  font-weight: 760;
}

.brand-copy small {
  margin-top: 3px;
  color: var(--subtle);
  font-size: 11px;
}

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

.network-pill,
.review-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 31px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.network-pill.is-wrong {
  border-color: rgba(255, 109, 97, 0.35);
  color: var(--danger);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--subtle);
}

.network-pill.is-connected .status-dot {
  background: var(--success);
  box-shadow: 0 0 0 4px var(--success-soft);
}

.network-pill.is-wrong .status-dot {
  background: var(--danger);
  box-shadow: 0 0 0 4px var(--danger-soft);
}

.icon-button,
.chip-copy {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--muted);
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.icon-button:hover,
.chip-copy:hover {
  border-color: var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 680;
  white-space: nowrap;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.button:not(:disabled):active {
  transform: translateY(1px);
}

.button.is-loading svg {
  animation: button-spin 900ms linear infinite;
}

.button-primary {
  background: var(--accent);
  color: #19120c;
  box-shadow: 0 8px 22px rgba(244, 129, 29, 0.16);
}

.button-primary:hover:not(:disabled) {
  background: var(--accent-strong);
}

.button-secondary {
  border-color: var(--line-strong);
  background: var(--panel-strong);
  color: var(--text);
}

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

.button-ghost {
  border-color: var(--line);
  background: transparent;
  color: var(--muted);
}

.button-ghost:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: var(--panel-strong);
  color: var(--text);
}

.button-wide {
  width: 100%;
  min-height: 46px;
  margin-top: 22px;
  font-size: 14px;
}

.page-shell {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 54px 0 32px;
}

.intro-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 780;
  line-height: 1.2;
}

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

h1 {
  margin-bottom: 7px;
  font-size: 40px;
  font-weight: 760;
  line-height: 1.08;
}

h2 {
  margin-bottom: 4px;
  font-size: 16px;
  font-weight: 720;
  line-height: 1.2;
}

.intro-copy,
.section-heading p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.contract-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 0 6px 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--muted);
}

.chip-label {
  color: var(--subtle);
  font-size: 11px;
}

.chip-value {
  color: var(--text);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.chip-copy {
  width: 28px;
  height: 28px;
  border-color: transparent;
  background: transparent;
}

.stepper {
  display: flex;
  align-items: center;
  width: min(590px, 100%);
  margin-bottom: 24px;
}

.step-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--subtle);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.step-number {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--subtle);
  font-size: 10px;
  font-weight: 760;
}

.step-item.is-active,
.step-item.is-complete {
  color: var(--text);
}

.step-item.is-active .step-number,
.step-item.is-complete .step-number {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

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

.step-screen {
  display: none;
}

.step-screen.is-visible {
  display: block;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.33fr) minmax(320px, 0.67fr);
  align-items: start;
  gap: 18px;
}

.main-column {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.review-column {
  min-width: 0;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel:not(.review-panel) {
  padding: 24px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 21px;
}

.section-heading-inline {
  align-items: center;
  justify-content: space-between;
}

.section-heading-copy {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.section-index {
  flex: 0 0 auto;
  color: var(--accent);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  font-weight: 760;
  line-height: 1.3;
}

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

.asset-tab {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 64px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-strong);
  color: var(--muted);
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.asset-tab:hover {
  border-color: var(--accent-border);
}

.asset-tab.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
}

.asset-tab span:last-child {
  display: grid;
  gap: 2px;
}

.asset-tab strong {
  font-size: 13px;
  font-weight: 720;
}

.asset-tab small {
  color: var(--subtle);
  font-size: 11px;
}

.asset-icon {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 50%;
  font-family: Georgia, serif;
  font-size: 15px;
  font-weight: 800;
}

.asset-icon-bnb {
  overflow: hidden;
  background: transparent;
  color: #171717;
}

.asset-icon-bnb img,
.asset-balance-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.asset-icon-bnb.is-fallback {
  background: #f0b90b;
}

.asset-icon-bnb.is-fallback::after {
  content: attr(data-fallback);
}

.asset-icon-token {
  background: var(--accent-soft);
  color: var(--accent);
}

.asset-icon-token svg {
  width: 16px;
  height: 16px;
}

.asset-balance-row,
.token-meta,
.balance-check,
.allowance-check {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 66px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-strong);
}

.asset-balance-icon {
  width: 30px;
  height: 30px;
}

.asset-balance-copy,
.token-meta-main,
.balance-check > div {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.asset-balance-copy span,
.balance-check span,
.token-meta-stats span {
  color: var(--subtle);
  font-size: 11px;
}

.asset-balance-copy strong,
.balance-check strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-balance-symbol {
  margin-left: auto;
  color: var(--accent);
  font-size: 12px;
  font-weight: 780;
}

.is-hidden {
  display: none !important;
}

.token-form {
  display: grid;
  gap: 9px;
}

.field-label-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.field-label {
  color: var(--text);
  font-size: 12px;
  font-weight: 670;
}

.field-hint {
  color: var(--subtle);
  font-size: 11px;
}

.input-with-action {
  display: flex;
  gap: 8px;
}

.text-input {
  min-width: 0;
  flex: 1;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  outline: none;
  background: var(--editor);
  color: var(--text);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.text-input::placeholder,
.recipient-input::placeholder {
  color: var(--subtle);
}

.text-input:focus,
.recipient-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.token-validation {
  min-height: 18px;
  color: var(--subtle);
  font-size: 11px;
}

.token-validation.is-error,
.input-feedback.is-error {
  color: var(--danger);
}

.token-validation.is-success,
.input-feedback.is-success {
  color: var(--success);
}

.token-meta {
  justify-content: space-between;
  gap: 14px;
}

.token-meta-main {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.token-meta-main > div {
  display: grid;
  min-width: 0;
}

.token-meta-main strong {
  overflow: hidden;
  max-width: 230px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.token-meta-main span:last-child {
  color: var(--subtle);
  font-size: 11px;
}

.token-meta-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 13px;
  text-align: right;
}

.token-meta-stats span {
  display: grid;
  gap: 1px;
}

.token-meta-stats strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.recipient-panel {
  min-width: 0;
}

.upload-button {
  flex: 0 0 auto;
}

.editor-frame {
  display: grid;
  grid-template-columns: 43px minmax(0, 1fr);
  min-height: 280px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--editor);
}

.line-numbers {
  overflow: hidden;
  padding: 13px 10px 13px 0;
  border-right: 1px solid var(--line);
  color: var(--subtle);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.85;
  text-align: right;
  user-select: none;
  white-space: pre;
}

.recipient-input {
  width: 100%;
  min-height: 280px;
  resize: vertical;
  padding: 13px 15px;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.85;
  tab-size: 2;
}

.editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding-top: 10px;
}

.format-hint,
.row-counter {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--subtle);
  font-size: 11px;
}

.format-hint svg {
  width: 14px;
  height: 14px;
}

.row-counter {
  flex: 0 0 auto;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.input-feedback {
  min-height: 20px;
  margin-top: 8px;
  font-size: 11px;
}

.review-panel {
  position: sticky;
  top: 96px;
  padding: 22px;
}

.review-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.review-header .eyebrow {
  margin-bottom: 6px;
}

.review-state {
  min-height: 25px;
  padding: 0 8px;
  border-color: var(--line);
  font-size: 10px;
}

.review-state.is-ready {
  border-color: rgba(57, 197, 139, 0.3);
  background: var(--success-soft);
  color: var(--success);
}

.review-state.is-error {
  border-color: rgba(255, 109, 97, 0.3);
  background: var(--danger-soft);
  color: var(--danger);
}

.review-asset-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.review-asset-row > div {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.review-asset-row strong {
  overflow: hidden;
  max-width: 210px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-asset-row span:last-child {
  color: var(--subtle);
  font-size: 11px;
}

.review-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--line);
}

.review-stat {
  display: grid;
  gap: 4px;
  min-height: 80px;
  padding: 14px;
  background: var(--panel-strong);
}

.review-stat:first-child {
  border-radius: 5px 0 0 5px;
}

.review-stat:last-child {
  border-radius: 0 5px 5px 0;
}

.review-stat span {
  color: var(--subtle);
  font-size: 11px;
}

.review-stat strong {
  overflow: hidden;
  color: var(--text);
  font-size: 18px;
  font-weight: 740;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.balance-check,
.allowance-check {
  min-height: 58px;
  margin-top: 10px;
  padding: 10px 12px;
}

.balance-check-icon {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
}

.balance-check-icon svg {
  width: 15px;
  height: 15px;
}

.balance-check > div {
  flex: 1;
}

.balance-status {
  color: var(--subtle);
  font-size: 11px;
  font-weight: 720;
}

.balance-status.is-ok {
  color: var(--success);
}

.balance-status.is-error {
  color: var(--danger);
}

.review-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 19px;
  color: var(--subtle);
  font-size: 11px;
}

.review-note svg {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  color: var(--success);
}

.confirm-layout {
  max-width: 930px;
  margin: 0 auto;
}

.confirm-panel {
  padding: 26px;
}

.confirm-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 19px;
}

.summary-cell {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-strong);
}

.summary-cell span {
  color: var(--subtle);
  font-size: 11px;
}

.summary-cell strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gas-estimate {
  margin-bottom: 19px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-strong);
}

.gas-estimate-header,
.gas-estimate-heading,
.gas-estimate-total {
  display: flex;
  align-items: center;
}

.gas-estimate-header {
  justify-content: space-between;
  gap: 12px;
}

.gas-estimate-heading {
  min-width: 0;
  gap: 9px;
}

.gas-estimate-heading > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.gas-estimate-heading strong {
  font-size: 13px;
  font-weight: 720;
}

.gas-estimate-heading span:last-child {
  color: var(--subtle);
  font-size: 11px;
}

.gas-estimate-icon {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
}

.gas-estimate-icon svg {
  width: 16px;
  height: 16px;
}

.gas-refresh-button {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
}

.gas-refresh-button.is-loading svg {
  animation: button-spin 900ms linear infinite;
}

.gas-estimate-state {
  min-height: 18px;
  margin-top: 11px;
  color: var(--subtle);
  font-size: 11px;
}

.gas-estimate-state.is-progress {
  color: var(--accent);
}

.gas-estimate-state.is-success {
  color: var(--success);
}

.gas-estimate-state.is-error {
  color: var(--danger);
}

.gas-estimate-grid,
.gas-estimate-steps {
  display: grid;
  gap: 1px;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--line);
}

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

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

.gas-estimate-stat,
.gas-estimate-steps > div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 10px 11px;
  background: var(--panel);
}

.gas-estimate-stat:first-child,
.gas-estimate-steps > div:first-child {
  border-radius: 4px 0 0 4px;
}

.gas-estimate-stat:last-child,
.gas-estimate-steps > div:last-child {
  border-radius: 0 4px 4px 0;
}

.gas-estimate-stat span,
.gas-estimate-steps span,
.gas-estimate-total span {
  color: var(--subtle);
  font-size: 10px;
}

.gas-estimate-stat strong,
.gas-estimate-steps strong {
  overflow: hidden;
  color: var(--text);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gas-estimate-total {
  justify-content: space-between;
  gap: 12px;
  margin-top: 11px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

.gas-estimate-total > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.gas-estimate-total span {
  color: var(--text);
  font-size: 11px;
  font-weight: 680;
}

.gas-estimate-total small {
  color: var(--subtle);
  font-size: 10px;
}

.gas-estimate-total > strong {
  flex: 0 0 auto;
  color: var(--accent);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 14px;
  font-weight: 760;
  text-align: right;
}

.confirm-table-wrap {
  overflow: auto;
  max-height: 420px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.confirm-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

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

.confirm-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel-strong);
  color: var(--subtle);
  font-size: 11px;
  font-weight: 680;
}

.confirm-table td {
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 11px;
}

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

.confirm-table th:first-child,
.confirm-table td:first-child {
  width: 54px;
  color: var(--subtle);
  font-family: inherit;
}

.confirm-table .amount-column,
.confirm-table td:last-child {
  width: 150px;
  text-align: right;
}

.confirm-table td:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.confirm-actions,
.success-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.transaction-status {
  min-height: 22px;
  margin-top: 12px;
  color: var(--subtle);
  font-size: 12px;
  text-align: right;
}

.transaction-status.is-error {
  color: var(--danger);
}

.transaction-status.is-progress {
  color: var(--accent);
}

.success-panel {
  display: grid;
  justify-items: center;
  max-width: 640px;
  margin: 24px auto 0;
  padding: 54px 28px;
  text-align: center;
}

.success-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 20px;
  border: 1px solid rgba(57, 197, 139, 0.38);
  border-radius: 50%;
  background: var(--success-soft);
  color: var(--success);
}

.success-icon svg {
  width: 27px;
  height: 27px;
}

.success-panel h2 {
  margin-bottom: 8px;
  font-size: 23px;
}

.success-panel > p:not(.eyebrow) {
  margin-bottom: 22px;
  color: var(--muted);
}

.success-details {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
  width: 100%;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-strong);
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 11px;
}

.success-actions {
  justify-content: center;
  margin-top: 24px;
}

.footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  width: min(1180px, calc(100% - 48px));
  margin: auto auto 0;
  padding: 20px 0 26px;
  color: var(--subtle);
  font-size: 11px;
}

.toast-region {
  position: fixed;
  z-index: 50;
  right: 22px;
  bottom: 22px;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100% - 44px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 12px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 12px;
  animation: toast-in 180ms ease-out;
}

.toast svg {
  flex: 0 0 auto;
  color: var(--accent);
}

.toast.is-error {
  border-color: rgba(255, 109, 97, 0.35);
}

.toast.is-error svg {
  color: var(--danger);
}

.toast.is-success {
  border-color: rgba(57, 197, 139, 0.35);
}

.toast.is-success svg {
  color: var(--success);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@media (max-width: 940px) {
  .topbar {
    padding: env(safe-area-inset-top) 24px 0;
  }

  .page-shell {
    width: min(760px, calc(100% - 34px));
    padding-top: 40px;
  }

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

  .review-column {
    order: -1;
  }

  .review-panel {
    position: static;
  }

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

  .review-note {
    margin-top: 14px;
  }

  .button-wide {
    margin-top: 16px;
  }

  .footer-bar {
    width: min(760px, calc(100% - 34px));
  }
}

@media (max-width: 620px) {
  .topbar {
    min-height: 64px;
    padding: env(safe-area-inset-top) 16px 0;
  }

  .topbar-actions {
    gap: 6px;
  }

  .network-pill {
    display: none;
  }

  .wallet-button {
    min-width: 44px;
    padding: 0 11px;
  }

  .wallet-button span {
    display: none;
  }

  .page-shell {
    width: calc(100% - 24px);
    padding-top: 29px;
  }

  body {
    font-size: 16px;
  }

  h1 {
    font-size: 31px;
  }

  .intro-row {
    display: grid;
    gap: 17px;
    margin-bottom: 24px;
  }

  .intro-copy {
    max-width: 290px;
  }

  .contract-chip {
    width: 100%;
    justify-content: space-between;
  }

  .stepper {
    margin-bottom: 17px;
  }

  .step-item {
    gap: 5px;
    font-size: 10px;
  }

  .step-number {
    width: 22px;
    height: 22px;
    font-size: 9px;
  }

  .step-line {
    margin: 0 7px;
  }

  .panel:not(.review-panel) {
    padding: 18px 15px;
  }

  .review-panel {
    padding: 18px 15px;
  }

  .section-heading-inline {
    align-items: flex-start;
    flex-direction: column;
    gap: 13px;
  }

  .section-heading-copy {
    width: 100%;
  }

  .upload-button {
    width: 100%;
  }

  .input-with-action {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .input-with-action .button {
    padding: 0 12px;
  }

  .input-with-action .button span {
    display: none;
  }

  .input-with-action .button svg {
    margin: 0 2px;
  }

  .text-input,
  .recipient-input {
    font-size: 16px;
  }

  .editor-frame,
  .recipient-input {
    min-height: 235px;
  }

  .editor-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .token-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .token-meta-stats {
    justify-content: flex-start;
    width: 100%;
    text-align: left;
  }

  .confirm-panel {
    padding: 18px 15px;
  }

  .confirm-summary {
    grid-template-columns: 1fr 1fr;
  }

  .summary-cell:last-child {
    grid-column: 1 / -1;
  }

  .gas-estimate {
    padding: 13px;
  }

  .gas-estimate-grid {
    grid-template-columns: 1fr 1fr;
  }

  .gas-estimate-stat:last-child {
    grid-column: 1 / -1;
  }

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

  .gas-estimate-stat:first-child,
  .gas-estimate-steps > div:first-child,
  .gas-estimate-stat:last-child,
  .gas-estimate-steps > div:last-child {
    border-radius: 4px;
  }

  .gas-estimate-total {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .gas-estimate-total > strong {
    text-align: left;
  }

  .confirm-table th,
  .confirm-table td {
    padding: 9px 9px;
  }

  .confirm-table .amount-column,
  .confirm-table td:last-child {
    width: 105px;
  }

  .confirm-actions,
  .success-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .confirm-actions .button,
  .success-actions .button {
    width: 100%;
  }

  .success-panel {
    margin-top: 8px;
    padding: 42px 18px;
  }

  .footer-bar {
    width: calc(100% - 24px);
    padding-bottom: 20px;
    font-size: 10px;
  }
}

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