/* css/pages/portfolio.css: /portfolio only, owned by the portfolio page agent. Built on css/base.css (DESIGN.md);
   colours only through the tokens in css/tokens.css. Mobile first: phones, then 640 / 900 / 1120. */

/* ------------------------------------------------------------------ head: who is shown */
.pf-who { display: grid; gap: 6px; justify-items: start; min-width: 0; }
@media (min-width: 900px) { .pf-who { justify-items: end; text-align: right; min-width: 16em; } }
.pf-who .sk { height: 2.2em; }
.pf-who-k { font-size: 13px; color: var(--muted); }
.pf-who-s { font-size: 14px; color: var(--ink-2); max-width: 22em; }
.pf-who-a { font: 500 18px/1.2 var(--mono); color: var(--ink); white-space: nowrap; }
.pf-who-a code { font: inherit; }
.pf-who-a:hover { color: var(--orange-ink); }
.pf-who-acts { display: flex; flex-wrap: wrap; gap: 6px 16px; }
@media (min-width: 900px) { .pf-who-acts { justify-content: flex-end; } }
.pf-linkbtn { padding: 0; border: 0; background: none; font: inherit; font-size: 14px; cursor: pointer; }

/* ------------------------------------------------------------------ watch an address */
.pf-watch { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; width: 100%; }
.pf-watch .input input { font-family: var(--mono); font-size: 14px; }
.pf-watch-acts { display: flex; gap: 10px; }
@media (min-width: 640px) {
  .pf-watch { grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
  .pf-watch-acts { padding-top: 26px; }
}
.pf-watchrow { padding-bottom: 28px; }
.pf-watchrow .pf-watch { max-width: 680px; padding: 16px 18px; background: var(--panel); border: 1px solid var(--rule); border-top-color: var(--ink); }

/* ------------------------------------------------------------------ the gate: connect, or watch */
.pf-gate { padding-bottom: 12px; }
.pf-gate .way .pf-watch { margin-top: auto; }
.pf-gate .way p { max-width: 30em; }

/* ------------------------------------------------------------------ banners above the band */
.pf-banners { display: grid; gap: 10px; padding-bottom: 20px; }

/* ------------------------------------------------------------------ the band */
.pf-stats .pf-total .v { font-size: clamp(42px, 5.2vw, 66px); }
.pf-stats .v.sm { font-size: clamp(28px, 2.9vw, 38px); }
.pf-stats .v.muted { color: var(--muted); font-style: italic; }
.pf-stats .s { white-space: normal; }
@media (max-width: 899px) {
  .pf-stats .pf-total { grid-column: 1 / -1; }
  .pf-stats .cell:nth-child(2) { border-left: 0; padding-left: 0; border-top: 1px solid var(--rule); }
  .pf-stats .cell:nth-child(3) { border-left: 1px solid var(--rule); padding-left: 14px; }
  .pf-stats .cell:nth-child(4) { grid-column: 1 / -1; border-left: 0; padding-left: 0; }
}
@media (min-width: 900px) {
  .pf-stats { grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr)); }
}

/* ------------------------------------------------------------------ the inflation lens */
/* a panel (.panel, .panel-b) under the stats band: the code background stays in the margins */
.pf-lens { margin-top: 22px; }
.pf-lens > .panel-b { display: grid; gap: 14px; }
.pf-lens-t { max-width: 44em; font: 400 20px/1.5 var(--serif); color: var(--ink-2); text-wrap: pretty; }
@media (min-width: 900px) { .pf-lens-t { font-size: 22px; } }
.pf-lens-t b { font-weight: 500; color: var(--ink); }
.pf-lens-t b.down { color: var(--down); }
.pf-lens-t b.accent { color: var(--orange-ink); font-style: italic; }
.pf-lens-t .sk { height: 1.1em; }
.pf-lens-tags { justify-self: start; }
.pf-cc { display: inline-flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--muted); }
.pf-cc .input.select select { padding: 7px 34px 7px 10px; font-size: 13.5px; }
.pf-cc .input.select::after { right: 12px; }

