:root {
    color-scheme: light;
    --background: #f4f1ea;
    --surface: #fffdf9;
    --text: #17233b;
    --muted: #687387;
    --primary: #27496d;
    --primary-dark: #18324e;
    --accent: #b96f32;
    --accent-dark: #935224;
    --positive: #1f7a55;
    --positive-soft: #e8f5ee;
    --border: #ddd8cf;
    --danger-bg: #fff1f0;
    --danger: #9e2f2b;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background: var(--background);
}

.instrument-detail-document {
    min-height: 100%;
    background: var(--background);
}

a {
    color: var(--primary);
}

.auth-page {
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    background:
        radial-gradient(circle at 10% 10%, rgba(185, 111, 50, 0.14), transparent 34%),
        var(--background);
}

.auth-card {
    width: min(100%, 440px);
    padding: 38px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: 0 18px 55px rgba(23, 35, 59, 0.08);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    color: var(--text);
    text-decoration: none;
}

.brand img {
    display: block;
    width: 118px;
    height: 32px;
}

.brand-tagline {
    padding-left: 14px;
    border-left: 1px solid #d1cbc2;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 650;
    letter-spacing: 0.015em;
    line-height: 1.25;
    white-space: nowrap;
}

.eyebrow {
    margin: 36px 0 8px;
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 10px;
    font-size: clamp(2rem, 5vw, 3rem);
    letter-spacing: -0.045em;
    line-height: 1.05;
}

.auth-card h1 {
    font-size: 2rem;
}

.muted,
.lead,
.field-help,
.auth-switch,
.empty-state p {
    color: var(--muted);
}

.form {
    display: grid;
    gap: 10px;
    margin-top: 28px;
}

.form label {
    margin-top: 8px;
    font-size: 0.9rem;
    font-weight: 700;
}

.form input {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid #cec9c1;
    border-radius: 9px;
    color: var(--text);
    background: #fff;
    font: inherit;
}

.form input:focus {
    border-color: var(--primary);
    outline: 3px solid rgba(39, 73, 109, 0.14);
}

.form button {
    margin-top: 14px;
    padding: 13px 18px;
    border: 0;
    border-radius: 9px;
    color: #fff;
    background: var(--primary);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.form button:hover {
    background: var(--primary-dark);
}

.field-help {
    margin: -4px 0 2px;
    font-size: 0.8rem;
}

.required-fields-note {
    margin: 0 0 2px;
}

.required-marker {
    color: var(--danger);
}

.alert {
    margin-top: 22px;
    padding: 12px 14px;
    border: 1px solid #efc5c1;
    border-radius: 9px;
    color: var(--danger);
    background: var(--danger-bg);
    font-size: 0.9rem;
}

.notice {
    margin-top: 22px;
    padding: 12px 14px;
    border: 1px solid #bdcad8;
    border-radius: 9px;
    color: var(--primary-dark);
    background: #edf2f7;
    font-size: 0.9rem;
}

.auth-switch {
    margin: 26px 0 0;
    font-size: 0.9rem;
    text-align: center;
}

.auth-separator {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0;
    color: var(--muted);
    font-size: 0.85rem;
}

.auth-separator::before,
.auth-separator::after {
    flex: 1;
    height: 1px;
    background: var(--border);
    content: '';
}

.google-login-button {
    display: inline-flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 16px;
    border: 1px solid #cec9c1;
    border-radius: 9px;
    color: var(--text);
    background: #fff;
    font-weight: 700;
    text-decoration: none;
}

.google-login-button:hover {
    border-color: var(--primary);
    color: var(--text);
    background: #f8fafc;
}

.google-login-button svg {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
}

.public-access-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    color: var(--primary);
    font-size: 0.84rem;
    font-weight: 750;
    text-decoration: none;
}

.public-access-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.public-access-link::after {
    content: "→";
    font-size: 1rem;
}

.inline-details-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
}

.inline-details-link:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.inline-details-link::after {
    content: "→";
    font-size: 0.95rem;
}

.table-inline-link {
    display: flex;
    width: fit-content;
    margin-top: 8px;
}

.forgot-password-link {
    justify-self: end;
    margin-top: 2px;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
}

.inline-form {
    margin-top: 22px;
    text-align: center;
}

.code-input {
    font-size: 1.4rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.35em;
    text-align: center;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 70px;
    padding: 0 max(24px, calc((100vw - 1400px) / 2));
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.9);
}

.instrument-detail-page {
    width: min(100%, 1400px);
    margin: 0 auto;
    padding: 36px 24px 56px;
}

.instrument-detail-body {
    min-height: 100vh;
    overscroll-behavior-y: none;
}

.instrument-detail-body .instrument-detail-page {
    flex: 1 0 auto;
}

.instrument-detail-body .site-footer {
    flex: 0 0 auto;
    margin-top: auto;
}

.instrument-detail-header {
    display: grid;
    gap: 16px;
    margin-bottom: 28px;
}

.instrument-detail-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px;
}

.official-website-link,
.source-reference-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 42px;
    font-size: 0.84rem;
    font-weight: 750;
    text-decoration: none;
}

.official-website-link {
    padding: 0 15px;
    border: 1px solid #b9cad9;
    border-radius: 999px;
    color: var(--primary);
    background: #eef3f7;
}

.official-website-link:hover {
    border-color: #8ea8bf;
    background: #e5edf4;
}

.source-reference-link {
    min-height: auto;
    padding: 6px 0;
    color: var(--muted);
}

.source-reference-link[hidden] {
    display: none;
}

.source-reference-link:hover {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.back-link-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text);
    background: var(--surface);
    font-size: 0.92rem;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 8px 18px rgba(23, 35, 59, 0.05);
}

.back-link-button:hover {
    border-color: #aebcca;
    background: #eef2f6;
}

.back-link-button span[aria-hidden="true"] {
    color: var(--primary);
    font-size: 1.05rem;
}

.detail-metrics,
.mini-metrics-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.detail-metrics {
    margin-bottom: 24px;
}

.mini-summary-card strong {
    font-size: 1.5rem;
}

.detail-chart-panel {
    margin-bottom: 24px;
}

.detail-chart-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.chart-periods {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.chart-period-button {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
    color: var(--text);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.chart-period-button:hover,
.chart-period-button.is-active {
    border-color: rgba(39, 73, 109, 0.25);
    background: #edf2f7;
    color: var(--primary);
    box-shadow: inset 0 0 0 1px rgba(39, 73, 109, 0.08);
}

.chart-period-button.is-limited:not(.is-active) {
    color: #7d8796;
    background: #f8f6f1;
    border-style: dashed;
}

.detail-chart-note,
.detail-footnote {
    color: var(--muted);
    font-size: 0.92rem;
}

.instrument-chart {
    position: relative;
    min-height: 300px;
    margin-top: 18px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(237, 242, 247, 0.78), rgba(255, 255, 255, 0.98)),
        var(--surface);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.instrument-chart svg {
    display: block;
    width: 100%;
    height: 304px;
    overflow: visible;
}

.instrument-chart-empty {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    color: var(--muted);
    text-align: center;
}

.instrument-chart-empty[hidden],
.instrument-chart-tooltip[hidden] {
    display: none !important;
}

.chart-grid line {
    stroke: rgba(104, 115, 135, 0.18);
    stroke-width: 1;
}

.chart-axis-label {
    fill: var(--muted);
    font-size: 11px;
    font-weight: 600;
}

.chart-axis-label-y {
    text-anchor: end;
}

.chart-axis-label-x {
    dominant-baseline: hanging;
}

.chart-line {
    fill: none;
    stroke: var(--primary);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chart-area {
    fill: rgba(39, 73, 109, 0.12);
}

.chart-point {
    fill: var(--primary);
    stroke: #fff;
    stroke-width: 2;
}

.chart-hover-line {
    stroke: rgba(39, 73, 109, 0.18);
    stroke-width: 1.5;
    stroke-dasharray: 4 4;
}

.instrument-chart-meta {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
    color: var(--muted);
    font-size: 0.9rem;
}

.instrument-chart-tooltip {
    position: absolute;
    z-index: 2;
    min-width: 150px;
    padding: 10px 12px;
    border: 1px solid rgba(39, 73, 109, 0.12);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 14px 30px rgba(23, 35, 59, 0.12);
    pointer-events: none;
}

.instrument-chart-tooltip strong,
.instrument-chart-tooltip span {
    display: block;
}

.instrument-chart-tooltip strong {
    margin-bottom: 4px;
    color: var(--text);
    font-size: 0.95rem;
}

.instrument-chart-tooltip span {
    color: var(--muted);
    font-size: 0.82rem;
}

.user-menu,
.user-menu form {
    display: flex;
    align-items: center;
    gap: 18px;
}

.user-menu a {
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
}

.header-contact {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-weight: 600 !important;
}

.header-contact svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: var(--primary);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.header-contact:hover {
    color: var(--primary);
}

.user-account-link {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text);
    background: var(--surface);
}

.user-account-link::after {
    content: "›";
    margin-left: 8px;
    color: var(--primary);
    font-size: 1.1rem;
    line-height: 1;
}

.user-account-link:hover {
    border-color: #aebcca;
    background: #eef2f6;
}

.account-menu {
    position: relative;
    flex: 0 0 auto;
}

.account-menu summary {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 13px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text);
    background: var(--surface);
    font-size: 0.88rem;
    font-weight: 750;
    line-height: 1.2;
    list-style: none;
    cursor: pointer;
    user-select: none;
}

.account-menu summary::-webkit-details-marker {
    display: none;
}

.account-menu-icon {
    display: none;
    width: 20px;
    height: 20px;
    fill: none;
    stroke: var(--primary);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.account-menu summary::after {
    content: "▾";
    margin-left: 9px;
    color: var(--primary);
    font-size: 0.78rem;
    line-height: 1;
}

.account-menu[open] summary {
    border-color: #a6b6c8;
    background: #eef2f6;
}

.account-menu[open] summary::after {
    content: "▴";
}

.account-menu summary:focus-visible {
    border-color: var(--primary);
    outline: 3px solid rgba(39, 73, 109, 0.14);
}

.account-menu-popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 60;
    width: 180px;
    padding: 7px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface);
    box-shadow: 0 14px 36px rgba(23, 35, 59, 0.16);
}

