/* HASHSWAP_V2_2026_11_30 - landing swap form, market strip, fee tiers,
   account dialogs, discount popup. Builds on the tokens in style.css. */

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.link-btn { background: none; border: none; padding: 0; color: var(--accent); font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
body.hs-modal-open { overflow: hidden; }

/* ---------- Landing hero: copy + markets | swap form ---------- */
.hs-hero { grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr); padding-top: 48px; padding-bottom: 40px; gap: 40px; min-height: 0; align-items: start; }
.hs-hero .hero-headline { margin-bottom: 14px; }
.hs-hero .hero-sub { margin-bottom: 22px; }
.hs-hero .hero-ctas { margin-bottom: 10px; }
.hs-trade-off { margin: 4px 0 0; font-size: 13px; color: var(--warn); }
.btn-cta-equal:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }

.hs-markets { margin-top: 26px; border-top: 1px solid var(--border); padding-top: 18px; }
.hs-markets-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 11.5px; color: var(--text-2); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 10px; gap: 10px; }
.hs-data-age { text-transform: none; letter-spacing: 0; font-size: 12px; color: var(--text-1); }
.hs-data-age.is-warn { color: var(--warn); }
.hs-market-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.hs-market {
    display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto auto; column-gap: 8px; row-gap: 2px;
    text-align: left; background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 11px 12px 8px; cursor: pointer; color: var(--text-0);
    transition: border-color .2s ease, transform .2s ease, background-color .2s ease;
}
.hs-market:hover { border-color: var(--accent-strong); transform: translateY(-1px); }
.hs-market.active { border-color: var(--accent); background: linear-gradient(180deg, var(--accent-dim), var(--bg-1) 70%); }
.hs-market.is-stale { opacity: .75; }
.hs-m-sym { font-weight: 800; font-size: 13px; }
.hs-m-chg { justify-self: end; font-size: 12px; font-weight: 700; color: var(--text-1); }
.hs-m-chg.up { color: var(--up); }
.hs-m-chg.down { color: var(--down); }
.hs-m-price { grid-column: 1 / -1; font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.hs-m-spark { grid-column: 1 / -1; width: 100%; height: 32px; display: block; margin-top: 2px; }
.hs-m-spark path { stroke-dasharray: 600; stroke-dashoffset: 0; animation: hsDraw 1.1s ease-out; }
.hs-market.is-tick .hs-m-price { animation: priceFlash 900ms ease-out; }
.hs-markets-foot { font-size: 11.5px; color: var(--text-2); margin: 8px 0 0; }
@keyframes hsDraw { from { stroke-dashoffset: 600; } to { stroke-dashoffset: 0; } }

/* ---------- Swap form card ---------- */
.hs-swap { display: flex; flex-direction: column; gap: 10px; padding: 18px; border-top: 2px solid var(--accent); background: var(--bg-1); border-radius: var(--radius-lg); box-shadow: 0 18px 48px rgba(0, 0, 0, .35); position: relative; }
.hs-swap.is-switch { animation: hsSwitch .35s ease-out; }
@keyframes hsSwitch { from { opacity: .55; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.hs-swap-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hs-swap-head h2 { margin: 0; font-size: 17px; }
.hs-chain select, .hs-token {
    background: var(--bg-2); color: var(--text-0); border: 1px solid var(--border-strong); border-radius: 999px;
    padding: 7px 30px 7px 12px; font-weight: 700; font-size: 13px; cursor: pointer; appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--text-1) 50%), linear-gradient(135deg, var(--text-1) 50%, transparent 50%);
    background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size: 5px 5px; background-repeat: no-repeat;
}
.hs-token { flex: 0 0 auto; min-width: 92px; }
.hs-chain select:focus-visible, .hs-token:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hs-swap .amount-row input { font-size: 24px; }
.hs-flip { align-self: center; margin: -6px 0; z-index: 1; }
.hs-quote { min-height: 96px; }
.quote-summary.is-loading strong { color: var(--text-2); }
.quote-summary.is-loading { opacity: .6; transition: opacity .2s; }
.hs-swap .btn-execute:disabled, .tauschen-card .btn-execute:disabled { opacity: .6; cursor: not-allowed; }

/* ---------- Tariff line ---------- */
.tier-line { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; min-height: 24px; font-size: 12.5px; }
.tier-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--border-strong); font-weight: 800; color: var(--text-0); }
.tier-badge.is-account { background: var(--up-bg); border-color: rgba(14, 203, 129, .45); color: var(--up); }
.tier-sub { color: var(--text-1); font-size: 12.5px; }
button.tier-sub { color: var(--accent); }

