@font-face { font-family: Pretendard; src: url('/regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: Pretendard; src: url('/semibold.woff2') format('woff2'); font-weight: 600; font-display: swap; }

:root {
  /* HELIX receipt palette (2026-11-09 B, helix-light/dark). Contrast checked: text >= 4.5 on canvas/paper/wash. */
  /* 2026-11-12 polish: neutrals moved to one near-grey ramp (a trace of violet); violet stays for --pine and the signals.
     Surfaces step canvas -> panel -> paper. Shadow = two soft neutral layers; dark mode uses surface steps and hairlines instead. */
  color-scheme: light;
  --canvas: #f3f2f5; --paper: #fff; --panel: #fbfbfc; --ink: #1c1b22; --quiet: #66646f; --line: #e2e0e7; --edge: #8a8794;
  --pine: #7c3aed; --buy: #5b3cf5; --sell: #cc3036; --gold: var(--pine); --wash: #f2f1f5; --pill: #ecebf0; --pill-ink: #57555f;
  --on-signal: #fff; --row-line: #eeedf1; --focus: #7c3aed; --select: #ddd3fd; --backdrop: #1c1b2252;
  --shadow: 0 1px 2px rgba(20, 20, 20, .04), 0 8px 24px rgba(20, 20, 20, .04); --shadow-up: 0 -1px 2px rgba(20, 20, 20, .04), 0 -8px 24px rgba(20, 20, 20, .06);
  /* plush-ui shapes (2026-11-12 r2): white knob pills on a --wash plate, the selected one a --pine face with a 1px top gloss;
     dark mode lifts the knob one surface step and draws a hairline instead of a shadow. Status pill: near-black, inverted in dark. */
  --knob: #fff; --knob-shadow: 0 1px 2px rgba(20, 20, 20, .06), 0 2px 8px rgba(20, 20, 20, .06); --knob-shadow-hover: 0 1px 3px rgba(20, 20, 20, .16), 0 2px 8px rgba(20, 20, 20, .06);
  --gloss: inset 0 1px 0 rgba(255, 255, 255, .28); --success: #2fc26b; --on-success: #fff; --toast: #161616; --on-toast: #fff;
  /* Touch (plush-ui values): a spring for transform only, a smoothstep fade for colour and opacity. */
  --ease-spring: linear(0, 0.062, 0.203, 0.372, 0.538, 0.683, 0.801, 0.89, 0.952, 0.993, 1.016, 1.028, 1.031, 1.029, 1.025, 1.02, 1.015, 1.01, 1.006, 1.004, 1.002, 1, 1, 0.999, 0.999, 0.999, 0.999, 0.999, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
  --dur-spring: 732ms; /* 1045ms x tempo .7 */
  --ease-fade: cubic-bezier(.333, 0, .667, 1); --dur-fast: 120ms; --dur-fade: 200ms;
  --ease-out: cubic-bezier(.23, 1, .32, 1); /* exits and one-shot entrances */
  /* Type scale (2026-11-09 G): 14px trading base on desktop, labels small/quiet, values firm. */
  /* 2026-11-11 (user: 「폰트 크기가 너무 작습니다」): smallest step >= 14px on phones, body/inputs 17-18px. */
  --fs-xs: .8125rem; --fs-sm: .875rem; --fs-base: .9375rem; --fs-md: 1rem; --fs-lg: 1.25rem; --fs-xl: 1.5rem;
  font-family: Pretendard, 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
  /* Text size (2026-11-10, user): default one notch up from 16px; the masthead pill cycles 표준 → 크게 → 아주 크게. */
  font-size: 18px;
}
:root[data-text-size="large"] { font-size: 20px; }
:root[data-text-size="xlarge"] { font-size: 22px; }

@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  color-scheme: dark;
  /* OLED black (user choice 2026-11-10, comp E): pure black canvas, near-black papers, HELIX violet as the only accent. */
  --canvas: #000000; --paper: #18181c; --panel: #111114; --ink: #f2f2f5; --quiet: #9c9ca6; --line: #2a2a31; --edge: #4d4d57;
  --pine: #a78bfa; --buy: #8b7cff; --sell: #ff6b73; --gold: var(--pine); --wash: #1f1f24; --pill: #26262c; --pill-ink: #cfcfd8;
  --on-signal: #000000; --row-line: #1d1d22; --focus: #a78bfa; --select: #3f3680; --backdrop: #000000c0; --shadow: none; --shadow-up: 0 -1px 0 var(--line);
  --knob: #2a2a31; --knob-shadow: inset 0 0 0 1px #3a3a43; --knob-shadow-hover: inset 0 0 0 1px #55555f;
  --gloss: inset 0 1px 0 rgba(255, 255, 255, .4); --success: #2fc26b; --on-success: #fff; --toast: #f2f2f5; --on-toast: #161616;
} }
:root[data-theme="dark"] {
  color-scheme: dark;
  /* OLED black (user choice 2026-11-10, comp E): pure black canvas, near-black papers, HELIX violet as the only accent. */
  --canvas: #000000; --paper: #18181c; --panel: #111114; --ink: #f2f2f5; --quiet: #9c9ca6; --line: #2a2a31; --edge: #4d4d57;
  --pine: #a78bfa; --buy: #8b7cff; --sell: #ff6b73; --gold: var(--pine); --wash: #1f1f24; --pill: #26262c; --pill-ink: #cfcfd8;
  --on-signal: #000000; --row-line: #1d1d22; --focus: #a78bfa; --select: #3f3680; --backdrop: #000000c0; --shadow: none; --shadow-up: 0 -1px 0 var(--line);
  --knob: #2a2a31; --knob-shadow: inset 0 0 0 1px #3a3a43; --knob-shadow-hover: inset 0 0 0 1px #55555f;
  --gloss: inset 0 1px 0 rgba(255, 255, 255, .4); --success: #2fc26b; --on-success: #fff; --toast: #f2f2f5; --on-toast: #161616;
}

* { box-sizing: border-box; }
::selection { background: var(--select); color: var(--ink); }
html { scrollbar-color: var(--edge) var(--canvas); caret-color: var(--pine); accent-color: var(--pine); }
input, select { background-color: var(--paper); }
body { margin: 0; background: var(--canvas); color: var(--ink); font-size: var(--fs-md); line-height: 1.45; overflow-wrap: anywhere; }
@media (min-width: 900px) { body { font-size: var(--fs-base); } }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled, select:disabled { cursor: default; opacity: .57; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
a { color: var(--pine); text-underline-offset: .22em; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1, h3, b, strong { font-weight: 600; } /* one weight for emphasis: 600 (no 700 face is loaded) */
h2 { font-size: var(--fs-md); font-weight: 600; line-height: 1.3; }
.skip { position: absolute; padding: .75rem; background: var(--paper); transform: translateY(-130%); z-index: 2; }
.skip:focus { transform: translateY(0); }
.buy-ink { color: var(--buy); }
.sell-ink, .error { color: var(--sell); }

.masthead { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; padding: calc(8px + env(safe-area-inset-top)) 12px 8px; background: var(--paper); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; }
.brand span, .brand b { display: block; }
.brand span { font-size: var(--fs-sm); color: var(--quiet); }
.brand b { font-size: var(--fs-lg); font-weight: 600; }
.session { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; color: var(--quiet); font-size: var(--fs-sm); }
#connection { font-variant-numeric: tabular-nums; }
#wallet-status { flex-basis: 100%; }
.invite-link { padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--pine); font-size: var(--fs-sm); font-weight: 600; text-decoration: none; white-space: nowrap; }
#order-form, #depth-title, #my-section, #receipt-title, #pending-recovery { scroll-margin-top: 56px; }
#wallet, #duration, .field, #order-number { min-height: 44px; border: 1px solid var(--edge); background: var(--paper); border-radius: 8px; }
select { padding: 4px 12px; }
main, .disclosure { max-width: 560px; margin: auto; padding-inline: max(10px, env(safe-area-inset-left)) max(10px, env(safe-area-inset-right)); }
.market-head { margin-block: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 20px; }
.market-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.market-title h1 { font-size: var(--fs-xl); font-weight: 600; letter-spacing: -.01em; line-height: 1.15; }
.market-title p { margin-top: 4px; color: var(--quiet); font-size: var(--fs-sm); }
.fee-labels { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.trial { color: var(--pill-ink); background: var(--pill); padding: 4px 8px; border-radius: 4px; font-size: var(--fs-sm); font-weight: 600; }
.fee-policy { color: var(--quiet); font-size: var(--fs-sm); }
.ticker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); font-variant-numeric: tabular-nums; }
.ticker div { padding: 8px 12px; min-width: 0; }
.ticker div:nth-child(even) { border-left: 1px solid var(--line); }
.ticker div:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
.ticker dt { color: var(--quiet); font-size: var(--fs-xs); }
.ticker dd { font-weight: 600; font-size: 1rem; overflow-wrap: normal; }
.ticker #last-price { font-weight: 600; }

.board { display: grid; gap: 12px; }
.history-panel { margin-top: 12px; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.panel-head span, .panel-head p, .panel-note, .note { color: var(--quiet); font-size: var(--fs-sm); }
.panel-note { margin: 8px 12px; }
.depth-columns, .depth-row { display: grid; grid-template-columns: 1fr 1.03fr .85fr; gap: 8px; padding: 4px 12px; text-align: right; font-variant-numeric: tabular-nums; }
.depth-columns { color: var(--quiet); font-size: var(--fs-xs); }
.depth-side h3 { padding: 4px 12px; font-size: var(--fs-sm); font-weight: 600; }
.depth-row { width: 100%; min-height: 44px; align-items: center; position: relative; isolation: isolate; border: 0; border-bottom: 1px solid var(--row-line); background: transparent; font-size: var(--fs-base); }
.depth-row:focus-visible { background: var(--wash); }
.depth-row span:first-of-type { font-weight: 600; }
.depth-row meter { appearance: none; position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; z-index: -1; opacity: .13; pointer-events: none; }
.depth-row meter::-webkit-meter-bar { border: 0; border-radius: 0; background: transparent; }
.depth-row meter::-webkit-meter-optimum-value { background: var(--buy); }
.depth-row.ask meter::-webkit-meter-optimum-value { background: var(--sell); }
.depth-row meter::-moz-meter-bar { background: var(--buy); }
.depth-row.ask meter::-moz-meter-bar { background: var(--sell); }
.book-mid { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 8px 12px; background: var(--wash); border-block: 1px solid var(--line); }
.book-mid span { color: var(--quiet); font-size: var(--fs-sm); }
.book-mid strong { font-size: var(--fs-lg); font-weight: 600; font-variant-numeric: tabular-nums; }
.empty { padding: 12px; color: var(--quiet); font-size: var(--fs-sm); }
/* Long book (up to 60 levels/side): each side scrolls on its own; best price stays on top. */
.depth-rows { max-height: 300px; overflow: auto; overscroll-behavior: contain; scrollbar-color: var(--edge) transparent; scrollbar-width: thin; }
@media (min-width: 900px) { .depth-rows { max-height: max(240px, calc(50dvh - 140px)); } }
@media (min-width: 1200px) { .depth-rows { max-height: max(240px, calc(50dvh - 120px)); } }
/* Live block pill in the masthead (explorer style). */
.chain-block { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; white-space: nowrap; }
.chain-block[hidden] { display: none; }
.chain-block span { color: var(--quiet); }
.chain-block b { font-weight: 600; }
.chain-block .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--quiet); }
.chain-block .dot.live { background: var(--success); }
.trades-head { border-top: 1px solid var(--line); }
.scroll { overflow: auto; max-height: 296px; }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-base); font-variant-numeric: tabular-nums; }
th, td { padding: 8px 12px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
th { font-size: var(--fs-sm); color: var(--quiet); font-weight: 600; }
th:first-child, td:first-child { text-align: left; }
/* 2026-11-11 font scale: on phones the header may break between word and unit (단가 / (DAI)); numbers stay on one line. */
/* Same in the 320px desktop side column (≥1200px). */
@media (max-width: 480px), (min-width: 1200px) { .history-panel th { white-space: normal; word-break: keep-all; overflow-wrap: normal; } .history-panel th, .history-panel td { padding-inline: 8px; } }

#order-form { display: grid; gap: 8px; padding: 12px; }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.choice button, .plain, .primary { min-height: 44px; padding: 8px 12px; border: 1px solid var(--edge); border-radius: 8px; background: var(--paper); font-size: var(--fs-base); font-weight: 600; }
.choice button[aria-pressed="true"] { background: var(--wash); color: var(--pine); border-color: var(--pine); font-weight: 600; }
.side #buy[aria-pressed="true"] { color: var(--on-signal); background: var(--buy); border-color: var(--buy); }
.side #sell[aria-pressed="true"] { color: var(--on-signal); background: var(--sell); border-color: var(--sell); }
.primary { color: var(--on-signal); background: var(--pine); border-color: var(--pine); min-height: 48px; font-size: var(--fs-md); }
#limit-fields { display: grid; gap: 4px; }
#order-form label, .lookup label { margin: 0 0 4px; color: var(--quiet); font-size: var(--fs-sm); }
.field { display: flex; align-items: center; padding: 0 12px; gap: 8px; }
.field input { flex: 1; width: 0; border: 0; padding: 10px 0; background: transparent; font-variant-numeric: tabular-nums; font-size: var(--fs-md); font-weight: 600; }
.field:focus-within { outline: 2px solid var(--buy); outline-offset: 1px; }
.field input:focus-visible { outline: 0; }
.field span { color: var(--quiet); font-size: var(--fs-sm); }
.field input::placeholder, #budget::placeholder { color: var(--quiet); font-weight: 400; }
.market-reference { padding: 8px 12px; background: var(--wash); border-block: 1px solid var(--line); }
.market-reference strong { display: block; font-size: var(--fs-lg); font-weight: 600; font-variant-numeric: tabular-nums; }
.price-shortcuts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.price-shortcuts button { padding-inline: 2px; white-space: nowrap; font-size: var(--fs-sm); }
#price-relative:empty, #pool-sell-assumption:empty { display: none; }
#comparison-value { font-variant-numeric: tabular-nums; }
#duration { width: 100%; }
.order-quote { padding: 8px 12px; margin-top: 4px; border-block: 1px solid var(--line); background: var(--wash); }
.order-quote span { display: block; font-size: var(--fs-sm); color: var(--quiet); }
.order-quote strong { display: block; font-size: 1.45rem; font-variant-numeric: tabular-nums; }
.order-quote p:empty { display: none; }
.alternatives, .receipt-actions, .confirm-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.comparison, .transaction { border-top: 1px solid var(--line); padding-top: 4px; font-size: var(--fs-sm); }
summary { cursor: pointer; min-height: 44px; padding: 8px 0; font-weight: 600; color: var(--pine); }
.error { font-size: var(--fs-sm); font-weight: 600; }
.own-panel { margin-top: 12px; }
.order-link { background: transparent; border: 0; color: var(--pine); font-weight: 600; text-decoration: underline; min-height: 44px; }
.lookup { padding: 12px; display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.lookup > div { display: flex; gap: 8px; flex-wrap: wrap; }
#order-number { width: 144px; padding: 8px 12px; font-variant-numeric: tabular-nums; }
#pending-hash { min-height: 44px; min-width: 0; width: min(260px, 100%); padding: 8px 12px; border: 1px solid var(--edge); border-radius: 8px; }
#pending-recovery { padding-inline: 0; }
#lookup-message { padding: 0 12px 8px; }
.receipt, .credits { margin: 0; padding: 12px; border: 1px solid var(--line); background: var(--wash); border-radius: 0; }
.receipt-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.receipt-data { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; padding: 8px 0; }
.receipt-data dt, .confirmation-data dt { color: var(--quiet); font-size: var(--fs-sm); word-break: keep-all; }
.receipt-data dd, .confirmation-data dd { font-weight: 600; font-variant-numeric: tabular-nums; }
.receipt-share, #receipt-share { width: 100%; margin-top: 8px; }
#copy-status { min-height: 1.3rem; }
.disclosure { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-block: 16px; padding-bottom: env(safe-area-inset-bottom); font-size: var(--fs-sm); color: var(--quiet); }
.activity { padding: 8px 12px; margin: 12px 0; border: 1px solid var(--line); background: var(--paper); }
dialog { width: min(470px, calc(100% - 24px)); max-height: 90dvh; padding: 16px; border: 1px solid var(--edge); border-radius: 8px; color: var(--ink); background: var(--paper); }
dialog::backdrop { background: var(--backdrop); }
.confirmation-data { display: grid; gap: 8px; margin-block: 12px; }
.confirmation-data div { display: grid; grid-template-columns: 1fr 1.25fr; gap: 8px; }
.confirm-actions { justify-content: flex-end; margin-top: 12px; }
@media (max-width: 560px) {
  #confirm { width: 100%; max-width: none; margin: auto 0 0; padding-bottom: calc(16px + env(safe-area-inset-bottom)); border-radius: 12px 12px 0 0; }
  #confirm .confirm-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
}

.verification { max-width: 54rem; padding-block: 28px 44px; }
.verification section { margin-top: 20px; padding: 16px; background: var(--paper); border: 1px solid var(--line); }
.verification h3, .verification p { margin-top: 8px; }

#wallet-jump { display: inline-flex; align-items: center; min-height: 44px; justify-self: start; }

.market-selector {display:flex;gap:8px;max-width:1200px;margin:12px auto;padding:0 16px;overflow-x:auto}
.market-selector a {white-space:nowrap;color:inherit;padding:12px 14px;text-decoration:none;border-bottom:2px solid transparent}
.market-selector a[aria-current=page] {border-color:currentColor;font-weight:600}
.nft-panel {max-width:720px;margin:16px auto;padding:20px;overflow-wrap:anywhere}
.nft-form {display:grid;gap:12px}.nft-form input,.nft-form select {width:100%;min-height:44px;box-sizing:border-box}
.nft-form input[type=checkbox] {width:28px}.nft-row {display:flex;flex-wrap:wrap;gap:12px;justify-content:space-between;padding:14px 0;border-bottom:1px solid var(--line)}
.nft-books {margin:24px 0}.nft-panel .lookup {flex-wrap:wrap}.nft-panel p {line-height:1.6}
@media(max-width:480px){.market-selector{gap:0;padding:0 8px}.market-selector a{padding:12px 10px}.nft-panel{padding:16px;margin:8px}.masthead .session{max-width:100%;overflow-wrap:anywhere}}
/* Phones: the submit button stays in the flow at the end of the receipt (a fixed bar covered the
   receipt lines and the order book while scrolling — user feedback 2026-11-10). The dialog still
   shows the complete amounts and requires a second explicit confirmation. */
@media (max-width: 600px) {
  body { padding-bottom: env(safe-area-inset-bottom); }
  #order-submit, .nft-form > button.primary { width: 100%; min-height: 52px; }
  input, select { scroll-margin-bottom: 100px; }
}

/* Guide light theme: Vault brand/tokens.json. Keep financial signals separate. */
.guide-symbol { flex: none; }
.market-selector { max-width: 560px; margin-block: 0; background: var(--paper); }
.market-selector a { min-height: 48px; }
.market-selector a[aria-current=page] { color: var(--pine); }
.market-title { align-items: start; }
.ticker div { padding-block: 10px; }
#order-form { gap: 12px; }
#limit-fields, #duration-fields { display: grid; gap: 0; }
/* Label sits 4px above its input; fields stay 12px apart (form grid gap − 8px). */
.receipt-paper > label { margin-bottom: -8px; }
.field + .price-shortcuts { margin-top: 4px; }
.price-shortcuts + .note { margin-top: 4px; }
#budget-fields { padding-block: 8px; border-block: 1px solid var(--line); }
#budget-fields .lookup { padding: 4px 0; flex-wrap: wrap; } /* button drops below only when 60% field + button cannot share the row (200% text) */
#budget-fields label { display: block; }
#budget-fields .field { flex: 1 1 60%; min-width: 60%; }
#budget-apply { flex: none; }
.order-quote { padding: 14px 12px; }
.order-quote strong { font-size: var(--fs-xl); font-weight: 600; }
.market-reference { margin-top: 8px; }
.activity { margin: 12px 14px 0; border-radius: 8px; background: var(--wash); }
.confirmation-data div { align-items: baseline; padding-block: 4px; }
.confirmation-data dd { text-align: right; min-width: 0; }
.confirmation-data div:nth-child(5) { padding-block: 12px; border-block: 1px solid var(--line); }
.confirmation-data div:nth-child(5) dd { font-size: var(--fs-lg); font-weight: 600; }
.confirm-actions { position: sticky; bottom: 0; padding-top: 8px; background: var(--paper); }
.nft-form input:not([type=checkbox]), .nft-form select, .nft-panel .lookup input { border: 1px solid var(--edge); border-radius: 8px; padding: 10px 12px; }
.nft-panel .lookup input { min-width: 0; max-width: 100%; }
.nft-panel [role=status] { margin-block: 12px; }
input, select, button, a, summary, [tabindex] { scroll-margin-top: 60px; scroll-margin-bottom: 110px; }
@media (min-width: 900px) {
  main, .disclosure { max-width: 1040px; }
  .board { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; }
  .ticker { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ticker div:nth-child(-n + 2) { border-bottom: 0; }
  .ticker div + div { border-left: 1px solid var(--line); }
}

/* User review: market selector in the title, order direction above the form. */
.market-selector { display: inline-flex; margin: 0; padding: 0; max-width: 100%; overflow: visible; }
.order-panel > .side { display: grid; grid-template-columns: 1fr 1fr; gap: 0; padding: 0; border-bottom: 1px solid var(--line); }
.order-panel > .side button { min-height: 48px; border-radius: 0; font-size: var(--fs-md); font-weight: 600; }
.order-panel > .side button:first-child { border-top-left-radius: 8px; }
.order-panel > .side button:last-child { border-top-right-radius: 8px; }
.wallet-summary { padding: 12px; border-bottom: 1px solid var(--line); }
.wallet-summary .balances { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.wallet-summary summary { min-height: 44px; padding-block: 8px; cursor: pointer; color: var(--quiet); }
.asset-balances { display: grid; gap: 4px; font-variant-numeric: tabular-nums; }
.asset-balances > div { display: flex; justify-content: space-between; gap: 12px; }
.asset-balances dd { text-align: right; }
#order-panel { scroll-margin-top: 60px; }

/* 2026-11-09 UI revision: wider desktop frame, aligned header, quieter panels. */
.panel { border-radius: 20px; background: var(--panel); box-shadow: var(--shadow); }
.panel-head { background: var(--wash); }
.panel > .panel-head:first-child { border-radius: 19px 19px 0 0; }
.trades-head { border-radius: 0; }
.order-panel > .side button:first-child { border-top-left-radius: 19px; }
.order-panel > .side button:last-child { border-top-right-radius: 19px; }
.side #buy[aria-pressed="false"] { color: var(--buy); }
.side #sell[aria-pressed="false"] { color: var(--sell); }
.price-shortcuts button { border-radius: 999px; }
.depth-row meter { opacity: .17; }

@media (min-width: 900px) {
  :root { --frame: 1280px; --gutter: max(10px, calc((100% - var(--frame)) / 2 + 10px)); }
  main, .disclosure { max-width: var(--frame); }
  .masthead { padding-inline: var(--gutter); }
  .price-shortcuts button { min-height: 34px; }

}



/* 2026-11-09 F: listing view, saving headline, trade metrics band. */
.book-view { grid-template-columns: auto auto; gap: 4px; }
.book-view button { min-height: 36px; padding: 4px 12px; font-size: var(--fs-sm); }
.list-row { display: grid; gap: 4px; padding: 8px 12px; border-bottom: 1px solid var(--row-line); font-variant-numeric: tabular-nums; }
.list-line { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; min-width: 0; }
.list-price { font-size: var(--fs-md); font-weight: 600; }
.list-left, .list-total { font-size: var(--fs-sm); }
.list-meta { color: var(--quiet); font-size: var(--fs-xs); }
.list-mine { padding: 2px 8px; border-radius: 999px; background: var(--pill); color: var(--pill-ink); font-weight: 600; }
.list-take { margin-left: auto; min-height: 36px; padding: 4px 16px; }
.list-row.ask .list-take:not(:disabled) { color: var(--sell); border-color: var(--sell); }
.list-row.bid .list-take:not(:disabled) { color: var(--buy); border-color: var(--buy); }
.list-more { width: calc(100% - 24px); margin: 8px 12px; }
.saving-headline { padding: 8px 12px; border-radius: 8px; background: var(--wash); font-size: var(--fs-md); }
.saving-headline small { display: block; color: var(--quiet); font-size: var(--fs-sm); }
.ticker .metrics { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; border-top: 1px solid var(--line); border-left: 0 !important; padding-block: 4px; }
.ticker .metrics dd { font-weight: 600; font-size: var(--fs-sm); }

/* 2026-11-09 G: desktop density (Binance-P2P-like 36-40px controls; phones keep 44px+ touch targets). */
@media (min-width: 900px) {
  .choice button, .plain { min-height: 38px; }
  .primary { min-height: 40px; }
  .order-panel > .side button { min-height: 44px; }
  .field, #duration { min-height: 40px; }
}
/* Recommended price line under the price input; pool/recent/comparison detail folds into #price-details. */
.recommended { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; margin-top: 4px; padding: 8px 12px; border-radius: 8px; background: var(--wash); font-size: var(--fs-sm); }
.recommended[hidden] { display: none; }
.recommended .chip { padding: 2px 8px; border-radius: 999px; background: var(--buy); color: var(--on-signal); font-weight: 600; font-size: var(--fs-xs); }
.recommended strong { font-size: var(--fs-md); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.recommended button { margin-left: auto; min-height: 32px; padding: 2px 12px; }
.recommended small { flex-basis: 100%; }
#price-details h3 { margin-top: 8px; font-size: var(--fs-sm); font-weight: 600; }
#price-details .note + .note { margin-top: 4px; }
.market-references { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.market-references .market-reference { margin-top: 0; padding: 8px; }
.market-references .market-reference strong { font-size: var(--fs-md); }
.market-references .market-reference p { font-size: var(--fs-xs); }
.market-references #recent-price-apply { min-height: 32px; margin-top: 4px; font-size: var(--fs-xs); }
/* 1440x900: the order panel through 「주문 확인」 fits the first screen (desktop pointer only; mobile keeps 44px targets). */
@media (min-width: 1200px) {
  /* 320px column: the gap line repeats the small print, so it hides here and the price keeps the row. */
  .recommended { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 2px 8px; padding: 4px 8px; }
  .recommended #recommended-gap { display: none; }
  #recommended-gap { grid-column: 3 / -1; white-space: nowrap; font-size: var(--fs-xs); }
  /* 2026-11-11 (user): the split sentence moves into #price-details here (app.js placeSplit); 적용 keeps its own row. */
  .recommended button { grid-row: 2; grid-column: 3; margin: 0; min-height: 28px; padding-block: 0; }
  .order-panel > .side button { min-height: 38px; }
  #order-panel .panel-head { padding-block: 4px; }
  #order-form { gap: 4px; padding-top: 8px; }
  .receipt-paper > label { margin-bottom: -3px; }
  #order-form .field, #budget-fields .field, #duration { min-height: 34px; }
  .field input { padding-block: 4px; }
  .choice button, #order-form .plain { min-height: 32px; padding-block: 4px; }
  #order-form .price-shortcuts button { min-height: 28px; }
  .field + .price-shortcuts { margin-top: 4px; }
  .price-shortcuts + .note { margin-top: 0; }
  /* Budget section stacks: title row, input+apply row, buy % chips, note. */
  #budget-fields { padding-block: 4px; }
  #budget-fields label { margin: 0; }
  #budget-fields .lookup { padding: 2px 0; }
  #duration-fields { grid-template-columns: auto 1fr; align-items: center; column-gap: 8px; }
  #duration-fields label { margin: 0; }
  .order-quote { display: grid; grid-template-columns: auto 1fr; align-items: baseline; column-gap: 8px; padding: 5px 10px; }
  .order-quote strong { text-align: right; font-size: var(--fs-lg); }
  .order-quote p { grid-column: 1 / -1; }
  .saving-headline { padding: 4px 10px; }
  .primary { min-height: 40px; }
}

/* ===== 2026-11-09 B: HELIX receipt — order form as a thermal receipt (approved helix-light/dark). =====
   One gradient (the submit button), one motion (a changed receipt line feeds up 250ms). */
.masthead { background: var(--panel); }
/* Sun/moon toggle: 36px circle; ::after widens the hit area to 44px. The icon shown is the theme a press switches to. */
#theme-toggle { position: relative; flex: none; display: inline-grid; place-items: center; width: 36px; height: 36px; min-height: 36px; padding: 0; border: 1px solid var(--line); border-radius: 50%; color: var(--quiet); }
#theme-toggle::after { content: ""; position: absolute; inset: -4px; }
#text-size { min-height: 36px; padding: 3px 12px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--quiet); font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; }
#text-size b { color: var(--ink); font-weight: 600; margin-right: 4px; }
#theme-toggle svg { display: none; width: 20px; height: 20px; }
#theme-toggle .moon { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) #theme-toggle .moon { display: none; } :root:not([data-theme="light"]) #theme-toggle .sun { display: block; } }
:root[data-theme="dark"] #theme-toggle .moon { display: none; }
:root[data-theme="dark"] #theme-toggle .sun { display: block; }
.invite-link { border: 0; background: var(--pill); color: var(--pill-ink); }
.invite-link:focus-visible { background: var(--wash); color: var(--pine); }
.market-head, .listing-view { border-radius: 20px; background: var(--panel); box-shadow: var(--shadow); }
.market-title { border-radius: 19px 19px 0 0; }
.panel-head { background: transparent; }

/* Receipt paper */
#order-panel { background: var(--paper); }
#order-panel .panel-head { border-bottom: 1px dashed var(--line); }
.order-quote { border: 0; border-radius: 8px; background: var(--wash); }
.receipt-lines { padding-top: 10px; border-top: 1px dashed var(--edge); font-variant-numeric: tabular-nums; }
.receipt-lines > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-block: 2px; overflow: hidden; }
.receipt-lines dt { color: var(--quiet); }
.receipt-lines dd { min-width: 0; text-align: right; }
.receipt-lines .total { margin-top: 4px; padding-top: 6px; border-top: 1px solid var(--ink); font-size: var(--fs-lg); font-weight: 600; }
.receipt-lines .total dt { color: var(--ink); }
.receipt-lines .print { animation: receipt-feed 250ms cubic-bezier(.2, .7, .2, 1); }
@keyframes receipt-feed { from { transform: translateY(100%); } }
/* Torn edge under the printed lines: original comp's tooth mask on a strip. */
/* 2026-11-12: the submit button is the solid --pine primary (gradient removed); white/black --on-signal text 5.70 / 7.72. */
#order-submit { border: 0; }
@media (prefers-reduced-motion: reduce) {
  .receipt-lines .print { animation: none; }
}

/* Quote sheet: last trade band between asks and bids */
.book-mid { background: transparent; border-block-color: var(--ink); padding-block: 8px; }
.book-mid strong { font-size: 40px; font-weight: 600; line-height: 1; letter-spacing: -.01em; color: var(--pine); }
.depth-columns { border-bottom: 1px solid var(--ink); }
.ticker #last-price { color: var(--pine); }

/* My orders: torn stub */
#my-section .receipt, .credits { border: 0; border-top: 2px dashed var(--line); border-radius: 0; background: var(--wash); }
#my-section .panel-head { border-bottom: 2px dashed var(--line); }

/* Phone first: one column, quote sheet before the receipt (visual order only; DOM unchanged). */
main { display: flex; flex-direction: column; gap: 12px; padding-top: 10px; }
.board { display: contents; }
main > .market-head, main > .listing-view, main > .own-panel, main > .history-panel { margin: 0; }
.market-head { order: 1; } main > .listing-view { order: 2; } .depth-panel { order: 3; } #order-panel { order: 4; }
#my-section { order: 5; } #pending-recovery { order: 6; } .history-panel { order: 7; }

@media (min-width: 900px) {
  main { display: grid; gap: 16px 20px; align-items: start; grid-template-columns: 320px minmax(0, 1fr);
    grid-template-rows: auto auto auto 1fr auto auto auto;
    grid-template-areas: "head head" "order depth" "order depth" "order ." "my my" "pend pend" "hist hist"; }
  .market-head { grid-area: head; }
  #order-panel { grid-area: order; }
  .depth-panel { grid-area: depth; }
  #my-section { grid-area: my; }
  #pending-recovery { grid-area: pend; }
  .history-panel { grid-area: hist; }
  .listing-mode main { grid-template-areas: "head head" "list list" "my my" "pend pend" "hist hist"; grid-template-rows: none; }
  .listing-mode main > .listing-view { grid-area: list; }
}

@media (min-width: 1200px) {
  :root { --frame: 1400px; }
  main { grid-template-columns: 320px minmax(0, 1fr) 320px; grid-template-rows: auto auto auto auto 1fr;
    grid-template-areas: "title title wallet" "order ticker wallet" "order depth my" "order depth hist" "order pend hist"; }
  .market-head { display: contents; }
  .market-title, .wallet-summary, .ticker { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
  .market-title { grid-area: title; flex-wrap: nowrap; align-items: center; }
  .wallet-summary { grid-area: wallet; align-self: stretch; padding-block: 8px; }
  /* 2026-11-11 font scale: label sits above its value (inline no longer fits four columns at 18px). */
  .ticker div { padding-block: 8px; }
  .ticker .metrics { padding-block: 4px; }
  .order-panel > .side button { min-height: 34px; }
  #order-form { gap: 4px; }
  .wallet-summary summary { min-height: 0; padding-block: 2px; }
  /* Ticker = one line in the quote sheet's head. */
  .ticker { grid-area: ticker; margin-bottom: -16px; border-bottom: 0; border-radius: 20px 20px 0 0; box-shadow: none; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .depth-panel { border-top-left-radius: 0; border-top-right-radius: 0; }
  .depth-panel > .panel-head:first-child { border-radius: 0; }
  .depth-row { min-height: 26px; padding-block: 2px; }
  #my-section, .history-panel { align-self: stretch; }
  #my-section .scroll { max-height: 220px; }
  /* 1440x900: receipt through the submit button and the quote sheet on the first screen. */
  .market-title { padding-block: 8px; }
  .market-title > div:first-child { display: flex; align-items: center; gap: 4px 12px; flex-wrap: wrap; }
  .market-title > div:first-child p { margin: 0; }
  .receipt-lines { padding-top: 6px; font-size: var(--fs-sm); line-height: 1.3; }
  .receipt-lines > div { padding-block: 1px; }
  .receipt-lines .total { margin-top: 2px; padding-top: 3px; font-size: var(--fs-lg); }
  #order-form { padding: 0; }
  .receipt-paper { padding-top: 8px; }
  .book-mid { padding-block: 8px; }
  .depth-panel .panel-head { padding-block: 4px; }
  .depth-panel .panel-note { margin: 8px 12px; font-size: var(--fs-xs); }
  .depth-side h3 { padding-block: 2px; }
  .depth-columns { padding-block: 4px; }
  main { row-gap: 12px; padding-top: 8px; }
  .ticker { margin-bottom: -12px; }
  #order-form .note, #order-form .saving-headline small { font-size: var(--fs-xs); line-height: 1.3; }
  #order-form .price-shortcuts button { min-height: 26px; }
  .saving-headline { padding-block: 3px; font-size: var(--fs-base); }
  .masthead { padding-block: 4px; }
  /* Wide screens have room for the wallet hint on the same row; keeping it there holds the 1440x900 first screen with the 17px base. */
  #wallet-status { flex-basis: auto; }
  .market-title { padding-block: 4px; }
  .order-quote { padding-block: 3px; }
  .listing-mode main { grid-template-areas: "title title wallet" "ticker ticker wallet" "list list my" "list list hist" "pend pend hist"; grid-template-rows: auto auto auto 1fr auto; }
  .listing-mode main .ticker { grid-column: auto; grid-area: ticker; margin-bottom: 0; border-bottom: 1px solid var(--line); border-radius: 20px; }
}

/* ===== 2026-11-09 B finish review fixes ===== */
/* 1. The paper ends at the teeth; the submit button and the detail fold sit on the canvas below it. */
#order-panel { background: transparent; border: 0; box-shadow: none; }
#order-panel > .side, #order-panel > .panel-head, #order-panel > .activity, .receipt-paper { background: var(--paper); border-inline: 1px solid var(--line); }
#order-panel > .side { overflow: hidden; border-top: 1px solid var(--line); border-radius: 20px 20px 0 0; }
#order-panel > .activity { margin: 0; border-radius: 0; padding: 8px 12px; }
#order-form { padding: 0; }
.receipt-paper { display: grid; gap: inherit; padding: 12px 12px 26px;
  -webkit-mask: linear-gradient(#000 0 0) top / 100% calc(100% - 10px) no-repeat, conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / 20px 10px repeat-x;
          mask: linear-gradient(#000 0 0) top / 100% calc(100% - 10px) no-repeat, conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / 20px 10px repeat-x; }
#order-submit { margin-top: 4px; }
.nft-mode #order-panel { background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow); }

/* 3. Quote and saving headline print as receipt lines, not washed boxes; the bold total is the printed one. */
.order-quote, .saving-headline { margin: 0; padding: 2px 0; border: 0; border-radius: 0; background: none; }
.order-quote { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; column-gap: 12px; }
.order-quote span { font-size: var(--fs-sm); }
.order-quote strong { font-size: var(--fs-sm); font-weight: 400; letter-spacing: 0; text-align: right; }
.order-quote p { grid-column: 1 / -1; }
.saving-headline { font-size: var(--fs-sm); }
@media (min-width: 1200px) { .order-quote, .saving-headline { padding: 1px 0; } .order-quote strong { font-size: var(--fs-sm); } }

/* 2. My orders: one torn stub per order (label/value lines); table roles are set explicitly in app.js. */
#my-section table, #my-section tbody, #my-section tr, #my-section td { display: block; }
#my-section thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* 2026-11-12: each order is a --wash band under a dashed tear line (no rounded box inside the 20px panel). */
#my-section tr { margin: 0; padding: 8px 12px; border-top: 2px dashed var(--line); border-radius: 0; background: var(--wash); }
#my-section tr:first-child { border-top: 0; }
#my-section td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 1px 0; border: 0; text-align: right; white-space: normal; }
#my-section td::before { content: attr(data-label); color: var(--quiet); font-size: var(--fs-sm); text-align: left; }
#my-section td.empty { display: block; text-align: left; }
#my-section td.empty::before { content: none; }
#my-section .order-link { min-height: 32px; padding: 0; }


/* 6. Phone masthead/market head: label stays with its control; head compresses so the quote sheet starts on screen. */
.wallet-pick { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.wallet-pick:has(> #wallet[hidden]) { display: none; }
@media (max-width: 899px) {
  .masthead { padding-block: calc(4px + env(safe-area-inset-top)) 4px; }
  .market-title { padding: 8px 12px; gap: 4px 8px; }
  .market-title p { margin-top: 2px; font-size: var(--fs-xs); }
  .fee-labels { gap: 2px 8px; }
  .trial { padding: 1px 8px; font-size: var(--fs-xs); }
  .fee-policy { font-size: var(--fs-xs); }
  .wallet-summary { padding: 4px 12px; }
  .wallet-summary .note { font-size: var(--fs-xs); }
  .wallet-summary summary { padding-block: 8px; }
  .ticker div { padding: 4px 12px; }
}

/* 7. Disclosure marker: one drawn chevron (1.5px stroke) instead of the ▶ glyph. */
summary { list-style: none; display: flex; align-items: center; gap: 8px; }
summary::-webkit-details-marker { display: none; }
summary::before { content: ""; flex: none; width: 6px; height: 6px; margin-inline: 2px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); }
details[open] > summary::before { transform: rotate(45deg); }

/* Verification page (/verify): one reading column in every viewport; never the terminal's board grid. */
main.verification { display: block; max-width: 54rem; padding-block: 28px 44px; }
.verification h1 { margin: 0 0 6px; }
.verification > p { margin: 0; color: var(--quiet); }
.verification section { border-radius: 20px; }
.verification code { overflow-wrap: anywhere; }

/* ===== 2026-11-11 user review: price dropdown, DeBox box, phone order sheet ===== */
#recommended-split:empty { display: none; }
#price-details > #recommended-split { display: block; margin-bottom: 8px; line-height: 1.35; word-break: keep-all; }

/* Price adjust: native <select> (phone picker wheel) inside the price field, a violet pill so it reads as a control. */
/* The input keeps room for a 10-character price (787.189466 is ~6.05em at --fs-md); if the row cannot also hold the
   dropdown (320px with 「아주 크게」), the dropdown wraps to a second line inside the same bordered box. */
.price-field { padding-right: 4px; flex-wrap: wrap; column-gap: 8px; }
.price-field input { flex: 1 1 6.6em; min-width: 6.6em; text-overflow: ellipsis; }
/* The unit sits beside the field, so the placeholder (「현재 시가 802 DAI」) drops one step to fit; a longer one ends in … rather than a half glyph. */
.price-field input::placeholder { font-size: var(--fs-sm); }
.price-field .price-adjust { margin: 4px 0 4px auto; }
.price-adjust { flex: none; appearance: none; -webkit-appearance: none; min-height: 38px; padding: 4px 28px 4px 12px; border: 1.5px solid var(--pine); border-radius: 999px;
  background-color: var(--wash); color: var(--pine); font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; cursor: pointer;
  /* Drawn 1.5px chevron (two hard-stop triangles), not a ▾ glyph: same shape language as summary::before. */
  background-image: linear-gradient(45deg, transparent calc(50% - .75px), currentColor calc(50% - .75px), currentColor calc(50% + .75px), transparent calc(50% + .75px)),
    linear-gradient(-45deg, transparent calc(50% - .75px), currentColor calc(50% - .75px), currentColor calc(50% + .75px), transparent calc(50% + .75px));
  background-size: 6px 6px; background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%; background-repeat: no-repeat; }
.price-adjust:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.price-adjust option { color: var(--ink); background: var(--paper); font-weight: 400; }
@media (min-width: 1200px) { #order-form .price-field { min-height: 40px; gap: 8px; } .price-adjust { padding-inline: 8px 24px; background-position: calc(100% - 15px) 55%, calc(100% - 10px) 55%; } .price-field .price-adjust { margin-block: 1px; } }

/* DeBox notifications (user 2026-11-12, modelled on the reference popup): one line under 내 주문 opens a dialog with
   a round-dot QR that carries the guide symbol. The line stays no taller than the old folded box (46px). */
/* 2026-11-12: a --wash band closing the panel (bottom corners follow the 20px panel: 19px inside the 1px border), not a box in the panel. */
.debox-alerts { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0; padding: 2px 12px; border: 0; border-top: 1px solid var(--line); border-radius: 0 0 19px 19px; background: var(--wash); font-size: var(--fs-sm); }
.debox-alerts span { min-width: 0; color: var(--quiet); font-size: var(--fs-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.debox-open { min-height: 40px; padding: 4px 12px; border: 0; border-radius: 8px; background: var(--paper); color: var(--pine); font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; }
.debox-dialog { width: min(420px, calc(100% - 24px)); max-height: calc(100dvh - 24px); overflow-y: auto; padding: 28px 20px 20px; border: 1px solid var(--line); border-radius: 28px; text-align: center; box-shadow: var(--shadow); }
/* Close: a drawn 1.5px cross (no × glyph); the accessible name stays aria-label 「닫기」. */
.debox-close { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--wash); color: var(--quiet); }
.debox-close::before, .debox-close::after { content: ""; position: absolute; top: 50%; left: 50%; width: 14px; height: 1.5px; margin: -.75px 0 0 -7px; border-radius: 1px; background: currentColor; transform: rotate(45deg); }
.debox-close::after { transform: rotate(-45deg); }
.debox-dialog h2 { margin: 0 40px 8px; font-size: var(--fs-lg); font-weight: 600; word-break: keep-all; }
.debox-lead, .debox-phone, .debox-get { color: var(--quiet); font-size: var(--fs-sm); word-break: keep-all; }
.debox-qr-card { width: min(240px, 100%); margin: 16px auto 8px; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; background: #fff; } /* white in dark mode too; the PNG carries its own quiet zone */
.debox-qr { display: block; width: 100%; height: auto; }
.debox-save { display: inline-block; margin-bottom: 8px; color: var(--quiet); font-size: var(--fs-xs); } /* desktop: same file as the long-press photo */
.debox-link { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; margin-top: 12px; padding: 4px 20px; border-radius: 999px; background: var(--pine); color: var(--on-signal); font-weight: 600; text-decoration: none; white-space: nowrap; }
.debox-steps { margin-top: 12px; text-align: left; font-size: var(--fs-sm); border-top: 1px solid var(--line); padding-top: 8px; }
.debox-steps summary { justify-content: center; padding: 8px 0; color: var(--pine); font-weight: 600; cursor: pointer; } /* centred like the rest of the card; the open list stays left */
.debox-steps ol { margin: 4px 0 0; padding-left: 1.2em; display: grid; gap: 4px; }
.debox-get { margin-top: 8px; } .debox-get a { color: var(--pine); font-weight: 600; }

/* Phone order sheet (<900px single column): the bar opens #order-panel from the bottom; desktop keeps the grid. */
.order-bar, .sheet-close, .sheet-backdrop { display: none; }
@media (max-width: 899px) {
  /* Static class on index.html's body (no :has(), which older Safari lacks); NFT and listing views hide the bar and drop the room. */
  body.has-order-bar:not(.nft-mode):not(.listing-mode) { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  body:not(.nft-mode):not(.listing-mode) .order-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; position: fixed; inset: auto 0 0; z-index: 20;
    padding: 8px max(12px, env(safe-area-inset-right), calc((100% - 560px) / 2 + 10px)) calc(8px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left), calc((100% - 560px) / 2 + 10px));
    background: var(--panel); border-top: 1px solid var(--line); box-shadow: var(--shadow-up); }
  .order-bar button { min-height: 52px; border: 0; border-radius: 12px; color: var(--on-signal); font-size: var(--fs-md); font-weight: 600; }
  #open-buy { background: var(--buy); }
  #open-sell { background: var(--sell); }
  .sheet-backdrop:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 30; background: var(--backdrop); }
  .sheet-lock, .sheet-lock body { overflow: hidden; }
  body:not(.nft-mode) #order-panel { position: fixed; inset: auto 0 0; z-index: 40; display: flex; flex-direction: column; max-width: 560px; max-height: 92dvh; margin-inline: auto;
    overflow-y: auto; overscroll-behavior: contain; padding-bottom: env(safe-area-inset-bottom);
    scroll-padding-top: 72px; scroll-padding-bottom: calc(84px + env(safe-area-inset-bottom)); /* sticky title row / 주문 확인 strip (72px) */
    background: var(--paper); border-radius: 20px 20px 0 0; box-shadow: var(--shadow-up);
    transform: translateY(100%); visibility: hidden; transition: transform 250ms cubic-bezier(.2, .7, .2, 1), visibility 0s linear 250ms; }
  body:not(.nft-mode) #order-panel.sheet-open { transform: none; visibility: visible; transition: transform 250ms cubic-bezier(.2, .7, .2, 1); }
  body:not(.nft-mode) #order-panel > * { flex: none; }
  body:not(.nft-mode) #order-panel > .panel-head { order: -1; position: sticky; top: 0; z-index: 2; padding: 8px 8px 8px 16px; background: var(--paper); border-radius: 20px 20px 0 0; border-inline: 0; }
  body:not(.nft-mode) #order-panel > .panel-head h2 { font-size: var(--fs-lg); }
  body:not(.nft-mode) #order-panel > .side { border-radius: 0; border-inline: 0; border-top: 0; }
  body:not(.nft-mode) .receipt-paper { border-inline: 0; }
  body:not(.nft-mode) .sheet-close { display: inline-flex; align-items: center; margin-left: auto; min-height: 44px; padding-inline: 16px; border-radius: 999px; }
  /* 주문 확인 stays on screen at the bottom of the sheet while the form scrolls. */
  /* The paper strip behind it is a separate sticky box: the disabled button is translucent (opacity .57) and must not show the form through. */
  body:not(.nft-mode) #order-submit { position: sticky; bottom: 10px; z-index: 1; width: auto; margin: 4px 12px 0; }
  body:not(.nft-mode) #order-form::after { content: ""; position: sticky; bottom: 0; height: 72px; background: var(--paper); box-shadow: 0 -1px 0 var(--line); pointer-events: none; }
  body:not(.nft-mode) #price-details { margin-inline: 12px; }
}
@media (max-width: 899px) and (prefers-reduced-motion: reduce) {
  body:not(.nft-mode) #order-panel, body:not(.nft-mode) #order-panel.sheet-open { transition: none; }
}
/* 2026-11-11: a price that crosses the best opposite quote fills at once (taker fee); say so next to the price. */
.cross-notice { display: grid; gap: 2px; margin-top: 4px; padding: 4px 12px; border-radius: 8px; border-left: 3px solid var(--gold); background: var(--wash); font-size: var(--fs-sm); line-height: 1.3; word-break: keep-all; }
.cross-notice[hidden] { display: none; }
.cross-notice #cross-title { font-weight: 600; }
.cross-notice #cross-split, .cross-notice small { color: var(--quiet); }
.cross-notice #cross-title span, .cross-notice button span { white-space: nowrap; } /* a price in parentheses moves to the next line whole */
.cross-notice button[hidden], .cross-notice button[hidden] + small { display: none; }
.cross-notice button { justify-self: start; max-width: 100%; min-height: 36px; margin-top: 2px; padding: 2px 12px; font-size: var(--fs-sm); line-height: 1.35; }
/* 2026-11-11 r3: best opposite quote beside the price label (wraps under it when the row is too narrow) and the who-pays fee line. */
.price-label-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 8px; margin-bottom: 4px; }
#order-form .price-label-row label { margin: 0; }
.best-quote { margin-left: auto; padding: 0; border: 0; background: none; color: var(--quiet); font: inherit; font-size: var(--fs-sm); text-align: right; cursor: pointer; }
.best-quote[hidden] { display: none; }
.best-quote strong { font-weight: 600; font-variant-numeric: tabular-nums; }
.best-quote:focus-visible strong { text-decoration: underline; }
.best-quote:disabled { cursor: default; opacity: 1; }
.fee-rule { margin-top: 2px; color: var(--quiet); font-size: var(--fs-xs); line-height: 1.35; }
.fee-rule strong { color: inherit; font-weight: 600; }
.confirmation-data dd small { display: block; color: var(--quiet); font-size: var(--fs-sm); font-weight: 400; }
@media (max-width: 899px) { .best-quote { min-height: 44px; } }
@media (min-width: 900px) { .cross-notice #cross-apply-note { display: none; } .cross-notice button { min-height: 0; margin-top: 1px; padding-block: 2px; line-height: 1.3; } }
/* Two wordings in one element, one displayed (display:none is not read): full below 1200px, short from 1200px. */
.wide-text { display: none; }
@media (min-width: 1200px) { .wide-text { display: inline; } .narrow-text { display: none; } }

/* ===== 2026-11-12 touch polish (plush-ui feel) and slop sweep (unslop) =====
   Keeps the receipt metaphor, --pine, the two signal colours and Pretendard. Transform moves on a spring
   (--ease-spring / --dur-spring); colour and opacity fade in 120-200ms. Hover lives in (hover: hover) only;
   reduced motion removes every movement (the receipt print and the sheet slide keep their own rules above). */

/* Buy/sell segment: a --wash track with the active side as a pill sitting 4px inside (8px = 12px track - 4px).
   The track keeps the old segment height: 48 -> 52 phone (44px pill), 44 from 900px, 34 from 1200px. */
#order-panel > .side { position: relative; isolation: isolate; padding: 8px 16px 4px; border-bottom: 0; }
#order-panel > .side::before { content: ""; position: absolute; inset: 4px 12px 0; z-index: -1; border-radius: 12px; background: var(--wash); }
#order-panel > .side button { min-height: 44px; border: 0; border-radius: 8px; background: transparent; }
@media (min-width: 900px) { #order-panel > .side button { min-height: 36px; padding-block: 4px; } }
@media (min-width: 1200px) {
  #order-panel > .side { padding: 12px 16px 4px; }
  #order-panel > .side::before { inset: 8px 12px 0; }
  #order-panel > .side button { min-height: 26px; padding-block: 0; line-height: 1.3; }
}

/* Motion pairs: transform on the spring, colour on the fade. Primary fills keep their colour fixed (no colour transition:
   a theme switch must not pass through a low-contrast mix) and dim with filter on hover. */
button, .invite-link, .debox-link, .price-adjust {
  transition: transform var(--dur-spring) var(--ease-spring), background-color var(--dur-fast) var(--ease-fade), color var(--dur-fast) var(--ease-fade),
    border-color var(--dur-fast) var(--ease-fade), opacity var(--dur-fade) var(--ease-fade); }
.primary, .order-bar button, .listing-take, .debox-link {
  transition: transform var(--dur-spring) var(--ease-spring), filter var(--dur-fast) var(--ease-fade), opacity var(--dur-fade) var(--ease-fade); }
@media (prefers-reduced-motion: no-preference) {
  /* Press: wide buttons .97, pills and chips .95, whole quote rows barely (.99: a 700px row at .97 would jump 20px). */
  :is(.primary, .plain, .choice button, .order-bar button, .listing-take, .list-take, .debox-link, .sheet-close):not(:disabled):active { transform: scale(.97); }
  :is(.price-shortcuts button, .recommended button, .invite-link, .debox-open, .debox-close, .price-adjust, .intervals button, .listing-markets button, .cross-notice button, #text-size, #theme-toggle):not(:disabled):active { transform: scale(.95); }
  .depth-row:active { transform: scale(.99); }
}
@media (hover: hover) {
  .plain:not(:disabled):hover, .depth-row:hover { background-color: var(--wash); }
  .invite-link:hover { background-color: var(--wash); color: var(--pine); }
  .primary:not(:disabled):hover, .order-bar button:hover, .debox-link:hover { filter: brightness(.93); }
  .price-adjust:not(:disabled):hover { background-color: var(--select); }
  .best-quote:not(:disabled):hover strong { text-decoration: underline; }
  #order-panel > .side button[aria-pressed="false"]:hover { background-color: var(--paper); }
  .debox-close:hover { color: var(--ink); }
}

/* Dialogs (all four): open = fade + small rise on the spring; close = the same path back in 150ms (exit faster than entry).
   The scrim fades both ways. Without @starting-style / allow-discrete a browser simply opens and closes instantly.
   Focus, Esc and close() are unchanged; the open attribute still flips at once. */
dialog { opacity: 0; transform: translateY(8px) scale(.96);
  transition: opacity 150ms var(--ease-out), transform 150ms var(--ease-out), overlay 150ms allow-discrete, display 150ms allow-discrete; }
dialog[open] { opacity: 1; transform: none;
  transition: opacity var(--dur-fade) var(--ease-fade), transform var(--dur-spring) var(--ease-spring), overlay var(--dur-fade) allow-discrete, display var(--dur-fade) allow-discrete; }
dialog::backdrop { opacity: 0; transition: opacity 150ms var(--ease-out), overlay 150ms allow-discrete, display 150ms allow-discrete; }
dialog[open]::backdrop { opacity: 1; transition: opacity var(--dur-fade) var(--ease-fade), overlay var(--dur-fade) allow-discrete, display var(--dur-fade) allow-discrete; }
@starting-style { dialog[open] { opacity: 0; transform: translateY(8px) scale(.96); } dialog[open]::backdrop { opacity: 0; } }
#confirm { border-color: var(--line); box-shadow: var(--shadow); }
@media (prefers-reduced-motion: reduce) { dialog, dialog[open], dialog::backdrop, dialog[open]::backdrop { transition: none; } }

/* Drawn chevron (1.5px, pointing right) where a → glyph used to sit in running text. */
.chev { display: inline-block; width: 6px; height: 6px; margin: 0 6px 1px 4px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); vertical-align: middle; }

/* NFT market (?market=awake) layout, moved here from nft.js: its injected <style> was blocked by CSP style-src 'self'. */
.nft-mode #order-panel,.nft-mode .depth-panel,.nft-mode #my-section{min-width:0}
.nft-mode .nft-body{display:grid;gap:8px;width:100%;min-width:0;box-sizing:border-box;padding:0 14px 14px}
.nft-mode .nft-form{display:grid;gap:8px;width:100%;min-width:0}
.nft-mode .nft-form input:not([type=checkbox]),.nft-mode .nft-form select,.nft-mode .nft-lookup input,.nft-mode .nft-lookup select{width:100%;min-width:0;min-height:44px;box-sizing:border-box;border:1px solid var(--edge);border-radius:8px;padding:8px 12px;font:inherit;background:var(--paper);color:var(--ink)}
.nft-mode .nft-form input[type=checkbox]{width:28px;min-height:28px}
.nft-mode .nft-pick{margin:0;padding:8px 12px;border-radius:8px;background:var(--wash);font-variant-numeric:tabular-nums}
.nft-mode .nft-books{container-type:inline-size;width:100%;min-width:0}
.nft-mode .nft-books h3{margin:12px 0 4px;font-size:.95rem}
.nft-mode .nft-list{--cols:repeat(5,minmax(0,1fr));display:grid;width:100%;min-width:0}
.nft-mode .nft-list[data-kind=bid]{--cols:repeat(4,minmax(0,1fr))}
.nft-mode .nft-item{display:grid;grid-template-columns:var(--cols);gap:2px 8px;width:100%;min-width:0;box-sizing:border-box;padding:8px;border:0;border-bottom:1px solid var(--line);background:none;color:inherit;font:inherit;font-size:.9rem;text-align:left;font-variant-numeric:tabular-nums}
.nft-mode button.nft-item{cursor:pointer}
.nft-mode button.nft-item:focus-visible{background:var(--wash)}
@media (hover:hover){.nft-mode button.nft-item:hover{background:var(--wash)}}
.nft-mode .nft-item>span{min-width:0;overflow-wrap:anywhere}
.nft-mode .nft-item.head{color:var(--quiet);font-size:.78rem;font-weight:600}
.nft-mode .nft-empty{margin:8px 0;color:var(--quiet)}
@container (max-width:420px){.nft-mode .nft-list[data-kind=listing]{--cols:repeat(3,minmax(0,1fr))}}
.nft-mode .nft-lookup{display:flex;flex-wrap:wrap;gap:8px;align-items:center;width:100%;min-width:0}
.nft-mode .nft-lookup input,.nft-mode .nft-lookup select{flex:1 1 8rem;width:auto}
.nft-mode #nft-my-list .nft-row{gap:8px;padding:8px 0}
.nft-mode .nft-lock{margin:0;color:var(--sell);font-size:var(--fs-sm)}
.nft-mode .nft-item>.nft-lock{grid-column:1/-1}

/* ===== 2026-11-12 r2: plush-ui shapes — button, toggle / toggle-group, status badge =====
   plush-ui (MIT, Dominik Martin 2026)에서 옮김: components/ui/button.tsx (default·outline), toggle.tsx, toggle-group.tsx,
   badge.tsx + demos/badge.tsx (the black "Sent" status pill), registry/tokens/tokens.css (shadow-soft/knob, select gloss, h-status).
   Mapping: plush default (black) -> our .primary on --pine; outline (white, shadow instead of border) -> .plain;
   toggle on (gradient fill + tick) -> --pine face + drawn tick; group = pills on a --wash plate. Heights from 1200px stay as before. */
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* Buttons: pill corners everywhere; primary = solid --pine with the top gloss; plain = white knob floating on a soft shadow. */
.plain, .primary, .choice button, .order-bar button, .sheet-close, .list-take, .listing-take, .debox-open { border-radius: 999px; }
.plain { border: 0; background-color: var(--knob); box-shadow: var(--knob-shadow); }
.primary, #order-submit, .order-bar button, .listing-take { box-shadow: var(--gloss); }
.primary { border: 0; }
@media (hover: hover) {
  .plain:not(:disabled):hover { background-color: var(--knob); box-shadow: var(--knob-shadow-hover); }
  :root[data-theme="dark"] .plain:not(:disabled):hover { background-color: var(--pill); }
}
@media (hover: hover) and (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .plain:not(:disabled):hover { background-color: var(--pill); } }
.plain, .choice button { transition: transform var(--dur-spring) var(--ease-spring), background-color var(--dur-fast) var(--ease-fade), box-shadow var(--dur-fast) var(--ease-fade), color var(--dur-fast) var(--ease-fade), opacity var(--dur-fade) var(--ease-fade); }
/* Masthead: text size and theme are knob pills, not outlined chips. */
#theme-toggle, #text-size { border: 0; background-color: var(--knob); box-shadow: var(--knob-shadow); }
.invite-link { border-radius: 999px; }
/* Phones: plush sizes (button 52px, chip 44px). */
@media (max-width: 899px) {
  .primary, #order-submit { min-height: 52px; }
  .order-bar button { min-height: 52px; }
  .plain { min-height: 44px; }
  #order-form .price-shortcuts button { min-height: 44px; }
}

/* Toggle groups: one --wash plate, white knob pills, the pressed one a --pine face (a darker step at the bottom, same hue) + tick. */
.toggle-plate, .book-view, .listing-segment, .listing-markets, .nft-mode .nft-tabs, #quantity-percents {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px; width: fit-content; max-width: 100%; padding: 4px;
  border: 0; border-radius: 26px; background: var(--wash); }
:is(.toggle-plate, .book-view, .listing-segment, .listing-markets, .nft-mode .nft-tabs) button {
  display: inline-flex; align-items: center; justify-content: center; min-width: 0; min-height: 44px; margin: 0; padding: 0 16px;
  border: 0; border-radius: 999px; background: var(--knob); box-shadow: var(--knob-shadow); color: var(--ink);
  font-size: var(--fs-base); font-weight: 600; line-height: 1.2; white-space: nowrap; }
:is(.toggle-plate, .book-view, .listing-segment, .listing-markets, .nft-mode .nft-tabs) button[aria-pressed="true"] {
  background: linear-gradient(180deg, var(--pine), color-mix(in oklab, var(--pine), #000 8%)); color: var(--on-signal); box-shadow: var(--gloss), 0 1px 2px rgba(20, 20, 20, .12); }
/* Drawn tick (2px L rotated), never a glyph; the toggle widens for it like plush's ToggleTick. */
:is(.toggle-plate, .book-view, .listing-markets, #listing-view-toggle) button[aria-pressed="true"]::before {
  content: ""; flex: none; width: .6em; height: .32em; margin: -.2em .5em 0 -.15em; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); }
@media (prefers-reduced-motion: no-preference) {
  :is(.toggle-plate, .book-view, .listing-markets, #listing-view-toggle) button[aria-pressed="true"]::before { animation: tick-in var(--dur-spring) var(--ease-spring); }
  :is(.toggle-plate, .book-view, .listing-segment, .listing-markets, .nft-mode .nft-tabs) button:not(:disabled):active { transform: scale(.95); }
}
@keyframes tick-in { from { opacity: 0; transform: rotate(-45deg) scale(.55); } }
@media (hover: hover) {
  :is(.toggle-plate, .book-view, .listing-segment, .listing-markets, .nft-mode .nft-tabs) button[aria-pressed="false"]:not(:disabled):hover { color: var(--ink); background: var(--knob); box-shadow: var(--knob-shadow-hover); }
  :is(.toggle-plate, .book-view, .listing-segment, .listing-markets, .nft-mode .nft-tabs) button[aria-pressed="true"]:hover { filter: brightness(1.06); }
}
/* Buy/sell in the listing keep the signal faces (no tick: the colour is the mark). */
#listing-side button[data-value="buy"][aria-pressed="true"] { background: var(--buy); }
#listing-side button[data-value="sell"][aria-pressed="true"] { background: var(--sell); }
#listing-side button[aria-pressed="false"][data-value="buy"] { color: var(--buy); }
#listing-side button[aria-pressed="false"][data-value="sell"] { color: var(--sell); }
.listing-markets button { border-bottom: 0; }
/* NFT: three tabs share the row (the old grid), each a pill; no tick (the 320px column would wrap 「카드 팔기」), the face marks it. */
.nft-mode .nft-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: auto; margin: 12px 0; }
.nft-mode .nft-tabs button { white-space: normal; padding-inline: 8px; text-align: center; }
/* Quantity chips 10%…최대: knob pills on the plate (actions, not a selection: no pressed face). */
#quantity-percents { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); width: auto; padding: 3px; gap: 3px; }

/* Market pills in the title row: the selected market reads first; the group wraps on narrow phones. */
.market-selector.toggle-plate { margin: 0 0 4px; overflow: visible; }
.market-selector.toggle-plate button { font-size: var(--fs-md); }
/* Narrow phones: four pills do not fit one row, so they sit as an even 2 x 2 instead of a ragged wrap. */
@media (max-width: 480px) { .market-title > div:first-child { flex: 1 1 100%; min-width: 0; } .market-selector.toggle-plate { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .market-selector.toggle-plate button { padding-inline: 8px; font-size: var(--fs-base); } }
@media (min-width: 900px) {
  .market-selector.toggle-plate { border-radius: 22px; margin: 0; }
  :is(.toggle-plate, .book-view, .listing-segment, .listing-markets, .nft-mode .nft-tabs) button { min-height: 36px; padding-inline: 14px; }
  #quantity-percents button { min-height: 34px; }
}
@media (min-width: 1200px) {
  .market-selector.toggle-plate { flex: none; flex-wrap: nowrap; padding: 3px; gap: 3px; border-radius: 20px; }
  /* Pills and the description share one line; a long description wraps inside its own box instead of under the pills. */
  .market-title > div:first-child { flex-wrap: nowrap; min-width: 0; }
  .market-title > div:first-child p { min-width: 0; font-size: var(--fs-xs); line-height: 1.25; }
  .market-title .fee-labels { flex: none; flex-wrap: nowrap; }
  .market-selector.toggle-plate button { min-height: 32px; padding-inline: 12px; font-size: var(--fs-base); }
  .book-view { padding: 3px; gap: 3px; }
  .depth-panel .book-view button { min-height: 30px; }
  #order-form #quantity-percents button { min-height: 26px; }
  /* 2026-11-12: description on its own full-width line under the pills and fee badges (was squeezed to 3 lines at --fs-xs). */
  /* The second line costs ~20px; the row's padding and pill height give part of it back for the 1440x900 first screen. */
  .market-title { flex-wrap: wrap; row-gap: 0; padding-block: 2px; }
  .market-title > div:first-child { display: contents; }
  .market-title > div:first-child p { order: 1; flex: 1 0 100%; padding-bottom: 2px; font-size: var(--fs-sm); line-height: 1.25; }
  .market-selector.toggle-plate button { min-height: 30px; }
  /* Not connected: the balance % chips cannot fill anything (all disabled), so they and their note fold away here. */
  #quantity-percents:has(button:disabled), #quantity-percents:has(button:disabled) + #quantity-percents-note { display: none; }
  /* Moved under the submit button by app.js (placeBelow): keep the receipt's inner margin. */
  #order-form > :is(#wallet-jump, #clearing-note, #advance-book) { margin-inline: 12px; }
}

/* Buy/sell segment: the track and its pills turn round; the pressed side gets the gloss. */
#order-panel > .side::before { border-radius: 999px; }
#order-panel > .side button { border-radius: 999px; }
#order-panel > .side button[aria-pressed="true"] { box-shadow: var(--gloss), 0 1px 2px rgba(20, 20, 20, .12); }

/* Status pill (plush badge "Sent"): near-black pill, green disc with a drawn tick, short label. Rises on the spring and fades
   out after ~3s (markets.js / invite.js). It never takes pointer events, and sits above the phone order bar. */
.status-pill { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 60; display: inline-flex; align-items: center; gap: 10px;
  max-width: calc(100% - 32px); min-height: 52px; padding: 8px 22px 8px 8px; border-radius: 26px; background: var(--toast); color: var(--on-toast);
  font-size: var(--fs-md); font-weight: 600; line-height: 1.2; box-shadow: 0 2px 8px rgba(20, 20, 20, .16), 0 12px 32px rgba(20, 20, 20, .14);
  pointer-events: none; opacity: 0; transform: translateX(-50%); transition: opacity var(--dur-fade) var(--ease-fade); }
.status-pill:empty { padding: 0; min-height: 0; }
.status-pill.show { opacity: 1; }
.status-pill-mark { position: relative; flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--success); }
.status-pill-mark::after { content: ""; position: absolute; left: 50%; top: 50%; width: 13px; height: 7px; margin: -5px 0 0 -7px; border-left: 2.5px solid var(--on-success); border-bottom: 2.5px solid var(--on-success); transform: rotate(-45deg); }
@keyframes pill-rise { from { transform: translateX(-50%) translateY(16px) scale(.9); } }
@keyframes pill-pop { from { transform: scale(.55); } }
@media (prefers-reduced-motion: no-preference) {
  .status-pill.show { animation: pill-rise var(--dur-spring) var(--ease-spring); }
  .status-pill.show .status-pill-mark { animation: pill-pop var(--dur-spring) var(--ease-spring) 65ms backwards; }
}
@media (max-width: 899px) {
  /* Above the 「매수 주문」「매도 주문」 bar (76px + safe area), and above the sheet's sticky 주문 확인 strip (72px). */
  body.has-order-bar:not(.nft-mode):not(.listing-mode) .status-pill { bottom: calc(88px + env(safe-area-inset-bottom)); }
}

/* Copy help stays keyboard reachable; descriptions remain available to screen readers. */
#order-form .copy-help, .copy-help { min-width: 44px; min-height: 44px; padding: 4px; }
@media (min-width: 1200px) {
  .recommended .copy-help { grid-row: 1; grid-column: 3; min-height: 44px; }
}
@media (min-width: 1200px) {
  /* Keep every crossing warning visible when the ordinary comparison notes are folded. */
  .cross-notice { gap: 0; padding-block: 1px; line-height: 1.15; }
  .cross-notice button { min-height: 44px; padding-block: 0; line-height: 1.15; }
}

/* 2026-11-16 (총괄 계약): price stats = four cards, number first and large, label small and quiet; no dividers. */
.ticker { gap: 8px; padding: 8px 12px; }
.ticker > div:not(.metrics) { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 2px; padding: 8px 12px; border: 0 !important; border-radius: 12px; background: var(--wash); }
.ticker > div:not(.metrics) dt { color: var(--quiet); font-size: var(--fs-xs); font-weight: 400; }
.ticker > div:not(.metrics) dd { font-size: var(--fs-lg); font-weight: 600; line-height: 1.15; letter-spacing: -.01em; }
@media (min-width: 1200px) { .ticker { padding: 8px; } .ticker > div:not(.metrics) { padding: 6px 12px; } }
/* Help 「?」: a 24px circle drawn on a 44px transparent hit area, so it no longer reads as large as 적용. */
.plain.copy-help, .plain.copy-help:not(:disabled):hover { position: relative; isolation: isolate; border: 0; background: transparent; box-shadow: none; color: var(--quiet); font-size: var(--fs-xs); line-height: 1; }
.plain.copy-help::before { content: ""; position: absolute; z-index: -1; top: 50%; left: 50%; width: 24px; height: 24px; margin: -12px 0 0 -12px; border: 1px solid var(--edge); border-radius: 50%; background: var(--paper); }
.plain.copy-help:not(:disabled):hover::before { background: var(--wash); }
:root[data-theme="dark"] .plain.copy-help:not(:disabled):hover { background-color: transparent; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .plain.copy-help:not(:disabled):hover { background-color: transparent; } }

/* 2026-11-16 motion pass (animate): short and calm, transform/opacity only, all off under reduced motion.
   Depth rows are rebuilt on every book refresh (app.js replaceChildren), so they get no entrance and the meter no width
   transition: either would replay across the whole book on each poll. */
@media (prefers-reduced-motion: no-preference) {
  /* Notices (order error, crossing warning, activity, status notes): fade in once when unhidden. Never a repeat. */
  #order-error, #cross-notice, #activity, .note[role="status"] { transition: opacity var(--dur-fade) var(--ease-out); }
  @starting-style { #order-error, #cross-notice, #activity, .note[role="status"] { opacity: 0; } }
  /* 「?」 help: the drawn circle eases its fill on hover; press scale comes from .plain above. */
  .plain.copy-help::before { transition: background-color var(--dur-fast) var(--ease-fade); }
  /* Hook: price card values flash when app.js re-adds .changed after a new value (remove, reflow, add). 480ms, once. */
  .ticker dd.changed { animation: value-flash 480ms var(--ease-out); }
  /* Hook: a quiet 2px streak under an element marked aria-busy="true" (signing wait, lookup in flight). */
  :is(button, .note, .panel-note)[aria-busy="true"] { position: relative; overflow: hidden; }
  :is(button, .note, .panel-note)[aria-busy="true"]::after { content: ""; position: absolute; left: 0; bottom: 0; width: 40%; height: 2px;
    background: currentColor; opacity: .35; pointer-events: none; animation: busy-streak 1.2s linear infinite; }
}
@keyframes value-flash { from { opacity: .35; transform: translateY(3px); } }
@keyframes busy-streak { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
