.account-launchbar { display: flex; justify-content: flex-end; padding: 16px 0 4px; }
.account-launch { display: inline-flex; align-items: center; gap: 12px; border: 1px solid var(--border-subtle); border-radius: 100px; background: #17152a; color: var(--text-primary); padding: 9px 16px; cursor: pointer; font: inherit; font-size: .85rem; }
.account-launch:hover { border-color: #a78bfa; background: #211b36; }
.account-launch-icon { color: #a78bfa; font-size: 1.1rem; }
.account-drawer { position: fixed; inset: 0 0 0 auto; width: min(780px, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0 0 0 auto; padding: 0; border: 0; border-left: 1px solid var(--border-subtle); background: #100f20; color: var(--text-primary); overflow-y: auto; overscroll-behavior: contain; box-shadow: -20px 0 80px #0008; }
.account-drawer::backdrop { background: #05040b99; backdrop-filter: blur(4px); }
.account-drawer[open] { animation: account-slide-in .2s ease-out; }
.account-panel { background: #100f20; padding: 24px; margin: 0; min-height: 100%; box-sizing: border-box; }
.account-drawer-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; color: var(--text-secondary); font-size: .8rem; letter-spacing: .05em; }
.account-close { border: 1px solid var(--border-subtle); background: #ffffff08; color: var(--text-primary); border-radius: 50%; width: 36px; height: 36px; cursor: pointer; }
.account-close:hover { background: #ffffff18; }
body:has(.account-drawer[open]) { overflow: hidden; }
@keyframes account-slide-in { from { transform: translateX(40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@media(prefers-reduced-motion: reduce) { .account-drawer[open] { animation: none; } }
.account-bar, .account-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.account-bar { justify-content: space-between; }
.account-bar h2 { font-size: 1.15rem; margin: 0; }
.account-panel p { color: var(--text-secondary); line-height: 1.7; margin: 10px 0; }
.account-panel [hidden] { display: none !important; }
#account-status { font-size: .88rem; overflow-wrap: anywhere; }
#account-status[data-error="true"] { color: #fda4af; }
.asset-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 18px 0; }
.asset-cards article { background: #818cf80c; border: 1px solid var(--border-subtle); border-radius: 12px; padding: 16px; }
.asset-cards h3 { font-size: .85rem; color: var(--text-secondary); font-weight: 500; }
.asset-cards strong { display: block; font-size: 1.5rem; color: var(--text-bright); margin-top: 8px; overflow-wrap: anywhere; }
.asset-cards small { color: var(--text-secondary); line-height: 1.6; display: block; margin-top: 8px; }
.asset-history svg { width: 100%; max-height: 250px; display: block; }
.asset-history text { fill: #aab5cd; font-size: 12px; }
.asset-trend-scroll { overflow-x: auto; }
.asset-history .asset-trend-scroll svg { min-width: 660px; max-height: none; }
.asset-history .asset-trend-scroll text { font-size: 14px; }
.asset-history .asset-trend-scroll table { white-space: nowrap; width: 100%; }
.asset-trend-help { font-size: .8rem; color: #aab5cd; }
.asset-history-point { cursor: help; outline: none; }
.asset-history-tooltip { visibility: hidden; pointer-events: none; }
.asset-history-tooltip rect { fill: #151b2e; stroke: #536480; stroke-width: 1; }
.asset-history .asset-history-tooltip text { fill: #f1f5f9; font-size: 16px; }
.asset-history-point:hover .asset-history-tooltip,
.asset-history-point:focus .asset-history-tooltip { visibility: visible; }
.asset-history-point:hover > circle,
.asset-history-point:focus > circle { fill: #fff; }
.asset-table-wrap { overflow: auto; max-height: 350px; margin-top: 16px; }
.asset-table-wrap table { border-collapse: collapse; width: 100%; white-space: nowrap; font-size: .85rem; }
.asset-table-wrap th, .asset-table-wrap td { padding: 12px; border-bottom: 1px solid var(--border-subtle); text-align: right; }
.asset-table-wrap th:first-child, .asset-table-wrap td:first-child { text-align: left; }
.asset-table-wrap th { position: sticky; top: 0; background: #181b30; }
.account-conflict { padding: 12px; border: 1px solid #fbbf24; border-radius: 10px; }
.account-cash-editor { margin: 20px 0; padding: 16px; border: 1px solid #a78bfa40; background: #a78bfa08; border-radius: 12px; }
.account-cash-editor label { display: block; font-size: .9rem; margin-bottom: 10px; }
.account-cash-row { display: flex; align-items: center; gap: 12px; }
.account-cash-row input { min-width: 0; flex: 1; }
.account-cash-row button { flex-shrink: 0; }
.account-panel #account-cash-help, .account-panel #asset-chart-note { font-size: .8rem; }
.asset-chart-title { font-size: 1rem; margin: 24px 0 12px; }
@media(max-width: 450px) { .account-cash-row { align-items: stretch; flex-direction: column; } }
@media(max-width: 650px) { .asset-cards { grid-template-columns: 1fr; } .account-panel { padding: 18px 14px; } }
.portfolio-summary-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
#portfolio-broker-update[hidden], #portfolio-broker-status[hidden] { display: none !important; }
.portfolio-broker-status { margin: 12px 0 0; color: var(--text-secondary); font-size: .85rem; line-height: 1.7; overflow-wrap: anywhere; }
.portfolio-broker-status[data-error="true"] { color: #fda4af; }
.asset-holdings-section { margin-top: 24px; padding: 16px; border: 1px solid var(--border-subtle); border-radius: 12px; background: #818cf808; }
.asset-holdings-section .asset-chart-title { margin-top: 0; }
#asset-holdings-note { font-size: .8rem; }
.asset-holdings-chart svg { display: block; width: min(100%, 260px); margin: 8px auto 16px; }
.holdings-chart-caption { fill: #b5b2ce; font-size: 10px; }
.holdings-chart-total { fill: #f4f1ff; font-size: 15px; font-weight: 700; }
.holdings-list { list-style: none; padding: 0; margin: 0; }
.holdings-list li { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid var(--border-subtle); }
.holdings-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.holdings-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.holdings-name strong, .holdings-name span, .holdings-name small, .holdings-value strong, .holdings-value span { display: block; }
.holdings-name strong, .holdings-value strong { font-size: .9rem; }
.holdings-name span, .holdings-name small, .holdings-value span { font-size: .78rem; color: var(--text-secondary); margin-top: 4px; }
.holdings-value { text-align: right; flex-shrink: 0; font-variant-numeric: tabular-nums; }
@media(max-width: 650px) { .portfolio-summary-actions { width: 100%; flex-direction: column; align-items: stretch; } .portfolio-summary-actions button, .portfolio-summary-actions #stock-batch-actions { width: 100%; } }
.return-calendar { margin: 24px 0; }
.return-heading { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.return-heading h3 { margin:0; }
.return-grid { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:3px; text-align:center; margin:12px 0; }
.return-grid > span, .return-calendar > small { color:#aab5cd; font-size:.78rem; }
.return-day { display:grid; align-content:start; gap:4px; min-height:60px; padding:4px 1px; background:#212638; border-radius:4px; font-size:clamp(9px,1.8vw,14px); overflow-wrap:anywhere; }
.return-day b { text-align:right; padding-right:4px; color:#c9d2df; font-size:.8em; }
.return-day.gain { background:#51282f; color:#ffb6b6; }
.return-day.loss { background:#193b32; color:#9ae6b8; }
.settle-grid { display:grid;grid-template-columns:repeat(auto-fit,minmax(155px,1fr));gap:8px; }
.settle-card { display:grid;gap:8px;padding:10px;background:#212638;border-radius:6px;font-size:.83rem; }
.settle-card input { width:7em;max-width:100%; }
.income-panels { display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:8px;margin:8px 0 14px; }
.income-panels > div, .income-badge { background:#39242e;border:1px solid #865161;border-radius:6px;padding:8px; }
.income-panels > div { display:grid;gap:4px; }
.income-panels strong, .income-badge strong { color:#ffb4bb;font-weight:700;font-variant-numeric:tabular-nums; }
.income-panels strong { font-size:1.3rem; }
.income-panels small { color:#ecd4da; }
.income-badge { cursor:pointer;color:#ffe8ec; }
.return-grid { position:relative; }
.return-day[tabindex] { cursor:help; }
.return-day[tabindex]:focus { outline:2px solid #a78bfa;outline-offset:-2px; }
.return-detail { display:none;position:absolute;left:0;right:0;top:100%;z-index:20;background:#151b2e;border:1px solid #64748b;border-radius:8px;padding:14px;box-shadow:0 10px 30px #0008;color:#e2e8f0;text-align:left;font-size:.82rem;line-height:1.5; }
.return-day:hover .return-detail, .return-day:focus-within .return-detail { display:block; }
.return-detail p { margin:6px 0 10px;color:#b8c4d8;font-size:.75rem; }
.return-detail-scroll { max-height:260px;overflow:auto; }
.return-detail table { width:100%;border-collapse:collapse;white-space:nowrap; }
.return-detail th, .return-detail td { padding:8px 6px;border-bottom:1px solid #364155;text-align:right; }
.return-detail th:first-child { text-align:left; }
.return-detail small { display:block;font-size:.7rem; }
.return-detail .price-up { color:#ff9da7; }
.return-detail .price-down { color:#86efac; }
