/* The top bar and the small bar at the bottom of every page. Loaded last, so it settles the header's look. */

/* ---- top bar: logo, links, search that takes the free room, then bell, wallet and the account picture ---- */
.top{gap:8px}
.top .mark{margin-right:8px;flex:none}
.top .nav{margin-right:8px}
.top .search{flex:1 1 240px;max-width:560px;height:40px;box-sizing:border-box;margin-right:auto}
.top .search input{height:100%;padding:0}
.top .bell{width:40px;height:40px;border-radius:12px}
.top .bell i{top:8px;right:8px}
.top .sq-btn,.top .sbtn{width:40px;height:40px;border-radius:12px;transition:background-color .12s,border-color .12s,transform .1s}
/* the search button on phones: a clear hover and a clear press, and it stays lit while the search sheet is open */
@media(hover:hover){.top .sq-btn:hover{background:color-mix(in srgb,var(--fg) 9%,var(--surface));border-color:color-mix(in srgb,var(--fg) 26%,transparent)}}
.top .sq-btn:active{transform:scale(.94);background:color-mix(in srgb,var(--fg) 14%,var(--surface))}
.top .sq-btn[aria-expanded=true]{background:var(--fg);border-color:var(--fg);color:var(--bg)}
.top .sq-btn:focus-visible{outline:2px solid var(--accent);outline-offset:2px}

.ch-wal{display:inline-flex;align-items:center;gap:8px;flex:none;height:40px;box-sizing:border-box;padding:0 14px 0 12px;border:1px solid var(--line);border-radius:12px;background:none;color:var(--fg);font:inherit;font-size:13.5px;font-weight:700;white-space:nowrap;cursor:pointer;transition:background-color .15s}
.ch-wal svg{width:18px;height:18px;flex:none;color:var(--muted)}
.ch-wal:hover{background:color-mix(in srgb,var(--fg) 6%,transparent)}
.ch-wal:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.ch-wal[hidden]{display:none}
@media (max-width:899px){.ch-wal{display:none}}

/* signed in: the picture alone, round, 40px */
.top #connect.acct.ch-me{display:grid;place-items:center;width:40px;min-width:40px;height:40px;padding:0;border:0;border-radius:50%;background:none;animation:none}
.ch-av{display:grid;place-items:center;width:40px;height:40px;flex:none;border-radius:50%;overflow:hidden;background:color-mix(in srgb,var(--fg) 12%,var(--bg));color:var(--fg)}
.ch-av img{width:100%;height:100%;object-fit:cover;display:block}
.ch-av b{font-size:15px;font-weight:800;line-height:1}
#connect.ch-me .ch-av{box-shadow:0 0 0 1px color-mix(in srgb,var(--fg) 14%,transparent);transition:box-shadow .15s}
#connect.ch-me:hover .ch-av,#connect.ch-me[aria-expanded=true] .ch-av{box-shadow:0 0 0 2px color-mix(in srgb,var(--fg) 34%,transparent)}
#connect.ch-me:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
/* signed out: the same "Sign in" button, 40px high everywhere */
.top #connect.acct.out,.top #connect.acct.out .acct-f{height:40px}

