/* Terminal visual system. Monetary state and chart observations remain unchanged. */
:root,:root[data-theme="dark"] {
  --page-content-max-width:1200px;
  color-scheme:dark;
  --bg:#111216;--surface:#17181e;--surface-raised:#23252e;--line:#2c2e38;
  --text:#f3f1f8;--muted:#9393a4;--green:#2bcb89;--red:#fa6d84;
  --accent:#8a26ff;--accent-hover:#9a43ff;--accent-soft:#8a26ff1c;
  --violet:#a65cff;--blue:#9aa9e8;--positive-soft:#2bcb8912;--negative-soft:#fa6d8415;
  --chart-grid:#2c2d39;--chart-min:#73768e;--shadow:none;--profit-ink:#fff;
}
body{background:var(--bg);}
.site-header{height:64px;max-width:none;padding:0 24px;gap:36px;background:var(--bg);}
.brand{font-size:21px;letter-spacing:-.7px;}
.brand .brand-mark path:first-child{fill:var(--accent);}
.brand .brand-mark path:last-child{fill:var(--violet);}
.wallet{gap:8px;}
.wallet strong{font-size:16px;}
.header-icon{width:32px;height:34px;border-radius:8px;}
.header-icon:hover,.header-icon:focus-visible,:root[data-theme="dark"] .header-icon:hover{background:var(--surface-raised);color:var(--text);}
button:focus,.create-token-primary:focus,[role="button"]:focus{outline:none;}
button:focus-visible,.create-token-primary:focus-visible,[role="button"]:focus-visible{filter:brightness(1.25);}
:root[data-theme="dark"] .desktop-nav button:focus-visible{background:var(--surface-raised);}
a:not(.create-token-primary):focus-visible{text-decoration:underline;}
:root[data-theme] .desktop-nav button{color:var(--muted);font-size:12px;}
:root[data-theme] .desktop-nav button[aria-current="page"]{color:var(--text);}
:root[data-theme] .mode-select{background:var(--surface-raised);border-color:var(--line);color:var(--text);height:30px;border-radius:7px;}
:root[data-theme] .mode-control .select-menu button,:root[data-theme] .select-menu{background:var(--surface);}
:root[data-theme] .mode-control .select-menu button[aria-selected="true"],:root[data-theme] .mode-control .select-menu button:hover{background:var(--accent-soft);color:var(--violet);}
:root[data-theme] .mode-select[aria-expanded="true"]{border-color:var(--violet);background:var(--accent-soft);}
/* Catalog sorting and the mode picker use the same neutral treatment in every interaction state. */
:root[data-theme] :is(.wallet,.tokens-tools) .mode-select,
:root[data-theme] :is(.wallet,.tokens-tools) .mode-select:hover,
:root[data-theme] :is(.wallet,.tokens-tools) .mode-select:focus-visible,
:root[data-theme] :is(.wallet,.tokens-tools) .mode-select[aria-expanded="true"] {
  background:var(--surface-raised);color:var(--text);border-color:var(--line);
}
:root[data-theme] :is(.wallet,.tokens-tools) .select-menu {background:var(--surface);border-color:var(--line);}
:root[data-theme] :is(.wallet,.tokens-tools) .select-menu button {background:var(--surface);color:var(--text);}
:root[data-theme] :is(.wallet,.tokens-tools) .select-menu button[aria-selected="true"],
:root[data-theme] :is(.wallet,.tokens-tools) .select-menu button:hover,
:root[data-theme] :is(.wallet,.tokens-tools) .select-menu button:focus-visible {background:var(--surface-raised);color:var(--text);}
:root[data-theme] .history-nav .mode-select:hover,
:root[data-theme] .history-nav .mode-select:focus-visible,
:root[data-theme] .history-nav .mode-select[aria-expanded="true"]{background:var(--surface-raised);color:var(--text);border-color:var(--line);}
main{padding:18px 24px 0;max-width:none;}
@media(min-width:801px){
  #app-main{
    display:flex;
    flex-direction:column;
    min-height:calc(100dvh - 64px);
  }
  #app-main[data-screen="market"],#app-main[data-screen="trades"] {
    display:flex;flex-direction:column;height:calc(100svh - 64px);height:calc(100dvh - 64px);min-height:0;
  }
  .terminal{grid-template-columns:330px minmax(0,1fr);height:auto;min-height:0;gap:22px;}
  #app-main[data-screen="market"] .terminal,#app-main[data-screen="trades"] .terminal{flex:1;}
  .market-panel{grid-column:2;grid-row:1;height:auto;}
  .trading-column{grid-column:1;grid-row:1;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto minmax(0,1fr);gap:12px;min-height:0;}
  #app-main>.site-footer{flex-shrink:0;margin-top:auto;}
}
.market-panel{border:0;border-left:1px solid var(--line);border-radius:0;background:var(--bg);box-shadow:none;}
.chart-toolbar{padding:0 24px;height:48px;border:0;gap:16px;}
.chart-tabs{gap:8px;height:auto;padding:4px;border:1px solid var(--line);border-radius:9px;background:var(--surface);justify-self:start;width:max-content;max-width:100%;}
:root[data-theme] .chart-tabs button{padding:8px 13px;font-size:12px;border:0;border-radius:6px;color:var(--muted);}
:root[data-theme] .chart-tabs button[aria-selected="true"]{color:var(--text);background:var(--surface-raised);box-shadow:none;}
:root[data-theme] .chart-tabs button:hover{background:var(--surface-raised);}
.chart-tabs button:after{display:none;}
.chart-panel{padding:22px 24px 0;}
.quote-strip{min-height:100px;gap:12px;}
.portfolio-value{font-size:48px;letter-spacing:-1.9px;font-weight:500;}
@media(min-width:801px){.account-summary strong{font-size:clamp(26px,2.2vw,40px);font-weight:500;line-height:1.15;letter-spacing:-1px;}}
.label{font-size:11px;margin-bottom:8px;}
:root[data-theme] .token-state{padding:6px 9px;border-color:var(--line);background:var(--surface-raised);color:var(--muted);border-radius:6px;}
:root[data-theme] .token-state[data-status="active"]{background:var(--positive-soft);border-color:#2bcb8940;color:var(--green);}
:root[data-theme] .token-state[data-status="exited"]{background:#e8c57b15;border-color:#e8c57b40;color:#e8c57b;}
:root[data-theme] .token-state[data-status="zeroed"]{background:var(--negative-soft);border-color:#fa6d8440;color:var(--red);}
.chart-heading{font-size:10px;letter-spacing:.35px;margin:5px 0 12px;}
:root[data-theme] .chart-grid{stroke:var(--chart-grid);stroke-dasharray:1 6;}
:root[data-theme] .chart-zero{stroke:var(--muted);stroke-dasharray:5 6;}
:root[data-theme] .chart-axis{fill:var(--muted);font-size:10px;}
.chart-line{stroke-width:1.5;}
:root[data-theme] .series-max{color:var(--violet);}
:root[data-theme] .series-min{color:var(--chart-min);}
.chart-line.series-max{stroke-width:1.5;stroke-dasharray:none;opacity:1;}
.chart-line.series-min{stroke-width:1;stroke-dasharray:3 6;opacity:.55;}
.chart-market-area{pointer-events:none;}
.chart-current-guide{stroke:currentColor;stroke-width:1;stroke-dasharray:5 5;opacity:.42;}
.chart-current-label{fill:#fff;font-size:10px;font-weight:650;font-family:inherit;font-variant-numeric:tabular-nums;}
.chart-legend{justify-content:flex-start;gap:22px;padding:15px 0 13px;font-size:10px;min-height:43px;}
.chart-legend i{width:7px;height:7px;border-radius:50%;}
:root[data-theme] .chart-tooltip{background:var(--surface);color:var(--text);border-color:var(--line);border-radius:12px;box-shadow:var(--shadow);padding:15px;font-size:12px;}
:root[data-theme] .chart-empty{background:radial-gradient(var(--chart-grid) .8px,transparent .8px);background-size:24px 24px;}
.order-panel{border-color:var(--line);border-radius:12px;background:var(--surface);padding:18px;box-shadow:var(--shadow);}
.order-title{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:18px;font-size:12px;font-weight:600;}
.order-live{display:flex;align-items:center;gap:6px;font-size:9px;font-weight:450;color:var(--muted);}
.order-live i{width:5px;height:5px;background:var(--green);border-radius:50%;}
.pulse-heading{font-size:11px;color:var(--muted);font-weight:450;}
:root[data-theme] .phase-badge{background:var(--positive-soft);color:var(--green);border:0;font-size:9px;padding:4px 7px;border-radius:5px;}
:root[data-theme] .phase-badge.is-locked{background:var(--negative-soft);color:var(--red);}
:root[data-theme] .phase-badge.is-paused{background:var(--surface-raised);color:var(--muted);}
.pulse-timing{margin:7px 0 12px;gap:10px;}
.pulse-timing strong{font-size:32px;font-weight:500;letter-spacing:-1px;}
.pulse-timing>span{font-size:10px;}
:root[data-theme] .progress-track{background:var(--surface-raised);height:3px;}
.progress-track>span{background:var(--accent);}
.order-risk{display:flex;justify-content:space-between;gap:8px;font-size:11px;color:var(--muted);margin-top:12px;}
.order-risk strong{color:var(--text);font-weight:500;}
.order-risk strong.is-elevated{color:var(--red);}
.token-actions{margin-top:15px;gap:8px;}
.coin-button{min-height:51px;border-radius:8px;font-size:15px;font-weight:600;letter-spacing:-.2px;}
:root[data-theme] .coin-buy,:root[data-theme] .help-next{background:var(--accent);color:#fff;}
:root[data-theme] .coin-buy:not(:disabled):hover{background:var(--accent-hover);}
:root[data-theme] .coin-cashout.profit{background:var(--green);color:var(--profit-ink);box-shadow:none;}
:root[data-theme] .coin-cashout.profit:not(:disabled):hover{background:var(--green);filter:brightness(1.06);}
:root[data-theme] .coin-cashout.loss{background:var(--negative-soft);color:var(--red);box-shadow:inset 0 0 0 1px var(--red);}
:root[data-theme] .coin-cashout.loss:not(:disabled):hover{background:var(--negative-soft);filter:brightness(1.1);}
:root[data-theme] .coin-cashout.break-even{background:var(--surface-raised);color:var(--text);box-shadow:inset 0 0 0 1px var(--line);}
.order-note{font-size:9px;color:var(--muted);line-height:1.5;text-align:center;margin:10px 0 0;}
:root[data-theme] .room-stats{border-color:var(--line);background:var(--surface-raised);border-radius:9px;min-height:43px;font-size:10px;}
:root[data-theme] .room-stats>span+span{border-color:var(--line);}
.room-online-dot{box-shadow:none;}
:root[data-theme] #demo-terminal .activity-panel{border:1px solid var(--line);border-radius:11px;background:var(--surface);overflow:hidden;}
#demo-terminal .activity-heading{height:44px;min-height:44px;padding:11px 13px;border-bottom:1px solid var(--line);}
#demo-terminal .activity-heading h2{font-size:12px;font-weight:550;}
#demo-terminal .activity-live{font-size:9px;}
#demo-terminal .trade-scroll{--trade-row-height:48px;--trade-row-gap:0px;margin:0;}
#demo-terminal .trade-scroll tbody{gap:0;}
:root[data-theme] #demo-terminal .trade-row{height:48px;min-height:48px;padding:8px 12px;gap:6px;grid-template-columns:minmax(0,1fr) 44px 81px;border:0;border-bottom:1px solid var(--line);border-radius:0;background:var(--surface);}
:root[data-theme][lang="ru"] #demo-terminal .trade-row{grid-template-columns:minmax(0,1fr) 58px 81px;}
#demo-terminal .trade-row td:first-child{padding-left:31px;position:relative;font-size:11px;}
#demo-terminal .trade-row td:first-child:before{content:attr(data-avatar);position:absolute;left:0;top:50%;transform:translateY(-50%);display:grid;place-items:center;width:23px;height:23px;border-radius:7px;background:var(--surface-raised);color:var(--muted);font-size:8px;font-weight:600;letter-spacing:.3px;}
#demo-terminal .trade-kind{font-size:10px;}
#demo-terminal .trade-kind:before{content:'↗';margin-right:3px;font-size:12px;}
#demo-terminal .exit .trade-kind:before{content:'↙';}
#demo-terminal .trade-amount{font-size:12px;}
:root[data-theme] #demo-terminal .trade-row.is-own{background:var(--accent-soft);box-shadow:inset 2px 0 var(--accent);border-color:var(--line);}
:root[data-theme] #demo-terminal .trade-row.is-own td:first-child:after{display:none;}
:root[data-theme] #demo-terminal .trade-row.is-own td:first-child:before{background:var(--accent);color:#fff;}
:root[data-theme] #demo-terminal .empty-trades{background:var(--surface);}
:root[data-theme] .auth-submit{background:var(--accent);}
:root[data-theme] .auth-submit:hover{background:var(--accent-hover);}
.auth-card{border-radius:16px;box-shadow:var(--shadow);}
:root[data-theme] #auth-form input:focus{border-color:var(--violet);}
:root[data-theme] .account-menu{background:var(--surface);border-color:var(--line);}
:root[data-theme] .account-segment button[aria-pressed="true"]{color:var(--violet);}
:root[data-theme] .wiki-callout,:root[data-theme] .help-note-box{background:var(--accent-soft);border-color:var(--line);color:var(--text);}
:root[data-theme] .wiki-cycle>div,:root[data-theme] .wiki-fee-grid>div{background:var(--surface-raised);}
:root[data-theme] .wiki-articles p,:root[data-theme] .wiki-articles dd{color:var(--muted);}
:root[data-theme="dark"] .wiki-contents a:hover,:root[data-theme="dark"] .wiki-contents a:focus-visible{background:var(--surface-raised);color:var(--text);text-decoration:none;}
.site-footer{padding:12px 0 24px;font-size:10px;align-items:center;gap:12px 24px;flex-wrap:wrap;}
.affiliate-page,.balance-page,.create-token-page,.wiki-page{width:100%;max-width:var(--page-content-max-width);margin:0 auto;padding:26px 0 40px;}
@media(min-width:801px){
 #demo-terminal.is-catalog>.token-catalog{width:100%;max-width:var(--page-content-max-width);padding:26px 0;}
 .wiki-heading{padding-top:0;}
}
.balance-heading{margin-bottom:24px;}
.balance-heading h1{margin:0 0 10px;font-size:clamp(26px,4vw,38px);}
.balance-heading p{color:var(--muted);font-size:12px;line-height:1.5;}
.balance-layout{display:grid;grid-template-columns:minmax(0,1fr) 280px;gap:16px;align-items:stretch;}
.balance-chart-card,.balance-statistics,.balance-guest{min-width:0;padding:20px;background:var(--surface);border-radius:14px;}
.balance-chart-card{height:440px;display:flex;}
.balance-chart-card #chart-panel{padding:0;min-width:0;}
.balance-chart-card #room-context{display:none;}
.balance-chart-card #chart-legend{display:none;}
@media(min-width:801px){
 .balance-page{flex:1;display:flex;flex-direction:column;justify-content:center;padding-block:24px;}
 .balance-chart-card{height:clamp(340px,60dvh,660px);}
 .balance-heading{position:absolute;width:1px;height:1px;padding:0;margin:0;overflow:hidden;clip-path:inset(50%);}
}
.balance-statistics .account-summary{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:repeat(4,minmax(0,1fr));gap:0;padding:0;min-height:0;height:100%;}
.balance-statistics .account-summary>div{display:flex;flex-direction:column;justify-content:center;gap:8px;padding:12px 0;border-bottom:1px solid var(--line);}
.balance-statistics .account-summary>div:first-child{padding-top:0;}
.balance-statistics .account-summary>div:last-child{border:0;padding-bottom:0;}
.balance-statistics .account-summary>div>span{font-size:12px;}
.balance-statistics .account-summary strong{font-size:24px;line-height:1.15;font-weight:500;letter-spacing:-.4px;}
.balance-statistics .account-summary>div:first-child strong{font-size:30px;}
@media(max-width:800px){
 .balance-layout{grid-template-columns:minmax(0,1fr);gap:16px;}
 .balance-chart-card,.balance-statistics,.balance-guest{padding:16px;}
 .balance-chart-card{height:300px;}
 .balance-statistics .account-summary{height:auto;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:auto;gap:0 16px;}
 .balance-statistics .account-summary>div{padding:12px 0;}
 .balance-statistics .account-summary>div:first-child{padding-top:12px;}
 .balance-statistics .account-summary>div:nth-child(n+3){border:0;}
 .balance-statistics .account-summary>div:first-child strong{font-size:24px;}
 #app-main[data-screen="balance"]{padding-bottom:calc(var(--mobile-nav-height) + 64px + var(--mobile-safe-bottom));}
}
.affiliate-heading{margin-bottom:24px;}
.affiliate-heading h1{font-size:clamp(26px,4vw,38px);margin:0 0 10px;}
.balance-heading h1,.affiliate-heading h1,.create-token-page h1,.wiki-heading h1{font-size:26px;font-weight:500;line-height:1.25;letter-spacing:-.6px;margin:0 0 8px;}
.balance-heading,.affiliate-heading{margin-bottom:20px;}
.balance-heading p,.affiliate-heading p,.wiki-heading p{font-size:13px;line-height:1.6;margin:0;color:var(--muted);}
.create-token-page .create-back{margin-bottom:18px;}
.create-token-page h1{margin-bottom:20px;}
@media(max-width:800px){
 .balance-heading h1,.affiliate-heading h1,.create-token-page h1,.wiki-heading h1{font-size:23px;}
}
.affiliate-page p,.affiliate-list small,.affiliate-metrics dt{font-size:13px;color:var(--muted);line-height:1.5;}
.affiliate-card,.affiliate-metrics>div{background:var(--surface);border-radius:14px;padding:18px;}
.affiliate-card h2{font-size:16px;margin:0;}
.affiliate-card p:last-child{margin-bottom:0;}
.affiliate-copy{display:flex;gap:8px;margin:10px 0;}
.affiliate-copy input{flex:1;min-width:0;background:var(--bg);border:1px solid var(--line);border-radius:8px;padding:9px 12px;color:var(--text);font:inherit;font-size:16px;}
.affiliate-copy button{flex:none;}
.affiliate-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:12px 0;}
.affiliate-metrics dd{margin:6px 0 0;font-size:clamp(16px,2.5vw,26px);overflow-wrap:anywhere;}
.affiliate-metrics dd small{display:block;margin-top:4px;color:var(--muted);font-size:11px;line-height:1.4;}
.affiliate-earned dd{color:var(--green);}
.affiliate-list>div{display:flex;justify-content:space-between;gap:12px;padding:10px 0;border-bottom:1px solid var(--line);}
.affiliate-list>div:last-child{border:0;padding-bottom:0;}
.affiliate-list>div>div{display:grid;gap:4px;min-width:0;overflow-wrap:anywhere;}
.affiliate-list>div>div:last-child{text-align:right;}
.affiliate-intro{margin:0 0 18px;}
@media(min-width:801px){
 #app-main[data-screen="affiliate"]{display:flex;flex-direction:column;height:calc(100dvh - 64px);min-height:0;}
 #app-main[data-screen="affiliate"]>.site-footer{flex-shrink:0;}
 .affiliate-page{display:flex;flex:1;flex-direction:column;min-height:0;padding-top:8px;padding-bottom:20px;}
 .affiliate-heading{position:absolute;width:1px;height:1px;padding:0;margin:0;overflow:hidden;clip-path:inset(50%);}
 #affiliate-dashboard{display:grid;grid-template-columns:minmax(0,3fr) minmax(0,2fr);gap:24px;flex:1;min-height:0;}
 .affiliate-info{display:flex;flex-direction:column;min-width:0;min-height:0;overflow-y:auto;}
 .affiliate-info>.affiliate-card{flex-shrink:0;}
 .affiliate-referrals{display:flex;flex-direction:column;min-width:0;min-height:0;}
 .affiliate-referrals>h2,.affiliate-referrals>p{flex-shrink:0;}
 .affiliate-referrals .affiliate-list{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;}
 .affiliate-info .affiliate-metrics{flex:1;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:minmax(min-content,1fr);margin-bottom:0;}
}
@media(max-width:800px){
  .affiliate-metrics{grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media(max-width:480px){
  .affiliate-card,.affiliate-metrics>div{padding:12px;}
  .affiliate-copy{flex-wrap:wrap;}
  .affiliate-copy input{flex-basis:100%;width:100%;}
}
@media(max-width:800px){
  #app-main:not([data-screen="catalog"],[data-screen="create"])>.site-footer{display:none;}
  #app-main[data-screen="create"]{
    display:flex;
    flex-direction:column;
    min-height:calc(100dvh - var(--mobile-header-height));
  }
  #app-main[data-screen="create"]>.site-footer{
    display:flex;
    flex-shrink:0;
    margin-top:auto;
  }
}
.footer-copyright{display:flex;align-items:center;gap:6px 12px;flex-wrap:wrap;line-height:1.6;}
.footer-copyright>span:first-child{color:var(--text);}
.footer-age{display:inline-flex;align-items:center;justify-content:center;min-width:32px;padding:3px 5px;border:1px solid var(--line);border-radius:5px;color:var(--muted);font-size:10px;font-weight:600;line-height:1.2;}
@media(min-width:801px){
 .order-panel{display:grid;grid-template-columns:minmax(0,1fr) auto;padding:16px;}
 .order-title{grid-column:1 / -1;grid-row:1;margin-bottom:10px;}
 .pulse-heading{grid-column:1;grid-row:2;justify-content:flex-start;gap:8px;}
 .pulse-timing{grid-column:2;grid-row:2;margin:0;}.pulse-timing strong{font-size:29px;}.pulse-timing>span{display:none;}
 .progress-track{grid-column:1 / -1;grid-row:3;margin-top:10px;}
 .order-risk{grid-column:1 / -1;grid-row:4;}.token-actions{grid-column:1 / -1;grid-row:5;margin-top:12px;}
 .order-note{grid-column:1 / -1;grid-row:6;margin-top:8px;}.coin-button{min-height:48px;}
}
@media(min-width:801px) and (max-width:1100px){
 .terminal{grid-template-columns:300px minmax(0,1fr);gap:15px;}
 .chart-toolbar,.chart-panel{padding-left:18px;padding-right:18px;}
 .portfolio-value{font-size:42px;}
}
@media(max-width:800px){
 :root{--mobile-page-gutter:16px;--mobile-page-top:16px;--mobile-header-height:64px;--page-scroll-margin:calc(var(--mobile-header-height) + var(--mobile-page-top));}
 .site-header{padding-inline:var(--mobile-page-gutter);}
 #demo-terminal.is-catalog>.token-catalog,.create-token-page,.affiliate-page,.balance-page{padding:0;}
 .tokens-intro h1{margin-top:0;}
 .wiki-heading{padding:0 0 20px;}
 .wiki-articles article,.create-fields,.affiliate-card{padding:16px;}
 .token-catalog,.wiki-page,.affiliate-page,.tournament-panel,.market-panel,.usdc-preview,.secondary-panel{scroll-margin-top:var(--page-scroll-margin);}
}
@media(min-width:541px) and (max-width:800px) and (min-height:541px){
 #app-main[data-screen]{padding:var(--mobile-page-top) var(--mobile-page-gutter) 16px;}
 .terminal{gap:14px;}.market-panel{height:520px;border:1px solid var(--line);border-radius:12px;}
 .trading-column{min-height:380px;gap:12px;}.order-panel{padding:17px;}.activity-panel{min-height:0;}
}
@media(max-width:540px), (max-width:800px) and (max-height:540px){
 :root{--mobile-page-gutter:12px;--mobile-page-top:12px;--mobile-header-height:50px;}
 .site-header{height:var(--mobile-header-height);gap:10px;}.brand{font-size:17px;gap:5px;}.brand .brand-mark{width:24px;height:24px;}
 #app-main[data-screen]{height:auto;min-height:calc(100svh - var(--mobile-header-height));padding:var(--mobile-page-top) var(--mobile-page-gutter) calc(var(--mobile-nav-height) + 64px + var(--mobile-safe-bottom));}
 .wallet{gap:8px;}.wallet strong{font-size:13px;}.wallet>.mode-control{margin-right:5px;}.header-icon{width:25px;height:31px;padding:3px;}.header-icon svg{width:17px;height:17px;}
 :root[data-theme] .mode-select{height:25px;font-size:10px;}
 #app-main[data-screen="market"] .terminal{height:auto;grid-template-rows:minmax(160px,calc(100svh - var(--page-scroll-margin) - var(--mobile-nav-height) - 48px - var(--mobile-safe-bottom) - var(--mobile-controls-height,260px) - 16px)) auto auto auto;}
 #demo-terminal[data-section="market"] .activity-panel{display:flex;grid-row:4;height:auto;contain:none;overflow:visible;margin-top:12px;}
 :root[data-theme] #demo-terminal .activity-panel{border:0;border-radius:0;background:transparent;overflow:visible;}
 #demo-terminal .activity-heading{padding:10px 2px;border-bottom:0;}
 #demo-terminal .trade-scroll{--trade-visible-rows:8;--trade-row-gap:8px;flex:none;height:auto;overflow:visible;}
 #demo-terminal .trade-scroll tbody{gap:8px;}
 :root[data-theme] #demo-terminal .trade-row{border:1px solid var(--line);border-radius:10px;}
 .site-footer{display:flex;flex-direction:column;align-items:flex-start;gap:10px;padding:18px 0 12px;}
 .footer-links{width:100%;justify-content:flex-start;flex-wrap:wrap;gap:12px;}
 .footer-age{order:-1;}
 .mobile-nav{grid-template-columns:repeat(2,minmax(0,1fr));}
 .market-panel{border:1px solid var(--line);border-radius:10px;background:var(--bg);}
 .chart-toolbar{padding:0 10px;height:43px;min-height:43px;gap:6px;}.chart-tabs{gap:2px;padding:2px;}
 :root[data-theme] .chart-tabs button{font-size:10px;padding:6px 8px;}.history-size{min-width:87px;}
 .chart-panel{padding:11px 10px 0;}.quote-strip{min-height:61px;}.portfolio-value{font-size:32px;}.label{font-size:10px;margin-bottom:4px;}
 .chart-legend{font-size:9px;gap:14px;min-height:29px;padding:8px 0;}.chart-legend i{width:6px;height:6px;}
 .order-panel{display:block;padding:12px 14px;}.order-title{display:none;}.pulse-heading{font-size:10px;}
 .pulse-timing{display:flex;align-items:baseline;gap:9px;margin:5px 0 8px;}.pulse-timing strong{font-size:27px;}.pulse-timing>span{display:inline;font-size:9px;}
 .order-risk{font-size:10px;}.token-actions{margin-top:10px;}.coin-button{min-height:43px;padding:11px;font-size:14px;}.order-note{display:none;}
 :root[data-theme] .room-stats{min-height:33px;font-size:9px;}
 :root[data-theme] .mobile-nav,:root[data-theme] .how-to-launcher{background:var(--surface);color:var(--muted);border-color:var(--line);}
 :root[data-theme] .mobile-nav button[aria-current="page"]{color:var(--violet);}
 .activity-panel{min-height:0;}
}
@media(max-width:540px) and (max-height:720px){.order-risk{margin-top:9px;}.pulse-timing strong{font-size:24px;}}
@media(max-width:360px){#header-wallet{display:none;}.site-header{gap:7px;}.brand{font-size:15px;}.brand .brand-mark{width:21px;height:21px;}.wallet strong{font-size:12px;}}
@media(prefers-reduced-motion:reduce){.chart-market-area{animation:none;}}

/* Transient system feedback stays outside the trading layout. */
:root[data-theme] .message {
  position:fixed;z-index:200;top:auto;left:auto;right:max(24px,env(safe-area-inset-right));
  bottom:calc(24px + env(safe-area-inset-bottom));margin:0;padding:14px 18px;
  width:max-content;max-width:min(380px,calc(100vw - 32px));height:auto;min-height:0;
  border:1px solid var(--line);border-left:3px solid var(--green);border-radius:10px;
  background:var(--surface-raised);color:var(--text);font-size:13px;line-height:1.5;
  box-shadow:0 8px 30px #0005;overflow-wrap:anywhere;pointer-events:none;
  animation:system-notice-in .18s ease-out;
}
:root[data-theme] .message.error {border-left-color:var(--red);color:var(--text);}
:root[data-theme] .message:empty {display:none;}
@keyframes system-notice-in {from {opacity:0;transform:translateY(8px);}to {opacity:1;transform:translateY(0);}}
@media(max-width:700px),(max-width:800px) and (max-height:540px){:root[data-theme] .message{right:16px;bottom:calc(8px + var(--mobile-safe-bottom));}}
@media(prefers-reduced-motion:reduce){:root[data-theme] .message{animation:none;}}

.tournament-panel{height:100%;min-width:0;min-height:0;padding:16px;background:linear-gradient(160deg,#a65cff0e,transparent 45%),var(--surface);border:0;border-right:1px solid var(--line);border-radius:12px;overflow:hidden;scroll-margin-top:var(--page-scroll-margin,66px);box-shadow:none;}
.tournament-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:18px;}
.tournament-heading h2 span{margin-left:4px;color:var(--text);white-space:nowrap;}
.tournament-heading h2{font-size:17px;margin:0;font-weight:600;letter-spacing:-.4px;}.tournament-heading svg{width:32px;height:32px;color:#edc76b;flex:none;}
.tournament-bank{padding:16px;background:linear-gradient(120deg,#a65cff28,#a65cff0b);border:1px solid #a65cff60;border-radius:10px;box-shadow:inset 0 1px 0 #ffffff0a;}
.tournament-bank>span{display:block;font-size:11px;color:var(--muted);}.tournament-bank>strong{display:block;font-size:32px;letter-spacing:-1px;font-weight:500;margin:8px 0 12px;}
.tournament-bank p{display:flex;flex-wrap:wrap;gap:5px;justify-content:space-between;font-size:10px;margin:0 0 5px;color:var(--muted);}.tournament-bank b{color:var(--text);font-variant-numeric:tabular-nums;}.tournament-bank>small{font-size:10px;color:var(--muted);}
.tournament-me{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;padding:16px 0 10px;}.tournament-me>div>span{display:block;font-size:9px;color:var(--muted);margin-bottom:6px;}.tournament-me strong{font-size:13px;font-weight:500;}
.tournament-note{font-size:10px;color:var(--muted);line-height:1.6;margin:8px 0 12px;}
.tournament-sign-in{background:var(--accent-soft);border:1px solid #a65cff40;border-radius:7px;padding:9px;color:var(--violet);font-size:11px;width:100%;margin:4px 0;}
.tournament-previous{font-size:11px;line-height:1.6;margin:12px 0;color:var(--muted);}.tournament-previous summary{cursor:pointer;color:var(--text);padding:6px 0;}
.tournament-rules-button{display:block;width:100%;padding:10px 12px;margin:12px 0;background:var(--surface);border:1px solid var(--line);border-radius:8px;color:var(--text);font:inherit;font-size:11px;cursor:pointer;}
.tournament-rules-button:hover,.tournament-rules-button:focus-visible{background:var(--bg);}
body.tournament-rules-open{overflow:hidden;}
.tournament-rules-dialog{width:min(520px,calc(100vw - 32px));overscroll-behavior:contain;}
.tournament-list-heading{display:flex;flex-wrap:wrap;gap:6px;align-items:center;justify-content:space-between;border-top:1px solid var(--line);padding-top:14px;margin-top:14px;}.tournament-list-heading h3{font-size:12px;font-weight:500;margin:0;}.tournament-list-heading>span{font-size:10px;color:var(--muted);}
.tournament-leaders{list-style:none;padding:0;margin:10px 0 0;display:flex;flex-direction:column;gap:6px;}
#tournament-leaders{overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-width:none;min-height:0;}
#tournament-old-leaders{max-height:160px;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:none;}
#tournament-leaders::-webkit-scrollbar,#tournament-old-leaders::-webkit-scrollbar{display:none;}
.tournament-leaders>.tournament-player{flex:none;}
.tournament-rank svg{width:22px;height:22px;fill:currentColor;fill-opacity:.2;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;}
.tournament-player.tournament-place-1{--podium:#edc76b;border-color:#edc76b60;}
.tournament-player.tournament-place-2{--podium:#c3ccde;border-color:#c3ccde45;}
.tournament-player.tournament-place-3{--podium:#d29872;border-color:#d2987250;}
.tournament-player[class*="tournament-place-"] .tournament-rank,.tournament-player[class*="tournament-place-"] .tournament-prize{color:var(--podium);}
.tournament-player{display:grid;grid-template-columns:20px minmax(0,1fr) auto;align-items:center;gap:7px;padding:10px 7px;border:0;border-bottom:1px solid var(--line);border-radius:0;background:transparent;min-width:0;}.tournament-player.is-me{border-bottom-color:#a65cff70;}.tournament-player.is-me>div>strong{color:var(--violet);}
.tournament-rank{font-size:11px;color:var(--muted);font-variant-numeric:tabular-nums;}.tournament-player>div{min-width:0;}.tournament-player>div>strong{display:block;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:500;}.tournament-player small{display:flex;gap:3px;align-items:center;font-size:9px;color:var(--muted);margin-top:4px;}.tournament-bot{margin-left:3px;font-size:8px;padding:1px 4px;border:1px solid var(--line);border-radius:3px;}.tournament-prize{font-size:11px;font-weight:500;color:var(--green);white-space:nowrap;}
.tournament-settlement{padding:10px;border:1px solid #e8c57b40;border-radius:8px;background:#e8c57b0a;color:#e8c57b;display:flex;justify-content:space-between;gap:8px;font-size:10px;}
@media(min-width:801px){
 .terminal.has-tournament{grid-template-columns:300px minmax(0,1fr) 280px;gap:18px;}.tournament-panel{grid-column:3;grid-row:1;}
}
@media(min-width:801px) and (max-width:1100px){.terminal.has-tournament{grid-template-columns:260px minmax(0,1fr) 220px;gap:12px;}.tournament-panel{padding:12px;}.tournament-heading h2{font-size:14px;}.tournament-bank{padding:12px;}.tournament-bank>strong{font-size:27px;}}
@media(min-width:801px) and (max-width:950px){.terminal.has-tournament{grid-template-columns:220px minmax(0,1fr) 190px;gap:10px;}.tournament-player{grid-template-columns:16px minmax(0,1fr) auto;padding:8px 5px;gap:4px;}.tournament-me{gap:4px;}.tournament-me strong{font-size:11px;}}
@media(min-width:541px) and (max-width:800px) and (min-height:541px){.tournament-panel{height:auto;max-height:700px;}}
@media(max-width:540px),(max-width:800px) and (max-height:540px){
 .tournament-panel{display:none;}
 .mobile-nav.has-tournament{grid-template-columns:repeat(3,minmax(0,1fr));}
 #demo-terminal[data-section="tournament"]{display:block;height:auto;}
 #demo-terminal[data-section="tournament"]>.market-panel,#demo-terminal[data-section="tournament"]>.trading-column{display:none;}
 #demo-terminal[data-section="tournament"]>.tournament-panel{display:block;height:auto;max-height:none;overflow:visible;}
 #tournament-leaders{overflow:visible;overscroll-behavior:auto;}
 .tournament-bank>strong{font-size:36px;}.tournament-player{grid-template-columns:24px minmax(0,1fr) auto;padding:12px;}.tournament-player>div>strong{font-size:13px;}.tournament-prize{font-size:13px;}
}

.affiliate-copy-icon{display:none}
@media(max-width:800px){
 .affiliate-copy{flex-wrap:nowrap;align-items:center;gap:7px;border:1px solid var(--line);border-radius:10px;padding:6px 7px 6px 12px;background:var(--bg)}
 .affiliate-copy:focus-within{border-color:var(--violet)}
 .affiliate-copy input{flex:1 1 auto;min-width:0;width:auto;height:30px;padding:0;background:transparent;border:0;border-radius:0;font-size:13px;text-overflow:ellipsis;outline:0}
 .affiliate-copy #affiliate-copy{display:flex;align-items:center;justify-content:center;flex:none;width:32px;height:32px;min-height:0;padding:0;border:0;border-radius:8px;background:var(--surface-raised);color:var(--text);transition:none}
 .affiliate-copy #affiliate-copy:hover{background:#353640}
 .affiliate-copy-label{display:none}.affiliate-copy-icon{display:block;width:18px;height:18px}
}

/* Account panel */
.account-menu{width:288px;padding:10px;border-radius:18px;box-shadow:0 18px 48px #0006;}
.account-username{margin:0;padding:14px 12px 16px;font-size:16px;font-weight:600;letter-spacing:-.2px;border-bottom:1px solid var(--line);white-space:nowrap;}
.account-links{display:grid;gap:2px;padding:8px 0;}
.account-settings,.account-logout{display:flex;align-items:center;gap:12px;min-height:44px;padding:11px 12px;border-radius:10px;font:inherit;font-size:14px;line-height:1.4;cursor:pointer;}
.account-settings .lucide,.account-logout .lucide{width:19px;height:19px;flex:none;color:var(--muted);}
.account-settings:hover,.account-settings:focus-visible,.account-logout:hover,.account-logout:focus-visible{background:var(--surface-raised);color:var(--text);}
.account-preference{padding:12px;min-height:58px;font-size:13px;color:var(--muted);}
.account-segment{padding:3px;gap:3px;border-radius:9px;}
.account-segment button{min-width:39px;min-height:32px;padding:6px 9px;border-radius:6px;font-size:12px;cursor:pointer;}
:root[data-theme] .account-segment button[aria-pressed="true"]{background:var(--surface-raised);color:var(--text);box-shadow:none;}
.account-logout{border:0;border-top:1px solid var(--line);border-radius:0 0 10px 10px;color:var(--muted);}
.account-logout:hover,.account-logout:focus-visible,.account-logout:hover .lucide{color:var(--red);}
:root[data-theme] #header-profile[aria-expanded="true"]{background:var(--surface-raised);color:var(--text);}