.quote-problem .route-error, .hs-quote .route-error { margin: 0; padding: 10px 12px; border-radius: 9px; background: var(--warn-bg); border: 1px solid rgba(240, 185, 11, .35); color: var(--text-0); font-size: 12.5px; line-height: 1.5; }
.quote-problem { margin: 0; }
.quote-age { font-size: 11.5px; color: var(--warn); margin: 2px 0 0; }

/* ---------- Account dialogs ---------- */
.pw-wrap { position: relative; display: flex; }
.pw-wrap input { flex: 1; padding-right: 92px !important; min-width: 0; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: var(--bg-3); border: 1px solid var(--border); color: var(--text-1); border-radius: 6px; padding: 4px 9px; font-size: 12px; font-weight: 700; cursor: pointer; }
.pw-toggle:hover { color: var(--text-0); }
.field-hint { margin: 0; font-size: 11.5px; color: var(--text-2); line-height: 1.45; }
.auth-benefit { margin: 0 0 12px; padding: 9px 12px; border-radius: 9px; background: var(--up-bg); border: 1px solid rgba(14, 203, 129, .35); color: var(--text-0); font-size: 13px; line-height: 1.45; }
.auth-card .btn-cta-equal { width: 100%; margin-top: 8px; justify-content: center; flex: 0 0 auto; }
.account-summary { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.account-summary div { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--text-1); }
.account-summary strong { color: var(--text-0); text-align: right; }
.recovery-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 17px; letter-spacing: .06em; text-align: center; padding: 14px 10px; border-radius: 9px; background: var(--bg-2); border: 1px dashed var(--accent-strong); word-break: break-all; user-select: all; margin: 10px 0 4px; }

/* ---------- Final confirmation ---------- */
.confirm-card { max-width: 460px; }
.confirm-body { display: flex; flex-direction: column; gap: 8px; }
.confirm-body > div { display: flex; justify-content: space-between; gap: 14px; font-size: 13px; color: var(--text-1); }
.confirm-body > div > :last-child { color: var(--text-0); text-align: right; font-variant-numeric: tabular-nums; }
.confirm-body strong { font-weight: 800; }
.confirm-body hr { border: none; border-top: 1px solid var(--border); margin: 4px 0; width: 100%; }
.confirm-actions { display: flex; gap: 10px; margin-top: 14px; }
.confirm-actions .btn-cta-equal { flex: 1; justify-content: center; }

/* ---------- Non-blocking banner ---------- */
.hs-banner { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 90; width: min(560px, calc(100% - 32px));
    background: var(--bg-1); border: 1px solid var(--border-strong); border-left: 3px solid var(--up); border-radius: var(--radius-lg);
    padding: 12px 14px; display: flex; gap: 12px; align-items: center; box-shadow: 0 14px 40px rgba(0, 0, 0, .45); animation: hsUp .25s ease-out; }
