.app { display:grid; grid-template:'top top' var(--rv-top) 'rail canvas' 1fr / var(--rv-rail) minmax(0,1fr); min-height:100vh; min-height:100dvh;
       max-width:none; margin:0; padding:0; box-sizing:border-box; position:relative; }
html.rail-open .app { --rv-rail:200px; }

.app .topbar { grid-area:top; position:sticky; top:0; z-index:30; display:flex; align-items:center; gap:14px; height:var(--rv-top); box-sizing:border-box;
               padding:0 8px 0 12px; margin:0; background:var(--rv-paper); border-bottom:2px solid var(--rv-ink); }
.topbar .nav-brand { height:calc(var(--rv-top) - 2px); }
.topbar .nav-mascot { height:30px; }
.rv-top-gap { flex:1 1 auto; min-width:100px; }
.topbar .nav-brand { white-space:nowrap; }
.rv-search:empty { display:none; }
.app .topbar .coin-btn { position:static; width:36px; height:36px; flex:none; }

.app .refresh-box { position:fixed; top:0; right:calc(8px + 36px + 12px); height:var(--rv-top); z-index:31; display:flex; align-items:center; gap:10px; }
.app .refresh-box .rv-data-btn { position:static; height:34px; min-height:34px; padding:0 8px; border:0; background:none; }

.rail { grid-area:rail; position:sticky; top:var(--rv-top); align-self:start; height:calc(100vh - var(--rv-top)); height:calc(100dvh - var(--rv-top)); z-index:20; display:flex; flex-direction:column;
        box-sizing:border-box; background:var(--rv-paper); border-right:1px solid var(--rv-ink); overflow:hidden; }
.rail .rail-link { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; height:74px; flex:none; color:var(--rv-mute); text-decoration:none;
                   border-bottom:1px solid var(--rv-rule-soft); font:500 8px/1 var(--rv-font); letter-spacing:.08em; text-transform:uppercase; }
.rail .rail-link:hover { background:var(--rv-wash); color:var(--rv-ink); }
.rail .rail-link.rail-current { background:var(--rv-ink); color:var(--rv-paper); }
.rail-ico { width:20px; height:20px; background:currentColor; -webkit-mask:var(--ico) center / contain no-repeat; mask:var(--ico) center / contain no-repeat; }
.app .rail .rail-pin { margin-top:auto; flex:none; height:44px; min-height:44px; padding:0; border:0; border-top:1px solid var(--rv-rule-soft); border-radius:0; background:none; color:var(--rv-mute); font:500 14px var(--rv-mono); cursor:pointer; }
.app .rail .rail-pin:hover:not(:disabled) { background:var(--rv-wash); color:var(--rv-ink); }
html.rail-open .rail .rail-link { flex-direction:row; justify-content:flex-start; gap:12px; padding:0 18px; height:48px; }
html.rail-open .rail .rail-pin { text-align:right; padding-right:20px; }

.canvas { grid-area:canvas; min-width:0; display:flex; flex-direction:column; padding:16px var(--rv-pad) 0; }
.canvas > main { flex:1 1 auto; min-width:0; }
.canvas .site-footer { flex:none; }

@media (max-width:720px) {
  .rv-top-gap { min-width:48px; }
  .app .refresh-box { right:calc(8px + 44px + 8px + 44px + 4px); }
  .app .refresh-box .rv-data-btn { width:44px; height:44px; min-height:44px; padding:0; justify-content:center; }
  .rv-data-label { display:none; }
  .app .topbar .coin-btn { width:44px; height:44px; }
  .topbar { gap:8px; }
}
@media (prefers-reduced-motion:reduce) { .rail-link, .rail-pin { transition:none; } }

