h1:focus {
    outline: none;
}

.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: "Segoe UI", system-ui, sans-serif;
    background: #f4f6f8;
    color: #1a1a1a;
}

.app-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.75rem 1.5rem;
    background: #0f2d52;
    color: #fff;
}

.brand a {
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 1rem;
    flex: 1;
}

.nav-links a {
    color: #c8d9ef;
    text-decoration: none;
}

.nav-links a:hover,
.nav-links a:focus {
    color: #fff;
}

.nav-links a.active {
    color: #fff;
    font-weight: 600;
}

.view-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.view-tabs button {
    border: 1px solid #cfd8e3;
    background: #fff;
    color: #24384d;
    border-radius: 999px;
    padding: 0.35rem 0.9rem;
    cursor: pointer;
    font: inherit;
}

.view-tabs button.active {
    background: #0f2d52;
    border-color: #0f2d52;
    color: #fff;
}

.home-feature-grid a {
    color: inherit;
}

.auth-links {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.auth-links a {
    color: #fff;
    text-decoration: none;
}

.auth-button {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 0.35rem;
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
}

.auth-button:hover,
.auth-button:focus {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.auth-button.primary {
    background: #fff;
    color: #0f2d52;
    border-color: #fff;
}

.auth-card {
    max-width: 36rem;
}

.auth-card .auth-button {
    border-color: #0f2d52;
    color: #0f2d52;
}

.auth-card .auth-button:hover,
.auth-card .auth-button:focus {
    background: rgba(15, 45, 82, 0.08);
    color: #0f2d52;
}

.auth-card .auth-button.primary {
    background: #0f2d52;
    color: #fff;
    border-color: #0f2d52;
}

.auth-card .auth-button.primary:hover,
.auth-card .auth-button.primary:focus {
    background: #163d6e;
    color: #fff;
}

.auth-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.auth-link {
    align-self: center;
}

.auth-hint {
    margin-top: 1rem;
    color: #5a6470;
    font-size: 0.95rem;
}

.user-name {
    opacity: 0.85;
    font-size: 0.9rem;
}

.app-main {
    flex: 1;
    padding: 1.5rem;
    box-sizing: border-box;
    min-width: 0;
    width: 100%;
}

.app-main h1 {
    margin: 0 0 0.35rem;
    font-size: 1.75rem;
}

.app-main > p {
    margin: 0 0 1.25rem;
    color: #4b5563;
}

.home-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(18rem, 0.7fr);
    gap: 2rem;
    align-items: center;
    padding: 2rem 0 2.25rem;
}

.home-copy h1 {
    max-width: 46rem;
    margin: 0.25rem 0 0.8rem;
    color: #102033;
    font-size: 3rem;
    line-height: 1.05;
}

.home-copy p {
    max-width: 43rem;
    margin: 0;
    color: #4b5563;
    font-size: 1.05rem;
    line-height: 1.65;
}

.home-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.4rem;
}

.button-link {
    display: inline-flex;
    align-items: center;
    min-height: 2.45rem;
    border-radius: 6px;
    padding: 0.55rem 1rem;
    font-weight: 700;
    text-decoration: none;
}

.button-link.primary {
    background: #0f2d52;
    color: #fff;
}

.button-link.secondary {
    background: #fff;
    border: 1px solid #cfd8e3;
    color: #0f2d52;
}

.home-panel {
    display: grid;
    gap: 0.75rem;
    background: #fff;
    border: 1px solid #d9e2ea;
    border-radius: 8px;
    padding: 1rem;
}

.home-panel div {
    border-bottom: 1px solid #edf1f5;
    padding-bottom: 0.75rem;
}

.home-panel div:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.home-panel span,
.home-feature-grid span {
    display: block;
    color: #5a6470;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.home-panel strong {
    display: block;
    margin-top: 0.2rem;
    color: #102033;
    font-size: 1.15rem;
}

.home-feature-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    scroll-margin-top: 1.25rem;
}

.home-feature-grid article {
    background: #fff;
    border: 1px solid #d9e2ea;
    border-radius: 8px;
    padding: 1rem;
}