.account-menu-popover a,
.account-menu-popover button {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 38px;
    padding: 0 11px;
    border: 0;
    border-radius: 7px;
    color: var(--text);
    background: transparent;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 700;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.account-menu-popover a:hover,
.account-menu-popover button:hover {
    color: var(--primary);
    background: #edf2f7;
}

.account-menu-popover form {
    display: block;
}

.link-button {
    padding: 0;
    border: 0;
    color: var(--primary);
    background: none;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.dashboard {
    flex: 1;
    width: min(calc(100% - 40px), 1400px);
    margin: 0 auto;
    padding: 72px 0;
}

.profile-page {
    flex: 1;
    width: min(calc(100% - 40px), 720px);
    margin: 0 auto;
    padding: 72px 0;
}

.profile-return-link {
    max-width: 560px;
    margin: 28px 0 0;
    text-align: center;
}

.profile-return-link a {
    color: var(--primary);
    font-weight: 700;
}

.legal-page {
    flex: 1;
    width: min(calc(100% - 40px), 820px);
    margin: 0 auto;
    padding: 72px 0;
}

.legal-page > .eyebrow {
    margin-top: 0;
}

.legal-panel {
    margin-top: 36px;
    padding: clamp(26px, 5vw, 46px);
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
}

.legal-panel h2 {
    margin: 30px 0 8px;
    font-size: 1.15rem;
}

.legal-panel h2:first-child {
    margin-top: 0;
}

.legal-panel p {
    margin-bottom: 0;
    color: var(--muted);
    line-height: 1.65;
}

.cookie-policy-list {
    display: grid;
    gap: 14px;
    margin-top: 20px;
}

.cookie-policy-list article {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f8f6f1;
}

.cookie-policy-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.cookie-policy-heading h3 {
    margin: 0;
    font-size: 1rem;
}

.cookie-policy-heading span {
    padding: 5px 8px;
    border-radius: 999px;
    color: var(--primary-dark);
    background: #e3eaf1;
    font-size: 0.7rem;
    font-weight: 750;
}

.cookie-policy-list dl {
    display: grid;
    gap: 11px;
    margin: 0;
}

.cookie-policy-list dl > div {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    gap: 14px;
}

.cookie-policy-list dt {
    color: var(--text);
    font-size: 0.78rem;
    font-weight: 750;
}

.cookie-policy-list dd {
    margin: 0;
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.55;
}

.legal-return-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px 24px;
    margin-top: 26px;
}

.legal-return-links a {
    color: var(--primary);
    font-size: 0.84rem;
    font-weight: 750;
    text-decoration: none;
}

.legal-return-links a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.legal-highlight {
    padding: 20px;
    border: 1px solid #bdcad8;
    border-radius: 12px;
    background: #edf2f7;
}

.legal-highlight strong {
    display: block;
    margin-bottom: 7px;
    color: var(--primary-dark);
    font-size: 1rem;
}

.legal-highlight p {
    color: #4b5c70;
}

.legal-panel > p + p {
    margin-top: 12px;
}

.risk-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.risk-grid article {
    padding: 17px 18px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: #f8f6f1;
}

.risk-grid h3 {
    margin: 0 0 6px;
    font-size: 0.88rem;
}

.risk-grid p {
    font-size: 0.78rem;
    line-height: 1.55;
}

.legal-source-list {
    display: grid;
    gap: 9px;
    margin: 14px 0 0;
    padding-left: 20px;
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.55;
}

.legal-source-list a,
.public-disclaimer a {
    font-weight: 700;
}

.legal-updated {
    margin-top: 24px !important;
    font-size: 0.76rem;
}

.site-footer {
    width: 100%;
    padding: 18px max(20px, calc((100vw - 1400px) / 2));
    border-top: 1px solid var(--border);
    color: var(--muted);
    background: rgba(255, 255, 255, 0.62);
    font-size: 0.78rem;
}

.site-footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px 28px;
    max-width: 1400px;
    margin: 0 auto;
}

.site-footer p {
    margin: 0;
}

.site-footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;
}

.site-footer a {
    color: var(--muted);
    font-weight: 650;
    text-decoration: none;
}

.site-footer a:hover {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.cookie-notice {
    position: fixed;
    right: max(20px, calc((100vw - 1400px) / 2));
    bottom: 20px;
    z-index: 100;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 24px;
    width: min(calc(100% - 40px), 920px);
    padding: 22px 24px;
    border: 1px solid #c5ccd5;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 18px 60px rgba(23, 35, 59, 0.2);
}

.cookie-notice[hidden] {
    display: none;
}

.cookie-notice-copy strong {
    display: block;
    margin-bottom: 5px;
    font-size: 1rem;
}

.cookie-notice-copy p {
    max-width: 590px;
    margin: 0;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.55;
}

.cookie-notice-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
}

.cookie-notice-actions a,
.cookie-notice-actions button {
    min-height: 38px;
    padding: 0 12px;
    border-radius: 8px;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 750;
    white-space: nowrap;
}

.cookie-notice-actions a {
    display: inline-flex;
    align-items: center;
    color: var(--primary);
    text-decoration: none;
}

.cookie-notice-actions a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.cookie-notice-actions button {
    cursor: pointer;
}

.cookie-reject {
    border: 1px solid #c5ccd5;
    color: var(--primary-dark);
    background: #fff;
}

.cookie-reject:hover {
    border-color: var(--primary);
    background: #eef3f7;
}

.cookie-accept {
    border: 1px solid var(--primary);
    color: #fff;
    background: var(--primary);
}

.cookie-accept:hover {
    background: var(--primary-dark);
}

.auth-page .site-footer {
    max-width: 720px;
    margin-top: 24px;
    padding-right: 20px;
    padding-left: 20px;
    background: transparent;
}

.login-page .site-footer {
    max-width: 1100px;
}

.login-page .site-footer-inner,
.login-page .site-footer nav {
    flex-wrap: nowrap;
}

.public-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(14px);
}

.public-header-actions {
    display: flex;
    align-items: center;
    gap: 22px;
    margin-left: auto;
    flex: 0 0 auto;
    overflow: visible;
}

.portfolio-header-actions {
    flex-wrap: nowrap;
    justify-content: flex-end;
}

.public-currency-form {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
    min-width: max-content;
    white-space: nowrap;
}

.public-currency-form label {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 750;
}

.public-currency-form select {
    height: 36px;
    min-width: 92px;
    padding: 0 30px 0 10px;
    border: 1px solid var(--border);
    border-radius: 9px;
    color: var(--text);
    background-color: var(--surface);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 750;
    cursor: pointer;
}

.public-currency-form select:focus {
    border-color: var(--primary);
    outline: 3px solid rgba(39, 73, 109, 0.14);
}

.public-currency-form noscript button {
    min-height: 36px;
    padding: 0 10px;
}

.public-header-actions a,
.public-nav-link {
    font-size: 0.88rem;
    font-weight: 750;
    text-decoration: none;
}

.public-nav-link {
    color: var(--muted);
}

.public-nav-link:hover {
    color: var(--primary);
}

.portfolio-public-link svg {
    display: none;
}

.portfolio-entry-link {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 40px;
    padding: 0 15px;
    border-radius: 9px;
    color: #fff;
    background: var(--primary);
}

.portfolio-entry-link:hover {
    color: #fff;
    background: var(--primary-dark);
}

.portfolio-entry-label {
    font-size: 0.88rem;
}

.portfolio-entry-label-short {
    display: none;
}

.portfolio-entry-arrow {
    font-size: 1.05rem;
}

.public-main {
    flex: 1;
    width: min(calc(100% - 40px), 1400px);
    margin: 0 auto;
    padding: 64px 0 80px;
}

.public-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.75fr);
    align-items: stretch;
    gap: 28px;
}

.public-hero-copy {
    display: flex;
    justify-content: center;
    flex-direction: column;
    min-height: 390px;
    padding: clamp(36px, 6vw, 76px);
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 24px;
    background:
        radial-gradient(circle at 92% 12%, rgba(185, 111, 50, 0.15), transparent 32%),
        linear-gradient(145deg, #fff 0%, #f5f2ec 100%);
}

.public-hero-copy .eyebrow,
.market-pulse .eyebrow {
    margin-top: 0;
}

.public-hero-copy h1 {
    max-width: 790px;
    font-size: clamp(2.7rem, 5.6vw, 5.3rem);
    line-height: 0.98;
}

.public-hero-copy .lead {
    max-width: 720px;
    margin-top: 10px;
    font-size: clamp(1rem, 1.5vw, 1.22rem);
    line-height: 1.65;
}

.public-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.public-hero-note {
    max-width: 720px;
    margin: 16px 0 0;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.55;
}

.public-hero-note a {
    color: var(--primary);
    font-weight: 700;
}

.primary-action,
.secondary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 9px;
    font-size: 0.9rem;
    font-weight: 800;
    text-decoration: none;
}