/* phones: logo, space, search button, bell, picture */
@media (max-width:720px){
  .top{gap:8px}
  .top .mark{margin-right:auto}
}
@media (max-width:360px){.top .mark{font-size:16px}.top{gap:6px}.top #connect.acct.out .acct-f{padding:0 10px}}

/* ---- account menu ---- */
.ch-menu{position:fixed;z-index:56;width:min(260px,calc(100vw - 16px));box-sizing:border-box;padding:6px;border:1px solid var(--line);border-radius:14px;background:var(--bg);color:var(--fg);box-shadow:0 18px 48px -18px #000;font-family:"Instrument Sans",system-ui,sans-serif;animation:chIn .14s ease-out}
@keyframes chIn{from{opacity:0;transform:translateY(-4px)}}
.ch-who{display:flex;align-items:center;gap:10px;padding:8px 10px 12px;margin-bottom:4px;border-bottom:1px solid var(--line)}
.ch-who .ch-av{width:36px;height:36px}
.ch-wt{display:grid;gap:1px;min-width:0}
.ch-wt b{font-size:14px;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ch-wt small{font-size:12px;color:var(--muted);font-family:ui-monospace,SFMono-Regular,Menlo,monospace}
.ch-mi{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;height:44px;box-sizing:border-box;padding:0 10px;border:0;border-radius:10px;background:none;color:var(--fg);font:inherit;font-size:14px;font-weight:600;text-align:left;text-decoration:none;cursor:pointer}
.ch-mi:hover,.ch-mi:focus{background:color-mix(in srgb,var(--fg) 7%,transparent);outline:0}
.ch-mi:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}
.ch-mv{color:var(--muted);font-size:13px;font-weight:600;white-space:nowrap}
.ch-hr{height:0;margin:4px 0;border:0;border-top:1px solid var(--line)}

/* ---- the bar at the foot of every page: live ETH price, and the ETH | USD switch ---- */
.ch-bar{position:fixed;left:0;right:0;bottom:0;z-index:44;display:flex;align-items:center;justify-content:space-between;gap:12px;height:36px;box-sizing:content-box;padding:0 max(16px,env(safe-area-inset-right)) env(safe-area-inset-bottom) max(16px,env(safe-area-inset-left));background:var(--bg);border-top:1px solid var(--line);font-family:"Instrument Sans",system-ui,sans-serif}
.ch-rate{display:flex;align-items:baseline;gap:7px;min-width:0;overflow:hidden;white-space:nowrap;font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums}
.ch-rate span{font-weight:600;letter-spacing:.04em}
.ch-rate b{font-size:13.5px;font-weight:800;letter-spacing:.01em;color:var(--fg)}
.ch-bar .ccy{position:relative;display:grid;grid-template-columns:1fr 1fr;flex:none;margin-left:auto;padding:2px;gap:2px;border-radius:10px}
/* one marker that slides between the two currencies */
.ccy-th{position:absolute;z-index:0;top:2px;bottom:2px;left:2px;width:calc(50% - 3px);border-radius:8px;background:color-mix(in srgb,var(--fg) 14%,transparent);transition:transform .24s cubic-bezier(.2,.8,.2,1);pointer-events:none}
.ccy[data-on=USD] .ccy-th{transform:translateX(calc(100% + 2px))}
.ch-bar .ccy button,.ch-bar .ccy button[aria-pressed=true]{position:relative;z-index:1;background:none;transition:color .2s}
.ch-bar .ccy button[aria-pressed=true]{color:var(--fg)}
/* the currency chooser: a small square with a caret that opens the site's own list above the bar */
.ch-bar .ovm{flex:none;margin-left:-4px}
.ch-bar .ovm[hidden]{display:none}
.ch-bar .ovm-b{width:28px;height:28px;padding:0;justify-content:center;border-radius:8px;box-shadow:none}
.ch-bar .ovm-b>span{display:none}
.ch-bar .ovm-b>svg{width:13px;height:13px}
.ch-bar .ovm-l{left:auto;right:0;min-width:176px;max-height:min(320px,56vh)}
.ch-bar .ovm.open .ovm-l>button{animation:none}
.ch-bar .ovm.open .ovm-b{box-shadow:none}
.ccy-pick{position:absolute;opacity:0;width:1px;height:1px;pointer-events:none}
@media(max-width:720px),(pointer:coarse){.ch-bar .ovm-b{width:40px;height:32px}}
html.ccy-flip [data-eth]{animation:ccySet .22s ease-out}
@keyframes ccySet{from{opacity:.3}to{opacity:1}}
@media(prefers-reduced-motion:reduce){.ccy-th{transition:none}html.ccy-flip [data-eth]{animation:none}}
.ch-bar .ccy button{min-width:44px;height:28px;padding:0 10px;justify-content:center;border-radius:8px;font-size:12px}
body{padding-bottom:var(--ch-h,37px)}
/* other fixed docks rest on the bar, not under it */
body .cx-dock{bottom:var(--ch-top,37px)}
body .ld-dock{bottom:calc(var(--ch-top,103px) + 8px)}

@media (max-width:1000px){
  .ch-bar{bottom:var(--ch-tabs,calc(62px + env(safe-area-inset-bottom)));height:40px;padding-bottom:0}
  .ch-bar .ccy button{height:32px}
  body{padding-bottom:var(--ch-h,41px)}
  nav.tabs{background:var(--bg);border-top:0}
}
@media (prefers-reduced-motion:reduce){.ch-menu{animation:none}.ch-wal,#connect.ch-me .ch-av{transition:none}}

/* ---- the section marker: one slim mark per bar that moves to the section on show, in that section's hue ---- */
/* the two colours a moving mark is filled with, registered so they can change smoothly */
@property --ova{syntax:"<color>";inherits:false;initial-value:transparent}
@property --ovb{syntax:"<color>";inherits:false;initial-value:transparent}
.top .nav{position:relative}
.top .nav a{position:relative;background:none;transition:color .16s}
.top .nav a:hover,.top .nav a[aria-current]{background:none;color:var(--fg)}
.top .nav a:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}
.ov-sec{position:absolute;left:0;top:0;width:0;height:2px;border-radius:2px;pointer-events:none;opacity:0;background:linear-gradient(var(--ovd,90deg),var(--ova),var(--ovb));view-transition-name:ov-sec;transition:opacity .12s}
@media (max-width:1000px){
  nav.tabs{position:fixed}
  nav.tabs a[aria-current]::before{content:none}
  nav.tabs a[aria-current] svg{color:var(--sec,var(--accent))}
}
/* between pages only the mark moves: the page itself is replaced at once, with no fade */
@view-transition{navigation:auto}
:root{view-transition-name:none}
::view-transition{pointer-events:none}
::view-transition-group(ov-sec){animation-duration:.52s;animation-timing-function:cubic-bezier(.45,0,.25,1)}
::view-transition-old(ov-sec){animation:none;opacity:0}
::view-transition-new(ov-sec){animation:ovSecHue .52s cubic-bezier(.45,0,.25,1) both}
@keyframes ovSecHue{from{filter:hue-rotate(var(--ov-hr,0deg))}}
/* a picture that would carry over between pages is not animated either */
.item-pic img{view-transition-name:none}
::view-transition-group(ovpic),::view-transition-old(ovpic),::view-transition-new(ovpic){animation:none;opacity:0}
@media (prefers-reduced-motion:reduce){@view-transition{navigation:none}.ov-sec{transition:none}}
