.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
.mode { text-align: left; padding: 18px 20px; border-radius: var(--r-md); border: 1px solid var(--line); background: rgba(255, 255, 255, 0.5); display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; gap: 2px 12px; transition: 0.2s; }
.mode b { font: 700 18px var(--display); }
.mode span:not(.pulse) { grid-column: 1; font-size: 14px; color: var(--muted); }
.mode em { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-style: normal; }
.mode:hover { background: #fff; }
.mode.on { background: #fff; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.layout { display: grid; grid-template-columns: 1fr 400px; gap: 20px; margin-top: 20px; align-items: start; }
.col { display: grid; gap: 20px; }
.lbl { font-size: 13.5px; color: var(--muted); }
.sub2 { display: block; font-size: 13.5px; color: var(--faint); margin-top: 2px; }

.pos { padding: 28px; }
.pos-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-end; }
.big { font: 600 46px/1.1 var(--mono); letter-spacing: -0.03em; margin-top: 4px; }
.big small { font-size: 17px; color: var(--muted); margin-left: 8px; font-weight: 500; letter-spacing: 0; }
.earned { text-align: right; }
.earned .num { font: 600 24px/1.2 var(--mono); color: var(--good); margin-top: 4px; }
.stats { margin-top: 24px; display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line-2); border-radius: var(--r-md); overflow: hidden; }
.stats div { padding: 16px 18px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.stats div:nth-child(3n) { border-right: 0; }
.stats div:nth-child(n + 4) { border-bottom: 0; }
.stats span { display: block; font-size: 13px; color: var(--muted); }
.stats b { display: block; margin-top: 4px; font-size: 17px; font-weight: 500; white-space: nowrap; }
.alloc { margin-top: 22px; }
.alloc-head { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--muted); }

.pts { padding: 24px 28px; }
.pts-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.pts-head b { font: 700 18px var(--display); }
.pts-stats { margin-top: 18px; display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line-2); border-radius: var(--r-md); overflow: hidden; }
.pts-stats div { padding: 16px 18px; }
.pts-stats div + div { border-left: 1px solid var(--line-2); }
.pts-stats span { display: block; font-size: 13px; color: var(--muted); }
.pts-stats b { display: block; margin-top: 4px; font-size: 22px; font-weight: 500; }
.pts-how { margin-top: 14px; font-size: 14px; color: var(--muted); }
.pts-board { margin-top: 16px; }
.pts-row { display: grid; grid-template-columns: 44px 1fr auto auto; gap: 16px; padding: 11px 0; border-top: 1px solid var(--line-2); font-size: 14.5px; align-items: center; }
.pts-row .r { font-size: 13px; color: var(--faint); }
.pts-row .a { font-family: var(--mono); }
.pts-row .h { font-size: 13px; color: var(--muted); }
.pts-row .p { font-weight: 500; min-width: 90px; text-align: right; }
.pts-row.me { background: var(--accent-soft); border-radius: var(--r-sm); padding-left: 10px; padding-right: 10px; }
@media (max-width: 680px) { .pts { padding: 18px; } .pts-stats { grid-template-columns: 1fr; } .pts-stats div + div { border-left: 0; border-top: 1px solid var(--line-2); } .pts-row { grid-template-columns: 32px 1fr auto; } .pts-row .h { display: none; } }
.log { padding: 24px 28px; }
.log-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.log-head b { font: 700 18px var(--display); }
.log-list { margin-top: 16px; }
.log-item { display: grid; grid-template-columns: 92px 1fr auto; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line-2); font-size: 14.5px; align-items: baseline; }
.log-item .k { font: 500 12.5px var(--mono); color: var(--accent); }
.log-item .k.fee { color: var(--good); }
.log-item .k.out { color: var(--warn); }
.log-item .k.user { color: var(--muted); }
.log-item p { color: var(--ink-2); }
.log-item a { font: 400 12.5px var(--mono); color: var(--faint); white-space: nowrap; }
.log-item a:hover { color: var(--accent); }
.empty { padding: 40px 0; text-align: center; color: var(--faint); border-top: 1px solid var(--line-2); }

