/* The trading workspace shares the established VALKI colours and chart. */
.hero-signature { transform: translateY(114px); }
/* Keep the complete 1536 × 1024 artwork instead of cropping it to the hero height. */
@media (min-width: 841px) {
  .hero-signature { top: calc(50% - 14px); bottom: auto; height: auto; aspect-ratio: 3 / 2; transform: translateY(calc(114px - 50%)); }
  .hero-signature img { object-fit: contain; }
}
@media (min-width: 841px) and (max-height: 850px) {
  .hero-signature { top: calc(50% - 32px); }
}
.overview { min-height: 310px; padding: 22px 0 28px; gap: 48px; grid-template-columns: 1fr 1fr; }
.overview h1 { font-size: 54px; }
.overview .positioning { max-width: 460px; margin-top: 10px; font-size: 15px; }
.overview .price-lockup { margin-top: 18px; min-height: 0; }
.overview .price-lockup strong { font-size: 36px; }
.overview .route { margin-top: 12px; }
.overview .metric-grid { margin: 0; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.overview .metric { min-height: 112px; padding: 16px 18px; }
.overview .metric-head { margin-bottom: 12px; }
.overview .metric strong { font-size: 24px; }
.trade-workspace { display: grid; grid-template-columns: minmax(0,1.7fr) minmax(360px,1fr); gap: 24px; align-items: stretch; scroll-margin-top: 112px; margin: 12px 0 48px; }
.trade-workspace .market-chart { display: flex; flex-direction: column; padding: 22px; border-radius: 12px; }
.trade-workspace .chart-stage { flex: 1; min-height: 420px; height: auto; }
.trade-workspace .chart-stage canvas { position: absolute; inset: 0; }
.trade-workspace .chart-ranges button { width: 40px; }
.trade-workspace .chart-head { flex-wrap: wrap; gap: 14px; }
.swap-card { min-width: 0; padding: 24px; border: 1px solid rgba(114,135,180,.3); border-radius: 12px; background: linear-gradient(145deg,rgba(13,21,43,.96),rgba(8,13,27,.92)); box-shadow: var(--shadow); scroll-margin-top: 112px; }
.swap-card [hidden] { display: none !important; }
.swap-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.swap-heading .eyebrow { font-size: 9px; letter-spacing: .11em; margin: 0 0 7px; color: #9e93bf; }
.swap-heading h2 { margin: 0; font-size: 23px; letter-spacing: -.03em; }
.swap-card button,.swap-card input,.swap-card select { font: inherit; }
.swap-card button { cursor: pointer; transition: border-color .15s,background .15s,color .15s; }
.swap-card button:disabled { opacity: .42; cursor: not-allowed; }
.swap-card button:focus-visible,.swap-card input:focus-visible,.swap-card select:focus-visible,.swap-card a:focus-visible { outline: 2px solid #b49aff; outline-offset: 3px; }
.swap-card .swap-connect { border: 1px solid rgba(169,135,255,.5); background: rgba(139,97,233,.1); color: #dfd0ff; padding: 10px 12px; border-radius: 7px; font-size: 11px; font-weight: 650; white-space: nowrap; min-height: 40px; }
.swap-account { color: #8491ab; font-size: 10px; overflow-wrap: anywhere; margin: 11px 0 16px; }
.swap-balances { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; background: rgba(255,255,255,.025); border: 1px solid rgba(121,144,187,.15); border-radius: 8px; padding: 13px 15px; }
.swap-balances span { display: block; color: #8f9bb2; font-size: 10px; }
.swap-balances strong { display: block; color: #e7ecf7; font-size: 15px; margin-top: 6px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.swap-balances > div { min-width: 0; }
.swap-balances .swap-balance-label { display: flex; align-items: center; gap: 7px; }
.swap-balances .swap-buy-iq { display: inline-flex; align-items: center; gap: 5px; min-height: 32px; margin-top: 5px; color: #d4baff; font-size: 11px; line-height: 1.4; text-decoration: underline; text-underline-offset: 3px; }
.swap-balances .swap-buy-iq span { display: inline; color: inherit; font-size: inherit; }
.swap-buy-iq:hover { color: #f2eaff; }
.swap-tabs { display: flex; border-bottom: 1px solid rgba(121,144,187,.2); margin: 18px 0; }
.swap-tabs button { flex: 1; border: 0; border-bottom: 2px solid transparent; background: transparent; color: #909db4; padding: 12px 4px; font-size: 12px; font-weight: 700; }
.swap-tabs button.active { border-bottom-color: #b08bff; color: #d4baff; background: linear-gradient(0deg,rgba(153,105,255,.08),transparent); }
.swap-tabs button { display: flex; align-items: center; justify-content: center; gap: 7px; }
.swap-tabs .token-mark { width: 20px; height: 20px; flex-basis: 20px; }
.swap-card label { display: block; color: #b3bed2; font-size: 11px; font-weight: 600; }
.swap-route { margin-bottom: 15px; }
.swap-card select { display: block; width: 100%; min-height: 40px; margin-top: 8px; padding: 9px 11px; color: #d9dfee; background: #0d1425; border: 1px solid #334057; border-radius: 7px; font-size: 12px; color-scheme: dark; }
.swap-input { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 10px 13px; margin-top: 8px; background: #080f1e; border: 1px solid #35425b; border-radius: 8px; }
.swap-input:focus-within { border-color: #a381e9; outline: 2px solid #b49aff; outline-offset: 3px; }
.swap-card .swap-input input:focus-visible { outline: none; }
.swap-input input { width: 100%; min-width: 0; padding: 0; border: 0; color: #f2f4fb; background: transparent; font-size: 20px; font-variant-numeric: tabular-nums; outline: none; }
.swap-input > .token-tag { font-size: 11px; color: #d6c8ed; padding: 5px 7px; border: 1px solid rgba(163,134,220,.23); border-radius: 7px; }
.swap-portions { display: grid; grid-template-columns: repeat(4,1fr); gap: 7px; margin: 9px 0 16px; }
.swap-portions button { border: 1px solid #2d3850; background: transparent; color: #9daac0; min-height: 32px; border-radius: 5px; font-size: 10px; }
.swap-portions button:hover:not(:disabled) { color: #dfd0ff; border-color: #9170c8; background: rgba(153,105,255,.07); }
.swap-receive .swap-input { background: rgba(104,196,172,.025); border-color: rgba(119,194,176,.2); }
.swap-receive input { color: #91e6d0; }
.swap-details { margin: 18px 0; display: grid; gap: 9px; }
.swap-details div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 10px; }
.swap-details dt { color: #91a0b7; }
.swap-details dt span { color: #6e7b94; font-size: 9px; }
.swap-details dd { margin: 0; text-align: right; color: #d5deed; max-width: 56%; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.swap-actions { display: grid; gap: 9px; }
.swap-actions button { min-height: 42px; padding: 10px; border-radius: 7px; border: 1px solid #485374; color: #d4dcef; background: #111a2e; font-size: 12px; font-weight: 650; }
.swap-actions .swap-submit { color: #fff; background: linear-gradient(115deg,#724acf,#9863da); border-color: #9872db; }
.swap-actions .swap-approve { color: #ddcefb; border-color: #7b629f; background: rgba(147,101,220,.12); }
.swap-status { margin: 12px 0 0; color: #b4c0d4; font-size: 11px; line-height: 1.6; min-height: 34px; }
.swap-route-note { margin: 13px 0 0; padding-top: 12px; border-top: 1px solid rgba(121,144,187,.15); color: #798aa4; font-size: 10px; line-height: 1.6; }
.swap-hash { overflow-wrap: anywhere; font-size: 11px; color: #c5a5ff; }
.swap-hash:empty { display: none; }
.swap-steps { display: flex; justify-content: space-between; gap: 10px; margin: 12px 0 0; color: #b6a0dc; font-size: 10px; line-height: 1.5; }
.swap-notice { position: fixed; z-index: 1000; right: 24px; bottom: 24px; display: flex; align-items: flex-start; gap: 13px; width: min(430px,calc(100vw - 32px)); padding: 20px; border: 1px solid #8564bd; border-radius: 14px; background: #11192d; color: #e9e9f5; box-shadow: 0 12px 60px rgba(0,0,0,.6); }
.swap-notice[hidden],.swap-notice [hidden] { display: none !important; }
.swap-notice[data-tone="success"] { border-color: #54cba4; background: #0d241f; }
.swap-notice[data-tone="error"] { border-color: #dd7892; background: #291720; }
.swap-notice-icon { flex: 0 0 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: rgba(164,132,233,.16); color: #d3b9ff; font-size: 20px; font-weight: 700; }
.swap-notice[data-tone="success"] .swap-notice-icon { background: rgba(84,203,164,.16); color: #79edbe; }
.swap-notice[data-tone="error"] .swap-notice-icon { color: #ffa2b9; }
.swap-notice-copy { min-width: 0; flex: 1; }
.swap-notice strong { display: block; padding-top: 4px; font-size: 17px; }
.swap-notice p { margin: 9px 0 0; font-size: 13px; line-height: 1.55; }
.swap-notice [data-notice-detail] { color: #b6c3ce; font-size: 12px; }
.swap-notice a { display: inline-block; margin-top: 13px; color: #cfb7ff; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.swap-notice[data-tone="success"] a { color: #8ae9c7; }
.swap-notice button { flex: 0 0 32px; height: 32px; padding: 0; border: 0; border-radius: 5px; background: transparent; color: #b7c3d1; font-size: 24px; cursor: pointer; }
.swap-notice button:hover { background: rgba(255,255,255,.07); color: white; }
.swap-notice button:focus-visible,.swap-notice a:focus-visible { outline: 2px solid #bba0f2; outline-offset: 3px; }
/* Keep the complete trade controls visible beside the chart on a laptop. */
.trade-workspace,.swap-card { scroll-margin-top: 12px; }
.swap-card { padding: 20px; }
.swap-account { margin: 5px 0 8px; }
.swap-balances { padding: 9px 12px; }
.swap-balances strong { margin-top: 3px; }
.swap-tabs { margin: 12px 0; }
.swap-tabs button { padding: 10px 4px; }
.swap-route { margin-bottom: 10px; }
.swap-card select { min-height: 36px; margin-top: 6px; padding: 7px 10px; }
.swap-input { min-height: 44px; padding: 7px 11px; margin-top: 6px; }
.swap-portions { margin: 7px 0 10px; }
.swap-portions button { min-height: 28px; }
.swap-details { margin: 12px 0; gap: 6px; }
.swap-actions { grid-template-columns: 1fr 1fr; }
.swap-actions .swap-approve:not([hidden]) { grid-column: 2; }
.swap-actions:has(.swap-approve:not([hidden])) .swap-submit { grid-column: 1 / -1; }
.swap-status { min-height: 28px; margin-top: 10px; }
.swap-route-note { margin-top: 10px; padding-top: 8px; }
@media (max-width: 1000px) {
  .trade-workspace { grid-template-columns: minmax(0,1.3fr) minmax(330px,1fr); gap: 16px; }
  .swap-card,.trade-workspace .market-chart { padding: 18px; }
  .overview { gap: 24px; }
}
@media (max-width: 840px) {
  .overview { grid-template-columns: 1fr; padding: 12px 0 16px; gap: 16px; }
  .overview-copy { max-width: none; }
  /* Start mobile with the token label, then the market cards and chart. */
  .overview-copy > :not(.eyebrow) { display: none; }
  .overview-copy > .eyebrow { margin-bottom: 0; }
  .trade-workspace { grid-template-columns: 1fr; scroll-margin-top: 12px; }
  .trade-workspace .chart-stage { flex: none; height: 300px; min-height: 0; }
  .swap-card { scroll-margin-top: 12px; }
  .swap-card button { min-height: 44px; }
  .trade-workspace .chart-ranges button { width: 46px; }
}
@media (max-width: 500px) {
  .hero-signature { transform: translateY(37px); }
  .swap-notice { right: 16px; bottom: max(16px,env(safe-area-inset-bottom)); padding: 16px; gap: 10px; }
  .swap-notice button { flex-basis: 36px; height: 36px; }
  .overview h1 { font-size: 42px; }
  .overview .price-lockup { flex-direction: row; align-items: baseline; gap: 10px; }
  .overview .price-lockup strong { font-size: 30px; }
  .overview .metric { min-height: 103px; padding: 13px; }
  .overview .metric strong { font-size: 21px; }
  .overview .metric-head { gap: 6px; }
  .overview .metric-head p { font-size: 10px; }
  .trade-workspace .chart-stage { height: 250px; }
  .trade-workspace .chart-ranges { width: 100%; }
  .trade-workspace .chart-ranges button { width: 20%; }
  .swap-details dt span { display: block; margin-top: 3px; }
}
