:root {
    --surface-page: #f3f6fb;
    --surface-panel: rgba(255, 255, 255, 0.88);
    --surface-panel-muted: rgba(247, 250, 253, 0.92);
    --surface-strong: #ffffff;
    --line-soft: #d8e0ea;
    --line-muted: #e8edf3;
    --text-strong: #17324f;
    --text-muted: #60758c;
    --shadow-soft: 0 14px 34px rgba(28, 52, 84, 0.08);
    --shadow-hover: 0 18px 42px rgba(28, 52, 84, 0.12);
    --focus-ring: 0 0 0 0.2rem rgba(112, 164, 213, 0.2);
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --riskpremium-bg: #f4eafb;
    --riskpremium-fg: #7a29b6;
    --return-bg: #e7f1fb;
    --return-fg: #176ca5;
    --risk-bg: #fbe9e8;
    --risk-fg: #b23d36;
    --diversification-bg: #eaf8ef;
    --diversification-fg: #19794a;
}

html,
body {
    width: 100%;
    min-height: 100%;
    background:
        radial-gradient(circle at top left, rgba(115, 165, 213, 0.18), transparent 26rem),
        linear-gradient(180deg, #f7f9fc 0%, var(--surface-page) 100%) !important;
}

body {
    font-family: "Lexend Deca", Times, serif !important;
    color: var(--text-strong);
}

.container-fluid {
    width: min(97%, 2000px) !important;
    max-width: 2000px;
}

.showcase-page {
    padding-bottom: 1rem;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: "Lexend Deca", Times, serif;
    font-weight: 600 !important;
    color: var(--text-strong);
}

h1:focus {
    outline: none;
}

a {
    color: #1b6ea8;
}

a:hover {
    color: #154f78;
}

small,
.small,
.text-muted {
    color: var(--text-muted) !important;
}

.percent-sign {
    color: #000000 !important;
}

@font-face {
    font-display: swap;
    font-family: "Lexend Deca";
    font-style: normal;
    font-weight: 200;
    src: url("/fonts/lexend-deca-v22-latin-200.woff2") format("woff2");
}

@font-face {
    font-display: swap;
    font-family: "Lexend Deca";
    font-style: normal;
    font-weight: 300;
    src: url("/fonts/lexend-deca-v22-latin-300.woff2") format("woff2");
}

@font-face {
    font-display: swap;
    font-family: "Lexend Deca";
    font-style: normal;
    font-weight: 400;
    src: url("/fonts/lexend-deca-v22-latin-regular.woff2") format("woff2");
}

@font-face {
    font-display: swap;
    font-family: "Lexend Deca";
    font-style: normal;
    font-weight: 500;
    src: url("/fonts/lexend-deca-v22-latin-500.woff2") format("woff2");
}

@font-face {
    font-display: swap;
    font-family: "Lexend Deca";
    font-style: normal;
    font-weight: 600;
    src: url("/fonts/lexend-deca-v22-latin-600.woff2") format("woff2");
}

@font-face {
    font-display: swap;
    font-family: "Gochi Hand";
    font-style: normal;
    font-weight: 400;
    src: url("/fonts/gochi-hand-v24-latin-regular.woff2") format("woff2");
}

.bg-riskpremium {
    background: var(--riskpremium-bg) !important;
    border-color: color-mix(in srgb, var(--riskpremium-fg) 35%, white) !important;
}

.fg-riskpremium {
    color: var(--riskpremium-fg) !important;
}

.bg-return {
    background: var(--return-bg) !important;
    border-color: color-mix(in srgb, var(--return-fg) 30%, white) !important;
}

.fg-return {
    color: var(--return-fg) !important;
}

.bg-risk {
    background: var(--risk-bg) !important;
    border-color: color-mix(in srgb, var(--risk-fg) 28%, white) !important;
}

.fg-risk {
    color: var(--risk-fg) !important;
}

.bg-diversification {
    background: var(--diversification-bg) !important;
    border-color: color-mix(in srgb, var(--diversification-fg) 30%, white) !important;
}

.fg-diversification {
    color: var(--diversification-fg) !important;
}

.bg-paritas-darker {
    background: #001133;
}

.bg-paritas-dark {
    background: #224466;
}

.bg-paritas-light {
    background: #abc7e3 !important;
}

.bg-paritas-lighter {
    background: #f1f6fa !important;
}

.paritas-darker {
    color: #001133;
}

.paritas-dark {
    color: #224466 !important;
}

.paritas-light {
    color: #abc7e3 !important;
}

.gradient-text {
    display: inline-block;
    font-weight: 700;
    background: linear-gradient(90deg, #bf534f, #ff6d68, #ffc843, #0071ce, #5e96dc, #009638);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    transform: rotate(-5deg);
    font-family: "Gochi Hand";
}

.ex-ante-title {
    margin: 0;
    font-size: 1.38em !important;
    font-weight: 700;
    letter-spacing: 0.035em;
    color: #f7fbff;
    text-shadow: 0 1px 14px rgba(12, 28, 45, 0.24);
}

.playground-title {
    position: relative;
    left: 12px;
    top: 0;
    font-size: 2em;
}

.section-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.helper-text-block {
    max-width: 1000px !important;
    line-height: 1.7;
    color: var(--text-muted);
}

.btn {
    border-radius: 999px;
    font-weight: 500;
    box-shadow: none !important;
}

.btn-dark {
    border-color: rgba(36, 75, 112, 0.22) !important;
    background: rgba(36, 75, 112, 0.1) !important;
    color: #244b70 !important;
}

.btn-dark:hover,
.btn-dark:focus {
    border-color: rgba(36, 75, 112, 0.32) !important;
    background: rgba(36, 75, 112, 0.16) !important;
    color: #1f3f5e !important;
}

.btn-light {
    border: 1px solid rgba(36, 75, 112, 0.12);
    background: rgba(255, 255, 255, 0.78);
}

.icon-button {
    min-width: 2.25rem;
}

.form-control,
select.form-control {
    border-radius: 999px;
    border: 1px solid var(--line-soft);
    background: rgba(255, 255, 255, 0.92);
}

.form-control:focus,
select.form-control:focus {
    border-color: #9cbddd;
    box-shadow: var(--focus-ring);
}

.bulk-allocation,
.portfolio-select-row {
    gap: 0.5rem;
}

.bulk-allocation select,
.portfolio-select-row select {
    min-width: 16rem;
}

.mylabel {
    padding: 0 5px;
    font-weight: 700;
    font-size: 0.85rem;
}

.remove-button {
    display: none !important;
    padding: 0 5px !important;
    margin-right: 5px;
}

tr:hover .remove-button {
    display: block !important;
}

.table {
    margin-bottom: 0;
    color: var(--text-strong);
}

.table td {
    padding: 4px 6px !important;
    min-width: 0 !important;
    height: 38px !important;
    border: 1px solid var(--line-muted);
    vertical-align: middle !important;
    background: rgba(255, 255, 255, 0.52);
}

.table th {
    padding: 6px 8px !important;
    border-bottom: none;
    font-size: 0.9em;
    color: var(--text-muted);
    font-weight: 500;
    background: transparent;
}

.table thead th {
    white-space: nowrap;
}

.table.no-inputs td {
    padding: 6px 8px !important;
}

.matrix-table td,
.holdings-table td {
    height: 36px !important;
}

.matrix-table td .myinput,
.holdings-table td .myinput {
    padding: 2px 5px;
}

.table-header th {
    padding-top: 12px !important;
    font-size: 0.76em;
    font-weight: 600;
    text-transform: uppercase !important;
    letter-spacing: 0.05em;
    vertical-align: middle !important;
}

.table-row-header {
    color: var(--text-muted) !important;
    font-size: 0.9em;
    font-weight: 600 !important;
    letter-spacing: 0.05em;
    /*text-transform: uppercase !important;*/
}

.matrix-table,
.summary-table,
.holdings-table {
    overflow: hidden;
    border-radius: var(--radius-md);
}

.matrix-table thead th,
.holdings-table thead th,
.summary-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
}

.summary-table th:first-child,
.summary-table td:first-child,
.holdings-table th:first-child,
.holdings-table td:first-child {
    border-left-width: 0;
}

.nullrow td {
    color: #aab6c3 !important;
}

.strong-border-end {
    border-inline-end: 2px solid #224466 !important;
}

.theader th {
    border-bottom: 2px solid #224466 !important;
}

td.selectable {
    transition: background-color 0.18s ease;
}

td.selectable:hover {
    background: rgba(36, 75, 112, 0.07) !important;
}

.td-sm {
    width: 90px;
}

.td-md {
    width: 150px;
}

.td-lg {
    width: 350px;
}

.td-fill {
    width: auto;
}

.tr-asset-type td {
    background: #00000007 !important;
    border-bottom: 2px solid rgba(23, 50, 79, 0.35) !important;
}

.tr-hoverable td {
    transition: background-color 0.18s ease, border-color 0.18s ease;
}

.tr-hoverable:hover td {
    background: rgba(255, 255, 255, 0.9) !important;
}

.tr-hoverable td:first-child {
    border-left: 3px solid #e3e8ef;
}

.tr-hoverable:hover td:first-child {
    border-left: 3px solid #244b70;
}

.myinput {
    border-radius: 9px;
    border: 1px solid transparent;
    padding: 4px 6px;
    display: block;
    width: 100%;
    background: transparent;
    color: var(--text-strong);
    outline: 0 !important;
    transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.myinput:hover {
    border-color: rgba(36, 75, 112, 0.25);
    background: rgba(241, 246, 250, 0.95);
}

input.myinput-visible,
.portfolio-name-input {
    border: 1px solid #c9d7e6;
    background: rgba(255, 255, 255, 0.95) !important;
}

.myinput:active,
.myinput:focus {
    box-shadow: var(--focus-ring) !important;
    border-color: #9cbddd !important;
    background: #ffffff !important;
}

.myinput:disabled {
    color: #7c8ea1;
    background-color: transparent;
    border-color: transparent;
}

.myinput::placeholder {
    color: #0d6dfd;
    opacity: 1;
    font-style: italic;
}

.input-danger {
    border-radius: 5px !important;
    border: 1px solid #dc3545;
    border-right-width: 2px;
}

.sigmadiff-cold {
    font-weight: 700 !important;
    color: #0d6efd !important;
    background: #0d6efd22 !important;
}

.sigmadiff-warm {
    font-weight: 700 !important;
    color: #dc3545 !important;
    background: #dc354522 !important;
}

.holding-api {
    border-left: 3px solid #0daefd;
    border-radius: 10px;
    margin: 20px 0 20px 5px;
    padding: 8px 0 8px 8px;
}

.api-connection {
    border-bottom: 1px solid #cccccc;
    margin: 0 0 20px;
    padding: 0 0 30px;
}

.card,
.page-card {
    position: relative;
    padding: 22px 20px;
    border: 1px solid rgba(216, 224, 234, 0.9) !important;
    border-radius: var(--radius-lg) !important;
    background: var(--surface-panel);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(10px);
    margin-bottom: 22px;
}

.page-card:hover,
.portfolio-card:hover,
.help-card:hover {
    box-shadow: var(--shadow-hover);
}

.page-card-muted {
    background: var(--surface-panel-muted);
}

.page-card h5,
.page-card h6 {
    margin-bottom: 0.5rem;
}

.riskfree-badge {
    display: inline-flex;
    align-items: baseline;
    gap: 0.45rem;
    padding: 0.32rem 0.62rem;
    border: 1px solid rgba(40, 95, 128, 0.16);
    border-radius: 999px;
    background: rgba(40, 95, 128, 0.06);
    color: var(--text-muted);
    font-size: 0.78rem;
    white-space: nowrap;
}

.riskfree-badge strong {
    color: var(--text-main);
    font-size: 0.88rem;
    font-weight: 700;
}

.portfolio-card {
    overflow: hidden;
}

.portfolio-toolbar {
    gap: 0.75rem;
}

.portfolio-actions {
    align-items: center;
}

.portfolio-name-input {
    height: 34px;
}

.metric-card-grid {
    row-gap: 0.9rem !important;
}

.card .loading {
    display: flex !important;
    inset: 16px;
    width: auto !important;
    height: auto !important;
    border-radius: calc(var(--radius-lg) - 6px);
    background: rgba(255, 255, 255, 0.78) !important;
    backdrop-filter: blur(6px);
}

.small-card {
    min-height: 100%;
    padding: 10px 16px;
    border: 1px solid rgba(216, 224, 234, 0.92);
    border-radius: var(--radius-md);
    background: rgba(250, 252, 255, 0.92);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.small-card .title {
    display: inline-block;
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    font-size: 0.78em;
    letter-spacing: 0.04em;
    line-height: 1.8;
    font-weight: 600;
}

.small-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.4rem;
}

.small-card-header .title {
    margin-bottom: 0;
}

.card-toggle {
    padding: 0.15rem 0.65rem;
    font-size: 0.72rem;
    line-height: 1.4;
}

.help-grid > div {
    display: flex;
    flex-direction: column;
}

.help-card {
    height: 100%;
}

.help-card p:last-child {
    margin-bottom: 0;
}

.summary-risk-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    min-height: 30px;
}

.summary-risk-select {
    min-width: 13.5rem;
    max-width: 15.5rem;
    /*max-width: 100%;*/
    height: 30px;
    font-size: 0.82rem;
}

.showcase-mobile-page {
    max-width: 820px;
    padding-inline: 0.35rem;
}

.showcase-mobile-page .page-card {
    margin-bottom: 18px;
}

.mobile-card-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.9rem;
}

