/* Preferences are rendered by PHP before the stylesheet loads, avoiding a theme flash. */
.portfolio-selectors{display:flex;align-items:center;gap:10px;min-width:0}
.account-switcher{display:flex;align-items:center;gap:7px;width:clamp(140px,18vw,240px);min-width:0;margin:0;padding:0}
.account-switcher select{width:100%;padding:7px 28px 7px 10px;font-size:.75rem;min-width:0;text-overflow:ellipsis}
.portfolio-selectors select{height:36px}
.sidebar>.nav-label{margin-top:28px}
.security-settings>.management-form{padding:0 22px 22px}
.legal-document{max-width:850px;margin:48px auto;padding:0 24px 48px;line-height:1.8}
.legal-document h1{margin:24px 0 8px;font-size:2rem}
.legal-document section{margin:28px 0}
.legal-document h2{font-size:1rem;margin-bottom:8px}
.terms-choice{display:flex;flex-direction:row;align-items:flex-start;gap:10px;font-weight:400;line-height:1.7}
.terms-choice input{width:18px;height:18px;flex-shrink:0;margin-top:4px}
.footer-links{display:flex;align-items:center;justify-content:flex-end;gap:12px;flex-wrap:wrap}
.footer-links>a{color:inherit}
.user-menu{position:relative;flex-shrink:0}
.user-menu>summary{list-style:none;cursor:pointer;display:flex;align-items:center;gap:8px;color:var(--ink);font-size:.75rem;padding:4px 8px 4px 4px;border:1px solid var(--line);border-radius:8px;white-space:nowrap}
.user-menu>summary::-webkit-details-marker{display:none}
.user-menu-name{max-width:160px;overflow:hidden;text-overflow:ellipsis}
.user-menu>summary .avatar{flex-shrink:0}
.user-menu>summary>.icon{height:14px;width:14px;transform:rotate(90deg)}
.user-menu[open]>summary,.user-menu>summary:hover{background:var(--green-light)}
.user-menu[open]>summary>.icon{transform:rotate(-90deg)}
.user-menu-panel{position:absolute;right:0;top:calc(100% + 10px);width:280px;max-width:calc(100vw - 32px);max-height:70vh;overflow:auto;background:var(--surface);border:1px solid var(--line);box-shadow:0 12px 40px #0003;border-radius:12px;padding:16px;z-index:40}
.user-menu-group+.user-menu-group{margin-top:16px}
.user-menu-label{display:block;color:var(--muted);font-size:.6875rem;margin-bottom:8px}
.user-menu-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
.user-menu-panel form{margin:0;min-width:0}
.user-menu-choice{width:100%;min-height:36px;padding:8px 6px;border:1px solid var(--line);border-radius:6px;background:transparent;color:var(--ink);font:inherit;font-size:.75rem;cursor:pointer}
.user-menu-choice:hover,.user-menu-choice[aria-pressed="true"]{background:var(--green-light);border-color:var(--green);color:var(--green-dark)}
.user-menu-choice[aria-pressed="true"]{font-weight:600}
.user-menu-actions{margin-top:16px;padding-top:8px;border-top:1px solid var(--line)}
.user-menu-action{display:flex;align-items:center;gap:8px;width:100%;padding:10px 6px;border:0;border-radius:6px;background:transparent;color:var(--ink);font:inherit;font-size:.75rem;text-align:left;text-decoration:none;cursor:pointer}
.user-menu-action .icon{width:16px;height:16px;flex-shrink:0}
.user-menu-action:hover{background:var(--green-light)}
.user-menu-choice:focus-visible,.user-menu-action:focus-visible{outline:2px solid var(--green);outline-offset:2px}
[data-density="comfortable"] .user-menu-choice,[data-density="comfortable"] .user-menu-action{min-height:42px}
.page-footer>.footer-credit{color:inherit;text-align:right}
.footer-credit:hover{text-decoration:underline}
.currency-switcher select{width:5.5rem;min-width:5.5rem;padding-right:1.75rem;flex-shrink:0}
.chart-axis-label{font-size:12px;fill:var(--muted);font-variant-numeric:tabular-nums}
.market-settings>.panel-heading{padding:0 0 20px;flex-wrap:wrap;gap:14px}
.market-provider-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:22px;padding:0}
.market-provider{padding:22px;min-width:0}
.market-settings>.notice.market-services-note{margin:20px 0 0;padding:0;line-height:1.7}
.market-provider h3{font-size:.875rem;display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.market-provider p{font-size:.75rem;color:var(--muted);margin:12px 0;line-height:1.7}
.market-provider>.text-link{margin-bottom:18px}
.market-provider .management-form{gap:12px;padding-bottom:12px}
.quote-report{margin-bottom:22px}
.quote-report>.form-hint{padding:0 22px 18px}
.quote-report-details>summary{padding:0 22px 18px;cursor:pointer;color:var(--ink);font-size:.8rem}
.heading-actions{flex-wrap:wrap;justify-content:flex-end}
.heading-actions .online-action{display:inline-flex}
.online-quote-action{display:flex;flex-direction:column;align-items:flex-end;gap:4px}
.last-quote-update{font-size:.625rem;color:var(--muted);white-space:nowrap;font-variant-numeric:tabular-nums}
[data-density="comfortable"] .last-quote-update{font-size:.6rem}
.online-run-panel{padding:0 0 22px;display:flex;flex-direction:column;gap:14px}
.online-run-panel progress{width:100%;height:12px;accent-color:var(--green)}
.online-run-panel p{font-size:.8rem;color:var(--ink)}
.performance-panel .panel-heading{flex-wrap:wrap}
.performance-panel .segmented{flex-wrap:wrap;max-width:100%}
.chart-controls{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px;margin-left:auto}
.ibkr-content{padding:0 23px 22px}
.ibkr-content>p{font-size:.8125rem;line-height:1.7;margin-bottom:12px}
.ibkr-content .management-form{max-width:620px}
.ibkr-connection{padding:18px 0;border-top:1px solid var(--line);margin-top:18px}
.ibkr-connection h3,.ibkr-connection summary{margin-bottom:14px;font-size:.875rem}
.ibkr-match-form{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:8px}
.ibkr-match-form select{max-width:180px}
.sort-link{display:inline-flex;align-items:center;gap:7px;color:inherit}
th.num .sort-link{justify-content:flex-end}
.sort-arrow{font-size:1em;opacity:.55}
.sort-link.is-sorted .sort-arrow,.sort-link:hover .sort-arrow{opacity:1}
.sort-link:focus-visible{outline:2px solid currentColor;outline-offset:4px;border-radius:2px}
.cash-summary .cash-net-deposit{font-weight:600}
.cash-flow-filters{align-items:flex-end;flex-wrap:wrap}
.cash-flow-filters>label{flex:1 1 240px;min-width:0}
.cash-flow-filters select,.cash-flow-filters>.button{height:42px;min-height:42px}
.cash-flow-filters select{padding-top:8px;padding-bottom:8px}
.import-tabs{margin-bottom:22px;flex-wrap:wrap}
.import-tab-content>#ibkr-imports{margin-top:0}
.settings-tabs{margin:22px 0;flex-wrap:wrap}
.settings-tab-content>.section-gap{margin-top:0}
.chart-interactive{position:relative}
.chart-summary{flex-wrap:wrap;row-gap:8px}
.chart-readout{display:inline-flex;align-items:baseline;gap:7px;margin-left:auto;font-size:.8125rem;line-height:1.5;font-variant-numeric:tabular-nums;white-space:nowrap}
.chart-readout[hidden]{display:none}
.chart-readout [data-chart-date],.chart-readout-separator{color:var(--muted)}
.chart-summary .chart-readout strong{font-size:.875rem;font-weight:600;color:var(--ink)}
.chart-summary-readout{padding-top:4px}
@media(max-width:600px){.chart-readout{width:100%;justify-content:flex-end;font-size:.75rem}.chart-summary .chart-readout strong{font-size:.8125rem}}
.chart-hover-marker line{stroke:var(--muted);stroke-width:1;stroke-dasharray:4 4;opacity:.65}
.chart-hover-marker circle{fill:var(--green-dark);stroke:var(--surface);stroke-width:2}
.performance-chart:focus-visible{outline:2px solid var(--green-dark);outline-offset:3px;border-radius:4px}
@media print{.chart-readout,.chart-hover-marker{display:none}}
@media(max-width:600px){.page-heading{flex-wrap:wrap}.heading-actions{justify-content:flex-start;margin-top:0}}
@media(max-width:1100px){.market-provider-grid{grid-template-columns:1fr}}
.management-list{padding:0 22px 20px}
.manage-record{border-top:1px solid var(--line)}
.manage-record>summary{display:flex;align-items:center;gap:15px;cursor:pointer;list-style:none;padding:18px 0;flex-wrap:wrap}
.manage-record>summary::-webkit-details-marker{display:none}
.manage-record>summary>span:first-child{flex:1;min-width:170px;overflow-wrap:anywhere}
.manage-record>summary strong{font-size:.875rem}
.manage-record>summary small{display:block;color:var(--muted);margin-top:4px}
.manage-record[open]>summary .text-link .icon{transform:rotate(90deg)}
.management-form{display:flex;flex-direction:column;gap:16px;padding:0 0 22px;max-width:850px}
summary:focus-visible{outline:3px solid #7caa91;outline-offset:3px;border-radius:6px}
[hidden]{display:none!important}

html[data-density="comfortable"]{font-size:20px;--sidebar:280px}
[data-density="comfortable"] body{font-size:.8rem;line-height:1.65}
[data-density="comfortable"] table{font-size:.75rem}
[data-density="comfortable"] th{font-size:.65rem;padding-top:16px;padding-bottom:16px}
[data-density="comfortable"] td{padding-top:19px;padding-bottom:19px}
[data-density="comfortable"] .nav-item{font-size:.75rem;min-height:48px;height:auto;padding-top:10px;padding-bottom:10px}
[data-density="comfortable"] .button{font-size:.7rem;min-height:42px;padding:11px 16px}
[data-density="comfortable"] label,[data-density="comfortable"] input,[data-density="comfortable"] select,[data-density="comfortable"] textarea{font-size:.75rem}
[data-density="comfortable"] .metric-note,[data-density="comfortable"] .panel-heading p,[data-density="comfortable"] .asset-cell small,[data-density="comfortable"] .form-hint,[data-density="comfortable"] .table-foot,[data-density="comfortable"] .notice,[data-density="comfortable"] .page-heading p{font-size:.65rem}
[data-density="comfortable"] .small-text,[data-density="comfortable"] .text-link,[data-density="comfortable"] .text-button,[data-density="comfortable"] .asset-cell strong{font-size:.7rem}
[data-density="comfortable"] .badge{font-size:.6rem}
[data-density="comfortable"] .topbar{min-height:85px;height:auto;padding-top:15px;padding-bottom:15px;gap:15px}
[data-density="comfortable"] .account-switcher select{font-size:.7rem}
[data-density="comfortable"] .metric-value{font-size:clamp(1.1rem,2vw,1.7rem);white-space:normal;overflow-wrap:anywhere}
[data-density="comfortable"] .chart-summary{flex-wrap:wrap}

html[data-theme="dark"]{color-scheme:dark;--bg:#101714;--surface:#1b2520;--ink:#edf3ee;--muted:#b6c5bb;--line:#35453b;--green:#84d4ae;--green-dark:#a5e4c5;--green-light:#263e31;--red:#ffaca5;--shadow:0 2px 8px #0002}
[data-theme="dark"] .sidebar,[data-theme="dark"] .panel,[data-theme="dark"] .modal,[data-theme="dark"] .donut>div,[data-theme="dark"] .button.secondary{background:var(--surface);border-color:var(--line);color:var(--ink)}
[data-theme="dark"] .topbar{background:#18221df2}
[data-theme="dark"] input,[data-theme="dark"] select,[data-theme="dark"] textarea,[data-theme="dark"] .currency-switcher select,[data-theme="dark"] .login-form-inner input{background:#141e18;color:var(--ink);border-color:#4e6355}
[data-theme="dark"] input::placeholder,[data-theme="dark"] textarea::placeholder{color:#aab9af}
[data-theme="dark"] .button.primary{background:#86d6b0;color:#10291d;border-color:#86d6b0}
[data-theme="dark"] .button.primary:hover{background:#a5e4c5}
[data-theme="dark"] th,[data-theme="dark"] .table-foot,[data-theme="dark"] .date-tile,[data-theme="dark"] .days-badge,[data-theme="dark"] .segmented,[data-theme="dark"] .metric-icon,[data-theme="dark"] .soft-icon,[data-theme="dark"] .ticker-logo,[data-theme="dark"] .upload-symbol,[data-theme="dark"] .steps li>span{background:#222e27;border-color:var(--line);color:var(--muted)}
[data-theme="dark"] td,[data-theme="dark"] th,[data-theme="dark"] .search-field,[data-theme="dark"] .table-filters>select,[data-theme="dark"] .chart-note,[data-theme="dark"] .panel-bottom-link,[data-theme="dark"] .expiry-item,[data-theme="dark"] .cash-summary>div,[data-theme="dark"] .target-row,[data-theme="dark"] .modal-footer{border-color:var(--line)}
[data-theme="dark"] tbody tr:hover,[data-theme="dark"] .nav-item:hover,[data-theme="dark"] .icon-button:hover,[data-theme="dark"] .panel-bottom-link:hover,[data-theme="dark"] .button.secondary:hover{background:#293a2f}
[data-theme="dark"] .nav-item.active,[data-theme="dark"] .metric-card.featured,[data-theme="dark"] .info-strip,[data-theme="dark"] .demo-banner,[data-theme="dark"] .notice,[data-theme="dark"] .notice.success{background:#263b2e;border-color:#405b48;color:#d8eadd}
[data-theme="dark"] .nav-item.active,[data-theme="dark"] .nav-item.active .icon,[data-theme="dark"] .tabs .active{color:#a5e4c5}
[data-theme="dark"] .notice.error,[data-theme="dark"] .badge.red{background:#472a29;border-color:#754340;color:#ffc1b9}
[data-theme="dark"] .notice.subdued{background:transparent;color:var(--muted)}
[data-theme="dark"] .badge.green,[data-theme="dark"] .mini-trend{background:#264433;color:#b3ebc6}
[data-theme="dark"] .badge.purple{background:#3b3049;color:#e1c7ff}
[data-theme="dark"] .badge.blue{background:#283c52;color:#c4deff}
[data-theme="dark"] .badge.neutral-badge,[data-theme="dark"] .avatar,[data-theme="dark"] .nav-count,[data-theme="dark"] .tabs span span,[data-theme="dark"] .tabs a span{background:#344239;color:#e3ece5}
[data-theme="dark"] .segmented a.selected{background:#3b5142;color:#f1f6f2}
[data-theme="dark"] .positive{color:#9be4b5!important}
[data-theme="dark"] .warning-text{color:#f2cf89}
[data-theme="dark"] .import-errors{color:#ffc1b9}
[data-theme="dark"] .settings-profile p{color:var(--muted)}
[data-theme="dark"] .chart-grid{stroke:var(--line)}
[data-theme="dark"] .performance-chart polyline{stroke:#84d4ae}
[data-theme="dark"] .performance-chart circle{fill:#84d4ae}
[data-theme="dark"] .login-body{background:var(--bg)}
[data-theme="dark"] .login-story{background:#1c2d22}
[data-theme="dark"] .login-story:after{border-color:#354a3b;box-shadow:0 0 0 60px #2a3c2e44,0 0 0 120px #2a3c2e22}
[data-theme="dark"] .login-divider:before,[data-theme="dark"] .login-divider:after{background:var(--line)}

@media(max-width:1250px){[data-density="comfortable"] .topbar-right{gap:10px}[data-density="comfortable"] .breadcrumb>span{display:none}[data-density="comfortable"] .local-indicator{display:none}}
@media(max-width:800px){[data-density="comfortable"] .topbar{padding:12px 16px}[data-density="comfortable"] .breadcrumb{gap:7px}[data-density="comfortable"] .breadcrumb strong{font-size:.65rem}.topbar-right{gap:9px}.user-menu-name{max-width:100px}}
@media(max-width:480px){.user-menu-name{max-width:72px}.portfolio-selectors{gap:6px}.user-menu>summary{gap:5px}.page-footer>.footer-credit{font-size:.5rem;max-width:155px}}
@media(max-width:800px){.topbar{flex-wrap:wrap;height:auto;gap:10px;padding:12px 16px}.topbar-right{width:100%;justify-content:flex-end;min-width:0}.portfolio-selectors{flex:1}.account-switcher{flex:1;width:auto}.currency-switcher{flex-shrink:0}}
@media(max-width:600px){[data-density="comfortable"] .content{padding:20px 14px 0}[data-density="comfortable"] .metrics-grid{grid-template-columns:1fr}[data-density="comfortable"] .metric-value{font-size:1.5rem}[data-density="comfortable"] .page-heading{flex-wrap:wrap}[data-density="comfortable"] .page-heading p{max-width:none}[data-density="comfortable"] .currency-switcher select{width:76px}[data-density="comfortable"] .currency-switcher small{display:none}.management-list{padding:0 16px 16px}.manage-record>summary{gap:10px}.manage-record>summary>span:first-child{flex-basis:100%}.management-form .form-grid{grid-template-columns:1fr}.management-form .inline-actions{flex-wrap:wrap}}
@media print{html[data-theme="dark"]{--ink:#171c19;--muted:#4d554f;--bg:white;--surface:white;--line:#ccc;--red:#a2382d}html[data-theme="dark"] .panel,html[data-theme="dark"] td,html[data-theme="dark"] th{background:white;color:#171c19}html[data-theme="dark"] .positive{color:#216650!important}}