/* ------------------------------------------------------------------ the holdings ledger */
.pf-ledger .u { font-size: 12px; color: var(--muted); }
.pf-ledger .cc, .pf-bledger .cc { min-width: 46px; }
.pf-ledger .pf-mpx { display: none; }
.pf-ledger .c-act { text-align: right; width: 1%; }
.pf-acts { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.pf-acts .btn.sm { min-width: 58px; }
.pf-ledger .c-share { min-width: 120px; }
.pf-ledger .c-share .pf-sh { display: inline-block; min-width: 3.4em; }
.pf-ledger tr.zero td.num, .pf-ledger tr.zero .nm-s { color: var(--muted); }
.pf-ledger tr.zero .nm { color: var(--ink-2); }
.pf-ledger tr.zero .cellbar { opacity: .5; }
.pf-ledger tfoot td { padding-top: 13px; font-family: var(--sans); }
.pf-ledger tfoot td.num { font-family: var(--mono); font-size: 14px; }
/* prices only (no wallet, no address): the balance columns step aside */
.pf-ledger.pf-prices .c-bal, .pf-ledger.pf-prices .c-val, .pf-ledger.pf-prices .c-share { display: none; }
/* read only (watching an address): no trade buttons */
.pf-ledger.pf-readonly .c-act { display: none; }
.pf-note { margin-top: 18px; max-width: 46em; }

@media (min-width: 900px) {
  .pf-ledger th, .pf-ledger td { padding-block: 13px; }
  .pf-ledger td.c-asset { white-space: normal; }
}
@media (min-width: 900px) and (max-width: 1119px) {
  .pf-ledger td.c-asset .nm-s { max-width: 17em; }
  .pf-ledger .c-share { min-width: 0; }
  .pf-ledger .c-share .cellbar { width: 40px; }
}

/* under 900px each holding is a small card: asset and value, then balance (at its price) and share, then the
   buttons; from 640px the buttons sit on the right of the two lines */
@media (max-width: 899px) {
  .pf-ledger { display: flex; flex-direction: column; }
  .pf-ledger thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .pf-ledger caption { order: 3; display: block; }
  .pf-ledger tbody, .pf-ledger tfoot { display: block; }
  .pf-ledger tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "asset val" "bal share" "act act"; gap: 6px 14px; padding: 14px 0; border-bottom: 1px solid var(--rule-2); }
  .pf-ledger tbody tr:last-child { border-bottom: 0; }
  .pf-ledger tbody td, .pf-ledger tbody td:first-child, .pf-ledger tbody td:last-child { display: block; padding: 0; border: 0; white-space: normal; min-width: 0; }
  .pf-ledger tbody tr:hover td { background: none; }
  .pf-ledger .c-asset { grid-area: asset; }
  .pf-ledger td.c-val { grid-area: val; align-self: center; text-align: right; font-size: 15px; color: var(--ink); }
  .pf-ledger td.c-bal { grid-area: bal; text-align: left; font-size: 12.5px; color: var(--ink-2); }
  .pf-ledger td.c-px { display: none; }
  .pf-ledger td.c-share { grid-area: share; min-width: 0; font-size: 12.5px; color: var(--muted); }
  .pf-ledger td.c-share .cellbar { width: 44px; }
  .pf-ledger td.c-act { grid-area: act; width: auto; }
  .pf-ledger td.c-act:empty, .pf-ledger td.c-act:not(:has(*)) { display: none; }
  .pf-ledger .pf-acts { justify-content: flex-start; padding-top: 4px; }
  .pf-ledger .pf-acts .btn.sm { flex: 0 0 auto; min-width: 72px; }
  .pf-ledger .pf-mpx { display: inline; color: var(--muted); }
  .pf-ledger.pf-prices tbody tr { grid-template-areas: "asset px" "act act"; }
  .pf-ledger.pf-prices td.c-px { display: block; grid-area: px; align-self: center; font-size: 15px; }
  .pf-ledger.pf-readonly tbody tr { grid-template-areas: "asset val" "bal share"; }
  .pf-ledger tfoot tr { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 0 0; border-top: 1px solid var(--ink); }
  .pf-ledger tfoot td { display: block; padding: 0; border: 0; }
  .pf-ledger tfoot td.c-bal, .pf-ledger tfoot td.c-px, .pf-ledger tfoot td.c-share, .pf-ledger tfoot td.c-act { display: none; }
  .pf-ledger-wrap { overflow: visible; }
}
@media (min-width: 640px) and (max-width: 899px) {
  .pf-ledger tbody tr { grid-template-columns: minmax(0, 1fr) auto 168px; grid-template-areas: "asset val act" "bal share act"; column-gap: 24px; }
  .pf-ledger td.c-act { align-self: center; }
  .pf-ledger .pf-acts { justify-content: flex-end; padding-top: 0; }
  .pf-ledger td.c-share { text-align: right; }
  .pf-ledger.pf-prices tbody tr { grid-template-columns: minmax(0, 1fr) auto 168px; grid-template-areas: "asset px act"; }
  .pf-ledger.pf-readonly tbody tr { grid-template-columns: minmax(0, 1fr) auto; }
}