.primary-action {
    color: #fff;
    background: var(--primary);
}

.primary-action:hover {
    color: #fff;
    background: var(--primary-dark);
}

.secondary-action {
    border: 1px solid #bdc7d2;
    color: var(--primary);
    background: rgba(255, 255, 255, 0.8);
}

.secondary-action:hover {
    border-color: var(--primary);
    background: #fff;
}

.market-pulse {
    padding: clamp(28px, 4vw, 42px);
    border: 1px solid #bdcad8;
    border-radius: 24px;
    background: #eaf0f6;
}

.market-pulse h2 {
    max-width: 330px;
    font-size: clamp(1.55rem, 2.4vw, 2.15rem);
    line-height: 1.15;
}

.market-pulse-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 28px 0 24px;
}

.market-pulse-grid > div {
    padding: 18px;
    border: 1px solid rgba(39, 73, 109, 0.14);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.72);
}

.market-pulse-grid span,
.market-pulse-grid small {
    display: block;
    color: var(--muted);
    font-size: 0.76rem;
}

.market-pulse-grid strong {
    display: block;
    margin: 4px 0 1px;
    font-size: 1.8rem;
}

.market-mover {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 9px 0;
    color: var(--muted);
    font-size: 0.82rem;
}

.market-mover strong {
    color: var(--text);
}

.market-mover span {
    margin-left: auto;
    font-weight: 800;
    white-space: nowrap;
}

.public-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 22px;
}

.public-summary article {
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
}

.public-summary span {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
}

.public-summary strong {
    display: block;
    margin-top: 6px;
    font-size: 1.55rem;
}

.public-summary p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.5;
}

.public-benefits {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 64px;
}

.public-benefits article {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 16px;
    padding: 24px;
}

.benefit-icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 11px;
    color: var(--primary);
    background: #e3eaf1;
    font-size: 1.15rem;
    font-weight: 850;
}

.public-benefits h2 {
    margin-bottom: 7px;
    font-size: 1rem;
}

.public-benefits p {
    margin: 0;
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.55;
}

.market-directory {
    padding-top: 82px;
    scroll-margin-top: 76px;
}

.public-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
}

.public-section-heading .eyebrow {
    margin-top: 0;
}

.public-section-heading h2 {
    margin-bottom: 8px;
    font-size: clamp(2rem, 3vw, 2.8rem);
}

.public-section-heading p {
    max-width: 720px;
    margin-bottom: 0;
    color: var(--muted);
    line-height: 1.55;
}

.market-currency {
    flex: 0 0 auto;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted);
    background: var(--surface);
    font-size: 0.78rem;
    font-weight: 750;
}

.public-market-tabs {
    margin-top: 28px;
    flex-wrap: wrap;
    overflow: visible;
}

.public-market-tab-row-break {
    flex-basis: 100%;
    height: 0;
}

.public-market-panel {
    margin-top: 18px;
}

.market-table-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.market-table-heading h3 {
    margin: 0;
    font-size: 1.35rem;
}

.public-instrument-search {
    flex: 0 1 340px;
    margin: 0;
}

.public-result-count {
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 0.78rem;
}

.fuel-regime-tabs {
    display: flex;
    gap: 8px;
    margin-top: 18px;
    padding-bottom: 2px;
    border-bottom: 1px solid var(--border);
}

.fuel-regime-tabs[hidden] {
    display: none;
}

.fuel-regime-tab {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 14px;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 750;
    text-decoration: none;
}

.fuel-regime-tab:hover {
    color: var(--primary);
}

.fuel-regime-tab.is-active {
    border-bottom-color: var(--primary);
    color: var(--primary);
}

.public-table-scroll {
    margin-top: 10px;
}

.public-instrument-table {
    min-width: 780px;
}

.public-instrument-table tbody tr {
    transition: background 120ms ease;
}

.public-instrument-table tbody tr:hover {
    background: #f8f6f1;
}

.public-instrument-table td {
    height: 62px;
}

.mobile-price-change {
    display: none;
}

.public-symbol {
    display: inline-flex;
    padding: 5px 8px;
    border-radius: 7px;
    color: var(--primary-dark);
    background: #eaf0f6;
    font-size: 0.76rem;
    font-weight: 800;
}

.native-price {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 500;
}

.source-cell {
    width: 112px;
}

.source-cell a {
    font-size: 0.8rem;
    font-weight: 750;
    text-decoration: none;
}

.source-cell a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.public-disclaimer {
    display: grid;
    grid-template-columns: minmax(240px, 0.45fr) minmax(0, 1fr);
    gap: 50px;
    margin-top: 70px;
    padding: 34px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #eef1f4;
}

.public-disclaimer .eyebrow {
    margin-top: 0;
}

.public-disclaimer h2 {
    margin-bottom: 0;
}

.public-disclaimer > p {
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
}

.profile-page > .eyebrow {
    margin-top: 0;
}

.profile-panel {
    max-width: 560px;
    margin-top: 36px;
}

.profile-panel .form {
    margin-top: 0;
}

.google-account-panel {
    max-width: 560px;
    margin-top: 24px;
}

.google-account-panel h2 {
    margin-top: 0;
}

.google-account-panel .google-login-button {
    width: auto;
    margin-top: 8px;
}

.password-fields {
    display: grid;
    gap: 10px;
    margin: 24px 0 0;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 12px;
}

.password-fields legend {
    padding: 0 8px;
    font-weight: 800;
}

.danger-zone {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    max-width: 560px;
    margin-top: 28px;
    padding: 22px 24px;
    border: 1px solid #efc5c1;
    border-radius: 14px;
    background: var(--danger-bg);
}

.danger-zone h2 {
    margin-bottom: 6px;
    font-size: 1rem;
}

.danger-zone p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 0.85rem;
    line-height: 1.5;
}

.danger-button {
    flex: 0 0 auto;
    padding: 10px 14px;
    border: 1px solid var(--danger);
    border-radius: 9px;
    color: var(--danger);
    font-size: 0.85rem;
    font-weight: 800;
    text-decoration: none;
}

.danger-button:hover {
    color: #fff;
    background: var(--danger);
}

.danger-eyebrow {
    color: var(--danger);
}

.form .destructive-submit {
    background: var(--danger);
}

.form .destructive-submit:hover {
    background: #7f211e;
}

.portfolio-tabs {
    display: flex;
    gap: 6px;
    margin-top: 34px;
    padding: 6px;
    overflow-x: auto;
    scroll-padding-inline: 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #e8edf1;
    scrollbar-width: thin;
}

.portfolio-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 46px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: #536172;
    font-size: 0.88rem;
    font-weight: 750;
    text-decoration: none;
    white-space: nowrap;
}

.portfolio-tab:hover {
    color: var(--primary);
    background: rgba(255, 255, 255, 0.65);
}

.portfolio-tab.is-active {
    border-color: #d7dce2;
    color: var(--text);
    background: var(--surface);
    box-shadow: 0 2px 8px rgba(23, 35, 59, 0.07);
}

.portfolio-tab strong {
    display: inline-grid;
    place-items: center;
    min-width: 24px;
    height: 24px;
    padding: 0 7px;
    border-radius: 999px;
    color: var(--muted);
    background: #dfe5eb;
    font-size: 0.75rem;
}

.portfolio-tab.is-active strong {
    color: #fff;
    background: var(--primary);
}

.summary-grid {
    display: grid;
    grid-template-columns: minmax(0, 360px);
    gap: 16px;
    margin-top: 42px;
}

.portfolio-tabs + .summary-grid {
    margin-top: 18px;
}

.summary-card {
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
}

.summary-card span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.85rem;
}

.summary-card strong {
    font-size: 1.5rem;
}

.summary-card-primary strong {
    display: block;
    margin-bottom: 10px;
}

.summary-secondary {
    display: grid;
    gap: 4px;
    padding-top: 10px;
    border-top: 1px solid rgba(39, 73, 109, 0.1);
}

.summary-secondary-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
}

.summary-secondary span {
    margin-bottom: 0;
    font-size: 0.78rem;
}

.summary-secondary-value {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: nowrap;
    min-width: 0;
    font-size: 0.9rem;
    white-space: nowrap;
    line-height: 1.35;
}

.summary-secondary-amount {
    display: inline-block;
    white-space: nowrap;
}

.summary-secondary-empty {
    color: var(--muted);
    font-weight: 600;
}

.summary-card strong small,
td .positive small,
td .negative small {
    font-size: 0.72em;
    white-space: nowrap;
}

.portfolio-layout {
    display: grid;
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
    gap: 22px;
    margin-top: 22px;
    align-items: start;
}

.panel {
    padding: 26px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
}

.section-heading .eyebrow {
    margin-bottom: 6px;
}

.section-heading h2 {
    margin-bottom: 0;
}

.data-note {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.5;
}

.table-controls {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 10px;
}

.table-controls[hidden] {
    display: none;
}

.portfolio-table-controls {
    margin-top: 0;
}

.portfolio-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-top: 18px;
}

.portfolio-result-count {
    margin: 0;
    color: var(--muted);
    font-size: 0.8rem;
    white-space: nowrap;
}

.table-sort-control {
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 750;
}

.table-sort-control span {
    padding-left: 2px;
}

.table-sort-control select {
    min-width: 190px;
    height: 42px;
    padding: 0 34px 0 12px;
    border: 1px solid #cec9c1;
    border-radius: 9px;
    color: var(--text);
    background: #fff;
    font: inherit;
    font-size: 0.82rem;
    cursor: pointer;
}

.table-sort-control select:focus {
    border-color: var(--primary);
    outline: 3px solid rgba(39, 73, 109, 0.14);
}

