/* In the style of swapmarket.github.io: deep navy, a dark card with a soft glow, dashed asset rows, and a yellow call to action.
   System fonts only, because this page loads nothing from outside. */
:root {
  --bg: #142840;
  --card: #0f1f30;
  --deep: #091625;
  --edge: #1e2d3c;
  --text: #d7dee4;
  --muted: #a1a9b2;
  --dim: #727e8c;
  --primary: #e8cb2b;
  --primary-soft: rgb(232 203 43 / 35%);
  --link: #4fadc2;
  --ok: #4fc04f;
  --ok-bg: #0f3a1c;
  --warn-bg: #3d3210;
  --warn-text: #f6e7a8;
  --err: #ff8a80;
  --err-bg: #4a1414;
  --radius: 16px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font: 16px/1.45 "Noto Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--link); }
/* A button that reads as a link, for an action in running text. */
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--link); text-decoration: underline; cursor: pointer; text-align: left; }
[hidden] { display: none !important; }

nav { background: var(--card); border-bottom: 1px solid rgb(255 255 255 / 8%); }
.nav-inner { max-width: 960px; margin: 0 auto; padding: 8px 16px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 0; justify-content: center; }
.logo { font-size: 1.45rem; font-style: italic; font-weight: 800; color: var(--primary); text-decoration: none; margin-right: 28px; letter-spacing: -.01em; }
/* One image, so it looks the same everywhere: client/site/logo.svg. */
.logo { display: inline-flex; align-items: center; }
.logo img { display: block; height: 28px; width: auto; }
.tab { color: var(--text); text-decoration: none; padding: 2px 14px; border-left: 1px solid rgb(255 255 255 / 15%); }
#collapse { display: flex; align-items: center; flex-wrap: wrap; }
.tab:hover, .tab.on { color: var(--primary); }
.net { display: table; margin: 0 auto 18px; font-size: .78rem; color: var(--muted); border: 1px dashed var(--dim); border-radius: 999px; padding: 2px 10px; }