/* ------------------------------------------------------------------ the split: a ring for the wallet, a bar inside the hedge */
.pf-split .panel-b { min-height: 240px; }
.pf-donut { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; align-items: center; }
@media (min-width: 640px) { .pf-donut { grid-template-columns: 184px minmax(0, 1fr); gap: 28px; } }
@media (min-width: 900px) and (max-width: 1119px) { .pf-donut { grid-template-columns: minmax(0, 1fr); } }
.pf-ring-box { position: relative; width: 184px; max-width: 100%; margin-inline: auto; }
.pf-ring { display: block; width: 100%; height: auto; overflow: visible; }
.pf-ring circle { fill: none; stroke-width: 8; }
.pf-ring .pf-ring-track { stroke: var(--rule-2); }
.pf-arc { transition: stroke-dasharray .9s var(--ease), stroke-dashoffset .9s var(--ease); }
.pf-ring-c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; }
.pf-ring-v { font: italic 400 36px/1 var(--serif); color: var(--orange-ink); font-variant-numeric: lining-nums tabular-nums; }
.pf-ring-k { margin-top: 6px; font-size: 13px; color: var(--muted); }

.pf-arc.a0 { stroke: var(--orange); }
.pf-arc.a1 { stroke: var(--ink-2); }
.pf-arc.a2 { stroke: var(--muted); }
.pf-arc.a3 { stroke: var(--orange-2); opacity: .55; }
.pf-legend i, .pf-hlist i { display: block; width: 9px; height: 9px; align-self: center; background: var(--orange); }
.pf-legend i.a1, .pf-hlist i.a1 { background: var(--ink-2); }
.pf-legend i.a2, .pf-hlist i.a2 { background: var(--muted); }
.pf-legend i.a3, .pf-hlist i.a3 { background: var(--orange-2); opacity: .55; }
/* the fifth share, stocks (MSTR): not a hedge, so the quietest tone (DESIGN.md allocation order: ... faint). --faint is
   close to Ether's --muted, so it is also drawn apart: a thin arc, and a hollow dashed key like the stack's MSTR rung.
   (Not a dashed arc: the arcs are cut by their stroke-dasharray attribute, which a CSS dasharray would override.) */
.pf-arc.a4 { stroke: var(--faint); stroke-width: 3.5; }
.pf-legend i.a4 { background: transparent; border: 1px dashed var(--muted); }