.rail-ico[data-ico="market"] { --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18' fill='none' stroke='black' stroke-width='1.5' stroke-linejoin='round'%3E%3Crect x='2.5' y='2.5' width='5.5' height='5.5'/%3E%3Crect x='10' y='2.5' width='5.5' height='5.5'/%3E%3Crect x='2.5' y='10' width='5.5' height='5.5'/%3E%3Crect x='10' y='10' width='5.5' height='5.5'/%3E%3C/svg%3E"); }
.rail-ico[data-ico="explorer"] { --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18' fill='none' stroke='black' stroke-width='1.5' stroke-linejoin='round'%3E%3Cpath d='M5 2v14M3 5h4v7H3zM13 3v13M11 6h4v6h-4z'/%3E%3C/svg%3E"); }
.rail-ico[data-ico="setups"] { --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18' fill='none' stroke='black' stroke-width='1.5' stroke-linejoin='round'%3E%3Cpath d='M2 4h14M4.5 9h9M7 14h4'/%3E%3C/svg%3E"); }
.rail-ico[data-ico="tokens"] { --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18' fill='none' stroke='black' stroke-width='1.5' stroke-linejoin='round'%3E%3Cpath d='M9 2l6 3.2v7.6L9 16l-6-3.2V5.2z'/%3E%3Cpath d='M9 6.5v5M6.5 9h5'/%3E%3C/svg%3E"); }
.rail-ico[data-ico="watchlist"] { --ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18' fill='none' stroke='black' stroke-width='1.5' stroke-linejoin='round'%3E%3Cpath d='M4.5 12.5V8a4.5 4.5 0 0 1 9 0v4.5l1.5 1.5H3z'/%3E%3Cpath d='M7.5 15.5a1.5 1.5 0 0 0 3 0'/%3E%3C/svg%3E"); }

.ctx { position:sticky; top:var(--rv-top); z-index:25; display:flex; align-items:center; gap:14px; min-height:var(--rv-ctx); box-sizing:border-box;
       margin:-16px calc(-1 * var(--rv-pad)) 12px; padding:6px var(--rv-pad); background:var(--rv-paper); border-bottom:1px solid var(--rv-ink); }
.ctx-id { display:flex; align-items:baseline; gap:8px; flex:none; min-width:0; }
.ctx-crumb { font:400 12px var(--rv-mono); color:var(--rv-mute); white-space:nowrap; }
.ctx-title { margin:0; font:600 22px/1.1 var(--rv-font); letter-spacing:-.02em; white-space:nowrap; }
.ctx-badge { font:500 10px var(--rv-mono); border:1px solid var(--rv-ink); padding:1px 5px; text-transform:lowercase; align-self:center; }
.ctx-sub { font:400 11px var(--rv-mono); color:var(--rv-mute); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:34ch; }
.ctx-ctl { display:flex; align-items:center; gap:12px; flex:1 1 auto; min-width:0; flex-wrap:wrap; }
.ctx-ctl .field { display:flex; align-items:center; gap:8px; flex:none; min-width:0 !important; margin:0; }
.ctx-ctl .field-label, .ctx-ctl .field-label-row { margin:0; white-space:nowrap; }
.ctx-ctl .field-note { display:none; }
.ctx-ctl .dash-dropdown { min-width:120px; }
.ctx-ctl .dash-dropdown-trigger { min-height:32px; }
.ctx-ctl .seg-lbl { min-height:32px; padding:0 12px; }
.ctx-right { display:flex; align-items:center; gap:10px; flex:none; margin-left:auto; font:400 11px var(--rv-mono); color:var(--rv-mute); }
.app .ctx-share { min-height:32px; width:32px; padding:0; border:1px solid var(--rv-ink); border-radius:0; background:var(--rv-paper); color:var(--rv-ink); font:400 14px var(--rv-mono); cursor:pointer; }
.app .ctx-share:hover:not(:disabled) { background:var(--rv-wash); }
.ctx { height:var(--rv-ctx); }
.ctx-ctl .tk-period { display:flex; align-items:center; gap:8px; width:auto; }
.ctx-ctl .tk-period .field-label { margin:0; white-space:nowrap; }
.ctx-ctl .tk-period .seg-lbl { min-height:32px; padding:0 12px; }
.ctx-ctl { flex-wrap:nowrap; }
@media (max-width:1099px) { .ctx { height:auto; flex-wrap:wrap; } .ctx-ctl { flex:1 1 100%; order:3; flex-wrap:wrap; } .tk-tabs { position:static; } }
@media (pointer:coarse) { .ctx-ctl .dash-dropdown-trigger, .ctx-ctl .seg-lbl, .app .ctx-share { min-height:44px; } .app .ctx-share { width:44px; } }

.tk-tabs { position:sticky; top:calc(var(--rv-top) + var(--rv-ctx)); z-index:24; background:var(--rv-paper); margin-top:0; }
.tk-tabs .tk-tab { min-height:var(--rv-tabs); padding:0 14px !important; }
@media (max-width:1099px) { .tk-tabs .tab-parent, .tk-tabs .tab-container { display:flex; flex-wrap:nowrap; overflow-x:auto; scrollbar-width:none; } .tk-tabs .tk-tab { flex:none; } }

.pn-grid { display:grid; grid-template-columns:repeat(12, minmax(0,1fr)); gap:var(--rv-gap); align-items:start; }
.pn { display:flex; flex-direction:column; min-width:0; background:var(--rv-paper); border:1px solid var(--rv-rule); border-top:2px solid var(--rv-ink); }
.pn[data-span="4"] { grid-column:span 4; } .pn[data-span="6"] { grid-column:span 6; } .pn[data-span="8"] { grid-column:span 8; } .pn[data-span="12"] { grid-column:span 12; }
@media (max-width:1099px) { .pn { grid-column:1 / -1 !important; } }
.pn-h { display:flex; align-items:center; gap:8px; min-height:var(--rv-ph); padding:0 6px 0 9px; border-bottom:1px solid var(--rv-rule-soft); box-sizing:border-box; }
.pn-fam { font:500 8.5px/1 var(--rv-font); letter-spacing:.08em; text-transform:uppercase; border:1px solid var(--rv-ink); padding:2px 4px; flex:none; }
.pn-t { margin:0; font:600 10.5px/1 var(--rv-font); letter-spacing:.08em; text-transform:uppercase; white-space:nowrap; }
.pn-s { font:400 11px var(--rv-mono); color:var(--rv-mute); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; min-width:0; }
.pn-act { margin-left:auto; display:flex; gap:2px; flex:none; }
.app .pn-btn { width:22px; height:22px; min-height:22px; padding:0; border:0; border-radius:0; background:none; color:var(--rv-mute); font:400 13px var(--rv-mono); line-height:22px; cursor:pointer; }
.app .pn-btn:hover:not(:disabled) { background:var(--rv-wash); color:var(--rv-ink); }
.app .pn-btn.pn-help { border:1px solid var(--rv-ink); color:var(--rv-ink); font-weight:600; border-radius:0; background:var(--rv-paper); width:22px; height:22px; margin-left:4px; }
.pn-leg { padding:6px 9px 0; }
.pn-b { position:relative; flex:1 1 auto; min-width:0; }
.pn-b--s { min-height:134px; } .pn-b--m { min-height:220px; } .pn-b--l { min-height:330px; } .pn-b--xl { min-height:440px; }
.pn-f { display:flex; justify-content:space-between; gap:12px; min-height:var(--rv-pf); padding:2px 9px; border-top:1px solid var(--rv-rule-soft); box-sizing:border-box;
        font:400 9.5px/1.4 var(--rv-mono); color:var(--rv-mute); }
.pn-f .info, .pn-f .hint { margin:0; font:inherit; color:inherit; }
.pn-fr { text-align:right; flex:none; }
.pn[data-state="stale"] { border-top:2px dashed var(--rv-ink); }
.pn[data-state="stale"] .pn-b { background:repeating-linear-gradient(135deg, transparent 0 6px, var(--rv-wash) 6px 7px); }
.pn[data-state="error"] { border-color:var(--rv-down); border-top-color:var(--rv-down); }
.pn-empty { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px; min-height:134px; padding:18px; text-align:center; font:400 14px/1.4 var(--rv-font); color:var(--rv-ink); }
.pn-failed .app button { margin-top:6px; }
.pn.pn-focus { outline:2px solid var(--rv-ink); outline-offset:2px; }
.pn.pn-max { position:fixed; z-index:40; top:var(--rv-top); left:0; right:0; bottom:0; border-top-width:2px; overflow:auto; }
.pn.pn-max .pn-b { min-height:0; }
body.pn-open { overflow:hidden; }
.xh-main { display:flex; gap:12px; align-items:flex-start; } .xh-main > .pn { flex:1 1 auto; min-width:0; }

.xp-cols { display:grid; grid-template-columns:var(--rv-cc) minmax(0,1fr) var(--rv-ins); gap:var(--rv-gap); align-items:start; }
.xp-main { min-width:0; }
.cc, .ins { background:var(--rv-paper); border:1px solid var(--rv-rule); border-top:2px solid var(--rv-ink); box-sizing:border-box; min-width:0;
            position:sticky; top:calc(var(--rv-top) + var(--rv-ctx) + var(--rv-tabs) + 8px); max-height:calc(100dvh - var(--rv-top) - var(--rv-ctx) - var(--rv-tabs) - 16px); overflow:auto; }
.cc-h { display:flex; align-items:center; justify-content:space-between; min-height:var(--rv-ph); padding:0 9px; border-bottom:1px solid var(--rv-rule-soft); }
.cc-t { font:600 10.5px/1 var(--rv-font); letter-spacing:.08em; text-transform:uppercase; }
.ins-date { font:400 11px var(--rv-mono); color:var(--rv-mute); }
.app .cc-x { display:none; min-height:28px; width:28px; padding:0; border:0; background:none; font-size:18px; }
.cc-s { padding:8px 12px 4px; border-bottom:1px solid var(--rv-rule-soft); }
.cc-g { margin:0 0 6px; font:600 10.5px/1 var(--rv-font); letter-spacing:.08em; text-transform:uppercase; color:var(--rv-mute); }
.cc .field { display:block; width:100%; min-width:0 !important; margin:0 0 10px; }
.cc .field-label-row { margin:0 0 2px; }
.cc .dash-dropdown { width:100%; }
.cc .dash-dropdown-trigger { min-height:34px; }
.cc-ev { display:flex; flex-direction:column; gap:6px; margin-top:6px; }
.ins-body { padding:6px 10px 10px; font:400 11.5px/1.5 var(--rv-mono); }
.ins-pane { padding:6px 0; border-bottom:1px solid var(--rv-rule-soft); }
.ins-pt { font:600 9.5px var(--rv-font); letter-spacing:.08em; text-transform:uppercase; color:var(--rv-mute); margin-bottom:2px; }
.ins-it { padding:1px 0; overflow-wrap:anywhere; }
.ins-it .xh-item, .ins-it .xh-read { display:inline; }
.ins-it .xh-date { display:block; color:var(--rv-mute); }
#docs-col { display:none !important; }
.xp-main .xh-help { display:inline-block !important; }
.xp-int { display:flex; align-items:center; gap:8px; }
.app .ctx-gear { display:none; min-height:32px; width:32px; padding:0; border:1px solid var(--rv-ink); border-radius:0; background:var(--rv-paper); cursor:pointer; font-size:15px; }
@media (max-width:1359px) {
  .xp-cols { grid-template-columns:minmax(0,1fr); }
  .ins { display:none; }
  .app .ctx-gear { display:inline-block; }
  .cc { position:fixed; z-index:35; top:var(--rv-top); left:var(--rv-rail); bottom:0; width:var(--rv-cc); max-height:none; transform:translateX(-110%); visibility:hidden; transition:transform .15s, visibility .15s; border-top-width:1px; }
  html.cc-open .cc { transform:none; visibility:visible; box-shadow:4px 0 0 rgba(0,0,0,.08); }
  .app .cc-x { display:block; }
}
@media (prefers-reduced-motion:reduce) { .cc { transition:none; } }
#xp-cc .cc-s:nth-child(n+3) > .field > .field-label, #xp-cc .cc-s:nth-child(n+3) > .field > .field-label-row { display:none; }

.rv-search { position:relative; flex:0 1 420px; min-width:0; }
.rv-search:empty { display:none; }
.rv-search input { width:100%; height:32px; box-sizing:border-box; padding:0 44px 0 10px; border:1px solid var(--rv-ink); border-radius:0; background:var(--rv-paper); color:var(--rv-ink); font:400 13px var(--rv-font); }
.rv-search input::placeholder { color:var(--rv-mute); }
.rv-search input:focus-visible { outline:2px solid var(--rv-ink); outline-offset:1px; }
.rv-sr-k { position:absolute; right:8px; top:7px; font:400 10px var(--rv-mono); color:var(--rv-mute); border:1px solid var(--rv-rule); padding:0 4px; pointer-events:none; }
.rv-sr-btn { display:none; }
.rv-sr-list { position:absolute; top:calc(100% + 2px); left:0; right:0; z-index:60; margin:0; padding:0; list-style:none; background:var(--rv-paper); border:1px solid var(--rv-ink); border-bottom-width:2px; }
.rv-sr-it { display:flex; justify-content:space-between; gap:12px; padding:0 10px; min-height:36px; align-items:center; cursor:pointer; font:500 13px var(--rv-font); border-bottom:1px solid var(--rv-rule-soft); }
.rv-sr-it.on, .rv-sr-it:hover { background:var(--rv-ink); color:var(--rv-paper); }
.rv-sr-h { font:400 10px var(--rv-mono); opacity:.7; }
@media (max-width:720px) {
  .rv-search { flex:none; position:static; }
  .app .rv-search .rv-sr-btn { display:block; width:44px; height:44px; min-height:44px; padding:0; border:0; background:none; font:400 22px var(--rv-mono); cursor:pointer; }
  .rv-search input, .rv-sr-k { display:none; }
  .rv-search.open { position:fixed; z-index:50; top:0; left:0; right:0; height:var(--rv-top); background:var(--rv-paper); border-bottom:2px solid var(--rv-ink); padding:6px 8px; box-sizing:border-box; }
  .rv-search.open .rv-sr-btn { display:none; }
  .rv-search.open input { display:block; height:32px; }
}

.pn-grip { height:10px; cursor:ns-resize; touch-action:none; background:repeating-linear-gradient(90deg, var(--rv-rule) 0 3px, transparent 3px 6px) center / 100% 2px no-repeat; border-top:1px solid var(--rv-rule-soft); }
.pn-grip:hover, .pn-grip:focus-visible { background-color:var(--rv-wash); outline:none; }

@media (max-width:720px) {
  .app { grid-template:'top' var(--rv-top) 'canvas' 1fr / minmax(0,1fr); }
  .app .rail { display:flex; flex-direction:row; position:fixed; top:auto; left:0; right:0; bottom:0; height:var(--rv-bar); z-index:45; border-right:0; border-top:2px solid var(--rv-ink); }
  .rail .rail-link { flex:1 1 0; height:var(--rv-bar); min-width:0; gap:2px; border-bottom:0; border-right:1px solid var(--rv-rule-soft); }
  .rail .rail-link:last-of-type { border-right:0; }
  .rail .rail-pin { display:none; }
  .canvas { padding-bottom:calc(var(--rv-bar) + 12px); }
  .pn-h { min-height:38px; }
  .app .pn-btn { width:44px; height:44px; min-height:44px; line-height:44px; }
  .app .cc { top:auto; left:0; right:0; bottom:var(--rv-bar); width:auto; max-height:72dvh; transform:translateY(110%); border-top:2px solid var(--rv-ink); }
  html.cc-open .cc { transform:none; visibility:visible; box-shadow:0 -6px 0 rgba(0,0,0,.12); }
  .app .cc-x { display:block; width:44px; height:44px; }
  .pn-grip { height:22px; }
}

:root { --rv-cc:clamp(248px, 15vw, 320px); --rv-ins:clamp(264px, 15vw, 340px); --rv-pad:clamp(16px, 1.6vw, 32px); }
.canvas { padding:16px var(--rv-pad) 0; }
.ctx { height:auto; min-height:var(--rv-ctx); flex-wrap:wrap; row-gap:8px; column-gap:24px; padding:8px var(--rv-pad); }
.ctx-ctl { flex:1 1 auto; flex-wrap:wrap; gap:10px 22px; }
.ctx-ctl .field { gap:10px; }
.ctx-ctl .field-label { font-size:10px; letter-spacing:.1em; }
.ctx-ctl .dash-dropdown { min-width:150px; }
.ctx-ctl .tk-period { gap:10px; }
.ctx-right { gap:12px; }
.ctx-facts { margin:-4px 0 10px; font:400 11px var(--rv-mono); color:var(--rv-mute); overflow-wrap:anywhere; }
.tk-tabs { position:static; }
@media (max-width:1099px) { .ctx-ctl { flex:1 1 100%; order:3; } }

.cc { position:relative; top:auto; z-index:10; max-height:none; overflow:visible; }
.cc .dash-dropdown-content { min-width:260px; max-width:min(420px, 90vw); z-index:5000; }
@media (max-width:1359px) { .cc { position:fixed; top:var(--rv-top); z-index:35; overflow-y:auto; max-height:none; } }
@media (max-width:720px) { .app .cc { position:fixed; z-index:35; max-height:72dvh; } }
.tk-ctl { justify-content:flex-start; gap:12px 28px; align-items:flex-end; }

.topbar a.nav-brand, .topbar a.nav-brand:visited { color:var(--rv-ink); text-decoration:none; display:flex; align-items:center; gap:10px; }
.topbar a.nav-brand:hover { text-decoration:none; }

.pn-b { padding:10px 12px; box-sizing:border-box; }
.pn-leg { padding:8px 12px 0; }
@media (max-width:720px) { .pn-b { padding:8px; } }

.ctx { position:static; }
.ctx-sheet { display:contents; }
.ctx-sheet-h, .ctx-sheet-btn { display:none; }
.ctx-more { flex:1 1 100%; order:5; min-width:0; }
.ctx-more .rv-settings { margin:0; }
@media (max-width:720px) {
  .app .ctx-sheet-btn { display:inline-flex; align-items:center; min-height:44px; padding:0 12px; border:1px solid var(--rv-ink); border-radius:0; background:var(--rv-paper); color:var(--rv-ink); font:500 13px var(--rv-font); cursor:pointer; }
  .ctx-sheet { display:block; position:fixed; z-index:35; left:0; right:0; bottom:var(--rv-bar); max-height:72dvh; overflow-y:auto; box-sizing:border-box; padding:0 16px 16px; background:var(--rv-paper);
               border-top:2px solid var(--rv-ink); box-shadow:0 -6px 0 rgba(0,0,0,.12); transform:translateY(110%); visibility:hidden; transition:transform .15s, visibility .15s; }
  html.ctx-open .ctx-sheet { transform:none; visibility:visible; }
  .ctx-sheet-h { display:flex; align-items:center; justify-content:space-between; min-height:48px; margin:0 -16px 8px; padding:0 16px; border-bottom:1px solid var(--rv-rule-soft); }
  .app .ctx-done { min-height:44px; padding:0 14px; border:1px solid var(--rv-ink); border-radius:0; background:var(--rv-ink); color:var(--rv-paper); font:500 13px var(--rv-font); cursor:pointer; }
  .ctx-sheet .ctx-ctl { flex-direction:column; align-items:stretch; gap:14px; }
  .ctx-sheet .ctx-ctl .field { display:block; }
  .ctx-sheet .ctx-ctl .field-label { display:block; margin-bottom:4px; }
  .ctx-sheet .dash-dropdown { width:100%; }
  .ctx-more { margin-top:16px; }
}
@media (prefers-reduced-motion:reduce) { .ctx-sheet { transition:none; } }

.app .ctx-done:hover:not(:disabled), .app .ctx-done:active:not(:disabled), .app .ctx-done:focus-visible { background:#333; color:var(--rv-paper); border-color:#333; }
.app .ctx-sheet-btn:hover:not(:disabled), .app .ctx-gear:hover:not(:disabled), .app .ctx-share:hover:not(:disabled) { background:var(--rv-wash); color:var(--rv-ink); }
.app .ctx-sheet-btn:active:not(:disabled), .app .ctx-gear:active:not(:disabled), .app .ctx-share:active:not(:disabled) { background:var(--rv-rule-soft); color:var(--rv-ink); }
html.ctx-open .app .ctx-sheet-btn, html.cc-open .app .ctx-gear { background:var(--rv-ink); color:var(--rv-paper); }
html.ctx-open .app .ctx-sheet-btn:hover:not(:disabled), html.cc-open .app .ctx-gear:hover:not(:disabled) { background:#333; color:var(--rv-paper); }
.app .ctx-done:focus-visible, .app .ctx-sheet-btn:focus-visible, .app .ctx-gear:focus-visible, .app .ctx-share:focus-visible { outline:2px solid var(--rv-ink); outline-offset:2px; }

@media (max-width:720px) {
  .rv-top-gap { order:2; min-width:48px; }
  .rv-search { order:3; }
  .app .topbar .coin-btn { order:5; }
  .app .refresh-box { right:calc(8px + 44px + 8px + 108px + 8px + 44px + 4px); }
  .ctx { padding:8px 12px; }
  .ctx-right { flex:1 1 100%; margin-left:0; gap:8px; }
  .app .ctx-sheet-btn { order:-1; flex:1 1 auto; justify-content:center; }
  .ctx-right .rv-reset { order:1; align-self:center; margin:0; padding:0 6px; }
  .ctx-share { order:2; }
}

@media (max-width:720px) {
  .ctx-right { flex:none; margin-left:auto; }
  .ctx:has(.ctx-sheet-btn) .ctx-right { flex:1 1 100%; margin-left:0; }
  .ctx-sheet.ctx-inline { display:contents; position:static; transform:none; visibility:visible; box-shadow:none; max-height:none; padding:0; transition:none; }
  .ctx-inline .ctx-sheet-h { display:none; }
  .ctx-sheet.ctx-inline .ctx-ctl { flex:1 1 100%; order:3; flex-direction:row; flex-wrap:wrap; align-items:center; gap:10px 16px; }
  .ctx-sheet.ctx-inline .ctx-ctl .field { display:flex; }
  .ctx-inline .xp-int { gap:10px; }
}

.dash-spreadsheet-container, .dash-table-container { position:relative; isolation:isolate; z-index:0; }

.rail .rail-link { position:relative; }
@media (max-width:720px) {
  .rail .rail-link.has-settings::after { content:'⚙'; position:absolute; top:5px; right:calc(50% - 26px); font:400 11px var(--rv-mono); opacity:.85; }
  .app .ctx-sheet-btn, .app .ctx-gear { display:none !important; }
  .ctx:has(.ctx-sheet-btn) .ctx-right { flex:none; margin-left:auto; }
  .ctx:has(.ctx-sheet-btn) { min-height:0; }
  .ctx-sheet .ctx-sheet-h { margin-top:0; }
}

.tab-sheet .controls, .tab-sheet .tv-winbar { margin-bottom:8px; }
@media (max-width:720px) {
  .tab-sheet .controls, .tab-sheet .tv-winbar { flex-direction:column; align-items:stretch; flex-wrap:nowrap; gap:12px; }
  .tab-sheet .field { display:block; width:100%; min-width:0 !important; }
  .tab-sheet .dash-dropdown { width:100%; }
  .tab-sheet .rv-reset { align-self:flex-end; margin:0; }
  .tab-sheet .tk-input, .tab-sheet input[type=text] { width:100%; box-sizing:border-box; }
}

.rv-narr-in, .rv-tk { border-radius:0; border:1px solid var(--rv-rule); border-top:2px solid var(--rv-ink); }
.rv-narr-top::before, .rv-tk-h::before { content:'LIVE'; flex:none; font:500 8.5px/1 var(--rv-font); letter-spacing:.08em; border:1px solid var(--rv-ink); padding:2px 4px; }
.rv-tk-h::before { content:'TICKER'; }
.rv-narr-top { order:0; min-height:var(--rv-ph); box-sizing:border-box; padding:0 12px; }
.rv-narr-title { font:600 10.5px/1 var(--rv-font); letter-spacing:.08em; text-transform:uppercase; }
}

.canvas:has(#mk-notice:not([hidden])) .pn[data-panel^="market."], .canvas:has(#panel-warning:not(:empty)) .pn[data-panel="explorer.chart"] { border-top:2px dashed var(--rv-ink); }
.canvas:has(#mk-notice:not([hidden])) .pn[data-panel^="market."] .pn-b, .canvas:has(#panel-warning:not(:empty)) .pn[data-panel="explorer.chart"] .pn-b { background:repeating-linear-gradient(135deg, transparent 0 6px, var(--rv-wash) 6px 7px); }
.pn-failed .pn-retry { margin:4px 0; padding:4px 14px; min-height:32px; border:1px solid var(--rv-ink); border-radius:0; background:var(--rv-paper); color:var(--rv-ink); font:500 13px var(--rv-font); cursor:pointer; }

.dx-pair { display:grid; grid-template-columns:minmax(0, 1fr); gap:var(--rv-gap); align-items:start; }
@media (min-width:1600px) { .dx-pair { grid-template-columns:minmax(0, 7fr) minmax(0, 5fr); } }

.rv-def { margin:0 0 10px; }
.rv-def > summary { cursor:pointer; font:600 10px/1.6 var(--rv-mono); letter-spacing:.08em; text-transform:uppercase; color:var(--rv-mute); }
.rv-def > summary:hover { color:var(--rv-ink); }
.rv-def[open] > summary { margin-bottom:4px; }

@media (min-width:1100px) {
  .ctx { flex-wrap:nowrap; }
  .ctx-id { flex:none; }
  .ctx-ctl { flex:1 1 0; min-width:0; flex-wrap:nowrap; gap:10px 18px; }
  .ctx-ctl .field { flex:1 1 190px; min-width:130px !important; max-width:300px; }
  .ctx-ctl .field > :last-child { min-width:0; flex:1 1 auto; }
  .ctx-ctl .dash-dropdown { min-width:0; width:100%; }
  .ctx-ctl .seg, .ctx-ctl .tk-period, .ctx-ctl .xp-int, .ctx-ctl > .field:has(.seg) { flex:none; }
  .ctx-right { flex:none; }
  .ctx-more { flex:1 1 100%; }
}

.mk-cols { grid-template-columns:var(--rv-cc) minmax(0, 1fr); }
@media (max-width:1359px) { .mk-cols { grid-template-columns:minmax(0, 1fr); } }
.mk-cols .cc-s .field { margin-bottom:10px; }

.su-cols { --rv-cc:clamp(300px, 22vw, 380px); grid-template-columns:var(--rv-cc) minmax(0, 1fr); }
@media (max-width:1359px) { .su-cols { grid-template-columns:minmax(0, 1fr); } }
.cc .controls { display:flex; flex-direction:column; gap:0; margin:0; }
.cc .su-ctype, .cc .su-ccol, .cc .su-cop { width:100%; flex:1 1 100%; min-width:0; }
.cc .su-row { gap:6px; padding-bottom:8px; margin-bottom:8px; border-bottom:1px solid var(--rv-rule-soft); }
.cc .su-tools { margin:4px 0 8px; }
.cc [hidden] { display:none !important; }

.ctx-ctl:empty { display:none; }

.ctx-ctl .field:has(> .seg), .xp-int .field { flex:none !important; max-width:none; min-width:0 !important; }
.ctx-ctl .field > .seg { flex:none; width:auto; }

.rv-data-btn::after { content:attr(data-clock); font:400 11px var(--rv-mono); color:var(--rv-mute); margin-left:2px; white-space:nowrap; }
.rv-live-dot.on ~ .rv-data-label { font-size:0; }
.rv-live-dot.on ~ .rv-data-label::before { content:'live ·'; font:500 12px var(--rv-mono); color:var(--rv-ink); }
@media (max-width:720px) { .rv-data-btn::after { content:none; } }

.pn-h { padding-top:4px; padding-bottom:4px; }
.pn-t { white-space:normal; flex:0 1 auto; min-width:0; line-height:1.3; overflow-wrap:anywhere; }
.pn-s { flex:0 1 auto; }
.pn-act { margin-left:auto; }

.mx-split > .pn { grid-column:1; }

html { -webkit-text-size-adjust:100%; text-size-adjust:100%; }

@media (max-width:479px) {
  .nav-word { display:none; }
  .app .refresh-box { right:calc(4px + 44px + 6px + 44px + 4px); }
  .topbar { gap:6px; padding:0 4px 0 8px; }
}

.app .ctx-share, .app .ctx-gear, .app .pn-btn, .app .cc-x { display:inline-flex; align-items:center; justify-content:center; }

.cc, .ctx-sheet, .tab-sheet { container-type:inline-size; }
.cc-s, .cc .controls { display:grid; grid-template-columns:minmax(0, 1fr); gap:12px; align-content:start; }
.cc-s > *, .cc .controls > * { grid-column:1 / -1; min-width:0; margin:0 !important; }
.cc-s > .field.half, .cc .controls > .field.half { grid-column:auto; }
@container (min-width:300px) {
  .cc-s, .cc .controls { grid-template-columns:repeat(2, minmax(0, 1fr)); gap:12px 14px; }
}
@media (max-width:720px) {
  .tab-sheet .controls, .ctx-sheet .ctx-ctl, .ctx-more .controls { display:grid; grid-template-columns:minmax(0, 1fr); gap:14px; align-content:start; }
  .tab-sheet .controls > *, .ctx-sheet .ctx-ctl > *, .ctx-more .controls > * { grid-column:1 / -1; min-width:0; margin:0 !important; }
  .tab-sheet .controls > .field.half, .ctx-sheet .ctx-ctl > .field.half, .ctx-more .controls > .field.half { grid-column:auto; }
  .tab-sheet .field, .ctx-sheet .field { display:block; width:100%; }
  .tab-sheet .field .dash-dropdown, .tab-sheet .field > div, .ctx-sheet .field .dash-dropdown { width:100%; max-width:none; }
  .tab-sheet .field .seg { display:flex; }
  .tab-sheet .field .seg > label { flex:1 1 0; }
}
@media (max-width:720px) and (min-width:360px) {
  .tab-sheet .controls, .ctx-sheet .ctx-ctl, .ctx-more .controls { grid-template-columns:repeat(2, minmax(0, 1fr)); gap:14px 12px; }
}
.cc-g { color:var(--rv-ink); border-bottom:1px solid var(--rv-rule-soft); padding-bottom:6px; margin-bottom:0; }
.cc .field-label, .tab-sheet .field-label, .ctx-sheet .field-label { font:500 10px/1.2 var(--rv-font); letter-spacing:.08em; text-transform:uppercase; color:var(--rv-mute); margin:0 0 4px; }
.cc .dash-dropdown, .tab-sheet .dash-dropdown, .ctx-sheet .dash-dropdown { width:100%; }
.cc .dash-dropdown-trigger, .tab-sheet .dash-dropdown-trigger, .ctx-sheet .dash-dropdown-trigger { min-height:40px; }
.cc .field .seg, .tab-sheet .field .seg { display:flex; }
.cc .field .seg > label, .tab-sheet .field .seg > label { flex:1 1 0; min-width:0; }
.cc input[type=number], .tab-sheet input[type=number], .ctx-sheet input[type=number] { width:100%; box-sizing:border-box; }

.app .ctx-gear, .app .cc-x { display:none; }
@media (max-width:1359px) { .app .ctx-gear, .app .cc-x { display:inline-flex; } }
@media (max-width:720px) { .app .ctx-gear { display:none !important; } }

.mx-split:not(.mx-split-on) [data-panel="market.matrix"] .pn-fr { display:none; }

:root { --rv-bar:46px; }
@media (max-width:720px) {
  .rail .rail-link { font-size:7.5px; }
  .rail-ico { width:18px; height:18px; }
  .rail .rail-link.has-settings::after { top:3px; }
  .app .rail { transition:transform .2s ease; }
  html.bar-hide .app .rail { transform:translateY(100%); }
}
@media (prefers-reduced-motion:reduce) { .app .rail { transition:none; } }

.pn .mx-chips { flex-wrap:nowrap; overflow-x:auto; max-width:100%; min-width:0; scrollbar-width:none; -ms-overflow-style:none; -webkit-overflow-scrolling:touch; padding-bottom:2px; }
.pn .mx-chips::-webkit-scrollbar { display:none; }
.pn .mx-chip { flex:none; white-space:nowrap; }

.cc-btns { display:flex; gap:2px; }
.app .cc-fold, .app .cc-pin { display:none; align-items:center; justify-content:center; width:28px; min-height:28px; padding:0; border:0; border-radius:0; background:none; color:var(--rv-mute); font:400 15px var(--rv-mono); cursor:pointer; }
.app .cc-fold:hover:not(:disabled), .app .cc-pin:hover:not(:disabled), .app .cc-x:hover:not(:disabled) { background:var(--rv-wash); color:var(--rv-ink); }
@media (min-width:1360px) {
  .app .cc-fold { display:inline-flex; }
  html.cc-collapsed .app .cc-fold { display:none; }
  html.cc-collapsed .xp-cols { grid-template-columns:minmax(0, 1fr) var(--rv-ins); }
  html.cc-collapsed .mk-cols, html.cc-collapsed .su-cols { grid-template-columns:minmax(0, 1fr); }
  html.cc-collapsed .cc { position:fixed; top:var(--rv-top); left:var(--rv-rail); bottom:0; width:var(--rv-cc); z-index:35; max-height:none; overflow-y:auto; border-top-width:1px;
                          transform:translateX(-110%); visibility:hidden; transition:transform .15s, visibility .15s; }
  html.cc-collapsed.cc-open .cc { transform:none; visibility:visible; box-shadow:4px 0 0 rgba(0,0,0,.08); }
  html.cc-collapsed .app .ctx-gear, html.cc-collapsed .app .cc-x { display:inline-flex; }
  html.cc-collapsed.cc-open .app .cc-pin { display:inline-flex; }
}
@media (min-width:1360px) and (prefers-reduced-motion:reduce) { html.cc-collapsed .cc { transition:none; } }

.rv-top-gap { min-width:190px; }
@media (max-width:1099px) {
  .rv-top-gap { min-width:96px; }
  .rv-data-btn::after { content:none; }
}
@media (max-width:720px) { .rv-top-gap { min-width:48px; } }

.rv-tz-row { display:flex; align-items:center; gap:12px; padding:0 0 12px; margin:0 0 10px; border-bottom:1px solid var(--rv-rule-soft); }
.rv-tz-lbl { flex:none; font:500 10px/1 var(--rv-font); letter-spacing:.08em; text-transform:uppercase; color:var(--rv-mute); white-space:nowrap; }
.rv-tz-row .rv-tz-pick { flex:1 1 auto; min-width:0; margin:0; }
.rv-tz-row .rv-tz-pick select { width:100%; max-width:340px; height:36px; padding:0 6px; border:1px solid var(--rv-ink); border-radius:0; background:var(--rv-paper); color:var(--rv-ink); font:400 12px var(--rv-mono); }
html:has(.rv-search.open) .app .refresh-box { visibility:hidden; }

.app .topbar { position:fixed; top:0; left:0; right:0; }
@media (max-width:720px) {
  .rv-top-gap { order:0; flex:none; width:48px; min-width:48px; }
  .rv-search { order:0; margin-left:auto; }
  .app .topbar .coin-btn { order:0; }
  .app .refresh-box { right:calc(8px + 44px + 2px); }
}
@media (max-width:479px) { .app .refresh-box { right:calc(4px + 44px + 2px); } }

@media (max-width:720px) {
  .rv-top-gap { width:44px; min-width:44px; }
  .app .refresh-box { right:calc(8px + 44px + 8px); }
}
@media (max-width:479px) { .app .refresh-box { right:calc(4px + 44px + 6px); } }

.app .refresh-box { height:calc(var(--rv-top) - 2px); }
.app .rv-search .rv-sr-btn, .app .topbar .coin-btn, .app .refresh-box .rv-data-btn { min-height:0; }
@media (max-width:720px) {
  .app .rv-search .rv-sr-btn, .app .topbar .coin-btn, .app .refresh-box .rv-data-btn { height:38px; }
}

@media (max-width:720px) {
  .app .topbar { gap:0; padding:0 4px 0 12px; }
  .rv-top-gap { flex:none; width:44px; min-width:44px; }
  .app .refresh-box { right:calc(4px + 44px); }
}
@media (max-width:479px) { .app .refresh-box { right:calc(4px + 44px); } }
