/* portfolio tab and the Send drawer: styles only these use. Shared tokens and components live in app.css. */

.v-portfolio [hidden], .drawer[data-d="send"] [hidden] { display: none !important; }

/* ── hero ─────────────────────────────────────── */
.pf-unpriced { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 14px; color: var(--dim); margin-left: 4px; }
.pf-unpriced:not(:empty)::before { content: "· "; }
.pf-na { font-size: 32px; color: var(--mute); font-weight: 650; }
.pf-errline { font-size: 14px; font-weight: 500; color: var(--red); white-space: normal; }
.delta { flex-wrap: wrap; min-height: 25px; }
.delta .btn { margin-left: 4px; }
.hkpi b.up small, .hkpi b.down small { color: inherit; }
.hkpi b small.up, .hkpi b small.down { font-weight: 650; }
.chart-wrap .pf-chart-msg {
  position: absolute; inset: 0 56px 22px 0; display: flex; align-items: center; justify-content: center; gap: 12px;
  flex-wrap: wrap; text-align: center; padding: 0 16px; font-size: 15px; color: var(--dim);
}
.pf-chart-note { font-size: 14px; color: var(--dim); }

.hero-r .hl > span { white-space: nowrap; }

/* ── accounts ─────────────────────────────────── */
/* text rows: name and tag, address line, value. No icon column. */
.acct-list > a, .acct-list > .acct-row { grid-template-columns: minmax(0, 1fr) auto; }
.acct-list > .acct-row {
  display: grid; gap: 14px; align-items: center;
  padding: 13px var(--pad); border-bottom: 1px solid #1B1B1B;
}
.acct-list > a > span:first-child, .acct-list > .acct-row > span:first-child { min-width: 0; display: flex; flex-direction: column; }
.acct-n .tag { font-weight: 650; }
.acct-s { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; }
.acct-v { display: flex; flex-direction: column; align-items: flex-end; }
.pf-locked, .pf-create { display: inline-flex !important; align-items: center; gap: 6px; color: var(--mute) !important; font-size: 16px !important; }
.pf-go { color: var(--orange-hi) !important; font-weight: 650; }
.acct-list > a:hover .pf-go { color: var(--orange) !important; }
.acct-s.pf-errline { color: var(--red); }

/* ── allocation ───────────────────────────────── */
.pf-alloc-note { font-size: 14px; color: var(--dim); padding-top: 10px; }
.alloc-list .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── holdings ─────────────────────────────────── */
.pf-hold tr.hrow { cursor: pointer; }
.pf-hold tr.hrow:focus-visible { outline: 2px solid var(--orange); outline-offset: -2px; }
.pf-hold tr.hrow.is-open { background: var(--ink-2); }
.pf-hold tr.hrow.is-open td { border-bottom-color: transparent; }
.pf-hold .tok-n .pk-ca { margin-left: 2px; }
.pf-hold tr.hx td { height: auto; padding: 4px var(--pad) 14px; text-align: left; white-space: normal; background: var(--ink-2); }
.pf-hold tr.hx:hover { background: var(--ink-2); }
.hx-b { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; padding-left: 44px; }
.hx-l { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.hx-mint { font-size: 14px; color: var(--mute); }
.hx-mint code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 14px; color: var(--text); word-break: break-all; }
.hx-px { font-size: 15px; }
.hx-warn { font-size: 14px; color: var(--amber); }
.hx-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.hx-acts .btn .ic { width: 15px; height: 15px; }
.pf-hold tr.full td, .pf-hist tr.full td { height: auto; padding: 0; text-align: left; white-space: normal; }
.pf-hold tr.full:hover, .pf-hist tr.full:hover { background: transparent; }
.pf-hold tr.full .empty, .pf-hist tr.full .empty { padding: 48px 20px; }
.pf-hidden-note { padding: 14px var(--pad); font-size: 14px; color: var(--dim); }
.pf-skel .tk.skel { display: block; height: 32px; width: 32px; border-radius: 50%; }
.pf-skel .tok-t { gap: 6px; }
.pf-skel:hover { background: transparent !important; }
.pf-nft .tok-n { white-space: nowrap; }