.holdings-search {
    position: relative;
    width: min(100%, 320px);
    margin: 18px 0 4px auto;
}

.table-controls .holdings-search {
    margin: 0;
}

.holdings-search svg {
    position: absolute;
    top: 50%;
    left: 13px;
    width: 17px;
    height: 17px;
    fill: none;
    stroke: var(--muted);
    stroke-width: 2;
    stroke-linecap: round;
    transform: translateY(-50%);
    pointer-events: none;
}

.holdings-search input {
    width: 100%;
    padding: 10px 36px 10px 40px;
    border: 1px solid #cec9c1;
    border-radius: 9px;
    color: var(--text);
    background: #fff;
    font: inherit;
}

.holdings-search input:focus {
    border-color: var(--primary);
    outline: 3px solid rgba(39, 73, 109, 0.14);
}

.search-empty {
    margin: 22px 0 4px;
    padding: 22px;
    border: 1px dashed #c2c9d1;
    border-radius: 10px;
    color: var(--muted);
    text-align: center;
}

.search-empty[hidden],
.table-scroll[hidden],
.instrument-row[hidden],
.purchase-details-row[hidden] {
    display: none !important;
}

.compact-form {
    margin-top: 20px;
}

.transaction-fields {
    display: contents;
}

.transaction-fields[hidden] {
    display: none !important;
}

.fund-switch-fields:not([hidden]) {
    display: grid;
    gap: 10px;
}

.instrument-type-context {
    display: grid;
    gap: 3px;
    padding: 13px 14px;
    border: 1px solid #bdcad8;
    border-radius: 9px;
    background: #eef3f7;
}

.instrument-type-context span {
    color: var(--muted);
    font-size: 0.75rem;
}

.instrument-type-context strong {
    color: var(--primary-dark);
    font-size: 0.95rem;
}

.compact-form select {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid #cec9c1;
    border-radius: 9px;
    color: var(--text);
    background: #fff;
    font: inherit;
}

.symbol-picker {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.symbol-picker .secondary-button {
    margin: 0;
    padding-inline: 13px;
    border: 1px solid var(--primary);
    color: var(--primary);
    background: #fff;
    font-size: 0.85rem;
}

.symbol-picker .secondary-button:hover {
    color: #fff;
}

.instrument-preview {
    display: grid;
    gap: 4px;
    margin-top: 4px;
    padding: 13px 14px;
    border: 1px solid #bdcad8;
    border-radius: 9px;
    background: #edf2f7;
}

.instrument-preview[hidden] {
    display: none !important;
}

.instrument-dialog {
    width: min(calc(100% - 32px), 720px);
    max-height: min(780px, calc(100vh - 40px));
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 16px;
    color: var(--text);
    background: var(--surface);
    box-shadow: 0 24px 80px rgba(23, 35, 59, 0.24);
}

.instrument-dialog::backdrop {
    background: rgba(16, 24, 40, 0.56);
    backdrop-filter: blur(2px);
}

.dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 24px 26px 16px;
}

.dialog-header .eyebrow {
    margin-top: 0;
}

.dialog-header h2 {
    margin-bottom: 0;
}

.dialog-close {
    position: relative;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: var(--muted);
    background: var(--background);
    font-size: 1.55rem;
    line-height: 1;
    cursor: pointer;
}

.dialog-close-primary {
    color: #fff;
    background: var(--primary);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0;
}

.dialog-close-primary::before {
    content: "×";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -54%);
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1;
}

.dialog-close-primary:hover,
.dialog-close-primary:focus-visible {
    background: var(--primary-dark);
    outline: none;
}

.instrument-dialog > label,
.instrument-dialog > .dialog-search,
.instrument-dialog > .data-note {
    margin-right: 26px;
    margin-left: 26px;
}

.instrument-dialog > label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.85rem;
    font-weight: 700;
}

.dialog-search {
    width: calc(100% - 52px);
    padding: 12px 14px;
    border: 1px solid #cec9c1;
    border-radius: 9px;
    color: var(--text);
    background: #fff;
    font: inherit;
}

.instrument-list {
    display: grid;
    max-height: 480px;
    margin-top: 12px;
    overflow-y: auto;
    border-top: 1px solid var(--border);
}

.instrument-option {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    width: 100%;
    padding: 14px 26px;
    border: 0;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    background: #fff;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.instrument-option:hover,
.instrument-option:focus-visible {
    background: #eef3f7;
    outline: none;
}

.instrument-option > span {
    display: grid;
    gap: 3px;
}

.instrument-option > span:last-child {
    text-align: right;
}

.instrument-option span span,
.instrument-option small {
    color: var(--muted);
    font-size: 0.78rem;
}

.instrument-preview span {
    color: var(--muted);
    font-size: 0.82rem;
}

.inline-warning {
    margin-top: 4px;
    color: var(--danger);
    font-size: 0.82rem;
}

.positive {
    color: var(--positive);
}

.negative {
    color: var(--danger);
}

.two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.two-columns > div {
    display: grid;
    gap: 10px;
}

.two-columns > div > label {
    display: flex;
    align-items: flex-end;
    min-height: 40px;
    margin-top: 0;
}

.table-scroll {
    margin: 22px -10px -8px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
}

.table-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    min-height: 38px;
    margin-top: 14px;
    color: var(--muted);
    font-size: 0.82rem;
}

.table-actions[hidden] {
    display: none;
}

.compact-danger-button {
    padding: 8px 12px;
    border: 1px solid var(--danger);
    border-radius: 8px;
    color: #fff;
    background: var(--danger);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.compact-danger-button:disabled {
    border-color: #dadde2;
    color: #818995;
    background: #eef1f4;
    cursor: not-allowed;
}

.date-input-wrap {
    position: relative;
}

.date-input-wrap input {
    padding-right: 46px;
}

.date-input-wrap .date-picker-trigger {
    position: absolute;
    top: 50%;
    right: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 7px;
    color: var(--primary);
    background: transparent;
    transform: translateY(-50%);
    cursor: pointer;
}

.date-picker-trigger svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.date-input-wrap .date-picker-trigger:hover,
.date-input-wrap .date-picker-trigger:focus-visible {
    color: var(--primary-dark);
    background: rgba(39, 73, 109, 0.1);
    outline: none;
}

.sl-date-picker {
    position: fixed;
    z-index: 40;
    width: 292px;
    padding: 16px;
    border-radius: 10px;
    color: #e9edf0;
    background: #34343a;
    box-shadow: 0 18px 45px rgba(16, 24, 40, 0.28);
}

.sl-date-picker[hidden] {
    display: none;
}

.sl-date-picker-header,
.sl-date-picker-footer {
    display: flex;
    align-items: center;
}

.sl-date-picker-header {
    justify-content: space-between;
    margin-bottom: 12px;
}

.sl-date-picker-header strong {
    padding: 5px 12px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 4px;
    font-size: 0.9rem;
}

.sl-date-picker button {
    border: 0;
    color: inherit;
    background: transparent;
    font: inherit;
    cursor: pointer;
}

.sl-date-picker-header button {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    color: #aeb4bd;
    font-size: 1.55rem;
    line-height: 1;
}

.sl-date-picker-header button:hover,
.sl-date-picker-day:hover:not(:disabled),
.sl-date-picker-footer button:hover {
    background: rgba(255, 255, 255, 0.1);
}

.sl-date-picker-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.sl-date-picker-day-name {
    color: #aeb4bd;
    font-size: 0.72rem;
    text-align: center;
}

.sl-date-picker-day {
    width: 30px;
    height: 30px;
    margin: 0 auto;
    border-radius: 7px;
    font-size: 0.82rem;
}

.sl-date-picker-day.is-muted {
    color: #737983;
}

.sl-date-picker-day.is-selected {
    outline: 2px solid #d39a67;
    color: #fff;
    background: #27496d;
}

.sl-date-picker-day:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.sl-date-picker-footer {
    justify-content: flex-start;
    margin-top: 12px;
}

.sl-date-picker-footer button {
    padding: 7px 12px;
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 4px;
    font-weight: 700;
}

table {
    width: 100%;
    min-width: 980px;
    border-collapse: collapse;
    font-size: 0.88rem;
}

th,
td {
    padding: 13px 10px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
}

th {
    color: var(--muted);
    font-size: 0.75rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

tbody tr:last-child td {
    border-bottom: 0;
}

.instrument-row:has(+ .purchase-details-row.is-open) td {
    border-bottom-color: #cbd4de;
    background: #faf8f4;
}

.number {
    text-align: right;
}

.selection-cell {
    width: 34px;
    padding-right: 4px;
    padding-left: 4px;
    text-align: center;
}

.selection-cell input {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: var(--primary);
    cursor: pointer;
}

.symbol {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.75rem;
}

.delete-button,
.edit-button {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    cursor: pointer;
}

.delete-button {
    color: var(--danger);
}

.edit-button {
    color: var(--primary);
    font-weight: 700;
}

.details-button {
    padding: 6px 9px;
    border: 1px solid #bbc9d8;
    border-radius: 7px;
    color: var(--primary);
    background: #fff;
    font: inherit;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}

.details-button:hover,
.details-button[aria-expanded="true"] {
    background: #eef3f7;
}

.mobile-details-button {
    display: none;
}

.purchase-details-row td {
    padding: 0;
    background: #f8f6f1;
}

.purchase-details-row {
    display: none;
}

.purchase-details-row.is-open {
    display: table-row;
}

.purchase-details {
    padding: 18px 20px 20px;
}

.purchase-details-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 12px;
}

.purchase-details-header span {
    color: var(--muted);
    font-size: 0.78rem;
}

.purchase-lot-list {
    display: grid;
    gap: 7px;
}

.purchase-lot {
    display: grid;
    grid-template-columns: 1.05fr 0.8fr repeat(4, minmax(95px, 1fr)) 48px;
    align-items: end;
    gap: 16px;
    padding: 11px 12px;
    border: 1px solid #e1ddd5;
    border-radius: 8px;
    background: #fff;
}

.purchase-lot > span {
    display: grid;
    gap: 3px;
}

.purchase-lot small {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
}

.purchase-lot-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.purchase-lot-actions .inline-form {
    margin-top: 0;
    text-align: right;
}

.sales-history-panel {
    margin-top: 28px;
}

.sale-history-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.sale-history-actions .inline-form {
    margin-top: 0;
    text-align: left;
}

.text-link-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--accent);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.danger-link-button {
    color: #a62d2d;
}

