/* Yieldfolio — theme styled after the Aurora dashboard template, in the logo's navy and green
   (https://aurora.themewagon.com): Plus Jakarta Sans, a blue/green/orange/purple
   palette, softly-shadowed rounded cards instead of hairline borders, and a
   white sidebar with a tinted rounded highlight on the active link. Every
   Tabler component still works unmodified — this only overrides the tokens
   Tabler itself reads, plus a few structural tweaks (sidebar, cards). */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --tblr-font-sans-serif: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    /* Aurora palette (see https://aurora.themewagon.com — MUI theme tokens) */
    --tblr-primary: #083D73;
    --tblr-primary-rgb: 8, 61, 115;
    --tblr-success: #2F9E6F;
    --tblr-success-rgb: 47, 158, 111;
    --tblr-warning: #F68D2A;
    --tblr-warning-rgb: 246, 141, 42;
    --tblr-danger: #D02241;
    --tblr-danger-rgb: 208, 34, 65;
    --tblr-info: #0DA6D6;
    --tblr-info-rgb: 13, 166, 214;

    --aurora-purple: #A641FA;
    --aurora-purple-lt: rgba(166, 65, 250, .12);
    --aurora-primary-lt: rgba(8, 61, 115, .10);
    --aurora-success-lt: rgba(47, 158, 111, .12);
    --aurora-warning-lt: rgba(246, 141, 42, .12);
    --aurora-info-lt: rgba(13, 166, 214, .12);
    /* Exact elevation-3 shadow from Aurora's own theme/shadows.ts — Paper (Aurora's Card)
       defaults to elevation={3}, so this is the real card shadow, not an approximation. */
    --aurora-card-shadow: 3px 24px 42px 0px rgba(0, 0, 0, .07), 1px 10.271px 9.478px 0px rgba(0, 0, 0, .03),
                           0px 5.695px 3.531px 0px rgba(0, 0, 0, .01), 0px -1px 3.15px 0px rgba(0, 0, 0, .02);
    --aurora-divider: rgba(195, 211, 219, .6);

    /* "dark" shade of each palette color, from Aurora's palette/index.ts — soft badges/buttons
       use this (not the main color) for their text, over a tint of the main color. */
    --aurora-primary-dark: #083D73;
    --aurora-secondary-dark: #742DAF;
    --aurora-success-dark: #1F7A52;
    --aurora-warning-dark: #AC631D;
    --aurora-danger-dark: #B11D37;
    --aurora-info-dark: #097496;
    --aurora-neutral-dark: #111417;
}

:root {
    /* Tabler defaults to 0.875rem (14px) body text — Aurora's own body1 is 16px, and Tabler's
       default reads noticeably small next to Aurora's type scale, so bump it up a step. */
    --tblr-body-font-size: 1rem;
}

body {
    font-family: var(--tblr-font-sans-serif);
}

