:root {
  color-scheme: light dark;
  --bg: #f2f0ea;
  --ink: #11130f;
  --muted: #65685f;
  --surface: #faf9f5;
  --line: #cac8be;
  --stellar: #7357ff;
  --ethereum: #3867d6;
  --acid: #c8f24a;
  --danger: #c83c32;
  --warning: #d28a12;
  --shadow: 0 18px 50px rgb(30 33 25 / 10%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
button, input, select { font: inherit; }
a { color: inherit; }
.shell { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 48px 0 80px; }
.hero { display: grid; grid-template-columns: 1.4fr .6fr; gap: 40px; align-items: end; padding: 34px 0 42px; }
.eyebrow { font: 700 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .13em; color: var(--stellar); }
h1 { margin: 10px 0 20px; font-size: clamp(48px, 8vw, 92px); line-height: .9; letter-spacing: -.065em; }
h1 span { color: transparent; -webkit-text-stroke: 1.5px var(--ink); }
.lede { max-width: 650px; margin: 0; color: var(--muted); font-size: 18px; line-height: 1.55; }
.route-mark { display: flex; align-items: center; justify-content: flex-end; gap: 15px; padding-bottom: 8px; }
.chain-orb { width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center; color: white; font-size: 30px; font-weight: 800; box-shadow: var(--shadow); }
.stellar-orb { background: var(--stellar); }
.ethereum-orb { background: var(--ethereum); }
.route-line { display: flex; align-items: center; gap: 8px; color: var(--muted); font: 600 12px ui-monospace, SFMono-Regular, monospace; }
.route-line b { color: var(--ink); font-size: 22px; }
.truth-strip { border: 1px solid var(--ink); padding: 14px 18px; background: var(--acid); font-size: 14px; line-height: 1.6; margin-bottom: 24px; }
.truth-strip strong:not(:first-child) { margin-left: 16px; }
.panel { background: var(--surface); border: 1px solid var(--line); padding: 28px; margin-top: 18px; box-shadow: var(--shadow); }
.panel.compact { padding-bottom: 20px; }
.section-head { display: flex; align-items: start; justify-content: space-between; gap: 30px; margin-bottom: 24px; }
.section-head > div { display: flex; align-items: baseline; gap: 12px; }
.section-head h2 { margin: 0; font-size: 24px; letter-spacing: -.025em; }
.section-head p { margin: 2px 0 0; max-width: 480px; color: var(--muted); text-align: right; font-size: 14px; }
.step-label { color: var(--stellar); font: 700 11px ui-monospace, SFMono-Regular, monospace; letter-spacing: .08em; }
.wallet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.wallet-card { border: 1px solid var(--line); padding: 22px; min-height: 238px; display: flex; flex-direction: column; align-items: flex-start; }
.wallet-title { text-transform: uppercase; letter-spacing: .09em; font-size: 11px; font-weight: 750; display: flex; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.stellar-dot { background: var(--stellar); } .ethereum-dot { background: var(--ethereum); }
.wallet-card h3 { margin: 20px 0 6px; font-size: 30px; }
.muted, .micro { color: var(--muted); }
.micro { font-size: 12px; line-height: 1.5; }
.wallet-card .button { margin-top: auto; }
.wallet-details { width: 100%; margin-top: 12px; }
.address { display: block; overflow-wrap: anywhere; font: 600 12px/1.5 ui-monospace, SFMono-Regular, monospace; margin-bottom: 12px; }
.address:hover { color: var(--stellar); }
.balance-row { display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding: 8px 0; font-size: 13px; }
.network-ok { color: #36753a; font-size: 12px; font-weight: 700; margin-top: 8px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
label { font-size: 13px; font-weight: 700; }
label small { display: block; color: var(--muted); font-weight: 450; line-height: 1.4; margin-top: 6px; }
input, select { width: 100%; border: 1px solid var(--line); background: transparent; color: var(--ink); padding: 13px 14px; outline: none; border-radius: 0; }
input:focus, select:focus { border-color: var(--stellar); box-shadow: inset 0 0 0 1px var(--stellar); }
select:disabled { opacity: .55; }
.input-unit { position: relative; margin-top: 7px; }
.input-unit input { padding-right: 70px; font: 650 18px ui-monospace, SFMono-Regular, monospace; }
.input-unit span { position: absolute; right: 13px; top: 14px; color: var(--muted); font: 650 12px ui-monospace, SFMono-Regular, monospace; }
.button { border: 1px solid var(--ink); padding: 11px 16px; cursor: pointer; font-weight: 750; transition: transform .12s, opacity .12s, background .12s; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .45; }
.button.primary { background: var(--ink); color: var(--surface); }
.button.secondary { background: var(--acid); color: var(--ink); }
.button.sign { background: var(--stellar); border-color: var(--stellar); color: white; }
.button.danger { background: var(--danger); border-color: var(--danger); color: white; }
.button.warning { background: var(--warning); color: #111; }
.button.ghost { background: transparent; border-color: var(--line); }
.quote { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); margin-top: 18px; }
.quote > div { padding: 14px; border-right: 1px solid var(--line); }
.quote > div:last-of-type { border-right: 0; }
.quote span, .quote strong { display: block; }
.quote span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .07em; }
.quote strong { margin-top: 7px; font: 700 15px ui-monospace, SFMono-Regular, monospace; }
.quote-total { background: color-mix(in srgb, var(--acid) 35%, transparent); }
.quote p { grid-column: 1 / -1; margin: 0; padding: 8px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: grid; grid-template-columns: 46px 1fr; gap: 16px; padding: 22px 0; border-top: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 1px solid var(--line); }
.stage-index { width: 36px; height: 36px; border: 1px solid var(--line); display: grid; place-items: center; font-weight: 800; }
.active .stage-index { border-color: var(--stellar); background: var(--stellar); color: white; }
.complete .stage-index { background: var(--acid); border-color: var(--ink); color: var(--ink); }
.locked { opacity: .48; }
.stage-body h3 { margin: 4px 0 6px; }
.stage-body > p { margin: 0; color: var(--muted); font-size: 14px; }
.stage-body > p.blocked-copy { color: var(--danger); font-weight: 750; }
.review { margin-top: 16px; padding: 14px; border-left: 3px solid var(--stellar); background: color-mix(in srgb, var(--stellar) 6%, transparent); font: 12px/1.6 ui-monospace, SFMono-Regular, monospace; overflow-wrap: anywhere; }
.review strong { color: var(--ink); }
.review .danger-text { color: var(--danger); font-weight: 800; }
.action-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.activity { border: 1px solid var(--line); padding: 10px 12px; margin: -6px 0 10px; background: color-mix(in srgb, var(--acid) 18%, transparent); }
.activity-head { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; }
.activity-head span { font-family: ui-monospace, SFMono-Regular, monospace; color: var(--muted); }
.activity-track { height: 4px; margin: 7px 0 5px; overflow: hidden; background: var(--line); }
.activity-track i { display: block; width: 0; height: 100%; background: var(--stellar); transition: width .35s ease; }
.activity small { display: block; color: var(--muted); font-size: 10px; line-height: 1.35; }
.activity.error { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, transparent); }
.activity.error .activity-track i { background: var(--danger); }
.activity.success { border-color: #36753a; }
.resume-row { display: grid; grid-template-columns: 1fr auto; gap: 5px; margin-top: 7px; }
.resume-row input, .resume-row .button { min-width: 0; padding: 7px 8px; font-size: 9px; }
.contracts dl { display: grid; grid-template-columns: 220px 1fr; margin: 0; }
.contracts dl > div { display: contents; }
.contracts dt, .contracts dd { border-top: 1px solid var(--line); margin: 0; padding: 10px 0; font-size: 12px; }
.contracts dt { color: var(--muted); }
.contracts dd { font-family: ui-monospace, SFMono-Regular, monospace; overflow-wrap: anywhere; }
.notice { position: fixed; right: 24px; bottom: 24px; width: min(460px, calc(100% - 48px)); padding: 16px 18px; border: 1px solid var(--ink); background: var(--surface); box-shadow: var(--shadow); white-space: pre-wrap; z-index: 10; }
.notice.error { border-color: var(--danger); color: var(--danger); }
.notice.success { border-color: #36753a; }
.hidden { display: none !important; }

@media (prefers-color-scheme: dark) {
  :root { --bg: #11130f; --ink: #f1f0ea; --muted: #a7aa9e; --surface: #1a1d17; --line: #3b3e35; --acid: #b5dc3f; --shadow: 0 18px 50px rgb(0 0 0 / 28%); }
  .button.primary { background: #f1f0ea; color: #11130f; }
  .truth-strip, .button.secondary, .complete .stage-index { color: #11130f; }
  .network-ok { color: #7ecf84; }
}

@media (max-width: 760px) {
  .shell { width: min(100% - 20px, 1120px); padding-top: 20px; }
  .hero { grid-template-columns: 1fr; }
  .route-mark { justify-content: flex-start; }
  .section-head { display: block; }
  .section-head p { text-align: left; margin-top: 8px; }
  .wallet-grid, .form-grid { grid-template-columns: 1fr; }
  .quote { grid-template-columns: 1fr 1fr; }
  .quote > div { border-bottom: 1px solid var(--line); }
  .contracts dl { grid-template-columns: 1fr; }
  .contracts dt { padding-bottom: 0; }
  .contracts dd { border-top: 0; }
}

/* Laptop-first, one-viewport control-room layout. */
@media (min-width: 1100px) and (min-height: 600px) {
  html, body { min-height: 100%; overflow: hidden; }
  .shell {
    width: min(1580px, calc(100% - 28px));
    min-height: 100vh;
    height: auto;
    padding: 12px 0 18px;
    display: grid;
    grid-template-rows: auto auto auto auto;
    align-content: start;
    gap: 8px;
  }
  .hero {
    grid-template-columns: 1fr auto;
    gap: 24px;
    align-items: center;
    padding: 0;
  }
  .eyebrow { margin: 0 0 3px; font-size: 11px; }
  h1 { margin: 0; font-size: clamp(30px, 3.1vw, 48px); line-height: .88; }
  .lede { margin-top: 7px; max-width: 900px; font-size: 15px; line-height: 1.35; }
  .route-mark { padding: 0; }
  .chain-orb { width: 48px; height: 48px; font-size: 20px; }
  .truth-strip { margin: 0; padding: 8px 12px; font-size: 13px; line-height: 1.3; }
  .control-grid {
    display: grid;
    grid-template-columns: minmax(330px, .92fr) minmax(280px, .72fr) minmax(520px, 1.48fr);
    align-items: start;
    gap: 8px;
  }
  .panel { min-height: 0; margin: 0; padding: 15px; box-shadow: none; overflow: hidden; }
  .section-head { gap: 12px; margin-bottom: 12px; }
  .section-head > div { gap: 7px; }
  .section-head h2 { font-size: 18px; }
  .section-head p { max-width: 300px; font-size: 12px; line-height: 1.3; }
  .step-label { font-size: 10px; }
  .route-panel .form-grid { display: block; margin-bottom: 8px; }
  .route-panel select, .limits-panel input { padding: 9px 10px; }
  label { font-size: 12px; }
  label small { margin-top: 4px; font-size: 11px; line-height: 1.3; }
  .wallet-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .wallet-card { min-height: 210px; height: auto; padding: 11px; }
  .wallet-title { font-size: 10px; letter-spacing: .05em; }
  .wallet-card h3 { margin: 8px 0 3px; font-size: 23px; }
  .wallet-card > p { margin: 0 0 6px; font-size: 11px; line-height: 1.35; }
  .wallet-card .button { width: 100%; margin-top: auto; padding: 8px; font-size: 12px; }
  .wallet-details { margin-top: 6px; }
  .address { margin-bottom: 5px; font-size: 10px; line-height: 1.3; }
  .balance-row { padding: 5px 0; font-size: 11px; }
  .network-ok { margin-top: 5px; font-size: 10px; }
  .limits-panel .form-grid { grid-template-columns: 1fr; gap: 11px; margin-bottom: 12px; }
  .input-unit { margin-top: 4px; }
  .input-unit input { padding: 11px 62px 11px 11px; font-size: 18px; }
  .input-unit span { top: 13px; right: 10px; font-size: 10px; }
  .button { padding: 9px 11px; font-size: 12px; }
  .limits-panel > .button { width: 100%; }
  .quote { grid-template-columns: 1fr 1fr; margin-top: 10px; }
  .quote > div { padding: 9px; border-bottom: 1px solid var(--line); }
  .quote span { font-size: 10px; }
  .quote strong { margin-top: 4px; font-size: 12px; }
  .quote p { padding: 6px 9px; font-size: 10px; }
  .activity { padding: 7px 9px; margin: -4px 0 8px; }
  .activity-head { font-size: 11px; }
  .activity-track { height: 3px; margin: 4px 0 3px; }
  .activity small { font-size: 10px; }
  .timeline { display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: stretch; gap: 8px; height: auto; }
  .timeline li, .timeline li:last-child {
    min-width: 0;
    min-height: 225px;
    display: grid;
    grid-template-columns: 28px 1fr;
    align-content: start;
    gap: 7px;
    padding: 10px;
    border: 1px solid var(--line);
  }
  .stage-index { width: 26px; height: 26px; font-size: 11px; }
  .stage-body { min-width: 0; }
  .stage-body h3 { margin: 2px 0 4px; font-size: 15px; }
  .stage-body > p { min-height: 43px; font-size: 11px; line-height: 1.35; }
  .review { max-height: clamp(120px, 18vh, 190px); overflow: auto; margin-top: 8px; padding: 8px; font-size: 10px; line-height: 1.45; }
  .action-row { display: grid; gap: 6px; margin-top: 8px; }
  .action-row .button { width: 100%; padding: 8px 6px; }
  .resume-row { grid-template-columns: 1fr; }
  .resume-row input, .resume-row .button { width: 100%; padding: 7px 6px; font-size: 10px; }
  .contracts { padding: 7px 10px !important; }
  .contracts .section-head { display: none; }
  .contracts dl { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0 10px; }
  .contracts dl > div { display: block; min-width: 0; }
  .contracts dt, .contracts dd { padding: 2px 0; border: 0; font-size: 9px; line-height: 1.2; }
  .contracts dt { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .contracts dd { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .notice { right: 14px; bottom: 14px; padding: 10px 12px; font-size: 12px; }
}