.pf-legend, .pf-hlist { display: grid; grid-template-columns: minmax(0, 1fr); list-style: none; }
.pf-legend li, .pf-hlist li { display: grid; grid-template-columns: 9px minmax(0, 1fr) auto; grid-template-areas: "dot name pct" ". name val"; gap: 2px 12px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--rule-2); font-size: 14.5px; color: var(--ink); }
.pf-legend li:last-child, .pf-hlist li:last-child { border-bottom: 0; }
.pf-legend li > i, .pf-hlist li > i { grid-area: dot; }
.pf-lg-n, .pf-h-n { grid-area: name; min-width: 0; }
.pf-lg-n small, .pf-h-n small { display: block; margin-top: 2px; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.pf-h-n b { font: 500 13px var(--mono); color: var(--ink); }
.pf-lg-p, .pf-h-p { grid-area: pct; justify-self: end; font: 500 14px var(--mono); color: var(--ink); }
.pf-lg-v, .pf-h-v { grid-area: val; justify-self: end; font: 12.5px var(--mono); color: var(--muted); }
.pf-legend li.nil, .pf-hlist li.nil { color: var(--muted); }
.pf-legend li.nil .pf-lg-p, .pf-hlist li.nil .pf-h-p { color: var(--muted); }
.pf-legend li.nil i, .pf-hlist li.nil i { opacity: .35; }
#pf-hedge .alloc { height: 12px; margin: 4px 0 10px; }
.pf-hedge-empty { padding: 4px 0 18px; }
.pf-hedge-asof { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--rule-2); line-height: 1.5; }

/* ------------------------------------------------------------------ OpenBonds positions */
.pf-bledger { min-width: 720px; }
.pf-bledger .c-st { white-space: normal; }
.pf-bledger .c-st .tag + .tag { margin-left: 10px; }
.pf-bledger td.num .nm-s { font-family: var(--sans); font-variant-numeric: normal; } /* tabular nums set a comma figure-wide in sans */
.pf-bledger .u { font-size: 12px; color: var(--muted); }
.pf-bledger .pf-claim { color: var(--warn); }
.pf-bledger .pf-claim-l { font-family: var(--sans); color: var(--warn); }
.pf-bledger .c-open { text-align: right; width: 1%; }
.pf-bledger tfoot td { padding-top: 13px; }
.pf-bledger tfoot td.num { font-family: var(--mono); font-size: 14px; }
#pf-bonds .note { margin-top: 16px; max-width: 46em; }
@media (min-width: 900px) {
  .pf-bledger td.c-bond { white-space: normal; }
  .pf-bledger td.c-bond .nm { max-width: 14em; }
}
@media (min-width: 900px) and (max-width: 1119px) {
  .pf-bledger .c-open { display: none; }
}
#pf-bonds .banner .btn { flex: none; }

@media (max-width: 899px) {
  .pf-bledger { display: flex; flex-direction: column; min-width: 0; }
  .pf-bledger thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .pf-bledger caption { order: 3; display: block; }
  .pf-bledger tbody, .pf-bledger tfoot { display: block; }
  .pf-bledger tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "bond pv" "st held" "red mat"; gap: 8px 14px; padding: 14px 0; border-bottom: 1px solid var(--rule-2); }
  .pf-bledger tbody tr:last-child { border-bottom: 0; }
  .pf-bledger tbody td, .pf-bledger tbody td:first-child, .pf-bledger tbody td:last-child { display: block; padding: 0; border: 0; white-space: normal; min-width: 0; }
  .pf-bledger tbody tr:hover td { background: none; }
  .pf-bledger .c-bond { grid-area: bond; }
  .pf-bledger td.c-pv { grid-area: pv; }
  .pf-bledger td.c-st { grid-area: st; }
  .pf-bledger td.c-held { grid-area: held; }
  .pf-bledger td.c-red { grid-area: red; text-align: left; font-size: 12.5px; }
  .pf-bledger td.c-mat { grid-area: mat; font-size: 12.5px; }
  .pf-bledger .c-open { display: none !important; }
  .pf-bledger tfoot tr { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 0 0; border-top: 1px solid var(--ink); }
  .pf-bledger tfoot td { display: block; padding: 0; border: 0; }
  .pf-bledger tfoot td:not(:first-child):not(.c-pv) { display: none; }
  #pf-bonds .pf-ledger-wrap { overflow: visible; }
}
@media (min-width: 640px) and (max-width: 899px) {
  .pf-bledger tbody tr { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "bond held pv" "st red mat"; column-gap: 28px; }
  .pf-bledger td.c-red { text-align: right; }
}