/* Column-style headings: deep navy ink, tight tracking */
h1, h2, h3, h4, .card-title, .page-title {
    letter-spacing: -.02em;
}
html:not([data-bs-theme="dark"]) {
    --tblr-body-color: #1B2B44;
    --tblr-heading-color: #032C54;
}
/* links and focus follow the brand navy (a lighter blue on the dark theme, where navy would disappear) */
:root { --tblr-link-color: #0E4F93; --tblr-link-color-rgb: 14, 79, 147; --tblr-link-hover-color: #032C54; --tblr-link-hover-color-rgb: 3, 44, 84; }
html[data-bs-theme="dark"] {
    --tblr-primary: #2B6CB5; --tblr-primary-rgb: 43, 108, 181;
    --tblr-link-color: #8FB5DD; --tblr-link-color-rgb: 143, 181, 221;
    --tblr-link-hover-color: #C3D7EC; --tblr-link-hover-color-rgb: 195, 215, 236;
    --tblr-success: #4FBF8B; --tblr-success-rgb: 79, 191, 139;
}
:root { --tblr-primary-lt: #E3EDF7; --tblr-primary-lt-rgb: 227, 237, 247; --tblr-success-lt: #DDF3E8; --tblr-success-lt-rgb: 221, 243, 232; }
html[data-bs-theme="dark"] { --tblr-primary-lt: rgba(43, 108, 181, .22); --tblr-success-lt: rgba(79, 191, 139, .18); }
.form-control:focus, .form-select:focus { border-color: #2B6CB5; box-shadow: 0 0 0 .2rem rgba(14, 79, 147, .18); }
.form-check-input:checked { background-color: var(--tblr-primary); border-color: var(--tblr-primary); }

/* primary button: dark navy with a subtle top highlight */
.btn-primary {
    background-image: linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,0));
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(15,27,69,.25), inset 0 1px 0 rgba(255,255,255,.15);
}

/* `.small`/`<small>` are 0.875em of their parent everywhere in Bootstrap/Tabler — on top of the
   larger body size that's still fine for genuine fine print, but this app uses "small" for a lot
   of things that are actually primary content (KPI labels, table cells, card meta) and it was
   reading as too tiny. Nudge the floor up a bit without losing the size *relationship* to
   surrounding text. */
small, .small {
    font-size: .8125rem;
}

html:not([data-bs-theme="dark"]) body {
    background-color: #F3F6FA;
}

/* Cards: soft diffused shadow + generous radius instead of a hairline border,
   matching Aurora's elevated-surface look. Both .card and the .shadow-sm
   utility (used all over the existing templates) get it, so this alone
   reskins every card on every page. */
.card {
    border-radius: 8px;
    box-shadow: var(--aurora-card-shadow);
    border: 0;
}
.shadow-sm {
    box-shadow: var(--aurora-card-shadow) !important;
}
.card-header, .card-footer {
    border-color: var(--aurora-divider);
    background: transparent;
}
.modal-content {
    border-radius: 8px;
    box-shadow: var(--aurora-card-shadow);
}

.btn {
    font-weight: 600;
}

/* ---------------------------------------------------------------------------------------------
   App shell. The sidebar and top bar are styled with Tailwind utilities (tw- prefix, see layout.html);
   these few hooks only neutralise Tabler's own navbar colours and keep its mobile collapse working.
   --------------------------------------------------------------------------------------------- */
/* Dark navy rail (always dark, like a trading terminal) + a white top bar with a hairline; the workspace stays light. */
.app-sidebar {
    background: linear-gradient(180deg, #032C54 0%, #021F3C 100%) !important;
    border: 0 !important;
    box-shadow: none !important;
}
.app-sidebar .navbar-toggler { color: #fff; border-color: rgba(255,255,255,.25); }
.app-sidebar .navbar-toggler-icon {
    filter: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255,255,255,.9%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}
.app-topbar {
    background: #fff;
    border-bottom: 1px solid #E4E8F0;
}
html[data-bs-theme="dark"] .app-topbar {
    background: var(--tblr-bg-surface);
    border-bottom-color: rgba(255,255,255,.08);
}
/* wider, roomier sidebar on desktop (>= Tabler's lg breakpoint); the page shifts by the same amount */
@media (min-width: 992px) {
    .navbar-vertical.navbar-expand-lg.app-sidebar { width: 15rem; }
    .navbar-vertical.navbar-expand-lg.app-sidebar ~ .page-wrapper { margin-left: 15rem; }
}
.app-sidebar .container-fluid { align-items: stretch; }
.app-sidebar .navbar-collapse { flex-direction: column; flex-wrap: nowrap; }
/* let the sticky top bar's blur read against the page, and keep dropdown menus above it */
.dropdown-menu { z-index: 1050; }

/* Theme toggle button in the top bar */
#themeToggle {
    cursor: pointer;
}

/* Icon badge used for KPI stat rows (Aurora-style: a big tinted rounded square
   with the icon in the matching solid color). Pass a bg-*-lt-ish inline style
   or one of the helper classes below. */
.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}
.stat-icon-primary { background: var(--aurora-primary-lt); color: var(--tblr-primary); }
.stat-icon-success { background: var(--aurora-success-lt); color: var(--tblr-success); }
.stat-icon-warning { background: var(--aurora-warning-lt); color: var(--tblr-warning); }
.stat-icon-info { background: var(--aurora-info-lt); color: var(--tblr-info); }
.stat-icon-purple { background: var(--aurora-purple-lt); color: var(--aurora-purple); }

/* "Soft" badges — Aurora's Chip variant="soft": a 15%-tint background, a 25%-tint border,
   and the color's own darker shade for text, instead of a solid fill with white text.
   Replaces every `badge bg-*` / `badge text-white` combination in the templates. */
.badge-soft {
    border: 1px solid transparent;
    border-radius: 6px;
    font-weight: 600;
}
.badge-soft-primary { background: rgba(8, 61, 115, .15); border-color: rgba(8, 61, 115, .25); color: var(--aurora-primary-dark); }
.badge-soft-secondary { background: rgba(166, 65, 250, .15); border-color: rgba(166, 65, 250, .25); color: var(--aurora-secondary-dark); }
.badge-soft-success { background: rgba(47, 158, 111, .15); border-color: rgba(47, 158, 111, .25); color: var(--aurora-success-dark); }
.badge-soft-warning { background: rgba(246, 141, 42, .15); border-color: rgba(246, 141, 42, .25); color: var(--aurora-warning-dark); }
.badge-soft-danger { background: rgba(208, 34, 65, .15); border-color: rgba(208, 34, 65, .25); color: var(--aurora-danger-dark); }
.badge-soft-info { background: rgba(13, 166, 214, .15); border-color: rgba(13, 166, 214, .25); color: var(--aurora-info-dark); }
.badge-soft-neutral { background: #EBF2F5; border-color: #DBE6EB; color: var(--aurora-neutral-dark); }
html[data-bs-theme="dark"] .badge-soft-neutral { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.12); color: #DBE6EB; }

/* Tables: Tabler's `table-light` thead is a solid grey band with thin hard borders — it reads
   like a plain spreadsheet next to the new soft/rounded card look. Aurora's own tables instead
   use no header fill at all, small uppercase muted labels, soft dividers between rows, and more
   breathing room per cell. Applies to every table site-wide (all still just `<table class="table">`
   markup, nothing structural changed in the templates). */
.table {
    --tblr-table-bg: transparent;
    font-size: .9375rem;
}
.table > :not(caption) > * > * {
    padding: .85rem 1rem;
    border-bottom-color: var(--aurora-divider);
}
.table thead th, .table thead.table-light, .table > thead {
    background: transparent !important;
    border-bottom: 1px solid var(--aurora-divider) !important;
}
.table thead th {
    color: #77878F;
    text-transform: uppercase;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
    padding-top: .5rem;
    padding-bottom: .5rem;
}
.table-sm > :not(caption) > * > * {
    padding: .6rem .85rem;
}
.table-hover > tbody > tr:hover > * {
    background-color: var(--aurora-primary-lt);
}

/* "Soft" buttons — Aurora's Button variant="soft": same tint-background pattern, 20% on hover. */
.btn-soft-primary { background: rgba(8, 61, 115, .15); color: var(--aurora-primary-dark); border: 0; }
.btn-soft-primary:hover { background: rgba(8, 61, 115, .2); color: var(--aurora-primary-dark); }
.btn-soft-danger { background: rgba(208, 34, 65, .15); color: var(--aurora-danger-dark); border: 0; }
.btn-soft-danger:hover { background: rgba(208, 34, 65, .2); color: var(--aurora-danger-dark); }
.btn-soft-secondary { background: rgba(119, 135, 143, .12); color: #4D595E; border: 0; }
.btn-soft-secondary:hover { background: rgba(119, 135, 143, .18); color: #4D595E; }

/* Wide tables (e.g. the positions table, 12 columns) get tighter side padding and wrapping headers
   (Tabler forces nowrap on <th>) so they fit their card instead of scrolling sideways. */
.table-compact > :not(caption) > * > * {
    padding-left: .5rem;
    padding-right: .5rem;
}
.table-compact thead th {
    white-space: normal;
}

/* Portfolio page tabs (Overview, Holdings, …): Aurora-style underline tabs that scroll sideways on narrow screens. */
.portfolio-tabs {
    border-bottom: 1px solid var(--aurora-divider);
    scrollbar-width: none;
}
.portfolio-tabs::-webkit-scrollbar { display: none; }
.portfolio-tabs .nav-link {
    color: #77878F;
    font-weight: 600;
    white-space: nowrap;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    padding: .75rem 1rem;
}
.portfolio-tabs .nav-link:hover { color: var(--tblr-primary); }
.portfolio-tabs .nav-link.active {
    color: var(--tblr-primary);
    border-bottom-color: var(--tblr-primary);
    background: transparent;
}


/* ---------------------------------------------------------------------------------------------
   "Pro terminal" skin (inspired by Trading 212 / IBKR Client Portal / XTB): Inter with tabular figures, flat
   hairline-bordered panels instead of big soft shadows, tighter radii, denser tables with small
   uppercase column labels. Overrides the earlier Aurora-style rules above.
   --------------------------------------------------------------------------------------------- */
:root {
    --pro-line: #E4E8F0;
    --pro-card-shadow: 0 1px 2px rgba(16, 24, 40, .04);
    --aurora-card-shadow: var(--pro-card-shadow);
    --aurora-divider: #EDF0F5;
}
body {
    font-variant-numeric: tabular-nums;
    -webkit-font-smoothing: antialiased;
    --tblr-body-font-size: .9375rem;
}
html:not([data-bs-theme="dark"]) body { background-color: #F3F6FA; }
.card {
    border: 1px solid var(--pro-line);
    border-radius: 10px;
    box-shadow: var(--pro-card-shadow);
}
html[data-bs-theme="dark"] .card { border-color: rgba(255,255,255,.08); }
.shadow-sm { box-shadow: var(--pro-card-shadow) !important; }
.card-header { padding: .75rem 1rem; }
.card-title { font-size: .9375rem; font-weight: 600; letter-spacing: -.01em; }
.modal-content { border-radius: 12px; border: 1px solid var(--pro-line); }
.btn { border-radius: 8px; font-weight: 600; }
.table { font-size: .875rem; }
.table > :not(caption) > * > * { padding: .6rem .85rem; }
.table thead th {
    font-size: .6875rem;
    letter-spacing: .06em;
    color: #8590A3;
}
.table-hover > tbody > tr:hover > * { background-color: #F6F8FC; }
.stat-icon { width: 40px; height: 40px; border-radius: 10px; font-size: 1.1rem; }
.page-body { margin-top: 1.25rem; }
/* figures that carry a sign read as data, not decoration */
.text-success { color: #0E9F6E !important; }
.text-danger { color: #E02D3C !important; }

/* Account-summary panel: headline value + P&L chip, then a divided strip of supporting numbers. */
.summary-panel { display: flex; flex-direction: row; flex-wrap: wrap; }
.summary-hero { flex: 0 0 310px; padding: 1.25rem 1.5rem; border-right: 1px solid var(--pro-line); }
.summary-stats { flex: 1 1 520px; display: grid; grid-template-columns: repeat(3, 1fr); }
.summary-stat { padding: 1rem 1.25rem; border-bottom: 1px solid var(--pro-line); border-right: 1px solid var(--pro-line); }
.summary-stat:nth-child(3n) { border-right: 0; }
.summary-stat:nth-last-child(-n+3) { border-bottom: 0; }
.summary-label { font-size: .6875rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #8590A3; }
.summary-value { font-size: 2rem; font-weight: 700; letter-spacing: -.03em; line-height: 1.15; margin: .25rem 0 .6rem; color: var(--tblr-heading-color); }
.summary-num { font-size: 1.125rem; font-weight: 600; letter-spacing: -.01em; margin-top: .15rem; }
.summary-sub { font-size: .75rem; color: #8590A3; }
.pl-chip { white-space: nowrap; display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .55rem; border-radius: 6px; font-size: .8125rem; font-weight: 600; }
.pl-chip-pos { background: rgba(14, 159, 110, .12); color: #0A7A54; }
.pl-chip-neg { background: rgba(224, 45, 60, .1); color: #B4232F; }
.pl-chip-note { font-weight: 500; opacity: .75; }
html[data-bs-theme="dark"] .summary-hero, html[data-bs-theme="dark"] .summary-stat { border-color: rgba(255,255,255,.08); }
html[data-bs-theme="dark"] .summary-value { color: #fff; }
@media (max-width: 767px) {
    .summary-hero { flex-basis: 100%; border-right: 0; border-bottom: 1px solid var(--pro-line); }
    .summary-stats { grid-template-columns: repeat(2, 1fr); }
    .summary-stat:nth-child(3n) { border-right: 1px solid var(--pro-line); }
    .summary-stat:nth-child(2n) { border-right: 0; }
    .summary-stat:nth-last-child(-n+3) { border-bottom: 1px solid var(--pro-line); }
    .summary-stat:nth-last-child(-n+2) { border-bottom: 0; }
}

/* Sortable table headers (click to sort, arrow shows direction) */
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable::after { content: "\F283"; font-family: "bootstrap-icons"; font-size: .6rem; margin-left: .3rem; opacity: 0; }
th.sortable:hover::after { opacity: .45; }
th.sortable.sorted-asc::after { content: "\F235"; opacity: 1; color: var(--tblr-primary); }
th.sortable.sorted-desc::after { content: "\F229"; opacity: 1; color: var(--tblr-primary); }
th.sortable.sorted-asc, th.sortable.sorted-desc { color: var(--tblr-primary); }

/* Full-screen "working" overlay shown while a long form (import) is being processed */
.page-loading {
    position: fixed; inset: 0; z-index: 3000;
    display: none; align-items: center; justify-content: center;
    background: rgba(15, 27, 69, .55); backdrop-filter: blur(2px);
}
.page-loading.show { display: flex; }
.page-loading-card {
    background: #fff; border-radius: 12px; padding: 1.75rem 2rem; max-width: 22rem; text-align: center;
    box-shadow: 0 20px 40px rgba(15, 27, 69, .25);
}
html[data-bs-theme="dark"] .page-loading-card { background: var(--tblr-bg-surface); }
.page-loading-card .spinner-border { width: 2.5rem; height: 2.5rem; border-width: .25rem; }
.page-loading-title { margin-top: 1rem; font-weight: 600; font-size: 1rem; }
.page-loading-note { margin-top: .35rem; font-size: .8125rem; color: #8590A3; }


/* ---------------------------------------------------------------------------------------------
   Sign-in and account pages: a navy brand panel on the left (desktop only), the form on the right.
   --------------------------------------------------------------------------------------------- */
.auth-split { display: grid; grid-template-columns: minmax(420px, 46%) 1fr; min-height: 100vh; }
.auth-aside {
    position: relative; overflow: hidden; color: #fff;
    background:
        radial-gradient(circle at 85% 8%, rgba(60, 165, 117, .30), rgba(60, 165, 117, 0) 42%),
        linear-gradient(160deg, #043561 0%, #032C54 45%, #021F3C 100%);
    display: flex; flex-direction: column; padding: 2.75rem 3.5rem;
}
.auth-aside-logo { display: inline-block; align-self: flex-start; position: relative; z-index: 1; }
.auth-aside-logo img { height: 44px; width: auto; display: block; }
.auth-aside-body { margin: auto 0; max-width: 28rem; position: relative; z-index: 1; padding: 3rem 0; }
.auth-aside-title { color: #fff; font-size: 2.35rem; line-height: 1.15; font-weight: 700; letter-spacing: -.03em; margin: 0 0 1rem; }
.auth-aside-lead { color: rgba(255, 255, 255, .72); font-size: 1.05rem; margin: 0 0 2.25rem; }
.auth-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1.35rem; }
.auth-points li { display: flex; gap: 1rem; align-items: flex-start; }
.auth-points i {
    flex: 0 0 auto; width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
    background: rgba(60, 165, 117, .18); color: #86CFAB; font-size: 1.15rem;
}
.auth-points strong { display: block; color: #fff; font-weight: 600; }
.auth-points span { display: block; color: rgba(255, 255, 255, .62); font-size: .9rem; line-height: 1.45; margin-top: .1rem; }
.auth-aside-mark {                        /* the logo's mark as a large, barely-there watermark */
    position: absolute; right: -90px; bottom: -70px; width: 420px; opacity: .06; filter: brightness(0) invert(1); pointer-events: none;
}

.auth-main { display: flex; align-items: center; justify-content: center; padding: 2.5rem 1.5rem; background: var(--tblr-bg-surface, #fff); }
.auth-panel { width: 100%; max-width: 400px; }
.auth-mobile-logo { display: none; margin-bottom: 2rem; }
.auth-mobile-logo img { height: 36px; width: auto; }
.auth-title { font-size: 1.65rem; font-weight: 700; letter-spacing: -.02em; margin: 0 0 .35rem; color: var(--tblr-heading-color); }
.auth-sub { color: var(--tblr-secondary-color, #6c7a91); margin: 0 0 1.75rem; }
.auth-title:not(:has(+ .auth-sub)) { margin-bottom: 1.75rem; }
.auth-form .form-label { font-weight: 600; font-size: .875rem; }
.auth-form .form-control { height: 46px; border-radius: 8px; }
.auth-submit { height: 46px; display: flex; align-items: center; justify-content: center; font-size: 1rem; }
.auth-foot { text-align: center; margin: 1.5rem 0 0; font-size: .9rem; color: var(--tblr-secondary-color, #6c7a91); }
.auth-message { text-align: center; margin-bottom: 1.5rem; }
.auth-message i { font-size: 2.5rem; }
.auth-message p { color: var(--tblr-secondary-color, #6c7a91); margin: .75rem 0 0; }

@media (max-width: 991.98px) {
    .auth-split { display: block; }
    .auth-aside { display: none; }
    .auth-main { min-height: 100vh; align-items: flex-start; padding-top: 3rem; }
    .auth-mobile-logo { display: inline-block; }
}
html[data-bs-theme="dark"] .auth-mobile-logo img { filter: brightness(0) invert(1); }


/* ---------------------------------------------------------------------------------------------
   Page rhythm: titles, card headings and tabs, in the brand's navy with the green as the one accent.
   --------------------------------------------------------------------------------------------- */
.page-body h1.h4 { font-size: 1.6rem; font-weight: 700; letter-spacing: -.025em; color: var(--tblr-heading-color); }
.page-body h1.h4 + p.small, .page-body h1.h4 ~ .text-muted.small { font-size: .9rem; }
.card h2.h6, .card h5.card-title, .card .card-title { font-size: 1rem; font-weight: 600; color: var(--tblr-heading-color); }
html[data-bs-theme="dark"] .card h2.h6, html[data-bs-theme="dark"] .card .card-title, html[data-bs-theme="dark"] .page-body h1.h4 { color: #fff; }
.portfolio-tabs .nav-link.active, .nav-tabs .nav-link.active { border-bottom-color: #3CA575 !important; color: var(--tblr-heading-color); }
html[data-bs-theme="dark"] .portfolio-tabs .nav-link.active { color: #fff; }
.portfolio-tabs .nav-link:hover { color: var(--tblr-heading-color); }
.btn-outline-secondary { --tblr-btn-border-color: #C9D3E0; --tblr-btn-color: #284060; }
.btn-outline-secondary:hover { background: #F2F6FB; color: #032C54; border-color: #AEBCCF; }
table thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: #6B7A90; font-weight: 600; }
.badge-soft-primary { color: #083D73; }


/* ---------------------------------------------------------------------------------------------
   Dark theme in the brand's navy: page, cards and top bar share one hue; the sidebar is the deepest layer.
   --------------------------------------------------------------------------------------------- */
html[data-bs-theme="dark"] {
    --tblr-body-bg: #0B1626;
    --tblr-bg-surface: #112036;
    --tblr-bg-surface-secondary: #0E1B2E;
    --tblr-bg-surface-tertiary: #0B1626;
    --tblr-border-color: rgba(255, 255, 255, .09);
    --tblr-border-color-translucent: rgba(255, 255, 255, .09);
    --tblr-body-color: #D3DDEA;
    --tblr-secondary-color: #8C9BB0;
    --tblr-heading-color: #fff;
    --aurora-divider: rgba(255, 255, 255, .08);
    --aurora-card-shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px rgba(0, 0, 0, .18);
}
html[data-bs-theme="dark"] body { background-color: #0B1626; }
html[data-bs-theme="dark"] .app-sidebar {
    background: linear-gradient(180deg, #08172B 0%, #060F1D 100%) !important;
    border-right: 1px solid rgba(255, 255, 255, .06) !important;
}
html[data-bs-theme="dark"] .app-topbar { background: #0E1B2E; border-bottom-color: rgba(255, 255, 255, .07); }
html[data-bs-theme="dark"] .card { background-color: var(--tblr-bg-surface); }
html[data-bs-theme="dark"] .form-control, html[data-bs-theme="dark"] .form-select {
    background-color: #0E1B2E; border-color: rgba(255, 255, 255, .12); color: #E4EBF4;
}
html[data-bs-theme="dark"] .dropdown-menu { background-color: #112036; border-color: rgba(255, 255, 255, .1); }
html[data-bs-theme="dark"] .btn-outline-secondary { --tblr-btn-color: #C3D0E0; --tblr-btn-border-color: rgba(255, 255, 255, .2); }
html[data-bs-theme="dark"] .btn-outline-secondary:hover { background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .3); }
html[data-bs-theme="dark"] table thead th { color: #8C9BB0; }
html[data-bs-theme="dark"] .auth-main { background: #0B1626; }

/* soft badges and buttons carry dark text on a tint; on the dark theme the text has to be light */
html[data-bs-theme="dark"] .btn-soft-primary { background: rgba(90, 146, 203, .24); color: #BBD6F2; }
html[data-bs-theme="dark"] .btn-soft-primary:hover { background: rgba(90, 146, 203, .34); color: #fff; }
html[data-bs-theme="dark"] .btn-soft-danger { color: #F4A3AF; }
html[data-bs-theme="dark"] .badge-soft-primary { background: rgba(90, 146, 203, .22); border-color: rgba(90, 146, 203, .35); color: #BBD6F2; }
html[data-bs-theme="dark"] .badge-soft-success { background: rgba(79, 191, 139, .18); border-color: rgba(79, 191, 139, .3); color: #8EDDB6; }
html[data-bs-theme="dark"] .badge-soft-warning { color: #F7C58F; }
html[data-bs-theme="dark"] .badge-soft-danger { color: #F4A3AF; }
html[data-bs-theme="dark"] .badge-soft-info { color: #8FD6EE; }
html[data-bs-theme="dark"] .badge-soft-secondary { color: #CDB5F8; }
html[data-bs-theme="dark"] .stat-icon-primary { color: #8FB5DD; }

/* ---- error pages ---- */
.error-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 2rem 1rem; }
.error-logo img { height: 38px; width: auto; margin-bottom: 2.5rem; }
html[data-bs-theme="dark"] .error-logo img { filter: brightness(0) invert(1); }
.error-code { font-size: 6.5rem; font-weight: 800; line-height: 1; letter-spacing: -.05em;
    background: linear-gradient(135deg, #083D73 20%, #3CA575 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.error-title { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; margin: 1rem 0 .4rem; color: var(--tblr-heading-color); }
.error-text { color: var(--tblr-secondary-color, #6c7a91); margin: 0 0 1.75rem; }
.error-actions { display: flex; gap: .75rem; flex-wrap: wrap; justify-content: center; }
html[data-bs-theme="dark"] .error-code { background-image: linear-gradient(135deg, #5A92CB 20%, #5DBB90 100%); }


/* ---------------------------------------------------------------------------------------------
   Income calendar (portfolio tab)
   --------------------------------------------------------------------------------------------- */
.cal-legend { display: flex; gap: 1rem; align-items: center; }
.cal-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .35rem; vertical-align: baseline; }
.cal-dot.cal-received { background: #3CA575; }
.cal-dot.cal-declared { background: #083D73; }
.cal-dot.cal-estimated { background: transparent; border: 1.5px dashed #5A92CB; }

.cal-months { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: .4rem; }
.cal-month { border: 1px solid var(--tblr-border-color); background: var(--tblr-bg-surface); border-radius: 10px; padding: .5rem .25rem;
    display: flex; flex-direction: column; align-items: center; gap: .1rem; cursor: pointer; color: var(--tblr-body-color); transition: background .12s, border-color .12s; }
.cal-month:hover { border-color: #5A92CB; }
.cal-month-name { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--tblr-secondary-color, #6c7a91); }
.cal-month-total { font-size: .9rem; font-weight: 700; }
.cal-month.past .cal-month-total { color: #2F8F63; }
.cal-month.now { border-color: #3CA575; }
.cal-month.active { background: #083D73; border-color: #083D73; }
.cal-month.active .cal-month-name { color: rgba(255, 255, 255, .7); }
.cal-month.active .cal-month-total { color: #fff; }
html[data-bs-theme="dark"] .cal-month.active { background: #2B6CB5; border-color: #2B6CB5; }
html[data-bs-theme="dark"] .cal-month.past .cal-month-total { color: #7FD1A8; }

.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--tblr-border-color); border-left: 1px solid var(--tblr-border-color); }
.cal-dow { padding: .4rem .5rem; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--tblr-secondary-color, #6c7a91);
    border-right: 1px solid var(--tblr-border-color); border-bottom: 1px solid var(--tblr-border-color); background: var(--tblr-bg-surface-secondary, #f6f8fb); }
.cal-day { min-height: 92px; padding: .3rem .35rem; border-right: 1px solid var(--tblr-border-color); border-bottom: 1px solid var(--tblr-border-color);
    display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.cal-day.out { background: var(--tblr-bg-surface-secondary, #f6f8fb); opacity: .55; }
.cal-num { font-size: .8rem; font-weight: 600; color: var(--tblr-secondary-color, #6c7a91); }
.cal-day.today .cal-num { display: inline-flex; width: 22px; height: 22px; align-items: center; justify-content: center; border-radius: 50%; background: #3CA575; color: #fff; }
.cal-pill { display: flex; justify-content: space-between; gap: .35rem; padding: .12rem .4rem; border-radius: 6px; font-size: .72rem; font-weight: 600;
    text-decoration: none; line-height: 1.35; overflow: hidden; white-space: nowrap; }
.cal-pill-ticker { overflow: hidden; text-overflow: ellipsis; }
.cal-pill-amt { flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.cal-pill.cal-received { background: rgba(60, 165, 117, .16); color: #1F7A52; }
.cal-pill.cal-declared { background: #083D73; color: #fff; }
.cal-pill.cal-estimated { background: transparent; border: 1.5px dashed #5A92CB; color: #0E4F93; }
.cal-more { font-size: .7rem; color: var(--tblr-secondary-color, #6c7a91); padding-left: .2rem; }
html[data-bs-theme="dark"] .cal-pill.cal-received { background: rgba(79, 191, 139, .18); color: #8EDDB6; }
html[data-bs-theme="dark"] .cal-pill.cal-declared { background: #2B6CB5; }
html[data-bs-theme="dark"] .cal-pill.cal-estimated { color: #8FB5DD; border-color: #5A92CB; }

@media (max-width: 991.98px) {
    .cal-months { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
    .cal-grid { display: none; }                                  /* the list below carries the same information on a phone */
    .cal-months { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}


/* ---------------------------------------------------------------------------------------------
   Projections (portfolio tab)
   --------------------------------------------------------------------------------------------- */
.proj .btn-outline-primary { --tblr-btn-color: #0E4F93; --tblr-btn-border-color: #C9D3E0; font-weight: 600; }
.proj .btn-outline-primary.active, .proj .btn-outline-primary:hover { background: #083D73; border-color: #083D73; color: #fff; }
.proj .btn-outline-secondary.active { background: #083D73; border-color: #083D73; color: #fff; }
.proj .form-text { font-size: .78rem; }
.proj-controls .form-label { font-weight: 600; font-size: .85rem; }
.proj-goal-card { border-left: 4px solid #F2A33A !important; }
.proj-progress { border-radius: 8px; background: var(--tblr-bg-surface-secondary, #eef2f7); }
.proj-progress-future { background: repeating-linear-gradient(45deg, #5A92CB, #5A92CB 6px, #8FB5DD 6px, #8FB5DD 12px); }
.proj-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .35rem; vertical-align: baseline; }
.proj-contrib + .proj-contrib { margin-top: .75rem; }
html[data-bs-theme="dark"] .proj .btn-outline-primary { --tblr-btn-color: #8FB5DD; --tblr-btn-border-color: rgba(255,255,255,.18); }
html[data-bs-theme="dark"] .proj .btn-outline-primary.active, html[data-bs-theme="dark"] .proj .btn-outline-secondary.active { background: #2B6CB5; border-color: #2B6CB5; color: #fff; }


/* ---------------------------------------------------------------------------------------------
   Onboarding: the welcome page and the "Getting started" card
   --------------------------------------------------------------------------------------------- */
.onb-hero { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; padding: 1.75rem 2rem; margin-bottom: 1.25rem; border-radius: 14px; color: #fff;
    background: radial-gradient(circle at 92% 0%, rgba(60, 165, 117, .35), rgba(60, 165, 117, 0) 45%), linear-gradient(135deg, #043561, #021F3C); }
.onb-hero h1 { color: #fff; }
.onb-hero-sub { color: rgba(255, 255, 255, .75); max-width: 36rem; }
.onb-progress { text-align: center; padding-left: 1.5rem; border-left: 1px solid rgba(255, 255, 255, .2); }
.onb-progress-num { font-size: 2.1rem; font-weight: 700; line-height: 1; }
.onb-progress-num small { font-size: .9rem; font-weight: 500; color: rgba(255, 255, 255, .7); }
.onb-step { background: var(--tblr-bg-surface); border-radius: 12px; padding: 1.35rem 1.5rem; margin-bottom: 1rem; box-shadow: var(--aurora-card-shadow); }
.onb-step.locked { opacity: .65; }
.onb-step-head { display: flex; gap: 1rem; align-items: center; }
.onb-badge { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700;
    background: var(--tblr-primary-lt, #E3EDF7); color: var(--tblr-primary); }
.onb-step.done .onb-badge { background: #3CA575; color: #fff; }
.onb-tile { display: flex; flex-direction: column; gap: .35rem; height: 100%; padding: 1.1rem 1.2rem; border-radius: 12px; text-decoration: none; cursor: pointer;
    border: 1px solid var(--tblr-border-color); background: var(--tblr-bg-surface); color: var(--tblr-body-color); transition: border-color .12s, box-shadow .12s, transform .12s; }
.onb-tile:hover { border-color: #5A92CB; box-shadow: 0 6px 18px rgba(8, 61, 115, .12); transform: translateY(-1px); color: var(--tblr-body-color); }
.onb-tile > i { font-size: 1.6rem; color: #0E4F93; }
.onb-tile strong { font-size: 1rem; color: var(--tblr-heading-color); }
.onb-tile span { font-size: .85rem; color: var(--tblr-secondary-color, #6c7a91); flex: 1; }
.onb-tile em { font-style: normal; font-weight: 600; font-size: .85rem; color: #0E4F93; }
.onb-chip { display: inline-flex; align-items: center; padding: .25rem .7rem; border-radius: 999px; font-size: .8rem; font-weight: 600; cursor: pointer;
    border: 1px solid var(--tblr-border-color); background: var(--tblr-bg-surface); color: var(--tblr-body-color); }
button.onb-chip:hover { border-color: #3CA575; color: #2F8F63; }
.onb-chip.followed { background: rgba(60, 165, 117, .14); border-color: transparent; color: #1F7A52; cursor: default; }
.onb-card { border-left: 4px solid #3CA575 !important; }
.onb-list { list-style: none; margin: .5rem 0 0; padding: 0; }
.onb-list li { display: flex; align-items: center; gap: .65rem; padding: .45rem 0; }
.onb-list li + li { border-top: 1px solid var(--tblr-border-color); }
.onb-list li i { font-size: 1.15rem; color: var(--tblr-secondary-color, #98a6b8); }
.onb-list li.done i { color: #3CA575; }
.onb-list li.done span { color: var(--tblr-secondary-color, #6c7a91); text-decoration: line-through; }
html[data-bs-theme="dark"] .onb-tile > i, html[data-bs-theme="dark"] .onb-tile em { color: #8FB5DD; }
html[data-bs-theme="dark"] .onb-chip.followed { color: #8EDDB6; }
@media (max-width: 767.98px) {
    .onb-hero { flex-direction: column; align-items: flex-start; padding: 1.4rem; }
    .onb-progress { border-left: 0; padding-left: 0; text-align: left; }
}

/* ---------------------------------------------------------------------------------------------
   Search in the top bar, the Markets page
   --------------------------------------------------------------------------------------------- */
.app-search { max-width: 420px; }
.app-search .form-control { height: 38px; padding-left: 2.3rem; border-radius: 999px; }
.app-search-icon { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--tblr-secondary-color, #6c7a91); pointer-events: none; z-index: 2; }
/* legal pages: terms, disclaimer, cookies */
.legal { max-width: 52rem; }
.legal-text h2 { font-size: 1.05rem; font-weight: 700; margin: 1.6rem 0 .5rem; }
.legal-text h2:first-child { margin-top: 0; }
.legal-text p, .legal-text li { line-height: 1.6; }
.legal-text ul { padding-left: 1.2rem; }
.app-legal-links a { color: inherit; text-decoration: underline; }
.app-footnote { color: var(--tblr-secondary-color, #6c7a91); font-size: .78rem; max-width: 52rem; padding: 1rem 0 2rem; margin: 0; }
.mk-index.up { --mk: #2F9E6F; }
.mk-index.down { --mk: #D64550; }
.mk-index-level { font-size: 1.75rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.mk-index-change { color: var(--mk); font-variant-numeric: tabular-nums; }
.mk-spark { display: block; width: 100%; height: 44px; margin-top: .6rem; color: var(--mk); }
.mk-row { cursor: pointer; }
.mk-row:hover td { background: var(--tblr-bg-surface-secondary, #f3f6fa); }
.mk-name { max-width: 22rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; }
.mk-invite { border-left: 4px solid #3CA575 !important; }
.pub-invite { border-left: 4px solid #3CA575 !important; }

/* Table footers (the totals row) and "light" header cells: Tabler paints `table-light` near-white, which in the dark theme was a white bar at the bottom of the
   holdings table. The footer is transparent like the rest of the table, with a divider above it; light header cells become a soft tint. */
.table tfoot.table-light, .table > tfoot {
    background: transparent !important;
    --tblr-table-bg: transparent;
    --bs-table-bg: transparent;
    --bs-table-color: inherit;
    border-top: 1px solid var(--aurora-divider);
}
.table tfoot.table-light, .table > tfoot { color: inherit !important; }
.table tfoot.table-light > tr > *, .table > tfoot > tr > * { background-color: transparent !important; color: inherit !important; --tblr-table-color: inherit; --bs-table-color: inherit; }
html[data-bs-theme="dark"] .table th.table-light, html[data-bs-theme="dark"] .table td.table-light {
    --tblr-table-bg: rgba(255, 255, 255, .06);
    --bs-table-bg: rgba(255, 255, 255, .06);
    background-color: rgba(255, 255, 255, .06) !important;
    color: #DBE6EB;
}

/* Feedback button: fixed at the bottom left of the page area (to the right of the sidebar on desktop). */
.feedback-fab {
    position: fixed; z-index: 1040; bottom: 1.25rem; left: 1rem;
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .55rem .9rem; border: 1px solid var(--pro-line, #E4E8F0); border-radius: 999px;
    background: #fff; color: var(--tblr-primary); font-weight: 600; font-size: .875rem;
    box-shadow: 0 4px 14px rgba(16, 24, 40, .12); cursor: pointer;
    transition: box-shadow .15s, transform .15s;
}
.feedback-fab:hover { box-shadow: 0 6px 18px rgba(16, 24, 40, .18); transform: translateY(-1px); }
html[data-bs-theme="dark"] .feedback-fab { background: var(--tblr-bg-surface); border-color: rgba(255,255,255,.12); color: #fff; }
/* On desktop too it is a round button in the bottom right corner, out of the way of tables and forms (as a pill at the bottom left it covered the last row). */
@media (min-width: 992px) {
    .feedback-fab { left: auto; right: 1.25rem; width: 44px; height: 44px; padding: 0; justify-content: center; gap: 0; }
    .feedback-fab span { display: none; }
    .feedback-fab i { font-size: 1.15rem; }
}
@media print { .feedback-fab { display: none; } }
.btn-check:checked + .btn-outline-secondary { background: var(--tblr-primary); border-color: var(--tblr-primary); color: #fff; }

/* the blog: a readable column, with the page title and the article text in the same width */
.blog-post, .blog-list { max-width: 52rem; }
.blog-text { line-height: 1.75; font-size: 1.02rem; }
.blog-text h2 { font-size: 1.35rem; font-weight: 700; margin: 2rem 0 .6rem; letter-spacing: -.01em; }
.blog-text h3 { font-size: 1.1rem; font-weight: 700; margin: 1.5rem 0 .5rem; }
.blog-text h2:first-child, .blog-text h3:first-child { margin-top: 0; }
.blog-text p, .blog-text li { margin-bottom: .75rem; }
.blog-text ul, .blog-text ol { padding-left: 1.3rem; }
.blog-text blockquote { border-left: 3px solid var(--tblr-primary); margin: 1rem 0; padding: .25rem 1rem; color: var(--tblr-secondary-color, #6c7a91); }
.blog-text table { width: 100%; margin: 1rem 0; border-collapse: collapse; font-size: .95rem; }
.blog-text th, .blog-text td { border: 1px solid var(--tblr-border-color, #dce1e7); padding: .45rem .7rem; text-align: left; }
.blog-text th { background: rgba(8, 61, 115, .06); }
.blog-text a { text-decoration: underline; }
.blog-text img { max-width: 100%; height: auto; }
.blog-text code { background: rgba(8, 61, 115, .08); border-radius: 4px; padding: .1rem .3rem; font-size: .92em; }

/* pictures in the blog: a figure with its description as a caption, a cover above the article, a small cover in the list */
.blog-text .blog-figure { display: block; margin: 1.25rem 0; text-align: center; }
.blog-text .blog-figure img { display: block; margin: 0 auto; border-radius: 6px; }
.blog-text .blog-caption { display: block; margin-top: .4rem; font-size: .88rem; color: var(--tblr-secondary-color, #6c7a91); }
.blog-cover img { display: block; width: 100%; height: auto; border-radius: 8px; }
.blog-cover-thumb { display: block; width: 100%; height: 100%; min-height: 9rem; max-height: 13rem; object-fit: cover; }

/* the home page for visitors */
.lp { max-width: 62rem; }
.lp-hero { background: radial-gradient(60% 80% at 8% 0%, rgba(8, 61, 115, .12), transparent 70%), radial-gradient(50% 70% at 100% 10%, rgba(60, 165, 117, .20), transparent 70%), var(--tblr-bg-surface, #fff); border-radius: 1.25rem; }
.lp-title { font-size: clamp(2.1rem, 5vw, 3.4rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.1; margin-bottom: .9rem; }
.lp-lead { font-size: 1.15rem; max-width: 40rem; margin-bottom: 1.4rem; }
.lp-icon { display: inline-flex; align-items: center; justify-content: center; width: 2.6rem; height: 2.6rem; border-radius: .75rem; font-size: 1.3rem; line-height: 1; color: var(--tblr-primary); background: rgba(8, 61, 115, .09); margin-bottom: .8rem; }
.lp-hero { position: relative; overflow: hidden; }
.lp-hero::after { content: ""; position: absolute; right: -6rem; top: -6rem; width: 22rem; height: 22rem; border-radius: 50%; background: radial-gradient(circle, rgba(60, 165, 117, .22), transparent 70%); pointer-events: none; }
.lp-hero .card-body { position: relative; z-index: 1; }

/* a drawn picture of the app (made-up numbers) */
.lp-window { background: var(--tblr-bg-surface, #fff); border: 1px solid var(--tblr-border-color, #dce1e7); border-radius: .9rem; box-shadow: 0 18px 40px -12px rgba(8, 61, 115, .30); overflow: hidden; transform: rotate(1.2deg); }
.lp-window-bar { display: flex; align-items: center; gap: .35rem; padding: .55rem .8rem; background: rgba(8, 61, 115, .06); border-bottom: 1px solid var(--tblr-border-color, #dce1e7); }
.lp-window-bar i { width: .6rem; height: .6rem; border-radius: 50%; background: #cfd6df; }
.lp-window-bar i:nth-child(1) { background: #f0857d; } .lp-window-bar i:nth-child(2) { background: #f2c46d; } .lp-window-bar i:nth-child(3) { background: #7dc79a; }
.lp-window-bar span { margin-left: .6rem; font-size: .72rem; color: var(--tblr-secondary-color, #6c7a91); }
.lp-window-body { padding: 1rem; }
.lp-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-bottom: .9rem; }
.lp-kpi { border: 1px solid var(--tblr-border-color, #dce1e7); border-radius: .6rem; padding: .5rem .6rem; line-height: 1.2; }
.lp-kpi small { display: block; font-size: .64rem; color: var(--tblr-secondary-color, #6c7a91); }
.lp-kpi b { display: block; font-size: 1.1rem; }
.lp-kpi em { font-style: normal; font-size: .64rem; color: var(--tblr-secondary-color, #6c7a91); }
.lp-kpi em.up { color: #2f9e6b; font-weight: 600; }
.lp-mini-bars { display: flex; align-items: flex-end; gap: .3rem; height: 5.5rem; margin-bottom: .9rem; }
.lp-mini-bars i { flex: 1; background: linear-gradient(180deg, #3CA575, rgba(60, 165, 117, .5)); border-radius: 3px 3px 0 0; }
.lp-pay { display: grid; grid-template-columns: .8rem 1fr auto 4rem; align-items: center; gap: .6rem; padding: .4rem 0; border-top: 1px solid var(--tblr-border-color, #dce1e7); font-size: .8rem; }
.lp-pay b { text-align: right; }
.lp-dot { width: .6rem; height: .6rem; border-radius: 50%; background: #083D73; }
.lp-dot-b { background: #3CA575; } .lp-dot-c { background: #e0a43a; }
.lp-window { transform: none; }
.lp-window-wide { max-width: 52rem; margin-left: auto; margin-right: auto; }
.lp-hero-text { max-width: 44rem; }
.lp-kpis-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 575.98px) { .lp-kpis-4 { grid-template-columns: repeat(2, 1fr); } }
.lp-sub { font-size: .75rem; font-weight: 600; color: var(--tblr-secondary-color, #6c7a91); margin-bottom: .5rem; }
.lp-mini-bars-lab { height: 7rem; padding-bottom: 1.2rem; }
.lp-mini-bars-lab i { position: relative; }
.lp-mini-bars-lab s { position: absolute; left: 50%; bottom: -1.2rem; transform: translateX(-50%); font-size: .6rem; text-decoration: none; color: var(--tblr-secondary-color, #6c7a91); font-style: normal; }
.lp-dot-d { background: #d9534f; }
.lp-table { font-size: .82rem; }
.lp-share { display: grid; grid-template-columns: 9rem 1fr 2.5rem; align-items: center; gap: .6rem; padding: .35rem 0; font-size: .82rem; }
.lp-share div { height: .7rem; border-radius: .35rem; background: rgba(8, 61, 115, .08); overflow: hidden; }
.lp-share i { display: block; height: 100%; border-radius: .35rem; background: linear-gradient(90deg, #083D73, #3CA575); }
.lp-share b { text-align: right; }
@media (max-width: 575.98px) { .lp-share { grid-template-columns: 7rem 1fr 2.2rem; } }

/* the strip of short promises under the first screen */
.lp-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: .75rem; }
.lp-strip > div { display: flex; align-items: center; gap: .65rem; padding: .75rem .9rem; border-radius: .75rem; background: var(--tblr-bg-surface, #fff); border: 1px solid var(--tblr-border-color, #dce1e7); font-size: .85rem; line-height: 1.3; }
.lp-strip i { flex: none; font-size: 1.25rem; color: #2f9e6b; }
.lp-brokers { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.lp-brokers b { padding: .3rem .8rem; border-radius: 2rem; background: var(--tblr-bg-surface, #fff); border: 1px solid var(--tblr-border-color, #dce1e7); font-size: .85rem; }
/* section headings */
.lp-head { max-width: 46rem; margin-bottom: 1.5rem; }
.lp-eyebrow { display: inline-block; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #2f9e6b; margin-bottom: .4rem; }
.lp-h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.15; margin: 0 0 .6rem; }
.lp-sublead { color: var(--tblr-secondary-color, #6c7a91); font-size: 1.02rem; margin: 0; }

/* the feature grid */
.lp-bento { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.lp-tile { padding: 1.4rem; border-radius: 1rem; background: var(--tblr-bg-surface, #fff); border: 1px solid var(--tblr-border-color, #dce1e7); transition: transform .15s ease, box-shadow .15s ease; }
.lp-tile:hover { transform: translateY(-2px); box-shadow: 0 12px 28px -14px rgba(8, 61, 115, .35); }
.lp-tile h3 { font-size: 1.05rem; font-weight: 700; margin: 0 0 .4rem; }
.lp-tile p:last-child { margin: 0; color: var(--tblr-secondary-color, #6c7a91); }
.lp-tile-wide { grid-column: span 3; display: grid; grid-template-columns: auto 1fr; column-gap: 1rem; align-items: center; background: linear-gradient(135deg, rgba(8, 61, 115, .06), rgba(60, 165, 117, .10)); }
.lp-tile-wide .lp-icon { grid-row: span 2; margin: 0; width: 3.2rem; height: 3.2rem; font-size: 1.6rem; }
.lp-tile-wide h3 { margin: 0; }
@media (max-width: 991.98px) { .lp-bento { grid-template-columns: repeat(2, 1fr); } .lp-tile-wide { grid-column: span 2; } }
@media (max-width: 575.98px) { .lp-bento { grid-template-columns: 1fr; } .lp-tile-wide { grid-column: span 1; } }

/* the scores: a dark band, the charts are the real test results */
.lp-scores { padding: 2.5rem 1.5rem; border-radius: 1.25rem; color: #fff; background: radial-gradient(120% 90% at 0% 0%, #0b5a6e 0%, #083D73 45%, #061f3d 100%); box-shadow: 0 20px 50px -24px rgba(6, 31, 61, .7); }
.lp-scores .lp-head { margin-left: auto; margin-right: auto; text-align: center; }
.lp-head-light .lp-eyebrow { color: #7be0b0; }
.lp-scores .lp-h2 { color: #fff; }
.lp-head-light .lp-sublead { color: rgba(255, 255, 255, .78); }
.lp-score-card { height: 100%; padding: 1.4rem; border-radius: 1rem; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .14); backdrop-filter: blur(4px); }
.lp-score-card h3 { font-size: 1.2rem; font-weight: 800; color: #fff; margin: 0; }
.lp-score-q { color: #7be0b0; font-weight: 600; font-size: .9rem; }
.lp-score-text { color: rgba(255, 255, 255, .8); font-size: .92rem; margin: .9rem 0 1.1rem; }
.lp-chip { flex: none; padding: .2rem .65rem; border-radius: 2rem; font-size: .72rem; font-weight: 700; background: rgba(123, 224, 176, .18); color: #7be0b0; }
.lp-chip-beta { background: rgba(242, 196, 109, .2); color: #f2c46d; }
.lp-band-title { font-size: .75rem; font-weight: 600; color: rgba(255, 255, 255, .7); margin-bottom: .4rem; }
.lp-band { display: grid; grid-template-columns: 5.2rem 1fr 2.6rem; align-items: center; gap: .6rem; padding: .22rem 0; font-size: .82rem; }
.lp-band div { height: .8rem; border-radius: .4rem; background: rgba(255, 255, 255, .1); overflow: hidden; }
.lp-band i { display: block; height: 100%; border-radius: .4rem; min-width: .25rem; }
.lp-band .b1 { background: #3CA575; } .lp-band .b2 { background: #7bc47f; } .lp-band .b3 { background: #e5c453; } .lp-band .b4 { background: #ee9b4a; } .lp-band .b5 { background: #e5645c; }
.lp-band b { text-align: right; }
.lp-fine { font-size: .74rem; line-height: 1.45; color: rgba(255, 255, 255, .62); margin: .9rem 0 0; }
@media (max-width: 575.98px) { .lp-scores { padding: 1.75rem 1rem; } }
.lp-cta { padding: 2rem; border-radius: 1rem; color: #fff; background: linear-gradient(135deg, #083D73, #0b5a6e 60%, #2f9e6b); box-shadow: 0 10px 30px -12px rgba(8, 61, 115, .5); }
.lp-cta h2 { color: #fff; }
.lp-cta-sub { color: rgba(255, 255, 255, .85); }
.lp-step { display: flex; gap: .85rem; align-items: flex-start; }
.lp-step-n { flex: none; width: 2rem; height: 2rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--tblr-primary); color: #fff; font-weight: 700; }
.lp-bars { display: flex; align-items: flex-end; gap: .45rem; height: 11rem; padding-bottom: 1.4rem; }
.lp-bar { position: relative; flex: 1; background: linear-gradient(180deg, #3CA575, rgba(60, 165, 117, .55)); border-radius: 4px 4px 0 0; min-height: .5rem; }
.lp-bar span { position: absolute; left: 50%; bottom: -1.4rem; transform: translateX(-50%); font-size: .7rem; color: var(--tblr-secondary-color, #6c7a91); }
.lp-faq details { border-bottom: 1px solid var(--tblr-border-color, #dce1e7); padding: .75rem 0; }
.lp-faq details:last-child { border-bottom: 0; }
.lp-faq summary { cursor: pointer; font-weight: 600; }
.lp-faq p { margin: .6rem 0 0; color: var(--tblr-secondary-color, #6c7a91); }

/* the choice about statistics cookies: a bar at the bottom, both answers equally easy */
.consent-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1080; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.25rem;
    padding: .9rem 1.25rem; background: var(--tblr-bg-surface, #fff); border-top: 1px solid var(--tblr-border-color, #dce1e7); box-shadow: 0 -4px 18px rgba(3, 44, 84, .12); }
.consent-bar[hidden] { display: none; }
.consent-text { flex: 1 1 28rem; font-size: .9rem; line-height: 1.45; }
.consent-text strong { display: block; margin-bottom: .1rem; }
.consent-actions { display: flex; gap: .5rem; }
@media (min-width: 992px) { .consent-bar { left: 15rem; } }

/* the free calculators */
.tool-page { max-width: 62rem; }
.tool-card { transition: transform .12s ease, box-shadow .12s ease; }
.tool-card:hover { transform: translateY(-2px); box-shadow: 0 .5rem 1.2rem rgba(3, 44, 84, .12) !important; }
.tool-stat { height: 100%; padding: .9rem 1rem; border-radius: .6rem; background: var(--tblr-bg-surface, #fff); box-shadow: 0 1px 3px rgba(3, 44, 84, .1); }
.tool-stat-label { font-size: .8rem; color: var(--tblr-secondary-color, #6c7a91); }
.tool-stat-value { font-size: 1.45rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.25; margin: .15rem 0; }
.tool-stat-note { font-size: .75rem; color: var(--tblr-secondary-color, #6c7a91); }
.tool-table th, .tool-table td { white-space: nowrap; }

/* ---- Portfolio list: one card per portfolio, the value first, the figures in a grid that follows the width ---- */
.min-w-0 { min-width: 0; }
.pf-label { font-size: .7rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--tblr-secondary, #667085); line-height: 1.2; }
.pf-big { font-size: 1.75rem; font-weight: 700; line-height: 1.15; letter-spacing: -.01em; color: var(--tblr-body-color); }
.pf-num { font-size: 1rem; font-weight: 600; line-height: 1.3; white-space: nowrap; }
.pf-name { font-size: 1.05rem; font-weight: 600; line-height: 1.3; }
.pf-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem 1rem; padding-top: .9rem; border-top: 1px solid var(--pro-line, #E4E8F0); }
@media (max-width: 575.98px) { .pf-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pf-big { font-size: 1.6rem; } }
.pf-card { transition: box-shadow .15s, transform .15s; }
.pf-card:hover { box-shadow: 0 6px 18px rgba(16, 24, 40, .12) !important; transform: translateY(-1px); }
.pf-actions { position: relative; z-index: 2; }                       /* above the stretched card link */
.pf-actions .btn { min-width: 40px; min-height: 40px; }
html[data-bs-theme="dark"] .pf-stats { border-top-color: rgba(255, 255, 255, .1); }

/* ---- Phones ---- */
@media (max-width: 767.98px) {
    /* the feedback button: a small round one in the corner, so it never covers a card or a table */
    .feedback-fab { left: auto; right: .75rem; bottom: .75rem; width: 44px; height: 44px; padding: 0; justify-content: center; gap: 0; }
    .feedback-fab span { display: none; }
    .feedback-fab i { font-size: 1.15rem; }
    .page-body { padding-bottom: 4.5rem; }
    /* tabs that scroll sideways show that there is more: the right edge fades */
    .portfolio-tabs { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); scrollbar-width: none; }
    .portfolio-tabs::-webkit-scrollbar { display: none; }
    .portfolio-tabs .nav-link { padding-left: .9rem; padding-right: .9rem; white-space: nowrap; }
    /* a row of a table you can press is tall enough to press */
    #holdingsTable td, #holdingsTable th { padding-top: .65rem; padding-bottom: .65rem; }
}
@media (max-width: 767.98px) {
    /* the header of the holdings card: the title and the buttons on one line, the search box on its own line */
    #pane-holdings > .card:first-of-type > .card-header { flex-wrap: wrap; gap: .5rem; }
    #pane-holdings > .card:first-of-type > .card-header > .d-flex { flex-wrap: wrap; width: 100%; }
    #pane-holdings .holdings-search { flex: 1 1 100%; order: -1; }
    #pane-holdings .holdings-search input { width: 100% !important; }
}
@media (max-width: 575.98px) { #holdingsTable .text-truncate { max-width: 92px !important; } }

/* ---- Phones, round 2: things you press, tabs, the top of the page ---- */
@media (max-width: 767.98px) {
    /* a target you press is at least about 30px high (the badge links, the small buttons, the small selects) */
    a.badge, .badge[href] { padding: .42rem .65rem; font-size: .8rem; }
    .btn-sm { min-height: 36px; padding-top: .35rem; padding-bottom: .35rem; }
    .form-select-sm, .form-control-sm { min-height: 38px; }
    .dropdown-item { padding-top: .6rem; padding-bottom: .6rem; }
    .nav-tabs .nav-link { padding-top: .65rem; padding-bottom: .65rem; }
    /* the logo row above the search bar: lower, so the page starts higher */
    .app-brand-row { height: 3rem !important; }
    .app-brand-row img { height: 1.7rem !important; }
    /* the tabs of a company page scroll sideways like those of a portfolio */
    .page-tabs { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); scrollbar-width: none; }
    .page-tabs::-webkit-scrollbar { display: none; }
    .page-tabs .nav-link { white-space: nowrap; padding-left: .85rem; padding-right: .85rem; }
}
@media (max-width: 767.98px) { .hide-sm { display: none !important; } }
@media (max-width: 767.98px) {
    /* the price of a company under its name: the price and its change on one line, on the left */
    .stock-price { text-align: left !important; display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .75rem; width: 100%; }
    .stock-price .fs-3 { font-size: 1.65rem !important; }
}

/* Free tools index: an icon tile on each calculator card, as on the landing page. */
.tool-card-icon {
    flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(14, 79, 147, .08); color: var(--tblr-primary); font-size: 1.25rem;
}
html[data-bs-theme="dark"] .tool-card-icon { background: rgba(255, 255, 255, .08); color: #9CC3F0; }
.tool-card { transition: box-shadow .15s, transform .15s; }
.tool-card:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(16, 24, 40, .10) !important; }

/* Watchlist: the sector column only where the table has room for it next to the three scores. */
.wl-wide { display: none; }
@media (min-width: 1800px) { .wl-wide { display: table-cell; } }
/* The watchlist must fit the page too: as the window narrows the columns leave in order of how much they are missed. */
#watchTable > :not(caption) > * > * { padding-left: .55rem; padding-right: .55rem; }
@media (max-width: 1649.98px) { #watchTable .wl-p2 { display: none; } }
@media (max-width: 1479.98px) { #watchTable .wl-p3 { display: none; } }
@media (max-width: 1279.98px) { #watchTable .wl-p4 { display: none; } }
@media (max-width: 767.98px) { #watchTable .wl-p5 { display: none; } }

/* Markets: an index card opens its chart. */
.mk-index[role="button"] { cursor: pointer; transition: box-shadow .15s, transform .15s; }
.mk-index[role="button"]:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(16, 24, 40, .10) !important; }

/* Markets: the economy and market panel. */
.eco-signal { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.eco-signal.ok { background: rgba(47, 158, 111, .12); color: #1F7A53; }
.eco-signal.warn { background: rgba(242, 163, 58, .18); color: #9A5B00; }
html[data-bs-theme="dark"] .eco-signal.ok { color: #7FD3AC; }
html[data-bs-theme="dark"] .eco-signal.warn { color: #F6C177; }
.eco-dot { flex: 0 0 auto; width: .6rem; height: .6rem; border-radius: 50%; margin-top: .3rem; background: #B7C0CC; }
.eco-card.tone-good .eco-dot { background: #2F9E6F; }
.eco-card.tone-watch .eco-dot { background: #F2A33A; }
.eco-card.tone-bad .eco-dot { background: #D64550; }
.eco-spark { width: 100%; height: 30px; margin-top: .4rem; color: #5A92CB; }
.eco-mood { position: relative; height: 10px; border-radius: 999px; margin: .5rem 0 .25rem;
    background: linear-gradient(90deg, #D64550 0%, #F2A33A 30%, #C9D2DE 50%, #86CFAB 70%, #2F9E6F 100%); }
.eco-mood-pin { position: absolute; top: -4px; width: 4px; height: 18px; margin-left: -2px; border-radius: 2px; background: #1a2433; box-shadow: 0 0 0 2px #fff; }

/* Positions table: the three scores of a company share one narrow column, so the table fits the page without scrolling sideways. */
.score-trio { white-space: nowrap; }
.score-trio > span { display: inline-block; min-width: 1.7rem; text-align: center; }
.score-trio .badge { min-width: 1.7rem; padding: .2em .3em; font-size: .72rem; }
.score-trio-head { line-height: 1.15; }

/* Positions table: it must fit the page without scrolling sideways. As the window narrows the columns leave in order of how much they are missed:
   the average cost first (the cost basis says the same), then dividends received and weight, then cost basis and yield on cost. Ticker, quantity, price,
   market value, profit and the scores stay down to a tablet. */
#holdingsTable > :not(caption) > * > * { padding-left: .45rem; padding-right: .45rem; }
@media (max-width: 1599.98px) { #holdingsTable .col-p2 { display: none !important; } }
@media (max-width: 1439.98px) { #holdingsTable .col-p3 { display: none !important; } }
@media (max-width: 1239.98px) { #holdingsTable .col-p4 { display: none !important; } }

/* a score worked out from under 75% of its indicators: faded, with a question mark (see scores.js) */
.score-low-confidence { opacity: .6; border: 1px dashed currentColor; }
.score-low-confidence sup { font-size: .65em; margin-left: 1px; }

/* fixed income in the income calendar */
.cal-dot.cal-fixed { background: #d97706; }
.cal-pill.cal-fixed { background: #fef3c7; color: #92400e; }
html[data-bs-theme="dark"] .cal-pill.cal-fixed { background: #3b2a0a; color: #fcd34d; }

/* =============================================================================================
   Fintech refresh (November 2026): friendlier and more modern on top of the "pro terminal" skin.
   Rounder surfaces with a hairline and a soft lift, pill controls, segmented tabs, a brand hero
   for the headline figure, figures in tabular numerals, and on phones a bottom navigation bar.
   Everything below overrides the rules above; nothing in the templates depends on it to work.
   ============================================================================================= */
:root {
    --fx-bg: #F4F6FB;
    --fx-surface: #FFFFFF;
    --fx-line: #E6EAF2;
    --fx-line-strong: #D7DEEA;
    --fx-muted: #7A869A;
    --fx-ink: #0F1E36;
    --fx-brand: #0B4F96;
    --fx-brand-deep: #072F5A;
    --fx-radius: 16px;
    --fx-radius-sm: 12px;
    --fx-radius-xs: 10px;
    --fx-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 20px -10px rgba(16, 24, 40, .10);
    --fx-shadow-hover: 0 2px 4px rgba(16, 24, 40, .05), 0 14px 30px -12px rgba(16, 24, 40, .18);
    --pro-line: var(--fx-line);
    --aurora-divider: #EEF1F6;
    --tblr-primary: #0B4F96; --tblr-primary-rgb: 11, 79, 150;
    --tblr-success: #16A34A; --tblr-success-rgb: 22, 163, 74;
}
html:not([data-bs-theme="dark"]) body { background-color: var(--fx-bg); }
html:not([data-bs-theme="dark"]) { --tblr-body-color: #22314A; --tblr-heading-color: var(--fx-ink); }
.text-success { color: #12924A !important; }
.text-danger { color: #DC2E3E !important; }

/* type: one confident page title, figures that line up */
h1, .h1, .h2, .h3 { letter-spacing: -.025em; }
h1.h3, .h3.fw-bold { font-size: 1.55rem; font-weight: 750 !important; }
.table, .summary-value, .summary-num, .fs-3, .fs-4, .display-6 { font-variant-numeric: tabular-nums; }
.text-muted { color: var(--fx-muted) !important; }

/* surfaces */
.card {
    border: 1px solid var(--fx-line);
    border-radius: var(--fx-radius);
    box-shadow: var(--fx-shadow);
    background: var(--fx-surface);
}
.card > .card-header:first-child { border-top-left-radius: var(--fx-radius); border-top-right-radius: var(--fx-radius); }
.card > .card-footer:last-child { border-bottom-left-radius: var(--fx-radius); border-bottom-right-radius: var(--fx-radius); }
.shadow-sm { box-shadow: var(--fx-shadow) !important; }
.card-header { padding: .9rem 1.15rem; }
.card-body { padding: 1.15rem; }
.card-title, .card-header h2, .card-header .h6 { font-weight: 650; letter-spacing: -.01em; }
a.card, .card.card-link { transition: box-shadow .18s ease, transform .18s ease; }
a.card:hover, .card.card-link:hover { box-shadow: var(--fx-shadow-hover); transform: translateY(-2px); }
.modal-content { border-radius: 20px; border: 1px solid var(--fx-line); box-shadow: 0 24px 60px -20px rgba(16, 24, 40, .35); }
.modal-header { border-bottom-color: var(--aurora-divider); padding: 1.1rem 1.35rem; }
.modal-footer { border-top-color: var(--aurora-divider); }
.dropdown-menu { border-radius: 14px; border: 1px solid var(--fx-line); box-shadow: 0 16px 40px -16px rgba(16, 24, 40, .25); padding: .35rem; }
.dropdown-item { border-radius: 9px; }
.alert { border-radius: var(--fx-radius-sm); border-width: 1px; }
.list-group { border-radius: var(--fx-radius-sm); }

/* controls */
.btn { border-radius: var(--fx-radius-xs); font-weight: 600; transition: background-color .15s, box-shadow .15s, transform .15s, border-color .15s; }
.btn-sm { border-radius: 9px; }
.btn-lg { border-radius: 14px; }
.btn-primary {
    background: linear-gradient(180deg, #1160B1 0%, #0B4F96 100%);
    border-color: #0A4785;
    box-shadow: 0 1px 2px rgba(11, 79, 150, .25), 0 6px 14px -8px rgba(11, 79, 150, .55), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.btn-primary:hover, .btn-primary:focus-visible { background: linear-gradient(180deg, #1468BF 0%, #0C56A3 100%); border-color: #0A4785; transform: translateY(-1px); }
.btn-primary:active { transform: none; }
.btn-success { background: linear-gradient(180deg, #19B355 0%, #12924A 100%); border-color: #10833F; }
.btn-outline-secondary { background: #fff; border-color: var(--fx-line-strong); color: #2A3A55; }
.btn-outline-secondary:hover { background: #F5F8FC; border-color: #C5CFDF; color: var(--fx-ink); }
.btn-outline-primary { border-color: rgba(11, 79, 150, .35); color: var(--fx-brand); }
.btn-outline-primary:hover { background: rgba(11, 79, 150, .07); color: var(--fx-brand-deep); border-color: rgba(11, 79, 150, .5); }
.btn-link { font-weight: 600; text-decoration: none; }
.form-control, .form-select { border-radius: var(--fx-radius-xs); border-color: var(--fx-line-strong); background-color: #fff; }
.form-control:not(.form-control-sm):not(textarea), .form-select:not(.form-select-sm) { min-height: 42px; }
.form-control-sm, .form-select-sm { border-radius: 9px; }
.input-group-text { border-color: var(--fx-line-strong); background: #F6F8FB; color: var(--fx-muted); }
.form-control:focus, .form-select:focus { border-color: #3B82D6; box-shadow: 0 0 0 4px rgba(59, 130, 214, .15); }
.form-label { font-weight: 600; font-size: .875rem; color: #33435C; }
.form-check-input { border-color: #B9C3D3; }

/* badges and chips: pills */
.badge { border-radius: 999px; font-weight: 600; }
.badge-soft { border-radius: 999px; }
.pl-chip { border-radius: 999px; padding: .25rem .65rem; }

/* tables: a quiet header band, roomy rows, a row you hover lights up */
.table thead th {
    background: #F8FAFD !important;
    color: #74829A;
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .06em;
    border-bottom: 1px solid var(--fx-line) !important;
    padding-top: .65rem; padding-bottom: .65rem;
}
.table > :not(caption) > * > * { border-bottom-color: #EEF1F6; }
.table-hover > tbody > tr:hover > * { background-color: #F3F7FD; }
.table > tbody > tr:last-child > * { border-bottom: 0; }
.table tfoot td, .table tfoot th { background: #F8FAFD; font-weight: 700; }

/* tabs: a segmented control (the portfolio and company pages) */
.portfolio-tabs, .page-tabs {
    border: 0 !important;
    background: #E9EEF6;
    border-radius: 14px;
    padding: 4px;
    gap: 2px;
    display: inline-flex !important;
    max-width: 100%;
}
.portfolio-tabs .nav-link, .page-tabs .nav-link {
    border: 0 !important;
    border-radius: 10px !important;
    color: #56647C;
    font-weight: 600;
    font-size: .875rem;
    padding: .5rem 1rem;
    background: transparent;
    white-space: nowrap;
    margin: 0;
}
.portfolio-tabs .nav-link:hover, .page-tabs .nav-link:hover { color: var(--fx-ink); background: rgba(255, 255, 255, .55); }
.portfolio-tabs .nav-link.active, .page-tabs .nav-link.active {
    color: var(--fx-brand-deep) !important;
    background: #fff !important;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .08), 0 2px 8px -4px rgba(16, 24, 40, .15);
}
.nav-tabs:not(.portfolio-tabs):not(.page-tabs) { border-bottom-color: var(--fx-line); }
.nav-tabs:not(.portfolio-tabs):not(.page-tabs) .nav-link.active { color: var(--fx-brand-deep); border-bottom-color: var(--fx-brand); font-weight: 650; }
.nav-pills .nav-link { border-radius: 999px; font-weight: 600; }
.nav-pills .nav-link.active { background: var(--fx-brand); }

/* the headline figure: a brand hero instead of a plain cell */
.summary-panel { border-radius: var(--fx-radius); overflow: hidden; }
.summary-hero {
    background: radial-gradient(120% 140% at 0% 0%, #1467BA 0%, #0B4F96 45%, #062B52 100%);
    color: #fff;
    border-right: 0 !important;
    position: relative;
    overflow: hidden;
}
.summary-hero::after {
    content: ""; position: absolute; right: -40px; bottom: -60px; width: 180px; height: 180px; border-radius: 50%;
    background: radial-gradient(circle, rgba(52, 211, 153, .28), rgba(52, 211, 153, 0) 70%); pointer-events: none;
}
.summary-hero .summary-label { color: rgba(255, 255, 255, .7); }
.summary-hero .summary-value { color: #fff !important; }
.summary-hero .summary-sub, .summary-hero .text-muted { color: rgba(255, 255, 255, .7) !important; }
.summary-hero .pl-chip-pos { background: rgba(52, 211, 153, .2); color: #A7F3D0; }
.summary-hero .pl-chip-neg { background: rgba(248, 113, 113, .22); color: #FECACA; }
.summary-hero .text-success { color: #6EE7B7 !important; }
.summary-hero .text-danger { color: #FCA5A5 !important; }
.summary-hero a { color: #CFE3FA; }
.summary-stat { border-color: #EEF1F6 !important; }
.summary-num { font-weight: 700; color: var(--fx-ink); }
html[data-bs-theme="dark"] .summary-num { color: #fff; }
.stat-icon { border-radius: 12px; }

/* top bar: frosted, so the page slides under it */
.app-topbar { background: rgba(255, 255, 255, .82); backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--fx-line); }
.app-search .form-control { border-radius: 999px; background: #F2F5FA; border-color: transparent; min-height: 38px; }
.app-search .form-control:focus { background: #fff; border-color: #3B82D6; }
html[data-bs-theme="dark"] .app-topbar { background: rgba(17, 28, 46, .85); }
html[data-bs-theme="dark"] .app-search .form-control { background: rgba(255, 255, 255, .06); }

/* ---- phones: the bottom navigation bar ---- */
.app-bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1045;
    display: grid; grid-template-columns: repeat(5, 1fr);
    background: rgba(255, 255, 255, .94);
    backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-top: 1px solid var(--fx-line);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 24px -18px rgba(16, 24, 40, .35);
}
.app-bottom-nav a, .app-bottom-nav button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-height: 50px; border: 0; background: transparent; border-radius: 12px;
    color: #6B788E; font-size: .6875rem; font-weight: 600; text-decoration: none; letter-spacing: .01em;
}
.app-bottom-nav i { font-size: 1.2rem; line-height: 1; padding: .2rem .9rem; border-radius: 999px; }
.app-bottom-nav a.active { color: var(--fx-brand); }
.app-bottom-nav a.active i { background: rgba(11, 79, 150, .1); }
.app-bottom-nav a:active, .app-bottom-nav button:active { background: rgba(11, 79, 150, .06); }
html[data-bs-theme="dark"] .app-bottom-nav { background: rgba(17, 28, 46, .94); border-top-color: rgba(255, 255, 255, .08); }
html[data-bs-theme="dark"] .app-bottom-nav a, html[data-bs-theme="dark"] .app-bottom-nav button { color: #93A3BB; }
html[data-bs-theme="dark"] .app-bottom-nav a.active { color: #8FC1F5; }
@media (max-width: 991.98px) {
    body:has(.app-bottom-nav) .page-body { padding-bottom: 5.5rem; }
    body:has(.app-bottom-nav) .feedback-fab { bottom: calc(78px + env(safe-area-inset-bottom)); }
}
@media (max-width: 767.98px) {
    .page-body { margin-top: .75rem; }
    h1.h3, .h3.fw-bold { font-size: 1.35rem; }
    .card-body { padding: 1rem; }
    .card-header { padding: .8rem 1rem; }
    .portfolio-tabs, .page-tabs { display: flex !important; flex-wrap: nowrap; overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
    .portfolio-tabs .nav-link, .page-tabs .nav-link { padding: .5rem .85rem; }
    .page-actions .btn { min-height: 40px; }
    .page-actions > .btn-primary { flex: 1 1 auto; }
    .summary-hero { padding: 1.25rem; }
    .summary-value { font-size: 1.85rem; }
    .modal-dialog { margin: .75rem; }
}

/* ---- dark theme: the same surfaces on the dark palette ---- */
html[data-bs-theme="dark"] .card { background: var(--tblr-bg-surface); border-color: rgba(255, 255, 255, .08); box-shadow: none; }
html[data-bs-theme="dark"] .table thead th { background: rgba(255, 255, 255, .03) !important; color: #93A3BB; border-bottom-color: rgba(255, 255, 255, .08) !important; }
html[data-bs-theme="dark"] .table tfoot td, html[data-bs-theme="dark"] .table tfoot th { background: rgba(255, 255, 255, .03); }
html[data-bs-theme="dark"] .table-hover > tbody > tr:hover > * { background-color: rgba(255, 255, 255, .04); }
html[data-bs-theme="dark"] .portfolio-tabs, html[data-bs-theme="dark"] .page-tabs { background: rgba(255, 255, 255, .06); }
html[data-bs-theme="dark"] .portfolio-tabs .nav-link, html[data-bs-theme="dark"] .page-tabs .nav-link { color: #A7B4C8; }
html[data-bs-theme="dark"] .portfolio-tabs .nav-link.active, html[data-bs-theme="dark"] .page-tabs .nav-link.active { background: rgba(255, 255, 255, .12) !important; color: #fff !important; box-shadow: none; }
html[data-bs-theme="dark"] .btn-outline-secondary { background: transparent; border-color: rgba(255, 255, 255, .16); color: #DCE4F0; }
html[data-bs-theme="dark"] .btn-outline-secondary:hover { background: rgba(255, 255, 255, .06); }
html[data-bs-theme="dark"] .form-control, html[data-bs-theme="dark"] .form-select { background-color: rgba(255, 255, 255, .04); border-color: rgba(255, 255, 255, .14); }
html[data-bs-theme="dark"] .input-group-text { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .14); }
html[data-bs-theme="dark"] .form-label { color: #C6D1E1; }
html[data-bs-theme="dark"] .summary-stat { border-color: rgba(255, 255, 255, .08) !important; }
@media (max-width: 991.98px) {
    /* the bottom bar has the menu: the top bar keeps only the logo, on the left */
    body:has(.app-bottom-nav) .app-sidebar .navbar-toggler { display: none; }
    body:has(.app-bottom-nav) .app-sidebar .app-brand-row { justify-content: flex-start; }
}
@media (max-width: 767.98px) {
    /* the page starts right under the search bar */
    .page-body > .container-xl > .py-4 { padding-top: .5rem !important; }
    .page-body h1.h2, .page-body h1.h3, .page-body h1.h4 { font-size: 1.4rem !important; }
}
/* the three scores of a company stay side by side on a phone */
@media (max-width: 767.98px) {
    .snapshot-scores .s-label { font-size: .72rem; font-weight: 600; color: var(--fx-muted); margin-bottom: .25rem; min-height: 2em; display: flex; align-items: flex-end; justify-content: center; line-height: 1.15; }
    .snapshot-scores .display-6 { font-size: 1.9rem; }
    .snapshot-scores .badge { font-size: .68rem; white-space: normal; line-height: 1.2; }
}
.snapshot-scores > div > a { display: block; padding: .75rem .25rem; border-radius: 14px; transition: background-color .15s; }
.snapshot-scores > div > a:hover { background: #F3F7FD; }
/* settings: shortcuts to each section, and sections that land below the sticky top bar */
.settings-jump { display: flex; flex-wrap: wrap; gap: .4rem; }
.settings-jump a { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .75rem; border-radius: 999px; background: #fff; border: 1px solid var(--fx-line); color: #34445E; font-size: .8125rem; font-weight: 600; text-decoration: none; transition: background-color .15s, border-color .15s; }
.settings-jump a:hover { background: #F3F7FD; border-color: #C9D6EA; color: var(--fx-brand-deep); }
html[data-bs-theme="dark"] .settings-jump a { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.1); color: #C6D1E1; }
[id] { scroll-margin-top: 80px; }
/* plans page */
.plan-card { border-radius: 20px; }
.plan-card .card-body { padding: 1.6rem; }
.plan-price { font-size: 2.2rem; font-weight: 800; letter-spacing: -.03em; margin: .5rem 0 .25rem; color: var(--fx-ink); }
.plan-price span { font-size: .95rem; font-weight: 500; color: var(--fx-muted); letter-spacing: 0; }
.pricing-list li { position: relative; padding: .35rem 0 .35rem 1.6rem; line-height: 1.45; }
.pricing-list li i { position: absolute; left: 0; top: .38rem; margin: 0 !important; }
.plan-card-premium { background: radial-gradient(120% 120% at 0% 0%, #1467BA 0%, #0B4F96 45%, #062B52 100%); border: 0; color: #E6EEF8; box-shadow: 0 20px 50px -22px rgba(11, 79, 150, .7); }
.plan-card-premium h2, .plan-card-premium .plan-price, .plan-card-premium strong { color: #fff; }
.plan-card-premium .text-muted { color: rgba(255, 255, 255, .7) !important; }
.plan-card-premium .pricing-list i { color: #6EE7B7 !important; }
.plan-ribbon { display: inline-flex; align-items: center; padding: .3rem .7rem; border-radius: 999px; background: rgba(110, 231, 183, .18); color: #A7F3D0; font-size: .75rem; font-weight: 700; }
html[data-bs-theme="dark"] .plan-price { color: #fff; }
/* the drawn app on the home page fits a phone: the shares column goes, the rest scrolls if it must */
@media (max-width: 575.98px) {
    .lp-window-body { overflow-x: auto; }
    .lp-table th:nth-child(4), .lp-table td:nth-child(4) { display: none; }
    .page-body section > .row.g-4 { --tblr-gutter-x: 1rem; --bs-gutter-x: 1rem; }
}
/* phones with the bottom bar: feedback lives in the account menu, so no round button covers the rows */
@media (max-width: 991.98px) { body:has(.app-bottom-nav) .feedback-fab { display: none; } }
html[data-bs-theme="dark"] .table > :not(caption) > * > * { border-bottom-color: rgba(255, 255, 255, .07); }
html[data-bs-theme="dark"] .summary-panel .summary-stat, html[data-bs-theme="dark"] .card-header { border-color: rgba(255, 255, 255, .08) !important; }
html[data-bs-theme="dark"] .settings-jump a:hover, html[data-bs-theme="dark"] .snapshot-scores > div > a:hover { background: rgba(255, 255, 255, .06); }
/* pill tabs (the sub-tabs of a company page): the chosen one in white on the brand colour */
.nav-pills .nav-link { color: #56647C; }
.nav-pills .nav-link:hover { color: var(--fx-brand-deep); background: rgba(11, 79, 150, .06); }
.nav-pills .nav-link.active, .nav-pills .show > .nav-link { color: #fff !important; background: var(--fx-brand) !important; box-shadow: 0 4px 10px -6px rgba(11, 79, 150, .7); }
html[data-bs-theme="dark"] .nav-pills .nav-link { color: #A7B4C8; }
html[data-bs-theme="dark"] .nav-pills .nav-link.active { background: #2B6CB5 !important; }
/* "Your own scenario": every field has a label line of one height, so the boxes line up across a row */
.sc-fields .sc-label { display: flex; align-items: center; justify-content: space-between; gap: .5rem; min-height: 30px; margin-bottom: .35rem; font-size: .8125rem; font-weight: 600; color: #33435C; }
.sc-fields .sc-label label { margin: 0; }
.sc-toggle { display: inline-flex; background: #E9EEF6; border-radius: 9px; padding: 2px; }
.sc-toggle label { margin: 0; padding: .2rem .65rem; border-radius: 7px; font-size: .75rem; font-weight: 600; color: #56647C; cursor: pointer; white-space: nowrap; }
.sc-toggle .btn-check:checked + label { background: #fff; color: var(--fx-brand-deep); box-shadow: 0 1px 2px rgba(16, 24, 40, .12); }
.sc-toggle .btn-check:focus-visible + label { outline: 2px solid #3B82D6; outline-offset: 1px; }
.sc-check { display: flex; align-items: center; gap: .6rem; min-height: 42px; padding: 0 .85rem; border: 1px solid var(--fx-line-strong); border-radius: var(--fx-radius-xs); background: #fff; font-size: .875rem; cursor: pointer; margin: 0; }
html[data-bs-theme="dark"] .sc-fields .sc-label { color: #C6D1E1; }
html[data-bs-theme="dark"] .sc-toggle { background: rgba(255, 255, 255, .06); }
html[data-bs-theme="dark"] .sc-toggle .btn-check:checked + label { background: rgba(255, 255, 255, .14); color: #fff; }
html[data-bs-theme="dark"] .sc-check { background: rgba(255, 255, 255, .04); border-color: rgba(255, 255, 255, .14); }
/* phones: a column that holds a name and its explanation keeps a readable width (the table scrolls sideways instead of breaking every word) */
@media (max-width: 767.98px) {
    .table td:first-child:has(> .small.text-muted), .table td:first-child:has(> div.small) { min-width: 170px; }
    .yardstick-table th:nth-child(4), .yardstick-table td:nth-child(4) { display: none; }
    .yardstick-table td:first-child { min-width: 150px !important; }
    .yardstick-table td:nth-child(2) { font-size: .8125rem; }
}