.home-feature-grid h2 {
    margin: 0.35rem 0 0.4rem;
    color: #102033;
    font-size: 1.05rem;
}

.home-feature-grid p {
    margin: 0;
    color: #4b5563;
    line-height: 1.5;
}

.page-heading {
    display: flex;
    justify-content: space-between;
    gap: 1.25rem;
    align-items: flex-end;
    margin-bottom: 1.25rem;
}

.page-heading p {
    margin: 0.15rem 0 0;
    color: #4b5563;
}

.metric-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(5.5rem, 1fr));
    gap: 0.75rem;
    min-width: 26rem;
}

.metric-tile {
    background: #fff;
    border: 1px solid #d9e2ea;
    border-radius: 8px;
    padding: 0.75rem 0.9rem;
}

.metric-tile span {
    display: block;
    color: #5a6470;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.metric-tile strong {
    display: block;
    margin-top: 0.25rem;
    color: #102033;
    font-size: 1.35rem;
}

.metric-tile.target-ok {
    border-color: #86cfa2;
    background: #f0fbf4;
}

.metric-tile.target-warn {
    border-color: #e8cb6b;
    background: #fffbeb;
}

.metric-tile.target-error {
    border-color: #f0a3a3;
    background: #fff1f2;
}

.card {
    background: #fff;
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    margin-bottom: 1rem;
}

.card h2 {
    margin: 0 0 0.5rem;
    font-size: 1.15rem;
}

.card p {
    margin: 0 0 1rem;
    color: #4b5563;
}

table.data-table {
    width: 100%;
    border-collapse: collapse;
}

table.data-table th,
table.data-table td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}