.mobile-details summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    list-style: none;
}

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

.mobile-details summary::after {
    content: "Visa";
    flex: 0 0 auto;
    padding: 0.16rem 0.62rem;
    border: 1px solid rgba(36, 75, 112, 0.14);
    border-radius: 999px;
    background: rgba(36, 75, 112, 0.06);
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.mobile-details[open] summary::after {
    content: "Dölj";
}

.mobile-portfolio-editor {
    border-top: 1px solid rgba(216, 224, 234, 0.9);
    padding-top: 0.9rem;
}

.mobile-portfolio-editor summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    list-style: none;
}

.mobile-portfolio-editor summary::-webkit-details-marker {
    display: none;
}

.mobile-portfolio-editor summary::after {
    content: "Dölj";
    flex: 0 0 auto;
    padding: 0.16rem 0.62rem;
    border: 1px solid rgba(36, 75, 112, 0.14);
    border-radius: 999px;
    background: rgba(36, 75, 112, 0.06);
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.mobile-portfolio-editor:not([open]) summary::after {
    content: "Visa";
}

.mobile-scroll {
    overflow-x: auto;
    padding-bottom: 0.2rem;
}

.mobile-settings-table,
.mobile-correlation-table,
.mobile-holdings-table {
    min-width: 100%;
}

.mobile-correlation-table {
    min-width: 760px;
}

.mobile-risk-mode-row {
    display: grid;
    gap: 0.45rem;
}

.mobile-performance-list {
    display: grid;
    gap: 0.9rem;
}

.mobile-performance-card {
    border: 1px solid rgba(216, 224, 234, 0.9);
    border-radius: var(--radius-md);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.7) 0%, rgba(247, 250, 253, 0.94) 100%);
    padding: 14px;
}