.panel { padding: 0; position: sticky; top: 20px; overflow: hidden; display: flex; flex-direction: column; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line-2); }
.tab { padding: 18px; font: 600 15px var(--display); color: var(--muted); border-bottom: 2px solid transparent; }
.tab.on { color: var(--ink); border-color: var(--ink); }
.field { margin: 22px 22px 0; padding: 16px 18px; border-radius: var(--r-md); background: var(--card-2); border: 1px solid var(--line-2); }
.field:focus-within { border-color: var(--accent); }
.field-top { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--muted); }
.link { font-size: 13.5px; color: var(--accent); }
.field-in { display: flex; align-items: baseline; gap: 10px; margin-top: 6px; }
.field-in input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: 600 32px/1.2 var(--mono); letter-spacing: -0.02em; }
.field-in span { font: 500 15px var(--mono); color: var(--muted); }
.lines { margin: 16px 22px 0; }
.lines div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; font-size: 14px; color: var(--muted); }
.lines b { font-weight: 500; color: var(--ink); text-align: right; }
.go { margin: 20px 0 0; height: 58px; border-radius: 0; font-size: 16px; box-shadow: none; }
.hint { padding: 16px 22px 20px; font-size: 13px; color: var(--faint); background: var(--card-2); border-top: 1px solid var(--line-2); }
.go + .hint { border-top: 0; }