table.data-table th {
    background: #f9fafb;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

table.data-table .row-number {
    width: 2.5rem;
    color: #6b7280;
    text-align: right;
}

table.data-table tfoot td {
    background: #f9fafb;
    border-top: 2px solid #d9e2ea;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.section-heading h2 {
    margin: 0;
}

.target-summary {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    margin-top: 0.75rem;
    padding: 0.25rem 0.6rem;
    font-size: 0.85rem;
    font-weight: 700;
}

.target-summary.ok {
    background: #dcfce7;
    color: #166534;
}

.target-summary.warn {
    background: #fef9c3;
    color: #854d0e;
}

.target-summary.error {
    background: #fee2e2;
    color: #991b1b;
}

.empty-state {
    background: #fff;
    border: 1px solid #d9e2ea;
    border-radius: 8px;
    padding: 1.25rem;
}

.empty-state h2 {
    margin: 0 0 0.35rem;
    font-size: 1.1rem;
}

.empty-state p {
    margin: 0;
    color: #4b5563;
}

.rule-layout {
    display: grid;
    grid-template-columns: 15rem minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.rule-type-list {
    position: sticky;
    top: 1rem;
    display: grid;
    gap: 0.4rem;
}

.rule-type-list a {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: center;
    min-height: 2.5rem;
    padding: 0.55rem 0.7rem;
    background: #fff;
    border: 1px solid #d9e2ea;
    border-radius: 8px;
    color: #172033;
    text-decoration: none;
}

.rule-type-list a:hover,
.rule-type-list a:focus {
    border-color: #5f8fb8;
    background: #eef6fb;
}

.rule-type-list span {
    overflow-wrap: anywhere;
}

.rule-type-list strong,
.count-pill {
    flex: 0 0 auto;
    border-radius: 999px;
    background: #e8edf2;
    color: #24384d;
    font-size: 0.78rem;
    line-height: 1;
    padding: 0.35rem 0.5rem;
}

.rule-sections {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.rule-section {
    background: #fff;
    border: 1px solid #d9e2ea;
    border-radius: 8px;
    overflow: hidden;
}

.rule-section-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: 1rem 1rem 0.85rem;
    border-bottom: 1px solid #e7edf3;
}

.rule-section-header h2 {
    margin: 0.1rem 0 0;
    font-size: 1.1rem;
}

.eyebrow {
    color: #5a6470;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.rule-table-wrap {
    overflow-x: auto;
}

.rule-table th:nth-child(1) { width: 6rem; }
.rule-table th:nth-child(2) { width: 32%; }
.rule-table th:nth-child(3) { width: 7rem; }
.rule-table th:nth-child(4) { width: 34%; }
.rule-table th:nth-child(5) { width: 8rem; }

.rule-table td {
    vertical-align: top;
}

.rule-table .rule-id {
    color: #31506e;
    font-weight: 700;
    text-align: right;
}

.rule-main-row td {
    border-bottom: none;
}

.rule-meaning-row td {
    background: #fbfcfd;
    border-top: none;
    padding-top: 0;
}

.rule-meaning-row td:last-child {
    color: #3f4d5f;
    padding-bottom: 0.9rem;
}

.rule-meaning-row strong {
    color: #13263a;
    font-size: 0.95rem;
}

.rule-meaning-row span {
    margin-top: 0.2rem;
    color: #667280;
    max-width: 52rem;
}

.rule-table td strong,
.rule-table td span,
.rule-table td small {
    display: block;
}

.rule-table td small {
    margin-top: 0.2rem;
    color: #667280;
    font-size: 0.78rem;
}

.rule-table code {
    display: block;
    max-width: 26rem;
    color: #123047;
    background: #eef3f7;
    border: 1px solid #dce6ee;
    border-radius: 6px;
    padding: 0.35rem 0.45rem;
    white-space: normal;
    overflow-wrap: anywhere;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 4.5rem;
    border-radius: 999px;
    padding: 0.25rem 0.55rem;
    font-size: 0.78rem;
    font-weight: 700;
}

.status-pill.active {
    background: #dcfce7;
    color: #166534;
}

.status-pill.inactive {
    background: #e5e7eb;
    color: #4b5563;
}

.status-pill.neutral {
    background: #e0f2fe;
    color: #075985;
}

.status-pill.failed {
    background: #fee2e2;
    color: #991b1b;
}

.scan-results {
    margin-top: 1rem;
    overflow-x: auto;
}

.scan-results h3 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
}

.compact-table th,
.compact-table td {
    font-size: 0.85rem;
    white-space: nowrap;
}

.compact-table td:last-child {
    min-width: 16rem;
    white-space: normal;
}

.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-buy { background: #dcfce7; color: #166534; }
.badge-accumulate { background: #dbeafe; color: #1d4ed8; }
.badge-wait { background: #fef9c3; color: #854d0e; }
.badge-avoid { background: #fee2e2; color: #991b1b; }

button.primary {
    background: #0f2d52;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.55rem 1rem;
    cursor: pointer;
    font-size: 0.95rem;
}

button.primary:hover:not(:disabled) {
    background: #163d6e;
}

button.secondary {
    background: #fff;
    color: #0f2d52;
    border: 1px solid #cfd8e3;
    border-radius: 6px;
    padding: 0.55rem 1rem;
    cursor: pointer;
    font-size: 0.95rem;
}

button.secondary:hover:not(:disabled) {
    background: #f4f7fa;
    border-color: #b8c7d6;
}

button.primary:disabled,
button.secondary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

button.link-button {
    background: transparent;
    border: none;
    color: #0f2d52;
    cursor: pointer;
    font: inherit;
    padding: 0;
    text-decoration: underline;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(18rem, 1fr);
    gap: 1rem;
    align-items: start;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(8rem, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.form-grid.compact-form {
    grid-template-columns: repeat(2, minmax(8rem, 1fr));
}

.form-grid label {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    color: #24384d;
    font-size: 0.9rem;
}

.form-grid input,
.form-grid select {
    min-height: 2.25rem;
    border: 1px solid #cfd8e3;
    border-radius: 6px;
    padding: 0.4rem 0.5rem;
}

.wide-field {
    grid-column: span 2;
}

.form-action {
    display: flex;
    align-items: end;
}

.form-action .primary {
    min-height: 2.25rem;
    white-space: nowrap;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-top: 1rem;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-top: 1rem;
}

#blazor-error-ui {
    display: none;
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1000;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15);
    color: #7c2d12;
    padding: 0.75rem 1rem;
}

#blazor-error-ui .reload {
    color: #0f2d52;
    font-weight: 700;
    margin-left: 0.5rem;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    font-weight: 700;
    margin-left: 0.75rem;
}

.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+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

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

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

.rules-strip {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.2fr) auto;
    gap: 1rem;
    align-items: center;
    margin: 0 0 1rem;
    padding: 0.9rem 1.1rem;
    border-radius: 8px;
    border: 1px solid #d9e2ea;
    background: #fff;
}

.rules-strip p {
    margin: 0.2rem 0 0;
    color: #4b5563;
}

.rules-strip.healthy {
    border-color: #86cfa2;
    background: #f0fbf4;
}

.rules-strip.warn {
    border-color: #e8cb6b;
    background: #fffbeb;
}

.rules-strip.error {
    border-color: #f0a3a3;
    background: #fff1f2;
}

.units-caption {
    margin: 0 0 1rem;
    color: #5a6470;
    font-size: 0.92rem;
}

.retirement-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(18rem, 0.85fr);
    gap: 1rem;
    align-items: start;
}

.retirement-layout h3 {
    margin: 1.25rem 0 0.5rem;
    font-size: 1rem;
}

.retirement-layout ul {
    margin: 0;
    padding-left: 1.2rem;
    color: #374151;
}

.mc-strip {
    margin-bottom: 1rem;
}

.baseline-row {
    background: #f7fafc;
}

.scenario-results {
    overflow-x: auto;
}

.scenario-results table {
    min-width: 68rem;
}

.scenario-results th:nth-child(n+2):nth-child(-n+5),
.scenario-results td:nth-child(n+2):nth-child(-n+5) {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.delta-negative {
    color: #b42318;
}

.delta-positive {
    color: #027a48;
}

.copilot-card article {
    margin: 1rem 0;
}

.copilot-card article span {
    display: block;
    color: #5a6470;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.copilot-card article p {
    margin: 0.25rem 0 0;
}

@media (max-width: 900px) {
    .app-header,
    .page-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .nav-links {
        flex-wrap: wrap;
    }

    .metric-strip,
    .rule-layout,
    .retirement-layout,
    .rules-strip {
        grid-template-columns: 1fr;
        min-width: 0;
    }

    .home-hero,
    .home-feature-grid {
        grid-template-columns: 1fr;
    }

    .home-copy h1 {
        font-size: 2.25rem;
    }

    .rule-type-list {
        position: static;
        grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    }

    .portfolio-grid,
    .form-grid,
    .form-grid.compact-form {
        grid-template-columns: 1fr;
    }

    .wide-field {
        grid-column: auto;
    }

    .form-action .primary {
        width: 100%;
    }

    .filter-actions {
        flex-wrap: wrap;
    }
}

.filter-bar {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: end;
}

.filter-bar label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.9rem;
}

.filter-bar select {
    min-width: 10rem;
    padding: 0.4rem 0.5rem;
    border: 1px solid #cfd8e3;
    border-radius: 0.35rem;
}

.filter-actions {
    display: flex;
    gap: 0.6rem;
    align-items: end;
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
    gap: 1rem;
}

.chart-panel {
    background: #fafbfc;
    border: 1px solid #e3e8ef;
    border-radius: 0.5rem;
    padding: 0.75rem;
}

.history-chart {
    width: 100%;
    height: auto;
    background: #fff;
    border-radius: 0.35rem;
}

.chart-line {
    fill: none;
    stroke-width: 2;
}

.chart-line.price { stroke: #0f2d52; }
.chart-line.ma50 { stroke: #2a9d8f; }
.chart-line.ma200 { stroke: #e76f51; }
.chart-line.score { stroke: #264653; }

.chart-legend {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

.legend::before {
    content: "";
    display: inline-block;
    width: 0.75rem;
    height: 0.15rem;
    margin-right: 0.35rem;
    vertical-align: middle;
}

.legend.price::before { background: #0f2d52; }
.legend.ma50::before { background: #2a9d8f; }
.legend.ma200::before { background: #e76f51; }

/* Supplied Investor brand assets and shared public footer. */
.brand { flex-shrink: 0; }
.brand a { display: inline-flex; align-items: center; }
.brand-logo { width: 150px; height: auto; display: block; border-radius: 4px; }
.app-header { background: #0b1c42; flex-wrap: wrap; }
.nav-links { flex-wrap: wrap; }
.site-footer { background: #fff; border-top: 1px solid #dbe3ed; padding: 1.25rem 1.5rem; }
.site-footer-inner { max-width: 1400px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.footer-brand { display: flex; align-items: center; gap: .85rem; min-width: 0; }
.footer-logo { width: 105px; height: auto; display: block; }
.footer-brand > a { flex-shrink: 0; }
.footer-copyright { margin: 0; color: #58677a; font-size: .8rem; line-height: 1.5; }
.footer-links { display: flex; flex-wrap: wrap; gap: .75rem; }
.footer-links a { color: #24384d; text-decoration: none; }
.footer-links a:not(:last-child) { border-inline-end: 1px solid #c8d3df; padding-inline-end: .75rem; }
.footer-links a:hover, .footer-links a:focus-visible { text-decoration: underline; }
.footer-note { margin: 0; color: #58677a; font-size: .8rem; line-height: 1.5; }
.policy-page { max-width: 900px; line-height: 1.65; }
.policy-page h2 { margin-top: 1.5rem; }
@media (max-width: 600px) {
    .site-footer { padding: 1rem; }
    .site-footer-inner { align-items: flex-start; }
    .footer-links { flex-basis: 100%; }
    .brand-logo { width: 125px; }
}

.home-feature-grid p + p { margin-top: .75rem; }
.home-get-started { margin-top: 1.5rem; }
.home-get-started .muted { margin-top: 1rem; }

.home-questions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; margin: 0 0 2rem; }
.home-questions article { border-left: 3px solid #2463eb; padding: .25rem 0 .25rem 1rem; }
.home-questions h2 { color: #102033; font-size: 1.25rem; margin: 0 0 .5rem; }
.home-questions p { color: #4b5563; line-height: 1.6; margin: 0; }
@media (max-width: 900px) { .home-questions { grid-template-columns: 1fr; } }

.home-copilot { margin-top: 1.5rem; }

.feature-card-heading { display: flex; align-items: baseline; gap: .65rem; margin-bottom: .5rem; }
.feature-card-heading h2 { margin: 0; }
.feature-card-heading span { flex-shrink: 0; }
.home-copy .home-access-note { color: #5a6470; font-size: .9rem; margin: .75rem 0 0; }

.trial-reminder { display: flex; align-items: flex-start; gap: 1rem; padding: 1rem 1.25rem; margin: 0 0 1.25rem; border: 1px solid #b9d0f4; border-left: 4px solid #2463eb; border-radius: .6rem; background: #f1f6ff; color: #24384d; }
.trial-reminder > div { flex: 1; min-width: 0; }
.trial-reminder p { margin: .4rem 0 .65rem; line-height: 1.5; }
.trial-reminder a { display: inline-block; margin-right: 1rem; }
.trial-reminder button { flex-shrink: 0; }
.contextual-plus-offer:focus { outline: 2px solid #2463eb; outline-offset: 3px; }
.trial-offer label { display: block; line-height: 1.6; }
@media (max-width: 600px) { .trial-reminder { flex-direction: column; } }

/* Public introduction and focused planning-page polish. */
.app-main { box-sizing: border-box; }
.app-main .home-copy h1 { font-size: clamp(2.25rem, 4.5vw, 3.4rem); line-height: 1.12; letter-spacing: -.035em; }
.home-hero { gap: 2.5rem; padding-top: 2.5rem; }
.home-copy .eyebrow, .planning-page .eyebrow, .billing-page .eyebrow, .about-page .eyebrow {
    display: block; color: #426384; font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; margin-bottom: .65rem;
}
.home-actions .button-link { border-radius: .7rem; min-height: 2.8rem; box-sizing: border-box; }
.home-actions .primary:hover { background: #163d6b; }
.home-panel { border-radius: 1.25rem; padding: 1.5rem; gap: 1rem; box-shadow: 0 12px 32px rgba(15, 45, 82, .07); border-top: 4px solid #2a9d8f; }
.home-panel .home-panel-label { font-size: .8rem; color: #426384; font-weight: 600; margin: 0 0 .25rem; }
.home-panel div { padding-bottom: 1rem; }
.home-questions { gap: 1rem; }
.home-questions article { background: #fff; border: 1px solid #dce5ee; border-radius: 1rem; padding: 1.4rem; box-shadow: 0 3px 12px rgba(15, 45, 82, .03); }
.question-number { display: inline-flex; align-items: center; justify-content: center; width: 2.1rem; height: 2.1rem; margin-bottom: .85rem; border-radius: .65rem; background: #edf4fc; color: #345c86; font-size: .8rem; font-weight: 700; }
.home-questions h2 { margin-bottom: .65rem; }
.planning-page .page-heading { display: grid; gap: 1.5rem; padding: .5rem 0; }
.planning-page .page-heading h1, .billing-page h1 { font-size: 2rem; letter-spacing: -.025em; }
.planning-page .page-heading p, .billing-page .page-heading p { line-height: 1.6; max-width: 52rem; }
.planning-page .metric-strip { min-width: 0; }
.planning-page .metric-tile { border-radius: .85rem; padding: 1.1rem 1.2rem; min-width: 0; }
.planning-page .metric-tile strong { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; font-size: clamp(1.15rem, 2vw, 1.65rem); }
.planning-page .card, .billing-page .card { border: 1px solid #e0e7ef; border-radius: 1rem; box-shadow: 0 3px 14px rgba(15, 45, 82, .035); padding: 1.5rem; }
.planning-page .setup-guide { background: linear-gradient(120deg, #f0f7ff, #fff); border-color: #ccdfef; }
.setup-steps { display: flex; flex-wrap: wrap; gap: .75rem 2rem; padding-left: 1.25rem; margin: 1rem 0 0; color: #426384; font-size: .9rem; }
.setup-steps li { padding-left: .15rem; }
.planning-page .view-tabs { gap: .5rem; flex-wrap: wrap; padding: .4rem; background: #e8edf3; border-radius: .8rem; width: fit-content; }
.planning-page .view-tabs button { border-radius: .6rem; padding: .55rem 1.15rem; border-color: transparent; }
.planning-page .data-table { font-variant-numeric: tabular-nums; }
.planning-page .data-table th { color: #344e6b; }
.planning-page .units-caption { line-height: 1.6; }
.subscription-overview { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1.5rem; background: #f1f6fc; border: 1px solid #d9e5f2; border-radius: .9rem; padding: 1.25rem; margin: 1rem 0 1.5rem; }
.subscription-name { display: block; color: #183b61; font-size: 1.65rem; letter-spacing: -.025em; }
.subscription-overview p { margin: .4rem 0 0; }
.subscription-detail { display: grid; gap: .35rem; color: #426384; }
.subscription-detail strong { color: #183b61; font-size: 1.1rem; }
.subscription-detail small { font-size: .8rem; }
.billing-page .plan-comparison { overflow-x: auto; }
.plan-comparison .data-table { width: 100%; min-width: 430px; }
.plan-comparison thead th { background: #f1f6fc; color: #183b61; }
.plan-comparison thead span { display: block; font-size: .8rem; font-weight: 400; margin-top: .35rem; }
.plan-comparison .comparison-note { margin: 1rem 0 0; font-size: .9rem; }
.billing-page .account-data-card { border-top: 3px solid #b8c8d9; }
.about-page { max-width: 1050px; margin: 0 auto; }
.about-hero { padding: 2rem 0 2.5rem; max-width: 46rem; }
.app-main .about-hero h1 { color: #102033; font-size: clamp(2.25rem, 4vw, 3rem); line-height: 1.15; letter-spacing: -.035em; }
.about-hero p { color: #4b5563; font-size: 1.15rem; line-height: 1.7; margin: 1rem 0 0; }
.about-layout { display: grid; grid-template-columns: 1.2fr 1fr; gap: 1.25rem; }
.about-layout .card { padding: 1.75rem; border: 1px solid #dce5ee; border-radius: 1rem; box-shadow: 0 3px 14px rgba(15, 45, 82, .035); }
.about-layout h2 { color: #183b61; font-size: 1.35rem; line-height: 1.4; margin-bottom: 1rem; }
.about-layout p { line-height: 1.75; }
.about-principles { background: #f0f6fb; }
.about-principles ul { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.about-principles li + li { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid #d9e5ef; }
.about-principles strong, .about-principles span { display: block; }
.about-principles strong { color: #183b61; margin-bottom: .4rem; }
.about-principles span { color: #4b5563; line-height: 1.6; }
.about-note { padding: 1rem 0; color: #58677a; line-height: 1.7; font-size: .9rem; }
.about-note p { margin: 0 0 .75rem; }
.home-actions a:focus-visible, .about-page a:focus-visible, .planning-page button:focus-visible { outline: 3px solid #2463eb; outline-offset: 3px; }
@media (max-width: 700px) {
    .home-hero { grid-template-columns: 1fr; gap: 1.5rem; padding-top: 1.5rem; }
    .home-panel { padding: 1.25rem; }
    .about-layout { grid-template-columns: 1fr; }
    .about-hero { padding: 1.25rem 0 1.75rem; }
    .planning-page .metric-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .planning-page .card, .billing-page .card, .about-layout .card { padding: 1.15rem; }
    .subscription-overview { align-items: flex-start; }
}

.auth-card .provider-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    gap: 0.8rem;
    min-height: 2.85rem;
    padding: 0.7rem 1rem;
    border-radius: 0.7rem;
    background: #fff;
    border-color: #747775;
    color: #1f1f1f;
    font-weight: 600;
}

.auth-card .provider-button:hover,
.auth-card .provider-button:focus {
    background: #f8fafc;
    color: #1f1f1f;
}

.auth-card .provider-button:focus-visible {
    outline: 3px solid #0078d4;
    outline-offset: 3px;
}

.provider-logo {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.recovery-form {
    margin: 3rem auto;
    padding: 1.5rem;
}

.recovery-form form {
    display: grid;
    gap: 0.75rem;
}

.recovery-form input[type=email], .recovery-form button {
    min-height: 44px;
    padding: 0.65rem;
}

.auth-provider-group {
    width: 100%;
    max-width: 24rem;
    margin-inline: auto;
}

.auth-provider-group .auth-actions {
    display: grid;
    gap: 0.7rem;
}

.auth-provider-group .provider-button {
    width: 100%;
    box-shadow: 0 2px 5px rgba(15, 23, 42, 0.06);
    transition: background-color 150ms, box-shadow 150ms;
}

.auth-provider-group .provider-button:hover {
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
}

.auth-help-link {
    margin: 1.5rem 0 0;
    text-align: center;
    font-size: 0.9rem;
}

.auth-help-link a {
    display: inline-block;
    padding: 0.35rem 0;
    text-underline-offset: 0.2em;
}

.signin-help-start h2 {
    margin: 1.5rem 0 0.75rem;
    font-size: 1.1rem;
    line-height: 1.45;
}

.signin-help-situations {
    margin-top: 1.5rem;
    border-top: 1px solid #dce5ee;
}

.signin-help-situations details {
    padding: 1rem 0;
    border-bottom: 1px solid #dce5ee;
}

.signin-help-situations summary {
    cursor: pointer;
    color: #183b61;
    font-weight: 600;
    line-height: 1.5;
}

.signin-help-situations summary:focus-visible {
    outline: 3px solid #0078d4;
    outline-offset: 4px;
    border-radius: 0.2rem;
}

.signin-help-situations details p,
.signin-help-situations details ol {
    margin: 0.85rem 0 0;
    line-height: 1.65;
}

.signin-help-situations li + li {
    margin-top: 0.5rem;
}