.hs-banner p { margin: 0; font-size: 13px; line-height: 1.45; flex: 1; }
.hs-banner-actions { display: flex; gap: 8px; flex-shrink: 0; }
@keyframes hsUp { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- Discount popup ---------- */
.hs-promo { position: fixed; inset: 0; z-index: 120; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(5, 7, 10, .62); animation: hsFade .18s ease-out; }
.hs-promo.is-closing { animation: hsFade .16s ease-in reverse forwards; }
.hs-promo-card { position: relative; width: 100%; max-width: 440px; background: var(--bg-1); border: 1px solid var(--border-strong); border-radius: 18px; padding: 26px 24px 22px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .55); background-image: radial-gradient(ellipse 380px 180px at 20% 0%, rgba(0, 85, 255, .18), transparent 70%); animation: hsPop .22s ease-out; }
.hs-promo-close { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%; border: none; background: transparent; color: var(--text-1); font-size: 22px; cursor: pointer; }
.hs-promo-close:hover { background: var(--bg-2); color: var(--text-0); }
.hs-promo-badge { display: inline-block; padding: 4px 10px; border-radius: 999px; background: var(--up-bg); color: var(--up); font-weight: 800; font-size: 12px; margin-bottom: 12px; }
.hs-promo h2 { margin: 0 0 10px; font-size: 21px; line-height: 1.25; letter-spacing: -.01em; }
.hs-promo p { margin: 0 0 18px; color: var(--text-1); font-size: 14.5px; line-height: 1.55; }
.hs-promo-actions { display: flex; flex-direction: column; gap: 9px; }
.hs-promo-actions .btn-cta-equal { width: 100%; justify-content: center; flex: 0 0 auto; }
@keyframes hsFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes hsPop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
    .hs-hero { grid-template-columns: 1fr; gap: 24px; padding-top: 28px; padding-bottom: 32px; }
    .hs-hero .hero-text { max-width: none; }
    .hs-swap { order: -1; }   /* form first on small screens, before markets */
    .hs-hero .hero-text { order: 0; }
}
@media (max-width: 640px) {
    .hs-hero { padding-top: 16px; padding-bottom: 24px; }
    .hs-hero .hero-headline { font-size: 30px; }
    .hs-hero .hero-sub { font-size: 15px; }
    .hs-hero .hero-ctas .btn-cta-equal { flex: 1 1 140px; }
    .hs-market { padding: 9px 9px 6px; }
    .hs-m-price { font-size: 14px; }
    .hs-m-chg { font-size: 11px; }
    .hs-swap { padding: 14px; }
    .hs-promo { align-items: flex-end; padding: 0; }
    .hs-promo-card { max-width: none; border-radius: 18px 18px 0 0; padding: 24px 18px calc(18px + env(safe-area-inset-bottom)); }
    .hs-banner { flex-direction: column; align-items: stretch; bottom: 10px; }
    .hs-banner-actions { justify-content: flex-end; }
    .confirm-body > div { flex-direction: column; gap: 2px; }
    .confirm-body > div > :last-child { text-align: left; }
}
@media (max-width: 380px) {
    .hs-market-row { gap: 6px; }
    .hs-m-sym { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
    .hs-market, .hs-swap.is-switch, .hs-promo, .hs-promo-card, .hs-banner, .hs-m-spark path { animation: none !important; transition: none !important; }
}

/* ---------- HASHSWAP_NAV_WALLET_2026_11_30: mobile menu + wallet page ---------- */
@media (max-width: 860px) {
    .landing-header { row-gap: 8px; }
    .landing-nav {
        display: flex !important; order: 3; width: 100%; gap: 6px; overflow-x: auto; scrollbar-width: none;
        -webkit-overflow-scrolling: touch; margin: 0 calc(-1 * var(--gutter)); padding: 2px var(--gutter) 4px; width: calc(100% + 2 * var(--gutter));
    }
    .landing-nav::-webkit-scrollbar { display: none; }
    .landing-nav a { flex: 0 0 auto; padding: 7px 12px; border-radius: 999px; font-size: 13.5px; background: var(--bg-1); border: 1px solid var(--border); }
    .landing-nav a.active { background: var(--accent-dim); border-color: var(--accent-strong); color: var(--text-0); }
    .landing-nav a.active::after { display: none; }
}
.wallet-page .wallet-intro h1 { margin: 0 0 6px; }
.wallet-page .wallet-intro p { margin: 0 0 18px; color: var(--text-1); max-width: 720px; line-height: 1.55; }
.wallet-status { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 16px 18px; margin-bottom: 14px; flex-wrap: wrap; }
.wallet-status-label { font-size: 11.5px; color: var(--text-2); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.wallet-status-value { font-weight: 700; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.wallet-holdings-card { padding: 16px 18px; }
.wallet-holdings .wh-empty { margin: 0; color: var(--text-1); }
.wallet-holdings .wh-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.wallet-holdings .wh-address { font-size: 12.5px; color: var(--text-1); overflow-wrap: anywhere; }
.wallet-holdings .wh-native { margin: 4px 0 14px; font-size: 13px; color: var(--text-1); overflow-wrap: anywhere; }
.wallet-holdings .wh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.wallet-holdings .wh-net { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; min-width: 0; }
.wallet-holdings .wh-net h3 { margin: 0 0 4px; font-size: 14.5px; }
.wallet-holdings .wh-status { margin: 0 0 8px; font-size: 12px; color: var(--text-2); }
.wallet-holdings .wh-status.is-error { color: var(--warn); }
.wallet-holdings .wh-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.wallet-holdings .wh-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding-top: 8px; border-top: 1px solid var(--border); }
.wallet-holdings .wh-asset { display: flex; flex-direction: column; min-width: 0; }
.wallet-holdings .wh-asset strong { font-size: 13.5px; overflow-wrap: anywhere; }
.wallet-holdings .wh-name { font-size: 11.5px; color: var(--text-2); overflow-wrap: anywhere; }
.wallet-holdings .wh-amount { font-variant-numeric: tabular-nums; font-weight: 700; text-align: right; overflow-wrap: anywhere; max-width: 60vw; }
.wallet-holdings .wh-contract { grid-column: 1 / -1; font-size: 11px; color: var(--text-2); overflow-wrap: anywhere; }
.wallet-holdings .wh-more { margin-top: 10px; background: none; border: 1px solid var(--border-strong); color: var(--text-0); border-radius: 8px; padding: 7px 12px; font-weight: 700; cursor: pointer; }
.wallet-coverage { margin-top: 22px; color: var(--text-1); font-size: 13.5px; line-height: 1.55; max-width: 820px; }
.wallet-coverage h2 { font-size: 15px; color: var(--text-0); margin: 0 0 6px; }
@media (max-width: 640px) { .wallet-holdings .wh-grid { grid-template-columns: 1fr; } }