main { max-width: 960px; margin: 0 auto; padding: 14px 16px 16px; }
.banner { max-width: 480px; margin: 0 auto 16px; padding: 10px 14px; border-radius: 12px; background: var(--err-bg); color: #ffd9d4; font-size: .9rem; overflow-wrap: anywhere; }
.card { max-width: 480px; margin: 0 auto; padding: 16px 12px 14px; background: var(--card); border: 1px solid rgb(255 255 255 / 10%); border-radius: var(--radius); box-shadow: 0 0 34px var(--primary-soft); position: relative; }
.card h2 { margin: 2px 40px 2px; text-align: center; font-size: 1.3rem; color: var(--muted); }
.sub { text-align: center; font-size: .86rem; color: var(--muted); margin: 0 0 10px; }
.gear { position: absolute; top: 12px; right: 12px; background: none; border: 0; color: var(--dim); font-size: 1.35rem; cursor: pointer; padding: 2px 6px; }
.gear:hover { color: var(--text); }

.row { position: relative; border: 1px dashed var(--dim); border-radius: 12px; background: var(--deep); padding: 10px; margin-top: 8px; display: flex; align-items: center; gap: 10px; }
.row.to { border-color: rgb(232 203 43 / 60%); }
.pill { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--edge); border-radius: 999px; padding: 6px 14px 6px 8px; color: var(--text); font-weight: 600; white-space: nowrap; font-size: .92rem; }
/* The token on the other side, chosen from a list on mainnet. */
.pill.pick { background: var(--deep); cursor: pointer; font: inherit; font-weight: 600; font-size: .92rem; max-width: 62%; overflow: hidden; text-overflow: ellipsis; }
.pill.pick:hover { border-color: var(--primary); }
.pill .chevron { color: var(--muted); font-size: .8em; margin-left: -2px; }
dialog.picker { max-height: min(640px, calc(100vh - 48px)); overflow-y: auto; }
dialog.picker h4 { margin: 14px 0 6px; font-size: .82rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.pick-list { display: grid; gap: 4px; }
.pick-item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 1px solid var(--edge); border-radius: 10px; background: var(--deep); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.pick-item:hover:not(:disabled), .pick-item.on { border-color: var(--primary); }
.pick-item:disabled { opacity: .45; cursor: not-allowed; }
.pick-item small { color: var(--muted); font-size: .78rem; }
.card.onward .onward-to { overflow-wrap: anywhere; }
.card.onward .onward-trust { font-size: .88rem; }
label.check { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
/* Custodial routes: an operator holds the funds in flight. */
.custodial { color: var(--err); }
/* An alternative route, which a click makes the route. */
.route-pick { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-align: right; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.route-pick:hover { text-decoration-style: solid; }
.warn.custodial-box { background: var(--err-bg); color: var(--err); }
/* The chain's icon: client/site/liquid.svg or polygon.svg. */
.coin { width: 26px; height: 26px; display: block; flex: none; }
.amount { flex: 1; min-width: 0; text-align: right; background: none; border: 0; outline: 0; color: var(--text); font: inherit; font-size: 1.7rem; padding: 0; }
.amount::placeholder { color: var(--dim); }
.amount[readonly] { color: var(--muted); }
.flip { display: block; margin: -6px auto -6px; position: relative; z-index: 2; width: 32px; height: 32px; border: 1px dashed var(--dim); border-radius: 8px; background: var(--edge); color: var(--muted); cursor: pointer; font-size: 1rem; padding: 0; }
.flip:hover { color: var(--primary); }

.field { display: block; margin-top: 8px; }
.field span { display: block; font-size: .8rem; color: var(--muted); margin: 0 0 3px 4px; }
.input { width: 100%; background: var(--deep); border: 1px dashed var(--dim); border-radius: 12px; padding: 9px 12px; color: var(--text); font: inherit; font-size: .92rem; text-align: center; outline: 0; }
.input:focus { border-color: var(--primary); }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: .86rem; color: var(--muted); margin-top: 10px; }

.btn { display: block; width: 100%; margin-top: 10px; padding: 10px 12px; border: 0; border-radius: var(--radius); background: var(--primary); color: var(--card); font: inherit; font-weight: 700; text-transform: uppercase; font-size: .9rem; cursor: pointer; text-align: center; text-decoration: none; }
.btn:hover:not(:disabled) { background: #fee86b; }
.btn:disabled { background: #545c65; color: #1e2d3c; cursor: not-allowed; }
.btn.quiet { background: transparent; color: var(--text); border: 1px solid var(--dim); }
.btn.quiet:hover:not(:disabled) { background: var(--edge); }
/* The file picker's own button, as a quiet button rather than the browser's grey. */
input[type="file"]::file-selector-button { margin-right: 12px; padding: 8px 14px; border: 1px solid var(--dim); border-radius: var(--radius); background: transparent; color: var(--text); font: inherit; font-weight: 700; font-size: .8rem; text-transform: uppercase; cursor: pointer; }
input[type="file"]::file-selector-button:hover { background: var(--edge); }
input[type="file"] { color: var(--muted); }
.wallets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.wallets .btn { flex: 1 1 45%; margin: 0; }

.facts { margin: 10px 2px 0; font-size: .86rem; }
.facts div { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
dl { margin: 0; }

.note { font-size: .86rem; color: var(--muted); margin: 10px 2px 0; }
.warn { font-size: .88rem; margin: 10px 0 0; padding: 8px 12px; border-radius: 10px; background: var(--warn-bg); color: var(--warn-text); }
.good { font-size: .95rem; margin: 10px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--ok-bg); color: #d3f5d3; text-align: center; }
.status { font-size: .9rem; margin: 10px 2px 0; color: var(--text); text-align: center; min-height: 1.3em; overflow-wrap: anywhere; }
.spin::before { content: ""; display: inline-block; width: .8em; height: .8em; margin-right: .5em; border: 2px solid var(--dim); border-top-color: var(--primary); border-radius: 50%; animation: turn 1s linear infinite; vertical-align: -1px; }
@keyframes turn { to { transform: rotate(360deg); } }

.steps { list-style: none; margin: 8px 0 0; padding: 0; font-size: .86rem; }
.steps li { padding: 3px 0 3px 22px; position: relative; color: var(--dim); }
.steps li::before { content: "○"; position: absolute; left: 4px; }
.steps li.done { color: var(--muted); }
.steps li.done::before { content: "✓"; color: var(--ok); }
.steps li.now { color: var(--text); font-weight: 600; }
.steps li.now::before { content: "●"; color: var(--primary); }

.addr { font: .82rem/1.35 ui-monospace, "Noto Mono", Menlo, monospace; overflow-wrap: anywhere; background: var(--deep); border: 1px dashed var(--dim); border-radius: 10px; padding: 8px 10px; margin-top: 8px; text-align: center; }
.qr { display: flex; justify-content: center; margin-top: 10px; }
.qr svg { width: 188px; height: 188px; background: #fff; border-radius: 10px; padding: 6px; }
.qr[data-enlarge], .recovery-code[data-enlarge] { cursor: zoom-in; }
/* A QR code, tapped: the whole screen, black, with the code as large as fits on its own white square, whose margin is the quiet
   zone scanners need. Crisp squares, so a screenshot still reads. */
.qr-full { position: fixed; inset: 0; z-index: 2000; display: flex; flex-direction: column; gap: 14px; align-items: center; justify-content: center; background: #000; cursor: zoom-out; }
.qr-full-caption { margin: 0; color: #fff; font-size: 1rem; }
.qr-full-details { max-width: min(94vw, 94vh); color: #fff; text-align: center; }
.qr-full-details p { margin: 2px 0; font-size: .95rem; }
.qr-full-details p:first-child { font-weight: 700; }
.qr-full > svg, .qr-full > img { box-sizing: border-box; width: min(94vw, 94vh); height: min(94vw, 94vh); padding: min(3vw, 3vh); background: #fff; image-rendering: pixelated; }
.recovery-codes figure { margin: 14px 0; }
.recovery-codes figcaption { text-align: center; color: var(--muted); font-size: .85rem; margin-top: 4px; }
/* Big and sharp, with its own white border, so a screenshot of it reads back. */
.recovery-code { display: flex; justify-content: center; }
.recovery-code canvas { display: block; }

.swap-card, .back, #recovery-card { margin-bottom: 14px; }
.back { background: none; border: 0; box-shadow: none; padding: 0; }
.order-summary { margin-bottom: 12px; }
.book { max-width: 480px; margin: 28px auto 0; }
.book h3 { margin: 0 0 8px; font-size: 1.05rem; color: var(--muted); text-align: center; }
.scroll { overflow-x: auto; background: var(--card); border: 1px solid rgb(255 255 255 / 10%); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: .86rem; }
th, td { padding: 8px 10px; text-align: right; white-space: nowrap; }
th { color: var(--dim); font-weight: 600; font-size: .76rem; text-transform: uppercase; border-bottom: 1px solid var(--edge); }
th:first-child, td:first-child { text-align: left; }
tbody tr { cursor: pointer; border-top: 1px solid rgb(255 255 255 / 5%); }
tbody tr:hover { background: var(--edge); }
tbody tr.on { background: rgb(232 203 43 / 12%); }
tbody tr.off { opacity: .45; cursor: default; }
.maker-cell { display: flex; align-items: center; gap: 6px; }
.star { display: inline-flex; align-items: center; justify-content: center; width: 1.2rem; height: 1.2rem; background: none; border: 0; padding: 0; margin: 0; font-size: 1.1rem; line-height: 1; color: var(--dim); cursor: pointer; }
.star:hover, .star.on { color: var(--primary); }
.slot { display: contents; }
.send-links { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 4px 6px; margin: 2px 2px 12px; font-size: .95rem; color: var(--muted); }
.send-limit { background: var(--deep); border: 0; border-radius: 8px; padding: 2px 8px; margin-right: 8px; color: var(--text); font: inherit; cursor: pointer; }
.send-limit:last-child { margin-right: 0; }
.send-limit:hover, .send-limit:focus-visible { color: var(--primary); }
.send-links[hidden] { display: none; }
.vetted { display: inline-flex; align-items: center; line-height: 1; color: var(--ok); font-weight: 700; }
.book-filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 16px; margin-top: 8px; }
.book-filters .check { align-items: center; }
.mono { font-family: ui-monospace, "Noto Mono", Menlo, monospace; }
.empty { padding: 18px; text-align: center; color: var(--muted); font-size: .9rem; }

.hero { text-align: center; margin: 40px 0 8px; }
.hero h1 { margin: 0; font-size: clamp(1.9rem, 6vw, 3.2rem); line-height: 1.12; font-weight: 800; background: linear-gradient(90deg, #eac806, #2084f6); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { margin: 10px 0 0; color: #e8edf1; }

.list { max-width: 960px; margin: 0 auto; }

dialog { background: var(--card); color: var(--text); border: 1px solid rgb(255 255 255 / 15%); border-radius: var(--radius); width: min(460px, calc(100vw - 32px)); padding: 16px; }
dialog::backdrop { background: rgb(0 0 0 / 55%); }
dialog h3 { margin: 0 0 6px; }
dialog .input { text-align: left; }

dialog h4 { margin: 14px 0 4px; padding-top: 10px; border-top: 1px solid var(--edge); font-size: 1rem; }
.setting-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.icon-btns { display: flex; gap: 6px; }
.icon-btn { width: 44px; height: 32px; border: 0; border-radius: 8px; background: var(--primary); color: var(--card); font-size: 1rem; cursor: pointer; }
.icon-btn:hover { background: #fee86b; }
.icon-btn.danger { background: #6b0f0f; color: #ffd9d4; }
.icon-btn.danger:hover { background: #8b0000; }

footer { text-align: center; color: var(--dim); font-size: .78rem; padding: 28px 16px; }
footer p { margin: 4px 0; }

@media (max-width: 500px) {
  .card { border-radius: 12px; }
  .logo { margin-right: 12px; }
  .amount { font-size: 1.4rem; }
  table { font-size: .74rem; }
  th { font-size: .66rem; }
  th, td { padding: 7px 5px; }
  .maker-cell { gap: 3px; }
}

.qr-wait { display: flex; align-items: center; justify-content: center; min-height: 220px; }
.spinner { width: 44px; height: 44px; border-radius: 50%; border: 4px solid var(--edge); border-top-color: var(--primary); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 4s; } }

.page-loading { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.page-loading .sub { margin: 0; }
.skeleton { width: 100%; height: 48px; border-radius: 12px; background: var(--edge); }
.skeleton.short { width: 55%; height: 22px; }

.copy { display: block; width: 100%; color: inherit; text-align: left; cursor: pointer; }
/* Long addresses break only where addressText allows, between groups of 8. */
.addr.copy { overflow-wrap: normal; word-break: normal; text-wrap: balance; }
.good-text { color: var(--ok); }
.copy:hover, .copy:focus-visible { outline: 1px solid var(--primary); }
.copy::after { content: "⧉"; float: right; margin-left: 8px; color: var(--dim); }
#toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 10; padding: 8px 16px; border-radius: 12px; background: var(--ok-bg); color: #d3f5d3; font-size: .9rem; box-shadow: 0 4px 16px rgb(0 0 0 / 40%); }
#toast[hidden] { display: none; }

td.rate, td.size { white-space: pre-line; }
th:nth-child(2), td.rate { width: 45%; }
.open-wallet, .open-wc { text-align: center; text-decoration: none; box-sizing: border-box; }

.faucet-steps { margin: 10px 0; padding-left: 22px; font-size: .9rem; color: var(--muted); }
.faucet-steps li { margin: 4px 0; }
.faucet-send { margin-top: 18px; border-top: 1px solid var(--dim); padding-top: 12px; }
.faucet-send h3 { margin: 0 0 4px; font-size: 1rem; }
.faucet-send .btn { margin-top: 10px; }

.explorer-links { display: inline-flex; flex-wrap: wrap; gap: 0 10px; font-size: .84rem; }

.clear-amount { flex: none; width: 26px; height: 26px; margin-left: 6px; padding: 0; border: 0; border-radius: 50%; background: var(--edge); color: var(--muted); font-size: 1rem; line-height: 1; cursor: pointer; }
.clear-amount:hover, .clear-amount:focus-visible { color: var(--text); }
.history { max-width: 480px; background: var(--card); border: 1px solid rgb(255 255 255 / 10%); border-radius: 12px; overflow: hidden; }
.history-head, .history-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 10px 12px; }
.history-head { color: var(--dim); font-size: .7rem; font-weight: 600; text-transform: uppercase; border-bottom: 1px solid var(--edge); }
.history-head span:not(:first-child), .history-row span:not(:first-child) { text-align: right; }
.history-row { width: 100%; background: none; border: 0; border-top: 1px solid rgb(255 255 255 / 5%); color: var(--text); font: inherit; font-size: .86rem; text-align: left; cursor: pointer; }
.history-row:hover, .history-row[aria-expanded="true"] { background: var(--edge); }
.history-date { color: var(--muted); font-size: .8rem; }
.history-details { margin: 0; padding: 4px 12px 12px; background: var(--edge); }
.history-actions { display: flex; gap: 6px; margin-top: 8px; }
.history-actions .btn { width: auto; margin: 0; padding: 4px 12px; font-size: .76rem; }

/* The burger and its menu, from SwapMarket/swapmarket.github.io src/style/nav.scss (AGPL-3.0), with this page's colours. */
#burger { display: none; background: none; border: 0; padding: 0; margin-left: auto; position: relative; z-index: 1000;
  cursor: pointer; -webkit-tap-highlight-color: transparent; transition: transform 400ms; user-select: none; }
#burger.active { transform: rotate(45deg); }
body.menu-open { overflow: hidden; }
#burger .line { fill: none; transition: stroke-dasharray 400ms, stroke-dashoffset 400ms; stroke: var(--text); stroke-width: 5.5; stroke-linecap: round; }
#burger .top, #burger .bottom { stroke-dasharray: 40 121; }
#burger.active .top, #burger.active .bottom { stroke-dashoffset: -68px; }

@media (max-width: 768px) {
  .nav-inner { justify-content: flex-start; }
  #burger { display: block; }
  #collapse { display: none; }
  #collapse.open { display: flex; position: fixed; z-index: 999; inset: 0; background: var(--bg); align-items: center; justify-content: center; flex-direction: column; }
  #collapse.open .tab { display: block; border-left: 0; padding: 6px 24px; font-size: 26px; }
}
}

.recovery-paste { resize: vertical; font-family: ui-monospace, "Noto Mono", Menlo, monospace; font-size: .78rem; box-sizing: border-box; }
.paste-box { margin-top: 10px; }
.nowrap { white-space: nowrap; }
.history-rent { display: block; font-size: .74rem; color: var(--primary); }
.history-rent-total { max-width: 480px; margin: 0 auto 10px; text-align: center; color: var(--primary); }
/* An asset id is 64 characters with no break in it. */
.refund-asset { overflow-wrap: anywhere; }
#wallet-wait { position: fixed; inset: auto 12px calc(16px + env(safe-area-inset-bottom, 0px)) 12px; z-index: 50; max-width: 456px; margin: 0 auto; padding: 16px 18px; display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: center; background: var(--card); border: 2px solid var(--primary); border-radius: var(--radius); box-shadow: 0 8px 40px rgb(0 0 0 / 60%); }
#wallet-wait .spinner { grid-row: span 2; width: 32px; height: 32px; border-width: 3px; }
#wallet-wait strong { font-size: 1.1rem; }
#wallet-wait .btn { grid-column: 1 / -1; margin-top: 8px; }
#wallet-wait p { margin: 0; color: var(--muted); font-size: .9rem; }
#wallet-wait strong, #wallet-wait p { grid-column: 2; }
body { padding-bottom: var(--wallet-wait, 0px); }
#wallet-wait p.wallet-what { color: var(--text); }
.step-time { margin-left: .6em; font-size: .82em; color: var(--muted); font-variant-numeric: tabular-nums; }
.step-time.live { color: var(--primary); }
.facts.addresses { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--edge); }
.facts.addresses a { font-size: .85rem; }
.walletconnect-qr { display: block; margin: 8px auto 0; font-size: .88rem; }
.pick-held { display: block; }
.pick-held:empty { display: none; }
.pick-item > small { max-width: 13em; text-align: right; }
