:root {
    --navy: #0B2D4D;
    --navy-deep: #082239;
    --teal: #10B981;
    --teal-light: #34D399;
    --ink: #10283d;
    --muted: #6b7c8d;
    --surface: #ffffff;
    --canvas: #f4f8fb;
    --line: #e2eaf0;
    --header-height: 64px;
    --nav-height: 68px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--canvas);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body { background: var(--canvas); }
button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }

.auth-page { min-height: 100svh; background: linear-gradient(160deg, var(--navy) 0 38%, var(--canvas) 38%); }
.login-shell { display: grid; min-height: 100svh; place-items: center; padding: 24px; }
.login-card { width: min(100%, 390px); padding: 32px 26px; border-radius: 24px; background: var(--surface); box-shadow: 0 18px 55px rgb(7 35 57 / 18%); }
.login-brand, .brand-lockup { display: inline-flex; align-items: center; gap: 10px; color: #fff; }
.login-brand { color: var(--navy); margin-bottom: 48px; }
.login-brand img, .brand-lockup img { width: 34px; height: 34px; object-fit: contain; }
.login-brand span, .brand-lockup span { font-size: 16px; font-weight: 750; letter-spacing: -.02em; line-height: 1; }
.login-brand small, .brand-lockup small { display: block; margin-top: 5px; font-size: 8px; font-weight: 700; letter-spacing: .32em; }
.eyebrow { margin: 0 0 8px; color: var(--teal); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1 { margin: 0; color: var(--navy); font-size: clamp(28px, 8vw, 38px); letter-spacing: -.045em; }
.login-intro { margin: 10px 0 26px; color: var(--muted); font-size: 15px; line-height: 1.5; }
.login-form { display: grid; gap: 10px; }
.login-form label { color: var(--navy); font-size: 13px; font-weight: 700; }
.login-form input[type="password"] { width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); outline: none; }
.login-form input[type="password"]:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgb(16 185 129 / 14%); }
.primary-button { margin-top: 10px; padding: 13px 16px; border: 0; border-radius: 12px; background: var(--teal); color: #fff; cursor: pointer; font-weight: 800; }
.primary-button:hover { background: #0da875; }
.form-error { margin: 0 0 14px; padding: 10px 12px; border-radius: 10px; background: #fff0f0; color: #a32626; font-size: 13px; }

.app-page { padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom)); }
.app-header { position: fixed; z-index: 20; top: 0; right: 0; left: 0; display: flex; height: calc(var(--header-height) + env(safe-area-inset-top)); align-items: flex-end; justify-content: space-between; padding: env(safe-area-inset-top) 18px 0; background: var(--navy); box-shadow: 0 2px 14px rgb(4 26 43 / 14%); }
.brand-lockup { height: var(--header-height); }
.profile-wrap { position: relative; height: var(--header-height); display: flex; align-items: center; }
.profile-button { display: grid; width: 38px; height: 38px; place-items: center; padding: 0; border: 1px solid rgb(255 255 255 / 35%); border-radius: 50%; background: rgb(255 255 255 / 10%); color: #fff; cursor: pointer; }
.profile-button svg { width: 21px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.profile-menu { position: absolute; top: calc(var(--header-height) - 1px); right: 0; width: 220px; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 12px 32px rgb(7 35 57 / 17%); }
.profile-menu[hidden] { display: none; }
.privacy-toggle { display: flex; min-height: 42px; align-items: center; justify-content: space-between; gap: 10px; padding: 0 8px; color: var(--navy); cursor: pointer; font-size: 13px; font-weight: 700; }
.privacy-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track { width: 38px; height: 22px; padding: 3px; border-radius: 99px; background: #c8d4dd; transition: background .18s ease; }
.switch-track span { display: block; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 20%); transition: transform .18s ease; }
.privacy-toggle input:checked + .switch-track { background: var(--teal); }
.privacy-toggle input:checked + .switch-track span { transform: translateX(16px); }
.logout-form { margin-top: 4px; border-top: 1px solid var(--line); }
.logout-button { width: 100%; padding: 10px 8px; border: 0; background: transparent; color: #a32626; cursor: pointer; text-align: left; font-size: 13px; font-weight: 700; }
.app-main { min-height: 100svh; padding: calc(var(--header-height) + env(safe-area-inset-top) + 34px) 22px 28px; }
.page-intro { width: min(100%, 720px); margin: 0 auto; }
.page-intro h1 { font-size: clamp(28px, 8vw, 42px); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.home-main { padding-top: calc(var(--header-height) + env(safe-area-inset-top) + 18px); }
.home-content { width: min(100%, 720px); margin: 0 auto; display: grid; gap: 14px; }
.portfolio-content { width: min(100%, 920px); margin: 0 auto; display: grid; gap: 12px; }
.portfolio-page-heading { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 310px); align-items: start; gap: 20px; margin: 0 2px 2px; }
.portfolio-page-heading h1 { font-size: clamp(34px, 6vw, 48px); line-height: 1.05; }
.portfolio-page-heading p { margin: 10px 0 0; color: #405770; font-size: clamp(16px, 2.5vw, 22px); }
.portfolio-summary { display: grid; gap: 4px; padding: 15px 18px; }
.portfolio-summary > span:first-child { color: #8797a7; font-size: 14px; }
.portfolio-summary strong { color: var(--navy); font-size: clamp(25px, 4vw, 31px); letter-spacing: -.045em; line-height: 1.05; white-space: nowrap; }
.portfolio-summary strong.is-unavailable { font-size: 18px; letter-spacing: -.02em; }
.portfolio-summary-performance { font-size: 14px; }
.portfolio-summary-performance b { font-size: 17px; }
.portfolio-category { min-width: 0; }
.portfolio-category-heading { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 14px; padding: 0 2px 7px; border-bottom: 1px solid #dbe4eb; }
.portfolio-category-title, .portfolio-category-total { display: flex; min-width: 0; align-items: center; }
.portfolio-category-title { gap: 10px; }
.portfolio-category-title h2 { margin: 0; color: var(--navy); font-size: clamp(20px, 3vw, 25px); letter-spacing: -.025em; }
.portfolio-category-icon { display: grid; width: 44px; height: 44px; flex: 0 0 44px; place-items: center; border-radius: 50%; background: #dff5f2; color: #078f98; }
.portfolio-category-icon svg { width: 65%; height: 65%; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.2; }
.portfolio-category-total { flex: 0 0 auto; gap: 7px; color: #405770; font-size: clamp(12px, 2vw, 16px); white-space: nowrap; }
.portfolio-category-total b { color: var(--navy); font-size: clamp(15px, 2.5vw, 20px); }
.portfolio-category-total strong { font-size: clamp(14px, 2.3vw, 19px); }
.portfolio-position-list { overflow: hidden; border: 1px solid #e0e8ee; border-radius: 13px; background: #fff; box-shadow: 0 4px 14px rgb(7 35 57 / 5%); }
.portfolio-position { display: grid; min-width: 0; grid-template-columns: 46px minmax(0, 1fr) minmax(90px, auto); align-items: center; gap: 10px; padding: 11px 16px; border-bottom: 1px solid #e4ebf0; }
.portfolio-position-link { transition: background .15s ease, border-color .15s ease; }
.portfolio-position-link:hover, .portfolio-position-link:focus-visible { background: #f8fffc; outline: none; }
.portfolio-position:last-child { border-bottom: 0; }
.portfolio-position-logo { display: grid; width: 44px; height: 44px; place-items: center; overflow: hidden; border-radius: 50%; background: #e7f6f6; color: var(--navy); font-size: 11px; font-weight: 800; text-align: center; }
.portfolio-position-logo img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; }
.portfolio-position-main { display: grid; min-width: 0; gap: 2px; }
.portfolio-position-main > strong { overflow: hidden; color: var(--navy); font-size: clamp(14px, 2.4vw, 18px); line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.portfolio-position-name, .portfolio-position-provider, .portfolio-position-quantity { min-width: 0; overflow: hidden; color: #405770; font-size: clamp(11px, 1.8vw, 14px); line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.portfolio-position-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; white-space: normal; }
.portfolio-position-provider { color: #65788b; }
.portfolio-position-quantity { color: #405770; }
.portfolio-position-quantity-line { display: flex; min-width: 0; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.portfolio-position-thesis-badge { display: inline-flex; max-width: 100%; align-items: center; padding: 2px 6px; border-radius: 999px; background: #f0eaff; color: #6e4bae; font-size: 9px; font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }
.portfolio-position-side { display: grid; min-width: 0; justify-items: end; gap: 5px; text-align: right; }
.portfolio-position-side b { overflow: hidden; color: var(--navy); font-size: clamp(15px, 2.7vw, 21px); letter-spacing: -.025em; text-overflow: ellipsis; white-space: nowrap; }
.portfolio-position-side strong { font-size: clamp(13px, 2.3vw, 18px); white-space: nowrap; }
.home-card { padding: 18px 16px; border: 1px solid rgb(226 234 240 / 78%); border-radius: 17px; background: var(--surface); box-shadow: 0 5px 22px rgb(7 35 57 / 6%); }
.home-summary { padding: 19px 18px 17px; }
.home-summary-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.home-summary .eyebrow { color: var(--teal); font-size: clamp(14px, 3.8vw, 17px); letter-spacing: .12em; line-height: 1.1; }
.home-rm4 { display: grid; min-width: 0; justify-items: end; gap: 2px; color: var(--muted); text-align: right; }
.home-rm4 span { font-size: 10px; font-weight: 800; letter-spacing: .08em; line-height: 1; }
.home-rm4 strong { color: var(--navy); font-size: 15px; line-height: 1.1; white-space: nowrap; }
.home-total { margin: 0 0 15px; color: var(--navy); font-size: clamp(36px, 10vw, 48px); font-weight: 800; letter-spacing: -.045em; line-height: 1.04; }
.home-total.is-unavailable { font-size: clamp(22px, 7vw, 34px); letter-spacing: -.03em; }
.home-performance-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.home-performance { min-width: 0; color: #4b5d6d; font-size: 14px; }
.home-performance-line { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.home-performance small { margin-left: 3px; color: #4b5d6d; font-size: 12px; }
.home-performance-amount { display: block; margin: 1px 0 0 26px; font-size: 12px; font-weight: 650; line-height: 1.1; white-space: nowrap; }
.trend-arrow { font-size: 20px; font-weight: 800; line-height: 1; }
.is-positive { color: #059669; }
.is-negative { color: #d3443c; }
.is-neutral { color: #647789; }
.home-performance .privacy-performance { font-weight: 750; }
.home-last-update { margin: 9px 0 0; color: #607080; font-size: 11px; line-height: 1.2; }
.home-last-update-bottom { margin: -3px 0 0; text-align: center; }
.home-refresh-status { margin: 8px 0 0; color: var(--muted); font-size: 11px; text-align: right; }
@keyframes home-data-pulse {
    0% { border-color: rgb(226 234 240 / 78%); box-shadow: 0 5px 22px rgb(7 35 57 / 6%); transform: scale(1); }
    38% { border-color: rgb(16 185 129 / 66%); box-shadow: 0 7px 28px rgb(16 185 129 / 24%), 0 0 0 3px rgb(16 185 129 / 16%); transform: scale(1.008); }
    100% { border-color: rgb(226 234 240 / 78%); box-shadow: 0 5px 22px rgb(7 35 57 / 6%); transform: scale(1); }
}
.home-data-pulse { animation: home-data-pulse .8s cubic-bezier(.22, .75, .25, 1); transform-origin: center; }
.chart-card.is-collapsed { padding-bottom: 18px; }
.chart-toggle { display: grid; width: 30px; height: 30px; place-items: center; padding: 0; border: 1px solid #9bb0c0; border-radius: 50%; background: #fff; color: #607990; cursor: pointer; }
.chart-toggle:hover, .chart-toggle:focus-visible { border-color: var(--teal); color: var(--teal); outline: none; }
.chart-toggle-icon { display: block; font-size: 20px; line-height: 1; transform: translateY(-2px); }
.chart-panel[hidden] { display: none !important; }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-heading h2 { margin: 0; color: var(--navy); font-size: 17px; letter-spacing: -.02em; }
.chart-card { padding-bottom: 11px; }
.chart-wrap { position: relative; min-height: 210px; margin: 9px -4px 0; }
.portfolio-chart { display: block; width: 100%; height: auto; min-height: 190px; overflow: visible; }
.chart-grid-lines line { stroke: #e6edf2; stroke-width: 1; stroke-dasharray: 2 4; }
.chart-area { fill: url(#portfolio-area-gradient); }
.chart-line { fill: none; stroke: var(--teal); stroke-linecap: round; stroke-linejoin: round; stroke-width: 3; }
.chart-point { fill: var(--teal); stroke: #fff; stroke-width: 3; cursor: pointer; outline: none; }
.chart-point:focus { stroke: var(--navy); }
.chart-date-labels text { fill: #607990; font-size: 16px; }
.chart-tooltip { position: absolute; top: 8px; z-index: 2; display: grid; min-width: 106px; padding: 8px 10px; transform: translateX(-50%); border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: 0 5px 18px rgb(7 35 57 / 12%); color: var(--navy); font-size: 12px; pointer-events: none; }
.chart-tooltip[hidden] { display: none !important; }
.chart-tooltip time { color: var(--muted); font-size: 11px; }
.chart-tooltip .privacy-value { font-weight: 800; }
.chart-empty { margin: -9px 12px 0; color: var(--muted); font-size: 12px; line-height: 1.4; text-align: center; }
.chart-empty.is-hidden { display: none; }
.distribution-section { min-width: 0; margin: 0; }
.distribution-treemap { display: grid; width: 100%; margin: 0; gap: 8px; }
.distribution-tile { position: relative; display: block; width: 100%; min-width: 0; padding: 9px 12px; border: 1px solid #e1e7eb; border-radius: 12px; background: #fff; color: #263746; box-shadow: 0 1px 3px rgb(15 35 50 / 3%); }
.distribution-tile-content { display: grid; min-width: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center; gap: 10px; line-height: 1.25; }
.distribution-tile-top { display: flex; min-width: 0; align-items: center; gap: 10px; }
.distribution-tile-icon { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border-radius: 9px; background: #f1f4f6; color: #526372; }
.distribution-tile-icon svg { width: 62%; height: 62%; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.4; }
.distribution-tile-copy { display: grid; min-width: 0; gap: 2px; }
.distribution-tile-name { color: #263746; font-size: 16px; line-height: 1.2; }
.distribution-tile-performance { display: inline-flex; align-items: baseline; gap: 4px; color: #477a68; font-size: 13px; font-weight: 750; line-height: 1.25; white-space: normal; }
.distribution-tile-performance.is-negative { color: #955d59; }
.distribution-tile-performance.is-neutral { color: #74818d; }
.distribution-performance-arrow { font-size: 1.25em; line-height: 1; }
.distribution-tile-divider { display: none; }
.distribution-tile-bottom { display: grid; min-width: 0; justify-items: end; gap: 1px; text-align: right; }
.distribution-tile .class-value { min-width: 0; color: #263746; font-size: clamp(17px, 3vw, 20px); font-weight: 800; letter-spacing: -.025em; line-height: 1.15; overflow-wrap: anywhere; }
.distribution-tile .class-weight { min-width: 0; color: #74818d; font-size: 12px; line-height: 1.3; text-align: right; overflow-wrap: anywhere; }
.home-data-note { margin: 11px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.home-valuation-warning { display: grid; width: 100%; box-sizing: border-box; gap: 4px; margin: 12px 0 0; padding: 12px; border: 1px solid #e6bc45; border-left: 4px solid #ca9100; border-radius: 10px; background: #fff7cf; color: #6a4a00; font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.home-valuation-warning strong { color: #5a3e00; font-weight: 800; }
.home-valuation-warning span { min-width: 0; }
.thesis-valuation-note { color: #976c05; font-size: 10px; font-weight: 750; }
.compact-section { padding-bottom: 10px; }
.compact-section .card-heading h2 { color: var(--teal); }
.compact-list { display: grid; gap: 7px; margin-top: 10px; }
.compact-card { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 8px; border: 1px solid #edf2f5; border-radius: 12px; background: #fff; transition: border-color .15s ease, background .15s ease; }
.compact-card:hover, .compact-card:focus-visible { border-color: #8edec4; background: #f8fffc; outline: none; }
.compact-card-main, .compact-card-side { display: grid; min-width: 0; gap: 2px; }
.compact-card-main { flex: 1 1 auto; }
.compact-card-main strong { overflow: hidden; color: var(--navy); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.compact-card-main small, .compact-card-side small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.compact-card-side { flex: 0 0 auto; justify-items: end; text-align: right; }
.compact-card-side b { color: var(--navy); font-size: 14px; }
.compact-card-side .is-positive, .compact-card-side .is-negative, .compact-card-side .is-neutral { font-weight: 750; }
.thesis-section { padding-bottom: 8px; }
.thesis-section .card-heading h2 { color: var(--teal); font-size: 18px; letter-spacing: .035em; text-transform: uppercase; }
.thesis-list { display: grid; margin-top: 5px; }
.thesis-row { display: grid; min-width: 0; grid-template-columns: 44px minmax(0, 1fr) minmax(105px, auto) 14px; align-items: center; gap: 9px; min-height: 78px; padding: 11px 0; border-bottom: 1px solid #e5edf2; color: var(--navy); }
.thesis-row:last-child { border-bottom: 0; }
.thesis-row:hover, .thesis-row:focus-visible { background: #fbfefd; outline: none; }
.thesis-icon { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 50%; color: #fff; }
.thesis-icon svg { width: 64%; height: 64%; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.2; }
.thesis-icon-quantum-1 { background: #079669; }
.thesis-icon-generic { background: #079669; }
.thesis-icon-quantum-2 { background: #287be3; }
.thesis-icon-guida-autonoma { background: #e9a800; }
.thesis-icon-alimentazione-futuro { background: #f27812; }
.thesis-icon-biologia-programmabile { background: #17a9ae; }
.thesis-icon-nucleare-avanzato { background: #1858b5; }
.thesis-icon-accumulo-energetico { background: #ec3038; }
.thesis-icon-materiali-avanzati { background: #16a1ae; }
.thesis-icon-ai-bassissimo-consumo { background: #2259a9; }
.thesis-icon-space { background: #4f5ba8; }
.thesis-icon-reit-usa { background: #a26049; }
.thesis-row-main { display: grid; min-width: 0; align-self: center; gap: 5px; }
.thesis-row-main strong { color: var(--navy); font-size: 15px; line-height: 1.2; }
.thesis-row-main small { color: #637486; font-size: 11px; line-height: 1.25; letter-spacing: .02em; }
.thesis-row-side { display: grid; min-width: 0; justify-items: end; align-self: stretch; gap: 8px; text-align: right; }
.thesis-row-side > b { color: var(--navy); font-size: 15px; line-height: 1.15; white-space: nowrap; }
.thesis-performance-pair { display: flex; min-width: 0; align-items: center; justify-content: flex-end; gap: 6px; white-space: nowrap; }
.thesis-performance { display: inline-flex; min-width: 0; align-items: center; gap: 3px; color: #059669; font-size: 10px; font-weight: 750; line-height: 1.2; }
.thesis-performance.is-negative { color: #d93636; }
.thesis-performance.is-neutral { color: #647789; }
.thesis-performance svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.thesis-performance-divider { color: #d7e0e6; font-size: 16px; line-height: 1; }
.thesis-chevron { color: var(--navy); font-size: 29px; font-weight: 300; line-height: 1; }
.etf-section { padding-bottom: 8px; }
.etf-row-main strong { overflow: hidden; font-size: clamp(13px, 3.7vw, 15px); text-overflow: ellipsis; white-space: nowrap; }
.etf-row-main .etf-name { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; white-space: normal; }
.etf-row-main .etf-isin { overflow: hidden; color: #82909d; font-size: 9px; letter-spacing: .04em; text-overflow: ellipsis; white-space: nowrap; }
.etf-row-main .etf-pac-line { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pac-paused-label { color: var(--teal); font-weight: 800; }
.etf-icon { border-radius: 14px; }
.etf-icon svg { width: 72%; height: 72%; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
.etf-icon-xeon { background: #287be3; }
.etf-icon-msci-world { background: #159bb7; }
.etf-icon-vwce { background: #287be3; }
.etf-icon-xaix { background: #7542b8; }
.etf-icon-urnu { background: #39bd45; }
.pac-logo { overflow: hidden; background: #e7f6f6; color: var(--teal); font-size: 12px; font-weight: 800; }
.pac-logo img { width: 100%; height: 100%; object-fit: contain; }
.detail-content { width: min(100%, 720px); margin: 0 auto; }
.asset-detail-page { display: grid; gap: 12px; }
.asset-detail-page > .detail-back { margin-bottom: 0; }
.detail-back { display: inline-block; margin-bottom: 16px; color: var(--teal); font-size: 13px; font-weight: 750; }
.asset-detail-heading { display: flex; min-width: 0; align-items: center; gap: 12px; }
.asset-detail-heading .eyebrow { margin-bottom: 5px; }
.asset-detail-logo { display: grid; width: 48px; height: 48px; flex: 0 0 48px; place-items: center; border-radius: 12px; background: #e7f6f6; object-fit: contain; }
.asset-detail-logo-fallback { color: var(--teal); font-size: 13px; font-weight: 800; letter-spacing: .02em; }
.detail-subtitle { margin: 8px 0 18px; color: var(--muted); font-size: 14px; }
.detail-summary { margin: 0 0 14px; }
.asset-detail-summary { display: grid; gap: 17px; margin: 0; }
.asset-detail-value-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 18px; }
.asset-detail-value-line .home-total { margin: 5px 0 0; font-size: clamp(32px, 8vw, 45px); }
.asset-detail-pnl { display: grid; min-width: 86px; gap: 2px; justify-items: end; text-align: right; }
.asset-detail-pnl span { color: var(--muted); font-size: 11px; }
.asset-detail-pnl strong { font-size: 17px; line-height: 1.1; }
.asset-detail-pnl small { font-size: 12px; font-weight: 750; }
.asset-detail-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding-top: 15px; border-top: 1px solid #edf2f5; }
.asset-detail-metrics > div { display: grid; min-width: 0; gap: 3px; }
.asset-detail-metrics span { color: var(--muted); font-size: 10px; line-height: 1.2; }
.asset-detail-metrics strong { overflow: hidden; color: var(--navy); font-size: 13px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.asset-detail-section { margin: 0; }
.asset-detail-section .card-heading { margin-bottom: 10px; }
.asset-detail-section .card-heading h2 { color: var(--navy); font-size: 17px; }
.asset-detail-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.asset-detail-tag { padding: 7px 10px; border: 1px solid #cde9df; border-radius: 999px; background: #f4fffa; color: #087b58; font-size: 12px; font-weight: 750; }
.asset-detail-tag:hover, .asset-detail-tag:focus-visible { border-color: var(--teal); outline: none; }
.asset-pac-list, .asset-movement-list { display: grid; gap: 8px; }
.asset-pac-row { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 10px; border: 1px solid #edf2f5; border-radius: 12px; color: var(--navy); }
.asset-pac-row:hover, .asset-pac-row:focus-visible { border-color: #9ddfca; background: #f8fffc; outline: none; }
.asset-pac-main, .asset-pac-side { display: grid; min-width: 0; gap: 3px; }
.asset-pac-main { flex: 1 1 auto; }
.asset-pac-main strong, .asset-pac-side b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-pac-main strong { font-size: 13px; }
.asset-pac-main small, .asset-pac-side small { color: var(--muted); font-size: 10px; }
.asset-pac-side { flex: 0 1 44%; justify-items: end; text-align: right; }
.asset-pac-side b { font-size: 12px; }
.asset-movement-row { display: grid; min-width: 0; gap: 9px; padding: 12px 10px; border: 1px solid #edf2f5; border-radius: 12px; background: #fff; }
.asset-movement-row.is-planned { background: #fbfdff; }
.asset-movement-heading { display: flex; min-width: 0; align-items: flex-start; justify-content: space-between; gap: 10px; }
.asset-movement-heading > span:first-child { display: grid; min-width: 0; gap: 3px; }
.asset-movement-heading strong { color: var(--navy); font-size: 13px; }
.asset-movement-heading small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.asset-movement-badges { display: flex; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.asset-movement-badge { display: inline-flex; align-items: center; padding: 4px 7px; border-radius: 999px; font-size: 9px; font-weight: 800; line-height: 1.1; white-space: nowrap; }
.asset-movement-badge.is-executed { background: #e5f8f0; color: #087b58; }
.asset-movement-badge.is-pending { background: #fff4d8; color: #976c05; }
.asset-movement-badge.is-planned { background: #e8f1fb; color: #2b6498; }
.asset-movement-badge.is-pac { background: #f0eaff; color: #6e4bae; }
.asset-movement-values { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.asset-movement-values > span { display: grid; min-width: 0; gap: 2px; }
.asset-movement-values > span:not(:first-child) { text-align: right; }
.asset-movement-values small, .asset-movement-eur { color: var(--muted); font-size: 9px; line-height: 1.15; }
.asset-movement-values b { overflow: hidden; color: var(--navy); font-size: 11px; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.asset-movement-eur { margin: 0; }
.asset-reconcile-link { color: #976c05; font-size: 10px; font-weight: 800; }
.asset-reconcile-link:hover, .asset-reconcile-link:focus-visible { color: #705000; outline: none; text-decoration: underline; }
.asset-cancelled-details { margin: 0; color: var(--muted); font-size: 12px; }
.asset-cancelled-details summary { color: var(--navy); cursor: pointer; font-weight: 750; }
.asset-cancelled-list { display: grid; gap: 6px; margin-top: 12px; }
.asset-cancelled-list span { padding-top: 7px; border-top: 1px solid #edf2f5; }
.detail-summary .home-total { margin-bottom: 8px; }
.detail-performance, .detail-meta { color: var(--muted); font-size: 12px; }
.detail-performance span { font-weight: 750; }
.pac-summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid #edf2f5; }
.pac-summary-grid > div { display: grid; min-width: 0; gap: 3px; }
.pac-summary-grid span { color: var(--muted); font-size: 10px; line-height: 1.2; }
.pac-summary-grid strong { overflow: hidden; color: var(--navy); font-size: 13px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.detail-components h2 { margin: 0 0 12px; color: var(--navy); font-size: 17px; }
.component-list { display: grid; gap: 0; }
.component-row { display: grid; grid-template-columns: minmax(82px, 1.2fr) auto 52px 52px 72px; align-items: center; gap: 7px; padding: 10px 0; border-bottom: 1px solid #edf2f5; color: var(--navy); font-size: 11px; }
.component-row:last-child { border-bottom: 0; }
.component-row > span { display: grid; min-width: 0; gap: 2px; }
.component-row > span:not(:first-child) { text-align: right; }
.component-row strong { font-size: 13px; }
.component-row small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.component-row b { font-size: 11px; }
.detail-facts { display: grid; gap: 0; margin: 0; }
.detail-facts > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid #edf2f5; font-size: 12px; }
.detail-facts > div:last-child { border-bottom: 0; }
.detail-facts dt { color: var(--muted); }
.detail-facts dd { margin: 0; color: var(--navy); font-weight: 700; text-align: right; }
.pac-occurrences-card { padding-bottom: 12px; }
.pac-occurrence-list { display: grid; gap: 8px; margin-top: 12px; }
.pac-occurrence-heading { margin: 7px 0 0; color: var(--teal); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.pac-occurrence-heading:first-child { margin-top: 0; }
.pac-occurrence { display: grid; min-width: 0; gap: 9px; padding: 12px 10px; border: 1px solid #edf2f5; border-radius: 12px; background: #fff; color: var(--navy); }
.pac-occurrence-link { transition: border-color .15s ease, background .15s ease; }
.pac-occurrence-link:hover, .pac-occurrence-link:focus-visible { border-color: #8edec4; background: #f8fffc; outline: none; }
.pac-occurrence-topline, .pac-occurrence-planned { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 10px; }
.pac-occurrence-topline > strong { font-size: 13px; }
.pac-occurrence-badge { display: inline-flex; flex: 0 0 auto; align-items: center; padding: 4px 7px; border-radius: 999px; background: #e9eef2; color: #526777; font-size: 9px; font-weight: 800; letter-spacing: .02em; }
.pac-occurrence-badge.is-executed { background: #e5f8f0; color: #087b58; }
.pac-occurrence-badge.is-pending { background: #fff4d8; color: #976c05; }
.pac-occurrence-badge.is-planned { background: #e8f1fb; color: #2b6498; }
.pac-occurrence-badge.is-paused { background: #f1edf8; color: #725595; }
.pac-occurrence-values { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.pac-occurrence-values > span { display: grid; min-width: 0; gap: 2px; }
.pac-occurrence-values small, .pac-occurrence-planned span { color: var(--muted); font-size: 9px; line-height: 1.15; }
.pac-occurrence-values b, .pac-occurrence-planned b { overflow: hidden; color: var(--navy); font-size: 11px; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.pac-occurrence-values > span:not(:first-child) { text-align: right; }
.pac-occurrence-difference { display: flex; flex-wrap: wrap; gap: 5px 12px; color: #976c05; font-size: 10px; line-height: 1.2; }
.pac-management-card { display: grid; gap: 14px; margin: 0 0 14px; }
.pac-management-card .card-heading { align-items: flex-start; }
.pac-management-card .card-heading h2 { color: var(--navy); font-size: 17px; }
.pac-management-card .card-heading .editor-help { margin-bottom: 0; }
.pac-status-badge { display: inline-flex; flex: 0 0 auto; align-items: center; padding: 5px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.pac-status-badge.is-active { background: #e5f8f0; color: #087b58; }
.pac-status-badge.is-paused { background: #f1edf8; color: #725595; }
.transaction-form.pac-management-form { gap: 11px; }
.pac-management-form .primary-button { width: 100%; margin-top: 0; }
.pac-toggle-form { padding-top: 13px; border-top: 1px solid var(--line); }
.pac-toggle-form .secondary-button { width: 100%; }
.pac-toggle-form .secondary-button.is-pause { border-color: #efcaca; color: #a32626; }
.pac-detail-page.is-paused .detail-summary { border-color: #e7dfef; }

.bottom-nav { position: fixed; z-index: 19; right: 0; bottom: 0; left: 0; display: grid; height: calc(var(--nav-height) + env(safe-area-inset-bottom)); grid-template-columns: repeat(5, 1fr); padding: 5px 8px env(safe-area-inset-bottom); background: #fff; box-shadow: 0 -3px 18px rgb(7 35 57 / 10%); }
.nav-item { display: flex; min-width: 0; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: transparent; color: #718292; cursor: pointer; font-size: 10px; font-weight: 700; }
.nav-item svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.nav-item.is-active { color: var(--teal); }
.nav-add { gap: 1px; color: #718292; }
.add-circle { display: grid; width: 42px; height: 42px; margin-top: -12px; place-items: center; border: 4px solid var(--canvas); border-radius: 50%; background: var(--teal); color: #fff; font-size: 25px; font-weight: 400; line-height: 1; }
.nav-add.is-active { color: var(--teal); }

.detail-edit-button { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 50%; color: var(--navy); }
.detail-edit-button:hover, .detail-edit-button:focus-visible { background: #eef8f4; color: var(--teal); outline: none; }
.detail-edit-button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }

.thesis-editor { display: grid; gap: 14px; }
.editor-heading h1 { font-size: clamp(26px, 7vw, 38px); }
.thesis-editor-form { display: grid; gap: 16px; }
.editor-field { display: grid; gap: 6px; }
.editor-field label, .editor-switch-row label, .thesis-editor-assets legend { color: var(--navy); font-size: 13px; font-weight: 750; }
.editor-field label small { color: var(--muted); font-size: 11px; font-weight: 500; }
.editor-field input, .editor-field textarea, .transaction-form select, .thesis-editor-asset-row select, .thesis-editor-asset-row input { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); outline: none; }
.editor-field input, .transaction-form select, .thesis-editor-asset-row select, .thesis-editor-asset-row input { min-height: 42px; padding: 9px 10px; }
.editor-field textarea { min-height: 92px; padding: 10px; resize: vertical; }
.editor-field input:focus, .editor-field textarea:focus, .transaction-form select:focus, .thesis-editor-asset-row select:focus, .thesis-editor-asset-row input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgb(16 185 129 / 12%); }
.transaction-form select { appearance: none; -webkit-appearance: none; padding-right: 36px; background-color: #fff; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m5 7 5 5 5-5' fill='none' stroke='%230B2D4D' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.8'/%3E%3C/svg%3E"); background-position: right 10px center; background-repeat: no-repeat; background-size: 18px 18px; cursor: pointer; }
.transaction-form select:disabled { background-color: #f3f6f8; color: #7d8c98; cursor: not-allowed; opacity: 1; }
.pac-reconcile-list { display: grid; gap: 16px; margin-top: 12px; }
.pac-reconcile-card { padding-top: 14px; border-top: 1px solid var(--line); }
.pac-reconcile-card:first-child { padding-top: 0; border-top: 0; }
.pac-reconcile-card h3 { margin: 0; color: var(--navy); font-size: 17px; }
.pac-reconcile-card .transaction-form { margin-top: 12px; padding: 0; border: 0; box-shadow: none; }
.editor-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.editor-switch-row input { width: 42px; height: 24px; accent-color: var(--teal); }
.thesis-editor-assets { min-width: 0; margin: 0; padding: 0; border: 0; }
.thesis-editor-assets legend { padding: 0; }
.editor-help { margin: 4px 0 10px; color: var(--muted); font-size: 11px; }
.thesis-editor-asset-list { display: grid; gap: 8px; }
.thesis-editor-asset-row { display: grid; min-width: 0; grid-template-columns: minmax(0, 1fr) 34px; align-items: center; gap: 7px; }
.editor-remove-button { display: grid; width: 32px; height: 32px; place-items: center; padding: 0; border: 1px solid #f0caca; border-radius: 50%; background: #fff7f7; color: #ad3434; cursor: pointer; font-size: 21px; line-height: 1; }
.editor-add-button { margin-top: 10px; padding: 8px 0; border: 0; background: transparent; color: var(--teal); cursor: pointer; font-size: 13px; font-weight: 800; text-align: left; }
.editor-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding-top: 4px; }
.secondary-button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--navy); cursor: pointer; font-size: 13px; font-weight: 750; }
.secondary-button:hover, .secondary-button:focus-visible { border-color: #9ddfca; outline: none; }
.placeholder-page { display: grid; gap: 12px; }
.placeholder-copy { margin: 0 0 8px; color: var(--muted); font-size: 15px; line-height: 1.5; }
.transaction-page { display: grid; gap: 12px; }
.transaction-choice-list { display: grid; gap: 9px; }
.transaction-choice { display: grid; min-height: 72px; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 12px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: 0 5px 18px rgb(7 35 57 / 5%); }
.transaction-choice:hover, .transaction-choice:focus-visible { border-color: #9ddfca; background: #f8fffc; outline: none; }
.transaction-choice-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 11px; background: #e8f7f1; color: var(--teal); font-size: 25px; line-height: 1; }
.transaction-choice > span:nth-child(2) { display: grid; min-width: 0; gap: 3px; }
.transaction-choice strong { color: var(--navy); font-size: 15px; }
.transaction-choice small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.transaction-form { display: grid; min-width: 0; gap: 16px; }
.buy-type-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.buy-type-fieldset legend { margin-bottom: 8px; color: var(--navy); font-size: 13px; font-weight: 750; }
.buy-type-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.buy-type-card { display: flex; min-height: 52px; align-items: center; justify-content: center; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--navy); cursor: pointer; font-size: 13px; font-weight: 750; text-align: center; }
.buy-type-card:has(input:checked) { border-color: var(--teal); background: #effbf6; color: #087b58; box-shadow: 0 0 0 2px rgb(16 185 129 / 10%); }
.buy-type-card input { position: absolute; opacity: 0; pointer-events: none; }
.buy-query-field.is-disabled { opacity: .76; }
.buy-query-field input:disabled { border-color: var(--line); background: #f3f6f8; color: #7d8c98; cursor: not-allowed; opacity: 1; }
.buy-query-field input:disabled::placeholder { color: #9aa8b3; }
.buy-asset-confirmation { display: grid; gap: 8px; }
.buy-confirmation-heading { display: flex; min-width: 0; align-items: flex-start; justify-content: space-between; gap: 12px; }
.buy-confirmation-heading .eyebrow { margin: 0 0 3px; }
.buy-confirmation-heading h2 { overflow: hidden; margin: 0; color: var(--navy); font-size: 20px; text-overflow: ellipsis; white-space: nowrap; }
.buy-asset-type { flex: 0 0 auto; padding: 5px 8px; border-radius: 999px; background: #e8f7f1; color: #087b58; font-size: 11px; font-weight: 750; }
.buy-asset-name { margin: 0; color: #405770; font-size: 13px; }
.buy-asset-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 3px 0 0; }
.buy-asset-meta div { min-width: 0; padding-top: 7px; border-top: 1px solid var(--line); }
.buy-asset-meta dt { color: var(--muted); font-size: 10px; }
.buy-asset-meta dd { overflow: hidden; margin: 2px 0 0; color: var(--navy); font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.buy-manual-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; padding-bottom: 2px; }
.buy-manual-grid .editor-field:nth-child(3) { grid-column: 1 / -1; }
.buy-results-page { position: fixed; z-index: 35; inset: 0; width: auto; min-width: 0; max-width: none; height: auto; min-height: 0; margin: 0; padding: 0; background: rgb(7 35 57 / 38%); }
.buy-results-page > :not(.buy-results-sheet) { display: none; }
.buy-results-sheet { position: fixed; z-index: 1; bottom: calc(var(--nav-height) + 8px + env(safe-area-inset-bottom)); left: 50%; display: grid; width: calc(100% - 24px); max-width: 420px; min-width: 0; max-height: min(78vh, 680px); min-height: 0; transform: translateX(-50%); grid-template-rows: auto auto auto minmax(0, 1fr) auto; gap: 10px; padding: 10px 14px calc(14px + env(safe-area-inset-bottom)); overflow: hidden; border-radius: 20px 20px 14px 14px; background: #fff; box-shadow: 0 -8px 30px rgb(7 35 57 / 18%); }
.buy-results-sheet > .editor-help { margin: 0; line-height: 1.35; }
.buy-results-handle { width: 38px; height: 4px; margin: 0 auto 2px; border-radius: 99px; background: #cbd7df; }
.buy-results-heading { display: flex; min-width: 0; align-items: flex-start; justify-content: space-between; gap: 12px; }
.buy-results-heading .eyebrow { margin: 0 0 3px; }
.buy-results-heading h2 { margin: 0; color: var(--navy); font-size: 20px; text-transform: uppercase; }
.buy-results-close { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 50%; background: #f2f6f8; color: var(--navy); font-size: 23px; line-height: 1; }
.buy-results-list { display: grid; min-height: 0; align-content: start; gap: 6px; overflow-y: auto; overscroll-behavior: contain; }
.buy-results-list form { min-width: 0; }
.buy-result-card { display: flex; width: 100%; min-width: 0; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 4px; border: 0; border-bottom: 1px solid var(--line); background: #fff; color: var(--navy); cursor: pointer; text-align: left; }
.buy-result-card:hover, .buy-result-card:focus-visible { border-radius: 10px; background: #f5fcf9; outline: none; }
.buy-result-main, .buy-result-side { display: grid; min-width: 0; gap: 2px; }
.buy-result-main { flex: 1 1 auto; }
.buy-result-main strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.buy-result-main span { overflow: hidden; color: #405770; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.buy-result-main small, .buy-result-side small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.buy-result-side { flex: 0 1 45%; text-align: right; }
.buy-result-side b { color: #087b58; font-size: 10px; font-weight: 800; }
.buy-results-empty { margin: 4px 0 0; color: var(--navy); font-size: 15px; font-weight: 800; }
.buy-results-empty-copy { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.buy-manual-action { padding-top: 4px; border-top: 1px solid var(--line); }
.buy-manual-action .secondary-button { width: 100%; }
.transaction-form .editor-field, .transaction-two-columns > * { min-width: 0; }
.transaction-two-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.transaction-inline-error { margin: 0; color: #ad3434; font-size: 11px; }
.transaction-preview { padding: 11px 12px; border: 1px solid #dcefe8; border-radius: 12px; background: #f7fffb; color: var(--navy); }
.transaction-preview strong { font-size: 13px; }
.transaction-preview p { margin: 5px 0 0; color: #405770; font-size: 12px; line-height: 1.45; }
.transaction-success { margin: 0; padding: 10px 12px; border-radius: 10px; background: #e8f7f1; color: #087b58; font-size: 13px; font-weight: 750; }

.analysis-landing, .state-content { display: grid; gap: 14px; }
.analysis-page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.analysis-page-heading h1 { margin: 0; }
.analysis-edit-button { flex: 0 0 44px; width: 44px; height: 44px; margin-top: 2px; }
.analysis-edit-button svg { width: 22px; height: 22px; }
.analysis-report-card { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.analysis-report-card h2 { margin: 0; color: var(--navy); font-size: 22px; }
.analysis-report-card p:not(.eyebrow) { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.analysis-report-button { flex: 0 0 auto; margin-top: 0; text-align: center; }
.analysis-generation-card { display: grid; gap: 14px; }
.analysis-generation-card .card-heading h2 { color: var(--teal); font-size: 18px; letter-spacing: .035em; text-transform: uppercase; }
.analysis-generation-form { display: grid; gap: 12px; }
.analysis-liquidity-input { display: flex; align-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.analysis-liquidity-input span { padding-left: 11px; color: var(--muted); font-size: 14px; font-weight: 750; }
.analysis-liquidity-input input { min-width: 0; flex: 1 1 auto; padding: 10px 10px 10px 6px; border: 0; outline: none; color: var(--ink); }
.analysis-liquidity-input:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px rgb(16 185 129 / 12%); }
.analysis-generate-button { width: 100%; margin-top: 0; }
.analysis-generate-button:disabled { cursor: wait; opacity: .72; }
.analysis-usage-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding-top: 2px; }
.analysis-usage-grid > div { display: grid; gap: 4px; }
.analysis-usage-grid span { color: var(--muted); font-size: 11px; }
.analysis-usage-grid strong { color: var(--navy); font-size: 17px; }
.analysis-usage-note { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.35; }
.analysis-instructions-editor-card { display: grid; gap: 14px; }
.analysis-instructions-editor-card h2 { margin: 0; color: var(--navy); font-size: 22px; }
.analysis-instructions-form { display: grid; gap: 12px; }
.analysis-instructions-form textarea { min-height: 260px; resize: vertical; }
.analysis-instructions-form .editor-actions { justify-content: flex-end; }
.analysis-reports-section .card-heading h2 { color: var(--teal); font-size: 18px; letter-spacing: .035em; text-transform: uppercase; }
.analysis-reports-empty { margin: 14px 0 0; color: var(--muted); font-size: 13px; }
.analysis-report-list { display: grid; margin-top: 7px; }
.analysis-report-row { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 12px; min-height: 66px; padding: 10px 0; border-bottom: 1px solid #e5edf2; color: var(--navy); }
.analysis-report-row:last-child { border-bottom: 0; }
.analysis-report-row:hover, .analysis-report-row:focus-visible { background: #fbfefd; outline: none; }
.analysis-report-row-main { display: grid; min-width: 0; gap: 4px; }
.analysis-report-row-main strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.analysis-report-row-main small { color: var(--muted); font-size: 11px; }
.analysis-report-detail { display: grid; gap: 14px; }
.analysis-report-detail-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.analysis-report-detail-heading h1 { overflow-wrap: anywhere; }
.analysis-report-download { flex: 0 0 auto; margin-top: 0; white-space: nowrap; }
.markdown-content { color: var(--navy); font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.markdown-content > :first-child { margin-top: 0; }
.markdown-content > :last-child { margin-bottom: 0; }
.markdown-content h1, .markdown-content h2, .markdown-content h3 { color: var(--navy); line-height: 1.2; }
.markdown-content h1 { font-size: clamp(24px, 6vw, 34px); }
.markdown-content h2 { margin-top: 26px; font-size: 22px; }
.markdown-content h3 { margin-top: 22px; font-size: 18px; }
.markdown-content p { margin: 12px 0; }
.markdown-content ul, .markdown-content ol { margin: 12px 0; padding-left: 22px; }
.markdown-content li + li { margin-top: 5px; }
.markdown-content a { color: var(--teal); font-weight: 700; }
.markdown-content hr { margin: 22px 0; border: 0; border-top: 1px solid var(--line); }
.markdown-content code { padding: 2px 5px; border-radius: 5px; background: #eef3f6; font-size: .9em; }
.markdown-table-wrap { max-width: 100%; margin: 16px 0; overflow-x: auto; }
.markdown-content table { width: 100%; border-collapse: collapse; font-size: 12px; }
.markdown-content th, .markdown-content td { padding: 8px 9px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.markdown-content th { background: #f4f8fa; color: var(--navy); font-weight: 800; }
.state-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.state-downloads { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.state-downloads .primary-button, .state-downloads .secondary-button { margin-top: 0; white-space: nowrap; }
.state-schema { color: var(--muted); font-size: 12px; }
.state-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.state-summary-grid > div { display: grid; min-width: 0; gap: 5px; }
.state-summary-grid span, .state-outline-grid span { color: var(--muted); font-size: 12px; }
.state-summary-grid strong { color: var(--navy); font-size: 21px; letter-spacing: -.025em; }
.state-outline { display: grid; gap: 14px; }
.state-outline-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.state-outline-grid span { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #f8fbfd; }
.state-outline-grid b { color: var(--navy); font-size: 16px; }

.action-menu { position: fixed; z-index: 40; inset: 0; }
.action-menu[hidden] { display: none; }
.action-menu-backdrop { position: absolute; inset: 0; width: 100%; border: 0; background: rgb(7 35 57 / 38%); cursor: pointer; }
.action-sheet { position: absolute; right: 0; bottom: 0; left: 0; width: min(100%, 720px); margin: 0 auto; padding: 9px 16px calc(14px + env(safe-area-inset-bottom)); border-radius: 20px 20px 0 0; background: #fff; box-shadow: 0 -8px 30px rgb(7 35 57 / 18%); }
.action-sheet-handle { width: 38px; height: 4px; margin: 0 auto 12px; border-radius: 99px; background: #cbd7df; }
.action-sheet-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.action-sheet-heading h2 { margin: 0; color: var(--navy); font-size: 18px; }
.action-menu-close { width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: #f2f6f8; color: var(--navy); cursor: pointer; font-size: 23px; line-height: 1; }
.action-menu-list { display: grid; gap: 4px; margin-top: 9px; }
.action-menu-item { display: flex; min-height: 58px; align-items: center; gap: 12px; padding: 8px 6px; border-radius: 12px; color: var(--navy); }
.action-menu-item:hover, .action-menu-item:focus-visible { background: #f4fbf8; outline: none; }
.action-menu-icon { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border-radius: 10px; background: #e8f7f1; color: var(--teal); font-size: 22px; font-weight: 500; }
.action-menu-item span:last-child { display: grid; gap: 2px; }
.action-menu-item strong { font-size: 14px; }
.action-menu-item small { color: var(--muted); font-size: 11px; }

.privacy-value.is-hidden { position: relative; color: transparent; }
.privacy-value.is-hidden::after { position: absolute; inset: 0; overflow: hidden; color: var(--navy); text-align: inherit; white-space: nowrap; content: '••••'; }
.distribution-tile .privacy-value.is-hidden::after { color: #263746; }

@media (prefers-reduced-motion: reduce) {
    .home-data-pulse { animation: none; }
}

@media (min-width: 700px) {
    .app-header { padding-right: max(24px, calc((100vw - 720px) / 2)); padding-left: max(24px, calc((100vw - 720px) / 2)); }
    .bottom-nav { right: auto; left: 50%; width: min(100%, 720px); transform: translateX(-50%); border-radius: 18px 18px 0 0; }
    .app-main { padding-right: 28px; padding-left: 28px; }
}

@media (max-width: 390px) {
    .home-card { padding-right: 13px; padding-left: 13px; }
    .distribution-tile { padding: 8px 10px; }
    .distribution-tile-content { grid-template-columns: minmax(0, 1fr) minmax(105px, auto); gap: 8px; }
    .distribution-tile-icon { width: 32px; height: 32px; flex-basis: 32px; }
    .distribution-tile-name { font-size: 15px; }
    .distribution-tile .class-value { font-size: 17px; }
    .distribution-tile .class-weight { font-size: 11px; }
    .thesis-row { grid-template-columns: 38px minmax(0, 1fr) minmax(98px, auto) 10px; gap: 6px; min-height: 72px; padding: 9px 0; }
    .thesis-icon { width: 38px; height: 38px; }
    .thesis-row-main { gap: 3px; }
    .thesis-row-main strong { font-size: 13px; }
    .thesis-row-main small { font-size: 9px; }
    .thesis-row-side { gap: 5px; }
    .thesis-row-side > b { font-size: 14px; }
    .thesis-performance-pair { gap: 4px; }
    .thesis-performance { font-size: 9px; }
    .component-row { grid-template-columns: minmax(64px, 1fr) auto 43px 43px 61px; gap: 4px; font-size: 10px; }
    .component-row strong { font-size: 12px; }
}

@media (max-width: 620px) {
    .analysis-report-card, .state-heading, .analysis-report-detail-heading { align-items: stretch; flex-direction: column; }
    .analysis-report-button, .analysis-report-download { width: 100%; }
    .state-downloads { justify-content: stretch; }
    .state-downloads a { flex: 1 1 0; }
    .state-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .state-outline-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .portfolio-page-heading { grid-template-columns: 1fr; gap: 12px; }
    .portfolio-page-heading h1 { font-size: clamp(32px, 10vw, 40px); }
    .portfolio-summary { width: 100%; }
    .portfolio-category-heading { align-items: flex-end; gap: 8px; }
    .portfolio-category-total { gap: 5px; font-size: 11px; }
    .portfolio-category-total b { font-size: 16px; }
    .portfolio-category-total strong { font-size: 15px; }
    .portfolio-position { grid-template-columns: 42px minmax(0, 1fr) minmax(78px, auto); gap: 8px; padding: 10px 10px; }
    .portfolio-position-logo { width: 40px; height: 40px; }
    .portfolio-position-main > strong { font-size: 14px; }
    .portfolio-position-name, .portfolio-position-provider, .portfolio-position-quantity { font-size: 10px; }
    .portfolio-position-side b { font-size: 15px; }
    .portfolio-position-side strong { font-size: 13px; }
    .asset-detail-value-line { grid-template-columns: 1fr; gap: 10px; }
    .asset-detail-pnl { justify-items: start; text-align: left; }
    .asset-detail-metrics { gap: 10px; }
    .asset-movement-values { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 7px; }
    .asset-movement-values > span:not(:first-child) { text-align: left; }
}

.thesis-detail { display: grid; gap: 12px; }
.detail-header { display: grid; grid-template-columns: 40px minmax(0, 1fr) 40px; align-items: center; gap: 8px; min-height: 42px; }
.detail-header h1 { overflow: hidden; font-size: clamp(22px, 6.2vw, 34px); text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.detail-back-button { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 50%; color: var(--navy); }
.detail-back-button:hover, .detail-back-button:focus-visible { background: #eef8f4; color: var(--teal); outline: none; }
.detail-back-button svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.detail-summary { margin: 0 0 14px; }
.detail-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.detail-metric { display: grid; min-width: 0; gap: 8px; padding: 0 14px; align-content: center; }
.detail-metric + .detail-metric { border-left: 1px solid var(--line); }
.detail-metric-label { color: #405770; font-size: 12px; line-height: 1.2; }
.detail-metric-value { min-width: 0; color: var(--navy); font-size: clamp(17px, 4.8vw, 26px); font-weight: 800; line-height: 1.1; white-space: nowrap; }
.detail-metric .thesis-performance { gap: 5px; font-size: clamp(15px, 4.2vw, 23px); }
.detail-metric .thesis-performance svg { width: 23px; height: 23px; stroke-width: 1.8; }
.thesis-detail .detail-summary { margin: 0; padding: 14px 10px; }
.thesis-detail .detail-metric { gap: 5px; padding: 0 12px; }
.thesis-detail .detail-metric-label { color: #718292; font-size: 10px; }
.thesis-detail .detail-metric-value { font-size: clamp(16px, 4.4vw, 23px); }
.thesis-detail .detail-metric .thesis-performance { gap: 4px; font-size: clamp(14px, 3.8vw, 21px); }
.thesis-detail .detail-metric .thesis-performance svg { width: 19px; height: 19px; }
.thesis-detail .detail-metric-value.thesis-performance.is-positive,
.thesis-detail .detail-asset-performance.is-positive { color: #059669; }
.thesis-detail .detail-metric-value.thesis-performance.is-negative,
.thesis-detail .detail-asset-performance.is-negative { color: #d3443c; }
.thesis-detail .detail-metric-value.thesis-performance.is-neutral,
.thesis-detail .detail-asset-performance.is-neutral { color: #647789; }
.thesis-detail .detail-thesis-intro,
.thesis-detail .detail-components { padding: 15px 13px; }
.thesis-detail .detail-thesis-intro h2, .thesis-detail .detail-components h2 { margin: 0 0 9px; color: var(--teal); font-size: 16px; letter-spacing: .02em; text-transform: uppercase; }
.thesis-detail .detail-thesis-intro p { margin: 0; color: var(--navy); font-size: 14px; line-height: 1.45; }
.thesis-detail .detail-horizon { display: flex; align-items: center; gap: 7px; margin-top: 12px !important; font-size: 12px !important; }
.thesis-detail .detail-horizon svg { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.detail-asset-head { display: grid; margin: 0 0 2px; padding: 0 4px 7px; border-bottom: 1px solid var(--line); color: #405770; font-size: 10px; }
.detail-asset-head span:not(:first-child) { text-align: right; }
.thesis-detail .detail-asset-head, .thesis-detail .detail-asset-row { grid-template-columns: minmax(150px, 1.6fr) 70px minmax(120px, 1.15fr) 94px 80px; gap: 8px; }
.detail-asset-row { align-items: center; min-height: 62px; padding: 7px 4px; }
.detail-asset-identity { display: flex; min-width: 0; align-items: center; gap: 8px; }
.asset-logo { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 8px; object-fit: contain; }
.asset-logo-fallback { display: grid; place-items: center; background: #e8f7f1; color: var(--teal); font-size: 11px; font-weight: 800; letter-spacing: .02em; }
.detail-asset-name { display: grid; min-width: 0; gap: 2px; }
.detail-asset-name strong { overflow: hidden; color: var(--navy); font-size: 13px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.detail-asset-name small { overflow: hidden; color: var(--muted); font-size: 9px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.detail-asset-quantity, .detail-asset-value, .detail-asset-performance { min-width: 0; color: var(--navy); }
.detail-asset-quantity, .detail-asset-value { display: grid; gap: 2px; }
.detail-asset-quantity, .detail-asset-value, .detail-asset-performance { text-align: right; }
.detail-asset-value b, .detail-asset-quantity b { font-size: 12px; white-space: nowrap; }
.detail-asset-value small { overflow: hidden; color: var(--muted); font-size: 8px; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.detail-asset-performance { display: inline-flex; align-items: center; justify-content: flex-end; gap: 3px; font-size: 10px; font-weight: 750; white-space: nowrap; }
.detail-asset-performance svg { width: 15px; height: 15px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.detail-asset-label { display: none; color: var(--muted); font-size: 9px; font-weight: 500; }
.detail-allocation { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px; min-height: 20px; padding: 0 4px 6px; border-bottom: 1px solid #edf2f5; }
.detail-allocation-label { color: #647789; font-size: 10px; line-height: 1; white-space: nowrap; }
.detail-allocation-track { display: block; min-width: 0; height: 5px; overflow: hidden; border-radius: 999px; background: #dfe4e8; }
.detail-allocation-fill { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--teal); }
.detail-notes-card { padding: 0; overflow: hidden; }
.detail-notes-toggle { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 16px; border: 0; background: transparent; color: var(--teal); cursor: pointer; font-size: 17px; font-weight: 800; letter-spacing: .02em; text-align: left; text-transform: uppercase; }
.thesis-detail .detail-notes-toggle { padding: 13px 14px; font-size: 16px; }
.detail-notes-toggle:hover, .detail-notes-toggle:focus-visible { background: #f8fffc; outline: none; }
.detail-notes-chevron { color: var(--navy); font-size: 29px; font-weight: 300; line-height: 1; transform: rotate(0); transition: transform .15s ease; }
.detail-notes-card.is-open .detail-notes-chevron { transform: rotate(90deg); }
.detail-notes-panel { padding: 0 16px 18px; color: var(--navy); font-size: 13px; line-height: 1.45; }
.detail-notes-panel ul { display: grid; gap: 8px; margin: 0; padding-left: 18px; }
.thesis-detail .detail-analysis-notes { padding: 15px 13px; }
.thesis-detail .detail-analysis-notes h2 { margin: 0 0 9px; color: var(--teal); font-size: 16px; letter-spacing: .02em; text-transform: uppercase; }
.thesis-detail .detail-analysis-notes p { margin: 0; white-space: normal; }

@media (max-width: 480px) {
    .pac-occurrence-values { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
    .pac-occurrence-values > span:nth-child(odd) { text-align: left; }
    .pac-occurrence-values > span:nth-child(even) { text-align: right; }
}

@media (max-width: 600px) {
    .analysis-report-card { align-items: stretch; flex-direction: column; }
    .analysis-report-button { width: 100%; }
    .thesis-detail .detail-summary { padding-right: 4px; padding-left: 4px; }
    .thesis-detail .detail-metric { padding: 0 8px; gap: 4px; }
    .thesis-detail .detail-metric-label { font-size: 9px; }
    .thesis-detail .detail-metric-value { font-size: clamp(15px, 4.6vw, 20px); }
    .thesis-detail .detail-metric .thesis-performance { gap: 3px; font-size: clamp(13px, 3.9vw, 18px); }
    .thesis-detail .detail-metric .thesis-performance svg { width: 17px; height: 17px; }
    .thesis-detail .detail-asset-head,
    .thesis-detail .detail-asset-row { grid-template-columns: minmax(0, 1.55fr) minmax(35px, .55fr) minmax(52px, .82fr) minmax(52px, .82fr) minmax(52px, .82fr); gap: 4px; }
    .thesis-detail .detail-asset-head { padding-right: 0; padding-left: 0; font-size: 8px; }
    .thesis-detail .detail-asset-row { min-height: 52px; padding: 6px 0; }
    .thesis-detail .asset-logo { width: 26px; height: 26px; flex-basis: 26px; }
    .thesis-detail .detail-asset-identity { gap: 6px; }
    .thesis-detail .detail-asset-name strong { font-size: 11px; }
    .thesis-detail .detail-asset-name small { font-size: 8px; }
    .thesis-detail .detail-asset-value b, .thesis-detail .detail-asset-quantity b { font-size: 10px; }
    .thesis-detail .detail-asset-performance { gap: 2px; font-size: 8px; }
    .thesis-detail .detail-asset-performance svg { width: 12px; height: 12px; }
    .thesis-detail .detail-asset-label { display: none; }
    .thesis-detail .detail-allocation { gap: 6px; min-height: 19px; padding: 0 0 5px; }
    .thesis-detail .detail-allocation-label { font-size: 8px; }
    .thesis-detail .detail-allocation-track { height: 5px; }
}

@media (max-width: 390px) {
    .thesis-detail .detail-asset-head { font-size: 7px; }
    .thesis-detail .detail-asset-row { grid-template-columns: minmax(0, 1.55fr) minmax(34px, .55fr) minmax(51px, .82fr) minmax(51px, .82fr) minmax(51px, .82fr); gap: 3px; min-height: 50px; padding: 5px 0; }
    .thesis-detail .asset-logo { width: 24px; height: 24px; flex-basis: 24px; }
    .thesis-detail .detail-asset-identity { gap: 5px; }
    .thesis-detail .detail-asset-name strong { font-size: 10px; }
    .thesis-detail .detail-asset-name small { font-size: 7px; }
    .thesis-detail .detail-asset-value b, .thesis-detail .detail-asset-quantity b { font-size: 9px; }
    .thesis-detail .detail-asset-performance { font-size: 7.5px; }
    .thesis-detail .detail-asset-performance svg { width: 11px; height: 11px; }
    .thesis-detail .detail-allocation { gap: 5px; min-height: 18px; padding-bottom: 4px; }
    .thesis-detail .detail-allocation-label { font-size: 7.5px; }
    .thesis-detail .detail-allocation-overweight { font-size: 7.5px; }
    .thesis-detail .detail-allocation-track { height: 4px; }
}

@media (max-width: 430px) {
    .transaction-two-columns { gap: 8px; }
    .buy-type-grid { gap: 6px; }
    .buy-type-card { padding-right: 5px; padding-left: 5px; font-size: 12px; }
    .transaction-choice { min-height: 66px; padding: 10px; }
    .transaction-choice-icon { width: 34px; height: 34px; }
}