.layout-one { margin-top: 20px; }
.agentbox { margin-bottom: 20px; }
.ag-text { margin-top: 12px; font-size: 14.5px; color: var(--ink-2); }
.ag-warn { margin-top: 12px; padding: 12px 16px 12px 32px; border-radius: var(--r-md); background: var(--warn-soft); font-size: 14px; color: var(--warn); }
.ag-warn li + li { margin-top: 6px; }
.emergency { margin: 16px 22px 0; padding: 16px; border-radius: var(--r-md); background: var(--warn-soft); }
.emergency b { color: var(--warn); }
.emergency p { margin: 6px 0 12px; font-size: 13.5px; color: var(--ink-2); }
.soonbox { padding: 56px 40px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.soonbox h2 { margin-top: 18px; font: 800 36px/1.08 var(--display); letter-spacing: -0.03em; max-width: 640px; }
.soonbox p { margin-top: 14px; max-width: 600px; color: var(--muted); }
.soon-grid { margin: 32px 0; display: grid; grid-template-columns: repeat(4, 1fr); width: 100%; max-width: 820px; border: 1px solid var(--line-2); border-radius: var(--r-md); }
.soon-grid div { padding: 18px; border-right: 1px solid var(--line-2); }
.soon-grid div:last-child { border-right: 0; }
.soon-grid b { display: block; font-size: 22px; font-weight: 600; }
.soon-grid span { display: block; font-size: 13px; color: var(--muted); margin-top: 4px; }

@media (max-width: 1000px) {
  .layout { grid-template-columns: 1fr; }
  .panel { position: static; order: -1; }
}
@media (max-width: 640px) {
  .modes { grid-template-columns: 1fr; }
  .pos, .log { padding: 18px; }
  .pos-head { flex-direction: column; align-items: flex-start; }
  .earned { text-align: left; }
  .big { font-size: 36px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats div:nth-child(3n) { border-right: 1px solid var(--line-2); }
  .stats div:nth-child(2n) { border-right: 0; }
  .stats div:nth-child(n + 4) { border-bottom: 1px solid var(--line-2); }
  .stats div:nth-child(n + 5) { border-bottom: 0; }
  .log-item { grid-template-columns: 1fr auto; }
  .log-item p { grid-column: 1 / -1; grid-row: 2; }
  .soonbox { padding: 36px 20px; }
  .soonbox h2 { font-size: 28px; }
  .soon-grid { grid-template-columns: 1fr 1fr; }
  .soon-grid div:nth-child(2) { border-right: 0; }
  .soon-grid div:nth-child(-n + 2) { border-bottom: 1px solid var(--line-2); }
  .nav-links .btn { display: inline-flex; }
}
/* reference-style overrides */
.mode { border-radius: var(--r-lg); padding: 22px 24px; }
.mode.on { box-shadow: 0 0 0 3px var(--accent-soft); }
.pos { background: var(--navy); color: #fff; border: 0; position: relative; overflow: hidden; }
.pos .lbl, .pos .sub2 { color: var(--on-dark); }
.pos .big small { color: var(--on-dark); }
.pos .earned .num { color: #9fe0c4; }
.pos .stats { border-color: rgba(255, 255, 255, 0.14); }
.pos .stats div { border-color: rgba(255, 255, 255, 0.14) !important; }
.pos .stats span { color: var(--on-dark); }
.pos .alloc-head { color: var(--on-dark); }
.pos .split { background: rgba(255, 255, 255, 0.12); }
.pos .split .s-idle { background: #c9d6ee; }
.pos .split-legend { color: var(--on-dark); }
.pos > *:not(canvas) { position: relative; z-index: 1; }
.boostline { margin-top: 18px; padding: 16px 18px; border-radius: var(--r-md); background: linear-gradient(120deg, #5e82bc, #7ca0da); display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; align-items: center; }
.boostline .lbl { color: rgba(255, 255, 255, 0.85); display: block; }
.boostline b { font-size: 22px; font-weight: 500; }
.boostline small { grid-column: 1; font-size: 13px; color: rgba(255, 255, 255, 0.85); }
.boostline .btn { grid-column: 2; grid-row: 1 / span 2; }
@media (max-width: 680px) { .boostline { grid-template-columns: 1fr; } .boostline .btn { grid-column: 1; grid-row: auto; justify-self: start; margin-top: 8px; } }
.panel { top: 110px; }
.tab.on { color: var(--ink); border-color: var(--accent); }
.go { border-radius: 0; height: 60px; }
.field { border-radius: var(--r-md); }
.soonbox { background: var(--navy); color: #fff; border: 0; position: relative; overflow: hidden; }
.soonbox > *:not(canvas) { position: relative; z-index: 1; }
.soonbox p, .soon-grid span { color: var(--on-dark); }
.soon-grid, .soon-grid div { border-color: rgba(255, 255, 255, 0.14) !important; }
.soonbox h2 { font-weight: 400; font-family: var(--display); }

/* ---------------------------------------------------------------- tabbed app */
.appmain { padding-top: 36px; min-height: 70vh; }
.navpill a { cursor: pointer; }
.subnav { display: none; }
.vhead { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 24px; }
.vhead h1 { font: 400 40px/1.1 var(--display); letter-spacing: -0.01em; }
.vhead p { margin-top: 8px; color: var(--muted); font-size: 16px; }
.view[hidden] { display: none; }
.layout { margin-top: 0; }
.ch { display: block; font: 500 19px/1.3 var(--display); }
.note { margin-top: 14px; font-size: 13.5px; color: var(--faint); }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }

.mtable { padding: 8px 0; overflow: hidden; }
.mrow { display: grid; grid-template-columns: 1.7fr 1fr 1fr 1fr 1.1fr; gap: 14px; align-items: center; width: 100%; text-align: left; padding: 16px 24px; border-top: 1px solid var(--line-2); font-size: 15px; transition: background 0.2s; }
.mrow.mh { border-top: 0; padding-top: 10px; padding-bottom: 10px; font-size: 13px; color: var(--muted); }
button.mrow:hover { background: var(--card-2); }
button.mrow.on { background: var(--accent-soft); }
.mv b { display: block; font: 500 16.5px var(--display); }
.mv small { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); }

.soonpanel { padding: 28px; background: var(--navy); color: #fff; border: 0; position: sticky; top: 110px; overflow: hidden; }
.soonpanel > *:not(canvas) { position: relative; z-index: 1; }
.soonpanel h3 { margin-top: 16px; font: 400 26px/1.2 var(--display); }
.soonpanel p { margin-top: 12px; font-size: 14.5px; color: var(--on-dark); }
.soon-list { margin: 20px 0; display: grid; grid-template-columns: 1fr 1fr; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: var(--r-md); overflow: hidden; }
.soon-list div { padding: 14px 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.14); }
.soon-list div:nth-child(odd) { border-right: 1px solid rgba(255, 255, 255, 0.14); }
.soon-list div:nth-child(n + 3) { border-bottom: 0; }
.soon-list b { display: block; font-size: 19px; font-weight: 500; }
.soon-list span { display: block; font-size: 12.5px; color: var(--on-dark); margin-top: 2px; }

.ybreak, .ylith, .yearn, .abox, .ptrules { padding: 28px; }
.yrow { display: flex; justify-content: space-between; gap: 16px; padding: 15px 0; border-bottom: 1px solid var(--line-2); font-size: 15.5px; }
.ybreak .ch + .yrow { margin-top: 10px; }
.yrow b { font-weight: 500; font-size: 17px; }
.yrow.minus b { color: var(--muted); }
.yrow.plus b { color: var(--accent-deep); }
.yrow.total { border-bottom: 0; padding-top: 18px; }
.yrow.total span { font: 500 18px var(--display); }
.yrow.total b { font-size: 30px; color: var(--ink); }
.ylith { background: var(--navy); color: #fff; border: 0; }
.ylith .note { color: var(--on-dark); }
.ybig { margin-top: 18px; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.ybig b { font-size: 48px; font-weight: 500; line-height: 1; }
.ybig span { color: var(--on-dark); font-size: 15px; }
.ylith .meter { margin-top: 18px; }
.ylith .spark { height: 130px; margin: 22px 0 0; }
.yearn { margin-top: 20px; }
.ytable { margin-top: 16px; }
.yt { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding: 14px 0; border-top: 1px solid var(--line-2); font-size: 15.5px; }
.yt.h { font-size: 13px; color: var(--muted); border-top: 0; }
.yt .ybx { color: var(--accent-deep); }

.abox + .abox, .abox + .log { margin-top: 20px; }
.agrid { margin-top: 16px; display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line-2); border-radius: var(--r-md); overflow: hidden; }
.agrid div { padding: 18px 20px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.agrid div:nth-child(3n) { border-right: 0; }
.agrid div:nth-child(n + 4) { border-bottom: 0; }
.agrid span { display: block; font-size: 13px; color: var(--muted); }
.agrid b { display: block; margin-top: 4px; font-size: 22px; font-weight: 500; }
.abox .alloc { margin-top: 20px; }
.abox .alloc-head { color: var(--muted); }

.emptybox { padding: 72px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.emptybox h3 { font: 400 28px/1.2 var(--display); }
.emptybox p { margin-top: 10px; color: var(--muted); }
.emptybox .btn { margin-top: 24px; }
#pf-full .log { margin-top: 20px; }
#pf-full .stats { grid-template-columns: repeat(3, 1fr); }
#pf-full .stats div { border-bottom: 0 !important; }
.pf-actions { margin-top: 20px; display: flex; gap: 10px; }
.btn-line.dark { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.35); }
.btn-line.dark:hover { background: rgba(255, 255, 255, 0.1); }

.big3 { grid-template-columns: repeat(4, 1fr); background: #fff; margin-top: 0; }
.big3 b { font-size: 26px !important; }
.ptsgrid { margin-top: 20px; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; }
.ptrules ol { margin-top: 14px; padding-left: 20px; }
.ptrules li { margin-top: 10px; font-size: 15px; color: var(--ink-2); }

@media (max-width: 1100px) {
  .navpill { display: none; }
  .subnav { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 12px; scrollbar-width: none; }
  .subnav a { flex: none; padding: 8px 14px; border-radius: var(--pill); background: #fff; border: 1px solid var(--line); font-size: 14px; }
  .subnav a.on { background: var(--accent); color: #fff; border-color: var(--accent); }
  .grid2, .ptsgrid { grid-template-columns: 1fr; }
  .soonpanel { position: static; order: -1; }
}
@media (max-width: 680px) {
  .vhead { flex-direction: column; align-items: flex-start; }
  .vhead h1 { font-size: 32px; }
  .mrow { grid-template-columns: 1fr auto; padding: 14px 16px; }
  .mrow > span:nth-child(3), .mrow > span:nth-child(4) { display: none; }
  .mrow.mh { display: none; }
  .mrow > span:nth-child(5) { grid-column: 1 / -1; }
  .ybreak, .ylith, .yearn, .abox, .ptrules { padding: 20px; }
  .yt { grid-template-columns: 1fr 1fr; }
  .yt > span:nth-child(3) { display: none; }
  .yt.h > span:nth-child(3) { display: none; }
  .yt { grid-template-columns: repeat(3, 1fr); }
  .agrid { grid-template-columns: 1fr 1fr; }
  .agrid div:nth-child(3n) { border-right: 1px solid var(--line-2); }
  .agrid div:nth-child(2n) { border-right: 0; }
  .agrid div:nth-child(n + 4) { border-bottom: 1px solid var(--line-2); }
  .agrid div:nth-child(n + 5) { border-bottom: 0; }
  #pf-full .stats { grid-template-columns: 1fr; }
  .big3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1100px) { #v-markets .panel { order: 0; } }
