/* Assets tab. The net-worth sheet is the app's one bold moment: a passbook page with a bound edge. */
.worth {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 32px; align-items: end;
  border-left: 10px solid var(--pine);
  background-image: repeating-linear-gradient(180deg, transparent 0 33px, var(--rule-soft) 33px 34px);
  background-position: 0 14px;
}
.worth-label { font-weight: 600; }
.worth-label small { font-weight: 400; margin-left: 6px; }
.worth-value { font-size: clamp(34px, 6vw, 52px); line-height: 1.1; font-weight: 700; letter-spacing: -.03em; margin-top: 6px; }
.worth-read { color: var(--brass); font-weight: 500; margin-top: 4px; }
.worth-diff { margin-top: 10px; font-size: 14px; color: var(--muted); }
.worth-diff.up b { color: var(--good); }
.worth-diff.down b { color: var(--seal); }
.worth-split { display: grid; gap: 10px; margin: 0; min-width: 190px; }
.worth-split div { display: flex; justify-content: space-between; gap: 18px; border-bottom: 1px dashed var(--rule); padding-bottom: 6px; }
.worth-split dt { color: var(--muted); font-size: 14px; }
.worth-split dd { margin: 0; font-weight: 600; }

.chart { position: relative; width: 100%; min-height: 200px; }
.line-chart { display: block; width: auto; height: auto; overflow: visible; font-family: var(--font); }
.line-chart .grid line { stroke: var(--rule-soft); stroke-width: 1; }
.line-chart .grid line.zero { stroke: var(--muted); }
.line-chart text { fill: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.line-chart .series { fill: none; stroke: var(--pine-2); stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }
.line-chart .dot { fill: var(--sheet); stroke: var(--pine-2); stroke-width: 2; }
.line-chart .dot.last, .line-chart .dot.on { fill: var(--pine-2); r: 5; }
.line-chart .cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.line-chart .hit { cursor: crosshair; touch-action: pan-y; }
.chart-tip {
  position: absolute; pointer-events: none; display: grid; gap: 1px; min-width: 150px;
  padding: 8px 12px; border-radius: 10px; background: var(--ink); color: var(--sheet); font-size: 13px; box-shadow: var(--shadow);
}
.chart-tip[hidden] { display: none; }
.chart-tip span { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.chart-tip small { color: inherit; opacity: .75; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .line-chart .series, :root:not([data-theme="light"]) .line-chart .dot { stroke: var(--good); } :root:not([data-theme="light"]) .line-chart .dot.last, :root:not([data-theme="light"]) .line-chart .dot.on { fill: var(--good); } }

.sides { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; align-items: start; }
.sides .sheet + .sheet { margin-top: 0; }
.side-sheet h2 small { font-size: 15px; font-weight: 600; color: var(--muted); margin-left: 6px; }
.group-title { font-size: 13px; font-weight: 500; color: var(--muted); margin: 14px 0 4px; }
.accounts { list-style: none; margin: 0; padding: 0; }
.account { border-bottom: 1px solid var(--rule-soft); }
.account:last-child { border-bottom: 0; }
.account.closed { opacity: .6; }
.account-line {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 4px; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; border-radius: 8px;
}
.account-line:hover { background: var(--paper); }
.account-name, .account-balance { display: grid; min-width: 0; }
.account-name small, .account-balance small { font-size: 12.5px; color: var(--muted); }
.account-balance { justify-items: end; text-align: right; }
.account-balance b { font-weight: 600; font-size: 15.5px; }
.account-detail { padding: 4px 4px 14px; }
.account-detail .card-actions { margin-top: 12px; padding-top: 12px; }

@media (max-width: 860px) {
  .worth { grid-template-columns: 1fr; border-left-width: 8px; }
  .sides { grid-template-columns: 1fr; }
}

/* Holdings follow the Korean brokerage convention: a rise is red, a fall is blue. */
.gain, .gain b { color: var(--rise); }
.loss, .loss b { color: var(--fall); }
.holdings { margin: 6px 0 12px; padding: 12px 14px 4px; border: 1px solid var(--rule); border-radius: 12px; background: var(--paper); }
.holdings .sub-head { margin-top: 0; }
.holdings-table td { vertical-align: top; }
.holdings-table td.lead-cell { font-weight: 600; }
.holding-acts { display: flex; gap: 8px; margin-top: 2px; font-weight: 400; }
.holding-acts .link { font-size: 12.5px; padding: 2px 0; }
.holdings-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px 18px; margin: 12px 0 4px; padding-top: 12px; border-top: 1px solid var(--rule); }
.holdings-sum dt { font-size: 12.5px; color: var(--muted); }
.holdings-sum dd { margin: 2px 0 0; font-weight: 600; }
.holdings-sum .gain dd, .holdings-sum .loss dd { color: inherit; }
.holdings .note { margin-top: 6px; }
.premium-log.trades li { grid-template-columns: minmax(0, 1fr) auto 0 auto; }
.kpi .invest { font-style: normal; font-size: 13px; margin-top: 4px; }
.kpi .invest b { font-size: inherit; letter-spacing: 0; line-height: inherit; }
@media (max-width: 640px) {
  .holdings-table.stack td:last-child { grid-column: 1 / -1; text-align: left; display: flex; align-items: baseline; gap: 8px; padding-top: 4px; }
  .holdings-table.stack td:last-child::before { display: inline; }
  .holdings-table.stack td:last-child small { display: inline; }
}