.mobile-performance-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.mobile-performance-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.mobile-meta-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(36, 75, 112, 0.08);
    color: #244b70;
    font-size: 0.74rem;
    font-weight: 600;
}

.mobile-performance-score {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.1;
}

.mobile-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
}

.mobile-stat-grid .small-card {
    padding: 0.5rem 0.8rem;
}

.mobile-stat-grid .small-card b {
    display: inline-block;
    margin-top: 0.08rem;
}

.mobile-portfolio-card .portfolio-toolbar {
    align-items: flex-start !important;
}

.mobile-portfolio-card .portfolio-actions {
    justify-content: flex-end;
}

.mobile-metric-card-grid > div {
    flex: 0 0 100%;
    max-width: 100%;
}

.mobile-help-grid .help-card {
    height: auto;
}

.navbar-brand span {
    color: #555555;
    font-weight: 400;
    padding-right: 10px;
}

.nav-link,
.dropdown-item {
    font-weight: 300 !important;
}

.save-widget {
    border: 2px solid #cccccc;
    border-radius: 5px;
    padding: 4px 6px;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgO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pbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

.loading-progress circle {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: #1b6ec2;
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: 700;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Laddar");
}

code {
    color: #c02d76;
}

@media (max-width: 991.98px) {
    .container-fluid {
        width: 98% !important;
    }

    .bulk-allocation {
        flex-wrap: wrap;
        justify-content: flex-start;
        margin-top: 0.75rem;
        margin-left: 0.25rem;
    }

    .bulk-allocation select,
    .portfolio-select-row select {
        min-width: 12rem;
    }

    .portfolio-toolbar {
        flex-wrap: wrap;
    }

    .summary-risk-header {
        flex-direction: column;
        gap: 0.4rem;
    }

    .summary-risk-select {
        min-width: 12rem;
        width: 100%;
    }

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

    .card,
    .page-card {
        padding: 18px 16px;
        border-radius: 18px !important;
    }

    .mobile-card-heading,
    .mobile-performance-header {
        flex-direction: column;
    }

    .mobile-portfolio-card .portfolio-actions {
        justify-content: flex-start;
    }
}