.edit-holding-dialog {
    width: min(calc(100% - 32px), 480px);
}

.edit-holding-dialog .compact-form {
    margin-top: 0;
}

.edit-holding-fields {
    display: grid;
    padding: 0 26px 26px;
}

.edit-holding-fields button {
    margin-top: 8px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.dashboard .eyebrow {
    margin-top: 0;
}

.lead {
    max-width: 650px;
    font-size: 1.1rem;
}

.empty-state {
    margin-top: 54px;
    padding: 64px 24px;
    border: 1px dashed #c2c9d1;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.55);
    text-align: center;
}

.small-empty {
    margin-top: 22px;
    padding: 38px 20px;
}

.empty-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    margin: 0 auto 20px;
    border-radius: 50%;
    color: var(--primary);
    background: #e3eaf1;
    font-size: 1.4rem;
    font-weight: 800;
}

.empty-state h2 {
    margin-bottom: 8px;
}

.empty-state p {
    margin-bottom: 0;
}

@media (max-width: 1100px) {
    .topbar {
        padding-right: 24px;
        padding-left: 24px;
    }

    .public-main,
    .dashboard,
    .profile-page,
    .legal-page {
        width: min(calc(100% - 48px), 1400px);
    }

    .public-hero {
        grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
        gap: 20px;
    }

    .public-hero-copy {
        min-height: 350px;
        padding: clamp(32px, 5vw, 56px);
    }

    .market-pulse {
        padding: 30px;
    }

    .public-instrument-table {
        min-width: 660px;
    }

    .public-instrument-table th:nth-child(2),
    .public-instrument-table td:nth-child(2),
    .public-instrument-table th:nth-child(6),
    .public-instrument-table td:nth-child(6) {
        display: none;
    }

    #portfolio-table-scroll > table {
        min-width: 780px;
    }

    #portfolio-table-scroll > table th:nth-child(3),
    #portfolio-table-scroll > table td:nth-child(3),
    #portfolio-table-scroll > table th:nth-child(5),
    #portfolio-table-scroll > table td:nth-child(5),
    #portfolio-table-scroll > table th:nth-child(6),
    #portfolio-table-scroll > table td:nth-child(6) {
        display: none;
    }

    .portfolio-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .portfolio-table-controls {
        width: 100%;
        justify-content: flex-start;
    }
}