/* ── feed ─────────────────────────────────────── */
.fi.has-tk { background: transparent; }
.fi > .tk { width: 36px; height: 36px; font-size: 13px; }
.fi .fb {
  position: absolute; right: -4px; bottom: -4px; width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--ink-1); background: var(--ink-3); color: var(--mute); display: grid; place-items: center; overflow: hidden;
}
.fi .fb .ic { width: 11px; height: 11px; stroke-width: 2.5; }
.fi .fb .tk { width: 16px; height: 16px; font-size: 7px; }
.fi .fb.g { color: var(--green); }
.fi .fb.o { color: var(--orange-hi); }
/* rows with no token logo: a short mono type code, no icon tile */
.fi.is-k, .fi.is-k.o, .fi.is-k.g {
  background: transparent; border-radius: 0; color: var(--dim);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12px; font-weight: 600; letter-spacing: .04em;
}
.fi.is-k.g { color: var(--green); }
.fi.is-k.o { color: var(--orange-hi); }
/* empty states: text only, no icon */
.v-portfolio .empty > .ic { display: none; }
.feed .tag { vertical-align: 2px; margin-left: 4px; }
.feed .ft b { display: block; }
.feed > li.pf-li-skel { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 13px var(--pad); border-bottom: 1px solid #1B1B1B; }
.pf-li-skel .fi.skel { display: block; }
.pf-li-skel .ft { display: flex; flex-direction: column; gap: 6px; }
.feed > li.pf-li-box { display: flex; flex-direction: column; flex: 1; }
.feed > li.pf-li-box .empty { padding: 40px 20px; }
.p-feed .feed { display: flex; flex-direction: column; }

/* ── all activity ─────────────────────────────── */
.hist-tools .chips { min-width: 0; }
.typ { min-width: 0; }
.typ-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.typ-t a { color: var(--paper); }
.typ-t a:hover { text-decoration: underline; text-underline-offset: 3px; }
.typ-t .tag { align-self: flex-start; margin-top: 3px; }
.typ-s { font-size: 14px; color: var(--dim); font-weight: 500; }
.pf-addr {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 14px; color: var(--mute);
  padding: 2px 6px; border-radius: 4px; background: var(--ink-3); border: 1px solid var(--line);
}
.pf-addr:hover { color: var(--paper); border-color: var(--line-3); }
.pf-fail-note { display: block; font-size: 14px; color: var(--red); }
.pf-hist td.strong .sub { font-weight: 500; }
.pf-more { display: flex; align-items: center; gap: 14px; padding: 16px var(--pad) 20px; font-size: 14px; flex-wrap: wrap; }
.pf-more .err-box { margin: 0; flex: 1; }
.pf-more .btn .ic { width: 16px; height: 16px; }

/* ── last 30 days ─────────────────────────────── */
.pf-sum-cover { font-size: 14px; color: var(--dim); padding-top: 12px; }
.pf-sum-cover .link { display: inline; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.sum-bars i { position: relative; }
.sum-bars i.unk { background: transparent; border: 1px dashed var(--line-2); border-bottom: 0; }
.sum-x { display: flex; justify-content: space-between; font-size: 12px; color: var(--dim); margin-top: -8px; }
.p-sum .kv .dim { font-weight: 500; }

/* ── send drawer ──────────────────────────────── */
.s-form { gap: 14px; }
.s-form .fl label { cursor: pointer; }
.in.is-bad { border-color: rgba(244, 89, 107, .6); }
.in.is-bad:focus-within { box-shadow: 0 0 0 3px var(--red-soft); }
.s-to-st { display: grid; place-items: center; }
.s-to-st .ic { width: 18px; height: 18px; }
.s-to-st .is-ok { color: var(--green); }
.s-to-st .is-warn { color: var(--amber); }
.s-to-st .is-bad { color: var(--red); }
.s-notes { display: flex; flex-direction: column; gap: 6px; }
.s-notes:empty { display: none; }
.s-note { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; line-height: 1.4; }
.s-note .ic { width: 16px; height: 16px; margin-top: 2px; flex: none; }
.s-note.is-bad { color: var(--red); }
.s-note.is-warn { color: var(--amber); }
.s-note.is-ok { color: var(--green); }
.s-recent { display: flex; flex-direction: column; gap: 8px; margin-top: 2px; }
.s-rc { height: 38px; padding: 0 10px 0 4px; gap: 8px; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 14px; }
.s-rc .av-sm { width: 28px; height: 28px; font-family: "Archivo", sans-serif; font-size: 12px; }
.s-rc .n { font-family: "Archivo", sans-serif; font-size: 13px; }
.s-rc[disabled] { opacity: .5; pointer-events: none; }
.amt-top .k { cursor: pointer; }
.tsel > span { white-space: nowrap; }
.tsel[disabled], .amt-bot .bal button[disabled] { opacity: .5; pointer-events: none; }
.s-tok { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; font-size: 14px; color: var(--mute); margin-top: -4px; }
.s-tok:empty { display: none; }
.s-tok-n { display: inline-flex; align-items: center; gap: 8px; }
.s-tok-n b { color: var(--text); font-weight: 600; }
.s-tok-ca { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 14px; color: var(--dim); }
.s-tok-ca:hover { color: var(--paper); }
.s-tok-ca .ic { width: 14px; height: 14px; }
.s-form .kv > div > span:last-child .dim { font-weight: 500; margin-left: 6px; }
.s-form .note a, .s-priv { color: var(--orange-hi); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.s-form .note a:hover { color: var(--orange); }
.drawer[data-d="send"] .err-line { margin-top: 0; }
.drawer[data-d="send"] .pane-f .btn-lg { overflow: hidden; text-overflow: ellipsis; }

/* ── phone ────────────────────────────────────── */
@media (max-width: 767px) {
  .hist-tools .in { width: 100%; margin-left: 0; order: -1; }
  .hist-tools .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .hx-b { padding-left: 0; }
  .hx-acts { width: 100%; }
  .hx-acts .btn { flex: 1 1 auto; }
  .pf-hold .tok-t { max-width: 48vw; }
  .typ .fi { display: none; }
  .typ-t { max-width: 46vw; }
  .typ-t a { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .typ-s { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .pf-hist td:first-child { width: 56px; }
  .hero-r .pf-chart-note { font-size: 14px; }
  .s-tok-ca { margin-left: 0; }
  .delta { font-size: 16px; }
}

.v-portfolio .count:empty { display: none; }

/* ── tablet: the hero stacks, so the chart gets the full width ── */
@media (min-width: 768px) and (max-width: 1099px) {
  .p-hero { grid-template-columns: minmax(0, 1fr); }
  .hero-l { border-right: 0; border-bottom: 1px solid var(--line); }
  .hero-r { height: 280px; }
}

/* phone: the token name gives way so the balance always fits on screen */
.pf-hold .tok-s { min-width: 0; }
.pf-hold .tok-s .sy { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart-wrap .pf-chart-msg { flex-direction: column; }
@media (max-width: 767px) {
  .pf-hold .tok-t { max-width: calc(100vw - 200px); }
  .pf-hold .tok-s .tag { padding: 0 5px; }
  .pf-hold td:nth-child(4), .pf-hold th:nth-child(4) { padding-right: var(--pad); }
}

/* app.css styles every span in .hkpi as a label; the numbers inside b are not labels */
.hkpi b span { font-size: inherit; font-weight: inherit; color: inherit; }
.hkpi b span.dim { color: var(--dim); font-weight: 600; }
.hkpi b span.mute { color: var(--mute); }

/* money() wraps numbers in a span; the feed and account rows style every
   span as a sub-label, so the wrapped number takes its parent's look */
.fa > .money { display: inline; font-size: inherit; font-weight: inherit; color: inherit; }
.fa > span:not(.money) > .money { display: inline; font-size: inherit; font-weight: inherit; color: inherit; }
.acct-v b .money, .acct-v b span { font-size: inherit; font-weight: inherit; color: inherit; }
.acct-v b span.dim { color: var(--dim); }
.ft b .tag { font-size: 12px; }
.ft b .tag-red { color: var(--red); }

/* a large balance must not squeeze the chart's range switch off the pane */
@media (min-width: 1100px) {
  .p-hero { grid-template-columns: minmax(340px, 460px) minmax(0, 1fr); }
  .hero-l .hero-num { overflow-wrap: anywhere; }
}
.hero-r .top { flex-wrap: wrap; row-gap: 6px; }
.hero-r .top .seg { margin-left: auto; flex: none; }
.hero-r .hl { flex-wrap: wrap; gap: 4px 18px; min-width: 0; }
/* big balances: the % moves under the amount so neither is clipped */
.hkpi b { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; overflow: hidden; }
.hkpi b small { margin-left: 0; }
@media (max-width: 767px) {
  .hkpi b { font-size: 15px; }
}

/* ── first run: the Start panel ───────────────── */
/* It takes the holdings area. The hero drops its empty chart and KPIs and
   becomes one strip across the top: value left, actions right. */
.p-start { grid-area: start; }
.v-portfolio.is-start:not(.is-activity) {
  grid-template-rows: auto auto minmax(0, 1fr);
  grid-template-areas: "hero hero" "start acct" "start feed";
}
.v-portfolio.is-start .p-hold, .v-portfolio.is-start .p-alloc,
.v-portfolio.is-start .hero-r, .v-portfolio.is-start .hkpi,
.v-portfolio.is-start .hero-alloc, .v-portfolio.is-start .hero-alloc-l { display: none !important; }
.v-portfolio.is-activity .p-start { display: none !important; }
.v-portfolio.is-start .p-hero { grid-template-columns: minmax(0, 1fr); }
.v-portfolio.is-start .hero-l {
  border-right: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "lbl acts" "num acts" "delta acts"; align-items: end; row-gap: 10px; column-gap: 24px;
}
.v-portfolio.is-start .hero-l > .lbl { grid-area: lbl; }
.v-portfolio.is-start .hero-l > .hero-num { grid-area: num; }
.v-portfolio.is-start .hero-l > .delta { grid-area: delta; }
.v-portfolio.is-start .hero-acts { grid-area: acts; margin: 0; padding: 0; align-self: end; }
.v-portfolio.is-start .hero-acts .btn { flex: none; min-width: 128px; }
@media (min-width: 1680px) {
  .v-portfolio.is-start:not(.is-activity) { grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "hero hero hero" "start acct feed"; }
}
@media (max-width: 1099px) {
  .v-portfolio.is-start:not(.is-activity) { grid-template-rows: auto; grid-template-areas: "hero" "start" "acct" "feed"; }
}
@media (max-width: 767px) {
  .v-portfolio.is-start .hero-l { display: flex; align-items: stretch; }
  .v-portfolio.is-start .hero-acts { padding-top: 6px; }
  .v-portfolio.is-start .hero-acts .btn { flex: 1; min-width: 0; }
}

.st-prog {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; letter-spacing: .04em; color: var(--mute);
  padding: 1px 7px; border: 1px solid var(--line-2); border-radius: 4px; white-space: nowrap;
}
.st-steps { flex: 1; min-height: 0; overflow: auto; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) minmax(0, 1fr); }
.st-steps > li { padding: 20px var(--pad) 22px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.st-steps > li + li { border-left: 1px solid var(--line); }
.st-h { display: flex; align-items: baseline; gap: 12px; }
.st-n, .st-tag, .st-spec { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .06em; white-space: nowrap; }
.st-n { font-size: 13px; font-weight: 600; color: var(--dim); }
.st-h b { font-size: 20px; font-weight: 700; color: var(--mute); line-height: 1.2; }
.st-tag { margin-left: auto; font-size: 12px; text-transform: uppercase; color: var(--dim); }
.st-steps .is-now .st-n, .st-steps .is-now .st-tag { color: var(--orange-hi); }
.st-steps .is-now .st-h b { color: var(--paper); }
.st-steps .is-done .st-n, .st-steps .is-done .st-tag { color: var(--green); }
.st-steps .is-done .st-h b { color: var(--text); }
.st-d { font-size: 15px; color: var(--mute); line-height: 1.45; }
.st-d b { font-weight: 650; }
.st-fund { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.st-qr { width: 132px; height: 132px; padding: 6px; flex: none; }
.st-addr { flex: 1 1 180px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-width: 0; }
.st-k { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }
.st-addr code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 14px; color: var(--paper); word-break: break-all; line-height: 1.45; user-select: all; }
.st-live { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--mute); }
.st-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.st-opts { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.st-opts a { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 4px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.st-on { font-size: 16px; font-weight: 650; color: var(--paper); }
.st-spec { font-size: 12px; text-transform: uppercase; color: var(--dim); }
.st-od { grid-column: 1 / -1; font-size: 14px; color: var(--dim); line-height: 1.4; }
.st-opts a:hover .st-on { color: var(--orange-hi); }
.st-opts a:focus-visible { outline-offset: -2px; }

/* narrower panes: the steps stack */
@media (max-width: 1279px) {
  .st-steps { grid-template-columns: minmax(0, 1fr); }
  .st-steps > li + li { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 1099px) {
  .st-steps { overflow: visible; }
}
@media (max-width: 767px) {
  .st-qr { width: 116px; height: 116px; }
  .st-addr { flex-basis: 160px; }
  .st-addr code { font-size: 13px; }
  .v-portfolio.is-start .hero-acts { max-width: none; }
}

/* ── one transaction ───────────────────────────── */
.tbl tbody tr[data-tx] { cursor: pointer; }
.tx-sheet .modal-box { width: min(480px, 100%); max-height: 86vh; }
.tx-sheet .pane-h h2 { display: flex; align-items: center; gap: 8px; min-width: 0; overflow-wrap: anywhere; }
.tx-b { display: flex; flex-direction: column; gap: 16px; padding: 18px var(--pad) 20px; overflow-y: auto; }
.tx-amt { font-size: 28px; font-weight: 700; line-height: 1.15; color: var(--paper); overflow-wrap: anywhere; }
.tx-amt.up { color: var(--green); }
.tx-amt small { display: block; margin-top: 4px; font-size: 15px; font-weight: 500; color: var(--dim); }
.tx-kv { display: flex; flex-direction: column; }
.tx-kv > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 15px; }
.tx-kv > div > span:first-child { flex: none; color: var(--dim); }
.tx-kv > div > span:last-child { display: flex; align-items: center; gap: 6px; min-width: 0; text-align: right; color: var(--paper); }
.tx-addr { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.tx-kv .icon-btn { flex: none; }
.tx-kv a.tx, .tx-refund a.tx { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.tx-kv a.tx .ic, .tx-refund a.tx .ic { width: 14px; height: 14px; }
.tx-refund { display: flex; flex-direction: column; gap: 8px; }
.tx-refund .btn { width: 100%; }
.tx-refund p { font-size: 14px; line-height: 1.4; }
.tx-warn { color: var(--amber); }
.s-refund { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--ink-2); font-size: 14px; line-height: 1.4; color: var(--paper); overflow-wrap: anywhere; }
@media (max-width: 767px) {
  .tx-sheet.modal { padding: 0; place-items: end stretch; }
  .tx-sheet .modal-box { width: 100%; max-height: 92dvh; border-radius: 16px 16px 0 0; }
}