/* Tablet optimization (768px-1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .topbar {
        padding-right: 20px;
        padding-left: 20px;
    }

    .public-main,
    .dashboard,
    .profile-page,
    .legal-page {
        width: min(calc(100% - 40px), 900px);
    }

    .dashboard,
    .profile-page,
    .legal-page {
        padding-top: 56px;
        padding-bottom: 60px;
    }

    .public-hero {
        grid-template-columns: minmax(0, 1fr);
        gap: 24px;
    }

    .public-hero-copy {
        min-height: auto;
        padding: 40px;
    }

    .public-hero-copy h1 {
        font-size: clamp(2.6rem, 5vw, 3.2rem);
    }

    .market-pulse {
        padding: 28px;
    }

    .summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .summary-card {
        padding: 20px;
    }

    .summary-card strong {
        font-size: 1.4rem;
    }

    .portfolio-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
        margin-top: 20px;
    }

    .portfolio-tabs {
        gap: 5px;
        padding: 5px;
        overflow-x: auto;
        scrollbar-width: thin;
    }

    .portfolio-tab {
        flex: 0 0 auto;
        min-height: 44px;
        padding: 0 14px;
        font-size: 0.85rem;
    }

    .panel {
        padding: 24px;
    }

    .detail-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .instrument-chart {
        min-height: 280px;
        padding: 10px;
    }

    .instrument-chart svg {
        height: 280px;
    }

    .chart-periods {
        gap: 7px;
    }

    .chart-period-button {
        min-height: 40px;
        padding: 9px 13px;
        font-size: 0.82rem;
    }

    .public-instrument-table {
        min-width: 720px;
        font-size: 0.85rem;
    }

    .public-instrument-table th:nth-child(2),
    .public-instrument-table td:nth-child(2),
    .public-instrument-table th:nth-child(5),
    .public-instrument-table td:nth-child(5) {
        display: none;
    }

    .public-instrument-table th,
    .public-instrument-table td {
        padding-right: 10px;
        padding-left: 10px;
    }

    #portfolio-table-scroll > table {
        min-width: 680px;
        font-size: 0.85rem;
    }

    #portfolio-table-scroll > table th:nth-child(3),
    #portfolio-table-scroll > table td:nth-child(3),
    #portfolio-table-scroll > table th:nth-child(5),
    #portfolio-table-scroll > table td:nth-child(5),
    #portfolio-table-scroll > table th:nth-child(6),
    #portfolio-table-scroll > table td:nth-child(6) {
        display: none;
    }

    #portfolio-table-scroll > table th,
    #portfolio-table-scroll > table td {
        padding-right: 10px;
        padding-left: 10px;
    }

    .portfolio-toolbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
    }

    .portfolio-table-controls {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 10px;
    }

    .table-sort-control {
        flex: 1 1 200px;
    }

    .holdings-search {
        flex: 1 1 240px;
        margin: 0;
    }

    .auth-card {
        width: min(100%, 520px);
        padding: 34px;
    }

    .legal-panel {
        padding: clamp(28px, 4vw, 40px);
    }

    .cookie-policy-list article {
        padding: 18px;
    }

    .cookie-policy-list dl > div {
        grid-template-columns: 120px minmax(0, 1fr);
        gap: 12px;
    }

    .instrument-detail-page {
        padding: 32px 0 52px;
    }

    .instrument-detail-header {
        margin-bottom: 24px;
    }

    .mini-metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }
}

@media (max-width: 760px) {
    .topbar {
        min-height: 62px;
        padding-right: 20px;
        padding-left: 20px;
    }

    .brand {
        gap: 0;
    }

    .brand img {
        width: 106px;
        height: auto;
    }

    .public-header-actions {
        flex: 1 1 auto;
        justify-content: flex-end;
        gap: 10px;
    }

    .public-currency-form label,
    .public-nav-link {
        display: none;
    }

    .header-contact {
        display: inline-grid;
        place-items: center;
        flex: 0 0 38px;
        width: 38px;
        height: 38px;
        border: 1px solid var(--border);
        border-radius: 9px;
        background: var(--surface);
    }

    .header-contact svg {
        width: 19px;
        height: 19px;
    }

    .public-currency-form select {
        min-width: 68px;
        padding-right: 24px;
        padding-left: 8px;
    }

    .portfolio-entry-link {
        min-height: 38px;
        padding: 0 11px;
    }

    .portfolio-entry-label-wide {
        display: none;
    }

    .portfolio-entry-label-short {
        display: inline;
    }

    .public-main,
    .dashboard,
    .profile-page,
    .legal-page {
        width: min(calc(100% - 32px), 1400px);
    }

    .dashboard,
    .profile-page,
    .legal-page {
        padding-top: 44px;
        padding-bottom: 52px;
    }

    .instrument-detail-page {
        padding: 28px 0 48px;
    }

    .instrument-detail-header {
        margin-bottom: 22px;
    }

    .instrument-detail-links {
        gap: 8px 12px;
    }

    .official-website-link {
        min-height: 40px;
        padding: 0 13px;
        font-size: 0.8rem;
    }

    .source-reference-link {
        padding: 5px 0;
        font-size: 0.78rem;
        line-height: 1.3;
    }

    .detail-metrics,
    .mini-metrics-grid {
        gap: 12px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .instrument-chart {
        min-height: 245px;
        padding: 8px;
    }

    .instrument-chart svg {
        height: 245px;
    }

    .chart-periods {
        gap: 6px;
    }

    .chart-period-button {
        min-height: 38px;
        padding: 8px 11px;
        font-size: 0.8rem;
    }

    .public-hero-copy h1 {
        font-size: clamp(2.35rem, 10vw, 3.3rem);
    }

    .public-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .public-summary article {
        padding: 18px;
    }

    .public-summary strong {
        font-size: 1.3rem;
    }

    .public-market-tabs,
    .portfolio-tabs {
        margin-right: -4px;
        margin-left: -4px;
        padding-right: 4px;
        padding-left: 4px;
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: thin;
    }

    .public-market-tab-row-break {
        display: none;
    }

    .public-market-tab,
    .portfolio-tab {
        flex: 0 0 auto;
    }

    .public-instrument-table {
        min-width: 100%;
        table-layout: fixed;
        font-size: 0.82rem;
    }

    .public-instrument-table th:nth-child(5),
    .public-instrument-table td:nth-child(5) {
        display: none;
    }

    .public-instrument-table th:nth-child(4),
    .public-instrument-table td:nth-child(4) {
        display: none;
    }

    .public-instrument-table th,
    .public-instrument-table td {
        padding-right: 8px;
        padding-left: 8px;
    }

    .public-instrument-table th:first-child,
    .public-instrument-table td:first-child {
        width: 62%;
        white-space: normal;
    }

    .public-instrument-table th:nth-child(3),
    .public-instrument-table td:nth-child(3) {
        width: 38%;
        white-space: normal;
    }

    .public-instrument-table td {
        height: 56px;
    }

    .public-instrument-table .mobile-price-change,
    #portfolio-table-scroll > table .mobile-price-change {
        display: block;
        margin-top: 4px;
        font-size: 0.72rem;
        font-weight: 700;
        line-height: 1.15;
    }

    #portfolio-table-scroll > table {
        min-width: 590px;
        font-size: 0.82rem;
    }

    #portfolio-table-scroll > table th:nth-child(4),
    #portfolio-table-scroll > table td:nth-child(4),
    #portfolio-table-scroll > table th:nth-child(5),
    #portfolio-table-scroll > table td:nth-child(5),
    #portfolio-table-scroll > table th:nth-child(6),
    #portfolio-table-scroll > table td:nth-child(6),
    #portfolio-table-scroll > table th:nth-child(7),
    #portfolio-table-scroll > table td:nth-child(7) {
        display: none;
    }

    #portfolio-table-scroll > table th,
    #portfolio-table-scroll > table td {
        padding-right: 8px;
        padding-left: 8px;
    }

    .portfolio-result-count {
        white-space: normal;
    }

    .portfolio-table-controls,
    .table-controls {
        align-items: stretch;
        flex-wrap: wrap;
        gap: 8px;
    }

    .table-sort-control {
        flex: 1 1 180px;
    }

    .table-sort-control select,
    .holdings-search {
        width: 100%;
    }

    .holdings-search {
        flex: 1 1 220px;
        margin: 0;
    }

    .panel {
        padding: 20px;
    }

    .portfolio-layout {
        gap: 16px;
        margin-top: 16px;
    }
}

@media (max-width: 560px) {
    .auth-card {
        padding: 28px 22px;
    }

    .topbar {
        padding: 0 20px;
    }

    .dashboard {
        padding-top: 36px;
    }

    .summary-grid,
    .two-columns {
        grid-template-columns: 1fr;
    }

    .two-columns > div > label {
        min-height: 0;
    }

    .symbol-picker {
        grid-template-columns: 1fr;
    }

    .instrument-option {
        gap: 12px;
        padding-right: 18px;
        padding-left: 18px;
    }

    .danger-zone {
        align-items: stretch;
        flex-direction: column;
    }

    .danger-button {
        text-align: center;
    }

    .site-footer-inner {
        align-items: flex-start;
        flex-direction: column;
    }

    .login-page .site-footer-inner {
        flex-direction: column;
    }

    .login-page .site-footer nav {
        flex-wrap: wrap;
    }

    .cookie-notice {
        right: 14px;
        bottom: 14px;
        grid-template-columns: 1fr;
        gap: 16px;
        width: calc(100% - 28px);
        padding: 20px;
    }

    .cookie-notice-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .cookie-notice-actions a,
    .cookie-notice-actions button {
        justify-content: center;
        width: 100%;
    }

    .cookie-policy-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .cookie-policy-list dl > div {
        grid-template-columns: 1fr;
        gap: 3px;
    }

    .risk-grid {
        grid-template-columns: 1fr;
    }

    .public-main {
        width: min(calc(100% - 28px), 1400px);
        padding-top: 34px;
    }

    .public-hero-copy,
    .market-pulse {
        padding: 26px 22px;
        border-radius: 18px;
    }

    .public-hero-copy {
        min-height: 0;
    }

    .public-hero-copy h1 {
        font-size: 2.55rem;
    }

    .public-hero-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .public-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        margin-top: 14px;
    }

    .public-summary article {
        min-width: 0;
        padding: 13px 10px;
        border-radius: 11px;
    }

    .public-summary span {
        min-height: 2.3em;
        font-size: 0.66rem;
        line-height: 1.2;
    }

    .public-summary strong {
        margin-top: 4px;
        overflow-wrap: anywhere;
        font-size: 1.05rem;
        line-height: 1.15;
    }

    .public-summary p {
        display: none;
    }

    .public-benefits {
        grid-template-columns: 1fr;
    }

    .public-benefits {
        margin-top: 42px;
    }

    .market-directory {
        padding-top: 58px;
    }

    .public-section-heading,
    .market-table-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .public-market-panel {
        margin-top: 12px;
    }

    .market-table-heading {
        gap: 10px;
    }

    .table-controls {
        align-items: stretch;
        flex-direction: column;
        gap: 0;
    }

    .table-sort-control {
        flex: 0 0 auto;
        gap: 2px;
    }

    .table-sort-control select {
        width: 100%;
    }

    .public-instrument-search {
        flex: 0 0 auto;
        flex-basis: auto;
        width: 100%;
        margin-top: 5px;
    }

    .public-result-count {
        margin-top: 10px;
    }

    .public-table-scroll {
        margin-top: 4px;
    }

    .public-disclaimer {
        grid-template-columns: 1fr;
        gap: 18px;
        padding: 26px 22px;
    }

    .public-currency-form label {
        display: none;
    }

    .public-currency-form select {
        max-width: 105px;
    }

    .public-topbar {
        gap: 6px;
    }

    .public-topbar .public-header-actions {
        flex-basis: auto;
        justify-content: flex-end;
        gap: 4px;
    }

    .public-header-actions .account-menu summary {
        max-width: 106px;
        padding-right: 9px;
        padding-left: 9px;
        font-size: 0.78rem;
        white-space: normal;
    }

    .detail-metrics,
    .mini-metrics-grid {
        grid-template-columns: 1fr;
    }

    .detail-metrics {
        gap: 8px;
        margin-bottom: 16px;
    }

    .detail-metrics-public {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .detail-metrics-portfolio {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .detail-metrics .summary-card {
        min-width: 0;
        padding: 14px 11px;
        border-radius: 12px;
    }

    .detail-metrics .summary-card span {
        margin-bottom: 5px;
        font-size: 0.68rem;
        line-height: 1.25;
    }

    .detail-metrics .summary-card strong {
        overflow-wrap: anywhere;
        font-size: 1.05rem;
        line-height: 1.2;
    }

    .instrument-chart {
        min-height: 220px;
    }

    .instrument-chart svg {
        height: 220px;
    }

    .detail-chart-heading {
        gap: 12px;
    }

    .chart-period-button {
        flex: 1 0 auto;
        min-width: 44px;
        padding-right: 9px;
        padding-left: 9px;
        text-align: center;
    }

    .public-instrument-table {
        min-width: 100%;
        font-size: 0.76rem;
    }

    .public-instrument-table th:first-child,
    .public-instrument-table td:first-child {
        width: 60%;
    }

    .public-instrument-table th:nth-child(3),
    .public-instrument-table td:nth-child(3) {
        width: 40%;
    }

    .public-instrument-table th:nth-child(4),
    .public-instrument-table td:nth-child(4) {
        display: none;
    }

    .public-instrument-table th,
    .public-instrument-table td {
        padding: 10px 6px;
    }

    .public-instrument-table .table-inline-link {
        margin-top: 5px;
        font-size: 0.76rem;
    }

    .public-market-tabs {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        margin: 18px 0 0;
        padding: 0;
        overflow: visible;
        border: 0;
        border-radius: 0;
        background: transparent;
    }

    .public-market-tab-row-break {
        display: none;
    }

    .public-market-tabs .portfolio-tab {
        display: flex;
        min-width: 0;
        min-height: 38px;
        padding: 0 9px;
        overflow: hidden;
        border: 1px solid var(--border);
        border-radius: 9px;
        font-size: 0.72rem;
        line-height: 1.15;
        text-align: center;
        white-space: normal;
    }

    .public-market-tabs .portfolio-tab strong {
        display: none;
    }

    #portfolio-table-scroll > table {
        min-width: 500px;
    }

    #portfolio-table-scroll > table th:nth-child(9),
    #portfolio-table-scroll > table td:nth-child(9) {
        display: none;
    }

    .portfolio-tab {
        min-height: 42px;
        padding: 0 13px;
        font-size: 0.82rem;
    }

    .portfolio-entry-label-wide {
        display: none;
    }

    .portfolio-entry-label-short {
        display: inline;
    }
}

@media (max-width: 900px) {
    .topbar .brand-tagline,
    .header-contact span {
        display: none;
    }

    .public-nav-link {
        display: none;
    }

    .portfolio-header-actions .portfolio-public-link {
        display: inline-grid;
        place-items: center;
        flex: 0 0 38px;
        width: 38px;
        height: 38px;
        border: 1px solid var(--border);
        border-radius: 9px;
        color: var(--primary);
        background: var(--surface);
    }

    .portfolio-header-actions .portfolio-public-link-label {
        display: none;
    }

    .portfolio-header-actions .portfolio-public-link svg {
        display: block;
        width: 19px;
        height: 19px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .portfolio-header-actions .portfolio-public-link:hover {
        color: var(--primary);
        background: #eef3f7;
    }

    .public-header-actions {
        gap: 14px;
    }

    .public-hero {
        grid-template-columns: 1fr;
    }

    .public-summary,
    .public-benefits {
        grid-template-columns: 1fr;
    }

    .portfolio-layout {
        grid-template-columns: 1fr;
    }

    .purchase-lot {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .purchase-lot .edit-button {
        text-align: left;
    }

    .mini-metrics-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px;
    }

    .mini-metrics-grid .summary-card {
        min-width: 0;
        padding: 15px 13px;
        border-radius: 12px;
    }

    .mini-metrics-grid .summary-card span {
        min-height: 2.4em;
        margin-bottom: 5px;
        font-size: 0.72rem;
        line-height: 1.2;
    }

    .mini-metrics-grid .summary-card strong {
        overflow-wrap: anywhere;
        font-size: 1.1rem;
        line-height: 1.2;
    }
}

@media (max-width: 540px) {
    .public-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .public-header-actions .account-menu summary {
        display: grid;
        place-items: center;
        width: 38px;
        min-height: 38px;
        padding: 0;
    }

    .public-header-actions .account-menu-name,
    .public-header-actions .account-menu summary::after {
        display: none;
    }

    .public-header-actions .account-menu-icon {
        display: block;
    }

    .portfolio-entry-link {
        gap: 5px;
        min-height: 38px;
        padding: 0 8px;
        font-size: 0.76rem;
    }

    .portfolio-entry-arrow {
        font-size: 0.9rem;
    }

    .dashboard {
        width: min(calc(100% - 24px), 1400px);
        padding: 28px 0 40px;
    }

    .dashboard .portfolio-tabs {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        margin-top: 20px;
        padding: 0;
        overflow: visible;
        border: 0;
        border-radius: 0;
        background: transparent;
    }

    .dashboard .portfolio-tab {
        min-width: 0;
        min-height: 42px;
        padding: 7px 8px;
        border: 1px solid var(--border);
        border-radius: 9px;
        font-size: 0.76rem;
        line-height: 1.15;
        text-align: center;
        white-space: normal;
    }

    .dashboard .portfolio-tab strong {
        min-width: 20px;
        height: 20px;
        padding: 0 5px;
        font-size: 0.68rem;
    }

    .dashboard .summary-grid {
        gap: 8px;
        margin-top: 14px;
    }

    .dashboard .summary-card {
        padding: 14px 12px;
        border-radius: 12px;
    }

    .dashboard .summary-card span {
        margin-bottom: 5px;
        font-size: 0.72rem;
    }

    .dashboard .summary-card strong {
        font-size: 1.15rem;
    }

    .dashboard .summary-secondary-grid {
        gap: 8px;
    }

    .dashboard .summary-secondary-value {
        font-size: 0.82rem;
    }

    .dashboard .portfolio-layout {
        gap: 12px;
        margin-top: 14px;
    }

    .dashboard .portfolio-layout > .panel,
    .dashboard .compact-form,
    .dashboard .symbol-picker {
        min-width: 0;
        max-width: 100%;
    }

    .dashboard .panel {
        padding: 16px;
    }

    .dashboard .portfolio-toolbar {
        gap: 12px;
        margin-top: 12px;
    }

    .dashboard .portfolio-table-controls {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        width: 100%;
    }

    .dashboard .table-sort-control,
    .dashboard .table-sort-control select,
    .dashboard .holdings-search {
        width: 100%;
        min-width: 0;
    }

    .dashboard .holdings-search {
        min-height: 42px;
        margin: 0;
    }

    #portfolio-table-scroll {
        margin: 16px 0 -4px;
    }

    #portfolio-table-scroll > table {
        min-width: 100%;
        table-layout: fixed;
        font-size: 0.76rem;
    }

    #portfolio-table-scroll > table th:first-child,
    #portfolio-table-scroll > table td:first-child {
        width: 36px;
    }

    #portfolio-table-scroll > table th:nth-child(2),
    #portfolio-table-scroll > table td:nth-child(2) {
        width: auto;
        white-space: normal;
    }

    #portfolio-table-scroll > table th:nth-child(8),
    #portfolio-table-scroll > table td:nth-child(8) {
        width: 88px;
        white-space: normal;
    }

    #portfolio-table-scroll > table th,
    #portfolio-table-scroll > table td {
        padding: 10px 6px;
    }

    .mini-metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .mini-metrics-grid .summary-card {
        padding: 12px 10px;
        border-radius: 11px;
    }

    .mini-metrics-grid .summary-card span {
        min-height: 2.4em;
        margin-bottom: 4px;
        font-size: 0.68rem;
    }

    .mini-metrics-grid .summary-card strong {
        font-size: 1rem;
    }
}

@media (max-width: 1024px) and (max-height: 520px) and (orientation: landscape) {
    .topbar {
        min-height: 58px;
        padding-right: 16px;
        padding-left: 16px;
    }

    .brand {
        gap: 0;
    }

    .brand img {
        width: 106px;
        height: auto;
    }

    .public-header-actions {
        flex: 1 1 auto;
        justify-content: flex-end;
        gap: 8px;
    }

    .public-currency-form label {
        display: none;
    }

    .public-currency-form select {
        min-width: 68px;
        padding-right: 24px;
        padding-left: 8px;
    }

    .header-contact {
        display: inline-grid;
        place-items: center;
        flex: 0 0 38px;
        width: 38px;
        height: 38px;
        border: 1px solid var(--border);
        border-radius: 9px;
        background: var(--surface);
    }

    .header-contact svg {
        width: 19px;
        height: 19px;
    }

    .public-header-actions .account-menu summary {
        display: grid;
        place-items: center;
        width: 38px;
        min-height: 38px;
        padding: 0;
    }

    .public-header-actions .account-menu-name,
    .public-header-actions .account-menu summary::after {
        display: none;
    }

    .public-header-actions .account-menu-icon {
        display: block;
    }

    .public-main {
        width: min(calc(100% - 32px), 1060px);
        padding-top: 24px;
        padding-bottom: 36px;
    }

    .public-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
        margin-top: 14px;
    }

    .public-summary article {
        min-width: 0;
        padding: 13px 12px;
        border-radius: 11px;
    }

    .public-summary span {
        min-height: 0;
        font-size: 0.68rem;
        line-height: 1.25;
    }

    .public-summary strong {
        margin-top: 4px;
        overflow-wrap: anywhere;
        font-size: 1.1rem;
        line-height: 1.15;
    }

    .public-summary p {
        display: none;
    }

    .dashboard {
        width: min(calc(100% - 32px), 680px);
        padding: 24px 0 36px;
    }

    .dashboard h1 {
        font-size: 1.8rem;
    }

    .dashboard .lead {
        margin-bottom: 0;
        font-size: 0.95rem;
    }

    .dashboard .portfolio-tabs {
        display: flex;
        flex-wrap: nowrap;
        gap: 6px;
        margin: 16px -4px 0;
        padding: 4px;
        overflow-x: auto;
        scrollbar-width: thin;
    }

    .dashboard .portfolio-tab {
        flex: 0 0 auto;
        min-height: 38px;
        padding: 0 10px;
        font-size: 0.78rem;
    }

    .dashboard .summary-grid {
        gap: 10px;
        margin-top: 14px;
    }

    .dashboard .summary-card {
        padding: 14px;
    }

    .dashboard .portfolio-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
        margin-top: 14px;
    }

    .dashboard .portfolio-layout > .panel {
        min-width: 0;
    }

    .dashboard .panel {
        padding: 18px;
    }

    .dashboard .holdings-panel .data-note {
        margin-top: 7px;
    }

    .dashboard .compact-form {
        gap: 8px;
        margin-top: 14px;
    }

    .dashboard .compact-form label {
        margin-top: 4px;
    }

    .dashboard .symbol-picker {
        grid-template-columns: minmax(0, 1fr);
    }

    .dashboard .symbol-picker .secondary-button {
        width: 100%;
    }

    .dashboard .two-columns {
        gap: 10px;
    }

    .dashboard .portfolio-toolbar {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
        margin-top: 12px;
    }

    .dashboard .portfolio-result-count {
        white-space: normal;
    }

    .dashboard .portfolio-table-controls {
        display: grid;
        grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr);
        width: 100%;
    }

    .dashboard .portfolio-table-controls > * {
        min-width: 0;
    }

    .dashboard .portfolio-table-controls .table-sort-control,
    .dashboard .portfolio-table-controls .holdings-search {
        width: 100%;
    }

    #portfolio-table-scroll {
        overflow-x: visible;
        margin-top: 12px;
    }

    #portfolio-table-scroll > table {
        min-width: 100%;
        table-layout: fixed;
        font-size: 0.78rem;
    }

    #portfolio-table-scroll > table th:nth-child(3),
    #portfolio-table-scroll > table td:nth-child(3),
    #portfolio-table-scroll > table th:nth-child(4),
    #portfolio-table-scroll > table td:nth-child(4),
    #portfolio-table-scroll > table th:nth-child(5),
    #portfolio-table-scroll > table td:nth-child(5),
    #portfolio-table-scroll > table th:nth-child(6),
    #portfolio-table-scroll > table td:nth-child(6),
    #portfolio-table-scroll > table th:nth-child(7),
    #portfolio-table-scroll > table td:nth-child(7),
    #portfolio-table-scroll > table th:nth-child(9),
    #portfolio-table-scroll > table td:nth-child(9) {
        display: none;
    }

    #portfolio-table-scroll > table th:first-child,
    #portfolio-table-scroll > table td:first-child {
        width: 36px;
        padding-right: 5px;
        padding-left: 5px;
    }

    #portfolio-table-scroll > table th:nth-child(2),
    #portfolio-table-scroll > table td:nth-child(2) {
        width: auto;
        white-space: normal;
    }

    #portfolio-table-scroll > table th:nth-child(8),
    #portfolio-table-scroll > table td:nth-child(8) {
        width: 108px;
        white-space: normal;
    }

    #portfolio-table-scroll > table th:nth-child(10),
    #portfolio-table-scroll > table td:nth-child(10) {
        width: 106px;
        white-space: normal;
    }

    #portfolio-table-scroll > table th,
    #portfolio-table-scroll > table td {
        padding: 8px 7px;
    }

    #portfolio-table-scroll > table,
    #portfolio-table-scroll > table thead,
    #portfolio-table-scroll > table tbody {
        display: block;
        width: 100%;
    }

    #portfolio-table-scroll > table thead > tr,
    #portfolio-table-scroll > table .instrument-row {
        display: grid;
        grid-template-columns: 30px minmax(0, 1fr) 108px;
        width: 100%;
    }

    #portfolio-table-scroll > table thead > tr > th,
    #portfolio-table-scroll > table .instrument-row > td {
        display: block;
        width: auto;
        min-width: 0;
    }

    #portfolio-table-scroll > table thead > tr > th:nth-child(3),
    #portfolio-table-scroll > table thead > tr > th:nth-child(4),
    #portfolio-table-scroll > table thead > tr > th:nth-child(5),
    #portfolio-table-scroll > table thead > tr > th:nth-child(6),
    #portfolio-table-scroll > table thead > tr > th:nth-child(7),
    #portfolio-table-scroll > table thead > tr > th:nth-child(9),
    #portfolio-table-scroll > table thead > tr > th:nth-child(10),
    #portfolio-table-scroll > table .instrument-row > td:nth-child(3),
    #portfolio-table-scroll > table .instrument-row > td:nth-child(4),
    #portfolio-table-scroll > table .instrument-row > td:nth-child(5),
    #portfolio-table-scroll > table .instrument-row > td:nth-child(6),
    #portfolio-table-scroll > table .instrument-row > td:nth-child(7),
    #portfolio-table-scroll > table .instrument-row > td:nth-child(9),
    #portfolio-table-scroll > table .instrument-row > td:nth-child(10) {
        display: none;
    }

    #portfolio-table-scroll > table .purchase-details-row,
    #portfolio-table-scroll > table .purchase-details-row.is-open {
        display: none;
        width: 100%;
    }

    #portfolio-table-scroll > table .purchase-details-row.is-open {
        display: block;
    }

    #portfolio-table-scroll > table .purchase-details-row > td {
        display: block;
        width: 100%;
    }

    .mobile-details-button {
        display: inline-flex;
        margin-top: 7px;
        padding: 5px 8px;
        font-size: 0.72rem;
    }

    #portfolio-table-scroll > table .mobile-price-change {
        display: block;
        margin-top: 4px;
        font-size: 0.72rem;
        font-weight: 700;
        line-height: 1.15;
    }
}

@media (max-width: 1024px) {
    .public-market-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: thin;
    }

    .public-market-tab-row-break {
        display: none;
    }
}

@media (max-width: 540px) {
    .dashboard .portfolio-tabs,
    .public-market-tabs {
        display: flex;
        flex-wrap: nowrap;
        gap: 6px;
        margin: 18px -4px 0;
        padding: 5px;
        overflow-x: auto;
        border: 1px solid var(--border);
        border-radius: 12px;
        background: #e8edf1;
        scrollbar-width: thin;
    }

    .dashboard .portfolio-tab,
    .public-market-tabs .portfolio-tab {
        display: inline-flex;
        flex: 0 0 auto;
        min-width: auto;
        min-height: 38px;
        padding: 0 12px;
        overflow: visible;
        border: 1px solid transparent;
        border-radius: 8px;
        font-size: 0.76rem;
        line-height: 1;
        text-align: left;
        white-space: nowrap;
    }

    .public-market-tabs .portfolio-tab strong {
        display: inline-grid;
    }
}

.portfolio-add-form > summary {
    display: none;
}

@media (max-width: 1024px) {
    .portfolio-add-form > summary {
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 46px;
        padding: 0 14px;
        border: 1px solid #c7d7e5;
        border-radius: 10px;
        color: var(--primary);
        background: #edf4f9;
        cursor: pointer;
        font-size: 0.86rem;
        font-weight: 800;
        list-style: none;
    }

    .portfolio-add-form > summary::-webkit-details-marker {
        display: none;
    }

    .portfolio-add-form > summary svg {
        width: 18px;
        height: 18px;
        fill: none;
        stroke: currentColor;
        stroke-linecap: round;
        stroke-linejoin: round;
        stroke-width: 2;
        transition: transform 160ms ease;
    }

    .portfolio-add-form[open] > summary {
        background: #e5eff7;
    }

    .portfolio-add-form[open] > summary svg {
        transform: rotate(180deg);
    }

    .portfolio-add-form-close-label {
        display: none;
    }

    .portfolio-add-form[open] .portfolio-add-form-open-label {
        display: none;
    }

    .portfolio-add-form[open] .portfolio-add-form-close-label {
        display: inline;
    }

    .portfolio-add-form > .compact-form {
        margin-top: 16px;
    }
}

@media (max-width: 540px) {
    #portfolio-table-scroll {
        overflow-x: visible;
    }

    #portfolio-table-scroll > table,
    #portfolio-table-scroll > table thead,
    #portfolio-table-scroll > table tbody {
        display: block;
        width: 100%;
    }

    #portfolio-table-scroll > table thead > tr,
    #portfolio-table-scroll > table .instrument-row {
        display: grid;
        grid-template-columns: 30px minmax(0, 1fr) 88px;
        width: 100%;
    }

    #portfolio-table-scroll > table thead > tr > th,
    #portfolio-table-scroll > table .instrument-row > td {
        display: block;
        width: auto;
        min-width: 0;
    }

    #portfolio-table-scroll > table thead > tr > th:nth-child(3),
    #portfolio-table-scroll > table thead > tr > th:nth-child(4),
    #portfolio-table-scroll > table thead > tr > th:nth-child(5),
    #portfolio-table-scroll > table thead > tr > th:nth-child(6),
    #portfolio-table-scroll > table thead > tr > th:nth-child(7),
    #portfolio-table-scroll > table thead > tr > th:nth-child(9),
    #portfolio-table-scroll > table thead > tr > th:nth-child(10),
    #portfolio-table-scroll > table .instrument-row > td:nth-child(3),
    #portfolio-table-scroll > table .instrument-row > td:nth-child(4),
    #portfolio-table-scroll > table .instrument-row > td:nth-child(5),
    #portfolio-table-scroll > table .instrument-row > td:nth-child(6),
    #portfolio-table-scroll > table .instrument-row > td:nth-child(7),
    #portfolio-table-scroll > table .instrument-row > td:nth-child(9),
    #portfolio-table-scroll > table .instrument-row > td:nth-child(10) {
        display: none;
    }

    #portfolio-table-scroll > table thead > tr > th:nth-child(1),
    #portfolio-table-scroll > table .instrument-row > td:nth-child(1) {
        width: 30px;
        padding-right: 4px;
        padding-left: 4px;
    }

    #portfolio-table-scroll > table thead > tr > th:nth-child(2),
    #portfolio-table-scroll > table .instrument-row > td:nth-child(2) {
        width: auto;
    }

    #portfolio-table-scroll > table thead > tr > th:nth-child(8),
    #portfolio-table-scroll > table .instrument-row > td:nth-child(8) {
        width: 88px;
    }

    #portfolio-table-scroll > table .purchase-details-row,
    #portfolio-table-scroll > table .purchase-details-row.is-open {
        display: none;
        width: 100%;
    }

    #portfolio-table-scroll > table .purchase-details-row.is-open {
        display: block;
    }

    #portfolio-table-scroll > table .purchase-details-row > td {
        display: block;
        width: 100%;
    }

    #portfolio-table-scroll > table th:nth-child(8),
    #portfolio-table-scroll > table td:nth-child(8) {
        width: 82px;
    }

    #portfolio-table-scroll > table th:nth-child(10),
    #portfolio-table-scroll > table td:nth-child(10) {
        display: none;
    }

    #portfolio-table-scroll > table th:nth-child(8) {
        font-size: 0.64rem;
        line-height: 1.1;
        white-space: normal;
    }

    .mobile-details-button {
        display: inline-flex;
        margin-top: 8px;
        padding: 5px 7px;
        font-size: 0.7rem;
    }

    .purchase-details {
        padding: 14px 8px 16px;
    }

    .purchase-details-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
        margin-bottom: 12px;
    }

    .purchase-details-header + .purchase-details-header {
        margin-top: 18px;
    }

    .purchase-details-header strong {
        font-size: 0.86rem;
    }

    .purchase-details-header span {
        font-size: 0.74rem;
        line-height: 1.35;
    }

    .purchase-lot-list {
        gap: 10px;
    }

    .purchase-lot {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
        gap: 12px 10px;
        padding: 14px 12px;
        border-radius: 10px;
    }

    .purchase-lot > span {
        min-width: 0;
        font-size: 0.8rem;
        line-height: 1.35;
        overflow-wrap: anywhere;
    }

    .purchase-lot > span:nth-child(5),
    .purchase-lot > span:nth-child(6) {
        padding-top: 10px;
        border-top: 1px solid #ebe6de;
    }

    .purchase-lot > .data-note,
    .purchase-lot > .edit-button,
    .purchase-lot > .purchase-lot-actions {
        grid-column: 1 / -1;
    }

    .purchase-lot > .edit-button {
        width: fit-content;
        margin-top: -2px;
    }

    .purchase-lot-actions {
        align-items: flex-start;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px 14px;
    }

    .purchase-lot-actions .inline-form {
        text-align: left;
    }
}
