:root {
    color-scheme: light;
    --bg: #eef1f4;
    --surface: #ffffff;
    --surface-soft: #f6f8f5;
    --border: #c7d0c0;
    --border-soft: #dde4d8;
    --text: #182016;
    --muted: #52604c;
    --muted-strong: #2f3a2b;
    --green: #059669;
    --green-soft: #dcfce7;
    --red: #be123c;
    --red-soft: #ffe4e6;
    --amber-soft: #fef3c7;
    --yellow: #b77900;
    --yellow-soft: #fff8d7;
    --shadow: rgba(24, 32, 22, 0.05);
    --control-bg: #ffffff;
    --control-bg-focus: #f8fafc;
    --control-border: #b8c2b3;
    --control-text: #182016;
    --control-placeholder: #697565;
    /* Symbol Detail empty states (SIG-474): gray when the data does not
       exist, slate blue when it has not loaded. Never amber. */
    --empty-none-bg: #e7ece3;
    --empty-none-text: #46523f;
    --empty-pending-bg: #e3ebf5;
    --empty-pending-text: #33557a;
}

html {
    background: var(--bg);
    color: var(--text);
    /* iPhone Safari otherwise enlarges text inside wide blocks. */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

* {
    box-sizing: border-box;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: "TOSSans", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 17px;
    line-height: 1.5;
    margin: 0;
    transition: background-color 180ms ease, color 180ms ease;
}

body.theme-switching,
body.theme-switching * {
    animation: none !important;
    transition: none !important;
}

.app-loading-state {
    align-items: center;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    font-size: 0.84rem;
    font-style: normal;
    gap: 0.7rem;
    justify-content: center;
    min-height: 7rem;
    padding: 2rem 1rem;
    text-align: center;
}

.app-loading-state-inline {
    flex-direction: row;
    min-height: 0;
    padding: 0.8rem 0.2rem;
}

.app-loading-state-compact {
    min-height: 4.5rem;
    padding: 1rem;
}

.app-loading-state-inline.app-loading-state-compact {
    min-height: 0;
    padding: 0;
}

.app-loading-spinner {
    animation: app-loading-spin 0.7s linear infinite;
    border: 2px solid var(--control-border);
    border-radius: 50%;
    border-top-color: var(--green);
    display: block;
    flex: 0 0 auto;
    height: 1.35rem;
    width: 1.35rem;
}

@keyframes app-loading-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .app-loading-spinner { animation: none; }
}

a {
    color: inherit;
}

.page {
    margin: 0 auto;
    max-width: 1500px;
    padding: 1.5rem 1.25rem 3.5rem;
}

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

.brand {
    align-items: center;
    color: inherit;
    display: inline-flex;
    gap: 0.75rem;
    text-decoration: none;
}

.brand img {
    height: 3rem;
    width: auto;
}

.brand-wordmark,
.brand-name {
    color: var(--text);
    font-family: "Inter Tight", "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 2.25rem;
    font-weight: 500;
    letter-spacing: 0;
    line-height: 1;
    text-transform: none;
}

.brand-logo-dark {
    display: none;
}

.actions,
.site-nav {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    box-shadow: 0 1px 2px var(--shadow);
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
    justify-content: flex-end;
    padding: 0.25rem;
}

.nav-group {
    align-items: center;
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.site-nav {
    background: rgba(255, 255, 255, 0.76);
    border-color: #d8dfd2;
}

.nav-link,
.theme-btn,
.app-nav-btn {
    align-items: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 0.55rem;
    color: var(--muted);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    gap: 0.35rem;
    height: 2.2rem;
    justify-content: center;
    line-height: 1;
    padding: 0 0.85rem;
    text-decoration: none;
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
    white-space: nowrap;
    width: 8.75rem;
}

.nav-standalone-icon {
    align-items: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 0.55rem;
    color: var(--muted);
    cursor: pointer;
    display: inline-flex;
    flex: 0 0 auto;
    font: inherit;
    height: 2.2rem;
    justify-content: center;
    line-height: 1;
    padding: 0;
    text-decoration: none;
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
    width: 2.2rem;
}

.nav-standalone-icon:hover {
    background: var(--surface-soft);
    color: var(--text);
}

.nav-standalone-icon:focus-visible {
    background: #e5ecdf;
    border-color: #cad7c0;
    color: var(--text);
    outline: 2px solid #4b5b43;
    outline-offset: 2px;
}

.nav-standalone-icon svg {
    flex: 0 0 auto;
    height: 1.3rem;
    width: 1.3rem;
}

.nav-theme-icon {
    display: inline-block;
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1;
}

.content-button {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.55rem;
    color: var(--muted);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    gap: 0.35rem;
    height: 2.2rem;
    justify-content: center;
    line-height: 1;
    padding: 0 0.85rem;
    text-decoration: none;
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
    white-space: nowrap;
    width: 8.75rem;
}

.nav-link:hover,
.theme-btn:hover,
.content-button:hover {
    background: var(--surface-soft);
    color: var(--text);
}

.content-button:disabled {
    cursor: wait;
    opacity: 0.72;
}

.app-inline-feedback {
    color: var(--muted);
    display: block;
    font-size: 0.75rem;
    line-height: 1.35;
    margin-top: 0.4rem;
}

.app-inline-feedback:empty {
    display: none;
}

.app-inline-feedback[data-tone="error"] {
    color: var(--red);
}

.app-inline-feedback[data-tone="warning"] {
    color: var(--yellow);
}

.app-inline-feedback-block {
    flex-basis: 100%;
    margin-top: 0;
    width: 100%;
}

.app-inline-confirmation-text {
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
}

.app-nav-btn:hover {
    background: #eef2ea;
    color: var(--text);
}

.nav-link:focus-visible,
.theme-btn:focus-visible,
.app-nav-btn:focus-visible,
.content-button:focus-visible {
    background: #e5ecdf;
    border-color: #cad7c0;
    color: var(--text);
    outline: 2px solid #4b5b43;
    outline-offset: 2px;
}

.nav-link[aria-current="page"],
.app-nav-btn[aria-current="page"],
.nav-standalone-icon[aria-current="page"] {
    background: #e5ecdf;
    border-color: #cad7c0;
    color: var(--text);
}

.form-control {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.55rem;
    color: var(--text);
    font: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    height: 2.2rem;
    line-height: 1;
    padding: 0 0.65rem;
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.form-control:hover {
    background: var(--surface-soft);
}

.form-control:focus-visible {
    border-color: #4b5b43;
    outline: 2px solid #4b5b43;
    outline-offset: 2px;
}

.app-form .bg-white {
    background: var(--surface) !important;
}

.app-form .border-slate-100,
.app-form .border-slate-200,
.app-form .border-slate-300,
.app-form .option-type-card {
    border-color: var(--border-soft) !important;
}

.app-form .text-slate-900,
.app-form .text-slate-800,
.app-form .text-slate-700,
.app-form .text-slate-600 {
    color: var(--text) !important;
}

.app-form .text-slate-500,
.app-form .text-slate-400 {
    color: var(--muted) !important;
}

.app-form input:not([type="checkbox"]),
.app-form select,
.app-form textarea {
    background: var(--surface);
    border-color: var(--border-soft);
    color: var(--text);
}

.app-form input::placeholder,
.app-form textarea::placeholder {
    color: #8b9585;
}

.app-form input[type="checkbox"] {
    accent-color: var(--green);
}

.app-form input:focus,
.app-form select:focus,
.app-form textarea:focus {
    border-color: #6b7280 !important;
    box-shadow: none !important;
    outline: none !important;
}

.app-form-note {
    background: var(--surface-soft);
    border: 1px solid var(--border-soft);
    color: var(--muted);
}

.app-form-note-title {
    color: var(--text);
}

.app-panel {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px var(--shadow);
}

.auth-page {
    min-height: 100vh;
}

.auth-shell {
    margin: 0 auto;
    max-width: 30rem;
    padding: 4rem 1.25rem;
}

.auth-brand {
    justify-content: center;
    margin-bottom: 1.25rem;
    width: 100%;
}

.auth-panel {
    padding: 1.5rem;
}

.auth-form {
    display: grid;
    gap: 1rem;
}

.auth-account-details legend {
    color: var(--muted-strong);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 0;
    text-transform: uppercase;
}

.auth-account-details {
    border: 0;
    display: grid;
    gap: 1rem;
    margin: 0;
    padding: 0;
}

.auth-account-details legend {
    margin-bottom: 0.5rem;
}

.auth-trial-note {
    align-items: center;
    background: color-mix(in srgb, var(--green) 5%, var(--surface-soft));
    border: 1px solid color-mix(in srgb, var(--green) 25%, var(--border-soft));
    border-radius: 0.4rem;
    color: var(--muted-strong);
    display: flex;
    font-size: 0.8rem;
    gap: 0.5rem;
    margin: 0;
    padding: 0.65rem 0.75rem;
}

body.auth-page.auth-page-registration .page-heading p.auth-confirm-address {
    color: var(--text);
    font-size: 1.15rem;
    overflow-wrap: anywhere;
}

.auth-trial-note span {
    color: var(--green);
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1;
}

.auth-trial-ended-note {
    border-radius: 0.5rem;
    padding: 0.85rem;
}

.auth-trial-ended-note p {
    margin: 0.35rem 0 0;
}

.auth-trial-ended-note + .button_to {
    margin-top: 0.75rem;
}

.auth-field {
    display: grid;
    gap: 0.35rem;
}

.auth-field label {
    color: var(--muted-strong);
    font-size: 0.82rem;
    font-weight: 700;
}

.auth-field-help {
    color: var(--muted);
    font-size: 0.76rem;
}

.auth-field input {
    border: 1px solid var(--border-soft);
    border-radius: 0.55rem;
    font: inherit;
    min-height: 2.75rem;
    padding: 0.6rem 0.75rem;
    width: 100%;
}

.auth-submit {
    margin-top: 0.25rem;
    width: 100%;
}

/* Reserves the Turnstile widget's 65px so the button does not jump when it loads. */
.auth-turnstile {
    min-height: 65px;
}

.auth-links {
    color: var(--muted);
    font-size: 0.85rem;
    margin-top: 1rem;
    text-align: center;
}

/* Administrator second factor (SIG-300). */
.auth-help {
    color: var(--muted);
    font-size: 0.82rem;
    margin: 1rem 0 0;
}

.auth-steps {
    display: grid;
    gap: 1.25rem;
    margin: 0;
    padding-left: 1.25rem;
}

.auth-steps p {
    margin: 0 0 0.5rem;
}

/* White behind the code in both themes: scanners need dark modules on light. */
.auth-qr {
    background: #fff;
    border-radius: 0.5rem;
    display: inline-block;
    line-height: 0;
    padding: 0.75rem;
}

.auth-qr svg {
    height: auto;
    max-width: 100%;
    width: 12rem;
}

.auth-secret,
.auth-recovery-codes code {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.9rem;
    overflow-wrap: anywhere;
}

.auth-recovery-codes {
    display: grid;
    gap: 0.4rem 1rem;
    grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
    list-style: none;
    margin: 0 0 1.25rem;
    padding: 0;
}

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

.auth-consent {
    align-items: flex-start;
    color: var(--muted-strong);
    display: flex;
    font-size: 0.82rem;
    gap: 0.55rem;
    line-height: 1.4;
}

.auth-consent input {
    accent-color: var(--green);
    flex: none;
    height: 1rem;
    margin: 0.1rem 0 0;
    width: 1rem;
}

.legal-links {
    color: var(--muted);
    display: flex;
    font-size: 0.78rem;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
}

.legal-links a {
    color: inherit;
}

body.legal-page .auth-shell {
    max-width: 46rem;
}

.legal-document {
    color: var(--muted-strong);
    font-size: 0.95rem;
    line-height: 1.6;
}

.legal-document h2 {
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 700;
    margin: 1.75rem 0 0.5rem;
}

.legal-document p,
.legal-document ul {
    margin: 0 0 0.85rem;
}

.legal-document ul {
    padding-left: 1.25rem;
}

.legal-document li + li {
    margin-top: 0.35rem;
}

.legal-providers {
    display: grid;
    gap: 0.75rem;
    margin: 0 0 1rem;
}

.legal-provider {
    border: 1px solid var(--border-soft);
    border-radius: 0.4rem;
    padding: 0.75rem 0.9rem;
}

.legal-provider dt {
    color: var(--text);
    font-weight: 700;
}

.legal-provider dd {
    margin: 0.2rem 0 0;
}

.legal-provider dd span {
    color: var(--muted);
}

.legal-document .legal-caps {
    font-size: 0.88rem;
    text-transform: uppercase;
}

@media (max-width: 34rem) {
    body.auth-page-registration .auth-shell {
        padding: 2.5rem 1rem;
    }

    body.auth-page-registration .auth-brand {
        margin-bottom: 1rem;
    }

    body.auth-page-registration .auth-panel {
        padding: 1.25rem;
    }

}

.auth-flash {
    background: var(--surface-soft);
    border: 1px solid var(--border-soft);
    border-radius: 0.5rem;
    color: var(--muted-strong);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    padding: 0.65rem 0.75rem;
}

.auth-flash-error {
    background: var(--red-soft);
    color: var(--red);
}

.auth-resend {
    border-top: 1px solid var(--border-soft);
    margin-top: 1rem;
    padding-top: 1rem;
}

.auth-resend summary {
    color: var(--muted-strong);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 700;
    text-align: center;
}

.auth-resend summary:focus-visible {
    border-radius: 0.25rem;
    outline: 2px solid var(--green);
    outline-offset: 0.25rem;
}

.auth-resend-panel {
    margin-top: 0.85rem;
}

.auth-resend-panel > p {
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.45;
    margin: 0 0 0.85rem;
}

/* Canonical content frame for every route rendered by the Admin layout. */
.admin-page {
    max-width: 1500px;
}

.admin-context {
    align-items: center;
    color: var(--muted);
    display: flex;
    font-size: 0.8rem;
    gap: 0.5rem;
    justify-content: flex-end;
    margin: -0.35rem 0 1rem;
}

.admin-sign-out {
    width: auto;
}

.admin-subscription-panel {
    display: grid;
    gap: 0.75rem;
    margin-top: 0.75rem;
    padding: 1rem;
}

.admin-subscription-panel h2,
.admin-subscription-panel p {
    margin: 0;
}

.admin-subscription-panel p {
    color: var(--muted);
    margin-top: 0.3rem;
}

/* One setting per row: what it does on the left, the one action on the right. */
.admin-setting-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    justify-content: space-between;
}

.admin-setting-row + .admin-setting-row {
    border-top: 1px solid var(--border-soft);
    padding-top: 0.75rem;
}

.admin-setting-row > div {
    flex: 1 1 24rem;
}

.admin-setting-row h2,
.admin-setting-row h3 {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
}

.admin-subscription-form {
    align-items: end;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.admin-subscription-field {
    min-width: 12rem;
}

/* The shared button is a fixed 8.75rem; this label is longer. */
.admin-subscription-form .content-button {
    width: auto;
}

.admin-subscription-field select {
    border: 1px solid var(--border-soft);
    border-radius: 0.55rem;
    font: inherit;
    min-height: 2.75rem;
    padding: 0.6rem 0.75rem;
}

.admin-user-title {
    font-size: 1.5rem !important;
    line-height: 1.85rem !important;
    overflow-wrap: anywhere;
}

.admin-trial-help-email-control {
    align-items: center;
    display: flex;
    gap: 0.5rem;
}

.admin-trial-help-email-control .content-button {
    font-size: 0.7rem;
    height: 1.65rem;
    min-height: 0;
    padding: 0 0.55rem;
    width: auto;
}

.admin-user-summary {
    padding: 0;
}

.admin-user-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
}

.admin-user-summary-grid > div {
    display: grid;
    gap: 0.25rem;
    min-width: 0;
    padding: 0.9rem 1rem;
}

.admin-user-summary-grid > div + div {
    border-left: 1px solid var(--border-soft);
}

.admin-user-summary-grid strong {
    font-size: 0.9rem;
}

.admin-user-actions-panel,
.admin-user-billing-panel {
    display: grid;
    gap: 0.75rem;
    margin-top: 0.75rem;
    padding: 1rem;
}

.admin-panel-heading h2,
.admin-panel-heading p {
    margin: 0;
}

.admin-panel-heading h2 {
    font-size: 1rem;
}

.admin-panel-heading p,
.admin-inline-note {
    color: var(--muted);
    font-size: 0.82rem;
    margin-top: 0.25rem;
}

.admin-user-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.admin-nav-menu {
    position: relative;
}

.admin-desktop-nav {
    flex-wrap: nowrap;
}

/* Nav buttons are a fixed 8.75rem everywhere else, which is right for the
   customer nav's four items and wrong here: six admin groups reserve 840px of
   width before the brand, the theme toggle, and Sign out are laid out at all,
   so the row overflowed from 1200px down and pushed Sign out off the page.
   Sizing to content costs nothing visually -- these are grouped dropdowns with
   a caret, not a row that needs to look like equal columns. The mobile menu
   already overrides the same property for the same reason. */
.admin-desktop-nav {
    gap: 0.1rem;
}

.admin-desktop-nav .app-nav-btn {
    min-width: 0;
    padding: 0 0.6rem;
    width: auto;
}

.admin-mobile-navigation {
    display: none;
}

.admin-nav-menu summary {
    list-style: none;
}

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

.admin-nav-menu-caret {
    color: var(--muted);
    font-size: 0.7rem;
    transition: transform 150ms ease;
}

.admin-nav-menu[open] .admin-nav-menu-caret {
    transform: rotate(180deg);
}

.admin-nav-menu-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.55rem;
    box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.16);
    display: grid;
    gap: 0.2rem;
    left: 0;
    min-width: 11rem;
    padding: 0.35rem;
    position: absolute;
    top: calc(100% + 0.35rem);
    z-index: 20;
}

.admin-nav-menu-end .admin-nav-menu-panel {
    left: auto;
    right: 0;
}

.admin-nav-menu-section {
    color: var(--muted);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    padding: 0.55rem 0.75rem 0.15rem;
    text-transform: uppercase;
}

.admin-nav-mobile-panel {
    max-height: min(70vh, 32rem);
    min-width: min(20rem, calc(100vw - 2.5rem));
    overflow-y: auto;
}

.admin-nav-menu-item {
    border-radius: 0.4rem;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.65rem 0.75rem;
    text-decoration: none;
}

.admin-nav-menu-item:hover,
.admin-nav-menu-item[aria-current="page"] {
    background: var(--surface-soft);
    color: var(--text);
}

.admin-nav-current {
    cursor: default;
}

.admin-heading {
    align-items: flex-end;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.admin-heading-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: flex-end;
}

.admin-heading-actions form,
.admin-page .button_to {
    margin: 0;
}

.admin-stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 1rem;
}

.admin-adapters-heading {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.admin-adapters-heading h1 {
    font-size: 1.7rem;
}

.admin-adapters-heading p {
    font-size: 0.82rem;
}

.admin-adapters-note {
    background: var(--surface-soft);
    border: 1px solid var(--border-soft);
    border-radius: 0.55rem;
    color: var(--muted-strong);
    font-size: 0.78rem;
    line-height: 1.45;
    margin-bottom: 1rem;
    padding: 0.7rem 0.85rem;
}

.admin-adapters-section + .admin-adapters-section {
    margin-top: 1.25rem;
}

.admin-adapters-section .admin-section-heading {
    align-items: end;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 0.55rem;
}

.admin-adapters-section .admin-section-heading h2,
.admin-adapters-section .admin-section-heading p {
    margin: 0;
}

.admin-adapters-section .admin-section-heading h2 {
    font-size: 1rem;
}

.admin-adapters-section .admin-section-heading p,
.admin-adapters-section .admin-section-heading > span {
    color: var(--muted);
    font-size: 0.72rem;
}

.admin-adapters-list {
    overflow: hidden;
    padding: 0;
}

.admin-adapter-profile {
    align-items: end;
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(16rem, 1fr) minmax(22rem, 1.2fr);
    padding: 0.8rem 0.95rem;
}

.admin-adapter-profile-form {
    justify-self: end;
    max-width: 31rem;
    width: 100%;
}

.admin-trial-emails-heading {
    align-items: center;
}

.admin-trial-email-section .admin-section-heading,
.admin-trial-email-preview .admin-section-heading {
    align-items: end;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 0.55rem;
}

.admin-trial-email-section .admin-section-heading h2,
.admin-trial-email-section .admin-section-heading p,
.admin-trial-email-preview .admin-section-heading h2,
.admin-trial-email-preview .admin-section-heading p {
    margin: 0;
}

.admin-trial-email-section .admin-section-heading h2,
.admin-trial-email-preview .admin-section-heading h2 {
    font-size: 1rem;
}

.admin-trial-email-section .admin-section-heading p,
.admin-trial-email-section .admin-section-heading > span,
.admin-trial-email-preview .admin-section-heading p {
    color: var(--muted);
    font-size: 0.72rem;
}

.app-table.admin-trial-email-table {
    min-width: 78rem;
}

.app-table.admin-system-email-table {
    min-width: 68rem;
}

.app-table.admin-system-email-table th:nth-child(1) {
    width: 20%;
}

.app-table.admin-system-email-table th:nth-child(2) {
    width: 46%;
}

.app-table.admin-system-email-table th:nth-child(3) {
    width: 18%;
}

.app-table.admin-trial-email-table th:nth-child(1) {
    width: 15%;
}

.app-table.admin-trial-email-table th:nth-child(2) {
    width: 43%;
}

.app-table.admin-trial-email-table th:nth-child(3),
.app-table.admin-trial-email-table th:nth-child(4) {
    width: 12%;
}

.app-table.admin-trial-email-table td {
    vertical-align: top;
}

.admin-trial-email-identity,
.admin-trial-email-copy {
    display: grid;
    gap: 0.3rem;
}

.admin-trial-email-identity > span:not(.app-status-pill),
.admin-trial-email-copy > span,
.admin-trial-email-copy p {
    color: var(--muted);
    font-size: 0.72rem;
    line-height: 1.4;
}

.admin-trial-email-identity .app-status-pill {
    justify-self: start;
    margin-top: 0.15rem;
}

.admin-trial-email-copy p {
    color: var(--muted-strong);
    margin: 0.15rem 0;
}

.admin-trial-email-copy strong {
    color: var(--text);
    font-size: 0.65rem;
    margin-right: 0.25rem;
    text-transform: uppercase;
}

.app-table.admin-trial-email-audit-table {
    min-width: 82rem;
}

.admin-trial-email-audit-table td:first-child span {
    display: block;
    margin-top: 0.2rem;
}

.admin-trial-email-audit-values {
    color: var(--muted);
    font-size: 0.68rem;
    line-height: 1.45;
    max-width: 24rem;
}

.admin-trial-email-edit-grid {
    align-items: start;
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1.05fr) minmax(22rem, 0.95fr);
}

.admin-trial-email-editor {
    padding: 1.15rem;
}

.admin-trial-email-editor form {
    display: grid;
    gap: 1rem;
}

.admin-trial-email-editor textarea {
    min-height: 8rem;
    resize: vertical;
}

.admin-trial-email-protected-summary {
    border-bottom: 1px solid var(--border-soft);
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 1rem;
    padding-bottom: 1rem;
}

.admin-trial-email-protected-summary > div {
    display: grid;
    gap: 0.25rem;
}

.admin-trial-email-protected-summary span {
    color: var(--muted);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
}

.admin-trial-email-protected-summary strong {
    font-size: 0.82rem;
}

.admin-trial-email-field-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
}

.admin-trial-email-timing-field input {
    max-width: 10rem;
}

.admin-trial-email-rule-note {
    background: var(--surface-soft);
    border: 1px solid var(--border-soft);
    border-radius: 0.55rem;
    color: var(--muted-strong);
    font-size: 0.75rem;
    line-height: 1.45;
    padding: 0.75rem 0.85rem;
}

.admin-trial-email-editor-actions {
    display: flex;
    gap: 0.6rem;
    justify-content: flex-end;
}

.admin-trial-email-editor-actions .admin-secondary-action {
    background: var(--surface-soft);
    border-color: var(--border);
    color: var(--text);
}

.admin-trial-email-preview {
    min-width: 0;
}

.admin-trial-email-preview-card,
.admin-trial-email-preview-empty {
    margin-bottom: 0.75rem;
    padding: 0.9rem;
}

.admin-trial-email-preview-card > strong {
    display: block;
    font-size: 0.86rem;
    margin-top: 0.4rem;
}

.admin-trial-email-preview-card iframe {
    background: #fff;
    border: 1px solid var(--border-soft);
    border-radius: 0.35rem;
    display: block;
    margin-top: 0.55rem;
    min-height: 18rem;
    overflow: hidden;
    width: 100%;
}

.admin-trial-email-preview-card pre {
    background: var(--surface-soft);
    border: 1px solid var(--border-soft);
    border-radius: 0.35rem;
    color: var(--text);
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.7rem;
    line-height: 1.55;
    margin: 0.55rem 0 0;
    max-height: 18rem;
    overflow: auto;
    padding: 0.75rem;
    white-space: pre-wrap;
}

.admin-email-template-heading {
    align-items: center;
}

.admin-email-template-grid {
    align-items: start;
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1.05fr) minmax(22rem, 0.95fr);
}

.admin-email-template-editor {
    padding: 1.15rem;
}

.admin-email-template-editor form {
    display: grid;
    gap: 1rem;
}

.admin-email-template-editor .admin-section-heading,
.admin-email-template-preview .admin-section-heading {
    margin-bottom: 0.55rem;
}

.admin-email-template-editor .admin-section-heading h2,
.admin-email-template-editor .admin-section-heading p,
.admin-email-template-preview .admin-section-heading h2,
.admin-email-template-preview .admin-section-heading p {
    margin: 0;
}

.admin-email-template-editor .admin-section-heading h2,
.admin-email-template-preview .admin-section-heading h2 {
    font-size: 1rem;
}

.admin-email-template-editor .admin-section-heading p,
.admin-email-template-preview .admin-section-heading p {
    color: var(--muted);
    font-size: 0.72rem;
}

.admin-email-template-color-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-email-template-color-control > div {
    align-items: center;
    background: var(--surface-soft);
    border: 1px solid var(--border-soft);
    border-radius: 0.45rem;
    display: flex;
    gap: 0.65rem;
    min-height: 2.65rem;
    padding: 0.35rem 0.5rem;
}

.admin-email-template-color-control input[type="color"] {
    background: transparent;
    border: 0;
    cursor: pointer;
    height: 2rem;
    padding: 0;
    width: 2.65rem;
}

.admin-email-template-color-control code {
    color: var(--muted-strong);
    font-size: 0.72rem;
}

.admin-email-template-region-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(10rem, 0.6fr) minmax(0, 1.4fr);
}

.admin-email-template-region-grid input[type="number"] {
    max-width: 10rem;
}

.admin-email-template-preview {
    min-width: 0;
}

.admin-email-template-preview-card {
    padding: 0.9rem;
}

.admin-email-template-preview-card iframe {
    background: #fff;
    border: 1px solid var(--border-soft);
    border-radius: 0.35rem;
    height: 34rem;
    width: 100%;
}

.app-table.admin-email-template-audit-table {
    min-width: 78rem;
}

.admin-adapter-row {
    align-items: center;
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(20rem, 1.5fr) minmax(13rem, 0.8fr) minmax(19rem, 0.9fr);
    min-width: 0;
    padding: 0.8rem 0.95rem;
}

.admin-adapter-row + .admin-adapter-row {
    border-top: 1px solid var(--border-soft);
}

.admin-adapter-function,
.admin-adapter-active,
.admin-adapter-fixed-status {
    display: grid;
    gap: 0.18rem;
    min-width: 0;
}

.admin-adapter-function strong,
.admin-adapter-active strong {
    font-size: 0.82rem;
    line-height: 1.25;
}

.admin-adapter-function > span,
.admin-adapter-function small,
.admin-adapter-fixed-status small {
    color: var(--muted);
    font-size: 0.72rem;
    line-height: 1.35;
}

.admin-adapter-function small {
    color: var(--muted-strong);
}

.admin-adapter-label {
    color: var(--muted);
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.admin-adapter-active .app-status-pill,
.admin-adapter-fixed-status .app-status-pill {
    font-size: 0.6rem;
    justify-self: start;
    padding: 0.2rem 0.38rem;
}

/* SIG-524. Admin Provider Usage plan form. */
.admin-provider-plan p { margin: 0.4rem 0; }
.admin-provider-plan-form {
    align-items: end;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.6rem;
}
.admin-provider-plan-form label { display: grid; gap: 0.3rem; }

.admin-adapter-form {
    align-items: end;
    display: grid;
    gap: 0.45rem;
    grid-template-columns: minmax(10rem, 1fr) auto;
    margin: 0;
}

.admin-adapter-form label {
    display: grid;
    gap: 0.3rem;
    grid-column: 1;
}

/* SIG-512. "Route to" and "Backstop" stack; one Apply button beside both. */
.admin-adapter-form .content-button {
    align-self: end;
    grid-column: 2;
    grid-row: 1 / span 2;
}

.admin-adapter-form select.app-field {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239da7b1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-position: right 0.65rem center;
    background-repeat: no-repeat;
    font-size: 0.75rem;
    min-height: 2.25rem;
    padding: 0.45rem 2rem 0.45rem 0.65rem;
}

.admin-adapter-form .content-button {
    font-size: 0.72rem;
    min-height: 2.25rem;
    padding: 0.45rem 0.75rem;
    width: auto;
}

.admin-adapter-fixed-status {
    justify-items: start;
}

/* Signals AI tabs and evaluation trends (SIG-508). Check colours are the
   dataviz reference categorical order, one fixed slot per check, validated for
   colour-blind separation in both themes. */
:root {
    --admin-eval-check-1: #2a78d6;
    --admin-eval-check-2: #eb6834;
    --admin-eval-check-3: #1baf7a;
    --admin-eval-check-4: #eda100;
    --admin-eval-check-5: #e87ba4;
    --admin-eval-check-6: #008300;
    --admin-eval-check-7: #4a3aa7;
    --admin-eval-check-8: #e34948;
    --admin-eval-transport: #6b7468;
    --admin-eval-other: #c7d0c0;
    --admin-eval-ttft: #33557a;
}

body.dark-mode {
    --admin-eval-check-1: #3987e5;
    --admin-eval-check-2: #d95926;
    --admin-eval-check-3: #199e70;
    --admin-eval-check-4: #c98500;
    --admin-eval-check-5: #d55181;
    --admin-eval-check-6: #008300;
    --admin-eval-check-7: #9085e9;
    --admin-eval-check-8: #e66767;
    --admin-eval-transport: #7a7a7a;
    --admin-eval-other: #4a4a4a;
    --admin-eval-ttft: #a9c1dc;
}

.admin-page-tabs {
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 0.25rem;
    margin: 0 0 1rem;
    overflow-x: auto;
}

.admin-page-tabs a {
    border-bottom: 2px solid transparent;
    color: var(--muted-strong);
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: -1px;
    padding: 0.45rem 0.8rem;
    text-decoration: none;
    white-space: nowrap;
}

.admin-page-tabs a:hover {
    color: var(--text);
}

.admin-page-tabs a[aria-current="page"] {
    border-bottom-color: var(--green);
    color: var(--text);
}

.admin-eval-section {
    margin-bottom: 1.25rem;
}

.app-panel.admin-eval-section,
.admin-eval-empty {
    padding: 1rem 1.1rem;
}

.admin-eval-empty h2 {
    font-size: 1.05rem;
    margin: 0 0 0.35rem;
}

.admin-eval-empty p {
    color: var(--muted);
    font-size: 0.85rem;
    margin: 0;
    max-width: 62ch;
}

.admin-eval-callout {
    background: var(--yellow-soft);
    border: 1px solid var(--border-soft);
    border-radius: 0.5rem;
    font-size: 0.82rem;
    line-height: 1.45;
    margin-bottom: 0.85rem;
    padding: 0.6rem 0.85rem;
}

.admin-eval-callout strong {
    color: var(--yellow);
}

.admin-eval-callout-negative {
    background: var(--red-soft);
}

.admin-eval-callout-negative strong {
    color: var(--red);
}

.app-stat-grid.admin-eval-stat-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.admin-eval-charts {
    display: grid;
}

.admin-eval-chart-row {
    align-items: center;
    display: grid;
    gap: 0.75rem;
    grid-template-columns: 8.5rem minmax(0, 1fr);
    padding: 0.2rem 0;
}

.admin-eval-chart-row + .admin-eval-chart-row {
    border-top: 1px solid var(--border-soft);
}

.admin-eval-chart-meta {
    display: grid;
    font-size: 0.72rem;
    gap: 0.05rem;
}

.admin-eval-chart-meta strong {
    font-size: 0.82rem;
}

.admin-eval-chart-meta span {
    color: var(--muted);
}

.admin-eval-chart-meta .admin-eval-now {
    color: var(--text);
    font-size: 1rem;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.admin-eval-chart {
    display: block;
    height: auto;
    overflow: visible;
    width: 100%;
}

.admin-eval-tick {
    fill: var(--muted);
    font-size: 10px;
    font-variant-numeric: tabular-nums;
}

.admin-eval-grid {
    stroke: var(--border-soft);
    stroke-width: 1;
}

.admin-eval-marker {
    stroke: var(--yellow);
    stroke-dasharray: 3 3;
    stroke-width: 1.25;
}

.admin-eval-chip {
    fill: var(--yellow-soft);
    stroke: var(--yellow);
}

.admin-eval-chip-text {
    fill: var(--yellow);
    font-size: 9.5px;
    font-weight: 700;
}

.admin-eval-line {
    fill: none;
    stroke-linejoin: round;
    stroke-width: 2;
}

.admin-eval-area {
    opacity: 0.08;
    stroke: none;
}

.admin-eval-dot {
    fill: var(--surface);
    stroke-width: 1.5;
}

.admin-eval-line.admin-eval-pass, .admin-eval-dot.admin-eval-pass { stroke: var(--green); }
.admin-eval-area.admin-eval-pass, .admin-eval-dot-last.admin-eval-pass { fill: var(--green); }
.admin-eval-line.admin-eval-cost, .admin-eval-dot.admin-eval-cost,
.admin-eval-line.admin-eval-latency, .admin-eval-dot.admin-eval-latency { stroke: var(--muted-strong); }
.admin-eval-dot-last.admin-eval-cost, .admin-eval-dot-last.admin-eval-latency { fill: var(--muted-strong); }
.admin-eval-line.admin-eval-ttft, .admin-eval-dot.admin-eval-ttft { stroke: var(--admin-eval-ttft); }
.admin-eval-dot-last.admin-eval-ttft { fill: var(--admin-eval-ttft); }

.admin-eval-segment.admin-eval-check-1 { fill: var(--admin-eval-check-1); }
.admin-eval-segment.admin-eval-check-2 { fill: var(--admin-eval-check-2); }
.admin-eval-segment.admin-eval-check-3 { fill: var(--admin-eval-check-3); }
.admin-eval-segment.admin-eval-check-4 { fill: var(--admin-eval-check-4); }
.admin-eval-segment.admin-eval-check-5 { fill: var(--admin-eval-check-5); }
.admin-eval-segment.admin-eval-check-6 { fill: var(--admin-eval-check-6); }
.admin-eval-segment.admin-eval-check-7 { fill: var(--admin-eval-check-7); }
.admin-eval-segment.admin-eval-check-8 { fill: var(--admin-eval-check-8); }
.admin-eval-segment.admin-eval-check-transport { fill: var(--admin-eval-transport); }
.admin-eval-segment.admin-eval-check-other { fill: var(--admin-eval-other); }

.admin-eval-hover-col {
    fill: transparent;
}

.admin-eval-hover-col.is-active {
    fill: var(--surface-soft);
}

body.dark-mode .admin-eval-hover-col.is-active {
    fill: #2b2b2b;
}

.admin-eval-tip {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.45rem;
    box-shadow: 0 8px 24px var(--shadow);
    display: grid;
    font-size: 0.76rem;
    gap: 0.2rem;
    max-width: 20rem;
    min-width: 13rem;
    padding: 0.55rem 0.7rem;
    pointer-events: none;
    position: fixed;
    z-index: 30;
}

.admin-eval-tip[hidden] {
    display: none;
}

.admin-eval-tip dl {
    display: grid;
    gap: 0.1rem 0.9rem;
    grid-template-columns: auto auto;
    margin: 0;
}

.admin-eval-tip dt {
    align-items: center;
    color: var(--muted);
    display: inline-flex;
    gap: 0.35rem;
}

.admin-eval-tip dd {
    font-variant-numeric: tabular-nums;
    margin: 0;
    text-align: right;
}

.admin-eval-tip-sub {
    color: var(--muted);
}

.admin-eval-tip-heading {
    color: var(--muted);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
    text-transform: uppercase;
}

.admin-eval-tip-changes {
    color: var(--yellow);
    font-weight: 600;
    margin-top: 0.25rem;
}

.admin-eval-zero {
    fill: var(--border);
}

.admin-eval-hit rect {
    cursor: pointer;
    fill: transparent;
}


.admin-eval-legend,
.admin-eval-key {
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    font-size: 0.74rem;
    gap: 0.35rem 1rem;
    margin-top: 0.7rem;
}

.admin-eval-legend > span,
.admin-eval-key > span {
    align-items: center;
    display: inline-flex;
    gap: 0.3rem;
}

.admin-eval-swatch {
    border-radius: 2px;
    display: inline-block;
    flex: none;
    height: 0.65rem;
    width: 0.65rem;
}

.admin-eval-swatch.admin-eval-pass { background: var(--green); }
.admin-eval-swatch.admin-eval-latency { background: var(--muted-strong); }
.admin-eval-swatch.admin-eval-ttft { background: var(--admin-eval-ttft); }
.admin-eval-swatch.admin-eval-check-1 { background: var(--admin-eval-check-1); }
.admin-eval-swatch.admin-eval-check-2 { background: var(--admin-eval-check-2); }
.admin-eval-swatch.admin-eval-check-3 { background: var(--admin-eval-check-3); }
.admin-eval-swatch.admin-eval-check-4 { background: var(--admin-eval-check-4); }
.admin-eval-swatch.admin-eval-check-5 { background: var(--admin-eval-check-5); }
.admin-eval-swatch.admin-eval-check-6 { background: var(--admin-eval-check-6); }
.admin-eval-swatch.admin-eval-check-7 { background: var(--admin-eval-check-7); }
.admin-eval-swatch.admin-eval-check-8 { background: var(--admin-eval-check-8); }
.admin-eval-swatch.admin-eval-check-transport { background: var(--admin-eval-transport); }
.admin-eval-swatch.admin-eval-check-other { background: var(--admin-eval-other); }

.admin-eval-kind {
    border: 1px solid var(--border-soft);
    border-radius: 0.25rem;
    font-size: 0.62rem;
    padding: 0 0.25rem;
}

.admin-eval-filters {
    align-items: end;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 0.9rem;
    margin-bottom: 0.85rem;
}

.admin-eval-filters label {
    color: var(--muted);
    display: grid;
    font-size: 0.72rem;
    font-weight: 700;
    gap: 0.2rem;
}

.admin-eval-filters .admin-eval-check-field {
    align-items: center;
    color: var(--muted-strong);
    display: inline-flex;
    font-size: 0.82rem;
    font-weight: 500;
    gap: 0.35rem;
    min-height: 2.1rem;
}

.admin-eval-runs {
    --app-table-numeric-font-size: 0.8rem;
}

.admin-eval-runs td {
    white-space: nowrap;
}

.admin-eval-row-link {
    cursor: pointer;
}

.admin-eval-row-link:hover td {
    background: var(--surface-soft);
}

.admin-eval-row-muted td {
    color: var(--muted);
}

.admin-eval-versions {
    display: flex;
    gap: 0.2rem;
}

.admin-eval-version {
    border: 1px solid var(--border-soft);
    border-radius: 0.25rem;
    color: var(--muted);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.66rem;
    padding: 0.05rem 0.3rem;
    white-space: nowrap;
}

.admin-eval-version-changed {
    background: var(--yellow-soft);
    border-color: var(--yellow);
    color: var(--yellow);
    font-weight: 700;
}

.admin-eval-pager {
    align-items: center;
    display: flex;
    font-size: 0.8rem;
    gap: 1rem;
    justify-content: flex-end;
    padding-top: 0.7rem;
}

.admin-eval-crumbs {
    font-size: 0.8rem;
    margin: 0 0 0.2rem;
}

.admin-eval-stamp {
    display: grid;
    gap: 0.6rem 1rem;
    grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
    margin: 0;
}

.admin-eval-stamp div {
    display: grid;
    gap: 0.05rem;
    min-width: 0;
}

.admin-eval-stamp dt {
    color: var(--muted);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.admin-eval-stamp dd {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.76rem;
    margin: 0;
    overflow-wrap: anywhere;
}

.admin-eval-stamp dd.admin-eval-stamp-changed {
    color: var(--yellow);
    font-weight: 700;
}

.admin-eval-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.admin-eval-chip {
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 1rem;
    color: var(--muted-strong);
    display: inline-flex;
    font-size: 0.8rem;
    font-weight: 600;
    gap: 0.35rem;
    padding: 0.25rem 0.7rem;
    text-decoration: none;
}

.admin-eval-chip span {
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.admin-eval-chip[aria-current="true"] {
    background: var(--text);
    border-color: var(--text);
    color: var(--surface);
}

.admin-eval-chip[aria-current="true"] span {
    color: var(--surface);
}

.admin-eval-chip.is-empty {
    opacity: 0.5;
}

.admin-eval-category {
    align-items: end;
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

.admin-eval-category label {
    color: var(--muted);
    display: grid;
    font-size: 0.72rem;
    font-weight: 700;
    gap: 0.2rem;
}

.admin-eval-scenarios {
    overflow-x: auto;
}

.admin-eval-scenario-head,
.admin-eval-scenario > summary {
    align-items: center;
    display: grid;
    gap: 0.6rem;
    grid-template-columns: 1rem minmax(14rem, 2.4fr) minmax(8rem, 1fr) 6.5rem minmax(9rem, 1.4fr) 4.5rem 4.5rem 7rem;
    min-width: 58rem;
    padding: 0.45rem 0.55rem;
}

.admin-eval-scenario-head {
    border-bottom: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.admin-eval-scenario {
    border-bottom: 1px solid var(--border-soft);
}

.admin-eval-scenario > summary {
    cursor: pointer;
    font-size: 0.84rem;
    list-style: none;
}

.admin-eval-scenario > summary::-webkit-details-marker {
    display: none;
}

.admin-eval-scenario > summary:hover,
.admin-eval-scenario[open] > summary {
    background: var(--surface-soft);
}

.admin-eval-caret {
    color: var(--muted);
    transition: transform 120ms ease;
}

.admin-eval-scenario[open] .admin-eval-caret {
    transform: rotate(90deg);
}

.admin-eval-scenario-id {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.76rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-eval-failed-gates {
    color: var(--red);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.72rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-eval-num {
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.admin-eval-history {
    display: inline-flex;
    gap: 2px;
    justify-content: flex-end;
}

.admin-eval-history i {
    border-radius: 2px;
    height: 0.9rem;
    width: 0.5rem;
}

.admin-eval-history i.is-pass {
    background: var(--green);
    opacity: 0.75;
}

.admin-eval-history i.is-fail {
    background: var(--red);
}

.admin-eval-panel-slot {
    padding: 0.2rem 0.9rem 1rem 2.2rem;
}

.admin-eval-panel {
    display: grid;
    gap: 0.5rem 1.5rem;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
}

.admin-eval-panel section {
    min-width: 0;
}

.admin-eval-panel h3 {
    align-items: center;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    font-size: 0.68rem;
    font-weight: 800;
    gap: 0.5rem;
    letter-spacing: 0.05em;
    margin: 0.85rem 0 0.35rem;
    text-transform: uppercase;
}

.admin-eval-panel h3 .admin-secondary {
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}

.admin-eval-not-recorded {
    border: 1px dashed var(--border);
    border-radius: 0.4rem;
    color: var(--muted);
    font-size: 0.8rem;
    margin: 0;
    padding: 0.45rem 0.65rem;
}

.admin-eval-turn {
    border-left: 3px solid var(--border);
    color: var(--muted-strong);
    font-size: 0.84rem;
    margin-bottom: 0.35rem;
    padding-left: 0.6rem;
}

.admin-eval-turn b {
    color: var(--muted);
    display: block;
    font-size: 0.66rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.admin-eval-question {
    border-left: 3px solid var(--green);
    font-weight: 600;
    margin: 0;
    padding-left: 0.6rem;
}

.admin-eval-kv {
    display: grid;
    font-size: 0.8rem;
    gap: 0.2rem 0.9rem;
    grid-template-columns: max-content minmax(0, 1fr);
    margin: 0;
}

.admin-eval-kv dt {
    color: var(--muted);
}

.admin-eval-kv dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.admin-eval-context {
    font-size: 0.8rem;
    margin-top: 0.4rem;
}

.admin-eval-context summary {
    color: var(--green);
    cursor: pointer;
    font-weight: 600;
}

.admin-eval-context pre {
    background: var(--surface-soft);
    border: 1px solid var(--border-soft);
    border-radius: 0.4rem;
    font-size: 0.7rem;
    max-height: 18rem;
    overflow: auto;
    padding: 0.55rem 0.65rem;
    white-space: pre-wrap;
}

.admin-eval-tools {
    display: grid;
    font-size: 0.78rem;
    gap: 0.3rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.admin-eval-tools li {
    border: 1px solid var(--border-soft);
    border-radius: 0.35rem;
    display: grid;
    gap: 0.15rem;
    overflow-wrap: anywhere;
    padding: 0.3rem 0.5rem;
}

.admin-eval-answer {
    background: var(--surface-soft);
    border: 1px solid var(--border-soft);
    border-radius: 0.4rem;
    font-size: 0.86rem;
    line-height: 1.55;
    max-width: 72ch;
    padding: 0.65rem 0.8rem;
}

.admin-eval-answer p {
    margin: 0 0 0.55rem;
}

.admin-eval-answer p:last-child {
    margin: 0;
}

.admin-eval-answer mark {
    background: var(--yellow-soft);
    border-bottom: 2px solid var(--yellow);
    color: inherit;
}

.app-table.admin-eval-gates {
    --app-table-body-font-size: 0.78rem;
    --app-table-body-padding-block: 0.3rem;
    --app-table-body-padding-inline: 0.4rem;
    min-width: 0;
}

.app-table.admin-eval-gates td {
    vertical-align: top;
    white-space: normal;
}

.admin-eval-ok {
    color: var(--green);
}

.admin-eval-bad {
    color: var(--red);
    font-weight: 700;
}

.admin-eval-verdict {
    border: 1px solid var(--border-soft);
    border-radius: 0.4rem;
    display: grid;
    font-size: 0.82rem;
    gap: 0.25rem;
    margin-bottom: 0.45rem;
    padding: 0.5rem 0.65rem;
}

.admin-eval-verdict p {
    margin: 0;
}

.admin-eval-verdict-head {
    align-items: center;
    display: flex;
    font-weight: 700;
    justify-content: space-between;
}

.admin-eval-measure > summary {
    align-items: baseline;
    cursor: pointer;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.75rem;
}

.admin-eval-measure dl {
    display: grid;
    gap: 0.75rem;
    margin: 0.85rem 0 0;
}

.admin-eval-measure dl > div {
    align-items: baseline;
    display: grid;
    gap: 0.75rem;
    grid-template-columns: 5rem minmax(0, 1fr);
}

.admin-eval-measure dt {
    font-size: 1.25rem;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    text-align: right;
}

.admin-eval-measure dt small {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 500;
}

.admin-eval-measure dd {
    color: var(--muted-strong);
    font-size: 0.84rem;
    margin: 0;
    max-width: 72ch;
}

@media (max-width: 900px) {
    .app-stat-grid.admin-eval-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-eval-charts {
        overflow-x: auto;
    }

    .admin-eval-chart-row {
        grid-template-columns: 6.5rem 40rem;
    }

    .admin-eval-panel {
        grid-template-columns: 1fr;
    }

    .admin-eval-panel-slot {
        padding-left: 0.6rem;
    }

    .admin-eval-category {
        margin-left: 0;
    }
}

.admin-signals-ai-readiness {
    display: grid;
    gap: 0.65rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 1.25rem;
}

.admin-signals-ai-fact {
    align-content: start;
    display: grid;
    gap: 0.22rem;
    min-height: 5.4rem;
    padding: 0.75rem 0.85rem;
}

.admin-signals-ai-fact strong {
    font-size: 0.88rem;
}

.admin-signals-ai-fact small {
    color: var(--muted);
    font-size: 0.7rem;
    line-height: 1.35;
}

.admin-signals-ai-fact .app-status-pill {
    font-size: 0.6rem;
    justify-self: start;
    padding: 0.2rem 0.38rem;
}

.admin-signals-ai-fact-form {
    margin: 0.45rem 0 0;
}

.admin-signals-ai-fact .admin-signals-ai-fact-action {
    font-size: 0.72rem;
    padding: 0.35rem 0.7rem;
    width: auto;
}

.admin-signals-ai-configuration {
    padding: 0;
}

/* One column of labelled groups, each a row of equal fields, then the save row. */
.admin-signals-ai-form {
    display: grid;
    margin: 0;
}

.admin-signals-ai-group {
    border: 0;
    border-bottom: 1px solid var(--border-soft);
    margin: 0;
    min-width: 0;
    padding: 0.95rem 1rem 1.05rem;
}

.admin-signals-ai-group > legend {
    float: left;
    margin-bottom: 0.7rem;
    padding: 0;
    width: 100%;
}

.admin-signals-ai-group-grid {
    align-items: start;
    clear: both;
    display: grid;
    gap: 0.9rem 1.25rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-signals-ai-group-grid-access {
    align-items: center;
    grid-template-columns: minmax(15rem, 1fr) minmax(0, 2fr);
}

.admin-signals-ai-toggle {
    align-items: flex-start;
    background: var(--surface-soft);
    border: 1px solid var(--border-soft);
    border-radius: 0.35rem;
    cursor: pointer;
    display: flex;
    gap: 0.65rem;
    padding: 0.7rem 0.8rem;
}

.admin-signals-ai-toggle input {
    accent-color: var(--green);
    flex: 0 0 auto;
    height: 1rem;
    margin: 0.15rem 0 0;
    width: 1rem;
}

.admin-signals-ai-toggle span,
.admin-signals-ai-model-field {
    display: grid;
    gap: 0.3rem;
    min-width: 0;
}

.admin-signals-ai-toggle strong {
    font-size: 0.82rem;
}

.admin-signals-ai-field-label {
    color: var(--text);
    font-size: 0.76rem;
    font-weight: 600;
}

.admin-signals-ai-field-label em {
    color: var(--muted);
    font-style: normal;
    font-weight: 500;
    margin-left: 0.2rem;
}

.admin-signals-ai-toggle small,
.admin-signals-ai-model-field small {
    color: var(--muted);
    font-size: 0.68rem;
    line-height: 1.4;
}

.admin-signals-ai-model-field .app-field {
    width: 100%;
}

.admin-signals-ai-model-field input[type="number"].app-field {
    font-family: "JetBrains Mono", monospace;
    max-width: 11rem;
}

body.dark-mode .admin-signals-ai-model-field input[type="number"].app-field {
    background-color: #2a2a2a;
    border-color: #3a3a3a;
    color: #d6d6d6;
}

body.dark-mode .admin-signals-ai-model-field input[type="number"].app-field:focus {
    border-color: var(--green);
    outline: 0;
}

.admin-signals-ai-warning {
    color: var(--yellow) !important;
}

.admin-signals-ai-form-footer {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding: 0.8rem 1rem;
}

.admin-signals-ai-form-footer span {
    color: var(--muted);
    font-size: 0.7rem;
}

.admin-signals-ai-form .admin-signals-ai-save,
body.dark-mode .admin-signals-ai-form .admin-signals-ai-save {
    background: var(--green);
    border-color: var(--green);
    color: #0b1410;
    font-weight: 700;
    width: auto;
}

.admin-signals-ai-form .admin-signals-ai-save:hover,
.admin-signals-ai-form .admin-signals-ai-save:focus-visible,
body.dark-mode .admin-signals-ai-form .admin-signals-ai-save:hover,
body.dark-mode .admin-signals-ai-form .admin-signals-ai-save:focus-visible {
    background: #73d091;
    border-color: #73d091;
}

.admin-signals-ai-guardrails {
    display: grid;
    gap: 0;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 0;
}

.admin-signals-ai-guardrails span {
    color: var(--muted);
    display: grid;
    font-size: 0.7rem;
    gap: 0.12rem;
    padding: 0.7rem 0.85rem;
}

.admin-signals-ai-guardrails span + span {
    border-left: 1px solid var(--border-soft);
}

.admin-signals-ai-guardrails strong {
    color: var(--text);
    font-size: 0.82rem;
}

.admin-signals-ai-events {
    min-width: 64rem;
}

.admin-signals-ai-events code {
    color: var(--text);
    font-size: 0.7rem;
    overflow-wrap: anywhere;
    white-space: normal;
}

.admin-signals-ai-events td small {
    color: var(--muted);
    display: block;
    font-size: 0.64rem;
    margin-top: 0.2rem;
}

@media (max-width: 1080px) {
    .admin-signals-ai-group-grid,
    .admin-signals-ai-group-grid-access {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .admin-signals-ai-readiness,
    .admin-signals-ai-guardrails {
        grid-template-columns: 1fr;
    }

    .admin-signals-ai-guardrails span + span {
        border-left: 0;
        border-top: 1px solid var(--border-soft);
    }

    .admin-signals-ai-form-footer {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .admin-signals-ai-form .content-button {
        width: 100%;
    }
}

body.dark-mode .admin-adapter-form select.app-field {
    background-color: #2a2a2a;
    border-color: #3a3a3a;
    color: #d6d6d6;
}

body.dark-mode .admin-adapter-form select.app-field option {
    background: #202020;
    color: #eeeeee;
}

.admin-provider-controls {
    align-items: end;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.65rem;
}

.admin-provider-heading h1 {
    font-size: 1.7rem;
}

.admin-provider-heading p {
    font-size: 0.78rem;
}

.admin-provider-controls label {
    display: grid;
    gap: 0.35rem;
    min-width: 12rem;
}

.admin-provider-controls label > span {
    color: var(--muted);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.admin-signals-ai-model-field select.app-field,
.admin-provider-controls select.app-field,
.admin-provider-billing-form select.app-field,
.admin-provider-plan-form select.app-field {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239da7b1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    padding-right: 2.25rem;
}

body.dark-mode .admin-signals-ai-model-field select.app-field,
body.dark-mode .admin-provider-controls select.app-field,
body.dark-mode .admin-provider-controls input[type="date"].app-field,
body.dark-mode .admin-provider-billing-form select.app-field,
body.dark-mode .admin-provider-plan-form .app-field,
body.dark-mode .admin-provider-reconciliation-form .app-field {
    background-color: #2a2a2a;
    border-color: #3a3a3a;
    color: #d6d6d6;
}

body.dark-mode .admin-signals-ai-model-field select.app-field:focus,
body.dark-mode .admin-provider-controls select.app-field:focus,
body.dark-mode .admin-provider-controls input[type="date"].app-field:focus,
body.dark-mode .admin-provider-billing-form select.app-field:focus,
body.dark-mode .admin-provider-plan-form .app-field:focus,
body.dark-mode .admin-provider-reconciliation-form .app-field:focus {
    background-color: #2f2f2f;
    border-color: var(--green);
}

body.dark-mode .admin-signals-ai-model-field select.app-field option,
body.dark-mode .admin-provider-controls select.app-field option,
body.dark-mode .admin-provider-billing-form select.app-field option,
body.dark-mode .admin-provider-plan-form select.app-field option {
    background: #2a2a2a;
    color: #d6d6d6;
}

body.dark-mode .admin-signals-ai-model-field select.app-field:disabled {
    background-color: #252525;
    color: #8b8b8b;
    cursor: not-allowed;
    opacity: 1;
}

/* SIG-186 conversation review: the purpose note leads the page, and a
   transcript keeps the customer's own line breaks. */
.admin-signals-ai-review-purpose {
    margin-bottom: 1rem;
}

.admin-signals-ai-transcript {
    display: grid;
    gap: 0.75rem;
}

.admin-signals-ai-transcript-message {
    border: 1px solid var(--border-soft);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
}

.admin-signals-ai-transcript-user {
    background: var(--surface-soft);
}

.admin-signals-ai-transcript-content {
    margin: 0.5rem 0 0;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.admin-provider-controls .content-button {
    height: 2rem;
    width: auto;
}

.admin-provider-advanced-filters {
    align-self: end;
    flex: 0 0 auto;
    padding-bottom: 0.45rem;
}

.admin-provider-advanced-filters[open] {
    flex-basis: 100%;
    padding-bottom: 0;
}

.admin-provider-advanced-filters summary,
.admin-provider-reconciliation-history summary {
    color: var(--muted);
    cursor: pointer;
    font-size: 0.74rem;
    font-weight: 700;
}

.admin-provider-advanced-filters > div {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    margin-top: 0.75rem;
}

.admin-provider-advanced-filters label {
    min-width: 0;
}

.admin-provider-advanced-filters .app-field {
    min-width: 0;
    width: 100%;
}

.admin-provider-settings-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: minmax(18rem, 0.8fr) minmax(34rem, 1.7fr);
    margin-bottom: 1rem;
}

.admin-provider-billing-settings {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 0.65rem 0.75rem;
}

.admin-provider-billing-settings h2,
.admin-provider-billing-settings p,
.admin-provider-plan-settings h2,
.admin-provider-plan-settings p {
    margin: 0;
}

.admin-provider-billing-settings h2,
.admin-provider-plan-settings h2 {
    font-size: 0.8rem;
}

.admin-provider-billing-settings p,
.admin-provider-plan-settings p {
    color: var(--muted);
    font-size: 0.66rem;
    margin-top: 0.2rem;
}

.admin-provider-billing-form {
    align-items: end;
    display: flex;
    gap: 0.6rem;
}

.admin-provider-plan-settings {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 0.65rem 0.75rem;
}

.admin-provider-plan-form {
    align-items: end;
    display: flex;
    gap: 0.6rem;
}

.admin-provider-billing-form label,
.admin-provider-plan-form label,
.admin-provider-reconciliation-form label {
    display: grid;
    gap: 0.3rem;
}

.admin-provider-billing-form label > span,
.admin-provider-plan-form label > span,
.admin-provider-reconciliation-form label > span {
    color: var(--muted);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.admin-provider-billing-form select.app-field {
    min-width: 7.5rem;
}

.admin-provider-plan-form input.app-field {
    min-width: 8rem;
    width: 9rem;
}

.admin-provider-plan-form input[type="number"].app-field {
    width: 8rem;
}

.admin-provider-plan-form select.app-field {
    min-width: 9rem;
}

.admin-provider-billing-form .content-button,
.admin-provider-plan-form .content-button,
.admin-provider-reconciliation-form .content-button {
    font-size: 0.72rem;
    height: 2rem;
    width: auto;
}

.admin-provider-billing-form .app-field,
.admin-provider-plan-form .app-field,
.admin-provider-reconciliation-form .app-field {
    font-size: 0.75rem;
    height: 2rem;
}

.admin-provider-summary-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 1rem;
}

/* Signals AI adoption carries five cards. Same specificity as the rule above
   and declared before its breakpoints, so narrow screens still collapse it. */
.admin-signals-ai-review-summary {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.admin-provider-summary-grid .app-stat-card {
    min-height: 5.25rem;
    padding: 0.72rem 0.65rem;
}

.admin-provider-summary-grid .app-stat-value {
    font-size: 1.55rem;
    margin-top: 0.38rem;
}

.admin-provider-summary-grid .app-stat-label {
    font-size: 0.65rem;
}

/* The compact grid runs a smaller type scale throughout, so the trend line
   follows its label down rather than out-sizing it. */
.admin-provider-summary-grid .app-stat-comparison {
    font-size: 0.63rem;
    margin-top: 0.3rem;
}

.admin-provider-stat-detail {
    color: var(--muted);
    font-size: 0.65rem;
    margin-top: 0.34rem;
}

.admin-provider-danger {
    color: var(--red);
    font-weight: 700;
}

.admin-provider-usage-progress {
    margin-bottom: 1rem;
    padding: 0.65rem 0.75rem;
}

.admin-provider-usage-progress > div:first-child {
    align-items: center;
    display: flex;
    font-size: 0.68rem;
    justify-content: space-between;
    margin-bottom: 0.55rem;
}

.admin-provider-usage-progress > div:first-child span {
    color: var(--muted);
}

.admin-provider-progress-track {
    background: var(--surface-soft);
    border: 1px solid var(--border-soft);
    border-radius: 999px;
    height: 0.45rem;
    overflow: hidden;
}

.admin-provider-progress-fill {
    background: var(--green);
    display: block;
    height: 100%;
}

.admin-provider-progress-watch { background: var(--yellow); }
.admin-provider-progress-warning,
.admin-provider-progress-critical { background: #f59e0b; }
.admin-provider-progress-over_limit { background: var(--red); }
.admin-provider-progress-unconfigured { background: var(--muted); }

.admin-provider-insights-grid {
    align-items: start;
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-provider-insights-main {
    display: grid;
    gap: 1rem;
    grid-column: 1 / span 3;
    grid-template-columns: minmax(0, 1fr);
    min-width: 0;
}

.admin-provider-insights-grid > .admin-provider-breakdowns {
    align-self: start;
    grid-column: 4;
    min-width: 0;
}

.admin-provider-chart-panel {
    min-width: 0;
    overflow: hidden;
    padding: 0.75rem;
}

.admin-provider-chart-panel .admin-section-heading {
    min-width: 0;
}

.admin-provider-chart-panel .admin-section-heading h2,
.admin-provider-operations-grid .admin-section-heading h2,
.admin-provider-breakdowns .admin-section-heading h2 {
    font-size: 0.86rem;
}

.admin-provider-chart-panel .admin-section-heading span,
.admin-provider-operations-grid .admin-section-heading span,
.admin-provider-breakdowns .admin-section-heading span {
    font-size: 0.68rem;
}

.admin-provider-chart-panel .admin-section-heading span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-provider-chart {
    display: grid;
    grid-template-columns: repeat(var(--chart-day-count), minmax(0, 1fr));
    height: 11.5rem;
    min-width: max(100%, calc(var(--chart-day-count) * var(--chart-day-width, 2.2rem)));
    overflow: visible;
    padding: 1rem 0.25rem 0;
}

.admin-provider-chart-scroll {
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
}

/* Plot, then the count, then the date. The count row was 3.25rem because a
   rotated label is as tall as its text is long; upright it needs one line, and
   the two reclaimed rem go to the bars. */
.admin-provider-chart-day {
    display: grid;
    grid-template-rows: minmax(0, 1fr) 1.25rem 1.7rem;
    height: 100%;
    min-width: 0;
    position: relative;
}

.admin-provider-chart-plot {
    align-items: flex-end;
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    justify-content: center;
    min-height: 0;
    position: relative;
}

.admin-provider-chart-stack {
    display: flex;
    flex-direction: column-reverse;
    justify-content: flex-start;
    max-width: 0.85rem;
    min-height: 1px;
    overflow: hidden;
    width: 52%;
}

.admin-provider-chart-success,
.admin-provider-chart-failure {
    display: block;
    min-height: 1px;
}

.admin-provider-chart-success { background: var(--green); }
.admin-provider-chart-failure { background: var(--red); }

.admin-provider-chart-day time {
    color: var(--muted);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.68rem;
    font-weight: 600;
    padding-top: 0.4rem;
    text-align: center;
    white-space: nowrap;
}

/* Horizontal, like every other axis label on the page. This was
   `transform: rotate(90deg)` so that a multi-digit count would fit a column
   sized for a single digit, which left the numbers reading top-to-bottom and
   turned a row of zeros into a row of ovals. The column is now sized from the
   widest count in the range instead -- see the view -- so the label has the
   room to sit the right way up. */
.admin-provider-chart-call-count {
    align-self: center;
    color: var(--text);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.72rem;
    font-weight: 400;
    justify-self: center;
    line-height: 1;
    white-space: nowrap;
}

.admin-provider-chart-call-count-zero {
    color: var(--muted);
}

.admin-provider-chart-label-start time { text-align: left; }
.admin-provider-chart-label-end time { text-align: right; }

.admin-provider-chart-future .admin-provider-chart-plot::after {
    background: var(--border-soft);
    bottom: 0;
    content: "";
    height: 0.45rem;
    left: 50%;
    position: absolute;
    width: 1px;
}

.admin-provider-chart-today-marker {
    border-right: 1px solid var(--muted);
    bottom: 0;
    position: absolute;
    right: 0;
    top: 0.55rem;
    z-index: 2;
}

.admin-provider-chart-today-marker span {
    color: var(--muted);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    position: absolute;
    right: 0.2rem;
    text-transform: uppercase;
    top: -0.8rem;
    transform: none;
}

.admin-provider-chart-legend {
    color: var(--muted);
    display: flex;
    font-size: 0.7rem;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 0.65rem;
}

.admin-provider-chart-legend span {
    align-items: center;
    display: flex;
    gap: 0.35rem;
}

.admin-provider-chart-legend i {
    display: inline-block;
    height: 0.55rem;
    width: 0.55rem;
}

.admin-provider-legend-success { background: var(--green); }
.admin-provider-legend-failure { background: var(--red); }

.admin-provider-operations-grid {
    align-items: start;
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    margin-top: 0;
}

.admin-provider-workloads {
    grid-column: 1 / span 3;
    min-width: 0;
}

.admin-provider-sidecards {
    display: grid;
    gap: 1rem;
    grid-column: 4 / span 3;
    min-width: 0;
}

.admin-provider-operations-grid .app-panel,
.admin-provider-breakdowns {
    padding: 0.75rem;
}

/* System Health (SIG-387): three short columns fit a phone; the events table
   scrolls only for its error text. */
.app-table.admin-health-windows-table { min-width: 0; }
.app-table.admin-health-events-table { min-width: 36rem; }

.admin-provider-operations-grid .admin-table {
    min-width: 0;
    table-layout: fixed;
    width: 100%;
}

.admin-provider-workloads .admin-table th:first-child,
.admin-provider-workloads .admin-table td:first-child {
    text-align: left;
    width: 44%;
}

.admin-provider-workloads .admin-table th:nth-child(2),
.admin-provider-workloads .admin-table td:nth-child(2) {
    width: 14%;
}

.admin-provider-workloads .admin-table th:nth-child(3),
.admin-provider-workloads .admin-table td:nth-child(3),
.admin-provider-workloads .admin-table th:nth-child(4),
.admin-provider-workloads .admin-table td:nth-child(4) {
    width: 21%;
}

.admin-provider-operations-grid .admin-table th:not(:first-child),
.admin-provider-operations-grid .admin-table td:not(:first-child) {
    text-align: right;
}

.admin-provider-sidecards .admin-table th:first-child,
.admin-provider-sidecards .admin-table td:first-child {
    text-align: left;
    width: 34%;
}

.admin-provider-sidecards .admin-table th:not(:first-child),
.admin-provider-sidecards .admin-table td:not(:first-child) {
    text-align: right;
    width: 22%;
}

.admin-provider-forecast-note {
    color: var(--muted);
    font-size: 0.68rem;
    line-height: 1.45;
    margin: 0.65rem 0 0;
}

.admin-public-quotes-sources {
    margin-bottom: 1rem;
    padding: 0.75rem;
}

.admin-public-quotes-sources .admin-section-heading h2 { font-size: 0.86rem; }
.admin-public-quotes-sources .admin-section-heading span { font-size: 0.68rem; }

.admin-public-quotes-sources .admin-table {
    min-width: 36rem;
    table-layout: fixed;
    width: 100%;
}

.admin-public-quotes-sources .admin-table th,
.admin-public-quotes-sources .admin-table td {
    font-size: 0.72rem;
    padding: 0.45rem 0.5rem;
    text-align: right;
}

.admin-public-quotes-sources .admin-table th:first-child,
.admin-public-quotes-sources .admin-table td:first-child {
    text-align: left;
    width: 36%;
}

.admin-provider-operations-grid .admin-table th,
.admin-provider-operations-grid .admin-table td {
    font-size: 0.72rem;
    padding: 0.45rem 0.5rem;
}

.admin-provider-reconciliation dl {
    display: grid;
    gap: 0.65rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0;
}

.admin-provider-reconciliation dl > div {
    background: var(--surface-soft);
    border: 1px solid var(--border-soft);
    border-radius: 0.4rem;
    padding: 0.65rem;
}

.admin-provider-reconciliation dt {
    color: var(--muted);
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.admin-provider-reconciliation dd {
    font-family: "JetBrains Mono", monospace;
    font-weight: 700;
    margin: 0.3rem 0 0;
}

.admin-provider-reconciliation-form {
    align-items: end;
    border-top: 1px solid var(--border-soft);
    display: flex;
    gap: 0.6rem;
    margin-top: 0.8rem;
    padding-top: 0.8rem;
}

.admin-provider-reconciliation-form .app-field {
    min-width: 11rem;
}

.admin-provider-reconciliation-history {
    border-top: 1px solid var(--border-soft);
    margin-top: 0.8rem;
    padding-top: 0.7rem;
}

.admin-provider-reconciliation-history .table-wrap {
    margin-top: 0.6rem;
    max-height: 14rem;
}

.admin-provider-reconciliation-history .admin-table {
    font-size: 0.68rem;
}

.admin-provider-good { color: var(--green); }
.admin-provider-warning { color: var(--yellow); }

.admin-provider-overlap {
    background: color-mix(in srgb, var(--yellow) 9%, transparent);
    border: 1px solid color-mix(in srgb, var(--yellow) 50%, var(--border-soft));
    border-radius: 0.4rem;
    display: grid;
    font-size: 0.75rem;
    gap: 0.25rem;
    margin-top: 0.8rem;
    padding: 0.7rem;
}

.admin-provider-overlap span { color: var(--muted); }

.admin-provider-breakdowns {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1fr);
    margin-top: 0;
    overflow: hidden;
}

.admin-provider-breakdowns > .admin-section-heading {
    grid-column: 1 / -1;
    margin-bottom: 0;
}

.admin-provider-breakdowns h3 {
    font-size: 0.76rem;
    letter-spacing: 0.08em;
    margin: 0 0 0.45rem;
    text-transform: uppercase;
}

.admin-provider-breakdowns > div {
    min-width: 0;
}

.admin-provider-breakdowns ul {
    border-top: 1px solid var(--border-soft);
    list-style: none;
    margin: 0;
    padding: 0;
}

.admin-provider-breakdowns li {
    align-items: baseline;
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    font-size: 0.76rem;
    gap: 0.5rem;
    justify-content: space-between;
    padding: 0.45rem 0;
}

.admin-provider-breakdowns li span {
    color: var(--muted);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-provider-breakdowns li strong {
    flex: 0 0 auto;
}

.admin-provider-request-table {
    border-collapse: collapse;
    min-width: 78rem;
    table-layout: fixed;
    width: 100%;
}

.admin-provider-request-table th,
.admin-provider-request-table td {
    border-bottom: 1px solid var(--border-soft);
    font-size: 0.76rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
    padding: 0.6rem 0.7rem;
    text-align: left;
    vertical-align: top;
    white-space: normal;
}

.admin-provider-request-table th {
    color: var(--muted);
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.admin-provider-request-table tr:last-child td {
    border-bottom: 0;
}

.admin-provider-request-table th:nth-child(1) { width: 10%; }
.admin-provider-request-table th:nth-child(2) { width: 18%; }
.admin-provider-request-table th:nth-child(3) { width: 15%; }
.admin-provider-request-table th:nth-child(4) { width: 9%; }
.admin-provider-request-table th:nth-child(5) { width: 13%; }
.admin-provider-request-table th:nth-child(6) { width: 11%; }
.admin-provider-request-table th:nth-child(7) { width: 16%; }
.admin-provider-request-table th:nth-child(8) { width: 8%; }

.admin-provider-request-table .admin-provider-request-feature {
    padding-right: 1.25rem;
}

.admin-provider-request-table code {
    color: var(--text);
    font-size: 0.72rem;
    overflow-wrap: anywhere;
    white-space: normal;
}

.admin-provider-request-table .admin-secondary {
    font-size: 0.68rem;
    line-height: 1.35;
    margin-top: 0.16rem;
    overflow-wrap: anywhere;
}

.admin-provider-request-table .app-status-pill {
    font-size: 0.62rem;
    min-height: 1.05rem;
    padding: 0.12rem 0.3rem;
}

.admin-provider-request-time,
.admin-provider-request-duration {
    font-variant-numeric: tabular-nums;
    white-space: nowrap !important;
}

.admin-provider-request-duration {
    font-family: "JetBrains Mono", monospace;
    text-align: right !important;
}

.admin-provider-accounting-note {
    color: var(--muted);
    font-size: 0.7rem;
    line-height: 1.5;
    margin: 1rem 0 0;
}

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

    .admin-provider-insights-grid,
    .admin-provider-operations-grid {
        grid-template-columns: 1fr;
    }

    .admin-provider-insights-grid > .admin-provider-insights-main,
    .admin-provider-insights-grid > .admin-provider-breakdowns {
        grid-column: auto;
    }

    .admin-provider-workloads,
    .admin-provider-sidecards {
        grid-column: auto;
    }

    .admin-provider-settings-grid {
        grid-template-columns: 1fr;
    }

    .admin-provider-advanced-filters > div {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

}

@media (max-width: 720px) {
    .admin-provider-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-provider-controls label,
    .admin-provider-controls .content-button {
        flex: 1 1 100%;
        width: 100%;
    }

    .admin-provider-billing-settings,
    .admin-provider-billing-form,
    .admin-provider-plan-settings,
    .admin-provider-plan-form,
    .admin-provider-reconciliation-form {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-provider-billing-form .app-field,
    .admin-provider-billing-form .content-button,
    .admin-provider-plan-form .app-field,
    .admin-provider-plan-form .content-button,
    .admin-provider-reconciliation-form .app-field,
    .admin-provider-reconciliation-form .content-button {
        width: 100%;
    }

    .admin-provider-advanced-filters > div {
        grid-template-columns: 1fr;
    }

    .admin-provider-usage-progress > div:first-child {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.2rem;
    }

    .admin-provider-chart {
        height: 8rem;
    }
}

@media (max-width: 480px) {
    .admin-provider-summary-grid,
    .admin-provider-reconciliation dl {
        grid-template-columns: 1fr;
    }
}

.admin-identity-summary {
    align-items: stretch;
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.admin-identity-counts {
    align-items: stretch;
    display: flex;
    flex: 0 0 auto;
    padding: 0.3rem;
}

.admin-identity-count {
    align-items: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 3.5rem;
    min-width: 8.75rem;
    padding: 0.35rem 0.65rem;
    text-align: center;
    white-space: nowrap;
}

.admin-identity-count + .admin-identity-count {
    border-left: 1px solid var(--border-soft);
}

.admin-identity-count .app-stat-label {
    font-size: 0.65rem;
}

.admin-identity-count .app-stat-value {
    font-size: 1.45rem;
    line-height: 1;
    margin-top: 0.25rem;
}

.admin-summary-search {
    display: flex;
    flex: 1 1 28rem;
    max-width: 48rem;
    min-width: 24rem;
    padding: 0.55rem 0.65rem;
}

.admin-summary-search .admin-search-form {
    align-items: flex-end;
    flex: 1;
    width: 100%;
}

.admin-tier-notice {
    margin-bottom: 1rem;
    padding: 1rem;
}

.admin-tier-notice p {
    color: var(--muted);
    margin: 0.35rem 0 0;
}

.admin-tier-editor-grid {
    align-items: start;
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1fr);
}

.admin-tier-feature-form {
    padding: 1.25rem;
}

.admin-tier-editor-heading {
    align-items: flex-start;
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.2rem;
    padding-bottom: 1rem;
}

.admin-tier-editor-heading h2 {
    margin: 0.2rem 0 0;
}

.admin-tier-editor-heading p {
    color: var(--muted);
    margin: 0.35rem 0 0;
}

.admin-tier-feature-form form {
    display: grid;
    gap: 1.2rem;
}

/* SIG-336 Admin billing settings. */
.admin-billing-offer-list {
    display: grid;
    gap: 0.6rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.admin-billing-offer {
    padding: 0.85rem 1rem;
}

.admin-billing-offer-summary {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.9rem;
}

.admin-billing-offer-coupon {
    font-weight: 700;
}

.admin-billing-offer-window {
    color: var(--muted);
}

.admin-billing-offer-actions {
    align-items: flex-start;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-left: auto;
}

/* Opened, the reschedule form takes the card's full width under the summary. */
.admin-billing-offer-actions:has(> .admin-billing-offer-edit[open]) {
    flex-basis: 100%;
}

.admin-billing-offer-edit[open] {
    flex-basis: 100%;
}

.admin-billing-offer-edit > summary {
    list-style: none;
}

.admin-billing-offer-edit > summary::-webkit-details-marker {
    display: none;
}

.admin-billing-offer-edit[open] > summary {
    margin-bottom: 0.6rem;
}

/* Reference material, set apart from the live tables: a muted, dashed note
   that starts collapsed. */
.admin-billing-help {
    --help-accent: #2563eb;
    background: color-mix(in srgb, var(--surface) 90%, var(--help-accent));
    border: 1px dashed color-mix(in srgb, var(--border) 50%, var(--help-accent));
    border-left: 4px solid var(--help-accent);
    border-radius: 0.75rem;
    margin: 1rem 0;
    padding: 0.75rem 1rem;
}

/* Dark surfaces sit on a near-identical background, so the tint carries the
   distinction; a lighter blue keeps it visible. */
body.dark-mode .admin-billing-help {
    --help-accent: #60a5fa;
    background: color-mix(in srgb, var(--surface) 85%, var(--help-accent));
}

.admin-billing-help > summary {
    align-items: center;
    cursor: pointer;
    display: flex;
    gap: 0.6rem;
    list-style: none;
}

.admin-billing-help > summary::-webkit-details-marker {
    display: none;
}

.admin-billing-help-mark {
    align-items: center;
    border: 1px solid var(--help-accent);
    border-radius: 999px;
    color: var(--help-accent);
    display: inline-flex;
    font-size: 0.75rem;
    font-weight: 700;
    height: 1.4rem;
    justify-content: center;
    width: 1.4rem;
}

.admin-billing-help-title {
    font-weight: 700;
}

.admin-billing-help-hint {
    color: var(--help-accent);
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    margin-left: auto;
    text-transform: uppercase;
}

.admin-billing-help-hint::after {
    content: ' ▸';
}

.admin-billing-help[open] .admin-billing-help-hint::after {
    content: ' ▾';
}

.admin-billing-help > p {
    color: var(--muted);
    margin: 0.75rem 0;
}

/* Explanatory prose, so its cells wrap where the shared table keeps one line. */
.app-table.admin-billing-model-table td {
    min-width: 9rem;
    white-space: normal;
}

.admin-billing-new-offer {
    margin-top: 0.75rem;
    padding: 1.25rem;
}

.admin-billing-new-offer h3 {
    margin: 0 0 0.75rem;
}

.admin-billing-window-form {
    align-items: end;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.admin-billing-window-form .auth-field {
    flex: 1 1 13rem;
    margin: 0;
    min-width: 0;
}

.admin-billing-price-form {
    align-items: end;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.admin-billing-price-form .auth-field {
    flex: 1 1 12rem;
    min-width: 0;
}

.admin-tier-feature-fieldset,
.admin-tier-limit-fieldset {
    border: 0;
    display: grid;
    gap: 0.75rem;
    margin: 0;
    padding: 0;
}

.admin-tier-feature-fieldset legend,
.admin-tier-limit-fieldset legend {
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.admin-tier-limit-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-tier-feature-option {
    border: 1px solid var(--border-soft);
    border-radius: 0.55rem;
    padding: 0.9rem;
}

.admin-tier-feature-option span {
    display: grid;
    gap: 0.25rem;
}

.admin-tier-feature-option .admin-tier-feature-unavailable {
    color: var(--yellow);
}

.admin-tier-planned-features,
.admin-tier-feature-warning {
    border-top: 1px solid var(--border-soft);
    color: var(--muted);
    margin: 0;
    padding-top: 1rem;
}

.admin-tier-planned-features p {
    margin: 0.35rem 0 0;
}

.admin-tier-editor-actions {
    display: flex;
    justify-content: flex-end;
}

.admin-tier-editor-footer {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 1rem;
    padding: 1rem 1.25rem;
}

.admin-tier-editor-footer p {
    margin: 0.35rem 0 0;
}

.admin-filter-panel {
    margin-bottom: 1rem;
    max-width: 42rem;
    padding: 0.75rem;
}

.admin-search-form {
    align-items: flex-end;
    display: flex;
    gap: 0.65rem;
}

.admin-search-field {
    flex: 1 1 22rem;
}

.admin-search-field input {
    height: 2.35rem;
    min-height: 2.35rem;
    padding-bottom: 0.4rem;
    padding-top: 0.4rem;
}

.admin-search-form .content-button {
    height: 2.35rem;
}

.admin-section {
    margin-top: 1.25rem;
}

.admin-section-heading {
    align-items: baseline;
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.55rem;
}

.admin-section-heading h2 {
    font-size: 1rem;
    margin: 0;
}

.admin-section-heading span {
    color: var(--muted);
    font-size: 0.78rem;
}

.admin-table {
    min-width: 760px;
}

.admin-secondary {
    color: var(--muted);
    display: block;
    font-size: 0.78rem;
}

.admin-row-action {
    height: 2rem;
    width: auto;
}

.admin-empty {
    color: var(--muted) !important;
    padding: 1.5rem !important;
    text-align: center;
}

/* SIG-496: a customer's message keeps its line breaks and wraps in its cell. */
.admin-feedback-message,
.admin-feedback-note {
    max-width: 40rem;
    min-width: 16rem;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.admin-feedback-note {
    border-left: 2px solid var(--border);
    color: var(--muted-strong);
    margin-top: 0.5rem;
    padding-left: 0.6rem;
}

.admin-feedback-review {
    min-width: 14rem;
}

.admin-feedback-review form {
    display: grid;
    gap: 0.35rem;
    margin-top: 0.5rem;
}

.admin-feedback-review details {
    margin-top: 0.5rem;
}

.admin-feedback-review summary {
    cursor: pointer;
}

/* Colours come from .app-form, in both themes. */
.admin-feedback-review textarea {
    border-style: solid;
    border-width: 1px;
    border-radius: 0.5rem;
    box-sizing: border-box;
    font: inherit;
    font-size: 0.9rem;
    padding: 0.45rem 0.6rem;
    resize: vertical;
    width: 100%;
}

.admin-invite-actions {
    align-items: center;
    display: flex;
    gap: 0.5rem;
}

.admin-invite-link {
    border: 1px solid var(--border-soft);
    border-radius: 0.45rem;
    font: inherit;
    font-size: 0.78rem;
    min-width: 11rem;
    padding: 0.35rem 0.5rem;
    width: 100%;
}

.admin-beta-code {
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.04em;
}

/* SIG-131 corporate actions ingest health. The coverage strip is a plain
   twenty-four-cell grid rather than a reuse of .admin-provider-chart, which is
   sized for a scrolling daily series and carries a today marker and a future
   hatch this page has no equivalent of. */
.admin-coverage-panel {
    overflow-x: auto;
    padding: 0.85rem 0.75rem 0.5rem;
}

.admin-coverage-chart {
    display: grid;
    gap: 0.15rem;
    grid-template-columns: repeat(24, minmax(0, 1fr));
    list-style: none;
    margin: 0;
    min-width: max(100%, 44rem);
    padding: 0;
}

.admin-coverage-month {
    display: grid;
    grid-template-rows: 6.5rem 1.2rem 1rem 0.9rem;
    min-width: 0;
}

.admin-coverage-plot {
    align-items: flex-end;
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    justify-content: center;
    min-height: 0;
}

.admin-coverage-fill {
    background: var(--green);
    border-radius: 0.12rem 0.12rem 0 0;
    display: block;
    max-width: 0.85rem;
    min-height: 2px;
    width: 60%;
}

.admin-coverage-fill-empty {
    background: var(--border-soft);
    min-height: 2px;
}

.admin-coverage-count,
.admin-coverage-month time,
.admin-coverage-year {
    font-family: "JetBrains Mono", monospace;
    text-align: center;
    white-space: nowrap;
}

.admin-coverage-count {
    color: var(--text);
    font-size: 0.62rem;
    padding-top: 0.3rem;
}

.admin-coverage-month time {
    color: var(--muted);
    font-size: 0.62rem;
    font-weight: 600;
}

.admin-coverage-year {
    color: var(--muted);
    font-size: 0.58rem;
}

.admin-corporate-actions-window {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 0.9rem;
}

.admin-corporate-actions-window strong {
    display: block;
    font-size: 0.95rem;
    margin-top: 0.35rem;
}

.admin-corporate-actions-boundary {
    margin-top: 1rem;
}

.admin-back-link {
    color: var(--muted);
    display: inline-block;
    font-size: 0.82rem;
    margin-bottom: 0.25rem;
    text-decoration: none;
}

.admin-back-link:hover {
    color: var(--text);
}

.admin-detail-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 1rem;
}

.admin-detail-grid > div {
    display: grid;
    gap: 0.3rem;
}

.admin-detail-grid strong {
    font-size: 0.88rem;
}

.admin-confirm-panel {
    max-width: 46rem;
    padding: 1.25rem;
}

.admin-confirm-panel p {
    color: var(--muted);
    margin: 0 0 1rem;
}

.admin-confirm-panel h2 {
    font-size: 1rem;
    margin: 0 0 0.75rem;
}

.admin-delete-list {
    color: var(--muted);
    line-height: 1.6;
    margin: 0 0 1rem;
    padding-left: 1.25rem;
}

.admin-danger-button {
    border-color: var(--red);
    color: var(--red);
    width: auto;
}

.admin-schedule-notice {
    color: var(--muted);
    font-size: 0.72rem;
    line-height: 1.35;
    margin: -0.35rem 0 0.75rem;
}

.admin-maintenance-window-result {
    box-sizing: border-box;
    display: grid;
    gap: 0.3rem;
    padding: 0.8rem 0.9rem;
}

.admin-maintenance-window-label {
    color: var(--muted);
    font-size: 0.78rem;
}

.admin-maintenance-window .admin-schedule-notice {
    margin: 0.45rem 0 0;
}

.admin-schedule-profile-result {
    box-sizing: border-box;
    display: grid;
    gap: 0.55rem;
    padding: 0.8rem 0.9rem;
    width: min(34rem, 100%);
}

.admin-schedule-profile-column {
    display: grid;
    gap: 0.75rem;
    justify-items: end;
    min-width: 0;
}

.admin-schedule-profile-result-heading {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: space-between;
}

.admin-schedule-profile-result-heading > strong {
    color: var(--text);
    font-size: 0.9rem;
}

.admin-schedule-profile-result-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.admin-schedule-profile-dismiss {
    align-items: center;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 0.35rem;
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: 0.74rem;
    font-weight: 700;
    height: 1.75rem;
    padding: 0 0.6rem;
}

.admin-schedule-profile-dismiss:hover,
.admin-schedule-profile-dismiss:focus-visible {
    background: var(--surface);
    border-color: var(--muted);
}

.admin-schedule-profile-dismiss:focus-visible {
    border-radius: 0.2rem;
    outline: 2px solid currentColor;
    outline-offset: 0.2rem;
}

.admin-schedule-profile-result p {
    margin: 0;
}

.admin-schedule-profile-transition,
.admin-schedule-profile-timing {
    color: var(--muted);
    font-size: 0.76rem;
}

.admin-schedule-profile-transition strong {
    color: var(--muted-strong);
}

.admin-schedule-profile-cadences {
    border-collapse: collapse;
    max-width: 34rem;
    width: 100%;
}

.admin-schedule-profile-cadences tr + tr {
    border-top: 1px solid var(--border-soft);
}

.admin-schedule-profile-cadences th,
.admin-schedule-profile-cadences td {
    color: var(--muted);
    font-size: 0.76rem;
    line-height: 1.35;
    padding: 0.32rem 0;
    text-align: left;
    vertical-align: top;
}

.admin-schedule-profile-cadences th {
    color: var(--muted-strong);
    font-weight: 700;
    padding-right: 1.25rem;
    width: 58%;
}

.admin-schedule-profile-timing {
    border-top: 1px solid var(--border-soft);
    padding-top: 0.5rem;
}

.admin-schedule-heading {
    align-items: flex-start;
}

.admin-schedule-details {
    display: grid;
    gap: 0.85rem 2rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0;
}

.admin-schedule-details > div {
    min-width: 0;
}

.admin-schedule-details dt {
    color: var(--muted);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1.2;
    margin: 0 0 0.12rem;
    text-transform: uppercase;
}

.admin-schedule-details dd {
    color: var(--text);
    font-size: 0.7rem;
    line-height: 1.35;
    margin: 0;
    overflow-wrap: anywhere;
}

.admin-schedule-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0;
}

.admin-schedule-actions .admin-row-action {
    font-size: 0.7rem;
    height: 1.8rem;
    padding: 0 0.65rem;
}

.admin-schedule-groups {
    min-width: 1020px;
}

.admin-schedule-group-grid {
    align-items: center;
    display: grid;
    gap: 0.75rem;
    grid-template-columns: 27fr 9fr 23fr 16fr 16fr 9fr;
}

.admin-schedule-group-grid > span {
    min-width: 0;
    overflow-wrap: anywhere;
    white-space: normal;
}

/* Category navigation. Sits outside the horizontally scrolling table wrap so
   the links stay reachable when the grid below is scrolled sideways. */
.admin-schedule-toc {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.admin-schedule-toc-link {
    align-items: center;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text);
    display: inline-flex;
    font-size: 0.8rem;
    gap: 0.4rem;
    padding: 0.3rem 0.7rem;
    text-decoration: none;
}

.admin-schedule-toc-link:hover,
.admin-schedule-toc-link:focus-visible {
    border-color: var(--accent);
}

.admin-schedule-toc-count {
    color: var(--muted);
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
}

/* No `border-top` here. `shared_styles_spec` forbids that literal declaration
   anywhere in this stylesheet, and the guard is deliberate — separation comes
   from the fill and the spacing instead. The preceding group already draws its
   own bottom divider, so a top border would be redundant as well as forbidden. */
.admin-schedule-category {
    background: var(--surface-soft);
    border-bottom: 1px solid var(--border);
    margin-top: 0.5rem;
    padding: 0.7rem 0.85rem;
}

.admin-schedule-category:first-of-type {
    margin-top: 0;
}

/* The anchor target; without this the heading lands under any sticky chrome
   and reads as the wrong category. */
.admin-schedule-category:target {
    scroll-margin-top: 1rem;
}

.admin-schedule-category-title {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin: 0;
    text-transform: uppercase;
}

.admin-schedule-category-description {
    color: var(--muted);
    font-size: 0.8rem;
    margin: 0.2rem 0 0;
}

.admin-schedule-group-header {
    background: var(--surface-soft);
    border-bottom: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 0.65rem 0.85rem 0.65rem 2.05rem;
    text-transform: uppercase;
}

.admin-schedule-group-header > span:first-child {
    padding-left: 0;
}

.admin-schedule-group-header > span:nth-child(n + 2):nth-child(-n + 5) {
    padding-left: 0.5rem;
}

.admin-schedule-group {
    border-bottom: 1px solid var(--border-soft);
}

.admin-schedule-group:last-child {
    border-bottom: 0;
}

.admin-schedule-group > summary {
    align-items: start;
    cursor: pointer;
    font-size: 0.78rem;
    line-height: 1.3;
    list-style: none;
    min-height: 4.4rem;
    padding: 0.58rem 0.85rem 0.58rem 2.05rem;
    position: relative;
}

.admin-schedule-group > summary::-webkit-details-marker {
    display: none;
}

.admin-schedule-group > summary::before {
    color: var(--muted);
    content: '\203A';
    font-size: 1.15rem;
    left: 0.82rem;
    line-height: 1;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 120ms ease;
}

.admin-schedule-group[open] > summary::before {
    transform: translateY(-50%) rotate(90deg);
}

.admin-schedule-group > summary:hover,
.admin-schedule-group[open] > summary {
    background: var(--surface-soft);
}

.admin-schedule-group > summary:focus {
    outline: 0;
}

.admin-schedule-group > summary:focus-visible {
    box-shadow: inset 0 0 0 2px #6f8067;
}

.admin-schedule-group-title {
    display: grid;
    gap: 0.12rem;
    min-width: 0;
}

.admin-schedule-group-title strong {
    font-size: 0.78rem;
    line-height: 1.3;
}

.admin-schedule-group-title .admin-secondary {
    font-size: 0.78rem;
    line-height: 1.3;
}

.admin-schedule-groups .app-status-pill {
    font-size: 0.78rem;
    min-height: 1.1rem;
    padding: 0.2rem 0.4rem;
}

.admin-schedule-manage {
    align-self: center;
    align-items: center;
    display: inline-flex;
    gap: 0.45rem;
    justify-content: center;
    font-size: 0.78rem;
    height: 1.85rem;
    padding: 0 0.7rem;
}

.admin-schedule-manage::after {
    content: '\25BE';
    font-size: 0.78rem;
    transition: transform 120ms ease;
}

.admin-schedule-group[open] .admin-schedule-manage::after {
    transform: rotate(180deg);
}

.admin-schedule-timestamp {
    color: var(--muted);
    display: block;
    font-size: 0.78rem;
    line-height: 1.3;
}

.admin-schedule-cadence,
.admin-schedule-group > summary > span:nth-child(4) .admin-secondary,
.admin-schedule-group > summary > span:nth-child(5) .admin-secondary,
.admin-schedule-group > summary .admin-schedule-timestamp {
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 400;
    line-height: 1.3;
}

.admin-schedule-group > summary > span:not(.admin-schedule-group-title) {
    font-size: 0.78rem;
    line-height: 1.3;
}

.admin-schedule-group-body {
    background: var(--surface-soft);
    border-top: 1px solid var(--border-soft);
    padding: 0.55rem 0.75rem 0.75rem;
}

.admin-schedule-items {
    display: grid;
    gap: 0.65rem;
}

.admin-schedule-item {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: 0.55rem;
    overflow: hidden;
}

.admin-schedule-item-heading {
    border-bottom: 1px solid var(--border-soft);
    padding: 0.7rem 0.8rem;
}

.admin-schedule-item-heading strong {
    display: block;
    font-size: 0.78rem;
    line-height: 1.3;
}

.admin-schedule-item > .admin-schedule-details {
    padding: 0.8rem;
}

.admin-schedule-operations {
    border-top: 1px solid var(--border-soft);
    display: grid;
    gap: 1rem;
    grid-template-columns: 0.8fr 1.15fr 1.25fr 1.25fr minmax(8.75rem, 0.8fr);
    margin: 0;
    padding: 0.7rem 0.8rem 0.8rem;
}

.admin-schedule-operations > div {
    min-width: 0;
}

.admin-schedule-operations dt {
    color: var(--muted);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1.2;
    margin: 0 0 0.38rem;
    text-transform: uppercase;
}

.admin-schedule-operations dd {
    color: var(--text);
    font-size: 0.72rem;
    line-height: 1.35;
    margin: 0;
    overflow-wrap: anywhere;
    white-space: normal;
}

.admin-schedule-operations .admin-secondary,
.admin-schedule-operations .admin-schedule-timestamp {
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 400;
    line-height: 1.35;
}

.admin-schedule-history-table {
    min-width: 900px;
}

.app-table.admin-schedule-history-table th {
    font-size: 0.66rem;
    padding: 0.6rem 0.75rem;
}

.app-table.admin-schedule-history-table td {
    font-size: 0.78rem;
    line-height: 1.3;
    padding: 0.65rem 0.75rem;
}

.app-table.admin-schedule-history-table .admin-schedule-history-details {
    overflow-wrap: anywhere;
    white-space: normal;
    width: 50%;
}

.admin-schedule-history-table .admin-schedule-timestamp,
.admin-schedule-history-table .admin-secondary,
.admin-schedule-history-table .admin-schedule-error {
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 400;
    line-height: 1.3;
}

.admin-schedule-history-table .app-status-pill {
    font-size: 0.78rem;
}

.admin-schedule-error {
    color: var(--red);
    display: block;
    max-width: 28rem;
    overflow-wrap: anywhere;
    white-space: normal;
}

.admin-schedule-progress {
    color: var(--muted);
    display: grid;
    gap: 0.12rem;
    max-width: 42rem;
    overflow-wrap: anywhere;
    white-space: normal;
}

.admin-schedule-live-run {
    display: grid;
    gap: 0.28rem;
    max-width: 42rem;
}

.admin-schedule-live-run-heading {
    align-items: flex-start;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
}

.admin-schedule-live-run-heading > .admin-schedule-progress {
    flex: 1 1 auto;
    min-width: 0;
}

.admin-schedule-stop-form {
    flex: 0 0 auto;
    margin: 0;
}

.content-button.admin-schedule-stop-button {
    color: var(--red);
    height: 1.75rem;
    padding: 0 0.65rem;
    width: auto;
}

.admin-schedule-stop-feedback {
    color: var(--yellow);
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.3;
}

.admin-schedule-stop-feedback[hidden] {
    display: none;
}

.admin-schedule-stop-feedback[data-tone="error"] {
    color: var(--red);
}

.admin-schedule-stop-feedback.is-stopped {
    color: var(--muted);
    margin-top: 0.2rem;
}

.admin-schedule-progress strong {
    color: var(--text);
}

.admin-schedule-progress-stalled {
    color: var(--yellow);
    font-weight: 700;
}

.admin-schedule-result {
    display: grid;
    gap: 0.45rem;
    margin-top: 0.15rem;
    max-width: 52rem;
    min-width: 0;
}

.admin-schedule-result-heading {
    align-items: baseline;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.55rem;
}

.admin-schedule-result-heading strong {
    color: var(--text);
}

.admin-schedule-result-heading span {
    color: var(--muted);
}

.admin-schedule-result-metrics {
    display: grid;
    gap: 1px;
    grid-template-columns: repeat(4, minmax(7rem, 1fr));
    margin: 0;
    overflow: hidden;
}

.admin-schedule-result-metrics.is-fluid {
    grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
}

.admin-schedule-result-metrics > div {
    border-left: 1px solid var(--border-soft);
    display: grid;
    gap: 0.05rem;
    min-width: 0;
    padding: 0.18rem 0.55rem;
}

.admin-schedule-result-metrics dt {
    color: var(--muted);
    font-size: 0.62rem !important;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.admin-schedule-result-metrics dd {
    color: var(--text);
    font-weight: 750;
    margin: 0;
}

.admin-schedule-result-metrics small {
    color: var(--muted);
}

.admin-schedule-result-metrics .is-positive dd {
    color: var(--green);
}

.admin-schedule-result-metrics .is-warning dd {
    color: var(--yellow);
}

.admin-schedule-result-line {
    align-items: baseline;
    display: grid;
    gap: 0.2rem 0.65rem;
    grid-template-columns: minmax(7.5rem, auto) minmax(0, 1fr);
}

.admin-schedule-result-disclosure > summary {
    align-items: baseline;
    display: grid;
    gap: 0.2rem 0.35rem;
    grid-template-columns: 0.55rem minmax(7.5rem, auto) minmax(0, 1fr);
}

.admin-schedule-result-disclosure > summary::before {
    content: "›";
    font-weight: 800;
    grid-column: 1;
    transition: transform 120ms ease;
}

.admin-schedule-result-disclosure[open] > summary::before {
    transform: rotate(90deg);
}

.admin-schedule-result-line {
    border-top: 1px solid var(--border-soft);
    margin-top: 0.35rem;
    max-width: 52rem;
    padding-top: 0.4rem;
}

.admin-schedule-result-line strong,
.admin-schedule-result-disclosure strong {
    color: var(--muted-strong);
}

.admin-schedule-result-line > span {
    min-width: 0;
    overflow-wrap: anywhere;
    white-space: normal;
}

.admin-schedule-result-line.is-warning strong,
.admin-schedule-result-line.is-warning span {
    color: var(--yellow);
}

.admin-schedule-result-line.is-failure strong,
.admin-schedule-result-line.is-failure span {
    color: var(--red);
}

.admin-schedule-result-disclosure {
    border-top: 1px solid var(--border-soft);
    padding-top: 0.35rem;
}

.admin-schedule-result-disclosure > summary {
    cursor: pointer;
    list-style: none;
}

.admin-schedule-result-disclosure > summary::-webkit-details-marker {
    display: none;
}

.admin-schedule-result-disclosure p {
    color: var(--muted);
    margin: 0.3rem 0 0 8.15rem;
    overflow-wrap: anywhere;
}

@media (max-width: 980px) {
    .admin-schedule-result-metrics,
    .admin-schedule-result-metrics.is-fluid {
        grid-template-columns: repeat(2, minmax(7rem, 1fr));
    }

    .admin-schedule-result-line {
        grid-template-columns: 1fr;
    }

    .admin-schedule-result-disclosure > summary {
        grid-template-columns: 0.55rem minmax(0, 1fr);
    }

    .admin-schedule-result-disclosure > summary > span {
        grid-column: 2;
    }

    .admin-schedule-result-disclosure p {
        margin-left: 0;
    }
}

.admin-schedule-form {
    max-width: 46rem;
    padding: 1.25rem;
}

.admin-schedule-form form {
    display: grid;
    gap: 1rem;
}

.admin-schedule-toggle {
    align-items: flex-start;
    display: flex;
    gap: 0.65rem;
}

.admin-schedule-toggle input {
    margin-top: 0.2rem;
}

.admin-schedule-time-field {
    max-width: 16rem;
}

.admin-schedule-fixed-value {
    border-top: 1px solid var(--border-soft);
    display: grid;
    gap: 0.3rem;
    padding-top: 1rem;
}

.app-toolbar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: space-between;
    padding: 1rem;
}

.app-field-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.app-field-label {
    color: var(--muted);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    line-height: 1.35;
    text-transform: uppercase;
}

.app-field {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: 0.5rem;
    color: var(--text);
    font: inherit;
    font-size: 0.9rem;
    height: 2.35rem;
    min-width: 9rem;
    padding: 0 0.75rem;
}

.app-field[type="search"],
.app-field[type="text"] {
    width: min(18rem, 100%);
}

.app-field::placeholder {
    color: #8b9585;
}

.app-field:focus {
    border-color: #6b7280;
    box-shadow: none;
    outline: none;
}

.app-symbol-toolbar {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: flex-start;
    min-height: 3.95rem;
    padding: 0.75rem 0.9rem;
}

.app-symbol-form {
    align-items: center;
    display: flex;
    gap: 0.7rem;
}

.app-symbol-form label {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.app-symbol-form .app-field {
    font-family: "JetBrains Mono", monospace;
    height: 2.45rem;
    min-height: 2.45rem;
    text-transform: uppercase;
    width: 12rem;
}

.app-symbol-action {
    align-items: center;
    background: transparent;
    border: 1px solid var(--green);
    border-radius: 0.5rem;
    color: var(--green);
    cursor: pointer;
    display: inline-flex;
    font-size: 0.8rem;
    font-weight: 700;
    justify-content: center;
    min-height: 2.45rem;
    padding: 0 1rem;
}

.app-symbol-action:hover {
    background: color-mix(in srgb, var(--green) 10%, transparent);
}

.app-symbol-action:disabled {
    cursor: wait;
    opacity: 0.65;
}

.app-symbol-identity {
    align-items: center;
    border-right: 1px solid var(--border-soft);
    display: flex;
    flex: 0 0 auto;
    gap: 0.65rem;
    padding-right: 1rem;
}

.app-symbol-identity[hidden],
.app-symbol-identity img[hidden] {
    display: none;
}

.app-symbol-identity img {
    background: var(--control-bg);
    border: 1px solid var(--control-border);
    border-radius: 0.42rem;
    height: 2.45rem;
    object-fit: contain;
    padding: 0.1rem;
    width: 2.45rem;
}

.app-symbol-identity-copy {
    display: grid;
    max-width: 32rem;
    min-width: 15rem;
}

.app-symbol-identity strong {
    color: var(--text);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.9rem;
    line-height: 1.25;
    white-space: normal;
}

.app-symbol-identity span {
    color: var(--muted);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.72rem;
}

.app-dashboard-row {
    align-items: stretch;
    display: grid;
    gap: 0.75rem;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.app-stat-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.app-stat-card {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: 0.5rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 5.5rem;
    padding: 1rem 0.85rem;
    text-align: center;
}

.app-stat-label {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* A card's label and its scope tag: the period the number covers, so
   neighbouring cards that cover different periods say so. */
.app-stat-card-top {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.4rem;
    justify-content: center;
}

.app-stat-scope {
    border: 1px solid var(--border-soft);
    border-radius: 0.25rem;
    color: var(--muted);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.6rem;
    line-height: 1.3;
    padding: 0 0.3rem;
    white-space: nowrap;
}

.app-stat-value {
    color: var(--text);
    font-family: "JetBrains Mono", monospace;
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.05;
    margin-top: 0.5rem;
}

.app-stat-value[data-tone="positive"] {
    color: var(--green);
}

.app-stat-value[data-tone="negative"] {
    color: var(--red);
}

/* The trend line under a stat card value (SIG-198). Colour is a second channel
   only: the text beside the arrow always says "Up" or "Down" in words, so this
   still reads correctly in monochrome and to a screen reader that skips the
   aria-hidden glyph. */
.app-stat-comparison {
    align-items: center;
    color: var(--muted);
    display: flex;
    font-size: 0.7rem;
    font-weight: 600;
    gap: 0.2rem;
    justify-content: center;
    line-height: 1.25;
    margin-top: 0.4rem;
}

.app-stat-comparison-arrow {
    font-size: 0.62rem;
    line-height: 1;
}

.app-stat-comparison-positive {
    color: var(--green);
}

.app-stat-comparison-negative {
    color: var(--red);
}

/* Neutral covers two different cases on purpose. `-neutral` is a real
   comparison whose direction carries no verdict -- more successful provider
   calls is more spend, not an achievement. `-none` is a stock with no
   comparison to make, saying so rather than being left blank, because a card
   nobody finished and a card that cannot have a trend look identical
   otherwise. Both are muted; neither may look like good or bad news. */
.app-stat-comparison-neutral,
.app-stat-comparison-none {
    color: var(--muted);
    font-weight: 500;
}

.app-stat-comparison-none {
    font-style: italic;
}

.app-filter-panel {
    align-items: stretch;
    flex-direction: column;
    justify-content: center;
}

.app-filter-panel .app-field-row {
    flex-wrap: nowrap;
}

.app-filter-panel .app-field[type="search"] {
    flex: 1 1 10rem;
    width: auto;
}

.app-filter-panel .app-field-row:last-child {
    justify-content: flex-end;
}

.app-screener-lanes {
    align-items: start;
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.app-screener-lane {
    overflow: hidden;
}

.app-screener-lane-header {
    align-items: start;
    background: var(--surface-soft);
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 1rem;
}

.app-screener-lane-title {
    color: var(--text);
    font-size: 0.92rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1.2;
    margin: 0;
    text-transform: uppercase;
}

.app-screener-lane-subtitle,
.app-screener-empty {
    color: var(--muted);
    font-size: 0.8rem;
}

.app-screener-lane-subtitle {
    margin: 0.25rem 0 0;
}

.app-screener-lane-count {
    color: var(--text);
    font-family: "JetBrains Mono", monospace;
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1;
}

.app-screener-list {
    display: grid;
}

.app-screener-row {
    align-items: stretch;
    border-bottom: 1px solid var(--border-soft);
    display: grid;
    gap: 0.75rem;
    grid-template-columns: minmax(0, 1fr) 7rem;
    padding: 0.7rem 1rem;
}

.app-screener-row:last-child {
    border-bottom: 0;
}

.app-screener-row-details,
.app-screener-row-trailing {
    display: grid;
    gap: 0.45rem;
    min-width: 0;
}

.app-screener-row-identity,
.app-screener-row-actions {
    align-items: center;
    display: flex;
    min-width: 0;
}

.app-screener-row-trailing {
    align-content: space-between;
    justify-items: end;
}

.app-screener-row-actions,
.app-screener-row-actions .content-button,
.app-screener-row-actions .app-field {
    width: 7rem;
}

.app-screener-row-actions .app-field {
    max-width: 100%;
    min-width: 0;
}

.app-screener-row-identity {
    align-items: baseline;
    gap: 0.5rem;
}

.app-screener-row-identity a {
    flex: 0 0 auto;
}

.app-screener-row-company {
    color: var(--text);
    font-size: 0.8rem;
    line-height: 1.35;
    min-width: 0;
    overflow-wrap: anywhere;
}

.app-screener-row-sector {
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.35;
}

.app-screener-row-price {
    color: var(--text);
    font-size: 0.92rem;
    font-weight: 700;
    text-align: center;
    width: 7rem;
    white-space: nowrap;
}

.app-screener-empty {
    padding: 1rem;
}

.app-screener-more {
    align-items: center;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    padding: 0.75rem 1rem;
}

.app-screener-more .content-button {
    flex: 0 0 auto;
}

.app-table-wrap {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px var(--shadow);
    overflow: hidden;
}

.app-table-scroll {
    overflow-x: auto;
}

.app-table {
    border-collapse: collapse;
    min-width: 920px;
    width: 100%;
}

/*
 * Shared table contract.
 *
 * Customer data tables use .app-table for the common typography and spacing
 * scale, then describe cell meaning with the semantic helpers below. Keep
 * identity/description columns left aligned and apply one alignment helper to
 * both a column's header and its cells. Equal column groups must declare their
 * complete percentage through --app-table-equal-column-width on the table.
 * Page selectors may change geometry through the custom properties, but must
 * not restate the shared font-size hierarchy.
 */
.app-table-layout-fixed {
    table-layout: fixed;
}

.app-table-col-equal {
    width: var(--app-table-equal-column-width);
}

.app-table .app-table-cell-start {
    text-align: left;
}

.app-table .app-table-cell-center {
    text-align: center;
}

.app-table .app-table-cell-end {
    text-align: right;
}

.app-table .app-table-cell-numeric {
    font-family: "JetBrains Mono", monospace;
    font-size: var(--app-table-numeric-font-size, inherit);
    font-variant-numeric: tabular-nums;
}

.app-table .app-table-primary {
    color: var(--text);
    font-size: var(--app-table-primary-font-size, inherit);
    font-weight: 700;
}

.app-table .app-table-secondary {
    color: var(--muted);
    font-size: var(--app-table-secondary-font-size, inherit);
}

.app-table .app-table-supporting {
    font-size: var(--app-table-supporting-font-size, inherit);
}

.app-table .app-table-sort-button {
    align-items: center;
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    gap: 0.35rem;
    letter-spacing: inherit;
    padding: 0;
    text-transform: inherit;
    transition: color 150ms ease;
}

.app-table .app-table-sort-button:hover {
    color: var(--text);
}

.app-table .app-table-sort-button:focus-visible {
    border-radius: 0.2rem;
    outline: 2px solid var(--green);
    outline-offset: 0.2rem;
}

.app-table .app-table-sort-indicator {
    display: inline-block;
    flex: 0 0 0.8rem;
    font-size: 0.86em;
    letter-spacing: 0;
    min-width: 0.8rem;
    opacity: 0.62;
    text-align: center;
}

.app-table th[aria-sort="ascending"] > .app-table-sort-button,
.app-table th[aria-sort="descending"] > .app-table-sort-button,
.app-table .app-table-sort-button.is-active {
    color: var(--green);
}

.app-table th[aria-sort="ascending"] .app-table-sort-indicator,
.app-table th[aria-sort="descending"] .app-table-sort-indicator,
.app-table .app-table-sort-button.is-active .app-table-sort-indicator {
    opacity: 1;
}

.app-table th.app-table-cell-center > .app-table-sort-button {
    justify-content: center;
    width: 100%;
}

.app-table th.app-table-cell-end > .app-table-sort-button {
    justify-content: flex-end;
    width: 100%;
}

.app-table th {
    background: var(--surface-soft);
    border-bottom: 1px solid var(--border-soft);
    color: var(--muted);
    font-size: var(--app-table-header-font-size, 0.72rem);
    font-weight: var(--app-table-header-font-weight, 700);
    letter-spacing: var(--app-table-header-letter-spacing, 0.08em);
    padding: var(--app-table-header-padding-block, 0.75rem) var(--app-table-header-padding-inline, 1rem);
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.app-table td {
    border-bottom: 1px solid var(--border-soft);
    color: var(--text);
    font-size: var(--app-table-body-font-size, 0.92rem);
    padding: var(--app-table-body-padding-block, 0.85rem) var(--app-table-body-padding-inline, 1rem);
    vertical-align: middle;
    white-space: nowrap;
}

.app-table tr:last-child td {
    border-bottom: 0;
}

/* Keep all Scheduler body text on one scale after the generic table rules. */
.admin-page .admin-schedule-groups .admin-schedule-group > summary,
.admin-page .admin-schedule-groups .admin-schedule-group > summary *,
.admin-page .app-table.admin-schedule-history-table tbody td,
.admin-page .app-table.admin-schedule-history-table tbody td * {
    font-size: 0.78rem;
    line-height: 1.3;
}

.admin-page .app-table.admin-schedule-history-table thead th {
    font-size: 0.66rem;
    line-height: 1.3;
}

.admin-page .admin-schedule-groups .admin-schedule-group > summary .app-status-pill,
.admin-page .admin-schedule-item .app-status-pill,
.admin-page .app-table.admin-schedule-history-table tbody td .app-status-pill {
    font-size: 0.6rem;
    line-height: 1.1;
    min-height: 1.05rem;
    padding: 0.08rem 0.28rem;
}

.app-status-pill {
    align-items: center;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    box-sizing: border-box;
    display: inline-flex;
    font-size: 0.72rem;
    font-weight: 800;
    justify-content: center;
    letter-spacing: 0.01em;
    line-height: 1;
    min-height: 1.25rem;
    padding: 0.25rem 0.5rem;
    text-transform: uppercase;
    white-space: nowrap;
}

.app-status-pill-prominent {
    font-size: 1rem;
    min-height: 2.25rem;
    padding: 0.5rem 1rem;
}

.app-status-pill-positive {
    background: #d1fae5;
    border-color: #059669;
    color: #047857;
}

.app-status-pill-caution {
    background: #fef3c7;
    border-color: #facc15;
    color: #182016;
}

.app-status-pill-negative {
    background: #ffe4e6;
    border-color: #f43f5e;
    color: #be123c;
}

.app-status-pill-neutral {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #475569;
}

.app-signal-summary {
    display: grid;
    gap: 0.65rem;
}

.app-signal-card.signal-card {
    border-color: #cbd5e1 !important;
    border-width: 2px !important;
}

.app-signal-state-pill {
    align-items: center;
    border: 1px solid transparent;
    border-radius: 0.625rem;
    display: inline-flex;
    font-size: 0.75rem;
    font-weight: 600;
    justify-content: center;
    line-height: 1rem;
    min-height: 1.75rem;
    padding: 0.375rem 0.75rem;
    text-transform: uppercase;
    white-space: nowrap;
}

.app-signal-state-pill-positive {
    background: #d1fae5;
    border-color: #059669;
    color: #047857;
}

.app-signal-state-pill-caution {
    background: #fef3c7;
    border-color: #facc15;
    color: #182016;
}

.app-signal-state-pill-negative {
    background: #ffe4e6;
    border-color: #f43f5e;
    color: #be123c;
}

.app-signal-state-pill-neutral {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #475569;
}

.app-watchlist-chip-control {
    align-items: center;
    box-sizing: border-box;
    display: inline-flex;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    height: 2.25rem;
}

.app-watchlist-symbol-pill {
    border-radius: 0.5rem;
    flex: 0 0 auto;
}

.app-watchlist-symbols {
    margin-top: 0.75rem;
    padding: 0 0.5rem 0.25rem;
}

.app-watchlist-symbols-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.app-watchlist-symbols-controls,
.app-watchlist-symbols-actions {
    align-items: center;
    display: flex;
    flex: 0 0 auto;
}

.app-watchlist-symbols-controls {
    flex: 1 1 auto;
    flex-wrap: wrap;
    gap: 0.75rem;
    min-width: 0;
}

.app-watchlist-symbols-actions {
    flex-wrap: wrap;
    gap: 0.5rem;
}

.app-watchlist-symbol-grid {
    align-items: center;
    display: flex;
    flex: 1 1 0;
    flex-wrap: wrap;
    gap: 0.375rem;
    max-height: 8.25rem;
    min-width: 0;
    overflow-y: auto;
    padding-right: 0.35rem;
}

.app-watchlist-symbol-grid:empty {
    display: none;
}

@media (max-width: 640px) {
    .app-watchlist-symbols-row {
        align-items: flex-start;
    }

    .app-watchlist-symbol-grid {
        flex-basis: 100%;
    }
}

/* Compact Congress disclosure feed. This supersedes the retired ranking-card layout above. */
.politician-trades-insights {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.45fr);
}

.politician-trades-insight-card {
    align-self: start;
    min-width: 0;
    overflow: hidden;
}

.politician-trades-insight-heading {
    align-items: baseline;
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    gap: 0.5rem;
    justify-content: space-between;
    min-height: 3.4rem;
    padding: 0.8rem 0.9rem;
}

.politician-trades-insight-heading h2 {
    color: var(--text-strong);
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
}

.politician-trades-insight-list {
    list-style: none;
    margin: 0;
    min-height: 11.25rem;
    padding: 0;
}

.politician-trades-stock-insights {
    display: grid;
    grid-auto-flow: column;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(3, 3.75rem);
}

.politician-trades-party-insights,
.politician-trades-active-insights {
    display: grid;
}

.politician-trades-party-insights {
    grid-template-rows: repeat(3, 3.75rem);
}

.politician-trades-active-insights {
    grid-auto-flow: column;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(3, 3.75rem);
}

.politician-trades-insight-row {
    align-items: center;
    border-bottom: 1px solid var(--border-soft);
    display: grid;
    min-width: 0;
    padding: 0.25rem 0.55rem;
}

.politician-trades-stock-insight-row {
    gap: 0.5rem;
    grid-template-columns: 1rem 2.1rem minmax(0, 1fr);
}

.politician-trades-stock-insight-row:nth-child(n + 4) {
    border-left: 1px solid var(--border-soft);
}

.politician-trades-stock-insight-row:nth-child(3),
.politician-trades-stock-insight-row:nth-child(6),
.politician-trades-person-insight-row:last-child,
.politician-trades-active-insight-row:last-child {
    border-bottom: 0;
}

.politician-trades-person-insight-row {
    gap: 0.65rem;
    grid-template-columns: 2.4rem minmax(0, 1fr);
}

.politician-trades-active-insight-row {
    gap: 0.5rem;
    grid-template-columns: 1rem 1.85rem minmax(0, 1fr);
    padding-bottom: 0.2rem;
    padding-top: 0.2rem;
}

.politician-trades-active-insight-row:nth-child(n + 4) {
    border-left: 1px solid var(--border-soft);
}

.politician-trades-active-insight-row:nth-child(3),
.politician-trades-active-insight-row:nth-child(6) {
    border-bottom: 0;
}

.politician-trades-insight-card .politician-trades-avatar {
    flex-basis: 2.4rem;
    height: 2.4rem;
    width: 2.4rem;
}

.politician-trades-active-insight-row .politician-trades-avatar {
    flex-basis: 1.85rem;
    height: 1.85rem;
    width: 1.85rem;
}

.politician-trades-insight-logo,
.politician-trades-insight-logo.app-symbol-icon-has-logo {
    border-radius: 0.3rem;
    height: 2.1rem;
    width: 2.1rem;
}

.politician-trades-insight-logo.app-symbol-icon-has-logo {
    background: transparent;
    border-color: transparent;
}

.politician-trades-insight-rank {
    color: var(--text-muted);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
}

.politician-trades-insight-copy {
    display: grid;
    min-width: 0;
}

.politician-trades-insight-copy strong,
.politician-trades-insight-copy span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.politician-trades-insight-copy strong {
    color: var(--text-strong);
    font-size: 0.95rem;
    line-height: 1.15;
}

.politician-trades-insight-copy span {
    color: var(--text-muted);
    font-size: 0.72rem;
    line-height: 1.15;
    margin-top: 0.08rem;
}

.politician-trades-insight-empty,
.politician-trades-insight-loading {
    align-items: center;
    color: var(--text-muted);
    display: flex;
    font-size: 0.72rem;
    gap: 0.5rem;
    grid-column: 1 / -1;
    grid-row: 1 / -1;
    justify-content: center;
    min-height: 11.25rem;
    padding: 0.75rem;
}

.politician-trades-metrics {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    overflow: hidden;
}

.politician-trades-metrics > div {
    align-items: center;
    border-right: 1px solid var(--border-soft);
    display: flex;
    gap: 0.55rem;
    min-height: 3.35rem;
    padding: 0.65rem 0.9rem;
}

.politician-trades-metrics > div:last-child {
    border-right: 0;
}

.politician-trades-metrics strong {
    color: var(--text-strong);
    font-family: "JetBrains Mono", monospace;
    font-size: 1.2rem;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.politician-trades-metrics span {
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.politician-trades-toolbar {
    padding: 0.75rem;
}

.politician-trades-results-header {
    min-height: 3.5rem;
    padding: 0.75rem 0.9rem;
}

.politician-trades-results .app-table-scroll {
    max-height: 42rem;
}

.politician-trades-table thead th {
    letter-spacing: var(--app-table-header-letter-spacing);
}

.politician-trades-table td {
    line-height: 1.2;
}

.politician-trades-avatar {
    flex-basis: 2rem;
    height: 2rem;
    width: 2rem;
}

.politician-trades-person,
.politician-trades-security {
    gap: 0.55rem;
}

.politician-trades-security-logo,
.politician-trades-security-logo.app-symbol-icon-has-logo {
    flex-basis: 1.9rem;
    height: 1.9rem;
    width: 1.9rem;
}

.politician-trades-person-meta {
    flex-wrap: nowrap;
}

.politician-trades-chamber-pill {
    flex: 0 0 auto;
}

.politician-trades-table .politician-trades-secondary {
    margin-top: 0.12rem;
}

.politician-trades-date,
.politician-trades-delay {
    font-variant-numeric: tabular-nums;
}

.politician-trades-type {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

.politician-trades-type.is-buy {
    color: var(--green);
}

.politician-trades-type.is-sell {
    color: var(--red);
}

.politician-trades-type.is-other {
    color: var(--text-muted);
}

@media (min-width: 1001px) {
    .politician-trades-filter-form {
        grid-template-columns: minmax(16rem, 2fr) minmax(8rem, 0.8fr) minmax(9rem, 0.9fr) minmax(10rem, 1fr) auto;
    }

    .politician-trades-filter-form label:first-child {
        grid-column: auto;
    }

    .politician-trades-filter-button {
        justify-self: stretch;
        min-width: 8.75rem;
    }
}

@media (max-width: 1450px) {
    .politician-trades-insights {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .politician-trades-insights {
        grid-template-columns: minmax(0, 1fr);
    }

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

    .politician-trades-metrics > div:nth-child(3) {
        border-right: 0;
    }

    .politician-trades-metrics > div:nth-child(n + 4) {
        border-top: 1px solid var(--border-soft);
    }

    .politician-trades-metrics > div:last-child {
        border-right: 1px solid var(--border-soft);
    }
}

/* Stock Screener */
.stock-screener-dashboard {
    --accent: var(--green);
    --danger: var(--red);
    --font-mono: "JetBrains Mono", ui-monospace, monospace;
    --font-sans: "Source Sans 3", "Segoe UI", sans-serif;
    --success: var(--green);
    --text-muted: var(--muted);
    max-width: 1840px;
}

.stock-screener-page-heading .app-freshness-display {
    align-self: flex-start;
    padding-top: 0.55rem;
}

.stock-screener-notice {
    background: color-mix(in srgb, var(--danger) 10%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--border));
    border-radius: 0.55rem;
    color: var(--danger);
    margin-bottom: 1rem;
    padding: 0.75rem 0.9rem;
}

.stock-screener-notice.is-success {
    background: color-mix(in srgb, var(--success) 10%, var(--surface));
    border-color: color-mix(in srgb, var(--success) 35%, var(--border));
    color: var(--success);
}

.stock-screener-layout {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1fr);
}

.stock-screener-builder {
    padding: 0;
}

.stock-screener-panel-heading,
.stock-screener-results-heading,
.stock-screener-results-footer,
.stock-screener-builder-actions {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.stock-screener-results-heading h2 {
    font-size: 1.05rem;
    margin: 0;
}

.stock-screener-panel-heading {
    align-items: center;
    display: flex;
    justify-content: flex-start;
    padding: 0.75rem 1rem;
}

.stock-screener-panel-heading > span,
.stock-screener-saved-row label > span,
.stock-screener-results-heading label > span {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}


.stock-screener-saved-row {
    margin: 0;
    padding: 0;
    width: auto;
}

.stock-screener-saved-browser,
.stock-screener-name-editor,
.stock-screener-delete-confirmation {
    align-items: center;
    display: flex;
    gap: 0.5rem;
}

.stock-screener-saved-browser[hidden],
.stock-screener-name-editor[hidden],
.stock-screener-delete-confirmation[hidden] {
    display: none;
}

.stock-screener-delete-confirmation .app-inline-feedback {
    margin-top: 0;
}

.stock-screener-saved-row label {
    display: block;
}

.stock-screener-results-heading label {
    display: grid;
    gap: 0.35rem;
}

.stock-screener-saved-row select,
.stock-screener-saved-row input,
.stock-screener-results-heading select,
.stock-screener-simple-control select {
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 0.45rem;
    color: var(--text);
    font: inherit;
    min-height: 2.45rem;
    min-width: 0;
    padding: 0.48rem 0.62rem;
    width: 100%;
}

.stock-screener-saved-browser select {
    width: 14rem;
}

.stock-screener-name-editor input {
    width: 17rem;
}

.stock-screener-filter-groups {
    border-top: 1px solid var(--border-soft);
    margin: 0;
    padding: 0 1.4rem;
}

.stock-screener-filter-group {
    border-bottom: 1px solid var(--border-soft);
    display: block;
    padding: 1.15rem 0 1.25rem;
}

.stock-screener-filter-group:last-child {
    border-bottom: 0;
}

.stock-screener-filter-group > h3 {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin: 0 0 0.85rem;
    text-transform: uppercase;
}

.stock-screener-filter-group-controls {
    display: grid;
    gap: 1.35rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stock-screener-simple-control {
    min-width: 0;
}

.stock-screener-control-heading {
    align-items: center;
    display: flex;
    gap: 0.6rem;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    min-height: 1.7rem;
}

.stock-screener-control-heading > label,
.stock-screener-control-heading > span {
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 700;
}

.stock-screener-control-heading small {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 400;
    margin-left: 0.25rem;
}

.stock-screener-control-heading output {
    color: var(--text-muted);
    font: 600 0.75rem/1 var(--font-mono);
    white-space: nowrap;
}

.stock-screener-range {
    accent-color: var(--green);
    cursor: pointer;
    margin: 0;
    width: 100%;
}

.stock-screener-performance-controls {
    align-items: center;
    display: grid;
    gap: 0.55rem;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.35fr);
}

.stock-screener-range-labels {
    color: var(--text-muted);
    font: 500 0.75rem/1 var(--font-mono);
    height: 0.8rem;
    margin-top: 0.45rem;
    position: relative;
}

.stock-screener-range-labels > span {
    position: absolute;
    transform: translateX(-50%);
    white-space: nowrap;
}

.stock-screener-range-labels > span:first-child {
    left: 0;
    transform: none;
}

.stock-screener-range-labels > span:last-child {
    right: 0;
    transform: none;
}

.stock-screener-range-labels > span:nth-child(2) {
    left: 33.333333%;
}

.stock-screener-range-labels > span:nth-child(3) {
    left: 66.666667%;
}

.stock-screener-segments {
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 0.45rem;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 0.2rem;
}

.stock-screener-segments.is-three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stock-screener-segments.is-five {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.stock-screener-segments button {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 0.32rem;
    color: var(--text-muted);
    cursor: pointer;
    font: 600 0.78rem/1 var(--font-sans);
    min-height: 1.95rem;
    min-width: 0;
    padding: 0.4rem 0.2rem;
}

.stock-screener-segments button[aria-pressed="true"] {
    background: color-mix(in srgb, var(--green) 10%, var(--surface));
    border-color: var(--border);
    color: var(--text);
}

body.dark-mode.home-dashboard-shell .stock-screener-segments button[aria-pressed="true"] {
    background: var(--control-bg-focus);
    border-color: var(--control-border);
    color: var(--control-text);
}

.stock-screener-builder-actions {
    border-top: 1px solid var(--border-soft);
    gap: 0.7rem;
    justify-content: space-between;
    padding: 0.8rem 1rem;
}

.stock-screener-criteria {
    flex: 1;
    min-width: 0;
}

.stock-screener-criteria > span {
    color: var(--text-muted);
    display: block;
    font: 700 0.72rem/1 var(--font-mono);
    letter-spacing: 0.08em;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
}

.stock-screener-criteria > p {
    color: var(--text);
    font: 600 0.78rem/1.45 var(--font-mono);
    margin: 0;
}

.stock-screener-criteria-row {
    align-items: center;
    column-gap: 0.45rem;
    display: flex;
    flex-wrap: nowrap;
    row-gap: 0.12rem;
}

.stock-screener-criteria-row > span {
    white-space: nowrap;
}

.stock-screener-criteria-row > span:not(:last-child)::after {
    color: var(--text-muted);
    content: "·";
    margin-left: 0.45rem;
}

.stock-screener-advanced-note {
    color: var(--text-muted) !important;
    margin-top: 0.2rem !important;
}

.stock-screener-builder-actions > div:last-child {
    display: flex;
    gap: 0.55rem;
    white-space: nowrap;
}

.stock-screener-button {
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 0.45rem;
    color: var(--text);
    cursor: pointer;
    font: 700 0.82rem/1 var(--font-sans);
    min-height: 2.45rem;
    padding: 0.65rem 0.85rem;
}

.stock-screener-button.is-primary {
    background: transparent;
    border-color: var(--green);
    color: var(--green);
}

.stock-screener-button.is-primary:hover,
.stock-screener-button.is-primary:focus-visible {
    background: color-mix(in srgb, var(--green) 10%, transparent);
}

.stock-screener-button.is-danger {
    color: var(--danger);
}

.stock-screener-button:disabled {
    cursor: not-allowed;
    opacity: 0.48;
}

.stock-screener-results-area {
    display: grid;
    gap: 1rem;
    min-width: 0;
    scroll-margin-top: 4.7rem;
}

.stock-screener-results-area[hidden] {
    display: none;
}

.stock-screener-results-heading p {
    color: var(--text-muted);
}

.stock-screener-results {
    min-width: 0;
    overflow: hidden;
}

.stock-screener-results-heading {
    gap: 1rem;
    padding: 1rem 1.15rem;
}

.stock-screener-results-heading p {
    font-size: 0.82rem;
    margin: 0.25rem 0 0;
}

.stock-screener-results-heading label {
    min-width: 185px;
}

.stock-screener-table-scroll {
    overflow-x: auto;
}

.stock-screener-table {
    --app-table-equal-column-width: 7%;
    border-collapse: collapse;
    min-width: 1240px;
    width: 100%;
}

.stock-screener-col-company {
    width: 16%;
}

.stock-screener-col-watchlist {
    width: 12%;
}

.stock-screener-col-index {
    width: 16%;
}

.stock-screener-table th,
.stock-screener-table td {
    border-top: 1px solid var(--border-soft);
    text-align: right;
    white-space: nowrap;
}

.stock-screener-table th:first-child,
.stock-screener-table td:first-child {
    text-align: left;
}

.stock-screener-table th:nth-child(2),
.stock-screener-table td:nth-child(2) {
    text-align: center;
}

.stock-screener-table .stock-screener-index-memberships {
    text-align: left;
    white-space: normal;
}

.stock-screener-watchlist-action {
    margin: 0 auto;
    width: 6.25rem;
}

.stock-screener-watchlist-action .stock-screener-button,
.stock-screener-watchlist-action select {
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 0.45rem;
    color: var(--text);
    font: 700 0.78rem/1 var(--font-sans);
    min-height: 2rem;
    padding: 0.4rem 0.45rem;
    width: 100%;
}

.stock-screener-watchlist-action select {
    font-weight: 600;
}

.stock-screener-company {
    align-items: center;
    display: flex;
    gap: 0.7rem;
}

.stock-screener-stock-icon {
    flex: 0 0 auto;
    height: 2rem;
    width: 2rem;
}

.stock-screener-company > div {
    display: grid;
}

.stock-screener-company a {
    text-decoration: none;
}

.stock-screener-company span {
    white-space: normal;
}

.stock-screener-table .is-positive { color: var(--success); }
.stock-screener-table .is-negative { color: var(--danger); }

.stock-screener-empty {
    color: var(--text-muted);
    padding: 3rem !important;
    text-align: center !important;
}

.stock-screener-results-footer {
    border-top: 1px solid var(--border-soft);
    color: var(--text-muted);
    padding: 0.8rem 1rem;
}

@media (max-width: 1200px) {
    .stock-screener-panel-heading {
        align-items: stretch;
    }

    .stock-screener-filter-group-controls {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .stock-screener-saved-row { width: 100%; }
    .stock-screener-saved-browser,
    .stock-screener-name-editor,
    .stock-screener-delete-confirmation { flex-wrap: wrap; }
    .stock-screener-saved-row label { flex: 1 0 100%; }
    .stock-screener-saved-browser select,
    .stock-screener-name-editor input { width: 100%; }
    .stock-screener-filter-groups { padding: 0 1rem; }
    .stock-screener-filter-group-controls { grid-template-columns: minmax(0, 1fr); }
    .stock-screener-builder-actions { align-items: stretch; flex-direction: column; }
    .stock-screener-criteria-row { flex-wrap: wrap; }
    .stock-screener-builder-actions > div:last-child { display: grid; grid-template-columns: 1fr 1fr; }
    .stock-screener-builder-actions .stock-screener-button { min-width: 0; width: 100%; }
    .stock-screener-results-heading { align-items: stretch; flex-direction: column; }
    .stock-screener-results-heading label { min-width: 0; }
}

.app-signal-summary-head,
.app-quality-mix-head {
    align-items: center;
    color: var(--muted);
    display: flex;
    font-size: 0.69rem;
    font-weight: 800;
    gap: 0.75rem;
    justify-content: space-between;
    letter-spacing: 0.06em;
    line-height: 1.2;
    text-transform: uppercase;
}

.app-signal-summary-count {
    color: var(--muted-strong);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    letter-spacing: 0;
    white-space: nowrap;
}

.app-signal-rail,
.app-quality-rail {
    background: var(--border-soft);
    border-radius: 999px;
    display: flex;
    gap: 0.29rem;
    height: 0.25rem;
    overflow: hidden;
    width: 100%;
}

.app-signal-rail-segment,
.app-quality-rail-segment {
    flex: 1 1 0;
    min-width: 0.22rem;
}

.app-signal-rail {
    display: grid;
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
}

.app-signal-comparison-grid {
    display: grid;
    gap: 0.85rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.app-signal-comparison-grid[data-count="1"] {
    grid-template-columns: minmax(0, 1fr);
}

.app-signal-comparison-grid[data-count="2"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.app-signal-comparison {
    align-items: center;
    display: grid;
    gap: 0.4rem;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    min-width: 0;
    padding: 0.15rem 0;
}

.app-signal-comparison-grid[data-count="1"] .app-signal-comparison,
.app-signal-comparison-grid[data-count="2"] .app-signal-comparison {
    gap: 0.8rem;
    grid-template-columns: auto auto auto;
    justify-content: center;
}

.app-signal-comparison-side {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.app-signal-comparison-left {
    align-items: center;
    text-align: center;
}

.app-signal-comparison-right {
    align-items: center;
    text-align: center;
}

.app-signal-comparison-label {
    color: var(--muted);
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    line-height: 1.2;
    text-transform: uppercase;
    white-space: nowrap;
}

.app-signal-comparison-value {
    color: var(--muted-strong);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.3;
    margin-top: 0.12rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-signal-comparison-operator {
    color: var(--muted-strong);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    line-height: 1;
}

.app-signal-comparison-positive .app-signal-comparison-operator {
    color: #10b981;
}

.app-signal-comparison-negative .app-signal-comparison-operator {
    color: #f43f5e;
}

.app-signal-comparison-neutral .app-signal-comparison-operator {
    color: #d49a00;
}

.app-quality-mix {
    display: grid;
    gap: 0.45rem;
    margin-bottom: 0.65rem;
}

.app-context-snapshot {
    border-top: 1px solid var(--border-soft);
    margin-top: 0.75rem;
    padding-top: 0.75rem;
}

.app-context-snapshot-standalone {
    border-top: 0;
    margin-top: 0;
    padding-top: 0;
}

.app-context-snapshot-header {
    align-items: baseline;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
}

.app-context-snapshot-title {
    color: var(--muted-strong);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.045em;
    line-height: 1.2;
    text-transform: uppercase;
}

.app-context-snapshot-scope {
    color: var(--muted);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.055em;
    line-height: 1.2;
    text-align: right;
    text-transform: uppercase;
    white-space: nowrap;
}

.app-context-snapshot-rail {
    display: grid;
    gap: 0.29rem;
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
    margin-top: 0.48rem;
}

.app-context-snapshot-segment {
    background: #94a3b8;
    border-radius: 999px;
    height: 0.24rem;
}

.app-context-snapshot-segment-positive {
    background: #10b981;
}

.app-context-snapshot-segment-caution {
    background: #d49a00;
}

.app-context-snapshot-segment-negative {
    background: #f43f5e;
}

.app-context-snapshot-grid {
    display: grid;
    gap: 0.38rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 0.55rem;
}

.app-context-snapshot-tile {
    background: rgba(255, 255, 255, 0.28);
    border: 1px solid var(--border-soft);
    border-radius: 0.55rem;
    min-width: 0;
    padding: 0.48rem 0.55rem 0.5rem;
}

.app-context-snapshot-tile-head {
    align-items: center;
    display: flex;
    gap: 0.38rem;
    min-width: 0;
}

.app-context-snapshot-dot {
    background: #94a3b8;
    border-radius: 999px;
    box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.12);
    flex: 0 0 auto;
    height: 0.42rem;
    width: 0.42rem;
}

.app-context-snapshot-dot-positive {
    background: #34d399;
    box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.12);
}

.app-context-snapshot-dot-caution {
    background: #facc15;
    box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.12);
}

.app-context-snapshot-dot-negative {
    background: #fb7185;
    box-shadow: 0 0 0 2px rgba(251, 113, 133, 0.12);
}

.app-context-snapshot-label {
    color: var(--muted);
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.045em;
    line-height: 1.15;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.app-context-snapshot-value {
    color: var(--text);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.2;
    white-space: nowrap;
}

.app-context-snapshot-reading {
    align-items: baseline;
    display: flex;
    gap: 0.28rem;
    margin-top: 0.38rem;
    min-width: 0;
}

.app-context-snapshot-separator {
    color: var(--muted);
    flex: 0 0 auto;
    font-size: 0.75rem;
}

.app-context-snapshot-state {
    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-signal-history-notice {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 0.4rem;
    color: var(--text);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.375;
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
}

body.dark-mode .app-signal-history-notice {
    border-color: rgba(255, 255, 255, 0.82);
    color: #ffffff;
}

body.dark-mode .app-context-snapshot-tile {
    background: rgba(255, 255, 255, 0.018);
    border-color: #424842;
}

@media (max-width: 420px) {
    .app-context-snapshot-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.2rem;
    }

    .app-context-snapshot-scope {
        text-align: left;
    }
}

.app-quality-input-dot {
    border-radius: 999px;
    flex: 0 0 auto;
    height: 0.4rem;
    width: 0.4rem;
}

.app-rail-positive {
    background: #10b981;
}

.app-rail-caution {
    background: #d49a00;
}

.app-rail-negative {
    background: #f43f5e;
}

.app-rail-neutral {
    background: #94a3b8;
}

.metric-pass {
    color: var(--green);
    font-weight: 700;
}

.metric-fail {
    color: var(--red);
    font-weight: 700;
}

.page-heading {
    margin: 0.25rem 0 1rem;
    padding-top: 0.25rem;
}

.page-heading h1,
.page-heading h2 {
    color: var(--text);
    font-size: 1.875rem;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 2.25rem;
    margin: 0;
}

.page-heading p {
    color: var(--muted);
    font-size: 0.875rem;
    line-height: 1.25rem;
    margin: 0.25rem 0 0;
}

.site-footer {
    color: var(--muted);
    margin-top: 28px;
    padding: 26px 0 4px;
    text-align: center;
}

.site-footer-nav {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 14px 24px;
    justify-content: center;
}

.site-footer-nav a {
    color: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
}

.site-footer-nav a:hover {
    color: var(--text);
}

.app-chart-earnings-key {
    align-items: center;
    background: #2563eb;
    border: 1px solid #1d4ed8;
    border-radius: 0.3rem;
    color: #ffffff;
    display: inline-flex;
    font-size: 0.68rem;
    font-weight: 800;
    height: 1.2rem;
    justify-content: center;
    line-height: 1;
    width: 1.2rem;
}

.app-chart-earnings-layer {
    inset: 0;
    pointer-events: none;
    position: absolute;
    z-index: 9;
}

.app-chart-earnings-marker {
    align-items: center;
    background: #2563eb;
    border: 2px solid #ffffff;
    border-radius: 50%;
    bottom: 27px;
    box-shadow: 0 2px 5px rgba(15, 23, 42, 0.3);
    color: #ffffff;
    cursor: pointer;
    display: flex;
    font: 800 0.75rem/1 "TOSSans", "Segoe UI", sans-serif;
    height: 1.65rem;
    justify-content: center;
    padding: 0;
    pointer-events: auto;
    position: absolute;
    transform: translateX(-50%);
    width: 1.65rem;
}

.app-chart-earnings-marker:hover,
.app-chart-earnings-marker:focus-visible {
    background: #1d4ed8;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.24), 0 2px 5px rgba(15, 23, 42, 0.3);
    outline: none;
}

.app-chart-earnings-popover {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-left: 4px solid #2563eb;
    border-radius: 0.65rem;
    bottom: 68px;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.2);
    color: var(--text);
    padding: 1rem;
    pointer-events: auto;
    position: absolute;
}

.app-chart-earnings-header,
.app-chart-earnings-heading,
.app-chart-earnings-detail {
    align-items: center;
    display: flex;
}

.app-chart-earnings-header {
    justify-content: space-between;
}

.app-chart-earnings-heading {
    font-size: 1.1rem;
    gap: 0.55rem;
}

.app-chart-earnings-close {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 0.3rem;
    color: var(--muted);
    cursor: pointer;
    display: flex;
    font-size: 1.4rem;
    height: 1.8rem;
    justify-content: center;
    line-height: 1;
    padding: 0;
    width: 1.8rem;
}

.app-chart-earnings-close:hover,
.app-chart-earnings-close:focus-visible {
    background: var(--surface-soft);
    color: var(--text);
    outline: none;
}

.app-chart-earnings-summary {
    background: rgba(37, 99, 235, 0.09);
    border-radius: 0.55rem;
    line-height: 1.35;
    margin: 0.85rem 0;
    padding: 0.7rem 0.8rem;
}

.app-chart-earnings-details {
    display: grid;
    gap: 0.35rem;
}

.app-chart-earnings-detail {
    gap: 1rem;
    justify-content: space-between;
}

.app-chart-earnings-detail-label {
    color: var(--muted);
}

.app-chart-earnings-detail-value {
    font-family: "JetBrains Mono", monospace;
    font-weight: 700;
    text-align: right;
}

.app-chart-earnings-positive {
    color: var(--green);
}

.app-chart-earnings-negative {
    color: var(--red);
}

:root.dark-mode,
body.dark-mode {
    color-scheme: dark;
    --bg: #252526;
    --surface: #1f1f1f;
    --surface-soft: #252526;
    --border: #383838;
    --border-soft: #333333;
    --text: #d6d6d6;
    --muted: #c4c4c4;
    --muted-strong: #d6d6d6;
    --green-soft: #103d2d;
    --red-soft: #3a1e26;
    --amber-soft: #3b3217;
    --yellow-soft: #3b3217;
    --shadow: rgba(0, 0, 0, 0.2);
    --empty-none-bg: #333333;
    --empty-none-text: #b4b4b4;
    --empty-pending-bg: #243040;
    --empty-pending-text: #a9c1dc;
    background: var(--bg);
    color: var(--text);
}

body.dark-mode .app-chart-earnings-marker {
    border-color: #1f1f1f;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.55);
}

body.dark-mode .app-chart-earnings-popover {
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.52);
}

body.dark-mode .app-chart-earnings-summary {
    background: rgba(59, 130, 246, 0.16);
}

:root.dark-mode body {
    background: var(--bg);
    color: var(--text);
}

/* The head bootstrap marks <html> before body exists; keep Admin nav dark on first paint. */
:root.dark-mode .admin-page .site-nav {
    background: rgba(31, 31, 31, 0.82);
    border-color: #383838;
    box-shadow: none;
}

:root.dark-mode .admin-page .app-nav-btn {
    color: #c7c7c7;
}

:root.dark-mode .admin-page .app-nav-btn[aria-current="page"] {
    background: #2a2a2a;
    border-color: #4a4a4a;
    color: #f5f7f4;
}

body.dark-mode .brand-wordmark,
body.dark-mode .brand-name {
    color: #f5f7f4;
}

body.dark-mode .brand-logo-light {
    display: none;
}

body.dark-mode .brand-logo-dark {
    display: block;
}

body.dark-mode .actions,
body.dark-mode .site-nav {
    background: rgba(31, 31, 31, 0.82);
    border-color: #383838;
    box-shadow: none;
}

body.dark-mode .nav-link,
body.dark-mode .theme-btn,
body.dark-mode .app-nav-btn {
    color: #c7c7c7;
}

body.dark-mode .content-button {
    background: var(--surface);
    border-color: var(--border);
    color: #c7c7c7;
}

body.dark-mode .nav-link:hover,
body.dark-mode .theme-btn:hover,
body.dark-mode .app-nav-btn:hover,
body.dark-mode .nav-standalone-icon:hover,
body.dark-mode .content-button:hover {
    background: #2a2a2a;
    color: #f5f7f4;
}

body.dark-mode .nav-link:focus-visible,
body.dark-mode .theme-btn:focus-visible,
body.dark-mode .app-nav-btn:focus-visible,
body.dark-mode .nav-standalone-icon:focus-visible,
body.dark-mode .content-button:focus-visible {
    background: #2f332d;
    border-color: #4b5b43;
    color: #f5f7f4;
    outline-color: #8fa783;
}

body.dark-mode .nav-link[aria-current="page"],
body.dark-mode .app-nav-btn[aria-current="page"],
body.dark-mode .nav-standalone-icon[aria-current="page"] {
    background: #2a2a2a;
    border-color: #4a4a4a;
    color: #f5f7f4;
}

body.dark-mode .form-control {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

body.dark-mode .form-control:hover {
    background: #2a2a2a;
}

body.dark-mode .app-form .bg-white {
    background: var(--surface) !important;
}

body.dark-mode .app-form .border-slate-100,
body.dark-mode .app-form .border-slate-200,
body.dark-mode .app-form .border-slate-300,
body.dark-mode .app-form .option-type-card {
    border-color: var(--border) !important;
}

body.dark-mode .app-form .text-slate-900,
body.dark-mode .app-form .text-slate-800,
body.dark-mode .app-form .text-slate-700,
body.dark-mode .app-form .text-slate-600 {
    color: var(--text) !important;
}

body.dark-mode .app-form .text-slate-500,
body.dark-mode .app-form .text-slate-400 {
    color: var(--muted) !important;
}

body.dark-mode .app-form input:not([type="checkbox"]),
body.dark-mode .app-form select,
body.dark-mode .app-form textarea {
    background: #2a2a2a;
    border-color: #3a3a3a;
    color: #d0d0d0;
}

body.dark-mode .app-form input::placeholder,
body.dark-mode .app-form textarea::placeholder {
    color: #8b8b8b;
}

body.dark-mode .app-form input:disabled,
body.dark-mode .app-form select:disabled,
body.dark-mode .app-form textarea:disabled {
    background: #2a2a2a;
    color: #8b8b8b;
    opacity: 1;
}

body.dark-mode .app-form input[type="checkbox"] {
    accent-color: #7ac86d;
}

body.dark-mode .app-form input:focus,
body.dark-mode .app-form select:focus,
body.dark-mode .app-form textarea:focus {
    border-color: #737373 !important;
}

body.dark-mode .app-panel,
body.dark-mode .app-stat-card,
body.dark-mode .app-table-wrap {
    background: var(--surface);
    border-color: var(--border);
    box-shadow: none;
}

body.dark-mode .app-field {
    background: var(--control-bg);
    border-color: var(--control-border);
    color: var(--text);
}

body.dark-mode .app-field::placeholder {
    color: var(--control-placeholder);
}

body.dark-mode .app-field:focus {
    border-color: var(--green);
}

body.dark-mode .app-table th {
    background: var(--surface-soft);
    border-color: var(--border);
}

body.dark-mode .app-table td {
    border-color: var(--border);
}

body.dark-mode .app-status-pill {
    background: #242424;
    color: #d6d6d6;
}

body.dark-mode .app-status-pill-positive {
    border-color: rgba(122, 200, 109, 0.7);
}

body.dark-mode .app-status-pill-caution {
    border-color: rgba(250, 204, 21, 0.82);
}

body.dark-mode .app-status-pill-negative {
    border-color: rgba(251, 113, 133, 0.78);
}

body.dark-mode .app-status-pill-neutral {
    border-color: #525252;
}

body.dark-mode .app-signal-summary-count {
    color: #d6d6d6;
}

body.dark-mode .app-signal-card.signal-card {
    background-color: #2a2a2a !important;
    border-color: #444444 !important;
}

body.dark-mode .app-signal-state-pill {
    background: #242424;
    color: #d6d6d6;
}

body.dark-mode .app-signal-state-pill-positive {
    border-color: rgba(122, 200, 109, 0.7);
}

body.dark-mode .app-signal-state-pill-caution {
    border-color: rgba(250, 204, 21, 0.82);
}

body.dark-mode .app-signal-state-pill-negative {
    border-color: rgba(251, 113, 133, 0.78);
}

body.dark-mode .app-signal-state-pill-neutral {
    border-color: #525252;
}

.admin-developer-reference .page-heading p {
    max-width: 72rem;
}

.admin-developer-reference .toc {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px var(--shadow);
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1rem;
    padding: 0.9rem;
}

.admin-developer-reference .toc a {
    background: var(--surface-soft);
    border: 1px solid var(--border-soft);
    border-radius: 0.45rem;
    color: var(--muted-strong);
    font-size: 0.88rem;
    font-weight: 700;
    padding: 0.4rem 0.65rem;
    text-decoration: none;
}

.admin-developer-reference .section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px var(--shadow);
    margin-top: 1rem;
    overflow: hidden;
}

.admin-developer-reference .section-head {
    border-bottom: 1px solid var(--border);
    padding: 1.15rem 1.35rem;
}

.admin-developer-reference .section-head h3 {
    font-size: 1.25rem;
    line-height: 1.2;
    margin: 0;
}

.admin-developer-reference .section-head p {
    color: var(--muted);
    font-size: 0.93rem;
    margin: 0.35rem 0 0;
}

.admin-developer-reference .content-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 1.2rem 1.35rem;
}

.admin-developer-reference .content-grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-developer-reference .full {
    grid-column: 1 / -1;
}

.admin-developer-reference .panel {
    background: var(--surface-soft);
    border: 1px solid var(--border-soft);
    border-radius: 0.5rem;
    padding: 0.95rem;
}

.admin-developer-reference .panel h4 {
    font-size: 1rem;
    margin: 0 0 0.45rem;
}

.admin-developer-reference .panel p {
    color: var(--muted);
    font-size: 0.92rem;
    margin: 0;
}

.admin-developer-reference .panel ul,
.admin-developer-reference .panel ol {
    color: var(--muted);
    font-size: 0.92rem;
    margin: 0.45rem 0 0;
    padding-left: 1.1rem;
}

.admin-developer-reference .panel li + li {
    margin-top: 0.35rem;
}

.admin-developer-reference .formula {
    background: #f8faf7;
    border: 1px solid var(--border-soft);
    border-radius: 0.45rem;
    color: var(--muted-strong);
    font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
    font-size: 0.84rem;
    line-height: 1.5;
    margin-top: 0.55rem;
    overflow-x: auto;
    padding: 0.7rem;
    white-space: pre-wrap;
}

.admin-developer-reference .badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.6rem;
}

.admin-developer-reference .badge {
    background: var(--green-soft);
    border-radius: 0.35rem;
    color: #047857;
    display: inline-flex;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1;
    padding: 0.35rem 0.45rem;
    text-transform: uppercase;
}

.admin-developer-reference .badge.warn {
    background: var(--amber-soft);
    color: #92400e;
}

.admin-developer-reference .badge.stop {
    background: var(--red-soft);
    color: #be123c;
}

.admin-developer-reference .schedule-table,
.admin-developer-reference .data-table {
    border-collapse: collapse;
    font-size: 0.9rem;
    width: 100%;
}

.admin-developer-reference .schedule-table th,
.admin-developer-reference .schedule-table td,
.admin-developer-reference .data-table th,
.admin-developer-reference .data-table td {
    border-bottom: 1px solid var(--border-soft);
    padding: 0.7rem 0.65rem;
    text-align: left;
    vertical-align: top;
}

.admin-developer-reference .schedule-table th,
.admin-developer-reference .data-table th {
    color: var(--muted-strong);
    font-size: 0.78rem;
    text-transform: uppercase;
}

.admin-developer-reference .schedule-table td,
.admin-developer-reference .data-table td {
    color: var(--muted);
}

.admin-developer-reference code {
    background: #edf2e9;
    border-radius: 0.28rem;
    color: var(--muted-strong);
    font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
    font-size: 0.86em;
    padding: 0.05rem 0.25rem;
}

body.dark-mode .admin-developer-reference .formula,
body.dark-mode .admin-developer-reference code {
    background: #2a2a2a;
    color: #eeeeee;
}

body.dark-mode .admin-developer-reference .badge { color: #86efac; }
body.dark-mode .admin-developer-reference .badge.warn { color: #facc15; }
body.dark-mode .admin-developer-reference .badge.stop { color: #fda4af; }

body.dark-mode .app-signal-rail,
body.dark-mode .app-quality-rail {
    background: #3a3a3a;
}

@media (max-width: 1380px) {
    .app-screener-lanes {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

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

    .nav-group {
        justify-content: flex-start;
        width: 100%;
    }

    .nav-link,
    .theme-btn {
        width: auto;
    }

    .admin-developer-reference .content-grid,
    .admin-developer-reference .content-grid.three {
        grid-template-columns: 1fr;
    }

    .admin-adapter-row {
        grid-template-columns: minmax(16rem, 1.3fr) minmax(12rem, 0.8fr);
    }

    .admin-adapter-form,
    .admin-adapter-fixed-status {
        grid-column: 1 / -1;
    }

    .admin-trial-email-edit-grid {
        grid-template-columns: 1fr;
    }

    .admin-email-template-grid {
        grid-template-columns: 1fr;
    }

}

@media (max-width: 840px) {
    .app-dashboard-row {
        grid-template-columns: 1fr;
    }

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

    .app-screener-lanes {
        grid-template-columns: 1fr;
    }

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

    .admin-heading-actions {
        justify-content: flex-start;
    }

    .admin-adapters-heading,
    .admin-adapters-section .admin-section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-adapter-row {
        grid-template-columns: 1fr;
    }

    .admin-adapter-profile {
        grid-template-columns: 1fr;
    }

    .admin-adapter-profile-form {
        justify-self: stretch;
        max-width: none;
    }

    .admin-adapter-form,
    .admin-adapter-fixed-status {
        grid-column: auto;
    }

    .admin-schedule-profile-column {
        justify-items: start;
        width: 100%;
    }

    .admin-stat-grid,
    .admin-detail-grid,
    .admin-tier-editor-grid,
    .admin-tier-editor-footer,
    .admin-corporate-actions-window {
        grid-template-columns: 1fr;
    }

    .admin-user-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-user-summary-grid > div + div {
        border-left: 0;
    }

    .admin-user-summary-grid > div:nth-child(even) {
        border-left: 1px solid var(--border-soft);
    }

    .admin-user-summary-grid > div:nth-child(n + 3) {
        border-top: 1px solid var(--border-soft);
    }

}

@media (max-width: 760px) {
    .admin-desktop-nav {
        display: none;
    }

    .admin-mobile-navigation {
        display: flex;
    }

    .admin-nav-mobile-menu > summary {
        min-width: 8.5rem;
        width: auto;
    }

    .app-symbol-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .app-symbol-form {
        align-items: stretch;
        display: grid;
        grid-template-columns: 1fr;
    }

    .app-symbol-form .app-field {
        width: 100%;
    }

    .app-symbol-identity {
        border-bottom: 1px solid var(--border-soft);
        border-right: 0;
        padding: 0 0 0.75rem;
    }

    .app-symbol-identity-copy {
        min-width: 0;
    }

    .app-nav-btn {
        min-width: 7rem;
        width: auto;
    }

    .brand-wordmark,
    .brand-name {
        font-size: 1.8rem;
    }
}

@media (max-width: 560px) {
    .app-stat-grid {
        grid-template-columns: 1fr;
    }

    .app-toolbar {
        align-items: stretch;
    }

    .app-filter-panel .app-field-row {
        flex-wrap: wrap;
    }

    .app-filter-panel .app-field-row:last-child {
        justify-content: flex-start;
    }

    .app-screener-row-actions {
        justify-content: flex-end;
    }

    .app-field-row,
    .app-field {
        width: 100%;
    }

    .app-signal-comparison-grid[data-count] {
        grid-template-columns: minmax(0, 1fr);
    }

    .admin-search-form {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-search-form .content-button {
        width: 100%;
    }

    .admin-summary-search {
        min-width: 100%;
    }

    .admin-identity-counts {
        flex: 1 1 100%;
        overflow-x: auto;
    }

    .admin-identity-count {
        flex: 1 0 auto;
        min-width: max-content;
        padding-inline: 0.55rem;
    }

    .admin-identity-count .app-stat-label {
        white-space: nowrap;
    }

    .admin-identity-count .app-stat-value {
        text-align: center;
        width: 100%;
    }

    .admin-user-summary-grid {
        grid-template-columns: 1fr;
    }

    .admin-tier-limit-grid {
        grid-template-columns: 1fr;
    }

    .admin-trial-email-protected-summary,
    .admin-trial-email-field-grid,
    .admin-email-template-color-grid,
    .admin-email-template-region-grid {
        grid-template-columns: 1fr;
    }

    .admin-trial-email-editor-actions,
    .admin-trial-email-editor-actions .content-button {
        width: 100%;
    }

    .admin-trial-email-editor-actions {
        flex-direction: column;
    }

    .admin-user-summary-grid > div:nth-child(even) {
        border-left: 0;
    }

    .admin-user-summary-grid > div + div {
        border-top: 1px solid var(--border-soft);
    }

    .admin-user-actions,
    .admin-user-actions .content-button,
    .admin-user-actions form,
    .admin-user-actions form .content-button {
        width: 100%;
    }
}

/* Authenticated homepage and reusable left-navigation shell. */
.sr-only {
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

.app-symbol-icon {
    align-items: center;
    border: 1px solid color-mix(in srgb, currentColor 20%, transparent);
    border-radius: 50%;
    display: inline-flex;
    flex: 0 0 auto;
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.7rem;
    font-weight: 700;
    height: 2rem;
    justify-content: center;
    line-height: 1;
    overflow: hidden;
    position: relative;
    width: 2rem;
}

.app-company-logo {
    height: 100%;
    inset: 0;
    object-fit: contain;
    opacity: 0;
    padding: 0.05rem;
    position: absolute;
    transition: opacity 120ms ease;
    width: 100%;
}

.app-symbol-icon-has-logo {
    background: var(--surface);
    border-color: var(--border);
    color: transparent;
}

.app-symbol-icon-has-logo .app-company-logo {
    opacity: 1;
}

.app-symbol-icon-compact {
    font-size: 0.58rem;
    height: 1.5rem;
    width: 1.5rem;
}

.app-symbol-icon-large {
    border-radius: 50%;
    font-size: 0.95rem;
    height: 2.75rem;
    width: 2.75rem;
}

.app-symbol-icon-large .app-company-logo {
    padding: 0.1rem;
}

.app-symbol-icon-detail,
.app-symbol-icon-detail.app-symbol-icon-has-logo {
    border-radius: 0.625rem;
}

.app-symbol-icon-detail.app-symbol-icon-has-logo {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

.app-symbol-icon-detail .app-company-logo {
    border-radius: inherit;
}

.app-watchlist-stock-icon,
.app-watchlist-stock-icon.app-symbol-icon-has-logo {
    border-radius: 0.5rem;
    height: 2.5rem;
    width: 2.5rem;
}

.app-watchlist-stock-icon.app-symbol-icon-has-logo {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

.app-watchlist-stock-icon .app-company-logo {
    border-radius: inherit;
    padding: 0.08rem;
}

.app-symbol-heading,
.app-symbol-card-heading {
    align-items: center;
    display: flex;
    gap: 0.65rem;
}

.app-symbol-tone-0,
.home-symbol-tone-0 { background: #173a32; color: #66d5ad; }
.app-symbol-tone-1,
.home-symbol-tone-1 { background: #342f16; color: #e6c95c; }
.app-symbol-tone-2,
.home-symbol-tone-2 { background: #342126; color: #f28b98; }
.app-symbol-tone-3,
.home-symbol-tone-3 { background: #1e2f43; color: #7ab8f5; }
.app-symbol-tone-4,
.home-symbol-tone-4 { background: #302545; color: #b89af7; }
.app-symbol-tone-5,
.home-symbol-tone-5 { background: #3b291e; color: #f0a86f; }

body.home-dashboard-shell {
    --app-table-body-font-size: 0.86rem;
    --app-table-body-padding-block: 0.78rem;
    --app-table-body-padding-inline: 0.9rem;
    --app-table-header-font-size: 0.75rem;
    --app-table-header-font-weight: 700;
    --app-table-header-letter-spacing: 0.06em;
    --app-table-header-padding-block: 0.78rem;
    --app-table-header-padding-inline: 0.9rem;
    --app-table-numeric-font-size: 0.82rem;
    --app-table-primary-font-size: 0.95rem;
    --app-table-secondary-font-size: 0.72rem;
    --app-table-supporting-font-size: 0.82rem;
    font-family: "Source Sans 3", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    min-height: 100vh;
}

.home-app-frame {
    display: grid;
    grid-template-columns: 214px minmax(0, 1fr);
    min-height: 100vh;
}

.home-sidebar {
    background: #090c10;
    border-right: 1px solid #242b33;
    color: #d5dbe1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    left: 0;
    padding: 1rem 0.75rem;
    position: sticky;
    top: 0;
    z-index: 40;
}

.home-sidebar-brand {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin: 0 0.35rem 1.2rem;
}

.home-sidebar .brand {
    gap: 0.55rem;
}

.home-sidebar .brand img {
    height: 2.15rem;
    width: auto;
}

.home-sidebar .brand-wordmark {
    color: #f5f7f4;
    font-size: 1.45rem;
}

.home-sidebar-close,
.home-menu-button {
    align-items: center;
    background: transparent;
    border: 1px solid transparent;
    color: inherit;
    cursor: pointer;
    display: none;
    justify-content: center;
}

.home-sidebar-close {
    border-radius: 0.3rem;
    font-size: 1.35rem;
    height: 2rem;
    width: 2rem;
}

.home-sidebar-nav,
.home-sidebar-footer {
    align-content: start;
    display: grid;
    gap: 0.25rem;
    grid-auto-rows: min-content;
}

.home-sidebar-nav {
    flex: 1;
    /* The sidebar is pinned at the window's height, so on a short window the
       list scrolls instead of pushing Settings and Sign out out of reach. */
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.home-sidebar-footer {
    border-top: 1px solid #242b33;
    padding-top: 0.75rem;
}

.home-sidebar-footer form {
    margin: 0;
}

.home-sidebar-link {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 0.2rem;
    color: #aeb7c0;
    cursor: pointer;
    display: flex;
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    gap: 0.8rem;
    min-height: 2.6rem;
    padding: 0.55rem 0.7rem;
    position: relative;
    text-align: left;
    text-decoration: none;
    transition: background-color 140ms ease, color 140ms ease;
    width: 100%;
}

/* The rule above sets display, which outranks the user-agent [hidden] rule, so
   without this `element.hidden = true` marks a nav link without hiding it.
   entitlements.js hides links exactly that way, so every gated destination —
   Options, Trade Journal, and whatever follows — depends on this one line. */
.home-sidebar-link[hidden] {
    display: none;
}

.home-sidebar-link svg,
.home-menu-button svg,
.home-symbol-search svg {
    fill: none;
    flex: 0 0 auto;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.home-sidebar-link svg {
    height: 1.2rem;
    width: 1.2rem;
}

.home-sidebar-link:hover,
.home-sidebar-link:focus-visible {
    background: #14191f;
    color: #ffffff;
    outline: none;
}

.home-sidebar-link[aria-current="page"] {
    background: #151a20;
    box-shadow: inset 2px 0 0 #4fbe72;
    color: #f8faf8;
}

.home-sidebar-link[aria-current="page"] svg,
.home-theme-symbol {
    color: #78bf71;
}

.home-theme-symbol {
    align-items: center;
    display: inline-flex;
    font-size: 1.15rem;
    justify-content: center;
    width: 1.2rem;
}

.home-workspace {
    min-width: 0;
}

.home-utility-bar {
    align-items: center;
    background: color-mix(in srgb, var(--bg) 94%, transparent);
    border-bottom: 1px solid var(--border);
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1fr) minmax(22rem, 32rem) minmax(0, 1fr);
    min-height: 3.7rem;
    padding: 0.65rem 1rem;
    position: sticky;
    top: 0;
    z-index: 30;
}

.home-symbol-search {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.35rem;
    display: flex;
    gap: 0.55rem;
    grid-column: 2;
    justify-self: center;
    max-width: 32rem;
    padding: 0 0.75rem;
    position: relative;
    width: 100%;
}

.home-menu-button {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
}

.home-symbol-search svg {
    color: var(--muted);
    height: 1rem;
    width: 1rem;
}

.home-symbol-search input {
    appearance: none;
    background: transparent;
    border: 0;
    box-sizing: border-box;
    color: var(--text);
    flex: 1;
    font-family: "Source Sans 3", sans-serif;
    font-size: 0.875rem;
    font-weight: 400;
    height: 2.35rem;
    line-height: 1.25rem;
    margin: 0;
    min-width: 0;
    outline: 0;
    padding: 0.55rem 0;
}

.home-symbol-search input::placeholder {
    color: var(--muted-strong);
    opacity: 1;
}

body.home-dashboard-shell .home-symbol-search input,
body.dark-mode.home-dashboard-shell .home-symbol-search input {
    background: transparent !important;
    border: 0 !important;
}

body.dark-mode.home-dashboard-shell .home-symbol-search input {
    -webkit-text-fill-color: #f8fafc;
    color: #f8fafc !important;
}

body.dark-mode.home-dashboard-shell .home-symbol-search input::placeholder {
    -webkit-text-fill-color: #f8fafc;
    color: #f8fafc !important;
    opacity: 1;
}

.home-symbol-search:focus-within {
    border-color: #6fae69;
    box-shadow: 0 0 0 2px color-mix(in srgb, #6fae69 18%, transparent);
}

.home-utility-status {
    align-items: center;
    color: var(--muted);
    display: flex;
    gap: 0.55rem;
    grid-column: 3;
    justify-content: flex-end;
    justify-self: end;
    white-space: nowrap;
}

.signals-ai-trigger {
    align-items: center;
    background: transparent;
    border: 1px solid color-mix(in srgb, var(--green) 82%, var(--border));
    border-radius: 0.35rem;
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    flex: 0 0 auto;
    font: inherit;
    font-size: 1.15rem;
    font-weight: 600;
    gap: 0.42rem;
    height: 3rem;
    justify-content: center;
    line-height: 1;
    margin-inline-end: 0.5rem;
    padding: 0 0.9rem;
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
    white-space: nowrap;
}

.signals-ai-trigger:hover,
.signals-ai-trigger:focus-visible,
.signals-ai-trigger[aria-expanded="true"] {
    background: color-mix(in srgb, var(--green) 12%, transparent);
    border-color: var(--green);
    color: var(--text);
    outline: none;
}

.signals-ai-trigger:focus-visible,
.signals-ai-icon-button:focus-visible,
.signals-ai-new:focus-visible,
.signals-ai-history-new:focus-visible,
.signals-ai-history-more:focus-visible,
.signals-ai-prompt:focus-visible,
.signals-ai-send:focus-visible {
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--green) 24%, transparent);
}

.signals-ai-send svg {
    fill: none;
    flex: 0 0 auto;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.signals-ai-backdrop {
    background: rgba(0, 0, 0, 0.44);
    border: 0;
    cursor: default;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    position: fixed;
    transition: opacity 180ms ease;
    z-index: 90;
}

.signals-ai-drawer {
    background: #0e1318;
    border: 1px solid #34404a;
    border-radius: 0.65rem;
    box-shadow: -0.75rem 0.75rem 2.5rem rgba(0, 0, 0, 0.5);
    color: #f1f4f7;
    display: flex;
    flex-direction: column;
    height: calc(100dvh - 1.5rem);
    max-width: calc(100vw - 1.5rem);
    overflow: hidden;
    position: fixed;
    right: 0.75rem;
    top: 0.75rem;
    transform: translateX(calc(100% + 1.5rem));
    transition: transform 190ms ease;
    width: min(40rem, calc(100vw - 1.5rem));
    z-index: 91;
}

.signals-ai-drawer[aria-hidden="true"] {
    visibility: hidden;
}

body.signals-ai-open {
    overflow: hidden;
}

body.signals-ai-open .signals-ai-backdrop {
    opacity: 1;
    pointer-events: auto;
}

body.signals-ai-open .signals-ai-drawer {
    transform: translateX(0);
    visibility: visible;
}

/* SIG-496 Feedback button and dialog. The button stays under the Signals AI
   backdrop (z-index 90) and hides while the drawer or the phone menu is open,
   so it never sits over Send. The padding below lets the last row of any page
   scroll clear of it. */
.feedback-pill {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    gap: 0.4rem;
    height: 2.5rem;
    line-height: 1;
    padding: 0 0.95rem;
    position: fixed;
    right: calc(1rem + env(safe-area-inset-right, 0px));
    transition: border-color 150ms ease;
    z-index: 80;
}

.feedback-pill:hover,
.feedback-pill:focus-visible,
.feedback-pill[aria-expanded="true"] {
    border-color: var(--green);
    outline: none;
}

.feedback-pill:focus-visible {
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--green) 35%, transparent), 0 4px 14px rgba(0, 0, 0, 0.18);
}

.feedback-pill svg {
    fill: none;
    flex: 0 0 auto;
    height: 1.05rem;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
    width: 1.05rem;
}

body.signals-ai-open .feedback-pill,
body.home-sidebar-open .feedback-pill {
    display: none;
}

body.has-feedback-pill .home-workspace,
body.has-feedback-pill.onboarding-page {
    padding-bottom: 4.5rem;
}

body.has-feedback-pill .auth-shell {
    padding-bottom: 5.5rem;
}

.feedback-dialog {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.65rem;
    box-shadow: 0 0.75rem 2.5rem rgba(0, 0, 0, 0.35);
    color: var(--text);
    margin: auto calc(1rem + env(safe-area-inset-right, 0px)) calc(1rem + env(safe-area-inset-bottom, 0px)) auto;
    max-height: calc(100dvh - 2rem);
    padding: 0;
    width: min(28rem, calc(100vw - 2rem));
}

.feedback-dialog::backdrop {
    background: rgba(0, 0, 0, 0.44);
}

.feedback-dialog .feedback-form {
    display: grid;
    gap: 1rem;
    margin: 0;
    padding: 1.1rem 1.2rem 1.2rem;
}

.feedback-dialog .feedback-head {
    align-items: start;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.feedback-dialog h2 {
    color: var(--text);
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
}

.feedback-dialog .feedback-head p,
.feedback-dialog .feedback-sent p {
    color: var(--muted);
    font-size: 0.9rem;
    margin: 0.2rem 0 0;
}

.feedback-dialog .feedback-sent p {
    color: var(--text);
    font-size: 0.95rem;
    margin: 0 0 1rem;
}

.feedback-dialog .feedback-close {
    background: none;
    border: 0;
    border-radius: 0.3rem;
    color: var(--muted);
    cursor: pointer;
    font: inherit;
    font-size: 1.35rem;
    line-height: 1;
    padding: 0.1rem 0.35rem;
}

.feedback-dialog .feedback-close:hover,
.feedback-dialog .feedback-close:focus-visible {
    color: var(--text);
    outline: 2px solid color-mix(in srgb, var(--green) 35%, transparent);
}

.feedback-dialog .feedback-compose {
    display: grid;
    gap: 0.9rem;
}

/* The display above would otherwise beat the hidden attribute. */
.feedback-dialog .feedback-compose[hidden],
.feedback-dialog .feedback-sent[hidden] {
    display: none;
}

.feedback-dialog .feedback-types {
    border: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
    min-width: 0;
    padding: 0;
}

.feedback-dialog .feedback-types legend,
.feedback-dialog .feedback-field > label {
    color: var(--muted-strong);
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0 0 0.45rem;
    padding: 0;
}

.feedback-dialog .feedback-types label {
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.35rem 0.95rem;
    position: relative;
}

.feedback-dialog .feedback-types input {
    cursor: pointer;
    inset: 0;
    margin: 0;
    opacity: 0;
    position: absolute;
}

.feedback-dialog .feedback-types label:has(input:checked) {
    background: color-mix(in srgb, var(--green) 14%, transparent);
    border-color: var(--green);
    font-weight: 600;
}

.feedback-dialog .feedback-types label:has(input:focus-visible) {
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--green) 35%, transparent);
}

.feedback-dialog .feedback-field textarea {
    background: var(--control-bg);
    border: 1px solid var(--control-border);
    border-radius: 0.45rem;
    box-sizing: border-box;
    color: var(--control-text);
    display: block;
    font: inherit;
    font-size: 0.95rem;
    line-height: 1.45;
    min-height: 8rem;
    padding: 0.6rem 0.7rem;
    resize: vertical;
    width: 100%;
}

.feedback-dialog .feedback-field textarea::placeholder {
    color: var(--control-placeholder);
}

.feedback-dialog .feedback-field textarea:focus {
    border-color: var(--green);
    outline: 2px solid color-mix(in srgb, var(--green) 25%, transparent);
}

.feedback-dialog .feedback-meta {
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    font-size: 0.8rem;
    gap: 0.5rem;
    justify-content: space-between;
    margin-top: 0.4rem;
}

.feedback-dialog .feedback-meta code {
    color: var(--muted-strong);
    font-family: "JetBrains Mono", ui-monospace, monospace;
    overflow-wrap: anywhere;
}

.feedback-dialog .feedback-count {
    font-variant-numeric: tabular-nums;
}

.feedback-dialog .feedback-status {
    color: var(--red);
    font-size: 0.88rem;
    margin: 0;
}

.feedback-dialog .feedback-status:empty {
    display: none;
}

.feedback-dialog .feedback-actions {
    display: flex;
    gap: 0.6rem;
    justify-content: flex-end;
}

.feedback-dialog .feedback-button {
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 0.45rem;
    color: var(--text);
    cursor: pointer;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    min-height: 2.4rem;
    padding: 0 1.05rem;
}

.feedback-dialog .feedback-button.is-primary {
    background: transparent;
    border-color: var(--green);
    color: var(--green);
}

.feedback-dialog .feedback-button:hover:not(:disabled),
.feedback-dialog .feedback-button:focus-visible {
    background: color-mix(in srgb, var(--green) 10%, transparent);
    outline: none;
}

.feedback-dialog .feedback-button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

@media (max-width: 760px) {
    .feedback-pill {
        height: 2.75rem;
        justify-content: center;
        padding: 0;
        width: 2.75rem;
    }

    .feedback-pill-label {
        display: none;
    }

    /* A sheet from the bottom edge, clear of the phone's home bar. */
    .feedback-dialog {
        border-radius: 0.75rem 0.75rem 0 0;
        margin: auto 0 0;
        max-width: 100%;
        width: 100%;
    }

    .feedback-dialog .feedback-form {
        padding-bottom: calc(1.2rem + env(safe-area-inset-bottom, 0px));
    }
}

.signals-ai-header {
    align-items: center;
    border-bottom: 1px solid #29313a;
    display: flex;
    flex: 0 0 auto;
    justify-content: space-between;
    min-height: 3.7rem;
    padding: 0.4rem 0.5rem 0.4rem 1rem;
}

.signals-ai-title {
    align-items: center;
    display: flex;
    font-size: 1.15rem;
    gap: 0.55rem;
}

.signals-ai-spark {
    flex: 0 0 auto;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
    font-size: 1.2rem;
    line-height: 1;
}

.signals-ai-header-actions {
    align-items: center;
    display: flex;
    gap: 0.25rem;
}

/* SIG-303, option B: history icon, labelled "+ New", close. Every control is a
   44px touch target; the icon buttons share one shape. */
.signals-ai-icon-button {
    align-items: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 0.35rem;
    color: #9da7b1;
    cursor: pointer;
    display: inline-flex;
    flex: 0 0 auto;
    height: 2.75rem;
    justify-content: center;
    padding: 0;
    width: 2.75rem;
}

.signals-ai-icon-button svg,
.signals-ai-new svg,
.signals-ai-history-new svg {
    fill: none;
    flex: 0 0 auto;
    height: 1.2rem;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.9;
    width: 1.2rem;
}

.signals-ai-icon-button:hover {
    background: #161b21;
    color: #ffffff;
}

.signals-ai-icon-button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

/* Tucked under the answer it rates, quieter than the answer itself. */
.signals-ai-feedback {
    align-self: flex-start;
    display: flex;
    gap: 0.25rem;
    margin-top: -0.35rem;
}

.signals-ai-feedback .signals-ai-icon-button {
    height: 2.25rem;
    width: 2.25rem;
}

.signals-ai-feedback .signals-ai-icon-button svg {
    height: 1rem;
    width: 1rem;
}

.signals-ai-feedback-down svg {
    transform: rotate(180deg);
}

/* Filled as well as coloured, so the choice does not rest on colour alone. */
.signals-ai-feedback .signals-ai-icon-button[aria-pressed="true"] {
    color: var(--green);
}

.signals-ai-feedback .signals-ai-icon-button[aria-pressed="true"] svg {
    fill: color-mix(in srgb, var(--green) 25%, transparent);
}

.signals-ai-feedback[aria-busy="true"] .signals-ai-icon-button {
    cursor: progress;
}

/* The green-tint convention of the trigger's open state, so it is right in both
   themes; secondary, not primary, because it discards context. */
.signals-ai-new,
.signals-ai-history-new {
    align-items: center;
    background: color-mix(in srgb, var(--green) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--green) 55%, var(--border));
    border-radius: 0.35rem;
    color: var(--green);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    gap: 0.35rem;
    min-height: 2.75rem;
    padding: 0 0.75rem;
    white-space: nowrap;
}

.signals-ai-new svg,
.signals-ai-history-new svg {
    height: 1rem;
    stroke-width: 2.2;
    width: 1rem;
}

.signals-ai-new:hover,
.signals-ai-history-new:hover {
    background: color-mix(in srgb, var(--green) 20%, transparent);
    border-color: var(--green);
}

.signals-ai-new:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

/* Says plainly that the restored transcript is a tail, not the whole thing. */
.signals-ai-history-note {
    color: #7f8a94;
    font-size: 0.85rem;
    margin: 0;
    text-align: center;
}

.signals-ai-back {
    display: none;
    margin-inline-start: -0.6rem;
}

/* One drawer, two views. The header keeps its title and close; history swaps
   the spark for a back control and hides its own entry point and New. */
.signals-ai-drawer[data-view="history"] .signals-ai-back {
    display: inline-flex;
}

.signals-ai-drawer[data-view="history"] .signals-ai-title .signals-ai-spark,
.signals-ai-drawer[data-view="history"] .signals-ai-history-toggle,
.signals-ai-drawer[data-view="history"] .signals-ai-new,
.signals-ai-drawer[data-view="history"] .signals-ai-content,
.signals-ai-drawer[data-view="history"] .signals-ai-form,
.signals-ai-drawer[data-view="conversation"] .signals-ai-history-view {
    display: none;
}

.signals-ai-history-view {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 0.25rem;
    min-height: 0;
    overflow-y: auto;
    padding: 0.75rem;
}

.signals-ai-history-new {
    align-self: stretch;
    margin-bottom: 0.5rem;
}

.signals-ai-history-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.signals-ai-history-group {
    color: #7f8a94;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    margin: 0;
    padding: 0.5rem 0.75rem 0.25rem;
    text-transform: uppercase;
}

.signals-ai-history-row {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 0.5rem;
    color: #f1f4f7;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    font: inherit;
    gap: 0.25rem;
    min-height: 2.75rem;
    padding: 0.75rem;
    text-align: left;
    width: 100%;
}

.signals-ai-history-row:hover,
.signals-ai-history-row:focus-visible {
    background: #151c22;
    border-color: #34404a;
    outline: none;
}

.signals-ai-history-row.is-current {
    background: #151c22;
    border-color: color-mix(in srgb, var(--green) 55%, var(--border));
}

.signals-ai-history-row-heading {
    align-self: stretch;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    min-width: 0;
}

.signals-ai-history-row-title {
    font-size: 0.95rem;
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.signals-ai-history-row-time {
    color: #8c969f;
    flex: 0 0 auto;
    font-size: 0.8rem;
}

.signals-ai-history-row.is-current .signals-ai-history-row-time {
    color: var(--green);
    font-weight: 600;
}

.signals-ai-history-row-page {
    color: #8c969f;
    font-size: 0.82rem;
}

.signals-ai-history-status:empty,
.signals-ai-history-footnote:empty {
    display: none;
}

.signals-ai-history-status,
.signals-ai-history-footnote {
    color: #8c969f;
    font-size: 0.85rem;
    line-height: 1.4;
    margin: 0;
    padding: 0.75rem;
}

.signals-ai-history-more {
    align-self: center;
    background: transparent;
    border: 1px solid #34404a;
    border-radius: 0.35rem;
    color: #d6dce2;
    cursor: pointer;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    min-height: 2.75rem;
    padding: 0 0.9rem;
}

.signals-ai-history-more:hover {
    border-color: #4fbe72;
    color: #ffffff;
}

.signals-ai-content {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 0;
    overflow-y: auto;
    padding: 1rem;
}

.signals-ai-prompts {
    display: grid;
    gap: 0.5rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 0.6rem;
}

.signals-ai-prompt {
    background: #11161b;
    border: 1px solid #34404a;
    border-radius: 0.32rem;
    color: #d6dce2;
    cursor: pointer;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    min-height: 2.35rem;
    padding: 0.45rem 0.55rem;
}

.signals-ai-prompt:hover {
    background: #161b21;
    border-color: #4fbe72;
    color: #ffffff;
}

.signals-ai-prompt:disabled {
    cursor: not-allowed;
    opacity: 0.52;
}

.signals-ai-conversation {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    min-height: 0;
}

.signals-ai-connection-note,
.signals-ai-message {
    border: 1px solid #29313a;
    border-radius: 0.45rem;
    font-size: 1rem;
    line-height: 1.5;
    padding: 0.8rem;
}

.signals-ai-connection-note {
    background: #11161b;
    color: #aeb7c0;
    display: grid;
    gap: 0.25rem;
}

.signals-ai-drawer[data-state="ready"] .signals-ai-connection-note,
.signals-ai-drawer[data-state="loading"] .signals-ai-connection-note,
.signals-ai-drawer[data-state="success"] .signals-ai-connection-note,
.signals-ai-drawer[data-state="error"] .signals-ai-connection-note {
    display: none;
}

.signals-ai-connection-note strong {
    color: #f1f4f7;
}

.signals-ai-message-user {
    align-self: flex-end;
    background: #1b2229;
    color: #f1f4f7;
    max-width: 88%;
}

.signals-ai-message-system {
    align-self: flex-start;
    background: linear-gradient(135deg, #182028 0%, #131a20 100%);
    color: #aeb7c0;
    max-width: 100%;
    width: 100%;
}

.signals-ai-message-system > * {
    margin: 0;
}

.signals-ai-message-system > * + * {
    margin-top: 0.7rem;
}

.signals-ai-message-system h3,
.signals-ai-message-system h4 {
    border-left: 2px solid #4fbe72;
    color: #f1f4f7;
    font-size: 1rem;
    line-height: 1.35;
    padding-left: 0.55rem;
}

.signals-ai-message-system ul,
.signals-ai-message-system ol {
    padding-left: 1.25rem;
}

.signals-ai-message-system li + li,
.signals-ai-message-system li > ul,
.signals-ai-message-system li > ol {
    margin-top: 0.42rem;
}

.signals-ai-message-system li > ul,
.signals-ai-message-system li > ol {
    padding-left: 1.1rem;
}

.signals-ai-message-system strong {
    color: #f1f4f7;
    font-weight: 700;
}

.signals-ai-message-system code {
    background: #1b2229;
    border-radius: 0.2rem;
    color: #d6dce2;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.88em;
    padding: 0.08rem 0.22rem;
}

.signals-ai-table-wrap {
    border: 1px solid #29313a;
    border-radius: 0.35rem;
    max-width: 100%;
    overflow-x: auto;
}

/* Separate, not collapsed: a collapsed border belongs to the table and would
   scroll away from a pinned first-column cell. */
.signals-ai-message-system table {
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.875rem;
    font-variant-numeric: tabular-nums;
    line-height: 1.4;
    min-width: 100%;
}

.signals-ai-message-system th,
.signals-ai-message-system td {
    padding: 0.4rem 0.6rem;
    text-align: left;
    vertical-align: top;
}

.signals-ai-message-system th {
    background: #11161b;
    border-bottom: 1px solid #34404a;
    color: #f1f4f7;
    font-weight: 600;
    vertical-align: bottom;
}

.signals-ai-message-system tbody tr + tr td {
    border-top: 1px solid #29313a;
}

.signals-ai-message-system [data-align="right"] {
    text-align: right;
    white-space: nowrap;
}

.signals-ai-message-system [data-align="center"] {
    text-align: center;
    white-space: nowrap;
}

/* Set by the drawer script only while the table is wider than the tray. */
.signals-ai-table-wrap[data-overflow] th:first-child,
.signals-ai-table-wrap[data-overflow] td:first-child {
    box-shadow: inset -1px 0 #34404a;
    left: 0;
    position: sticky;
    z-index: 1;
}

.signals-ai-table-wrap[data-overflow] td:first-child {
    background: #161d24;
}

.signals-ai-message-loading {
    align-items: center;
    align-self: flex-start;
    color: #aeb7c0;
    display: flex;
    gap: 0.5rem;
}

.signals-ai-thinking-dots {
    display: inline-flex;
    gap: 0.2rem;
}

.signals-ai-thinking-dots i {
    animation: signals-ai-thinking 900ms ease-in-out infinite alternate;
    background: #4fbe72;
    border-radius: 50%;
    height: 0.3rem;
    width: 0.3rem;
}

.signals-ai-thinking-dots i:nth-child(2) {
    animation-delay: 150ms;
}

.signals-ai-thinking-dots i:nth-child(3) {
    animation-delay: 300ms;
}

.signals-ai-message-error {
    align-self: flex-start;
    background: color-mix(in srgb, #ef5c64 8%, #11161b);
    border-color: color-mix(in srgb, #ef5c64 55%, #29313a);
    color: #ffd7da;
    width: 100%;
}

@keyframes signals-ai-thinking {
    from { opacity: 0.28; transform: translateY(0); }
    to { opacity: 1; transform: translateY(-0.12rem); }
}

.signals-ai-form {
    background: #0e1318;
    border-top: 1px solid #29313a;
    flex: 0 0 auto;
    margin: 0;
    padding: 0.8rem 1rem 0.45rem;
}

.signals-ai-input-row {
    align-items: stretch;
    background: transparent;
    border: 0;
    display: grid;
    gap: 0.5rem;
    grid-template-columns: minmax(0, 1fr) 3rem;
}

body.home-dashboard-shell.app-shell .signals-ai-input-row textarea,
body.dark-mode.home-dashboard-shell.app-shell .signals-ai-input-row textarea {
    -webkit-text-fill-color: #f1f4f7 !important;
    background: transparent !important;
    border: 1px solid #34404a !important;
    border-radius: 0.4rem;
    color: #f1f4f7 !important;
    font-family: "Source Sans 3", sans-serif;
    font-size: 1rem;
    line-height: 1.4;
    margin: 0;
    max-height: 7rem;
    min-height: 2.8rem;
    outline: 0;
    padding: 0.8rem;
    resize: none;
}

body.home-dashboard-shell.app-shell .signals-ai-input-row textarea:focus,
body.dark-mode.home-dashboard-shell.app-shell .signals-ai-input-row textarea:focus {
    border-color: #4fbe72 !important;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--green) 18%, transparent);
}

body.home-dashboard-shell.app-shell .signals-ai-input-row textarea::placeholder,
body.dark-mode.home-dashboard-shell.app-shell .signals-ai-input-row textarea::placeholder {
    -webkit-text-fill-color: #7f8a94 !important;
    color: #7f8a94 !important;
}

.signals-ai-send {
    align-items: center;
    align-self: stretch;
    background: #3c9c5c;
    border: 0;
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    border-radius: 0.4rem;
    margin: 0;
    padding: 0;
}

.signals-ai-send:hover {
    background: #4fbe72;
}

.signals-ai-send:disabled,
.signals-ai-input-row textarea:disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

.signals-ai-send svg {
    height: 1.15rem;
    width: 1.15rem;
}

.signals-ai-form-status {
    color: #f0ad32;
    font-size: 0.85rem;
    margin: 0.25rem 0 0;
}

.signals-ai-form-status:empty {
    display: none;
}

.signals-ai-footer {
    color: #7f8a94;
    flex: 0 0 auto;
    font-size: 0.85rem;
    padding: 0 1rem 0.7rem;
    text-align: center;
}

.signals-ai-footer a {
    color: inherit;
}

body.home-dashboard-shell:not(.dark-mode) .signals-ai-drawer,
body.home-dashboard-shell:not(.dark-mode) .signals-ai-form {
    background: #f8fafc;
    color: #182016;
}

body.home-dashboard-shell:not(.dark-mode) .signals-ai-drawer {
    border-color: #b8c2b3;
    box-shadow: -1.25rem 0 3rem rgba(24, 32, 22, 0.18);
}

body.home-dashboard-shell:not(.dark-mode) .signals-ai-header,
body.home-dashboard-shell:not(.dark-mode) .signals-ai-form {
    border-color: #d6ddd2;
}

body.home-dashboard-shell:not(.dark-mode) .signals-ai-icon-button,
body.home-dashboard-shell:not(.dark-mode) .signals-ai-history-note,
body.home-dashboard-shell:not(.dark-mode) .signals-ai-history-group,
body.home-dashboard-shell:not(.dark-mode) .signals-ai-history-row-time,
body.home-dashboard-shell:not(.dark-mode) .signals-ai-history-row-page,
body.home-dashboard-shell:not(.dark-mode) .signals-ai-history-status,
body.home-dashboard-shell:not(.dark-mode) .signals-ai-history-footnote {
    color: #52604c;
}

body.home-dashboard-shell:not(.dark-mode) .signals-ai-icon-button:hover,
body.home-dashboard-shell:not(.dark-mode) .signals-ai-prompt:hover {
    background: #edf2ea;
    color: #182016;
}

body.home-dashboard-shell:not(.dark-mode) .signals-ai-feedback .signals-ai-icon-button[aria-pressed="true"] {
    color: var(--green);
}

body.home-dashboard-shell:not(.dark-mode) .signals-ai-history-row {
    color: #182016;
}

body.home-dashboard-shell:not(.dark-mode) .signals-ai-history-row:hover,
body.home-dashboard-shell:not(.dark-mode) .signals-ai-history-row:focus-visible,
body.home-dashboard-shell:not(.dark-mode) .signals-ai-history-row.is-current {
    background: #ffffff;
    border-color: #d6ddd2;
}

body.home-dashboard-shell:not(.dark-mode) .signals-ai-history-row.is-current {
    border-color: color-mix(in srgb, var(--green) 55%, var(--border));
}

body.home-dashboard-shell:not(.dark-mode) .signals-ai-history-row.is-current .signals-ai-history-row-time {
    color: var(--green);
}

body.home-dashboard-shell:not(.dark-mode) .signals-ai-history-more {
    border-color: #b8c2b3;
    color: #33402e;
}

body.home-dashboard-shell:not(.dark-mode) .signals-ai-connection-note,
body.home-dashboard-shell:not(.dark-mode) .signals-ai-message,
body.home-dashboard-shell:not(.dark-mode) .signals-ai-prompt {
    background: #ffffff;
    border-color: #d6ddd2;
}

body.home-dashboard-shell:not(.dark-mode) .signals-ai-connection-note strong,
body.home-dashboard-shell:not(.dark-mode) .signals-ai-message-system h3,
body.home-dashboard-shell:not(.dark-mode) .signals-ai-message-system h4,
body.home-dashboard-shell:not(.dark-mode) .signals-ai-message-system strong,
body.home-dashboard-shell:not(.dark-mode) .signals-ai-message-user {
    color: #182016;
}

body.home-dashboard-shell:not(.dark-mode) .signals-ai-message-system code {
    background: #edf2ea;
    color: #33402e;
}

body.home-dashboard-shell:not(.dark-mode) .signals-ai-table-wrap,
body.home-dashboard-shell:not(.dark-mode) .signals-ai-message-system tbody tr + tr td {
    border-color: #d6ddd2;
}

body.home-dashboard-shell:not(.dark-mode) .signals-ai-message-system th {
    background: #f4f7f2;
    border-bottom-color: #b8c2b3;
    color: #182016;
}

body.home-dashboard-shell:not(.dark-mode) .signals-ai-table-wrap[data-overflow] th:first-child,
body.home-dashboard-shell:not(.dark-mode) .signals-ai-table-wrap[data-overflow] td:first-child {
    box-shadow: inset -1px 0 #b8c2b3;
}

body.home-dashboard-shell:not(.dark-mode) .signals-ai-table-wrap[data-overflow] td:first-child {
    background: #ffffff;
}

body.home-dashboard-shell:not(.dark-mode) .signals-ai-connection-note,
body.home-dashboard-shell:not(.dark-mode) .signals-ai-message-system,
body.home-dashboard-shell:not(.dark-mode) .signals-ai-prompt {
    color: #52604c;
}

body.home-dashboard-shell:not(.dark-mode) .signals-ai-message-user {
    background: #edf2ea;
}

body.home-dashboard-shell:not(.dark-mode) .signals-ai-input-row {
    background: transparent;
}

body.home-dashboard-shell:not(.dark-mode).app-shell .signals-ai-input-row textarea {
    -webkit-text-fill-color: #182016 !important;
    background: #ffffff !important;
    border-color: #b8c2b3 !important;
    color: #182016 !important;
}

body.home-dashboard-shell:not(.dark-mode).app-shell .signals-ai-input-row textarea::placeholder {
    -webkit-text-fill-color: #697565 !important;
    color: #697565 !important;
}

body.home-dashboard-shell:not(.dark-mode) .signals-ai-footer {
    color: #697565;
}

@media (prefers-reduced-motion: reduce) {
    .signals-ai-backdrop,
    .signals-ai-drawer,
    .signals-ai-thinking-dots i {
        animation: none;
        transition: none;
    }
}

.home-symbol-search-results {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.4rem;
    box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.34);
    left: 0;
    max-height: 25rem;
    overflow-y: auto;
    position: absolute;
    right: 0;
    top: calc(100% + 0.4rem);
    z-index: 80;
}

.home-symbol-search-results[hidden] {
    display: none;
}

.home-symbol-search-result {
    align-items: center;
    background: transparent;
    border: 0;
    color: var(--text);
    cursor: pointer;
    display: grid;
    font: inherit;
    gap: 0.65rem;
    grid-template-columns: 2rem minmax(0, 1fr) auto;
    padding: 0.62rem 0.7rem;
    text-align: left;
    width: 100%;
}

.home-symbol-search-result + .home-symbol-search-result {
    border-top: 1px solid var(--border-soft);
}

.home-symbol-search-result:hover,
.home-symbol-search-result.is-active {
    background: var(--surface-soft);
}

.home-symbol-search-result-icon {
    align-items: center;
    background: color-mix(in srgb, var(--green) 16%, var(--surface-soft));
    border: 1px solid var(--border-soft);
    border-radius: 0.35rem;
    color: var(--green);
    display: inline-flex;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.72rem;
    font-weight: 700;
    height: 2rem;
    justify-content: center;
    overflow: hidden;
    position: relative;
    width: 2rem;
}

.home-symbol-search-result-icon img {
    background: var(--surface);
    height: 100%;
    inset: 0;
    object-fit: contain;
    padding: 0.12rem;
    position: absolute;
    width: 100%;
}

.home-symbol-search-result-identity,
.home-symbol-search-result-identity strong,
.home-symbol-search-result-identity small {
    display: block;
    min-width: 0;
}

.home-symbol-search-result-identity strong {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.78rem;
}

.home-symbol-search-result-identity small {
    color: var(--muted);
    font-size: 0.72rem;
    margin-top: 0.08rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-symbol-search-result-market {
    color: var(--muted);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.62rem;
    text-transform: uppercase;
}

.home-symbol-search-empty {
    color: var(--muted);
    font-size: 0.78rem;
    padding: 0.85rem;
    text-align: center;
}

.home-status-dot {
    background: var(--muted);
    border-radius: 50%;
    height: 0.45rem;
    transition: background-color 150ms ease, box-shadow 150ms ease;
    width: 0.45rem;
}

.home-status-dot.is-open {
    background: #22c55e;
    box-shadow: 0 0 0 3px color-mix(in srgb, #22c55e 13%, transparent);
}

.home-status-dot.is-closed {
    background: var(--red);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 13%, transparent);
}

/* Quiet, readable observation dates beside customer data. */
.app-freshness-display {
    color: var(--muted);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.4;
}

.app-data-as-of {
    display: block;
    margin-top: 0.25rem;
}

.home-utility-divider {
    background: var(--border);
    height: 1.4rem;
    margin: 0 0.35rem;
    width: 1px;
}

.home-dashboard {
    margin: 0 auto;
    max-width: 1600px;
    padding: 1.15rem;
}

/* Approved customer-page content frame. Migrate destinations one at a time after rendered review. */
body.home-dashboard-shell main.app-content-frame {
    margin-left: auto;
    margin-right: auto;
    max-width: 1600px;
    width: 100%;
}

.home-panel-header h2 {
    color: var(--text);
    font-family: "Source Sans 3", "Segoe UI", sans-serif;
    font-weight: 700;
    margin: 0;
}

/* Shared title block for authenticated left-navigation destinations. */
body.home-dashboard-shell .app-page-heading {
    margin: 0 0 0.9rem;
    padding: 0;
}

/*
 * Destination pages use Watchlists and Charts as the canonical outer rhythm.
 * A stacked page consumes the same 0.9rem heading-to-content gap through its
 * grid gap, so the heading margin is removed instead of being double-counted.
 */
body.home-dashboard-shell .home-dashboard:has(> .app-page-heading) {
    padding: 1rem;
}

body.home-dashboard-shell .app-page-stack {
    display: grid;
    gap: 0.9rem;
}

body.home-dashboard-shell .app-page-stack > .app-page-heading {
    margin-bottom: 0;
}

body.home-dashboard-shell .app-page-heading h1 {
    color: var(--text);
    font-family: "Source Sans 3", "Segoe UI", sans-serif;
    font-size: 1.875rem;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 2.25rem;
    margin: 0;
}

body.home-dashboard-shell .app-page-heading p {
    color: var(--muted);
    font-size: 0.875rem;
    line-height: 1.25rem;
    margin: 0.3rem 0 0;
}

body.home-dashboard-shell .app-page-heading-row {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

body.home-dashboard-shell .app-page-heading-row > :first-child {
    min-width: 0;
}

.signals-ai-heading-actions {
    align-items: center;
    align-self: center;
    display: flex;
    flex: 0 0 auto;
    gap: 1.25rem;
    justify-content: flex-end;
    margin-left: auto;
    min-width: 0;
}

.signals-ai-heading-actions .app-freshness-display {
    min-width: 0;
    padding-top: 0;
}

.home-kicker,
.home-symbol,
.home-briefing-metric strong {
    font-family: "JetBrains Mono", monospace;
}

.home-kicker {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.11em;
    margin-bottom: 0.18rem;
}

.home-positive-text {
    color: var(--green);
}

.home-market-pulse-strip {
    border: 1px solid var(--border-soft);
    border-radius: 0.35rem;
    margin: 0 0 0.7rem;
    overflow: hidden;
}

.home-dashboard .page-heading h1 {
    align-items: center;
    display: inline-flex;
    gap: 0.35rem;
}

.home-market-pulse-session-label {
    border: 1px solid color-mix(in srgb, var(--green) 55%, var(--border));
    border-radius: 999px;
    color: var(--green);
    display: inline-flex;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    line-height: 1;
    padding: 0.18rem 0.35rem;
    text-transform: uppercase;
}

.home-market-pulse-session-label[hidden] {
    display: none;
}

/* Tiles wrap instead of scrolling sideways: one row on laptops, 4 + 3 on
   tablets, two per row on phones. Each row fills its width, and the 1px
   gaps over the strip's border colour draw the dividers. */
.home-market-pulse-items {
    background: var(--border-soft);
    display: flex;
    flex-wrap: wrap;
    gap: 1px;
}

.home-market-pulse-item {
    align-items: center;
    background: var(--bg);
    display: flex;
    flex: 1 1 9.5rem;
    min-height: 3.45rem;
    min-width: 0;
    padding: 0.5rem 0.6rem;
}

.home-market-pulse-copy {
    display: grid;
    gap: 0.25rem;
    min-width: 0;
    width: 100%;
}

.home-market-pulse-copy strong {
    color: var(--muted-strong);
    font-size: 1.0rem;
    font-weight: 600;
    line-height: 1.1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-market-pulse-figures,
.home-market-pulse-value,
.home-market-pulse-movement {
    font-family: "JetBrains Mono", monospace;
    font-variant-numeric: tabular-nums;
}

/* The change sits right beside the price with a small fixed gap. When any
   tile is too narrow for that, home-dashboard.js marks the strip is-stacked
   and every tile puts the change under the price, so tiles stay consistent. */
.home-market-pulse-figures {
    align-items: baseline;
    display: flex;
    flex-wrap: wrap;
    gap: 0.15rem 0.5rem;
    min-width: 0;
}

.home-market-pulse-items.is-stacked .home-market-pulse-figures {
    align-items: flex-start;
    flex-direction: column;
}

.home-market-pulse-value {
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.15;
    white-space: nowrap;
}

.home-market-pulse-movement {
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.15;
    white-space: nowrap;
}

.home-market-pulse-item-positive .home-market-pulse-movement {
    color: var(--green);
}

.home-market-pulse-item-negative .home-market-pulse-movement {
    color: var(--red);
}

.home-market-pulse-item-neutral .home-market-pulse-movement {
    color: var(--muted);
}

.home-market-pulse-loading,
.home-market-pulse-unavailable {
    align-items: center;
    color: var(--muted);
    display: flex;
    font-size: 0.75rem;
    min-height: 3.45rem;
    padding: 0.45rem 0.65rem;
}

.home-dashboard-grid {
    display: grid;
    gap: 0.7rem;
    grid-template-columns: 300px minmax(560px, 1fr) 300px;
}

.home-dashboard-column {
    display: grid;
    gap: 0.7rem;
    min-width: 0;
}

.home-dashboard-column-left,
.home-dashboard-column-right {
    align-content: start;
}

/* Desktop trial: swap the outer Market Pulse columns without changing mobile flow. */
@media (min-width: 1261px) {
    .home-dashboard-column-left {
        grid-column: 3;
        grid-row: 1;
    }

    .home-dashboard-column-center {
        grid-column: 2;
        grid-row: 1;
    }

    .home-dashboard-column-right {
        grid-column: 1;
        grid-row: 1;
    }
}

.home-panel {
    border-radius: 0.35rem;
    box-shadow: none;
    min-width: 0;
    padding: 0;
    overflow: hidden;
}

.home-panel-header {
    align-items: center;
    background: color-mix(in srgb, var(--surface-soft) 62%, var(--surface));
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    gap: 0.8rem;
    justify-content: space-between;
    min-height: 3.25rem;
    padding: 0.65rem 0.8rem;
}

.home-panel-header h2 {
    font-size: 0.95rem;
    letter-spacing: 0.02em;
}

.home-panel-header a,
.home-panel-link {
    color: var(--green);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.home-panel-header a:hover,
.home-panel-link:hover {
    text-decoration: underline;
}

.home-briefing-list {
    display: grid;
}

.home-briefing-row {
    align-items: center;
    color: var(--text);
    display: grid;
    gap: 0.65rem;
    grid-template-columns: 4.6rem minmax(0, 1fr) auto;
    min-height: 4.5rem;
    padding: 0.7rem 0.8rem;
    text-decoration: none;
}

.home-briefing-row + .home-briefing-row {
    border-top: 1px solid var(--border-soft);
}

.home-briefing-row:not(.home-briefing-row-unavailable):hover {
    background: var(--surface-soft);
}

.home-briefing-label {
    color: var(--muted);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.61rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.home-briefing-company {
    align-items: center;
    display: flex;
    gap: 0.5rem;
    min-width: 0;
}

.home-briefing-company > span:last-child,
.home-briefing-company strong,
.home-briefing-company small,
.home-briefing-metric strong,
.home-briefing-metric small {
    display: block;
}

.home-briefing-company strong {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.85rem;
}

.home-briefing-company small,
.home-briefing-metric small {
    color: var(--muted);
    font-size: 0.64rem;
    margin-top: 0.08rem;
}

.home-briefing-company small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-briefing-metric {
    text-align: right;
}

.home-briefing-metric strong {
    font-size: 0.82rem;
}

.home-briefing-row-gainer .home-briefing-metric strong {
    color: var(--green);
}

.home-briefing-row-decliner .home-briefing-metric strong {
    color: var(--red);
}

.home-briefing-row-earnings .home-briefing-metric strong {
    color: var(--yellow);
}

.home-briefing-metric .home-briefing-direction {
    display: inline-flex;
    font-size: 0.61rem;
}

.home-briefing-symbol-icon,
.home-briefing-symbol-icon.app-symbol-icon-has-logo {
    border-radius: 0.325rem;
    height: 1.85rem;
    width: 1.85rem;
}

.home-briefing-empty {
    color: var(--muted);
    font-size: 0.72rem;
    grid-column: 2 / -1;
    text-align: right;
}

.home-panel-note {
    border-top: 1px solid var(--border-soft);
    color: var(--muted);
    font-size: 0.77rem;
    margin: 0;
    padding: 0.65rem 0.8rem;
}

.home-fear-greed-body {
    padding: 0.75rem 0.75rem 0.55rem;
}

.home-fear-greed-score-row {
    align-items: center;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    padding: 0 0.1rem 0.65rem;
    transform: translateY(0.12rem);
}

.home-fear-greed-score-row > strong {
    color: var(--text);
    font-family: "JetBrains Mono", monospace;
    font-size: 1.8rem;
    font-weight: 600;
    line-height: 1;
}

.home-fear-greed-score-row .app-status-pill {
    font-size: 0.75rem;
    min-height: 1.5rem;
    min-width: 3.75rem;
    padding: 0.28rem 0.6rem;
}

.home-fear-greed-gauge {
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    margin: 0 auto;
    max-width: 15.25rem;
    padding: 0;
    transform: translateY(-0.38rem);
}

.home-fear-greed-gauge svg {
    display: block;
    height: auto;
    shape-rendering: geometricPrecision;
    width: 100%;
}

.home-fear-greed-gauge text {
    font-family: "Source Sans 3", sans-serif;
}

.home-fear-greed-note {
    margin: 0.5rem 0 0;
    color: var(--muted-strong);
    font-size: 0.8rem;
    line-height: 1.5;
}

.home-loading-row,
.home-empty-cell {
    color: var(--muted);
    padding: 1rem;
    text-align: center;
}

.home-market-news {
    align-self: start;
}

.home-market-news-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.home-news-item {
    color: var(--text);
    display: grid;
    gap: 0.7rem;
    grid-template-columns: 6rem minmax(0, 1fr);
    min-width: 0;
    padding: 0.75rem;
    text-decoration: none;
}

.home-news-item:not(.home-news-item-featured) {
    border-bottom: 1px solid var(--border-soft);
}

.home-news-item:not(.home-news-item-featured):nth-child(even) {
    border-right: 1px solid var(--border-soft);
}

.home-news-item-featured {
    border-bottom: 1px solid var(--border-soft);
    grid-column: 1 / -1;
    grid-template-columns: minmax(15rem, 0.85fr) minmax(0, 1.15fr);
    padding: 0.9rem;
}

.home-news-item:hover {
    background: var(--surface-soft);
}

.home-news-image {
    aspect-ratio: 16 / 10;
    background: var(--surface-soft);
    border: 1px solid var(--border-soft);
    border-radius: 0.35rem;
    display: block;
    height: 5rem;
    object-fit: cover;
    width: 100%;
}

.home-news-item-featured .home-news-image {
    height: 10.5rem;
}

.home-news-item-no-image {
    grid-template-columns: minmax(0, 1fr);
}

.home-news-copy {
    align-self: center;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.home-news-context {
    align-items: center;
    color: var(--muted);
    display: flex;
    font-size: 0.64rem;
    gap: 0.45rem;
    letter-spacing: 0.04em;
    margin-bottom: 0.28rem;
    text-transform: uppercase;
}

.home-news-context strong {
    color: var(--green);
    font-family: "JetBrains Mono", monospace;
}

.home-news-title {
    display: -webkit-box;
    font-size: 0.82rem;
    line-height: 1.35;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.home-news-item-featured .home-news-title {
    font-size: 1.1rem;
    line-height: 1.3;
}

.home-news-meta {
    color: var(--muted);
    font-size: 0.66rem;
    margin-top: 0.45rem;
}

.home-company-cell {
    align-items: center;
    color: var(--text);
    display: flex;
    gap: 0.55rem;
    min-width: 0;
    text-decoration: none;
}

.home-company-cell > span:last-child {
    min-width: 0;
}

.home-company-cell strong,
.home-company-cell small {
    display: block;
}

.home-company-cell small {
    color: var(--muted);
    margin-top: 0.1rem;
    max-width: 11rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-company-cell:hover .home-symbol {
    color: var(--green);
}

.home-symbol-icon {
    align-items: center;
    border-radius: 50%;
    color: #101510;
    display: inline-flex;
    flex: 0 0 auto;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.72rem;
    font-weight: 700;
    height: 1.75rem;
    justify-content: center;
    width: 1.75rem;
}

.home-symbol-icon.app-symbol-icon-has-logo {
    background: var(--surface);
    border-radius: 50%;
    color: transparent;
}

.home-watchlist-symbol-icon,
.home-watchlist-symbol-icon.app-symbol-icon-has-logo {
    border-radius: 0.375rem;
}

.home-watchlist-symbol-icon.app-symbol-icon-has-logo {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

.home-watchlist-symbol-icon .app-company-logo {
    border-radius: inherit;
}

.home-symbol-tone-0 { background: #78bf71; }
.home-symbol-tone-1 { background: #93c5fd; }
.home-symbol-tone-2 { background: #f4bf72; }
.home-symbol-tone-3 { background: #d8b4fe; }
.home-symbol-tone-4 { background: #f9a8d4; }
.home-symbol-tone-5 { background: #cbd5e1; }

.home-watchlist-list {
    padding: 0;
}

.home-watchlist-picker {
    align-items: center;
    border-bottom: 1px solid var(--border-soft);
    display: grid;
    gap: 0.6rem;
    grid-template-columns: auto minmax(0, 1fr);
    padding: 0.65rem 0.8rem;
}

.home-watchlist-picker label {
    color: var(--muted);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.home-watchlist-picker select {
    background-color: var(--control-bg);
    border: 1px solid var(--control-border);
    border-radius: 0.35rem;
    color: var(--control-text);
    font: inherit;
    font-size: 0.78rem;
    min-height: 2.35rem;
    min-width: 0;
    padding: 0 2.25rem 0 0.75rem;
    width: 100%;
}

.home-watchlist-row {
    align-items: center;
    border-bottom: 1px solid var(--border-soft);
    display: grid;
    gap: 0.75rem;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    min-height: 3.2rem;
    padding: 0.36rem 0.8rem;
    text-decoration: none;
}

.home-watchlist-status {
    display: contents;
}

.home-watchlist-price {
    color: var(--text);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.72rem;
    grid-column: 2;
    justify-self: center;
}

.home-watchlist-status .app-status-pill {
    grid-column: 3;
    justify-self: end;
}

.home-watchlist-row:hover {
    background: var(--surface-soft);
}

.home-panel-link {
    border-top: 1px solid var(--border-soft);
    display: block;
    padding: 0.7rem 0.8rem;
}

.home-panel-title-group {
    align-items: center;
    display: flex;
    gap: 0.6rem;
    min-width: 0;
}

.home-panel-title-group .app-status-pill {
    font-size: 0.58rem;
    padding: 0.2rem 0.38rem;
}

.home-analyst-activity-list {
    display: grid;
}

.home-analyst-activity .home-panel-header {
    gap: 0.45rem;
}

.home-analyst-activity .home-panel-header h2,
.home-analyst-activity #home-analyst-activity-meta {
    white-space: nowrap;
}

.home-analyst-row {
    align-items: center;
    color: var(--text);
    display: grid;
    gap: 0.7rem;
    grid-template-columns: 2rem minmax(0, 1fr);
    min-height: 4.25rem;
    padding: 0.55rem 0.8rem;
    text-decoration: none;
}

.home-analyst-row + .home-analyst-row {
    border-top: 1px solid var(--border-soft);
}

.home-analyst-row:hover {
    background: var(--surface-soft);
}

.home-analyst-identity {
    align-items: center;
    display: flex;
}

.home-analyst-symbol-icon,
.home-analyst-symbol-icon.app-symbol-icon-has-logo {
    border-radius: 0.325rem;
    height: 1.75rem;
    width: 1.75rem;
}

.home-analyst-copy {
    align-self: center;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.home-analyst-context {
    align-items: baseline;
    color: var(--muted);
    display: flex;
    font-size: 0.64rem;
    gap: 0.5rem;
    letter-spacing: 0.04em;
    margin-bottom: 0.18rem;
    min-width: 0;
    text-transform: uppercase;
}

.home-analyst-symbol,
.home-market-mover-row strong {
    font-family: "JetBrains Mono", monospace;
}

.home-analyst-symbol {
    color: var(--text);
    font-size: 0.72rem;
}

.home-analyst-action {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.65rem;
    font-weight: 600;
    white-space: nowrap;
}

.home-analyst-action-positive {
    color: var(--green);
}

.home-analyst-action-negative {
    color: var(--red);
}

.home-analyst-action-neutral {
    color: var(--muted-strong);
}

.home-analyst-headline {
    font-size: 0.76rem;
    line-height: 1.3;
}

.home-analyst-details {
    color: var(--muted);
    display: block;
    font-size: 0.64rem;
    margin-top: 0.22rem;
}

.home-market-movers-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.home-market-mover-lane {
    min-width: 0;
    padding: 0.7rem 0.8rem;
}

.home-market-mover-lane + .home-market-mover-lane {
    border-left: 1px solid var(--border-soft);
}

.home-market-mover-lane h3 {
    font-size: 0.72rem;
    margin: 0 0 0.35rem;
}

.home-market-mover-lane-positive h3,
.home-market-mover-lane-positive .home-market-mover-row > strong {
    color: var(--green);
}

.home-market-mover-lane-negative h3,
.home-market-mover-lane-negative .home-market-mover-row > strong {
    color: var(--red);
}

.home-market-mover-row {
    align-items: center;
    color: var(--text);
    display: grid;
    gap: 0.65rem;
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 2rem;
    padding: 0.22rem 0;
    text-decoration: none;
}

.home-market-mover-row + .home-market-mover-row {
    border-top: 1px solid var(--border-soft);
}

.home-market-mover-row > span {
    align-items: baseline;
    display: grid;
    gap: 0.55rem;
    grid-template-columns: 3.4rem minmax(0, 1fr);
    min-width: 0;
}

.home-market-mover-row > span:first-child .home-market-mover-detail {
    grid-column: 2;
}

.home-market-mover-metrics {
    align-items: flex-end !important;
    display: flex !important;
    flex-direction: column;
    gap: 0.08rem !important;
    text-align: right;
}

.home-market-mover-metrics small {
    color: inherit !important;
    font-family: var(--font-mono);
}

.home-market-mover-row > span strong,
.home-market-mover-row > span small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-market-mover-row > span strong,
.home-market-mover-row > strong {
    font-size: 0.7rem;
}

.home-market-mover-row > span small,
.home-market-mover-empty {
    color: var(--muted);
    font-size: 0.66rem;
}

.home-market-mover-row:hover > span strong {
    color: var(--green);
}

.home-market-mover-empty {
    padding: 0.7rem 0;
}

body.market-movers-dashboard-shell .market-movers-page-timestamp {
    padding-top: 0.35rem;
    white-space: nowrap;
}

@media (max-width: 760px) {
    body.market-movers-dashboard-shell .market-movers-page-timestamp {
        padding-top: 0;
    }
}

.market-movers-error {
    background: color-mix(in srgb, var(--red) 9%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--red) 35%, var(--border));
    border-radius: 0.4rem;
    color: var(--red);
    margin-bottom: 0.7rem;
    padding: 0.75rem 0.9rem;
}

.market-movers-top-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.market-movers-summary-card,
.market-movers-table-card {
    min-width: 0;
    overflow: hidden;
}

.market-movers-summary-card-positive {
    border-top: 2px solid color-mix(in srgb, var(--green) 72%, var(--border));
}

.market-movers-summary-card-negative {
    border-top: 2px solid color-mix(in srgb, var(--red) 72%, var(--border));
}

.market-movers-card-heading,
.market-movers-table-heading {
    align-items: center;
    background: color-mix(in srgb, var(--surface-soft) 62%, var(--surface));
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 0.85rem 1rem;
}

.market-movers-card-heading h2,
.market-movers-card-heading p,
.market-movers-table-heading h2,
.market-movers-table-heading p {
    margin: 0;
}

.market-movers-card-heading h2,
.market-movers-table-heading h2 {
    color: var(--text);
    font-size: 1.05rem;
}

.market-movers-summary-card-positive .market-movers-card-heading h2 {
    color: var(--green);
}

.market-movers-summary-card-negative .market-movers-card-heading h2 {
    color: var(--red);
}

.market-movers-card-heading p,
.market-movers-table-heading p {
    color: var(--muted);
    font-size: 0.82rem;
    margin-top: 0.15rem;
}

.market-movers-view-all {
    background: transparent;
    border: 0;
    color: var(--green);
    cursor: pointer;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0.35rem 0;
}

.market-movers-summary-card-negative .market-movers-view-all {
    color: var(--red);
}

.market-movers-summary-list {
    display: grid;
    min-height: 14rem;
}

.market-movers-summary-row {
    align-items: center;
    border-bottom: 1px solid var(--border-soft);
    display: grid;
    gap: 0.2rem 0.55rem;
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 3.25rem;
    padding: 0.48rem 0.7rem;
}

.market-movers-summary-row:last-child {
    border-bottom: 0;
}

.market-movers-summary-row:hover,
.market-movers-table tbody tr:hover {
    background: var(--surface-soft);
}

.market-movers-summary-identity {
    align-items: center;
    display: grid;
    gap: 0.55rem;
    grid-row: 1 / span 2;
    grid-template-columns: 1.8rem minmax(0, 1fr);
    min-width: 0;
}

.market-movers-summary-copy {
    font-size: 0.82rem;
    min-width: 0;
}

.market-movers-summary-copy > a,
.market-movers-summary-copy > span {
    display: block;
}

.market-movers-summary-copy > span,
.market-movers-company-cell {
    color: var(--muted-strong);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.market-movers-stock-icon,
.market-movers-stock-icon.app-symbol-icon-has-logo {
    border-radius: 0.35rem;
    height: 1.8rem;
    width: 1.8rem;
}

.market-movers-symbol-link {
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
}

.market-movers-symbol-link:hover {
    color: var(--green);
    text-decoration: underline;
}

.market-movers-summary-price,
.market-movers-summary-change,
.market-movers-table td:not(.market-movers-company-cell) {
    font-family: var(--font-mono);
}

.market-movers-summary-price,
.market-movers-summary-change {
    grid-column: 2;
    text-align: right;
    white-space: nowrap;
}

.market-movers-summary-price {
    font-size: 0.86rem;
    grid-row: 1;
}

.market-movers-summary-change {
    grid-row: 2;
}

.market-movers-summary-change {
    align-items: flex-end;
    display: flex;
    flex-direction: column;
    font-size: 0.82rem;
}

.market-movers-tone-positive .market-movers-summary-change,
.market-movers-tone-positive .market-movers-semantic-value,
.market-movers-tone-positive .market-movers-direction-cell {
    color: var(--green);
}

.market-movers-tone-negative .market-movers-summary-change,
.market-movers-tone-negative .market-movers-semantic-value,
.market-movers-tone-negative .market-movers-direction-cell {
    color: var(--red);
}

.market-movers-table-heading > strong {
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    white-space: nowrap;
}

.market-movers-toolbar {
    align-items: end;
    border-bottom: 1px solid var(--border-soft);
    display: grid;
    gap: 0.75rem;
    grid-template-columns: auto minmax(15rem, auto) minmax(14rem, 1fr) minmax(12rem, 0.55fr);
    padding: 0.85rem 1rem;
}

.app-table-filter-group,
.market-movers-direction-filter {
    display: inline-flex;
}

.app-table-filter-group button,
.market-movers-direction-filter button {
    background: var(--surface-soft);
    border: 1px solid var(--border);
    color: var(--muted-strong);
    cursor: pointer;
    font: inherit;
    font-size: 0.75rem;
    min-height: 2.25rem;
    padding: 0.42rem 0.8rem;
}

.app-table-filter-group button + button,
.market-movers-direction-filter button + button {
    border-left: 0;
}

.app-table-filter-group button:first-child,
.market-movers-direction-filter button:first-child {
    border-radius: 0.35rem 0 0 0.35rem;
}

.app-table-filter-group button:last-child,
.market-movers-direction-filter button:last-child {
    border-radius: 0 0.35rem 0.35rem 0;
}

.app-table-filter-group button.is-active,
.market-movers-direction-filter button.is-active {
    background: color-mix(in srgb, var(--green) 15%, var(--surface-soft));
    border-color: color-mix(in srgb, var(--green) 55%, var(--border));
    color: var(--text);
    position: relative;
    z-index: 1;
}

.app-table-filter-group button + button.is-active,
.market-movers-direction-filter button + button.is-active {
    border-left: 1px solid color-mix(in srgb, var(--green) 55%, var(--border));
    margin-left: -1px;
}

.market-movers-index-filter {
    border: 0;
    margin: 0;
    min-width: 0;
    padding: 0;
}

.market-movers-index-filter legend {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-bottom: 0.3rem;
    padding: 0;
    text-transform: uppercase;
}

.market-movers-index-filter > div {
    align-items: center;
    background: var(--surface-soft);
    border: 1px solid var(--control-border);
    border-radius: 0.35rem;
    display: flex;
    gap: 0.9rem;
    min-height: 2.25rem;
    padding: 0.42rem 0.7rem;
}

.market-movers-index-filter label {
    align-items: center;
    color: var(--muted-strong);
    cursor: pointer;
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 600;
    gap: 0.35rem;
    white-space: nowrap;
}

.market-movers-index-filter input {
    accent-color: var(--green);
    height: 0.95rem;
    margin: 0;
    width: 0.95rem;
}

.market-movers-filter-field {
    color: var(--muted);
    display: grid;
    font-size: 0.68rem;
    font-weight: 700;
    gap: 0.3rem;
    letter-spacing: 0.04em;
    min-width: 0;
    text-transform: uppercase;
}

.market-movers-filter-field input,
.market-movers-filter-field select {
    border: 1px solid var(--control-border);
    border-radius: 0.35rem;
    font: inherit;
    font-size: 0.78rem;
    min-height: 2.25rem;
    min-width: 0;
    padding: 0.42rem 0.65rem;
    text-transform: none;
    width: 100%;
}

.market-movers-table-scroll {
    overflow-x: auto;
}

.market-movers-table {
    --app-table-body-padding-block: 0.62rem;
    --app-table-body-padding-inline: 0.85rem;
    --app-table-header-padding-block: 0.7rem;
    --app-table-header-padding-inline: 0.85rem;
    min-width: 1200px;
}

.market-movers-col-company {
    width: 28%;
}

.market-movers-col-direction {
    width: 8%;
}

.market-movers-col-price,
.market-movers-col-change,
.market-movers-col-percent {
    width: 10%;
}

.market-movers-col-volume,
.market-movers-col-average-volume {
    width: 11%;
}

.market-movers-col-market-cap {
    width: 12%;
}

.market-movers-table tbody tr:nth-child(even) {
    background: color-mix(in srgb, var(--surface-soft) 42%, var(--surface));
}

.market-movers-company-cell {
    min-width: 0;
}

.market-movers-table-company {
    align-items: center;
    display: grid;
    gap: 0.6rem;
    grid-template-columns: 1.75rem minmax(0, 1fr);
    min-width: 0;
}

.market-movers-table-company-copy {
    align-items: baseline;
    display: grid;
    gap: 0.15rem 0.65rem;
    grid-template-columns: minmax(3.5rem, auto) minmax(0, 1fr);
    min-width: 0;
}

.market-movers-table-company-copy > span {
    color: var(--muted-strong);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.market-movers-table-stock-icon,
.market-movers-table-stock-icon.app-symbol-icon-has-logo {
    border-radius: 0.3rem;
    height: 1.75rem;
    width: 1.75rem;
}

.market-movers-direction-cell {
    text-align: center;
}

.market-movers-direction-indicator {
    align-items: center;
    border: 1px solid currentColor;
    border-radius: 999px;
    display: inline-flex;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.9rem;
    font-weight: 700;
    height: 1.55rem;
    justify-content: center;
    line-height: 1;
    width: 1.55rem;
}

.market-movers-direction-up {
    background: color-mix(in srgb, var(--green) 12%, transparent);
    color: var(--green);
}

.market-movers-direction-down {
    background: color-mix(in srgb, var(--red) 12%, transparent);
    color: var(--red);
}

.market-movers-volume-cell,
.market-movers-market-cap-cell {
    color: var(--muted-strong) !important;
}

.market-movers-empty {
    color: var(--muted);
    margin: 0;
    padding: 1.2rem !important;
    text-align: center;
}

.market-movers-table-footer {
    color: var(--muted);
    font-size: 0.8rem;
    padding: 0.7rem 1rem;
}

@media (max-width: 1300px) {
    .market-movers-top-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1220px) {
    .market-movers-toolbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .market-movers-direction-filter {
        align-self: end;
    }
}

@media (max-width: 760px) {
    .market-movers-top-grid,
    .market-movers-toolbar {
        grid-template-columns: 1fr;
    }

}

.social-trends-page-timestamp {
    padding-top: 0.35rem;
    white-space: nowrap;
}

.social-trends-error {
    background: color-mix(in srgb, var(--red) 9%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--red) 35%, var(--border));
    border-radius: 0.4rem;
    color: var(--red);
    padding: 0.75rem 0.9rem;
}

.social-trends-summary-grid {
    display: grid;
    gap: 0.85rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.social-trends-summary-card {
    border-top: 2px solid color-mix(in srgb, var(--blue) 72%, var(--border));
    display: grid;
    gap: 0.35rem;
    grid-template-rows: auto minmax(2.4rem, auto) auto;
    min-height: 7rem;
    padding: 0.85rem 1rem;
}

.social-trends-summary-card > span {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.social-trends-summary-card > strong {
    align-self: center;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 1.2rem;
}

.social-trends-summary-card > small {
    color: var(--muted-strong);
    font-size: 0.82rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.social-trends-highlight {
    align-items: center;
    align-self: center;
    display: grid;
    gap: 0.65rem;
    grid-template-columns: 2.25rem minmax(0, 1fr);
    min-width: 0;
}

.social-trends-highlight-icon,
.social-trends-highlight-icon.app-symbol-icon-has-logo {
    border-radius: 0.4rem;
    height: 2.25rem;
    width: 2.25rem;
}

.politician-trades-security-logo-fallback {
    align-items: center;
    background: var(--surface-raised);
    border: 1px solid var(--border-soft);
    color: var(--text-muted);
    display: inline-flex;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.85rem;
    font-weight: 700;
    justify-content: center;
}

.politician-trades-issuer-name {
    color: var(--text-strong);
    font-size: 0.82rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.social-trends-highlight-copy {
    min-width: 0;
}

.social-trends-highlight-copy > a,
.social-trends-highlight-copy > span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.social-trends-highlight-copy > a {
    font-size: 1.2rem;
}

.social-trends-highlight-copy > span {
    color: var(--muted-strong);
    font-size: 0.82rem;
    margin-top: 0.08rem;
}

.social-trends-table-card {
    min-width: 0;
    overflow: hidden;
}

.social-trends-table-heading {
    align-items: end;
    background: color-mix(in srgb, var(--surface-soft) 62%, var(--surface));
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 0.85rem 1rem;
}

.social-trends-table-heading h2,
.social-trends-table-heading p {
    margin: 0;
}

.social-trends-table-heading h2 {
    color: var(--text);
    font-size: 1.05rem;
}

.social-trends-table-title-row {
    align-items: baseline;
    display: flex;
    gap: 0.65rem;
}

.social-trends-table-title-row > strong {
    color: var(--muted-strong);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    white-space: nowrap;
}

.social-trends-table-heading p {
    color: var(--muted);
    font-size: 0.82rem;
    margin-top: 0.15rem;
}

.social-trends-table-controls {
    align-items: end;
    display: flex;
    gap: 0.75rem;
}

.social-trends-search,
.social-trends-movement-field {
    color: var(--muted);
    display: grid;
    font-size: 0.68rem;
    font-weight: 700;
    gap: 0.3rem;
    letter-spacing: 0.04em;
    min-width: min(18rem, 45vw);
    text-transform: uppercase;
}

.social-trends-movement-field {
    min-width: 0;
}

.social-trends-movement-filter {
    display: inline-flex;
}

.social-trends-movement-filter button {
    background: var(--surface-soft);
    border: 1px solid var(--control-border);
    color: var(--muted-strong);
    cursor: pointer;
    font: inherit;
    font-size: 0.75rem;
    min-height: 2.25rem;
    padding: 0.42rem 0.72rem;
}

.social-trends-movement-filter button + button {
    margin-left: -1px;
}

.social-trends-movement-filter button:first-child {
    border-radius: 0.35rem 0 0 0.35rem;
}

.social-trends-movement-filter button:last-child {
    border-radius: 0 0.35rem 0.35rem 0;
}

.social-trends-movement-filter button.is-active {
    background: color-mix(in srgb, var(--green) 15%, var(--surface-soft));
    border-color: color-mix(in srgb, var(--green) 55%, var(--border));
    color: var(--text);
    position: relative;
    z-index: 1;
}

.social-trends-search input {
    border: 1px solid var(--control-border);
    border-radius: 0.35rem;
    font: inherit;
    font-size: 0.78rem;
    min-height: 2.25rem;
    padding: 0.42rem 0.65rem;
    text-transform: none;
    width: 100%;
}

.social-trends-table-scroll {
    overflow-x: auto;
}

.social-trends-table {
    --app-table-body-padding-block: 0.62rem;
    --app-table-body-padding-inline: 0.85rem;
    --app-table-header-padding-block: 0.7rem;
    --app-table-header-padding-inline: 0.85rem;
    min-width: 880px;
}

.social-trends-table th:nth-child(1) { width: 9%; }
.social-trends-table th:nth-child(2) { width: 37%; }
.social-trends-table th:nth-child(n+3) { width: 13.5%; }

.social-trends-table tbody tr:nth-child(even) {
    background: color-mix(in srgb, var(--surface-soft) 42%, var(--surface));
}

.social-trends-table tbody tr:hover {
    background: var(--surface-soft);
}

.social-trends-company {
    align-items: center;
    display: grid;
    gap: 0.65rem;
    grid-template-columns: 1.9rem minmax(0, 1fr);
    min-width: 0;
}

.social-trends-stock-icon,
.social-trends-stock-icon.app-symbol-icon-has-logo {
    border-radius: 0.35rem;
    height: 1.9rem;
    width: 1.9rem;
}

.social-trends-company-copy {
    align-items: baseline;
    display: grid;
    gap: 0.2rem 0.75rem;
    grid-template-columns: minmax(3.5rem, auto) minmax(0, 1fr);
    min-width: 0;
}

.social-trends-company-copy > span {
    color: var(--muted-strong);
    font-family: var(--font-sans);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.social-trends-symbol-link {
    text-decoration: none;
}

.social-trends-symbol-link:hover {
    color: var(--green);
    text-decoration: underline;
}

.social-trends-rank {
    color: var(--muted-strong) !important;
    font-weight: 700;
}

.social-trends-metric-cell {
    padding-left: 0.55rem !important;
    padding-right: 0.55rem !important;
}

.social-trends-meter {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: 1.65rem;
    overflow: hidden;
    position: relative;
}

.social-trends-meter progress {
    appearance: none;
    border: 0;
    height: 100%;
    inset: 0;
    opacity: 0.65;
    position: absolute;
    width: 100%;
}

.social-trends-meter progress::-webkit-progress-bar {
    background: transparent;
}

.social-trends-meter progress::-webkit-progress-value {
    background: color-mix(in srgb, var(--blue) 18%, transparent);
    border-radius: 0.25rem;
}

.social-trends-meter progress::-moz-progress-bar {
    background: color-mix(in srgb, var(--blue) 18%, transparent);
    border-radius: 0.25rem;
}

.social-trends-meter > span {
    position: relative;
    z-index: 1;
}

.social-trends-change-positive { color: var(--green) !important; }
.social-trends-change-negative { color: var(--red) !important; }
.social-trends-change-neutral { color: var(--muted-strong) !important; }

.social-trends-empty {
    color: var(--muted) !important;
    font-family: var(--font-sans) !important;
    padding: 1.2rem !important;
    text-align: center !important;
}

.social-trends-table-footer {
    color: var(--muted);
    font-size: 0.8rem;
    padding: 0.7rem 1rem;
}

@media (max-width: 760px) {
    .social-trends-page-timestamp { padding-top: 0; }
    .social-trends-summary-grid { grid-template-columns: 1fr; }
    .social-trends-table-heading { align-items: stretch; flex-direction: column; }
    .social-trends-table-controls { align-items: stretch; flex-direction: column; }
    .social-trends-movement-filter { display: flex; }
    .social-trends-movement-filter button { flex: 1; }
    .social-trends-search { min-width: 0; width: 100%; }
}

@media (min-width: 761px) and (max-width: 1250px) {
    .social-trends-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .social-trends-table-heading { align-items: stretch; flex-direction: column; }
}

.home-sidebar-backdrop {
    background: rgba(0, 0, 0, 0.55);
    border: 0;
    display: none;
    inset: 0;
    position: fixed;
    z-index: 35;
}

body.dark-mode.home-dashboard-shell,
:root.dark-mode body.home-dashboard-shell {
    --bg: #080b0f;
    --surface: #11161b;
    --surface-soft: #161b21;
    --border: #29313a;
    --border-soft: #232a32;
    --text: #f1f4f7;
    --muted: #9da7b1;
    --muted-strong: #d6dce2;
    --green: #4fbe72;
    --red: #f0445e;
    --control-bg: #0d1217;
    --control-bg-focus: #10161c;
    --control-border: #34404a;
    --control-text: #f8fafc;
    --control-placeholder: #9da7b1;
    background: var(--bg);
}

body.dark-mode .home-utility-bar {
    background: rgba(8, 11, 15, 0.96);
}

body.dark-mode .home-panel-header {
    background: #14191f;
}

body.dark-mode .home-symbol-search {
    background: #10151a;
}

/* Market Breadth inside the reusable left-navigation workspace. */
.breadth-toolbar-status {
    color: var(--muted);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.72rem;
}

.breadth-heading-date {
    padding-top: 0.35rem;
    white-space: nowrap;
}

body.breadth-dashboard-shell .breadth-toolbar {
    align-items: center;
    background: var(--surface);
    border-radius: 0.35rem;
    box-shadow: none;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 0.8rem;
    min-height: 3rem;
    padding: 0.45rem 0.65rem;
}

.breadth-toolbar-control {
    align-items: center;
    display: flex;
    gap: 0.55rem;
}

.breadth-toolbar-control .home-kicker {
    margin: 0;
}

body.breadth-dashboard-shell .metric-selector {
    background: var(--surface-soft) !important;
    border: 1px solid var(--border) !important;
    border-radius: 0.35rem;
    box-shadow: none;
    gap: 0;
    padding: 0;
}

body.breadth-dashboard-shell .metric-btn {
    border: 0;
    border-radius: 0;
    color: var(--muted) !important;
    height: 1.9rem;
    min-width: 3.2rem;
    padding: 0 0.7rem;
}

body.breadth-dashboard-shell .metric-btn + .metric-btn {
    border-left: 1px solid var(--border);
}

body.breadth-dashboard-shell .metric-btn:hover,
body.breadth-dashboard-shell .metric-btn:focus-visible {
    background: color-mix(in srgb, var(--surface-soft) 70%, var(--text)) !important;
    color: var(--text) !important;
}

body.breadth-dashboard-shell .metric-btn.active {
    background: var(--surface) !important;
    box-shadow: inset 0 -2px 0 var(--green);
    color: var(--green) !important;
}

body.dark-mode.breadth-dashboard-shell .metric-selector {
    background: var(--surface-soft) !important;
    border-color: var(--border) !important;
}

body.dark-mode.breadth-dashboard-shell .metric-btn,
body.dark-mode.breadth-dashboard-shell .metric-btn:hover,
body.dark-mode.breadth-dashboard-shell .metric-btn:focus-visible,
body.dark-mode.breadth-dashboard-shell .metric-btn.active {
    color: var(--muted) !important;
}

body.dark-mode.breadth-dashboard-shell .metric-btn.active {
    background: var(--surface) !important;
    border-color: var(--border) !important;
    color: var(--green) !important;
}

body.breadth-dashboard-shell .breadth-groups {
    gap: 2.5rem;
    padding: 0;
}

body.breadth-dashboard-shell .breadth-group-heading {
    margin-bottom: 0.45rem;
}

body.breadth-dashboard-shell .breadth-group-heading h3 {
    font-size: 1.4rem;
    letter-spacing: 0.025em;
}

body.breadth-dashboard-shell .breadth-chart-grid {
    gap: 0.65rem;
}

body.breadth-dashboard-shell .breadth-chart-card,
body.dark-mode.breadth-dashboard-shell .breadth-chart-card {
    background: var(--surface) !important;
    border-color: var(--border) !important;
    border-radius: 0.35rem;
    box-shadow: none !important;
}

body.breadth-dashboard-shell .breadth-card-header {
    padding: 0.72rem 0.75rem 0.62rem;
}

body.breadth-dashboard-shell .breadth-card-title {
    font-size: 1.2rem;
    margin-top: 0;
}

body.breadth-dashboard-shell .breadth-chart-card .app-status-pill {
    font-size: 0.82rem;
    min-height: 1.7rem;
    padding: 0.35rem 0.65rem;
}

body.breadth-dashboard-shell .breadth-card-reading strong {
    font-size: 1.35rem;
}

body.breadth-dashboard-shell .breadth-card-meta {
    margin: 0 0.75rem;
}

body.breadth-dashboard-shell .breadth-card-stat {
    padding-bottom: 0.5rem;
    padding-top: 0.5rem;
}

body.breadth-dashboard-shell .breadth-card-chart {
    padding: 0.5rem 0.55rem 0.1rem;
}

body.breadth-dashboard-shell .breadth-card-footer {
    padding: 0 0.75rem 0.65rem;
}

.breadth-error {
    background: color-mix(in srgb, var(--red) 9%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--red) 45%, var(--border));
    border-radius: 0.35rem;
    color: var(--red);
    margin-bottom: 0.75rem;
    padding: 0.65rem 0.75rem;
}

body.dark-mode.breadth-dashboard-shell .section-label {
    color: var(--muted);
}

.market-signals-heading-row {
    width: 100%;
}

.market-signals-updated {
    padding-top: 0.35rem;
    white-space: nowrap;
}

body.market-signals-dashboard-shell .app-dashboard-row {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.35rem;
    gap: 0;
    grid-template-columns: minmax(370px, 0.72fr) minmax(720px, 1.55fr);
    overflow: hidden;
}

body.market-signals-dashboard-shell .app-stat-grid {
    gap: 0;
}

body.market-signals-dashboard-shell .app-stat-card {
    align-items: center;
    border: 0;
    border-radius: 0;
    border-right: 1px solid var(--border-soft);
    justify-content: center;
    min-height: 4.4rem;
    padding: 0.55rem 0.7rem;
    text-align: center;
}

body.market-signals-dashboard-shell .app-stat-value {
    font-size: 1.6rem;
    font-weight: 600;
    margin-top: 0.16rem;
}

body.market-signals-dashboard-shell .app-stat-card:nth-child(1) .app-stat-value {
    color: var(--green);
}

body.market-signals-dashboard-shell .app-stat-card:nth-child(2) .app-stat-value {
    color: var(--yellow);
}

body.market-signals-dashboard-shell .app-stat-card:nth-child(3) .app-stat-value {
    color: var(--red);
}

body.market-signals-dashboard-shell .app-stat-card:nth-child(4) .app-stat-value {
    font-weight: 500;
}

body.market-signals-dashboard-shell .app-filter-panel {
    background: var(--surface);
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0.5rem 0.65rem;
}

body.market-signals-dashboard-shell .app-filter-panel .app-stat-label {
    margin-bottom: 0.35rem;
}

body.market-signals-dashboard-shell .app-filter-panel .app-field-row {
    gap: 0.45rem;
}

body.market-signals-dashboard-shell #trend-model-filter {
    flex: 1.35 1 15rem;
}

body.market-signals-dashboard-shell #sector-filter,
body.market-signals-dashboard-shell #price-sort {
    flex: 0.8 1 10rem;
}

body.market-signals-dashboard-shell #symbol-search {
    flex: 1 1 12rem;
}

body.market-signals-dashboard-shell .app-field {
    background-color: var(--bg);
    border-color: var(--border);
    border-radius: 0.35rem;
    height: 2.65rem;
}

body.market-signals-dashboard-shell select.app-field {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239da7b1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    padding-right: 2.25rem;
}

body.dark-mode.market-signals-dashboard-shell .app-form input.app-field:not([type="checkbox"]),
body.dark-mode.market-signals-dashboard-shell .app-form select.app-field,
body.dark-mode.market-signals-dashboard-shell .app-field {
    background-color: #0d1217;
    border-color: #34404a;
    color: var(--text);
}

body.dark-mode.market-signals-dashboard-shell .app-form input.app-field::placeholder {
    color: #7f8994;
}

body.dark-mode.market-signals-dashboard-shell .app-form input.app-field:focus,
body.dark-mode.market-signals-dashboard-shell .app-form select.app-field:focus {
    background-color: #10161c;
    border-color: #5b9f69 !important;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--green) 14%, transparent);
}

body.market-signals-dashboard-shell .app-screener-lanes {
    gap: 0.65rem;
}

body.market-signals-dashboard-shell .app-screener-lane {
    border-color: var(--border);
    border-radius: 0.35rem;
    box-shadow: none;
}

body.market-signals-dashboard-shell .app-screener-lane-header {
    align-items: center;
    background: var(--surface-soft);
    padding: 0.72rem 0.75rem;
}

body.market-signals-dashboard-shell .app-screener-lane-count {
    font-size: 1.2rem;
}

body.market-signals-dashboard-shell .app-screener-row {
    gap: 0.6rem;
    padding: 0.6rem 0.75rem;
}

body.market-signals-dashboard-shell .app-screener-row-identity {
    align-items: center;
}

/* Match the Sectors text hierarchy without changing shared lane layouts. */
body.market-signals-dashboard-shell .app-screener-row-identity a {
    font-size: 0.95rem;
}

body.market-signals-dashboard-shell .app-screener-row-company {
    font-size: 0.86rem;
}

body.market-signals-dashboard-shell .app-screener-row-price,
body.market-signals-dashboard-shell .app-screener-row-sector,
body.market-signals-dashboard-shell .app-screener-lane-subtitle {
    font-size: 0.82rem;
}

.app-market-signal-icon,
.app-market-signal-icon.app-symbol-icon-has-logo {
    border-radius: 0.45rem;
    height: 2.25rem;
    width: 2.25rem;
}

.app-market-signal-icon.app-symbol-icon-has-logo {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

.app-market-signal-icon .app-company-logo {
    border-radius: inherit;
    padding: 0.06rem;
}

/* Watchlists inside the reusable left-navigation workspace. */
body.watchlists-dashboard-shell .watchlists-dashboard {
    max-width: none;
}

body.watchlists-dashboard-shell .watchlist-bar,
body.watchlists-dashboard-shell .surface,
body.dark-mode.watchlists-dashboard-shell .watchlist-bar,
body.dark-mode.watchlists-dashboard-shell .surface {
    background: var(--surface) !important;
    border-color: var(--border) !important;
    border-radius: 0.35rem;
    box-shadow: none !important;
}

body.watchlists-dashboard-shell .watchlist-bar {
    align-items: center;
    display: flex;
    flex-wrap: nowrap;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem !important;
}

body.watchlists-dashboard-shell #watchlist-select,
body.watchlists-dashboard-shell #watchlist-name-input,
body.watchlists-dashboard-shell #ticker-input {
    background-color: var(--bg) !important;
    border-color: var(--border) !important;
    border-radius: 0.35rem;
    color: var(--text) !important;
    min-height: 2.3rem;
}

body.watchlists-dashboard-shell #watchlist-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239da7b1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    min-width: 10.5rem;
    padding-right: 2.25rem;
    width: 10.5rem;
}

body.watchlists-dashboard-shell #watchlist-select:focus,
body.watchlists-dashboard-shell #watchlist-name-input:focus,
body.watchlists-dashboard-shell #ticker-input:focus {
    border-color: #5b9f69 !important;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--green) 14%, transparent);
}

body.watchlists-dashboard-shell .app-watchlist-management-row button,
body.watchlists-dashboard-shell #add-chip-btn {
    background: var(--surface-soft) !important;
    border: 1px solid var(--border) !important;
    border-radius: 0.35rem;
    color: var(--muted-strong) !important;
    min-height: 2.15rem;
    padding: 0.35rem 0.65rem;
}

body.watchlists-dashboard-shell .app-watchlist-management-row button:not(:disabled):hover,
body.watchlists-dashboard-shell .app-watchlist-management-row button:not(:disabled):focus-visible,
body.watchlists-dashboard-shell #add-chip-btn:hover,
body.watchlists-dashboard-shell #add-chip-btn:focus-visible {
    background: color-mix(in srgb, var(--surface-soft) 78%, var(--text)) !important;
    border-color: #4b5864 !important;
    color: var(--text) !important;
    outline: 0;
}

body.watchlists-dashboard-shell #last-scan-label {
    align-self: center;
    color: var(--muted) !important;
    flex: 0 0 auto;
    margin-top: 0;
    white-space: nowrap;
}

body.watchlists-dashboard-shell .app-watchlist-management-row {
    align-items: center;
    display: flex;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    gap: 0.5rem;
}

body.watchlists-dashboard-shell .watchlist-management-browser,
body.watchlists-dashboard-shell .watchlist-name-editor,
body.watchlists-dashboard-shell .watchlist-delete-confirmation {
    align-items: center;
    display: flex;
    gap: 0.5rem;
}

body.watchlists-dashboard-shell .watchlist-management-browser[hidden],
body.watchlists-dashboard-shell .watchlist-name-editor[hidden],
body.watchlists-dashboard-shell .watchlist-delete-confirmation[hidden] {
    display: none;
}

body.watchlists-dashboard-shell .watchlist-delete-confirmation .app-inline-feedback {
    margin-top: 0;
}

body.watchlists-dashboard-shell .app-watchlist-management-row label {
    display: block;
}

body.watchlists-dashboard-shell #watchlist-name-input {
    padding: 0.45rem 0.65rem;
    width: 14rem;
}

body.watchlists-dashboard-shell .app-watchlist-management-row button:disabled {
    cursor: not-allowed;
    opacity: 0.48;
}

body.watchlists-dashboard-shell .app-watchlist-management-row,
body.watchlists-dashboard-shell .app-watchlist-management-row button,
body.watchlists-dashboard-shell #watchlist-select,
body.watchlists-dashboard-shell #watchlist-name-input,
body.watchlists-dashboard-shell #ticker-input {
    font-family: inherit;
    font-size: 0.875rem;
}

body.watchlists-dashboard-shell .app-watchlist-management-row button {
    font-weight: 600;
}

body.watchlists-dashboard-shell #watchlist-select {
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.25rem;
}

body.watchlists-dashboard-shell .app-watchlist-symbols {
    border-left: 1px solid var(--border-soft);
    flex: 1 1 0;
    margin-top: 0;
    min-width: 0;
    padding: 0 0 0 1rem;
}

/* At the ticker limit both + Add and the ticker input are hidden; without this
   the empty wrapper still takes a flex gap before the first pill. */
body.watchlists-dashboard-shell .app-watchlist-symbols-actions {
    display: contents;
}

body.watchlists-dashboard-shell #watchlist-empty-state {
    flex-basis: 100%;
}

body.watchlists-dashboard-shell .app-watchlist-symbol-pill,
body.watchlists-dashboard-shell #add-chip-btn {
    border-radius: 0.35rem;
    height: 2.15rem;
    min-height: 2.15rem;
    padding-left: 0.55rem;
    padding-right: 0.55rem;
}

body.watchlists-dashboard-shell .app-watchlist-symbol-pill {
    gap: 0.35rem;
}

/* Pills wrap beside the divider rather than scroll, so a full list stays
   visible at laptop widths before the 1280px stacked layout takes over. */
body.watchlists-dashboard-shell .app-watchlist-symbols-row {
    flex-wrap: nowrap;
}

@media (max-width: 1280px) {
    body.watchlists-dashboard-shell .watchlist-bar {
        flex-wrap: wrap;
    }

    body.watchlists-dashboard-shell .app-watchlist-management-row,
    body.watchlists-dashboard-shell .app-watchlist-symbols {
        flex-basis: 100%;
    }

    body.watchlists-dashboard-shell .app-watchlist-symbols {
        border-left: 0;
        padding-left: 0;
    }
}

body.watchlists-dashboard-shell .app-watchlist-symbol-pill,
body.dark-mode.watchlists-dashboard-shell .app-watchlist-symbol-pill {
    background: var(--surface) !important;
    color: var(--muted-strong) !important;
}

body.watchlists-dashboard-shell #watchlist-results-content {
    background: #f1f4f2 !important;
    padding: 0.75rem !important;
}

body.dark-mode.watchlists-dashboard-shell #watchlist-results-content {
    background: #090e12 !important;
}

body.watchlists-dashboard-shell #watchlist-stock-signals {
    align-items: start;
    gap: 1.25rem !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

body.watchlists-dashboard-shell .app-signal-card.signal-card,
body.dark-mode.watchlists-dashboard-shell .app-signal-card.signal-card {
    --watchlist-card-sans: "Source Sans 3", "Segoe UI", sans-serif;
    --watchlist-card-display: var(--watchlist-card-sans);
    --watchlist-card-mono: var(--watchlist-card-sans);
    --watchlist-card-surface: #ffffff;
    --watchlist-card-surface-raised: #ffffff;
    --watchlist-card-border: #8f9c93;
    --watchlist-card-divider: #c7cec7;
    --watchlist-card-shadow: 0 6px 16px rgba(34, 45, 38, 0.14), 0 1px 3px rgba(34, 45, 38, 0.12);
    --watchlist-card-text: #151b17;
    --watchlist-card-muted: #66706a;
    background: var(--watchlist-card-surface) !important;
    border: 1px solid var(--watchlist-card-border) !important;
    border-radius: 0.35rem;
    box-shadow: var(--watchlist-card-shadow) !important;
    color: var(--watchlist-card-text) !important;
    container-type: inline-size;
    overflow: hidden;
    padding: 0 !important;
}

body.dark-mode.watchlists-dashboard-shell .app-signal-card.signal-card {
    --watchlist-card-surface: #151e24;
    --watchlist-card-surface-raised: #121a20;
    --watchlist-card-border: #687681;
    --watchlist-card-divider: #343d43;
    --watchlist-card-shadow: 0 8px 22px rgba(0, 0, 0, 0.42), 0 1px 4px rgba(0, 0, 0, 0.45);
    --watchlist-card-text: #f0f2ef;
    --watchlist-card-muted: #aab3bf;
}

body.watchlists-dashboard-shell .app-signal-card-header {
    align-items: center;
    display: grid;
    gap: 0.7rem;
    grid-template-columns: minmax(0, 1fr) auto auto;
    min-height: 0;
    padding: 0.5rem 0.6rem;
}

body.watchlists-dashboard-shell .app-signal-card-original-header {
    align-items: flex-start;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    padding: 0.65rem 1rem 0.1rem;
}

body.watchlists-dashboard-shell .app-signal-card-original-actions {
    align-items: center;
    display: flex;
    flex: 0 0 auto;
    gap: 0.5rem;
    justify-content: flex-end;
}

body.watchlists-dashboard-shell .app-signal-card-original-header .app-watchlist-stock-icon,
body.watchlists-dashboard-shell .app-signal-card-original-header .app-watchlist-stock-icon.app-symbol-icon-has-logo {
    background: transparent;
    border-color: transparent;
    border-radius: 0.5rem;
    box-shadow: none;
    height: 2.5rem;
    width: 2.5rem;
}

body.watchlists-dashboard-shell .app-signal-card-original-header .app-watchlist-stock-icon .app-company-logo {
    padding: 0.08rem;
}

body.watchlists-dashboard-shell .app-signal-card-original-header a {
    font-family: "Source Sans 3", "Segoe UI", sans-serif;
}

body.watchlists-dashboard-shell .app-signal-card-identity {
    gap: 0.5rem;
    min-width: 0;
}

body.watchlists-dashboard-shell .app-signal-card-identity-copy {
    display: grid;
    gap: 0.18rem;
    min-width: 0;
}

body.watchlists-dashboard-shell .app-watchlist-stock-icon,
body.watchlists-dashboard-shell .app-watchlist-stock-icon.app-symbol-icon-has-logo {
    background: var(--watchlist-card-surface-raised);
    border: 1px solid var(--watchlist-card-border);
    border-radius: 0.55rem;
    box-shadow: none;
    height: 2.1rem;
    width: 2.1rem;
}

body.watchlists-dashboard-shell .app-watchlist-stock-icon .app-company-logo {
    padding: 0.18rem;
}

body.watchlists-dashboard-shell .app-signal-card-symbol,
body.watchlists-dashboard-shell .app-signal-card-price {
    color: var(--watchlist-card-text);
    font-family: var(--watchlist-card-mono);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

body.watchlists-dashboard-shell .app-signal-card-symbol {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.015em;
    line-height: 0.82;
    text-transform: uppercase;
}

body.watchlists-dashboard-shell .app-signal-card-price {
    font-size: 0.86rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    line-height: 1;
}

body.watchlists-dashboard-shell .app-signal-card-header-price {
    font-size: 1rem;
    margin-bottom: 0.15rem;
}

body.watchlists-dashboard-shell .app-signal-card-actions {
    border: 1px solid var(--watchlist-card-border);
    border-radius: 0.35rem;
    display: grid;
    grid-template-columns: auto 2.45rem 2.45rem;
    justify-self: end;
    overflow: hidden;
}

body.watchlists-dashboard-shell .app-signal-card .app-signal-card-actions a {
    align-items: center;
    background: transparent !important;
    border: 0 !important;
    border-left: 1px solid var(--watchlist-card-border) !important;
    border-radius: 0;
    color: var(--watchlist-card-text) !important;
    display: inline-flex;
    font-family: var(--watchlist-card-sans);
    font-size: 0.88rem;
    font-weight: 600;
    gap: 0.42rem;
    justify-content: center;
    letter-spacing: 0.015em;
    min-height: 2.35rem;
    padding: 0.35rem 0.58rem;
    text-decoration: none;
    white-space: nowrap;
}

body.watchlists-dashboard-shell .app-signal-card .app-signal-card-actions a:first-child {
    border-left: 0 !important;
}

body.watchlists-dashboard-shell .app-signal-card .app-signal-card-actions .app-signal-card-action-icon-only {
    padding-left: 0.55rem;
    padding-right: 0.55rem;
    width: 100%;
}

body.watchlists-dashboard-shell .app-signal-card .app-signal-card-actions a:hover,
body.watchlists-dashboard-shell .app-signal-card .app-signal-card-actions a:focus-visible {
    background: color-mix(in srgb, var(--watchlist-card-text) 7%, transparent) !important;
    color: var(--watchlist-card-text) !important;
    outline: 0;
}

body.watchlists-dashboard-shell .app-signal-card .app-signal-card-actions svg {
    flex: 0 0 auto;
    height: 0.85rem;
    width: 0.85rem;
}

body.watchlists-dashboard-shell .app-signal-summary {
    display: grid;
    gap: 0;
}

body.watchlists-dashboard-shell .app-signal-summary-head {
    color: var(--watchlist-card-muted);
    font-family: var(--watchlist-card-mono);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    min-height: 1.75rem;
    padding: 0.2rem 1rem 0.15rem;
}

body.watchlists-dashboard-shell .app-signal-summary-count {
    color: var(--watchlist-card-muted);
    font-family: var(--watchlist-card-mono);
    font-size: 0.68rem;
    letter-spacing: 0.045em;
}

body.watchlists-dashboard-shell .app-signal-comparison-grid,
body.watchlists-dashboard-shell .app-signal-comparison-grid[data-count="1"],
body.watchlists-dashboard-shell .app-signal-comparison-grid[data-count="2"] {
    display: grid;
    column-gap: 0.8rem;
    row-gap: 0;
    grid-template-columns: repeat(var(--watchlist-comparison-count, 2), minmax(0, 1fr));
    padding: 0.1rem 1rem 0.45rem;
}

body.watchlists-dashboard-shell .app-signal-comparison-grid[data-count="1"] {
    --watchlist-comparison-count: 1;
}

body.watchlists-dashboard-shell .app-signal-comparison-grid[data-count="2"] {
    --watchlist-comparison-count: 2;
}

body.watchlists-dashboard-shell .app-signal-comparison-grid[data-count="3"] {
    --watchlist-comparison-count: 3;
}

body.watchlists-dashboard-shell .app-signal-comparison-grid .app-signal-comparison {
    align-items: stretch;
    display: grid;
    gap: 0;
    grid-template-columns: minmax(0, 1fr) 2.15rem minmax(0, 1fr);
    justify-content: stretch;
    min-width: 0;
    padding: 0;
}

body.watchlists-dashboard-shell .app-signal-comparison + .app-signal-comparison {
    border-left: 0;
}

body.watchlists-dashboard-shell .app-signal-comparison-side {
    align-items: center;
    justify-content: center;
    min-height: 2.35rem;
    padding: 0 0.25rem;
    text-align: center;
}

body.watchlists-dashboard-shell .app-signal-comparison-label {
    color: var(--watchlist-card-muted);
    font-family: var(--watchlist-card-mono);
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.1em;
}

body.watchlists-dashboard-shell .app-signal-comparison-value {
    color: var(--watchlist-card-text);
    font-family: var(--watchlist-card-display);
    font-size: clamp(0.9rem, 1vw, 1rem);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    letter-spacing: 0.015em;
    line-height: 1;
    margin-top: 0.25rem;
}

body.watchlists-dashboard-shell .app-signal-comparison-operator {
    align-items: center;
    border-left: 0;
    border-right: 0;
    display: flex;
    font-family: var(--watchlist-card-display);
    font-size: 1.4rem;
    font-weight: 500;
    justify-content: center;
    line-height: 1;
    min-height: 2.7rem;
    padding-bottom: 0.12em;
}

body.watchlists-dashboard-shell .app-signal-comparison-positive .app-signal-comparison-operator {
    color: #5bd08e;
}

body.watchlists-dashboard-shell .app-signal-comparison-negative .app-signal-comparison-operator {
    color: #f35b72;
}

body.watchlists-dashboard-shell .app-signal-comparison-neutral .app-signal-comparison-operator {
    color: #f5c94a;
}

body.watchlists-dashboard-shell .app-context-snapshot {
    border-top: 1px solid var(--watchlist-card-divider);
    margin-top: 0;
    padding: 0;
}

body.watchlists-dashboard-shell .watchlist-results-settings {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1rem;
    justify-content: flex-end;
    margin-left: auto;
}

body.watchlists-dashboard-shell .watchlist-context-toggle {
    align-items: center;
    color: var(--muted);
    cursor: pointer;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 0.75rem;
    font-weight: 400;
    gap: 0.75rem;
    user-select: none;
}

body.watchlists-dashboard-shell .watchlist-context-toggle input {
    height: 1px !important;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    position: absolute;
    width: 1px !important;
}

body.watchlists-dashboard-shell .watchlist-context-toggle-track {
    background: var(--control-border);
    border-radius: 999px;
    display: inline-flex;
    height: 1.5rem;
    padding: 0.125rem;
    transition: background-color 150ms ease;
    width: 2.75rem;
}

body.watchlists-dashboard-shell .watchlist-context-toggle-track span {
    background: #fff;
    border-radius: 50%;
    display: block;
    height: 1.25rem;
    transform: translateX(0);
    transition: transform 150ms ease;
    width: 1.25rem;
}

body.watchlists-dashboard-shell .watchlist-context-toggle input:checked + .watchlist-context-toggle-track {
    background: var(--green);
}

body.watchlists-dashboard-shell .watchlist-context-toggle input:checked + .watchlist-context-toggle-track span {
    transform: translateX(1.25rem);
}

body.watchlists-dashboard-shell .watchlist-context-toggle input:focus-visible + .watchlist-context-toggle-track {
    outline: 2px solid var(--green);
    outline-offset: 2px;
}

body.watchlists-dashboard-shell .watchlist-context-toggle input:disabled + .watchlist-context-toggle-track {
    cursor: not-allowed;
    opacity: 0.55;
}

body.watchlists-dashboard-shell .app-context-snapshot-header {
    align-items: center;
    min-height: 2.25rem;
    padding-left: 0.6rem;
    padding-right: 0.6rem;
}

body.watchlists-dashboard-shell .app-context-snapshot-title,
body.watchlists-dashboard-shell .app-context-snapshot-scope,
body.watchlists-dashboard-shell .app-context-snapshot-label {
    color: var(--watchlist-card-muted);
    font-family: var(--watchlist-card-mono);
    font-weight: 700;
    text-transform: uppercase;
}

body.watchlists-dashboard-shell .app-context-snapshot-title {
    font-size: 0.64rem;
    letter-spacing: 0.15em;
}

body.watchlists-dashboard-shell .app-context-snapshot-scope {
    font-size: 0.62rem;
    letter-spacing: 0.065em;
}

body.watchlists-dashboard-shell .app-context-snapshot-grid {
    --context-accent: #6584ad;
    --context-track: #dce2e8;
    --context-volume: #4b9cdb;
    --context-peers: #2bbba8;
    border-top: 1px solid var(--watchlist-card-divider);
    display: grid;
    gap: 0;
    grid-auto-flow: column;
    grid-auto-rows: minmax(4.5rem, 1fr);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(3, minmax(4.5rem, 1fr));
    margin-top: 0;
}

body.watchlists-dashboard-shell .app-context-snapshot-tile,
body.dark-mode.watchlists-dashboard-shell .app-context-snapshot-tile {
    align-content: center;
    align-items: center;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--watchlist-card-divider);
    border-radius: 0;
    display: grid;
    gap: 0.25rem;
    grid-template-columns: minmax(0, 1fr) auto;
    min-width: 0;
    padding: 0.4rem 0.6rem;
}

body.dark-mode.watchlists-dashboard-shell .app-context-snapshot-grid {
    --context-accent: #a8c5eb;
    --context-track: #2b3642;
}

body.watchlists-dashboard-shell .app-context-snapshot-tile-positive {
    --context-accent: #5bd08e;
}

body.watchlists-dashboard-shell .app-context-snapshot-tile-caution {
    --context-accent: #f5c94a;
}

body.watchlists-dashboard-shell .app-context-snapshot-tile-negative {
    --context-accent: #f35b72;
}

body.watchlists-dashboard-shell .app-context-snapshot-tile:nth-child(n + 4) {
    border-left: 1px solid var(--watchlist-card-divider);
    padding-left: 0.6rem;
    padding-right: 0.6rem;
}

body.watchlists-dashboard-shell .app-context-snapshot-tile:nth-child(3),
body.watchlists-dashboard-shell .app-context-snapshot-tile:nth-child(6) {
    border-bottom: 0;
}

body.watchlists-dashboard-shell .app-context-snapshot-grid[data-context-layout="compact"] {
    grid-auto-flow: row;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
}

body.watchlists-dashboard-shell .app-context-snapshot-grid[data-context-layout="compact"] .app-context-snapshot-tile:last-child {
    border-bottom: 0;
}

body.watchlists-dashboard-shell .app-context-snapshot-tile-head {
    gap: 0.3rem;
}

body.watchlists-dashboard-shell .app-context-snapshot-dot {
    box-shadow: none;
    height: 0.55rem;
    width: 0.55rem;
}

body.watchlists-dashboard-shell .app-context-snapshot-label {
    font-size: 0.62rem;
    letter-spacing: 0.04em;
    white-space: normal;
    overflow: visible;
}

body.watchlists-dashboard-shell .watchlist-context-meta {
    align-items: center;
    color: var(--watchlist-card-muted);
    display: flex;
    flex-wrap: wrap;
    font-family: var(--watchlist-card-mono);
    font-size: 0.6rem;
    gap: 0.4rem;
    grid-column: 1 / -1;
    line-height: 1.35;
}

body.watchlists-dashboard-shell .watchlist-context-calendar {
    color: var(--context-volume);
    flex: 0 0 auto;
    height: 1.25rem;
    width: 1.25rem;
}

body.watchlists-dashboard-shell .app-context-snapshot-tile[data-context-key="upcoming_earnings"] {
    row-gap: 0.65rem;
}

body.watchlists-dashboard-shell .app-context-snapshot-tile[data-context-key="upcoming_earnings"] .app-context-snapshot-tile-head {
    grid-row: 1;
}

body.watchlists-dashboard-shell .app-context-snapshot-tile[data-context-key="upcoming_earnings"] .app-context-snapshot-reading {
    grid-column: 2;
    grid-row: 1;
}

body.watchlists-dashboard-shell .watchlist-context-event-date {
    white-space: nowrap;
}

body.watchlists-dashboard-shell .watchlist-context-earnings-metrics {
    display: grid;
    gap: 0.6rem;
    grid-column: 1 / -1;
    grid-row: 2;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0;
    padding: 0;
}

body.watchlists-dashboard-shell .watchlist-context-earnings-stat {
    align-items: baseline;
    display: flex;
    gap: 0.3rem;
    justify-content: space-between;
    min-width: 0;
}

body.watchlists-dashboard-shell .watchlist-context-earnings-stat + .watchlist-context-earnings-stat {
    border-left: 1px solid var(--watchlist-card-divider);
    padding-left: 0.6rem;
}

body.watchlists-dashboard-shell .watchlist-context-earnings-stat dt {
    color: var(--watchlist-card-muted);
    font-family: var(--watchlist-card-mono);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

body.watchlists-dashboard-shell .watchlist-context-earnings-stat dd {
    color: var(--watchlist-card-text);
    flex: 0 0 auto;
    font-family: var(--watchlist-card-display);
    font-size: 0.875rem;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    line-height: 1.15;
    margin: 0;
    white-space: nowrap;
}

body.watchlists-dashboard-shell .watchlist-context-earnings-stat .watchlist-context-earnings-estimate {
    color: #2379b9;
}

body.watchlists-dashboard-shell .watchlist-context-earnings-stat .watchlist-context-earnings-positive {
    color: #187650;
}

body.watchlists-dashboard-shell .watchlist-context-earnings-stat .watchlist-context-earnings-negative {
    color: #bc314a;
}

body.dark-mode.watchlists-dashboard-shell .watchlist-context-earnings-stat .watchlist-context-earnings-estimate {
    color: var(--context-volume);
}

body.dark-mode.watchlists-dashboard-shell .watchlist-context-earnings-stat .watchlist-context-earnings-positive {
    color: #5bd08e;
}

body.dark-mode.watchlists-dashboard-shell .watchlist-context-earnings-stat .watchlist-context-earnings-negative {
    color: #f35b72;
}

body.watchlists-dashboard-shell .watchlist-context-earnings-stat .watchlist-context-earnings-unavailable {
    color: var(--watchlist-card-muted);
}

body.watchlists-dashboard-shell .watchlist-context-meter {
    align-items: center;
    display: flex;
    gap: 0.4rem;
    grid-column: 1 / -1;
    min-height: 0.375rem;
}

body.watchlists-dashboard-shell .watchlist-context-meter-track {
    background: var(--context-track);
    border-radius: 1rem;
    display: block;
    flex: 1;
    height: 0.25rem;
    min-width: 0;
    position: relative;
}

body.watchlists-dashboard-shell .watchlist-context-meter-fill {
    background: var(--context-accent);
    border-radius: inherit;
    display: block;
    height: 100%;
    width: var(--context-position);
}

/* Company metric accents identify the observation, not a bullish/bearish state. */
body.watchlists-dashboard-shell .watchlist-context-meter-volume {
    --context-accent: var(--context-volume);
}

body.watchlists-dashboard-shell .watchlist-context-meter-peers {
    --context-accent: var(--context-peers);
}

body.watchlists-dashboard-shell .app-context-snapshot-dot.watchlist-context-dot-volume {
    background: var(--context-volume);
}

body.watchlists-dashboard-shell .app-context-snapshot-dot.watchlist-context-dot-peers {
    background: var(--context-peers);
}

body.watchlists-dashboard-shell .watchlist-context-meter-reference {
    background: var(--watchlist-card-muted);
    height: 0.5rem;
    left: var(--context-reference);
    position: absolute;
    top: -0.125rem;
    width: 1px;
    z-index: 1;
}

body.watchlists-dashboard-shell .watchlist-context-meter-marker {
    background: var(--context-accent);
    border-radius: 50%;
    height: 0.5rem;
    left: clamp(0.25rem, var(--context-position), calc(100% - 0.25rem));
    position: absolute;
    top: -0.125rem;
    transform: translateX(-50%);
    width: 0.5rem;
    z-index: 2;
}

body.dark-mode.watchlists-dashboard-shell .watchlist-context-meter-peers .watchlist-context-meter-marker {
    background: #72dccd;
}

body.watchlists-dashboard-shell .watchlist-context-meter-sentiment .watchlist-context-meter-track {
    background: linear-gradient(to right, #ef6b83 0% 25%, #e4a477 25% 45%, #e8c85e 45% 55%, #82c59c 55% 75%, #43b799 75% 100%);
}

body.watchlists-dashboard-shell .watchlist-context-meter-sentiment .watchlist-context-meter-marker {
    background: var(--watchlist-card-text);
    border: 1px solid var(--context-track);
    border-radius: 0.15rem;
    height: 0.7rem;
    top: -0.225rem;
    width: 0.3rem;
}

body.watchlists-dashboard-shell .watchlist-context-meter-caption {
    color: var(--watchlist-card-muted);
    font-size: 0.6rem;
    line-height: 1;
    white-space: nowrap;
}

body.watchlists-dashboard-shell .watchlist-context-meter-unavailable {
    opacity: 0.45;
}

body.watchlists-dashboard-shell .app-context-snapshot-reading {
    gap: 0.24rem;
    justify-content: flex-end;
    margin-top: 0;
}

body.watchlists-dashboard-shell .app-context-snapshot-value,
body.watchlists-dashboard-shell .app-context-snapshot-state,
body.watchlists-dashboard-shell .app-context-snapshot-separator {
    font-family: var(--watchlist-card-display);
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

body.watchlists-dashboard-shell .app-context-snapshot-value {
    color: var(--watchlist-card-text);
    font-size: clamp(0.7rem, 0.76vw, 0.78rem);
    font-weight: 500;
    letter-spacing: 0.015em;
}

body.watchlists-dashboard-shell .app-context-snapshot-state,
body.watchlists-dashboard-shell .app-context-snapshot-separator {
    color: var(--watchlist-card-muted);
    font-size: clamp(0.7rem, 0.76vw, 0.78rem);
}

body.watchlists-dashboard-shell .app-context-snapshot-state {
    font-weight: 500;
}

body.watchlists-dashboard-shell .app-context-snapshot-tile-value-tone .app-context-snapshot-value {
    font-size: clamp(0.7rem, 0.76vw, 0.78rem);
    font-weight: 500;
}

body.watchlists-dashboard-shell .app-context-snapshot-tile-positive .app-context-snapshot-state,
body.watchlists-dashboard-shell .app-context-snapshot-tile-positive.app-context-snapshot-tile-value-tone .app-context-snapshot-value {
    color: #5bd08e;
}

body.watchlists-dashboard-shell .app-context-snapshot-tile-caution .app-context-snapshot-state,
body.watchlists-dashboard-shell .app-context-snapshot-tile-caution.app-context-snapshot-tile-value-tone .app-context-snapshot-value {
    color: #f5c94a;
}

body.watchlists-dashboard-shell .app-context-snapshot-tile-negative .app-context-snapshot-state,
body.watchlists-dashboard-shell .app-context-snapshot-tile-negative.app-context-snapshot-tile-value-tone .app-context-snapshot-value {
    color: #f35b72;
}

body.watchlists-dashboard-shell:not(.dark-mode) .app-context-snapshot-tile-positive .app-context-snapshot-state,
body.watchlists-dashboard-shell:not(.dark-mode) .app-context-snapshot-tile-positive.app-context-snapshot-tile-value-tone .app-context-snapshot-value {
    color: #187650;
}

body.watchlists-dashboard-shell:not(.dark-mode) .app-context-snapshot-tile-caution .app-context-snapshot-state,
body.watchlists-dashboard-shell:not(.dark-mode) .app-context-snapshot-tile-caution.app-context-snapshot-tile-value-tone .app-context-snapshot-value {
    color: #896300;
}

body.watchlists-dashboard-shell:not(.dark-mode) .app-context-snapshot-tile-negative .app-context-snapshot-state,
body.watchlists-dashboard-shell:not(.dark-mode) .app-context-snapshot-tile-negative.app-context-snapshot-tile-value-tone .app-context-snapshot-value {
    color: #bc314a;
}

body.watchlists-dashboard-shell .app-signal-history-notice,
body.watchlists-dashboard-shell .app-signal-card > .mt-3,
body.watchlists-dashboard-shell .app-signal-card > .space-y-1\.5 {
    margin-left: 1.55rem;
    margin-right: 1.55rem;
}

body.watchlists-dashboard-shell .app-signal-card > .space-y-1\.5:last-child:not(:empty) {
    margin-bottom: 1.25rem;
}

body.watchlists-dashboard-shell .app-signal-card a,
body.watchlists-dashboard-shell .app-signal-card button {
    background: var(--surface) !important;
    border-color: var(--border) !important;
    border-radius: 0.35rem;
    color: var(--muted-strong) !important;
    box-shadow: none;
}

body.watchlists-dashboard-shell .app-signal-card a:hover,
body.watchlists-dashboard-shell .app-signal-card a:focus-visible,
body.watchlists-dashboard-shell .app-signal-card button:hover,
body.watchlists-dashboard-shell .app-signal-card button:focus-visible {
    border-color: #4b5864 !important;
    color: var(--text) !important;
    outline: 0;
}

@container (max-width: 20rem) {
    body.watchlists-dashboard-shell .app-signal-card-header {
        gap: 1rem;
        grid-template-columns: minmax(0, 1fr) auto;
        min-height: 0;
        padding: 1rem;
    }

    body.watchlists-dashboard-shell .app-watchlist-stock-icon,
    body.watchlists-dashboard-shell .app-watchlist-stock-icon.app-symbol-icon-has-logo {
        height: 3.4rem;
        width: 3.4rem;
    }

    body.watchlists-dashboard-shell .app-signal-card-symbol {
        font-size: 2.25rem;
    }

    body.watchlists-dashboard-shell .app-signal-card-price {
        font-size: 1.5rem;
    }

    body.watchlists-dashboard-shell .app-signal-card-actions {
        grid-column: 1 / -1;
        justify-self: stretch;
    }

    body.watchlists-dashboard-shell .app-signal-card .app-signal-card-actions a {
        font-size: 1.05rem;
        min-height: 3.15rem;
        padding: 0.6rem;
        width: 100%;
    }

    body.watchlists-dashboard-shell .app-signal-summary-head {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    body.watchlists-dashboard-shell .app-signal-summary-head,
    body.watchlists-dashboard-shell .app-context-snapshot-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.3rem;
        justify-content: center;
    }

    body.watchlists-dashboard-shell .app-signal-summary-count,
    body.watchlists-dashboard-shell .app-context-snapshot-scope {
        white-space: normal;
    }

    body.watchlists-dashboard-shell .app-signal-comparison-grid[data-count] {
        grid-template-columns: minmax(0, 1fr);
        padding: 1rem;
    }

    body.watchlists-dashboard-shell .app-signal-comparison-grid .app-signal-comparison {
        grid-template-columns: minmax(0, 1fr) 3.75rem minmax(0, 1fr);
    }

    body.watchlists-dashboard-shell .app-signal-comparison + .app-signal-comparison {
        border-left: 0;
        border-top: 1px solid var(--watchlist-card-divider);
        padding-top: 1rem;
    }

    body.watchlists-dashboard-shell .app-signal-comparison-operator {
        font-size: 2.65rem;
    }

    body.watchlists-dashboard-shell .app-context-snapshot-grid {
        grid-auto-flow: row;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: none;
    }

    body.watchlists-dashboard-shell .app-context-snapshot-tile,
    body.watchlists-dashboard-shell .app-context-snapshot-tile:nth-child(n + 4) {
        border-left: 0;
        border-bottom: 1px solid var(--watchlist-card-divider);
        padding-left: 0.6rem;
        padding-right: 0.6rem;
    }

    body.watchlists-dashboard-shell .app-context-snapshot-tile:nth-child(3) {
        border-bottom: 1px solid var(--watchlist-card-divider);
    }

    body.watchlists-dashboard-shell .app-context-snapshot-tile:nth-child(6) {
        border-bottom: 0;
    }
}

@media (max-width: 1279px) {
    body.watchlists-dashboard-shell #watchlist-stock-signals {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 767px) {
    body.watchlists-dashboard-shell #watchlist-stock-signals {
        grid-template-columns: minmax(0, 1fr) !important;
    }
}

@media (max-width: 1080px) {
    body.watchlists-dashboard-shell .app-signal-card-header {
        gap: 1rem;
        grid-template-columns: minmax(0, 1fr) auto;
    }

    body.watchlists-dashboard-shell .app-signal-card-actions {
        grid-column: 1 / -1;
        justify-self: stretch;
    }

    body.watchlists-dashboard-shell .app-signal-card .app-signal-card-actions a {
        width: 100%;
    }

    body.watchlists-dashboard-shell .app-signal-comparison-grid[data-count] {
        grid-template-columns: minmax(0, 1fr);
    }

    body.watchlists-dashboard-shell .app-signal-comparison + .app-signal-comparison {
        border-left: 0;
        border-top: 1px solid var(--watchlist-card-divider);
        padding-top: 1rem;
    }
}

@media (max-width: 720px) {
    body.watchlists-dashboard-shell .watchlist-results-settings {
        justify-content: space-between;
        width: 100%;
    }

    body.watchlists-dashboard-shell .app-signal-card-header,
    body.watchlists-dashboard-shell .app-signal-summary-head {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    body.watchlists-dashboard-shell .app-signal-card-header {
        min-height: 0;
        padding-bottom: 1rem;
        padding-top: 1rem;
    }

    body.watchlists-dashboard-shell .app-watchlist-stock-icon,
    body.watchlists-dashboard-shell .app-watchlist-stock-icon.app-symbol-icon-has-logo {
        height: 3.4rem;
        width: 3.4rem;
    }

    body.watchlists-dashboard-shell .app-signal-card-symbol {
        font-size: 2.25rem;
    }

    body.watchlists-dashboard-shell .app-signal-card-price {
        font-size: 1.5rem;
    }

    body.watchlists-dashboard-shell .app-signal-card .app-signal-card-actions a {
        font-size: 1.05rem;
        min-height: 3.15rem;
        padding: 0.6rem;
    }

    body.watchlists-dashboard-shell .app-signal-summary-head,
    body.watchlists-dashboard-shell .app-context-snapshot-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.3rem;
        justify-content: center;
    }

    body.watchlists-dashboard-shell .app-signal-summary-count,
    body.watchlists-dashboard-shell .app-context-snapshot-scope {
        white-space: normal;
    }

    body.watchlists-dashboard-shell .app-signal-comparison-grid[data-count] {
        padding: 1rem;
    }

    body.watchlists-dashboard-shell .app-signal-comparison-grid .app-signal-comparison {
        grid-template-columns: minmax(0, 1fr) 3.75rem minmax(0, 1fr);
    }

    body.watchlists-dashboard-shell .app-signal-comparison-operator {
        font-size: 2.65rem;
    }

    body.watchlists-dashboard-shell .app-context-snapshot-grid {
        grid-auto-flow: row;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: none;
    }

    body.watchlists-dashboard-shell .app-context-snapshot-tile,
    body.watchlists-dashboard-shell .app-context-snapshot-tile:nth-child(n + 4) {
        border-left: 0;
        border-bottom: 1px solid var(--watchlist-card-divider);
        padding-left: 0.6rem;
        padding-right: 0.6rem;
    }

    body.watchlists-dashboard-shell .app-context-snapshot-tile:nth-child(3) {
        border-bottom: 1px solid var(--watchlist-card-divider);
    }

    body.watchlists-dashboard-shell .app-context-snapshot-tile:nth-child(6) {
        border-bottom: 0;
    }
}

@media (max-width: 460px) {
    body.watchlists-dashboard-shell .app-signal-card .app-signal-card-actions a {
        gap: 0.35rem;
    }

    body.watchlists-dashboard-shell .app-signal-card .app-signal-card-actions svg {
        height: 1rem;
        width: 1rem;
    }

    body.watchlists-dashboard-shell .app-signal-comparison-grid .app-signal-comparison {
        grid-template-columns: minmax(0, 1fr) 3.25rem minmax(0, 1fr);
    }

    body.watchlists-dashboard-shell .app-signal-comparison-side {
        padding: 0 0.35rem;
    }

    body.watchlists-dashboard-shell .app-context-snapshot-tile {
        gap: 0.25rem;
    }

    body.watchlists-dashboard-shell .app-context-snapshot-label {
        font-size: 0.61rem;
    }
}

body.watchlists-dashboard-shell .surface > .px-6,
body.watchlists-dashboard-shell .surface-content.px-6 {
    padding-left: 0.85rem !important;
    padding-right: 0.85rem !important;
}

/* Settings inside the reusable left-navigation workspace. */
.settings-sections-grid {
    align-items: start;
    display: grid;
    gap: 0.85rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.settings-options-card {
    grid-column: 1 / -1;
}

body.settings-dashboard-shell .settings-section-card {
    min-width: 0;
    padding: 1rem 1.1rem !important;
}

.settings-section-header {
    align-items: flex-start;
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.85rem;
}

.settings-section-heading h2 {
    color: var(--text);
    font-size: 1.05rem;
    line-height: 1.2;
    margin: 0;
}

.settings-section-heading p {
    color: var(--muted);
    font-size: 0.82rem;
    margin: 0.25rem 0 0;
    max-width: 48rem;
}

.settings-section-heading p a {
    color: inherit;
    text-decoration: underline;
}

.settings-watchlist-picker {
    flex: 0 0 auto;
}

.settings-watchlists-card .settings-section-header {
    flex-direction: column;
    gap: 0.7rem;
}

.settings-watchlists-card .settings-watchlist-picker {
    width: min(100%, 27rem);
}

.settings-inline-field {
    align-items: center;
    display: grid !important;
    gap: 0.5rem 0.75rem;
    grid-template-columns: 8.25rem minmax(0, 18rem);
    max-width: 27rem;
    width: 100%;
}

body.settings-dashboard-shell #watchlist-select {
    appearance: none;
    background-color: var(--bg) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239da7b1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    border: 1px solid var(--border) !important;
    border-radius: 0.35rem;
    color: var(--text) !important;
    min-height: 2.3rem;
    min-width: 0;
    padding: 0.35rem 2.25rem 0.35rem 0.75rem;
    width: 100%;
}

body.settings-dashboard-shell #watchlist-select:focus {
    border-color: #5b9f69 !important;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--green) 14%, transparent);
    outline: 0;
}

body.settings-dashboard-shell #save-status {
    color: var(--muted);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.82rem;
    grid-column: 2;
}

.settings-watchlist-layout {
    display: grid;
    gap: 0.8rem;
    grid-template-columns: minmax(0, 1fr);
}

.settings-context-section {
    border-top: 1px solid var(--border-soft);
    padding-top: 0.8rem;
}

body.settings-dashboard-shell .settings-context-section label {
    font-size: 0.86rem !important;
    line-height: 1.55;
}

.settings-context-copy {
    display: block;
    min-width: 0;
}

.settings-context-intro {
    color: var(--muted);
    display: block;
    margin-top: 0.45rem;
}

.settings-context-list {
    color: var(--muted);
    list-style: disc outside;
    margin: 0.45rem 0 0;
    padding-left: 1.2rem;
}

.settings-context-list li {
    padding-left: 0.15rem;
}

.settings-context-list li + li {
    margin-top: 0.3rem;
}

.settings-context-note {
    color: var(--muted);
    display: block;
    margin-top: 0.65rem;
}

.settings-trend-model-field {
    margin: 0;
}

body.settings-dashboard-shell #cfg-stock-trend-model {
    min-width: 0;
    width: 100%;
}

.settings-custom-trend-controls,
.settings-trend-model-copy {
    font-family: "Source Sans 3", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    max-width: 36rem;
}

.settings-custom-trend-controls {
    display: grid;
    gap: 0.5rem;
    grid-template-columns: minmax(6.25rem, 0.8fr) repeat(3, minmax(4.5rem, 1fr));
}

.settings-custom-trend-field {
    display: block;
    min-width: 0;
}

.settings-custom-trend-field .app-field {
    margin-top: 0.3rem;
    min-width: 0;
    width: 100%;
}

.settings-trend-model-title {
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.35;
    margin: 0 0 0.3rem;
}

.settings-trend-model-description {
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 400;
    line-height: 1.55;
    margin: 0;
}

.settings-trend-model-status {
    color: var(--yellow);
    font-size: 0.82rem;
    line-height: 1.45;
    margin: 0.35rem 0 0;
}

.settings-trend-model-calculation {
    margin-top: 1rem;
}

.settings-trend-model-calculation summary {
    align-items: center;
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    font-size: 0.86rem;
    font-weight: 600;
    gap: 0.3rem;
    list-style: none;
}

.settings-trend-model-calculation summary::-webkit-details-marker {
    display: none;
}

.settings-trend-model-calculation summary::after {
    content: '\203A';
    font-size: 1rem;
    line-height: 1;
    transition: transform 120ms ease;
}

.settings-trend-model-calculation[open] summary::after {
    transform: rotate(90deg);
}

.settings-trend-model-calculation summary:focus-visible {
    border-radius: 0.2rem;
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.settings-trend-model-technical {
    border-left: 1px solid var(--border-soft);
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 400;
    line-height: 1.5;
    margin-top: 0.5rem;
    padding-left: 0.75rem;
}

.settings-trend-model-technical p {
    margin: 0;
}

.settings-trend-model-technical p + p {
    margin-top: 0.35rem;
}

.settings-watchlist-layout > div:first-child,
.settings-context-section {
    max-width: 36rem;
}

.settings-notification-grid {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: minmax(0, 1fr);
}

.settings-account-summary {
    margin: 0;
}

/* The row display rule would otherwise beat the attribute (SIG-119). */
.settings-account-summary > div[hidden],
.settings-access-value [hidden] {
    display: none;
}

/* SIG-335: the billing action sits beside the access status it changes. */
.settings-access-value {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.85rem;
    justify-content: flex-end;
}

.settings-access-value form {
    margin: 0;
}

.settings-access-action {
    background: none;
    border: 0;
    color: var(--text);
    cursor: pointer;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 600;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

.settings-access-note {
    color: var(--muted);
    font-size: 0.86rem;
}

.settings-account-summary > div {
    align-items: center;
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    min-height: 2.65rem;
}

.settings-account-summary dt {
    color: var(--muted);
    font-size: 0.86rem;
}

.settings-account-summary dd {
    color: var(--text);
    font-size: 0.86rem;
    font-weight: 600;
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
    text-align: right;
}

.settings-account-email-preference {
    align-items: center;
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    gap: 0.45rem;
    justify-content: flex-end;
}

.settings-account-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 1rem;
}

.settings-account-profile-form {
    border-top: 1px solid var(--border-soft);
    margin-top: 1rem;
    padding-top: 1rem;
}

.settings-account-profile-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-account-profile-grid .auth-field {
    margin: 0;
}

.settings-account-profile-controls {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 0.75rem;
}

.settings-account-feedback {
    color: var(--muted);
    font-size: 0.82rem;
}

@media (max-width: 760px) {
    .settings-account-profile-grid {
        grid-template-columns: 1fr;
    }
}

.settings-subsection-title {
    color: var(--muted);
    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
}

body.settings-dashboard-shell .settings-panel,
body.dark-mode.settings-dashboard-shell .settings-panel {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: 0.35rem !important;
    box-shadow: none !important;
}

body.settings-dashboard-shell .settings-panel fieldset label {
    background: var(--surface-soft) !important;
    border-color: var(--border) !important;
}

body.settings-dashboard-shell .settings-panel input:not([type="checkbox"]):not([type="radio"]),
body.settings-dashboard-shell .settings-panel select,
body.dark-mode.settings-dashboard-shell .settings-panel input:not([type="checkbox"]):not([type="radio"]),
body.dark-mode.settings-dashboard-shell .settings-panel select {
    background: var(--bg) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
}

body.settings-dashboard-shell .settings-panel input[type="checkbox"],
body.settings-dashboard-shell .settings-panel input[type="radio"] {
    accent-color: var(--green);
}

.option-setting-input {
    width: 100%;
}

.option-settings-grid {
    display: grid;
    gap: 0.65rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.option-type-card {
    background: var(--surface-soft);
    border: 1px solid var(--border-soft);
    border-radius: 0.35rem;
    padding: 0.75rem;
}

.option-field-grid {
    display: grid;
    gap: 0.6rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 0.75rem;
}

/* Keep Settings controls and helper links on the customer text scale. */
.settings-dashboard .settings-section-header > a,
.settings-dashboard .option-field-grid label > span {
    font-size: 0.82rem;
}

.settings-dashboard .option-type-card > div:first-child {
    font-size: 0.95rem;
}

.settings-dashboard .option-setting-input {
    font-size: 0.82rem;
}

/* User Guide inside the reusable left-navigation workspace. */
body.guide-dashboard-shell .guide-content {
    display: grid;
    gap: 0.75rem;
    min-width: 0;
}

body.guide-dashboard-shell .guide-intro,
body.guide-dashboard-shell .guide-section {
    border-radius: 0.35rem;
    box-shadow: none;
    padding: 1rem;
    scroll-margin-top: 4.75rem;
}

body.guide-dashboard-shell .guide-section-heading {
    align-items: flex-start;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 0.65rem;
}

body.guide-dashboard-shell .guide-section-heading .home-kicker {
    font-size: 0.67rem;
    margin-bottom: 0.2rem;
}

body.guide-dashboard-shell .guide-section h2,
body.guide-dashboard-shell .guide-intro h2 {
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.25;
    margin: 0;
}

body.guide-dashboard-shell .guide-section h3,
body.guide-dashboard-shell .guide-intro h3 {
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
}

body.guide-dashboard-shell .guide-section p,
body.guide-dashboard-shell .guide-intro p,
body.guide-dashboard-shell .guide-section li,
body.guide-dashboard-shell .guide-intro li {
    color: var(--muted-strong);
    font-size: 0.86rem;
    line-height: 1.5;
}

body.guide-dashboard-shell .guide-section > p,
body.guide-dashboard-shell .guide-intro > p {
    margin: 0 0 0.75rem;
}

body.guide-dashboard-shell .guide-lead {
    color: var(--text) !important;
    font-size: 0.86rem !important;
}

.guide-reading-time,
.guide-heading-link {
    color: var(--muted);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.82rem;
    white-space: nowrap;
}

.guide-heading-link {
    color: var(--green);
    font-weight: 700;
    text-decoration: none;
}

.guide-heading-link:hover,
.guide-heading-link:focus-visible {
    color: #73d091;
    outline: 0;
}

.guide-step-list {
    display: grid;
    gap: 0.55rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    list-style: none;
    margin: 0;
    padding: 0;
}

.guide-intro .guide-split-grid + .guide-step-list {
    margin-top: 0.65rem;
}

.guide-step-list li {
    background: var(--surface-soft);
    border: 1px solid var(--border-soft);
    border-radius: 0.35rem;
    display: grid;
    gap: 0.55rem;
    grid-template-columns: 1.45rem 1fr;
    padding: 0.7rem;
}

.guide-step-list li > span {
    align-items: center;
    background: color-mix(in srgb, var(--green) 14%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--green) 40%, var(--border));
    border-radius: 50%;
    color: var(--green);
    display: inline-flex;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.7rem;
    font-weight: 700;
    height: 1.45rem;
    justify-content: center;
    width: 1.45rem;
}

.guide-step-list strong {
    color: var(--text);
    display: block;
    font-size: 0.86rem;
    line-height: 1.3;
}

.guide-step-list p {
    font-size: 0.82rem !important;
    line-height: 1.4 !important;
    margin: 0.2rem 0 0;
}

.guide-page-grid a {
    color: var(--green);
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
}

.guide-page-grid a:hover,
.guide-page-grid a:focus-visible {
    color: #73d091;
    outline: 0;
}

.guide-state-grid,
.guide-definition-grid,
.guide-page-grid,
.guide-split-grid {
    display: grid;
    gap: 0.6rem;
}

.guide-state-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.guide-definition-grid,
.guide-page-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.guide-card {
    background: var(--surface-soft);
    border: 1px solid var(--border-soft);
    border-radius: 0.35rem;
    min-width: 0;
    padding: 0.75rem;
}

.guide-card .app-status-pill {
    margin-bottom: 0.55rem;
}

.guide-card h3 + p,
.guide-card h3 + ul,
.guide-card h3 + ol {
    margin-top: 0.35rem;
}

.guide-card p {
    margin-bottom: 0;
}

.guide-card ul,
.guide-card ol {
    margin: 0.35rem 0 0;
    padding-left: 1.1rem;
}

.guide-card li + li {
    margin-top: 0.35rem;
}

.guide-page-grid .guide-card {
    display: flex;
    flex-direction: column;
}

.guide-page-grid .guide-card a {
    margin-top: auto;
    padding-top: 0.65rem;
}

.guide-note {
    background: color-mix(in srgb, var(--green) 7%, var(--surface-soft));
    border: 1px solid color-mix(in srgb, var(--green) 24%, var(--border-soft));
    border-radius: 0.35rem;
    color: var(--muted-strong);
    font-size: 0.82rem;
    line-height: 1.45;
    margin-top: 0.65rem;
    padding: 0.65rem 0.75rem;
}

.guide-note strong {
    color: var(--text);
}

.guide-note + .guide-split-grid {
    margin-top: 0.65rem;
}

.guide-note-caution {
    background: color-mix(in srgb, var(--yellow) 7%, var(--surface-soft));
    border-color: color-mix(in srgb, var(--yellow) 28%, var(--border-soft));
}

/* The guide reads as a reference: content on the left, a contents rail that
   stays in view on the right, and a search that narrows the cards in place. */
body.guide-dashboard-shell .guide-layout {
    align-items: start;
    display: grid;
    gap: 0.75rem;
    grid-template-columns: minmax(0, 1fr) 13.5rem;
}

.guide-toc {
    position: sticky;
    top: 4.75rem;
}

.guide-toc-details {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: 0.35rem;
    max-height: calc(100vh - 5.5rem);
    overflow-y: auto;
    padding: 0.75rem 0.5rem 0.75rem 0.75rem;
}

.guide-toc-details > summary {
    color: var(--text);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 700;
    list-style: none;
}

.guide-toc-details > summary::-webkit-details-marker {
    display: none;
}

.guide-jump-links {
    display: grid;
    gap: 0.1rem;
    margin-top: 0.4rem;
}

.guide-toc-group {
    color: var(--muted);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    margin: 0.65rem 0 0.15rem;
    text-transform: uppercase;
}

.guide-toc-group:first-child {
    margin-top: 0.2rem;
}

.guide-jump-links a {
    border-left: 2px solid transparent;
    color: var(--muted-strong);
    font-size: 0.82rem;
    line-height: 1.3;
    padding: 0.28rem 0.5rem;
    text-decoration: none;
}

.guide-jump-links a:hover,
.guide-jump-links a:focus-visible {
    background: var(--surface-soft);
    color: var(--text);
    outline: 0;
}

.guide-jump-links a[aria-current="location"] {
    border-left-color: var(--green);
    color: var(--green);
    font-weight: 700;
}

.guide-search {
    margin-top: 0.25rem;
    position: relative;
}

/* The field itself is an ordinary shell input, so it takes the site's control
   colors and focus ring; the icon and match count sit on top of it. */
.guide-search svg {
    fill: none;
    height: 1.05rem;
    left: 0.75rem;
    pointer-events: none;
    position: absolute;
    stroke: var(--muted);
    stroke-linecap: round;
    stroke-width: 2;
    top: 50%;
    transform: translateY(-50%);
    width: 1.05rem;
}

body.guide-dashboard-shell .guide-search input {
    border: 1px solid;
    border-radius: 0.35rem;
    font: inherit;
    font-size: 0.95rem;
    padding: 0.7rem 6.5rem 0.7rem 2.4rem;
    width: 100%;
}

.guide-search-count {
    color: var(--muted);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.75rem;
    pointer-events: none;
    position: absolute;
    right: 2.4rem;
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
}

body.guide-dashboard-shell .guide-search-empty {
    color: var(--muted-strong);
    margin: 0.65rem 0 0;
}

.guide-quick {
    margin-top: 0.85rem;
}

body.guide-dashboard-shell .guide-intro .guide-quick-title {
    color: var(--muted);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    margin: 0 0 0.45rem;
    text-transform: uppercase;
}

.guide-quick-grid {
    display: grid;
    gap: 0.55rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.guide-quick-link {
    background: var(--surface-soft);
    border: 1px solid var(--border-soft);
    border-radius: 0.35rem;
    display: grid;
    gap: 0.2rem;
    padding: 0.65rem 0.75rem;
    text-decoration: none;
}

.guide-quick-link:hover,
.guide-quick-link:focus-visible {
    border-color: color-mix(in srgb, var(--green) 50%, var(--border-soft));
    outline: 0;
}

.guide-quick-link strong {
    color: var(--text);
    font-size: 0.86rem;
    line-height: 1.3;
}

.guide-quick-link span {
    color: var(--green);
    font-size: 0.78rem;
    font-weight: 600;
}

.guide-quick + .guide-step-list {
    margin-top: 0.85rem;
}

/* Search narrows by class rather than [hidden], which entitlements own. */
body.guide-dashboard-shell .guide-filtered-out {
    display: none !important;
}

@media (max-width: 1180px) {
    body.guide-dashboard-shell .guide-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .guide-toc {
        order: -1;
        position: static;
    }

    .guide-toc-details {
        max-height: none;
    }

    .guide-toc-details > summary::after {
        color: var(--muted);
        content: " ▾";
    }

    .guide-toc-details[open] > summary::after {
        content: " ▴";
    }

    .guide-toc-details[open] .guide-jump-links {
        grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
    }

    .guide-toc-group {
        display: none;
    }

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

@media (max-width: 640px) {
    .guide-quick-grid {
        grid-template-columns: 1fr;
    }

    body.guide-dashboard-shell .guide-search input {
        font-size: 1rem;
        padding-right: 5.75rem;
    }
}

body.symbol-detail-dashboard-shell .symbol-detail-page-heading {
    align-items: center;
}

body.symbol-detail-dashboard-shell .detail-title-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    min-height: 2.75rem;
}

body.symbol-detail-dashboard-shell .detail-title-row h1 {
    line-height: 1;
}

body.symbol-detail-dashboard-shell .is-positive {
    color: var(--green) !important;
}

body.symbol-detail-dashboard-shell .is-negative {
    color: var(--red) !important;
}

body.symbol-detail-dashboard-shell .is-caution {
    color: var(--yellow) !important;
}

body.symbol-detail-dashboard-shell .is-neutral {
    color: var(--muted-strong) !important;
}

body.symbol-detail-dashboard-shell .screener-panel {
    display: none;
}

body.symbol-detail-dashboard-shell .screener-panel.active {
    display: block;
}

body.symbol-detail-dashboard-shell .expiry-group-header {
    border-radius: 0;
    display: block;
    margin: 0;
    width: 100%;
}

body.symbol-detail-dashboard-shell .grouped-results-table {
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
}

body.symbol-detail-dashboard-shell .watchlist-row-itm td {
    background: var(--surface-soft);
}

body.symbol-detail-dashboard-shell .watchlist-row-qualified td:first-child {
    box-shadow: inset 4px 0 0 var(--green);
}

body.symbol-detail-dashboard-shell .extrinsic-tooltip-trigger {
    position: relative;
}

body.symbol-detail-dashboard-shell .extrinsic-tooltip-trigger::after {
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 0.35rem;
    bottom: calc(100% + 0.6rem);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
    color: var(--text);
    content: attr(data-tooltip);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.35;
    min-width: 13rem;
    opacity: 0;
    padding: 0.65rem 0.75rem;
    pointer-events: none;
    position: absolute;
    right: 0;
    text-align: left;
    transform: translateY(2px);
    transition: opacity 60ms ease, transform 60ms ease;
    white-space: pre-line;
    z-index: 50;
}

body.symbol-detail-dashboard-shell .extrinsic-tooltip-trigger:hover::after,
body.symbol-detail-dashboard-shell .extrinsic-tooltip-trigger:focus-visible::after {
    opacity: 1;
    transform: translateY(0);
}

body.symbol-detail-dashboard-shell .signal-chip-entry-plus {
    background: color-mix(in srgb, var(--green) 10%, var(--surface-soft)) !important;
    border-color: var(--green) !important;
    color: var(--green) !important;
}

body.symbol-detail-dashboard-shell .signal-chip-entry {
    background: color-mix(in srgb, var(--yellow) 10%, var(--surface-soft)) !important;
    border-color: var(--yellow) !important;
    color: var(--yellow) !important;
}

body.symbol-detail-dashboard-shell .signal-chip-exit {
    background: color-mix(in srgb, var(--red) 10%, var(--surface-soft)) !important;
    border-color: var(--red) !important;
    color: var(--red) !important;
}

body.symbol-detail-dashboard-shell .detail-card {
    display: flex;
    flex-direction: column;
    padding: 0.85rem;
}

body.symbol-detail-dashboard-shell .detail-card-header {
    align-items: center;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    min-height: 1.75rem;
}

body.symbol-detail-dashboard-shell .detail-card-header h2,
body.symbol-detail-dashboard-shell .detail-card-header h3,
body.symbol-detail-dashboard-shell .detail-card-header h4 {
    line-height: 1.2;
}

body.symbol-detail-dashboard-shell .detail-card-body {
    margin-top: 0.75rem;
}

body.symbol-detail-dashboard-shell .detail-metric-grid {
    display: grid;
    gap: 0.5rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.symbol-detail-dashboard-shell .symbol-research-workspace {
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
}

body.symbol-detail-dashboard-shell .symbol-research-heading {
    align-items: flex-start;
    display: flex;
    gap: 1.25rem;
    justify-content: space-between;
    padding: 0 0.15rem;
}

body.symbol-detail-dashboard-shell .symbol-research-desk {
    --research-accent: var(--green);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.35rem;
    display: grid;
    gap: 0.65rem;
    grid-template-columns: minmax(15rem, 2.8fr) minmax(0, 9.2fr);
    margin-top: 0.85rem;
    min-width: 0;
    padding: 0.75rem;
}

body.symbol-detail-dashboard-shell .symbol-research-desk-rail,
body.symbol-detail-dashboard-shell .symbol-research-desk-main {
    align-content: start;
    display: grid;
    gap: 0.65rem;
    min-width: 0;
}

body.symbol-detail-dashboard-shell .symbol-research-desk-insights {
    align-items: start;
    display: grid;
    gap: 0.65rem;
    grid-template-columns: minmax(16rem, 0.9fr) repeat(2, minmax(0, 1fr));
    min-width: 0;
}

body.symbol-detail-dashboard-shell .symbol-research-desk-insights .symbol-research-overview-street {
    grid-column: 1;
    grid-row: 1 / span 2;
}

body.symbol-detail-dashboard-shell .symbol-research-desk-insights .symbol-research-position-activity-card {
    grid-column: 2 / -1;
    grid-row: 2;
}

body.symbol-detail-dashboard-shell .symbol-research-desk-secondary {
    align-items: start;
    display: grid;
    gap: 0.65rem;
    grid-template-columns: minmax(19rem, 0.82fr) minmax(0, 1.18fr);
    min-width: 0;
}

body.symbol-detail-dashboard-shell .symbol-research-desk-records {
    display: grid;
    gap: 0.65rem;
    grid-column: 1 / -1;
    min-width: 0;
    padding-top: 0.15rem;
}

body.symbol-detail-dashboard-shell .symbol-research-section-heading {
    align-items: center;
    display: flex;
    gap: 0.7rem;
}

body.symbol-detail-dashboard-shell .symbol-research-section-heading::after {
    background: color-mix(in srgb, var(--research-accent) 38%, var(--border-soft));
    content: "";
    flex: 1 1 auto;
    height: 1px;
}

body.symbol-detail-dashboard-shell .symbol-research-section-heading h3 {
    color: var(--research-accent);
    flex: 0 0 auto;
    font-size: var(--app-table-header-font-size);
    font-weight: 700;
    letter-spacing: 0.065em;
    line-height: 1;
    text-transform: uppercase;
}

body.symbol-detail-dashboard-shell .symbol-research-records-grid {
    align-items: start;
    display: grid;
    gap: 0.65rem;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    min-width: 0;
}

body.symbol-detail-dashboard-shell .symbol-research-records-grid .symbol-research-financials-card {
    grid-column: span 9;
}

body.symbol-detail-dashboard-shell .symbol-research-records-grid .symbol-research-filings-card {
    grid-column: span 3;
}

body.symbol-detail-dashboard-shell .symbol-research-workspace.is-fund-detail [data-company-research-only] {
    display: none !important;
}

body.symbol-detail-dashboard-shell .symbol-research-overview-section {
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 0.35rem;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 0.78rem 0.85rem;
}

body.symbol-detail-dashboard-shell .symbol-research-overview-section .detail-card-header {
    border-bottom: 1px solid var(--border-soft);
    padding-bottom: 0.48rem;
}

body.symbol-detail-dashboard-shell .symbol-research-overview-section .detail-card-body {
    flex: 1 1 auto;
    margin-top: 0.5rem;
}

body.symbol-detail-dashboard-shell .symbol-research-overview-section .detail-card-header h3,
body.symbol-detail-dashboard-shell .symbol-research-overview-section .detail-card-header h4,
body.symbol-detail-dashboard-shell .symbol-research-card .detail-card-header h3,
body.symbol-detail-dashboard-shell .symbol-research-card .detail-card-header h4 {
    font-size: 1rem !important;
    font-weight: 700;
}

body.symbol-detail-dashboard-shell .symbol-research-overview-fundamentals .fundamentals-grid {
    grid-template-columns: minmax(0, 1fr);
}

body.symbol-detail-dashboard-shell .symbol-research-overview-fundamentals .research-market-visuals {
    grid-template-columns: minmax(0, 1fr);
}

body.symbol-detail-dashboard-shell .symbol-research-overview-street .analyst-rating-summary {
    gap: 0.7rem;
    grid-template-columns: 5.25rem minmax(0, 1fr);
    margin-top: 0.6rem;
    padding-top: 0.6rem;
}

body.symbol-detail-dashboard-shell .symbol-research-overview-street .analyst-rating-chart {
    width: 5.25rem;
}

body.symbol-detail-dashboard-shell .symbol-research-card {
    background: var(--surface-soft) !important;
    border: 1px solid var(--border) !important;
    min-width: 0;
    padding: 0.7rem;
}

body.symbol-detail-dashboard-shell .symbol-research-card .detail-card-header {
    border-bottom: 1px solid var(--border-soft);
    padding-bottom: 0.48rem;
}

/* A card with nothing to show says which case it is (SIG-474): a chip, the
   sentence, and one line of why or what happens next. */
body.symbol-detail-dashboard-shell .research-empty-state {
    align-content: start;
    display: grid;
    gap: 0.375rem;
}

body.symbol-detail-dashboard-shell .research-empty-chip {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    font-size: 1rem;
    font-weight: 600;
    gap: 0.5rem;
    justify-self: start;
    line-height: 1.3;
    max-width: 100%;
    padding: 0.35rem 0.9rem;
    white-space: nowrap;
}

body.symbol-detail-dashboard-shell .research-empty-chip::before {
    background: currentColor;
    border-radius: 50%;
    content: "";
    height: 0.5rem;
    opacity: 0.85;
    width: 0.5rem;
}

body.symbol-detail-dashboard-shell .research-empty-chip.is-none {
    background: var(--empty-none-bg);
    color: var(--empty-none-text);
}

body.symbol-detail-dashboard-shell .research-empty-chip.is-pending {
    background: var(--empty-pending-bg);
    color: var(--empty-pending-text);
}

body.symbol-detail-dashboard-shell .research-empty-message {
    line-height: 1.4;
    color: var(--text);
    font-size: 0.95rem;
    margin: 0;
}

body.symbol-detail-dashboard-shell .research-stale-note {
    color: var(--empty-pending-text);
}

body.symbol-detail-dashboard-shell .research-empty-why {
    line-height: 1.4;
    color: var(--muted);
    font-size: 0.85rem;
    margin: 0;
}

body.symbol-detail-dashboard-shell .symbol-research-filings-card .research-filings-list {
    grid-template-columns: minmax(0, 1fr);
}

body.symbol-detail-dashboard-shell .symbol-research-desk-secondary .symbol-news-list {
    grid-template-columns: minmax(0, 1fr);
}

body.symbol-detail-dashboard-shell .symbol-research-desk-insights #research-street-panel {
    align-items: start;
    grid-template-columns: minmax(0, 1fr);
}

body.symbol-detail-dashboard-shell .symbol-research-desk-insights #research-street-panel .analyst-rating-summary {
    border-left: 0;
    border-top: 1px solid var(--border-soft);
    padding: 0.65rem 0 0;
}

body.symbol-detail-dashboard-shell .symbol-research-desk-insights .research-ownership-overview {
    align-items: start;
    grid-template-columns: 5.25rem minmax(0, 1fr);
}

body.symbol-detail-dashboard-shell .symbol-research-desk-insights .research-ownership-gauge {
    width: 5.25rem;
}

body.symbol-detail-dashboard-shell .symbol-research-desk-insights .research-data-grid {
    grid-template-columns: minmax(0, 1fr);
}

body.symbol-detail-dashboard-shell .symbol-research-desk-insights .symbol-research-compact-table {
    min-width: 0;
}

body.symbol-detail-dashboard-shell .research-primary-metric {
    border-bottom: 1px solid var(--border-soft);
    display: grid;
    gap: 0.12rem;
    padding: 0 0 0.7rem;
}

body.symbol-detail-dashboard-shell .research-primary-metric span,
body.symbol-detail-dashboard-shell .research-primary-metric small,
body.symbol-detail-dashboard-shell .research-data-row dt {
    color: var(--muted-strong);
    font-size: 0.82rem;
}

body.symbol-detail-dashboard-shell .research-primary-metric span {
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

body.symbol-detail-dashboard-shell .research-primary-metric strong {
    color: var(--text);
    font-family: "JetBrains Mono", monospace;
    font-size: 1.08rem;
    margin-top: 0.08rem;
}

body.symbol-detail-dashboard-shell .research-data-grid {
    display: grid;
    gap: 0 0.9rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.symbol-detail-dashboard-shell .research-data-row {
    align-items: center;
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    gap: 0.6rem;
    justify-content: space-between;
    min-width: 0;
    padding: 0.45rem 0;
}

body.symbol-detail-dashboard-shell .research-data-row dd {
    color: var(--text);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.88rem;
    font-weight: 700;
    margin: 0;
    text-align: right;
    white-space: nowrap;
}

body.symbol-detail-dashboard-shell .research-market-visuals {
    display: grid;
    gap: 0.8rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 0.7rem;
}

body.symbol-detail-dashboard-shell .research-range-visual,
body.symbol-detail-dashboard-shell .research-volume-visual,
body.symbol-detail-dashboard-shell .research-target-visual {
    background: color-mix(in srgb, var(--research-accent) 4%, var(--surface));
    border: 1px solid var(--border-soft);
    border-radius: 0.3rem;
    min-width: 0;
    padding: 0.62rem 0.7rem;
}

body.symbol-detail-dashboard-shell .research-visual-label,
body.symbol-detail-dashboard-shell .research-visual-scale {
    align-items: center;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
}

body.symbol-detail-dashboard-shell .research-visual-label {
    color: var(--muted-strong);
    font-size: 0.82rem;
}

body.symbol-detail-dashboard-shell .research-visual-label strong {
    color: var(--text);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.88rem;
}

body.symbol-detail-dashboard-shell .research-visual-scale {
    color: var(--muted);
    font-size: 0.72rem;
    margin-top: 0.32rem;
}

body.symbol-detail-dashboard-shell .research-range-track,
body.symbol-detail-dashboard-shell .research-volume-track,
body.symbol-detail-dashboard-shell .research-target-track {
    background: var(--border-soft);
    border-radius: 999px;
    height: 0.38rem;
    margin-top: 0.55rem;
    position: relative;
}

body.symbol-detail-dashboard-shell .research-range-track::before,
body.symbol-detail-dashboard-shell .research-target-track::before {
    background: color-mix(in srgb, var(--research-accent) 55%, var(--border));
    border-radius: inherit;
    content: "";
    inset: 0;
    position: absolute;
}

body.symbol-detail-dashboard-shell .research-range-track > span {
    background: var(--research-accent);
    border: 2px solid var(--surface-soft);
    border-radius: 50%;
    height: 0.85rem;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 0.85rem;
    z-index: 1;
}

body.symbol-detail-dashboard-shell .research-volume-track > span {
    background: var(--research-accent);
    border-radius: inherit;
    display: block;
    height: 100%;
}

body.symbol-detail-dashboard-shell .research-eps-comparison {
    display: grid;
    gap: 0.52rem;
    margin: 0.65rem 0 0.15rem;
}

body.symbol-detail-dashboard-shell .research-eps-comparison > div {
    align-items: center;
    display: grid;
    gap: 0.65rem;
    grid-template-columns: 4rem minmax(0, 1fr) auto;
}

body.symbol-detail-dashboard-shell .research-eps-comparison span {
    color: var(--muted-strong);
    font-size: 0.82rem;
}

body.symbol-detail-dashboard-shell .research-eps-comparison i,
body.symbol-detail-dashboard-shell .research-short-bar i {
    background: var(--border-soft);
    border-radius: 999px;
    height: 0.42rem;
    overflow: hidden;
}

body.symbol-detail-dashboard-shell .research-eps-comparison b,
body.symbol-detail-dashboard-shell .research-short-bar b {
    background: var(--green);
    border-radius: inherit;
    display: block;
    height: 100%;
}

body.symbol-detail-dashboard-shell .research-eps-comparison b.is-negative {
    background: var(--red);
}

body.symbol-detail-dashboard-shell .research-eps-comparison strong {
    color: var(--text);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.88rem;
}

body.symbol-detail-dashboard-shell #research-street-panel {
    align-items: center;
    display: grid;
    gap: 0.9rem;
    grid-template-columns: minmax(18rem, 1.1fr) minmax(16rem, 1fr) minmax(15rem, 0.8fr);
}

body.symbol-detail-dashboard-shell #research-street-panel > .mt-3 {
    grid-column: 1 / -1;
    margin-top: 0;
}

body.symbol-detail-dashboard-shell #research-street-panel .analyst-rating-summary {
    border-left: 1px solid var(--border-soft);
    border-top: 0;
    margin-top: 0;
    padding: 0 0 0 0.9rem;
}

body.symbol-detail-dashboard-shell .research-target-track {
    margin-bottom: 1rem;
    margin-top: 0.8rem;
}

body.symbol-detail-dashboard-shell .research-target-track > span {
    background: var(--text);
    border-radius: 999px;
    height: 0.8rem;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 0.22rem;
    z-index: 1;
}

body.symbol-detail-dashboard-shell .research-target-track > .research-target-mean {
    background: var(--research-accent);
}

body.symbol-detail-dashboard-shell .research-target-track i {
    color: var(--muted);
    font-size: 0.65rem;
    font-style: normal;
    left: 50%;
    position: absolute;
    top: 0.72rem;
    transform: translateX(-50%);
    white-space: nowrap;
}

body.symbol-detail-dashboard-shell .research-short-chart {
    border-bottom: 1px solid var(--border-soft);
    display: grid;
    gap: 0.55rem;
    margin-bottom: 0.55rem;
    padding-bottom: 0.7rem;
}

body.symbol-detail-dashboard-shell .research-short-bar {
    align-items: center;
    display: grid;
    gap: 0.55rem;
    grid-template-columns: 5.5rem minmax(0, 1fr) auto;
}

body.symbol-detail-dashboard-shell .research-short-bar span {
    color: var(--muted-strong);
    font-size: var(--app-table-supporting-font-size);
}

body.symbol-detail-dashboard-shell .research-short-bar strong {
    color: var(--text);
    font-family: "JetBrains Mono", monospace;
    font-size: var(--app-table-body-font-size);
}

body.symbol-detail-dashboard-shell .research-short-bar b {
    background: var(--research-accent);
}

body.symbol-detail-dashboard-shell .research-table-footer {
    align-items: center;
    color: var(--muted-strong);
    display: flex;
    font-size: var(--app-table-supporting-font-size);
    gap: 0.75rem;
    justify-content: space-between;
    padding-top: 0.5rem;
}

body.symbol-detail-dashboard-shell .research-table-footer-end {
    justify-content: flex-end;
}

body.symbol-detail-dashboard-shell .research-disclosure-button {
    background: transparent;
    border: 0;
    color: var(--green);
    cursor: pointer;
    flex: 0 0 auto;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.2rem 0;
}

body.symbol-detail-dashboard-shell .research-disclosure-button:hover,
body.symbol-detail-dashboard-shell .research-disclosure-button:focus-visible {
    text-decoration: underline;
}

body.symbol-detail-dashboard-shell .analyst-rating-summary {
    align-items: center;
    border-top: 1px solid var(--border-soft);
    display: grid;
    gap: 1rem;
    grid-template-columns: 6.5rem minmax(0, 1fr);
    margin-top: 0.85rem;
    padding-top: 0.85rem;
}

body.symbol-detail-dashboard-shell .analyst-rating-chart {
    align-items: center;
    aspect-ratio: 1;
    background: conic-gradient(
        var(--surface) 0 0.8%,
        transparent 0.8% calc(var(--analyst-buy-stop) - 0.8%),
        var(--surface) calc(var(--analyst-buy-stop) - 0.8%) calc(var(--analyst-buy-stop) + 0.8%),
        transparent calc(var(--analyst-buy-stop) + 0.8%) calc(var(--analyst-hold-stop) - 0.8%),
        var(--surface) calc(var(--analyst-hold-stop) - 0.8%) calc(var(--analyst-hold-stop) + 0.8%),
        transparent calc(var(--analyst-hold-stop) + 0.8%) 99.2%,
        var(--surface) 99.2% 100%
    ), conic-gradient(
        var(--green) 0 var(--analyst-buy-stop),
        var(--yellow) var(--analyst-buy-stop) var(--analyst-hold-stop),
        var(--red) var(--analyst-hold-stop) 100%
    );
    border-radius: 50%;
    display: flex;
    justify-content: center;
    width: 6.5rem;
}

body.symbol-detail-dashboard-shell .analyst-rating-chart-center {
    align-items: center;
    aspect-ratio: 1;
    background: var(--surface);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.05;
    width: 58%;
}

body.symbol-detail-dashboard-shell .analyst-rating-chart-center strong {
    color: var(--text);
    font-family: "JetBrains Mono", monospace;
    font-size: 1.05rem;
}

body.symbol-detail-dashboard-shell .analyst-rating-chart-center span {
    color: var(--muted-strong);
    font-size: 0.62rem;
    margin-top: 0.15rem;
}

body.symbol-detail-dashboard-shell .analyst-rating-legend {
    min-width: 0;
}

body.symbol-detail-dashboard-shell .analyst-rating-legend-title {
    color: var(--muted-strong);
    font-size: 0.72rem;
    font-weight: 700;
    margin-bottom: 0.55rem;
}

body.symbol-detail-dashboard-shell .analyst-rating-pills {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

body.symbol-detail-dashboard-shell .analyst-activity-scroll {
    overflow-x: auto;
    scrollbar-gutter: stable;
}

body.symbol-detail-dashboard-shell .analyst-activity-table {
    font-family: "Source Sans 3", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    min-width: 52rem;
}

body.symbol-detail-dashboard-shell .analyst-activity-table th,
body.symbol-detail-dashboard-shell .analyst-activity-table td {
    border-bottom: 1px solid var(--border-soft);
    vertical-align: middle;
}

body.symbol-detail-dashboard-shell .analyst-activity-table th {
    background: var(--surface);
    color: var(--muted-strong);
    position: sticky;
    top: 0;
    z-index: 1;
}

body.symbol-detail-dashboard-shell .analyst-activity-table td {
    color: var(--muted-strong);
    line-height: 1.25;
}

body.symbol-detail-dashboard-shell .analyst-activity-table th:first-child,
body.symbol-detail-dashboard-shell .analyst-activity-table td:first-child {
    padding-left: 0;
    width: 28%;
}

body.symbol-detail-dashboard-shell .analyst-activity-table th:nth-child(2),
body.symbol-detail-dashboard-shell .analyst-activity-table td:nth-child(2) {
    width: 16%;
}

body.symbol-detail-dashboard-shell .analyst-activity-table th:last-child,
body.symbol-detail-dashboard-shell .analyst-activity-table td:last-child {
    padding-right: 0;
}

body.symbol-detail-dashboard-shell .analyst-activity-table td:first-child strong,
body.symbol-detail-dashboard-shell .analyst-activity-table td:first-child span {
    display: block;
}

body.symbol-detail-dashboard-shell .analyst-activity-table td:first-child strong {
    color: var(--text);
}

body.symbol-detail-dashboard-shell .analyst-activity-table td:first-child span {
    margin-top: 0.12rem;
}

body.symbol-detail-dashboard-shell .analyst-activity-number,
body.symbol-detail-dashboard-shell .analyst-activity-date {
    white-space: nowrap;
}

body.symbol-detail-dashboard-shell .analyst-projected-positive {
    color: var(--green) !important;
    font-weight: 700;
}

body.symbol-detail-dashboard-shell .analyst-projected-negative {
    color: var(--red) !important;
    font-weight: 700;
}

body.symbol-detail-dashboard-shell .fundamentals-grid {
    display: grid;
    gap: 0 1.5rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

body.symbol-detail-dashboard-shell .fundamental-row {
    align-items: center;
    border-bottom: 1px dashed var(--border-soft);
    display: grid;
    gap: 0.5rem;
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 2rem;
    padding: 0.45rem 0;
}

body.symbol-detail-dashboard-shell .fundamental-label,
body.symbol-detail-dashboard-shell .fundamental-value {
    font-size: 0.875rem;
}

body.symbol-detail-dashboard-shell .fundamental-label {
    min-width: 0;
}

body.symbol-detail-dashboard-shell .fundamental-value {
    font-family: "JetBrains Mono", monospace;
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
}

body.symbol-detail-dashboard-shell .symbol-news-list {
    display: grid;
    gap: 0.65rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

body.symbol-detail-dashboard-shell .company-news-card {
    display: flex;
    flex-direction: column;
}

body.symbol-detail-dashboard-shell .symbol-news-scroll,
body.symbol-detail-dashboard-shell .research-long-scroll {
    overflow-y: auto;
    padding-right: 0.35rem;
    scrollbar-gutter: stable;
}

body.symbol-detail-dashboard-shell .research-long-scroll {
    max-height: 30rem;
    overscroll-behavior: contain;
}

body.symbol-detail-dashboard-shell .institutional-research-layout {
    display: grid;
    gap: 1.1rem;
    grid-template-columns: minmax(18rem, 0.72fr) minmax(0, 2.28fr);
}

body.symbol-detail-dashboard-shell .research-ownership-summary {
    border-right: 1px solid var(--border-soft);
    min-width: 0;
    padding-right: 1rem;
}

body.symbol-detail-dashboard-shell .research-position-list {
    display: grid;
    gap: 0.55rem;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin-top: 0.75rem;
}

body.symbol-detail-dashboard-shell .research-position-row {
    background: color-mix(in srgb, var(--research-accent) 4%, var(--surface));
    border: 1px solid var(--border-soft);
    border-radius: 0.3rem;
    display: grid;
    gap: 0.25rem;
    grid-template-columns: minmax(0, 1fr);
    min-width: 0;
    padding: 0.55rem 0.6rem;
}

body.symbol-detail-dashboard-shell .research-position-row span,
body.symbol-detail-dashboard-shell .research-position-row small {
    color: var(--muted-strong);
    font-size: var(--app-table-supporting-font-size);
}

body.symbol-detail-dashboard-shell .research-position-row strong {
    color: var(--text);
    font-family: "JetBrains Mono", monospace;
    font-size: var(--app-table-body-font-size);
    text-align: left;
}

body.symbol-detail-dashboard-shell .research-position-row small {
    grid-column: auto;
    font-size: var(--app-table-secondary-font-size);
}

body.symbol-detail-dashboard-shell .research-ownership-overview {
    align-items: center;
    display: grid;
    gap: 0.9rem;
    grid-template-columns: 6.75rem minmax(0, 1fr);
}

body.symbol-detail-dashboard-shell .research-ownership-gauge {
    align-items: center;
    aspect-ratio: 1;
    background: conic-gradient(var(--research-accent) 0 var(--research-ownership), var(--border-soft) var(--research-ownership) 100%);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    width: 6.75rem;
}

body.symbol-detail-dashboard-shell .research-ownership-gauge > span {
    align-items: center;
    aspect-ratio: 1;
    background: var(--surface-soft);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 66%;
}

body.symbol-detail-dashboard-shell .research-ownership-gauge strong {
    color: var(--text);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.95rem;
}

body.symbol-detail-dashboard-shell .research-ownership-gauge small {
    color: var(--muted);
    font-size: 0.62rem;
    margin-top: 0.1rem;
}

body.symbol-detail-dashboard-shell .research-holdings-table-wrap,
body.symbol-detail-dashboard-shell .research-financial-table-wrap {
    min-width: 0;
    overflow-x: auto;
}

body.symbol-detail-dashboard-shell .research-holdings-table {
    min-width: 42rem;
}

body.symbol-detail-dashboard-shell .research-financial-table {
    min-width: 18rem;
    width: 100%;
}

body.symbol-detail-dashboard-shell .research-holdings-table th,
body.symbol-detail-dashboard-shell .research-holdings-table td,
body.symbol-detail-dashboard-shell .research-financial-table th,
body.symbol-detail-dashboard-shell .research-financial-table td {
    border-bottom: 1px solid var(--border-soft);
    white-space: nowrap;
}

body.symbol-detail-dashboard-shell .research-holdings-table th,
body.symbol-detail-dashboard-shell .research-financial-table th {
    color: var(--muted-strong);
    font-weight: 700;
}

body.symbol-detail-dashboard-shell .research-holdings-table th:first-child,
body.symbol-detail-dashboard-shell .research-holdings-table td:first-child,
body.symbol-detail-dashboard-shell .research-financial-table th:first-child,
body.symbol-detail-dashboard-shell .research-financial-table td:first-child {
    padding-left: 0;
    text-align: left;
}

body.symbol-detail-dashboard-shell .research-holdings-table td:first-child {
    color: var(--text);
}

body.symbol-detail-dashboard-shell .symbol-research-compact-table {
    min-width: 24rem;
}

body.symbol-detail-dashboard-shell #research-financials-panel {
    align-items: start;
    display: grid;
    gap: 0.65rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

body.symbol-detail-dashboard-shell #research-financials-panel > .mt-3 {
    grid-column: 1 / -1;
    margin-top: 0;
}

body.symbol-detail-dashboard-shell .research-financial-statement {
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 0.35rem;
    min-width: 0;
    padding: 0.7rem;
}

body.symbol-detail-dashboard-shell .research-financial-statement + .research-financial-statement {
    margin-top: 0;
}

body.symbol-detail-dashboard-shell .research-financial-statement-title {
    color: var(--text);
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.025em;
    margin-bottom: 0.45rem;
}

body.symbol-detail-dashboard-shell .research-financial-table-wrap {
    max-height: 18rem;
    overscroll-behavior: contain;
    overflow-y: auto;
}

body.symbol-detail-dashboard-shell .research-filings-list {
    display: grid;
    gap: 0 1rem;
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

body.symbol-detail-dashboard-shell .research-filing-row {
    border-bottom: 1px solid var(--border-soft);
    padding: 0.45rem 0;
}

body.symbol-detail-dashboard-shell .research-filing-row:first-child {
    padding-top: 0;
}

body.symbol-detail-dashboard-shell .research-filing-row:last-child {
    border-bottom: 0;
}

body.symbol-detail-dashboard-shell .symbol-news-item {
    border-bottom: 1px dashed var(--border-soft);
    display: grid;
    gap: 0.75rem;
    grid-template-columns: 5.25rem minmax(0, 1fr);
    padding: 0.15rem 0 0.65rem;
}

body.symbol-detail-dashboard-shell .symbol-news-item.symbol-news-item-no-image {
    grid-template-columns: minmax(0, 1fr);
}

body.symbol-detail-dashboard-shell .symbol-news-thumb {
    aspect-ratio: 16 / 10;
    background: var(--surface-soft);
    border: 1px solid var(--border-soft);
    border-radius: 0.35rem;
    height: auto;
    object-fit: cover;
    width: 100%;
}

body.symbol-detail-dashboard-shell .symbol-news-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

body.symbol-detail-dashboard-shell .symbol-news-title {
    font-weight: 700;
    line-height: 1.25;
}

body.symbol-detail-dashboard-shell .symbol-news-item:hover .symbol-news-title {
    color: var(--green) !important;
}

body.symbol-detail-dashboard-shell .symbol-news-meta {
    font-size: 0.75rem;
    margin-top: 0.3rem;
}

body.symbol-detail-dashboard-shell .quality-rating-pill {
    border: 1px solid transparent;
}

@media (min-width: 1536px) {
    body.symbol-detail-dashboard-shell .company-news-card {
        height: auto;
    }

    body.symbol-detail-dashboard-shell .company-news-card .symbol-news-scroll {
        flex: 1;
        min-height: 0;
    }
}

@media (max-width: 1535px) {
    body.symbol-detail-dashboard-shell .symbol-news-scroll {
        max-height: 16rem;
    }
}

@media (max-width: 1180px) {
    body.symbol-detail-dashboard-shell .institutional-research-layout {
        grid-template-columns: minmax(0, 1fr);
        max-width: none;
    }

    body.symbol-detail-dashboard-shell .symbol-research-desk,
    body.symbol-detail-dashboard-shell .symbol-research-records-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    body.symbol-detail-dashboard-shell .symbol-research-desk-rail {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.symbol-detail-dashboard-shell .symbol-research-records-grid .symbol-research-financials-card,
    body.symbol-detail-dashboard-shell .symbol-research-records-grid .symbol-research-filings-card {
        grid-column: 1 / -1;
    }

    body.symbol-detail-dashboard-shell #research-street-panel {
        grid-template-columns: minmax(0, 1fr);
    }

    body.symbol-detail-dashboard-shell #research-street-panel .analyst-rating-summary {
        border-left: 0;
        border-top: 1px solid var(--border-soft);
        padding: 0.85rem 0 0;
    }

    body.symbol-detail-dashboard-shell .symbol-news-list,
    body.symbol-detail-dashboard-shell .research-filings-list,
    body.symbol-detail-dashboard-shell .research-position-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.symbol-detail-dashboard-shell .research-ownership-summary {
        border-bottom: 1px solid var(--border-soft);
        border-right: 0;
        padding-bottom: 1rem;
        padding-right: 0;
    }

    body.symbol-detail-dashboard-shell .fundamentals-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    body.symbol-detail-dashboard-shell .symbol-research-desk-rail,
    body.symbol-detail-dashboard-shell .symbol-research-desk-insights,
    body.symbol-detail-dashboard-shell .symbol-research-desk-secondary,
    body.symbol-detail-dashboard-shell #research-financials-panel {
        grid-template-columns: minmax(0, 1fr);
    }

    body.symbol-detail-dashboard-shell .symbol-research-desk-insights .symbol-research-overview-street,
    body.symbol-detail-dashboard-shell .symbol-research-desk-insights .symbol-research-position-activity-card {
        grid-column: 1;
        grid-row: auto;
    }

    body.symbol-detail-dashboard-shell .research-market-visuals,
    body.symbol-detail-dashboard-shell .symbol-news-list,
    body.symbol-detail-dashboard-shell .research-filings-list,
    body.symbol-detail-dashboard-shell .research-position-list,
    body.symbol-detail-dashboard-shell .research-ownership-overview {
        grid-template-columns: minmax(0, 1fr);
    }

    body.symbol-detail-dashboard-shell .research-ownership-gauge {
        width: 5.75rem;
    }

    body.symbol-detail-dashboard-shell .analyst-rating-summary {
        grid-template-columns: 5.75rem minmax(0, 1fr);
    }

    body.symbol-detail-dashboard-shell .analyst-rating-chart {
        width: 5.75rem;
    }

    body.symbol-detail-dashboard-shell .fundamentals-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    body.symbol-detail-dashboard-shell .research-long-scroll {
        max-height: 24rem;
    }

    body.symbol-detail-dashboard-shell .symbol-news-item {
        grid-template-columns: 4.5rem minmax(0, 1fr);
    }

    body.symbol-detail-dashboard-shell .detail-title-row {
        align-items: flex-start;
        flex-wrap: wrap;
    }

}

body.symbol-detail-dashboard-shell .surface,
body.symbol-detail-dashboard-shell .detail-card {
    background: var(--surface) !important;
    border-color: var(--border) !important;
    border-radius: 0.35rem;
    box-shadow: none !important;
}

body.symbol-detail-dashboard-shell .symbol-research-workspace .symbol-research-overview-section,
body.symbol-detail-dashboard-shell .symbol-research-workspace .symbol-research-card {
    background: var(--surface-soft) !important;
    border: 1px solid var(--border) !important;
    box-shadow: none !important;
}

body.symbol-detail-dashboard-shell .surface > .px-6:first-child {
    background: var(--surface-soft);
    border-bottom: 1px solid var(--border-soft);
}

body.symbol-detail-dashboard-shell .surface-content {
    padding-top: 0.9rem;
}

body.symbol-detail-dashboard-shell .detail-card-header h2,
body.symbol-detail-dashboard-shell .detail-card-header h3,
body.symbol-detail-dashboard-shell .surface h2 {
    color: var(--text) !important;
}

body.symbol-detail-dashboard-shell .text-slate-900,
body.symbol-detail-dashboard-shell .text-slate-800,
body.symbol-detail-dashboard-shell .text-slate-700 {
    color: var(--text) !important;
}

body.symbol-detail-dashboard-shell .text-slate-600,
body.symbol-detail-dashboard-shell .text-slate-500,
body.symbol-detail-dashboard-shell .text-slate-400 {
    color: var(--muted-strong) !important;
}

body.symbol-detail-dashboard-shell .border-slate-100,
body.symbol-detail-dashboard-shell .border-slate-200,
body.symbol-detail-dashboard-shell .border-slate-300,
body.symbol-detail-dashboard-shell .grouped-results-table {
    border-color: var(--border) !important;
}

body.symbol-detail-dashboard-shell .bg-white,
body.symbol-detail-dashboard-shell .expiry-group-header {
    background-color: var(--surface) !important;
}

body.symbol-detail-dashboard-shell .bg-slate-50,
body.symbol-detail-dashboard-shell .bg-slate-100,
body.symbol-detail-dashboard-shell .hover\:bg-slate-50:hover,
body.symbol-detail-dashboard-shell .hover\:bg-slate-100:hover,
body.symbol-detail-dashboard-shell .hover\:bg-blue-50:hover,
body.symbol-detail-dashboard-shell table thead {
    background-color: var(--surface-soft) !important;
}

body.symbol-detail-dashboard-shell .fundamental-row,
body.symbol-detail-dashboard-shell .symbol-news-item,
body.symbol-detail-dashboard-shell table tbody tr {
    border-color: var(--border-soft) !important;
}

body.symbol-detail-dashboard-shell .fundamental-label,
body.symbol-detail-dashboard-shell .symbol-news-meta {
    color: var(--muted) !important;
}

body.symbol-detail-dashboard-shell .fundamental-value,
body.symbol-detail-dashboard-shell .symbol-news-title {
    color: var(--text) !important;
}

body.symbol-detail-dashboard-shell .breadth-scope-card {
    background: var(--surface-soft);
    border-color: var(--border);
}

body.symbol-detail-dashboard-shell .breadth-scope-card-label,
body.symbol-detail-dashboard-shell .breadth-scope-card-date {
    color: var(--muted);
}

body.symbol-detail-dashboard-shell .breadth-scope-card-value {
    color: var(--text);
}

.detail-chart-section {
    min-width: 0;
}

.detail-chart-section-heading {
    align-items: center;
    display: flex;
    min-height: 2rem;
    padding: 0 0.1rem 0.55rem;
}

body.symbol-detail-dashboard-shell #watchlist-chart-content {
    padding: 0;
}

body.symbol-detail-dashboard-shell #watchlist-chart-frame,
body.symbol-detail-dashboard-shell #watchlist-chart-message {
    background: var(--surface-soft);
}

body.symbol-detail-dashboard-shell #watchlist-chart-container {
    height: 100%;
    min-height: 484px;
}

body.symbol-detail-dashboard-shell #watchlist-chart-message {
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    text-align: center;
}

.stock-chart-frame {
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 0.35rem;
    overflow: hidden;
    position: relative;
}

.stock-chart-container {
    height: 484px;
    position: relative;
}

.chart-interaction-locked .stock-chart-container {
    pointer-events: none;
}

.chart-lock-overlay {
    align-items: center;
    background: rgba(248, 250, 252, 0.78);
    border: 0;
    color: #475569;
    display: flex;
    font-size: 0.75rem;
    font-weight: 700;
    inset: 0;
    justify-content: center;
    letter-spacing: 0.02em;
    opacity: 0;
    pointer-events: auto;
    position: absolute;
    text-transform: uppercase;
    transition: opacity 0.15s ease;
    z-index: 10;
}

.chart-interaction-locked:hover .chart-lock-overlay,
.chart-lock-overlay:focus {
    opacity: 1;
}

body.dark-mode .chart-lock-overlay {
    background: rgba(15, 15, 15, 0.34);
    color: #c7d2c2;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

/* Shared by Symbol Detail and Charts. Keep chart/control geometry in this contract. */
.detail-chart-workspace {
    align-items: stretch;
    display: grid;
    gap: 0.8rem;
    grid-template-columns: minmax(0, 3fr) minmax(14rem, 1fr);
}

body.symbol-detail-dashboard-shell .detail-chart-workspace {
    grid-template-columns: minmax(0, 3.2fr) minmax(16rem, 0.95fr);
}

body.symbol-detail-dashboard-shell .symbol-detail-chart-rail {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    min-width: 0;
}

body.symbol-detail-dashboard-shell .symbol-market-snapshot {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.35rem;
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    padding: 0.85rem;
}

body.symbol-detail-dashboard-shell .symbol-market-snapshot > header {
    align-items: center;
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.7rem;
    padding-bottom: 0.55rem;
}

body.symbol-detail-dashboard-shell .symbol-market-snapshot h2 {
    color: var(--text);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0;
    margin: 0;
    text-transform: none;
}

body.symbol-detail-dashboard-shell #symbol-market-snapshot-panel {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    justify-content: space-between;
    min-height: 0;
}

body.symbol-detail-dashboard-shell .symbol-market-quote {
    display: grid;
    gap: 0.28rem;
}

body.symbol-detail-dashboard-shell .symbol-market-quote > span,
body.symbol-detail-dashboard-shell .symbol-market-key-metrics dt,
body.symbol-detail-dashboard-shell .symbol-market-range span {
    color: var(--muted-strong);
    font-size: 0.76rem;
}

body.symbol-detail-dashboard-shell .symbol-market-quote > div {
    align-items: baseline;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.6rem;
}

body.symbol-detail-dashboard-shell .symbol-market-quote strong {
    color: var(--text);
    font-family: "JetBrains Mono", monospace;
    font-size: 1.55rem;
    line-height: 1;
}

body.symbol-detail-dashboard-shell .symbol-market-quote em {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.9rem;
    font-style: normal;
    font-weight: 700;
}

body.symbol-detail-dashboard-shell .symbol-market-key-metrics {
    border-top: 1px solid var(--border-soft);
    display: grid;
    gap: 0.75rem 0.9rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0;
    padding-top: 0.75rem;
}

body.symbol-detail-dashboard-shell .symbol-market-key-metrics div {
    display: grid;
    gap: 0.14rem;
    min-width: 0;
}

body.symbol-detail-dashboard-shell .symbol-market-key-metrics .symbol-market-asset {
    grid-column: 1 / -1;
}

body.symbol-detail-dashboard-shell .symbol-market-key-metrics dd,
body.symbol-detail-dashboard-shell .symbol-market-range strong {
    color: var(--text);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.94rem;
    font-weight: 700;
    margin: 0;
}

body.symbol-detail-dashboard-shell .symbol-market-key-metrics small {
    color: var(--muted-strong);
    font-size: 0.72rem;
    line-height: 1.25;
}

body.symbol-detail-dashboard-shell .symbol-market-range {
    border-top: 1px solid var(--border-soft);
    padding-top: 0.7rem;
}

body.symbol-detail-dashboard-shell .symbol-market-range > div:first-child,
body.symbol-detail-dashboard-shell .symbol-market-range > small {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

body.symbol-detail-dashboard-shell .symbol-market-range-track {
    background: var(--border-soft);
    border-radius: 999px;
    height: 0.28rem;
    margin: 0.45rem 0 0.32rem;
    position: relative;
}

body.symbol-detail-dashboard-shell .symbol-market-range-track span {
    background: var(--green);
    border-radius: inherit;
    display: block;
    height: 100%;
    width: var(--symbol-range-position, 0%);
}

body.symbol-detail-dashboard-shell .symbol-market-range-track::after {
    background: var(--green);
    border: 2px solid var(--surface);
    border-radius: 50%;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--green) 35%, transparent);
    content: "";
    height: 0.62rem;
    left: clamp(0.31rem, var(--symbol-range-position, 0%), calc(100% - 0.31rem));
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 0.62rem;
}

body.symbol-detail-dashboard-shell .symbol-market-range > small {
    color: var(--muted-strong);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.72rem;
}

.detail-chart-main {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.35rem;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 0.85rem;
}

.detail-chart-legend {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.8rem;
    margin-bottom: 0.55rem;
    min-height: 1.35rem;
}

body.symbol-detail-dashboard-shell .detail-chart-toolbar {
    align-items: flex-end;
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1rem;
    justify-content: space-between;
    margin-bottom: 0.65rem;
    min-width: 0;
}

body.symbol-detail-dashboard-shell .detail-chart-toolbar .detail-chart-legend {
    align-self: center;
    flex: 1 1 15rem;
    margin-bottom: 0;
    min-width: 0;
    padding-bottom: 0;
}

body.symbol-detail-dashboard-shell .detail-chart-inline-controls {
    align-items: end;
    display: grid;
    flex: 0 1 auto;
    gap: 1rem;
    grid-template-columns: minmax(16rem, 18rem) minmax(12rem, 14rem);
    margin-left: auto;
    min-width: 0;
}

body.symbol-detail-dashboard-shell .detail-chart-inline-controls .detail-chart-control-group {
    gap: 0.35rem;
}

body.symbol-detail-dashboard-shell .detail-chart-inline-controls .detail-chart-control-group + .detail-chart-control-group {
    border-left: 1px solid var(--border-soft);
    border-top: 0;
    margin: 0;
    padding: 0 0 0 1rem;
}

body.symbol-detail-dashboard-shell .detail-chart-inline-controls .app-chart-range-options {
    grid-template-columns: repeat(4, minmax(3.2rem, 1fr));
}

body.symbol-detail-dashboard-shell .detail-chart-inline-controls .app-chart-range-options button,
body.symbol-detail-dashboard-shell .detail-chart-inline-controls .detail-chart-model-bar > .app-field {
    min-height: 2.35rem;
}

body.symbol-detail-dashboard-shell .detail-chart-inline-controls .detail-chart-custom-model {
    grid-column: 1 / -1;
    grid-template-columns: minmax(4.5rem, 0.7fr) minmax(6.5rem, 1fr) auto;
}

body.symbol-detail-dashboard-shell .detail-chart-inline-controls .detail-chart-model-error:empty {
    display: none;
}

.detail-chart-controls {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.35rem;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 0.85rem;
}

body.symbol-detail-dashboard-shell .detail-chart-main #watchlist-chart-frame {
    flex: 1 1 auto;
    min-height: 484px;
}

@media (max-width: 1100px) {
    body.symbol-detail-dashboard-shell .detail-chart-workspace {
        grid-template-columns: minmax(0, 1fr);
    }

    body.symbol-detail-dashboard-shell .symbol-detail-chart-rail {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.symbol-detail-dashboard-shell .symbol-detail-chart-rail > :only-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 720px) {
    body.symbol-detail-dashboard-shell .detail-chart-toolbar {
        align-items: stretch;
    }

    body.symbol-detail-dashboard-shell .detail-chart-toolbar .detail-chart-legend,
    body.symbol-detail-dashboard-shell .detail-chart-inline-controls {
        flex-basis: 100%;
        margin-left: 0;
        width: 100%;
    }

    body.symbol-detail-dashboard-shell .detail-chart-inline-controls {
        grid-template-columns: minmax(0, 1fr);
    }

    body.symbol-detail-dashboard-shell .detail-chart-inline-controls .detail-chart-control-group + .detail-chart-control-group {
        border-left: 0;
        border-top: 1px solid var(--border-soft);
        padding: 0.7rem 0 0;
    }

    body.symbol-detail-dashboard-shell .symbol-detail-chart-rail {
        display: flex;
    }
}

.detail-chart-controls header {
    border-bottom: 1px solid var(--border-soft);
    margin-bottom: 0.8rem;
    padding-bottom: 0.65rem;
}

.detail-chart-controls header > span,
.detail-chart-control-label,
.detail-chart-model-bar > label {
    color: var(--muted);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.detail-chart-controls h2 {
    color: var(--text);
    font-size: 0.9rem;
    line-height: 1.1;
    margin: 0.12rem 0 0;
}

.detail-chart-control-group {
    display: grid;
    gap: 0.45rem;
}

.detail-chart-control-group + .detail-chart-control-group {
    border-top: 1px solid var(--border-soft);
    margin-top: 0.85rem;
    padding-top: 0.85rem;
}

.app-chart-range-options {
    display: grid;
    gap: 0.35rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.app-chart-range-options button {
    background: var(--control-bg);
    border: 1px solid var(--control-border);
    border-radius: 0.4rem;
    color: var(--muted-strong);
    cursor: pointer;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.7rem;
    min-height: 2rem;
}

.app-chart-range-options button:hover {
    border-color: var(--muted);
    color: var(--text);
}

.app-chart-range-options button.active {
    background: color-mix(in srgb, var(--green) 12%, var(--control-bg));
    border-color: var(--green);
    color: var(--green);
}

.app-chart-range-description {
    color: var(--muted);
    font-size: 0.68rem;
    line-height: 1.35;
    margin: 0;
}

.detail-chart-overlay-options {
    display: grid;
    gap: 0.6rem;
}

.detail-chart-overlay-options label {
    align-items: center;
    color: var(--muted-strong);
    display: flex;
    font-size: 0.75rem;
    gap: 0.45rem;
}

.detail-chart-overlay-options label[hidden] {
    display: none;
}

.detail-chart-overlay-options label:has(input:disabled) {
    cursor: not-allowed;
    opacity: 0.48;
}

.detail-chart-model-bar {
    align-items: stretch;
}

.detail-chart-model-bar > .app-field {
    min-width: 0;
    width: 100%;
}

.detail-chart-custom-model {
    display: grid;
    gap: 0.4rem;
    grid-template-columns: 1fr;
}

.detail-chart-custom-model[hidden] {
    display: none;
}

.detail-chart-custom-model .app-field {
    min-width: 0;
    width: 100%;
}

.detail-chart-custom-model .app-symbol-action {
    min-height: 2.35rem;
    padding: 0 0.7rem;
}

.detail-chart-model-note {
    color: var(--muted);
    font-size: 0.7rem;
}

.detail-chart-model-error {
    color: var(--red);
    font-size: 0.7rem;
    width: 100%;
}

body.symbol-detail-dashboard-shell #watchlist-options-content {
    overflow-x: auto;
}

@media (max-width: 1500px) {
    .settings-sections-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.market-signals-dashboard-shell .app-dashboard-row {
        grid-template-columns: 1fr;
    }

    body.market-signals-dashboard-shell .app-filter-panel {
        border-top: 1px solid var(--border-soft);
    }
}

@media (max-width: 1180px) {
    .settings-sections-grid {
        grid-template-columns: 1fr;
    }

    .settings-options-card {
        grid-column: auto;
    }

    body.breadth-dashboard-shell .breadth-chart-grid--markets,
    body.breadth-dashboard-shell .breadth-chart-grid--sectors {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .guide-step-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1260px) {
    .home-utility-bar {
        grid-template-columns: minmax(0, 1fr) minmax(18rem, 24rem) minmax(0, 1fr);
    }

    .home-dashboard-grid {
        grid-template-columns: 280px minmax(440px, 1fr);
    }

    .home-dashboard-column-right {
        grid-column: 1 / -1;
        grid-template-columns: 1fr;
    }

    .home-market-news-list {
        grid-template-columns: minmax(0, 1fr);
    }

    .home-news-item,
    .home-news-item-featured {
        border-right: 0 !important;
        grid-column: auto;
    }
}

@media (max-width: 980px) {
    .home-app-frame {
        grid-template-columns: 190px minmax(0, 1fr);
    }

    .home-sidebar {
        padding-left: 0.55rem;
        padding-right: 0.55rem;
    }

    .home-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .home-dashboard-column-right {
        grid-column: auto;
        grid-template-columns: 1fr;
    }

    .home-dashboard-column-left {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}

@media (max-width: 760px) {
    .home-app-frame {
        display: block;
    }

    .home-sidebar {
        box-shadow: 18px 0 45px rgba(0, 0, 0, 0.35);
        max-width: 84vw;
        position: fixed;
        transform: translateX(-105%);
        transition: transform 170ms ease;
        width: 218px;
    }

    .home-sidebar-close,
    .home-menu-button {
        display: inline-flex;
    }

    .home-menu-button {
        border-color: var(--border);
        border-radius: 0.35rem;
        color: var(--text);
        height: 2.35rem;
        width: 2.35rem;
    }

    .home-menu-button svg {
        height: 1.1rem;
        width: 1.1rem;
    }

    .home-utility-bar {
        grid-template-columns: auto minmax(16rem, 1fr) auto;
    }

    .home-symbol-search {
        max-width: none;
    }

    body.home-sidebar-open .home-sidebar {
        transform: translateX(0);
    }

    body.home-sidebar-open .home-sidebar-backdrop {
        display: block;
    }

    body.home-sidebar-open {
        overflow: hidden;
    }

    .home-utility-status {
        font-size: 0.72rem;
    }

    .home-utility-divider,
    .home-utility-status > span:last-child {
        display: none;
    }

    .home-dashboard {
        padding: 0.8rem;
    }

    body.home-dashboard-shell .home-dashboard:has(> .app-page-heading) {
        padding: 0.8rem;
    }

    .home-dashboard-column-left,
    .home-market-movers-grid {
        grid-template-columns: 1fr;
    }

    .home-market-mover-lane + .home-market-mover-lane {
        border-left: 0;
        border-top: 1px solid var(--border-soft);
    }

    body.home-dashboard-shell .app-page-heading-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.35rem;
    }

    body.symbol-detail-dashboard-shell .symbol-detail-page-heading {
        align-items: flex-start;
    }

    body.symbol-detail-dashboard-shell .surface > .px-6:first-child {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    body.symbol-detail-dashboard-shell #watchlist-chart-container {
        height: 20rem;
        min-height: 20rem;
    }

    body.symbol-detail-dashboard-shell .detail-chart-main #watchlist-chart-frame {
        min-height: 20rem;
    }

    .stock-chart-container {
        height: 20rem;
    }

    .detail-chart-workspace {
        grid-template-columns: 1fr;
    }

    .detail-chart-controls {
        grid-row: 1;
    }

    .detail-chart-main {
        grid-row: 2;
    }

    body.symbol-detail-dashboard-shell .detail-chart-main {
        grid-row: 1;
    }

    body.symbol-detail-dashboard-shell .symbol-detail-chart-rail {
        grid-row: 2;
    }

    .breadth-heading-date {
        padding-top: 0;
    }

    .market-signals-heading-row {
        flex-direction: column;
    }

    .market-signals-updated {
        padding-top: 0;
    }

    .settings-sections-grid,
    .settings-watchlist-layout {
        grid-template-columns: 1fr;
    }

    .settings-watchlists-card,
    .settings-options-card {
        grid-column: auto;
    }

    .settings-context-section {
        border-left: 0;
        border-top: 1px solid var(--border-soft);
        padding-left: 0;
        padding-top: 1rem;
    }

    .settings-section-header {
        flex-direction: column;
    }

    .settings-inline-field,
    .settings-notification-grid {
        align-items: stretch;
        grid-template-columns: 1fr;
        max-width: none;
        width: 100%;
    }

    .settings-trend-model-field,
    .settings-trend-model-copy {
        max-width: none;
    }

    .settings-custom-trend-controls {
        grid-template-columns: 1fr;
    }

    body.settings-dashboard-shell #save-status {
        grid-column: 1;
    }

    body.settings-dashboard-shell #cfg-stock-trend-model {
        width: 100%;
    }

    body.settings-dashboard-shell #watchlist-select {
        min-width: 0;
        width: 100%;
    }

    body.guide-dashboard-shell .guide-intro,
    body.guide-dashboard-shell .guide-section {
        padding: 0.85rem;
    }

    body.guide-dashboard-shell .guide-section-heading {
        flex-direction: column;
        gap: 0.35rem;
    }

    .guide-step-list,
    .guide-state-grid,
    .guide-definition-grid,
    .guide-page-grid,
    .guide-split-grid {
        grid-template-columns: 1fr;
    }

    .option-settings-grid,
    .option-field-grid {
        grid-template-columns: 1fr;
    }

    body.watchlists-dashboard-shell .app-watchlist-management-row {
        align-items: flex-start;
    }

    body.watchlists-dashboard-shell .watchlist-management-browser,
    body.watchlists-dashboard-shell .watchlist-name-editor,
    body.watchlists-dashboard-shell .watchlist-delete-confirmation {
        flex-wrap: wrap;
        width: 100%;
    }

    body.watchlists-dashboard-shell .app-watchlist-management-row label {
        flex: 1 0 100%;
    }

    body.watchlists-dashboard-shell #watchlist-select {
        min-width: 0;
        width: 100%;
    }

    body.watchlists-dashboard-shell #watchlist-name-input {
        min-width: 0;
        width: 100%;
    }

    body.watchlists-dashboard-shell .app-watchlist-management-row,
    body.watchlists-dashboard-shell .app-watchlist-symbols {
        flex-basis: 100%;
    }

    body.market-signals-dashboard-shell .app-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.market-signals-dashboard-shell .app-stat-card:nth-child(2) {
        border-right: 0;
    }

    body.market-signals-dashboard-shell .app-stat-card:nth-child(n + 3) {
        border-top: 1px solid var(--border-soft);
    }

    body.breadth-dashboard-shell .breadth-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .breadth-toolbar-control {
        justify-content: space-between;
        width: 100%;
    }

    body.breadth-dashboard-shell .breadth-chart-grid--markets,
    body.breadth-dashboard-shell .breadth-chart-grid--sectors {
        grid-template-columns: 1fr;
    }

    .home-dashboard-column-left {
        grid-template-columns: 1fr;
    }

    .home-news-item-featured {
        grid-template-columns: minmax(0, 1fr);
    }

    .home-news-item-featured .home-news-image {
        height: auto;
    }
}

@media (max-width: 480px) {
    .home-utility-bar {
        gap: 0.55rem;
        grid-template-columns: auto minmax(0, 1fr);
        padding: 0.55rem 0.65rem;
    }

    .home-utility-status {
        display: none;
    }

    body.home-dashboard-shell .app-page-heading h1 {
        font-size: 1.6rem;
        line-height: 2rem;
    }
}

/* One neutral control palette across every customer page in the left-navigation shell. */
body.home-dashboard-shell.app-shell input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([data-symbol-search-input]),
body.home-dashboard-shell.app-shell select,
body.home-dashboard-shell.app-shell textarea {
    -webkit-text-fill-color: var(--control-text) !important;
    background-color: var(--control-bg) !important;
    border-color: var(--control-border) !important;
    color: var(--control-text) !important;
}

body.home-dashboard-shell.app-shell select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239da7b1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    padding-right: 2.25rem;
}

body.home-dashboard-shell.app-shell input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([data-symbol-search-input])::placeholder,
body.home-dashboard-shell.app-shell textarea::placeholder {
    -webkit-text-fill-color: var(--control-placeholder) !important;
    color: var(--control-placeholder) !important;
    opacity: 1;
}

body.home-dashboard-shell.app-shell input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([data-symbol-search-input]):focus,
body.home-dashboard-shell.app-shell select:focus,
body.home-dashboard-shell.app-shell textarea:focus {
    background-color: var(--control-bg-focus) !important;
    border-color: #5b9f69 !important;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--green) 14%, transparent);
    outline: 0;
}

body.home-dashboard-shell.app-shell select option {
    -webkit-text-fill-color: var(--control-text);
    background: var(--control-bg);
    color: var(--control-text);
}

body.home-dashboard-shell.app-shell input:disabled,
body.home-dashboard-shell.app-shell select:disabled,
body.home-dashboard-shell.app-shell textarea:disabled {
    cursor: not-allowed;
    opacity: 0.62;
}

/* Keep legacy utility classes inside the new customer shell on the shared blue-black palette. */
body.dark-mode.home-dashboard-shell .surface,
body.dark-mode.home-dashboard-shell .detail-card,
body.dark-mode.home-dashboard-shell .bg-white,
body.dark-mode.home-dashboard-shell .expiry-group-header,
body.dark-mode.home-dashboard-shell .app-panel,
body.dark-mode.home-dashboard-shell .app-stat-card,
body.dark-mode.home-dashboard-shell .app-table-wrap,
body.dark-mode.home-dashboard-shell .app-signal-card.signal-card {
    background: var(--surface) !important;
    background-color: var(--surface) !important;
    border-color: var(--border) !important;
    box-shadow: none !important;
}

body.dark-mode.home-dashboard-shell .bg-slate-50,
body.dark-mode.home-dashboard-shell .bg-slate-100,
body.dark-mode.home-dashboard-shell .hover\:bg-slate-50:hover,
body.dark-mode.home-dashboard-shell .hover\:bg-slate-100:hover,
body.dark-mode.home-dashboard-shell .hover\:bg-blue-50:hover,
body.dark-mode.home-dashboard-shell table thead,
body.dark-mode.home-dashboard-shell table thead tr,
body.dark-mode.home-dashboard-shell code,
body.dark-mode.home-dashboard-shell .metric-selector,
body.dark-mode.home-dashboard-shell .metric-btn:hover,
body.dark-mode.home-dashboard-shell .metric-btn:focus-visible,
body.dark-mode.home-dashboard-shell .breadth-scope-card,
body.dark-mode.home-dashboard-shell .watchlist-row-itm td {
    background: var(--surface-soft) !important;
    background-color: var(--surface-soft) !important;
}

body.dark-mode.home-dashboard-shell .app-status-pill,
body.dark-mode.home-dashboard-shell .app-signal-state-pill,
body.dark-mode.home-dashboard-shell .quality-rating-pill.signal-chip-entry-plus,
body.dark-mode.home-dashboard-shell .quality-rating-pill.signal-chip-entry,
body.dark-mode.home-dashboard-shell .quality-rating-pill.signal-chip-exit,
body.dark-mode.home-dashboard-shell .extrinsic-tooltip-trigger.signal-chip-entry-plus,
body.dark-mode.home-dashboard-shell .extrinsic-tooltip-trigger.signal-chip-entry,
body.dark-mode.home-dashboard-shell .extrinsic-tooltip-trigger.signal-chip-exit {
    background: var(--surface-soft) !important;
    background-color: var(--surface-soft) !important;
}

body.dark-mode.home-dashboard-shell .content-button:hover,
body.dark-mode.home-dashboard-shell .form-control:hover {
    background: var(--surface-soft);
    background-color: var(--surface-soft);
}

body.dark-mode.home-dashboard-shell .metric-btn.active {
    background: var(--surface-soft) !important;
    border-color: color-mix(in srgb, var(--green) 42%, var(--border)) !important;
}

body.dark-mode.home-dashboard-shell .app-chart-earnings-marker {
    border-color: var(--surface);
}

/* Congress Trades uses the shared shell, tables, controls, and semantic status pills. */
.politician-trades-heading {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.politician-trades-secondary,
.politician-trades-pagination {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.politician-trades-updated {
    padding-top: 0.35rem;
    text-align: right;
}

.politician-trades-filter-form {
    align-items: end;
    display: grid;
    gap: 0.75rem;
    grid-template-columns: minmax(16rem, 2fr) minmax(8rem, 0.8fr) minmax(10rem, 1fr) minmax(10rem, 1fr) auto;
    width: 100%;
}

.politician-trades-content-grid {
    align-items: start;
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1fr);
}

.politician-trades-top-grid {
    align-items: stretch;
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.politician-trades-rail {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.politician-trades-rail .politician-trades-leader-list {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.politician-trades-rail .politician-trades-leader-row {
    border-bottom: 0;
    border-right: 1px solid var(--border-soft);
}

.politician-trades-rail .politician-trades-leader-row:nth-child(5n),
.politician-trades-rail .politician-trades-leader-row:last-child {
    border-right: 0;
}

.politician-trades-rail .politician-trades-leader-row:nth-child(n + 6) {
    border-top: 1px solid var(--border-soft);
}

.politician-trades-feed {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.politician-trades-leaderboard {
    min-width: 0;
    overflow: hidden;
}

.politician-trades-card-heading {
    border-bottom: 1px solid var(--border-soft);
    padding: 1rem;
}

.politician-trades-card-heading h2,
.politician-trades-card-heading p {
    margin: 0;
}

.politician-trades-card-heading h2 {
    color: var(--text-strong);
    font-size: 1rem;
    font-weight: 650;
}

.politician-trades-card-heading p {
    color: var(--text-muted);
    font-size: 0.78rem;
    margin-top: 0.2rem;
}

.politician-trades-leader-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.politician-trades-leader-row {
    align-items: center;
    border-bottom: 1px solid var(--border-soft);
    display: grid;
    gap: 0.7rem;
    grid-template-columns: 1.25rem 2.35rem minmax(0, 1fr) auto;
    min-height: 4.1rem;
    padding: 0.65rem 0.85rem;
}

.politician-trades-leader-row:last-child {
    border-bottom: 0;
}

.politician-trades-stock-row {
    align-items: center;
    border-bottom: 1px solid var(--border-soft);
    display: grid;
    gap: 0.7rem;
    grid-template-columns: 1.25rem minmax(0, 1fr);
    min-height: 4.1rem;
    padding: 0.65rem 0.85rem;
}

.politician-trades-stock-list {
    display: grid;
    grid-auto-flow: column;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(3, minmax(4.1rem, auto));
}

.politician-trades-stock-row:nth-child(3),
.politician-trades-stock-row:nth-child(6),
.politician-trades-stock-row:last-child {
    border-bottom: 0;
}

.politician-trades-stock-row:nth-child(n + 4) {
    border-left: 1px solid var(--border-soft);
}

.politician-trades-stock-list .politician-trades-leader-loading,
.politician-trades-stock-list .politician-trades-leader-empty {
    grid-column: 1 / -1;
    grid-row: 1 / -1;
}

.politician-trades-stock-symbol {
    align-items: center;
    display: flex;
    gap: 0.65rem;
    min-width: 0;
}

.politician-trades-stock-logo,
.politician-trades-stock-logo.app-symbol-icon-has-logo {
    border-radius: 0.35rem;
    height: 2rem;
    width: 2rem;
}

.politician-trades-stock-logo.app-symbol-icon-has-logo,
.politician-trades-security-logo.app-symbol-icon-has-logo {
    background: transparent;
    border-color: transparent;
}

.politician-trades-stock-copy {
    display: grid;
    min-width: 0;
}

.politician-trades-stock-copy strong {
    color: var(--text-strong);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.88rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.politician-trades-party-row {
    align-items: center;
    display: grid;
    gap: 0.6rem;
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    min-height: 12.3rem;
    padding: 1.25rem 0.75rem;
    text-align: center;
}

.politician-trades-party-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.politician-trades-party-row .politician-trades-avatar {
    flex-basis: 5.25rem;
    height: 5.25rem;
    width: 5.25rem;
}

.politician-trades-party-row .politician-trades-leader-person {
    justify-items: center;
    text-align: center;
}

.politician-trades-party-row .politician-trades-leader-person strong {
    font-size: 1rem;
}

.politician-trades-party-row .politician-trades-leader-person span {
    font-size: 0.82rem;
    margin-top: 0.25rem;
}

.politician-trades-party-row .politician-trades-leader-count {
    font-size: 0.95rem;
    padding-left: 0;
}

.politician-trades-party-list .politician-trades-leader-loading,
.politician-trades-party-list .politician-trades-leader-empty {
    grid-column: 1 / -1;
}

.politician-trades-rank,
.politician-trades-leader-count {
    color: var(--text-muted);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
}

.politician-trades-leader-count {
    color: var(--text-strong);
}

.politician-trades-leader-person {
    display: grid;
    min-width: 0;
}

.politician-trades-leader-person strong {
    color: var(--text-strong);
    font-size: 0.86rem;
    line-height: 1.25;
}

.politician-trades-leader-person span {
    color: var(--text-muted);
    font-size: 0.72rem;
    margin-top: 0.15rem;
}

.politician-trades-leader-loading,
.politician-trades-leader-empty {
    align-items: center;
    color: var(--text-muted);
    display: flex;
    gap: 0.65rem;
    justify-content: center;
    min-height: 8rem;
    padding: 1rem;
}

.politician-trades-avatar {
    align-items: center;
    background: color-mix(in srgb, var(--green) 14%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--green) 28%, var(--border-soft));
    border-radius: 50%;
    color: var(--green);
    display: inline-flex;
    flex: 0 0 2.35rem;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.68rem;
    font-weight: 700;
    height: 2.35rem;
    justify-content: center;
    overflow: hidden;
    position: relative;
    width: 2.35rem;
}

.politician-trades-avatar img {
    height: 100%;
    inset: 0;
    object-fit: cover;
    position: absolute;
    width: 100%;
}

.politician-trades-avatar.is-democratic {
    background: color-mix(in srgb, #3b82f6 14%, var(--surface));
    border: 2px solid #3b82f6;
    color: #60a5fa;
}

.politician-trades-avatar.is-republican {
    background: color-mix(in srgb, #ef4444 14%, var(--surface));
    border: 2px solid #ef4444;
    color: #f87171;
}

.politician-trades-avatar.is-independent {
    background: color-mix(in srgb, #e2e8f0 12%, var(--surface));
    border: 2px solid #d7dee8;
    color: #e2e8f0;
}

.politician-trades-person {
    align-items: center;
    display: flex;
    gap: 0.7rem;
    min-width: 0;
}

.politician-trades-person > span:last-child,
.politician-trades-security-copy {
    display: grid;
    min-width: 0;
}

.politician-trades-security {
    align-items: center;
    display: flex;
    gap: 0.7rem;
    min-width: 0;
}

.politician-trades-security-logo,
.politician-trades-security-logo.app-symbol-icon-has-logo {
    border-radius: 0.45rem;
    flex: 0 0 2.25rem;
    height: 2.25rem;
    width: 2.25rem;
}

.politician-trades-person-meta {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.politician-trades-chamber-pill {
    font-size: 0.62rem;
    min-height: 1.2rem;
    padding: 0.05rem 0.35rem;
}

.politician-trades-filter-form label {
    color: var(--text-muted);
    display: grid;
    font-size: 0.76rem;
    font-weight: 600;
    gap: 0.35rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.politician-trades-filter-form .app-field {
    min-height: 2.6rem;
    width: 100%;
}

.politician-trades-filter-button {
    min-height: 2.6rem;
    white-space: nowrap;
}

.politician-trades-results {
    min-width: 0;
    overflow: hidden;
}

.politician-trades-results-header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    padding: 1rem;
}

.politician-trades-results-header h2,
.politician-trades-results-header p {
    margin: 0;
}

.politician-trades-results-header h2 {
    color: var(--text-strong);
    font-size: 1.05rem;
    font-weight: 650;
}

.politician-trades-results-header p {
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-top: 0.2rem;
}

.politician-trades-table {
    --app-table-equal-column-width: 9.333333%;
    --app-table-body-padding-block: 0.65rem;
    --app-table-body-padding-inline: 0.7rem;
    --app-table-header-padding-block: 0.6rem;
    --app-table-header-padding-inline: 0.7rem;
    min-width: 0;
}

.politician-trades-col-politician {
    width: 20%;
}

.politician-trades-col-security {
    width: 24%;
}

.politician-trades-results .app-table-scroll {
    max-height: 36rem;
    overflow: auto;
}

.politician-trades-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
}

.politician-trades-table td {
    vertical-align: middle;
    white-space: normal;
}

.politician-trades-table td:nth-child(n + 3) {
    white-space: nowrap;
}

.politician-trades-delay .politician-trades-secondary {
    margin-top: 0.05rem;
}

.politician-trades-secondary {
    display: block;
    line-height: 1.35;
    margin-top: 0.2rem;
    max-width: 16rem;
}

.politician-trades-security .politician-trades-secondary {
    display: -webkit-box;
    margin-top: 0.25rem;
    max-width: none;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.politician-trades-symbol {
    color: var(--green);
    font-family: "JetBrains Mono", monospace;
    font-weight: 600;
    text-decoration: none;
}

.politician-trades-symbol:hover {
    text-decoration: underline;
}

.politician-trades-table .politician-trades-metric {
    font-variant-numeric: tabular-nums;
}

.politician-trades-empty {
    color: var(--text-muted);
    padding: 2.5rem 1rem !important;
    text-align: center;
}

.politician-trades-infinite-status {
    align-items: center;
    border-top: 1px solid var(--border-soft);
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    min-height: 3.75rem;
    padding: 0.85rem 1rem;
    text-align: center;
}

.politician-trades-infinite-status[hidden] {
    display: none;
}

@media (max-width: 1280px) {
    .politician-trades-filter-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .politician-trades-filter-form label:first-child {
        grid-column: 1 / -1;
    }

    .politician-trades-filter-button {
        justify-self: start;
        min-width: 10rem;
    }
}

@media (max-width: 1180px) {
    .politician-trades-rail .politician-trades-leader-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .politician-trades-rail .politician-trades-leader-row,
    .politician-trades-rail .politician-trades-leader-row:nth-child(5n) {
        border-bottom: 1px solid var(--border-soft);
        border-right: 1px solid var(--border-soft);
        border-top: 0;
    }

    .politician-trades-rail .politician-trades-leader-row:nth-child(2n) {
        border-right: 0;
    }

    .politician-trades-rail .politician-trades-leader-row:nth-last-child(-n + 2) {
        border-bottom: 0;
    }
}

@media (max-width: 1000px) {
    .politician-trades-top-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1000px) {
    .politician-trades-results .app-table-scroll {
        padding: 0.75rem;
    }

    .politician-trades-table,
    .politician-trades-table tbody {
        display: block;
        min-width: 0;
        width: 100%;
    }

    .politician-trades-table colgroup,
    .politician-trades-table thead {
        display: none;
    }

    .politician-trades-table tbody {
        display: grid;
        gap: 0.75rem;
    }

    .politician-trades-table tbody tr {
        background: var(--surface-soft);
        border: 1px solid var(--border-soft);
        border-radius: 0.55rem;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        overflow: hidden;
    }

    .politician-trades-table td {
        border-bottom: 0;
        min-width: 0;
        padding: 0.7rem 0.8rem;
        white-space: normal !important;
    }

    .politician-trades-table .app-table-cell-center {
        text-align: left;
    }

    .politician-trades-table td::before {
        color: var(--text-muted);
        content: attr(data-label);
        display: block;
        font-size: var(--app-table-secondary-font-size);
        font-weight: 700;
        letter-spacing: 0.07em;
        margin-bottom: 0.4rem;
        text-transform: uppercase;
    }

    .politician-trades-table td:nth-child(1),
    .politician-trades-table td:nth-child(2),
    .politician-trades-table td[colspan] {
        border-bottom: 1px solid var(--border-soft);
        grid-column: 1 / -1;
    }

    .politician-trades-table td[colspan]::before {
        display: none;
    }

    .politician-trades-table td:nth-child(n + 3) strong {
        font-size: var(--app-table-body-font-size);
    }

    .politician-trades-infinite-status {
        margin: 0 -0.75rem -0.75rem;
    }
}

@media (max-width: 640px) {
    .politician-trades-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .politician-trades-updated {
        padding-top: 0;
        text-align: left;
    }

    .politician-trades-filter-form {
        grid-template-columns: 1fr;
    }

    .politician-trades-filter-form label:first-child {
        grid-column: auto;
    }

    .politician-trades-filter-button {
        justify-self: stretch;
        width: 100%;
    }

    .politician-trades-rail .politician-trades-leader-list,
    .politician-trades-table tbody tr {
        grid-template-columns: 1fr;
    }

    .politician-trades-rail .politician-trades-leader-row,
    .politician-trades-rail .politician-trades-leader-row:nth-child(2n),
    .politician-trades-rail .politician-trades-leader-row:nth-last-child(-n + 2) {
        border-bottom: 1px solid var(--border-soft);
        border-right: 0;
    }

    .politician-trades-rail .politician-trades-leader-row:last-child {
        border-bottom: 0;
    }
}

/* Trade Journal inside the reusable left-navigation workspace. Layout only:
   panels, tables, stat cards, and status pills are shared primitives, so
   light/dark is inherited from the palette variables rather than re-solved. */
.journal-dashboard {
    --danger: var(--red);
    --font-sans: "Source Sans 3", "Segoe UI", sans-serif;
    --text-muted: var(--muted);
}

.journal-panel {
    align-content: start;
    display: grid;
    gap: 0.75rem;
    min-width: 0;
    padding: 0.8rem;
}

/* A header may carry an action beside its text. With one child this is
   identical to the block it replaces, so the existing panels are unchanged. */
.journal-panel-header {
    align-items: start;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: space-between;
}

.journal-panel-header h2 {
    font-size: 1rem;
    margin: 0;
}

.journal-panel-header p {
    color: var(--text-muted);
    font-size: 0.78rem;
    margin: 0.25rem 0 0;
}

.journal-positions-scroll[hidden] {
    display: none;
}

.journal-positions-table {
    --app-table-equal-column-width: calc(100% / 7);
}

.journal-entries-table {
    --app-table-equal-column-width: calc(100% / 9);
    min-width: 1200px;
}

.journal-positions-table th,
.journal-positions-table td,
.journal-entries-table th,
.journal-entries-table td {
    padding: 0.6rem 0.7rem;
}

.journal-entries-table td:nth-child(7),
.journal-entries-table td:nth-child(8),
.journal-entries-table td:nth-child(9) {
    overflow-wrap: anywhere;
    white-space: normal;
}

.journal-entries-table .journal-row-actions,
.journal-entries-table .journal-row-confirmation {
    justify-content: center;
}

.journal-entries-table .journal-button {
    font-size: 0.78rem;
    min-height: 2rem;
    padding: 0.45rem 0.6rem;
}

.journal-symbol-cell {
    font-family: "JetBrains Mono", monospace;
    font-weight: 600;
}

.journal-symbol {
    align-items: center;
    display: inline-flex;
    gap: 0.6rem;
}

.journal-symbol-text {
    white-space: nowrap;
}

.journal-symbol-icon,
.journal-symbol-icon.app-symbol-icon-has-logo {
    border-radius: 0.3rem;
    height: 1.75rem;
    width: 1.75rem;
}

.journal-status-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: center;
}

.journal-empty {
    border: 1px dashed var(--border);
    border-radius: 0.55rem;
    display: grid;
    gap: 0.5rem;
    justify-items: start;
    padding: 1.5rem;
}

/* A class that sets display outranks the user-agent [hidden] rule, so the
   empty state needs this to disappear once the first trade is recorded. Same
   reason .journal-positions-scroll[hidden] exists below. */
.journal-empty[hidden] {
    display: none;
}

.journal-empty h3 {
    font-size: 1rem;
    margin: 0;
}

.journal-empty p {
    color: var(--text-muted);
    margin: 0;
    max-width: 46rem;
}

.journal-basis-note {
    border-radius: 0.5rem;
    font-size: 0.85rem;
    margin: 0;
    padding: 0.7rem 0.85rem;
}

.journal-realized-grid {
    display: grid;
    gap: 0.85rem;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
}

/* Owner-approved compact Trade Journal workspace. */
#journal-dashboard { container-type: inline-size; gap: 0.85rem; }
#journal-dashboard .journal-panel { min-width: 0; padding: 0.8rem; gap: 0.75rem; }
#journal-dashboard .journal-panel-header { align-items: center; }
#journal-dashboard .journal-realized-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#journal-dashboard .journal-button { font-size: 0.78rem; text-decoration: none; }
#journal-dashboard .journal-button.is-danger { color: var(--red); border-color: var(--red); }
#journal-dashboard .journal-table { --app-table-body-padding-block: 0.55rem; --app-table-body-padding-inline: 0.35rem; --app-table-header-padding-block: 0.6rem; --app-table-header-padding-inline: 0.35rem; }
#journal-dashboard .journal-positions-table { --app-table-body-padding-block: 0.8rem; min-width: 52rem; }
#journal-dashboard .journal-entries-table { min-width: 68rem; }
#journal-dashboard .journal-row-actions .journal-button { min-height: 1.7rem; padding: 0.25rem 0.55rem; }
#journal-dashboard [data-tone="positive"] { color: var(--green); }
#journal-dashboard [data-tone="negative"] { color: var(--red); }
.journal-count { border: 1px solid var(--border); border-radius: 0.25rem; color: var(--muted-strong); font-size: 0.72rem; padding: 0.15rem 0.4rem; white-space: nowrap; }
.journal-heading-with-count { display: flex; align-items: center; gap: 0.75rem; }
#journal-dashboard .journal-entries-toolbar .journal-entries-filter { align-items: center; margin-left: auto; flex-wrap: nowrap; }
#journal-dashboard .journal-entries-toolbar .journal-field { flex: 0 1 15rem; width: 15rem; }
.journal-entries-toolbar .journal-button { min-height: 2.2rem; padding: 0.4rem 0.65rem; }
.journal-entries-toolbar .app-field { height: 2.2rem; }
#journal-dashboard .journal-entries-pager .app-inline-feedback { margin-right: auto; font-size: 0.78rem; }
.journal-recorded-source { color: var(--muted-strong); font-size: 0.78rem; }
.journal-method { padding: 0.8rem; color: var(--muted-strong); font-size: 0.78rem; }
.journal-method summary { cursor: pointer; font-weight: 600; }
.journal-method summary:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.journal-method .journal-basis-note,
.journal-method p { margin: 0.75rem 0 0; padding: 0; }
@container (max-width: 50rem) {
    #journal-dashboard .journal-entries-toolbar .journal-entries-filter { margin-left: 0; width: 100%; flex-wrap: wrap; }
    #journal-dashboard .journal-entries-toolbar .journal-field { flex: 1 1 100%; width: 100%; }
}
@container (max-width: 28rem) {
    #journal-dashboard .journal-realized-grid { grid-template-columns: 1fr; }
}

/* Match the Sectors typography scale across the journal workspace. */
:is(#journal-dashboard, #journal-analytics-dashboard, #journal-import) .app-stat-value {
    font-size: 1.2rem;
    margin-top: 0.16rem;
}

:is(#journal-dashboard, #journal-analytics-dashboard, #journal-import) .app-stat-card {
    justify-content: center;
    min-height: 4.4rem;
    padding: 0.55rem 0.7rem;
}

:is(#journal-dashboard, #journal-analytics-dashboard, #journal-import) .journal-panel-header h2 {
    font-size: 1.05rem;
}

:is(#journal-dashboard, #journal-analytics-dashboard, #journal-import) .journal-panel-header p,
:is(#journal-dashboard, #journal-analytics-dashboard, #journal-import) .journal-basis-note {
    font-size: 0.82rem;
}

.journal-entry-form {
    display: grid;
    gap: 0.85rem 1rem;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
}

.journal-field {
    display: grid;
    gap: 0.3rem;
    min-width: 0;
}

.journal-field .app-field {
    min-width: 0;
    width: 100%;
}

.journal-field-wide {
    grid-column: 1 / -1;
}

.journal-field-note {
    width: 100%;
}

.journal-field-optional {
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
}

.journal-field-error:empty {
    display: none;
}

.journal-entry-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    grid-column: 1 / -1;
}

.journal-entry-feedback:empty {
    display: none;
}

/* The entry panel follows its available content width, including an open sidebar. */
.journal-entry {
    container-type: inline-size;
}

.journal-entry-form--compact {
    align-items: start;
    gap: 1.25rem 1rem;
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.journal-entry-form--compact .journal-field {
    align-content: start;
}

.journal-entry-form--compact .app-field-label {
    line-height: 1rem;
    margin: 0;
}

.journal-entry-form--compact .app-field {
    height: 2.45rem;
}

.journal-entry-form--compact .journal-entry-note {
    grid-column: span 4;
}

.journal-entry-form--compact .journal-entry-actions {
    display: grid;
    gap: 0.3rem;
    grid-column: auto;
    grid-template-rows: 1rem 2.45rem;
}

.journal-entry-form--compact .journal-entry-actions .journal-button {
    grid-row: 2;
    height: 2.45rem;
    width: 100%;
}

.journal-entry-form--compact .journal-entry-time-hint,
.journal-entry-form--compact .journal-entry-feedback {
    grid-column: 1 / -1;
    margin: 0;
}

.journal-time-info {
    margin-left: 0.25rem;
}

@container (max-width: 64rem) {
    .journal-entry-form--compact {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .journal-entry-form--compact .journal-entry-note {
        grid-column: span 2;
    }

    .journal-entry-form--compact .journal-entry-actions {
        grid-column: 3;
        grid-template-rows: auto;
    }

    .journal-entry-form--compact .journal-entry-actions .journal-button {
        grid-row: auto;
    }
}

@container (max-width: 38rem) {
    .journal-entry-form--compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .journal-entry-form--compact .journal-entry-note,
    .journal-entry-form--compact .journal-entry-actions {
        grid-column: 1 / -1;
    }
}

@container (max-width: 26rem) {
    .journal-entry-form--compact {
        grid-template-columns: minmax(0, 1fr);
    }
}

.journal-button {
    align-items: center;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 0.45rem;
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    font: 700 0.78rem/1 var(--font-sans);
    justify-content: center;
    min-height: 2.45rem;
    padding: 0.65rem 0.85rem;
    text-decoration: none;
}

.journal-button.is-primary {
    background: transparent;
    border-color: var(--green);
    color: var(--green);
}

.journal-button.is-primary:hover,
.journal-button.is-primary:focus-visible {
    background: color-mix(in srgb, var(--green) 10%, transparent);
}

.journal-button:disabled {
    cursor: not-allowed;
    opacity: 0.48;
}

/* entitlements.js hides the import link by setting `hidden` on the anchor. The
   Options link stayed visible for months because .home-sidebar-link set display
   and outranked the user-agent [hidden] rule; nothing sets display here, but a
   gated destination that fails to disappear is the same defect either way. */
.journal-button[hidden] {
    display: none;
}

/* The guide's import cards, section, and contents link, which do set display. */
[data-import-surface][hidden] {
    display: none;
}

/* The trades panel. Layout only: the provenance pills reuse .app-status-pill
   and the row confirmation reuses the saved-screener delete pattern, so neither
   adds geometry of its own. */
.journal-entries-filter {
    align-items: end;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.journal-entries-filter .journal-field {
    flex: 1 1 12rem;
    min-width: 0;
}

.journal-entries-pager {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.journal-entries-pager .app-inline-feedback {
    margin: 0;
}

.journal-entry-editor {
    align-items: end;
    display: grid;
    gap: 0.6rem 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
}

.journal-row-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

/* Same shape as .stock-screener-delete-confirmation, per row rather than per
   page, because this table has many rows and one selection would be a lie. */
.journal-row-confirmation {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.journal-row-confirmation[hidden],
.journal-row-actions[hidden] {
    display: none;
}

/* Per-row pricing age. Layout only — no new pill or badge geometry; the price
   and when it was observed are one fact sharing one cell. Tokens are limited to
   ones :root or .journal-dashboard actually declares, because a custom property
   scoped to another component resolves to nothing and paints nothing. */
.journal-price-cell {
    white-space: nowrap;
}

.journal-price-amount {
    display: block;
}

.journal-priced-at {
    display: block;
    margin-top: 0.15rem;
}

/* A button, because `title` alone is invisible on touch and unreachable by
   keyboard. It carries no button chrome: the dotted underline is the only
   affordance, so the row reads as data rather than as a row of controls. */
.journal-priced-age {
    background: none;
    border: 0;
    border-bottom: 1px dotted var(--border);
    color: var(--muted-strong);
    cursor: pointer;
    font: 400 0.74rem/1.3 var(--font-sans);
    padding: 0;
}

.journal-priced-age:hover,
.journal-priced-age:focus-visible {
    color: var(--text);
    border-bottom-style: solid;
}

.journal-priced-exact {
    color: var(--muted-strong);
    display: block;
    font: 400 0.72rem/1.3 var(--font-sans);
    margin-top: 0.15rem;
}

.journal-priced-exact[hidden] {
    display: none;
}

/* Journal analytics. Compact cards use the shared panel, table and stat primitives. */
#journal-analytics-dashboard {
    container-type: inline-size;
    gap: 0.85rem;
}
#journal-analytics-dashboard .journal-panel {
    align-content: start;
    gap: 0.6rem;
    min-width: 0;
    padding: 0.8rem;
}
:is(#journal-dashboard, #journal-analytics-dashboard, #journal-import) .signals-ai-heading-actions {
    gap: 2.5rem;
}

.journal-analytics-back,
.sector-back-link {
    color: var(--muted-strong);
    font-size: 1rem;
    font-weight: 400;
    text-decoration: none;
    white-space: nowrap;
}
.journal-analytics-range {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}
.journal-analytics-range h2 {
    font-size: 1.05rem;
    margin: 0;
}
.journal-analytics-range .journal-field {
    align-items: center;
    display: flex;
    gap: 0.6rem;
}
.journal-analytics-range .journal-field:first-of-type { margin-left: auto; }
.journal-analytics-range label { font-size: 0.82rem; margin: 0; }
.journal-analytics-range .app-field { width: 10rem; }
.journal-analytics-toolbar .journal-field-error:empty { display: none; }
#journal-analytics-dashboard .journal-button { font-size: 0.78rem; }
.journal-analytics-insights,
.journal-analytics-breakdowns { display: grid; gap: 0.85rem; align-items: start; }
.journal-analytics-insights { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; }
.journal-analytics-breakdowns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.journal-analytics-stat-detail { color: var(--muted-strong); font-size: 0.72rem; line-height: 1.3; }
#journal-analytics-dashboard .app-table { --app-table-body-padding-block: 0.55rem; --app-table-body-padding-inline: 0.35rem; --app-table-header-padding-block: 0.55rem; --app-table-header-padding-inline: 0.35rem; }
#journal-analytics-dashboard .app-table th { white-space: normal; }
#journal-analytics-dashboard .app-table td { white-space: nowrap; }
.journal-analytics-outcomes-table { --app-table-equal-column-width: calc(100% / 3); min-width: 0; }
.journal-analytics-holding-table { min-width: 0; }
.journal-analytics-symbol-table { --app-table-equal-column-width: calc(100% / 6); min-width: 30rem; }
.journal-analytics-month-table,
.journal-analytics-curve-table { --app-table-equal-column-width: 25%; min-width: 25rem; }
#journal-analytics-dashboard [data-tone="positive"] { color: var(--green); }
#journal-analytics-dashboard [data-tone="negative"] { color: var(--red); }
.journal-analytics-chart-wrap { display: flex; gap: 0.5rem; min-width: 0; }
.journal-analytics-chart-axis { display: flex; flex-direction: column; justify-content: space-between; font-size: 0.82rem; color: var(--muted-strong); padding: 0.45rem 0; }
.journal-analytics-chart-dates { display: flex; justify-content: space-between; gap: 0.5rem; color: var(--muted-strong); font-size: 0.72rem; }
.journal-analytics-chart-dates > :only-child { margin-inline: auto; }
.journal-analytics-daily { min-width: 0; }
.journal-analytics-daily summary,
.journal-analytics-method summary { cursor: pointer; font-size: 0.78rem; color: var(--muted-strong); }
.journal-analytics-daily[open] .app-table-scroll { margin-top: 0.6rem; }
.journal-analytics-method { padding: 0.8rem; }
.journal-analytics-method-copy { font-size: 0.78rem; color: var(--muted-strong); line-height: 1.5; }
.journal-analytics-method-copy p { margin: 0.7rem 0; }
.journal-analytics-method summary:focus-visible,
.journal-analytics-daily summary:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
#journal-analytics-dashboard #journal-analytics-holding-body td { border: 0; padding-block: 0.3rem; }
#journal-analytics-holding-body td:first-child { width: 8rem; }
#journal-analytics-holding-body td:nth-child(2) { width: 2rem; }
.journal-analytics-bar-track { display: inline-block; flex: 1; background: var(--border); border-radius: 0.2rem; height: 0.45rem; }
#journal-analytics-holding-body .journal-analytics-bar-cell { display: flex; align-items: center; gap: 0.5rem; min-width: 6rem; }
#journal-analytics-holding-body .journal-analytics-bar-label { width: 2.6rem; text-align: right; }
@container (max-width: 64rem) {
    .journal-analytics-insights { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .journal-analytics-insights > :last-child { grid-column: 1 / -1; }
    .journal-analytics-breakdowns { grid-template-columns: 1fr; }
}
@container (max-width: 44rem) {
    .journal-analytics-insights { grid-template-columns: 1fr; }
    .journal-analytics-range .journal-field:first-of-type { margin-left: 0; }
    .journal-analytics-range .journal-field { flex: 1 1 40%; flex-direction: column; align-items: stretch; }
    .journal-analytics-range .app-field { width: 100%; min-width: 0; }
    .journal-analytics-range h2 { flex-basis: 60%; }
    #journal-analytics-dashboard .journal-analytics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.journal-analytics-results {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

/* .journal-panel is display:grid and .app-loading-state is display:flex, and
   both outrank the user-agent [hidden] rule — so without these, setting
   `.hidden = true` marks the elements without hiding them and the page renders
   its own empty state and spinner underneath a full report. The same trap is
   documented on .home-sidebar-link above; it is invisible to any spec that
   reads the markup as text, because the markup is correct. */
.journal-analytics-results[hidden],
#journal-analytics-empty[hidden],
#journal-analytics-loading[hidden] {
    display: none;
}

.journal-analytics-grid {
    margin: 0;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
}

.journal-analytics-disclosures {
    color: var(--muted-strong);
    display: flex;
    flex-direction: column;
    font: 400 0.82rem/1.5 var(--font-sans);
    gap: 0.35rem;
    list-style: disc;
    margin: 1rem 0 0;
    padding-left: 1.1rem;
}

.journal-analytics-curve {
    margin: 0;
    flex: 1;
    min-width: 0;
}

/* Scaled by width, drawn in viewBox units. preserveAspectRatio is none on the
   element, so the curve fills whatever width it is given. */
.journal-analytics-curve-chart {
    color: var(--green);
    display: block;
    height: 7rem;
    width: 100%;
}

.journal-analytics-curve-baseline {
    stroke: var(--border);
    stroke-dasharray: 4 4;
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
}

.journal-analytics-curve-line {
    fill: none;
    stroke: currentColor;
    stroke-linecap: square;
    stroke-linejoin: miter;
    stroke-width: 2;
    /* The horizontal runs and the vertical jumps must read at the same weight
       however far the viewBox is stretched, or a wide screen thins the steps
       into nothing. */
    vector-effect: non-scaling-stroke;
}

.journal-analytics-curve-point {
    fill: currentColor;
    vector-effect: non-scaling-stroke;
}

.journal-analytics-bar-cell {
    min-width: 9rem;
}

.journal-analytics-bar {
    background: var(--green);
    border-radius: 0.2rem;
    display: inline-block;
    height: 100%;
    vertical-align: top;
    width: var(--journal-analytics-bar-share, 0%);
}

/* Deliberately no font-family: the label carries .app-table-cell-numeric so the
   monospace and tabular figures come from the shared primitive. --font-mono is
   declared under .stock-screener-dashboard and never under .journal-dashboard,
   so naming it here resolved to nothing and the label quietly rendered in the
   body font while every figure beside it was monospaced. */
.journal-analytics-bar-label {
    color: var(--muted-strong);
    font-weight: 500;
}

/* CSV import. Layout only — the verdict pills reuse .app-status-pill and add no
   geometry of their own. Skipped rows are collapsed because a real broker
   export is full of them and they would otherwise bury the trades. */
#journal-import { container-type: inline-size; gap: 0.85rem; }
#journal-import [hidden] { display: none !important; }
#journal-import .journal-panel { grid-template-columns: minmax(0, 1fr); }
.journal-import-start { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(18rem, 1fr); gap: 0.85rem; }
.journal-import-file-picker { background: var(--control-bg); border: 1px dashed var(--control-border); border-radius: 0.45rem; justify-items: center; padding: 1.25rem; text-align: center; }
.journal-import-file-picker > svg { color: var(--green); fill: none; height: 1.6rem; margin-bottom: 0.25rem; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.5; width: 1.6rem; }
.journal-import-file-picker > label { font-size: 0.95rem; font-weight: 600; margin: 0; }
#journal-import .app-inline-feedback { font-size: 0.82rem; margin: 0; }
#journal-import-file { background: transparent; border: 0; font-family: var(--font-sans); font-size: 0.8rem; height: auto; margin-top: 0.65rem; max-width: 25rem; padding: 0.25rem; }
#journal-import-file::file-selector-button { background: var(--surface-soft); border: 1px solid var(--border); border-radius: 0.35rem; color: var(--text); cursor: pointer; font: 600 0.78rem var(--font-sans); margin-right: 0.6rem; padding: 0.55rem 0.7rem; }
.journal-import-guide-list { counter-reset: import-guide; display: grid; gap: 0.85rem; list-style: none; margin: 0.25rem 0; padding: 0; }
.journal-import-guide-list li { counter-increment: import-guide; font-size: 0.86rem; padding-left: 2rem; position: relative; }
.journal-import-guide-list li::before { align-items: center; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 50%; color: var(--muted-strong); content: counter(import-guide); display: flex; font-size: 0.7rem; height: 1.35rem; justify-content: center; left: 0; position: absolute; top: 0.05rem; width: 1.35rem; }
.journal-import-guide-list strong { font-weight: 600; }
.journal-import-guide-list p { color: var(--muted); font-size: 0.82rem; line-height: 1.5; margin: 0.2rem 0 0; }
.journal-import-date-note { background: var(--surface-soft); border-left: 2px solid var(--green); color: var(--muted-strong); font-size: 0.82rem; margin: 0; padding: 0.55rem 0.75rem; }
#journal-import-mapping-form { grid-template-columns: repeat(4, minmax(0, 1fr)); }
#journal-import .journal-entry-form { align-items: start; }
#journal-import .app-field-label { font-size: 0.67rem; }
#journal-import-actions-block { border-top: 1px solid var(--border-soft); padding-top: 0.75rem; }
#journal-import-actions-block h3 { font-size: 0.95rem; margin: 0 0 0.2rem; }
#journal-import-actions-form { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 0.65rem; }
#journal-import .journal-realized-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; }
#journal-import .journal-table { --app-table-body-padding-block: 0.65rem; --app-table-body-padding-inline: 0.45rem; --app-table-header-padding-block: 0.65rem; --app-table-header-padding-inline: 0.45rem; }
#journal-import .journal-table th { white-space: normal; }
#journal-import .journal-table td { overflow-wrap: anywhere; }
.journal-import-preview-table { min-width: 64rem; }
.journal-import-line-column { width: 4%; }
.journal-import-notes-column { width: 24%; }
.journal-import-history-table { min-width: 45rem; }
.journal-import-history-table th,
.journal-import-history-table td { text-align: center !important; }
#journal-import-commit-form { align-items: center; border-top: 1px solid var(--border-soft); grid-template-columns: minmax(0, 1fr) auto; padding-top: 0.8rem; }
#journal-import-commit-form .journal-field-wide { grid-column: auto; max-width: 30rem; }
#journal-import-commit-form .journal-entry-actions { grid-column: auto; justify-content: end; }
@container (max-width: 55rem) {
    .journal-import-start { grid-template-columns: 1fr; }
    .journal-import-guide-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    #journal-import-mapping-form,
    #journal-import-actions-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container (max-width: 32rem) {
    .journal-import-guide-list,
    #journal-import-mapping-form,
    #journal-import-actions-form,
    #journal-import .journal-realized-grid,
    #journal-import-commit-form { grid-template-columns: 1fr; }
    #journal-import-commit-form .journal-entry-actions { justify-content: start; }
}

#journal-import-skipped-block {
    min-width: 0;
    background: var(--surface-soft);
    border: 1px solid var(--border-soft);
    border-radius: 0.45rem;
    padding: 0.65rem 0.85rem;
}

#journal-import-skipped-block > summary {
    color: var(--muted-strong);
    cursor: pointer;
    font: 700 0.82rem/1.4 var(--font-sans);
}

#journal-import-skipped-block > summary:focus-visible {
    outline: 2px solid var(--green);
    outline-offset: 2px;
}

#journal-import-rows-body td .app-inline-feedback {
    margin: 0 0 0.2rem;
}

#journal-import-rows-body td .app-inline-feedback:last-child {
    margin-bottom: 0;
}

/* Primary auth is intentionally last so the current product palette wins over legacy form rules. */
body.auth-page.auth-page-sign-in,
body.auth-page.auth-page-registration {
    --bg: #080b0f;
    --surface: #11161b;
    --surface-soft: #161b21;
    --border: #29313a;
    --border-soft: #232a32;
    --text: #f1f4f7;
    --muted: #9da7b1;
    --muted-strong: #d6dce2;
    --green: #4fbe72;
    --red: #f0445e;
    --control-bg: #0d1217;
    --control-bg-focus: #10161c;
    --control-border: #34404a;
    --control-text: #f8fafc;
    background: var(--bg);
    color: var(--text);
    color-scheme: dark;
    font-family: "Source Sans 3", "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.4;
}

body.auth-page:is(.auth-page-sign-in, .auth-page-registration) .auth-brand {
    gap: 0.6rem;
}

body.auth-page:is(.auth-page-sign-in, .auth-page-registration) .auth-brand img {
    height: 2.25rem;
}

body.auth-page:is(.auth-page-sign-in, .auth-page-registration) .auth-brand .brand-wordmark {
    color: var(--text);
    font-family: "Source Sans 3", "Segoe UI", sans-serif;
    font-size: 2rem;
    font-weight: 600;
}

body.auth-page:is(.auth-page-sign-in, .auth-page-registration) .brand-logo-light {
    display: none;
}

body.auth-page:is(.auth-page-sign-in, .auth-page-registration) .brand-logo-dark {
    display: block;
}

body.auth-page:is(.auth-page-sign-in, .auth-page-registration) .auth-panel {
    background: var(--surface);
    border-color: var(--border);
    border-radius: 0.4rem;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.26);
}

body.auth-page:is(.auth-page-sign-in, .auth-page-registration) .page-heading h1 {
    color: var(--text);
    font-family: "Source Sans 3", "Segoe UI", sans-serif;
}

body.auth-page:is(.auth-page-sign-in, .auth-page-registration) .page-heading p,
body.auth-page:is(.auth-page-sign-in, .auth-page-registration) .auth-links {
    color: var(--muted);
}

body.auth-page:is(.auth-page-sign-in, .auth-page-registration) .auth-field label {
    color: var(--muted-strong);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

body.auth-page:is(.auth-page-sign-in, .auth-page-registration) .app-form .auth-field input {
    background: var(--control-bg);
    border-color: var(--control-border);
    border-radius: 0.35rem;
    color: var(--control-text);
}

body.auth-page:is(.auth-page-sign-in, .auth-page-registration) .app-form .auth-field input:focus {
    background: var(--control-bg-focus);
    border-color: var(--green) !important;
    box-shadow: 0 0 0 3px rgba(79, 190, 114, 0.16) !important;
}

body.auth-page:is(.auth-page-sign-in, .auth-page-registration) .app-form .auth-submit {
    background: transparent;
    border-color: var(--green);
    border-radius: 0.5rem;
    color: var(--green);
    min-height: 2.45rem;
}

body.auth-page:is(.auth-page-sign-in, .auth-page-registration) .app-form .auth-submit:hover {
    background: color-mix(in srgb, var(--green) 10%, transparent);
    color: var(--green);
}

body.auth-page.auth-page-registration .app-form .auth-submit {
    background: var(--green);
    color: #07100b;
    font-size: 0.85rem;
    font-weight: 700;
}

body.auth-page.auth-page-registration .app-form .auth-submit:hover {
    background: color-mix(in srgb, var(--green) 88%, white);
    color: #07100b;
}

body.auth-page:is(.auth-page-sign-in, .auth-page-registration) .auth-links a {
    color: var(--muted-strong);
    text-decoration-color: #56616b;
    text-underline-offset: 0.18em;
}

body.auth-page:is(.auth-page-sign-in, .auth-page-registration) .auth-links a:hover {
    color: var(--green);
}

/* First-login setup */
.onboarding-page {
    min-height: 100vh;
}

.onboarding-utility {
    align-items: center;
    display: flex;
    justify-content: center;
    padding: 2.5rem 1.25rem 1.35rem;
}

.onboarding-brand {
    transform: translateX(-0.9375rem);
}

html.dark-mode .onboarding-brand .brand-logo-light {
    display: none;
}

html.dark-mode .onboarding-brand .brand-logo-dark {
    display: block;
}

.onboarding-shell {
    margin: 0 auto;
    max-width: 45.625rem;
    padding: 0 1.25rem 4rem;
}

.onboarding-progress {
    background: var(--surface-soft);
    border-bottom: 1px solid var(--border-soft);
    display: grid;
    gap: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    list-style: none;
    margin: 0;
    padding: 0.95rem 1.5rem;
    position: relative;
}

.onboarding-progress::before {
    background: var(--border);
    content: "";
    height: 1px;
    left: 50%;
    position: absolute;
    top: 50%;
    transform: translateX(-50%);
    width: 4.375rem;
}

.onboarding-progress.is-second-step::before {
    background: var(--green);
}

.onboarding-progress li {
    align-items: center;
    color: var(--muted);
    display: flex;
    gap: 0.55rem;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.onboarding-progress li:last-child {
    justify-content: flex-end;
}

.onboarding-progress li > span {
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex;
    flex: 0 0 auto;
    font: 600 0.76rem/1 "JetBrains Mono", monospace;
    height: 1.7rem;
    justify-content: center;
    width: 1.7rem;
}

.onboarding-progress li strong {
    color: inherit;
    font-size: 0.88rem;
}

.onboarding-progress li.is-current,
.onboarding-progress li.is-complete {
    color: var(--text);
}

.onboarding-progress li.is-current > span,
.onboarding-progress li.is-complete > span {
    background: color-mix(in srgb, var(--green) 6%, var(--surface-soft));
    border-color: var(--green);
    color: var(--green);
}

.onboarding-panel {
    box-shadow: none;
    margin: 0 auto;
    max-width: 43.125rem;
    overflow: hidden;
    padding: 0;
}

.onboarding-panel-content {
    padding: 1.75rem 2rem 1.875rem;
}

.onboarding-step-heading {
    border-bottom: 1px solid var(--border-soft);
    display: grid;
    gap: 0.4rem;
    margin-bottom: 1.45rem;
    padding-bottom: 1.35rem;
}

.onboarding-step-heading > span {
    color: var(--muted);
    font: 600 0.72rem/1.2 "JetBrains Mono", monospace;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.onboarding-step-heading h1 {
    color: var(--text);
    font-family: "Source Sans 3", "Segoe UI", sans-serif;
    font-size: 1.75rem;
    line-height: 1.15;
    margin: 0;
}

.onboarding-step-heading p {
    color: var(--muted);
    font-size: 1rem;
    margin: 0;
}

.onboarding-form,
.onboarding-field {
    display: grid;
    gap: 0.55rem;
}

.onboarding-form {
    gap: 1.45rem;
}

.onboarding-page .app-field-label,
.onboarding-symbol-fieldset legend {
    color: var(--text);
    font: 600 0.94rem/1.25 "Source Sans 3", "Segoe UI", sans-serif;
    letter-spacing: 0;
    text-transform: none;
}

.onboarding-page .app-field {
    background: var(--control-bg);
    border: 1px solid var(--control-border);
    border-radius: 0.4rem;
    color: var(--control-text);
    font: 500 0.94rem/1.3 "Source Sans 3", "Segoe UI", sans-serif;
    min-height: 2.9rem;
    padding: 0.65rem 0.75rem;
    width: 100%;
}

.onboarding-page .app-field:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 18%, transparent);
    outline: none;
}

.onboarding-symbol-fieldset,
.onboarding-trend-models {
    border: 0;
    margin: 0;
    padding: 0;
}

.onboarding-field-help {
    color: var(--muted);
    font-size: 0.86rem;
    margin: 0;
}

.onboarding-symbol-picker {
    display: grid;
    gap: 0.75rem;
}

.onboarding-symbol-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    min-height: 2.2rem;
}

.onboarding-symbol-chip {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.35rem;
    color: var(--muted-strong);
    display: inline-flex;
    font: 600 0.875rem/1 "Source Sans 3", "Segoe UI", sans-serif;
    gap: 0.35rem;
    min-height: 2.15rem;
    padding: 0.45rem 0.55rem;
}

.onboarding-symbol-chip button {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 50%;
    color: var(--muted);
    cursor: pointer;
    display: flex;
    font: 700 1rem/1 sans-serif;
    height: 1.25rem;
    justify-content: center;
    padding: 0;
    width: 1.25rem;
}

.onboarding-symbol-chip button:hover,
.onboarding-symbol-chip button:focus-visible {
    background: color-mix(in srgb, var(--red) 14%, transparent);
    color: var(--red);
    outline: none;
}

.onboarding-symbol-search {
    display: grid;
    gap: 0.5rem;
    grid-template-columns: minmax(0, 1fr) auto;
    position: relative;
}

.onboarding-add-symbol {
    min-width: 5rem;
}

.onboarding-symbol-results {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.4rem;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
    grid-column: 1;
    left: 0;
    max-height: 17rem;
    overflow-y: auto;
    position: absolute;
    right: 0;
    top: calc(100% + 0.3rem);
    z-index: 10;
}

.onboarding-symbol-result {
    align-items: center;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--border-soft);
    color: var(--text);
    cursor: pointer;
    display: grid;
    font: inherit;
    gap: 0.15rem 0.75rem;
    grid-template-columns: 4.5rem minmax(0, 1fr) auto;
    padding: 0.65rem 0.75rem;
    text-align: left;
    width: 100%;
}

.onboarding-symbol-result:last-child {
    border-bottom: 0;
}

.onboarding-symbol-result:hover,
.onboarding-symbol-result.is-active {
    background: var(--surface-soft);
}

.onboarding-symbol-result strong {
    font-family: "JetBrains Mono", monospace;
    grid-row: 1 / span 2;
}

.onboarding-symbol-result span,
.onboarding-symbol-result small,
.onboarding-symbol-result-empty {
    color: var(--muted);
    font-size: 0.78rem;
}

.onboarding-symbol-result small {
    text-align: right;
}

.onboarding-symbol-result-empty {
    padding: 0.75rem;
}

.onboarding-symbol-status {
    align-items: center;
    color: var(--muted);
    display: flex;
    font-size: 0.86rem;
    gap: 0.5rem;
    margin: 0;
    min-height: 1.15rem;
}

.onboarding-symbol-status::before {
    background: var(--green);
    border-radius: 50%;
    content: "";
    flex: 0 0 auto;
    height: 0.42rem;
    width: 0.42rem;
}

.onboarding-trend-guidance {
    color: var(--muted);
    font-size: 0.88rem;
    margin: 0 0 0.9rem;
}

.onboarding-trend-guidance strong {
    color: var(--text);
}

.onboarding-trend-models {
    display: grid;
    gap: 0.6rem;
}

.onboarding-trend-card {
    align-items: flex-start;
    background: var(--surface-soft);
    border: 1px solid var(--border-soft);
    border-radius: 0.5rem;
    cursor: pointer;
    display: grid;
    gap: 0.75rem;
    grid-template-columns: auto minmax(0, 1fr);
    padding: 0.95rem 1rem;
    transition: border-color 120ms ease, background-color 120ms ease, box-shadow 120ms ease;
}

.onboarding-trend-card:has(input:checked) {
    background: color-mix(in srgb, var(--green) 6%, var(--surface-soft));
    border-color: var(--green);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--green) 25%, transparent);
}

.onboarding-trend-card:focus-within {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 18%, transparent);
}

.onboarding-trend-card input {
    accent-color: var(--green);
    flex: 0 0 auto;
    height: 1rem;
    margin: 0.25rem 0 0;
    width: 1rem;
}

.onboarding-trend-copy {
    display: grid;
    gap: 0.35rem;
    min-width: 0;
}

.onboarding-trend-title {
    align-items: baseline;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.75rem;
}

.onboarding-trend-title strong {
    color: var(--text);
    font-size: 1rem;
}

.onboarding-trend-title > span {
    color: var(--muted);
    font: 600 1rem/1.2 "JetBrains Mono", monospace;
}

.onboarding-trend-description {
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.4;
}

.onboarding-trend-calculation {
    color: var(--muted);
    font-size: 0.8rem;
}

.onboarding-trend-calculation summary {
    color: var(--muted-strong);
    cursor: pointer;
    font-weight: 650;
}

.onboarding-trend-calculation > span {
    display: block;
    margin-top: 0.5rem;
}

.onboarding-actions {
    align-items: center;
    border-top: 1px solid var(--border-soft);
    display: flex;
    justify-content: space-between;
    margin-top: 0.35rem;
    padding-top: 1.35rem;
}

.onboarding-primary-action {
    min-width: 10rem;
}

.onboarding-secondary-action {
    color: var(--muted);
    font-size: 0.85rem;
    text-underline-offset: 0.2em;
}

.onboarding-secondary-action:hover,
.onboarding-secondary-action:focus-visible {
    color: var(--green);
}

.onboarding-save-note {
    color: var(--muted);
    font-size: 0.8rem;
    margin: 0;
}

.onboarding-errors {
    background: var(--red-soft);
    border: 1px solid color-mix(in srgb, var(--red) 45%, var(--border));
    border-radius: 0.45rem;
    color: var(--red);
    font-size: 0.82rem;
    margin-bottom: 1rem;
    padding: 0.75rem 0.85rem;
}

.onboarding-errors:focus {
    outline: 2px solid var(--red);
    outline-offset: 2px;
}

.onboarding-errors ul {
    margin: 0.35rem 0 0;
    padding-left: 1.15rem;
}

@media (max-width: 640px) {
    .onboarding-utility {
        padding: 1.5rem 0.85rem 1rem;
    }

    .onboarding-shell {
        padding: 0 0.75rem 2.25rem;
    }

    .onboarding-progress li {
        gap: 0.5rem;
    }

    .onboarding-progress {
        padding: 0.8rem 1rem;
    }

    .onboarding-progress::before {
        width: 1.625rem;
    }

    .onboarding-progress li strong {
        font-size: 0.8rem;
    }

    .onboarding-panel-content {
        padding: 1.5rem 1.2rem;
    }

    .onboarding-step-heading h1 {
        font-size: 1.55rem;
    }

    .onboarding-step-heading p {
        font-size: 0.94rem;
    }

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

    .onboarding-symbol-results {
        grid-column: 1;
        top: calc(2.65rem + 0.3rem);
    }

    .onboarding-add-symbol {
        width: 100%;
    }

    .onboarding-symbol-result {
        grid-template-columns: 3.8rem minmax(0, 1fr);
    }

    .onboarding-symbol-result small {
        display: none;
    }

    .onboarding-actions {
        align-items: stretch;
        flex-direction: column-reverse;
        gap: 0.9rem;
    }

    .onboarding-primary-action {
        min-width: 0;
        width: 100%;
    }

    .onboarding-secondary-action,
    .onboarding-save-note {
        text-align: center;
    }

    .onboarding-trend-title {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.2rem;
    }
}

@media (max-width: 560px) {
    .signals-ai-heading-actions {
        align-self: flex-start;
    }

    .signals-ai-trigger {
        padding: 0;
        width: 3rem;
    }

    .signals-ai-trigger-label {
        display: none;
    }
}

@media (max-width: 480px) {
    .signals-ai-drawer {
        height: calc(100dvh - 1rem);
        max-width: calc(100vw - 1rem);
        right: 0.5rem;
        top: 0.5rem;
        width: calc(100vw - 1rem);
    }
}

/* Adoption uses the shared Admin frame, panels, and compact summary cards. */
.admin-adoption-page .adoption-heading { align-items: center; }
.adoption-window { display: flex; align-items: center; gap: 0.75rem; margin: 0; }
.adoption-window label { color: var(--muted); font-size: 0.8rem; }
.adoption-window .app-field { width: 9rem; background-color: var(--surface); color: var(--text); border: 1px solid var(--border); }
body.dark-mode .adoption-window select.app-field { background-color: #2a2a2a; border-color: #3a3a3a; color: #d6d6d6; color-scheme: dark; }
.adoption-window .content-button { min-width: 5rem; }
.adoption-panel .admin-chart-tick { font-size: 14px; }
.adoption-failure-preview { table-layout: fixed; margin-top: 0.6rem; }
.adoption-failure-preview th:first-child { width: 50%; }
.adoption-failure-preview th:first-child span { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.adoption-band { margin-bottom: 1rem; }
.adoption-band .admin-provider-summary-grid { margin-bottom: 0; }
.adoption-band-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.25rem 1rem; margin-bottom: 0.5rem; }
.adoption-band-heading h2 { font-size: 1.05rem; margin: 0; }
.adoption-band-heading span { color: var(--muted); font-size: 0.8rem; }
.adoption-band .app-stat-value small { color: var(--muted); font-size: 0.55em; font-weight: 600; }
.adoption-definitions { color: var(--muted); font-size: 0.8rem; line-height: 1.55; }
.adoption-definitions strong { color: var(--text); }
.adoption-funnel { list-style: none; margin: 0.75rem 0 0.6rem; padding: 0; display: grid; gap: 0.45rem; }
.adoption-funnel li { display: grid; grid-template-columns: minmax(8rem, 12rem) minmax(0, 1fr) 4.5rem; gap: 0.6rem; align-items: center; font-size: 0.8rem; }
.adoption-funnel-bar { height: 1rem; background: var(--surface-soft); border: 1px solid var(--border-soft); border-radius: 0.25rem; overflow: hidden; }
.adoption-funnel-bar i { display: block; height: 100%; background: var(--green); opacity: 0.85; }
.adoption-funnel-count { text-align: right; font-variant-numeric: tabular-nums; }
.adoption-funnel-count small { display: block; color: var(--muted); font-size: 0.7rem; }
.adoption-attention { list-style: none; margin: 0; padding: 0; display: grid; }
.adoption-attention li { display: grid; grid-template-columns: 3rem minmax(0, 1fr) auto; align-items: center; gap: 0.75rem; padding: 0.55rem 0; border-top: 1px solid var(--border-soft); }
.adoption-attention li:first-child { border-top: 0; }
.adoption-attention-count { font-size: 1.35rem; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.adoption-attention-what { font-weight: 600; }
.adoption-attention .app-status-pill { margin-left: 0.35rem; }
.adoption-attention-rule { display: block; font-size: 0.78rem; color: var(--muted); }
.adoption-attention li > a, .adoption-attention li > .admin-secondary { font-size: 0.82rem; white-space: nowrap; }
.adoption-reach { display: inline-flex; align-items: center; justify-content: flex-end; gap: 0.45rem; }
.adoption-reach .adoption-funnel-bar { width: 4rem; height: 0.6rem; }
.adoption-table .app-stat-comparison { justify-content: flex-end; margin-top: 0; }
/* Shade rises with the share; the percentage is always printed, so colour is never the only cue. */
.admin-adoption-page .adoption-heat td { text-align: center; }
.adoption-heat td.adoption-heat-cell { background: color-mix(in srgb, var(--green) calc(var(--heat, 0) * 55%), transparent); }
/* Relative so the cell's .sr-only label stays inside the table's scroll box;
   an absolute child with no positioned ancestor widens the page on a phone. */
.adoption-heat td.adoption-heat-pending { position: relative; background: repeating-linear-gradient(135deg, transparent 0 4px, var(--border-soft) 4px 5px); }
.adoption-heat td.adoption-heat-empty { color: var(--muted); }
.adoption-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.85rem; }
.adoption-panel { min-width: 0; padding: 0.85rem 1rem; }
.adoption-wide { grid-column: 1 / -1; }
.adoption-panel .admin-section-heading { gap: 0.65rem; flex-wrap: wrap; }
.adoption-panel .admin-section-heading h2 { font-size: 1rem; }
.adoption-panel .admin-section-heading h3 { font-size: 0.85rem; margin: 0; }
.adoption-panel .app-table-wrap { border: 0; border-radius: 0; margin: 0; }
.adoption-table { min-width: 0; width: 100%; }
.admin-adoption-page .adoption-table th,
.admin-adoption-page .adoption-table td { padding: 0.45rem 0.35rem; font-size: 0.8rem; overflow-wrap: anywhere; }
.admin-adoption-page .adoption-table tbody th { background: transparent; font-weight: 400; text-transform: none; letter-spacing: normal; }
.adoption-table th:not(:first-child), .adoption-table td:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
/* Text columns after the first read left, like the first; numbers and dates stay right. */
.adoption-table th.adoption-text, .adoption-table td.adoption-text { text-align: left; font-variant-numeric: normal; }
.adoption-panel .admin-chart-figure { margin: 0.65rem 0 0; }
.adoption-registrations { display: flex; flex-direction: column; }
.adoption-registrations .admin-chart-figure { flex: 1; justify-content: center; }
.adoption-inline-stat { display: flex; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--border-soft); padding-top: 0.7rem; margin-top: 0.4rem; font-size: 0.78rem; color: var(--muted); }
.adoption-mini-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--border-soft); padding-top: 0.85rem; margin-bottom: 0.85rem; }
.adoption-mini-stats > div { display: grid; gap: 0.3rem; text-align: center; padding: 0 0.4rem; }
.adoption-mini-stats > div + div { border-left: 1px solid var(--border-soft); }
.adoption-mini-stats strong { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.adoption-mini-stats span { font-size: 0.8rem; color: var(--muted); }
.adoption-input-method { margin-top: 0.5rem; }
.adoption-input-method meter { width: 100%; height: 0.6rem; }
.adoption-input-method .adoption-inline-stat { border-top: 0; padding-top: 0.35rem; margin-top: 0; }
.adoption-input-method strong { font-variant-numeric: tabular-nums; color: var(--text); }
.adoption-details { margin-top: 0.85rem; color: var(--muted); font-size: 0.8rem; }
.adoption-details summary { cursor: pointer; width: fit-content; }
.adoption-details summary:focus-visible { outline: 2px solid var(--green); outline-offset: 4px; }
.adoption-details[open] summary { margin-bottom: 0.85rem; }
.adoption-details p { line-height: 1.55; }
.adoption-details .admin-section-heading { margin-top: 1rem; }
.adoption-delivery-summary { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.adoption-delivery-summary strong { font-size: 1.05rem; font-weight: 500; }
.adoption-delivery-summary .app-status-pill { margin-left: 0.35rem; }
.adoption-wide .app-status-pill { margin-left: 0.5rem; }
@media (max-width: 1000px) {
  .adoption-grid { grid-template-columns: minmax(0, 1fr); }
  .adoption-wide .adoption-table { min-width: 700px; }
}
@media (max-width: 600px) {
  .admin-adoption-page .adoption-heading { align-items: flex-start; gap: 1rem; }
  .adoption-window { flex-wrap: wrap; }
  .adoption-panel { padding: 0.8rem; }
  .adoption-table { min-width: 410px; }
  .adoption-inline-stat { flex-wrap: wrap; gap: 0.35rem; }
  .adoption-funnel li { grid-template-columns: 6.5rem minmax(0, 1fr) 3.6rem; }
}

/* SIG-31 Admin adoption charts.
   Drawn as server-rendered SVG (app/helpers/admin_chart_helper.rb) rather than
   by a charting library, so colour has to come from the theme variables here.
   Every value below is a var, which is what makes dark mode follow the shell
   instead of needing its own hardcoded palette. */
.admin-chart {
    display: block;
    height: auto;
    width: 100%;
}

.admin-chart-spark {
    height: 2.125rem;
}

.admin-chart-line {
    fill: none;
    stroke: var(--green);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
}

.admin-chart-area {
    fill: var(--green);
    opacity: 0.12;
    stroke: none;
}

.admin-chart-bars {
    height: auto;
    max-width: 100%;
}

/* Hairline, solid, one step off the surface. Recessive on purpose: the data is
   the only thing allowed to be loud. */
.admin-chart-grid {
    stroke: var(--border-soft);
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
}

.admin-chart-axis-line {
    stroke: var(--border);
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
}

/* Axis text wears a text token, never the series colour. */
.admin-chart-tick {
    fill: var(--muted);
    font-size: 8px;
    letter-spacing: 0.01em;
}

.admin-chart-bar {
    fill: var(--green);
}

/* Reserved status colour, used here because sent and failed are states rather
   than arbitrary series. Never reused as "series two". */
.admin-chart-bar.is-failed {
    fill: var(--red);
}

.admin-chart-bar.is-muted {
    fill: var(--muted);
    opacity: 0.45;
}

.admin-chart-figure {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}

.admin-chart-figure figcaption {
    align-items: baseline;
    display: flex;
    gap: 0.5rem;
    justify-content: space-between;
}

.admin-chart-axis {
    color: var(--muted);
    display: flex;
    font-size: 0.75rem;
    justify-content: space-between;
}

/* A provisional cohort is still censored: not every member has had time to
   convert yet, so the value is drawn but marked rather than read as a trend. */
.admin-cohort-provisional {
    color: var(--muted);
}

.admin-cohort-provisional td,
.admin-cohort-provisional th {
    opacity: 0.72;
}

/* Legend for a bar chart carrying more than one colour. A single-series chart
   gets none -- its caption already names what is plotted. Legend text wears a
   text token; identity comes from the swatch beside it, never from colouring
   the words. */
.admin-chart-legend {
    align-items: center;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    font-size: 0.75rem;
    gap: 0.85rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.admin-chart-legend li {
    align-items: center;
    display: flex;
    gap: 0.35rem;
}

.admin-chart-swatch {
    background: var(--green);
    border-radius: 2px;
    display: inline-block;
    height: 0.625rem;
    width: 0.625rem;
}

.admin-chart-swatch.is-failed {
    background: var(--red);
}

/* Stock Screener context stays visible with the existing filter groups. */
.stock-screener-context-help,
.stock-screener-context-status {
    color: var(--text-muted);
    font-size: .82rem;
    line-height: 1.5;
}
.stock-screener-context-help { margin: 1rem 0 0; }
.stock-screener-context-status { padding: .85rem 1rem; }
.stock-screener-context-status p { margin: .25rem 0; }
.stock-screener-row-context { white-space: normal; line-height: 1.5; margin-top: .35rem; }
.stock-screener-back-to-filters {
    background: none;
    border: 0;
    color: var(--text);
    font: inherit;
    font-size: .86rem;
    padding: .35rem 0;
    cursor: pointer;
}
.stock-screener-back-to-filters:hover { text-decoration: underline; }
#stock-screener-updated.is-stale { color: var(--warning, #e0b64b); }
.stock-screener-builder-actions > div:last-child { display: flex; flex-wrap: wrap; gap: .5rem; }

.stock-screener-criteria-row { flex-wrap: wrap; }
.stock-screener-criteria-row > span { white-space: normal; }
.stock-screener-builder { scroll-margin-top: 4.7rem; }

@media (min-width: 1201px) {
    .stock-screener-market-controls { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .stock-screener-filter-group { padding: .4rem 0 .5rem; }
    .stock-screener-filter-group > h3 { margin-bottom: .25rem; }
    .stock-screener-control-heading { min-height: 1.25rem; margin-bottom: .4rem; }
    .stock-screener-filter-group-controls { column-gap: 1rem; }
    .stock-screener-context-help { margin-top: .4rem; }
}

/* SIG-168: owner-selected Research Desk composition. */
body.symbol-detail-dashboard-shell .symbol-research-workspace {
    margin-top: 0.4rem;
}

body.symbol-detail-dashboard-shell .symbol-research-desk {
    --research-accent: var(--green);
    background: transparent;
    border: 0;
    border-radius: 0;
    display: grid;
    gap: 1.15rem;
    grid-template-columns: minmax(0, 1fr);
    margin-top: 0;
    min-width: 0;
    padding: 0;
}

body.symbol-detail-dashboard-shell .symbol-research-story-grid {
    align-items: stretch;
    display: grid;
    gap: 0.75rem;
    grid-template-columns: minmax(0, 0.47fr) minmax(0, 0.53fr);
    min-width: 0;
}

body.symbol-detail-dashboard-shell .symbol-research-chapter {
    display: grid;
    gap: 0.4rem;
    grid-template-rows: auto minmax(0, 1fr);
    height: 100%;
    min-width: 0;
}

body.symbol-detail-dashboard-shell .symbol-research-chapter-heading {
    align-items: center;
    border-bottom: 0;
    display: flex;
    min-height: 2.65rem;
}

body.symbol-detail-dashboard-shell .symbol-research-chapter-heading h3 {
    color: var(--text);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.1;
    text-transform: none;
}

body.symbol-detail-dashboard-shell .symbol-research-happening-grid,
body.symbol-detail-dashboard-shell .symbol-research-valued-grid,
body.symbol-detail-dashboard-shell .symbol-research-ownership-grid,
body.symbol-detail-dashboard-shell .symbol-research-records-grid {
    align-items: stretch;
    display: grid;
    gap: 0.75rem;
    min-width: 0;
}

body.symbol-detail-dashboard-shell .symbol-research-happening-grid,
body.symbol-detail-dashboard-shell .symbol-research-valued-grid {
    height: 100%;
}

body.symbol-detail-dashboard-shell .symbol-research-happening-grid {
    grid-template-columns: minmax(14rem, 0.42fr) minmax(0, 0.58fr);
}

body.symbol-detail-dashboard-shell .symbol-research-valued-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.symbol-detail-dashboard-shell .symbol-research-ownership-grid {
    grid-template-columns: minmax(20rem, 7fr) minmax(18rem, 5fr) minmax(0, 13fr);
}

/* With no holders the holdings card is hidden, so the other two take the row. */
body.symbol-detail-dashboard-shell .symbol-research-ownership-grid:has(> .symbol-research-holdings-card[hidden]) {
    grid-template-columns: minmax(20rem, 7fr) minmax(18rem, 5fr);
}

body.symbol-detail-dashboard-shell .symbol-research-records-grid {
    grid-template-columns: minmax(0, 3fr) minmax(32rem, 2fr);
}

body.symbol-detail-dashboard-shell .symbol-research-records-grid .symbol-research-financials-card,
body.symbol-detail-dashboard-shell .symbol-research-records-grid .symbol-research-filings-card {
    grid-column: auto;
}

body.symbol-detail-dashboard-shell .symbol-research-card,
body.symbol-detail-dashboard-shell .symbol-research-workspace .symbol-research-card {
    background: var(--surface-soft) !important;
    border: 1px solid var(--border) !important;
    border-radius: 0.35rem;
    box-shadow: none !important;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 0.72rem;
}

/* The display above outranks the user-agent [hidden] rule, so a card the page
   hides (an empty Top Institutional Holdings) would still show. */
body.symbol-detail-dashboard-shell .symbol-research-card[hidden] {
    display: none;
}

body.symbol-detail-dashboard-shell .symbol-research-card .detail-card-header {
    border-bottom: 1px solid var(--border-soft);
    padding-bottom: 0.48rem;
}

body.symbol-detail-dashboard-shell .symbol-research-card .detail-card-header h4 {
    color: var(--text);
    font-size: 1rem !important;
    font-weight: 700;
}

body.symbol-detail-dashboard-shell .symbol-research-card .detail-card-body {
    flex: 1 1 auto;
    margin-top: 0.5rem;
}

body.symbol-detail-dashboard-shell .symbol-research-overview-news .symbol-news-list {
    grid-template-columns: minmax(0, 1fr);
}

body.symbol-detail-dashboard-shell .symbol-research-overview-news .symbol-news-scroll {
    max-height: none;
}

body.symbol-detail-dashboard-shell .symbol-research-ownership-body {
    align-items: start;
    display: grid;
    gap: 0.55rem;
    grid-template-columns: minmax(0, 1fr);
    min-width: 0;
}

body.symbol-detail-dashboard-shell .symbol-research-ownership-body > .detail-card-body {
    margin-top: 0.5rem;
}

body.symbol-detail-dashboard-shell .symbol-research-ownership-body > .detail-card-body + .detail-card-body {
    border-left: 0;
    border-top: 1px solid var(--border-soft);
    padding-left: 0;
    padding-top: 0.55rem;
}

body.symbol-detail-dashboard-shell .symbol-research-happening-grid > .symbol-research-card,
body.symbol-detail-dashboard-shell .symbol-research-valued-grid > .symbol-research-card {
    height: 100%;
    min-height: 16.5rem;
}

body.symbol-detail-dashboard-shell .symbol-research-ownership-grid > .symbol-research-card {
    min-height: 13.5rem;
}

body.symbol-detail-dashboard-shell .symbol-research-records-grid > .symbol-research-card {
    min-height: 23rem;
}

body.symbol-detail-dashboard-shell .research-fundamentals-layout {
    display: grid;
    gap: 0.8rem;
    grid-template-columns: minmax(10rem, 0.47fr) minmax(0, 0.53fr);
    min-width: 0;
}

body.symbol-detail-dashboard-shell .symbol-research-overview-fundamentals .fundamental-row {
    min-height: 1.35rem;
    padding: 0.24rem 0;
}

body.symbol-detail-dashboard-shell .symbol-research-overview-fundamentals .fundamental-label,
body.symbol-detail-dashboard-shell .symbol-research-overview-fundamentals .fundamental-value {
    font-size: 0.78rem;
}

body.symbol-detail-dashboard-shell .research-fundamental-visuals {
    border-left: 1px solid var(--border-soft);
    display: grid;
    gap: 0.5rem;
    min-width: 0;
    padding-left: 0.8rem;
}

body.symbol-detail-dashboard-shell .research-fundamental-visual {
    border-bottom: 1px solid var(--border-soft);
    min-width: 0;
    padding-bottom: 0.5rem;
}

body.symbol-detail-dashboard-shell .research-fundamental-visual:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

body.symbol-detail-dashboard-shell .research-mini-bars {
    align-items: end;
    display: grid;
    gap: 0.2rem;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    height: 2.5rem;
    margin-top: 0.35rem;
}

body.symbol-detail-dashboard-shell .research-mini-bars i {
    background: var(--muted);
    border-radius: 0.08rem 0.08rem 0 0;
    min-height: 0.2rem;
}

body.symbol-detail-dashboard-shell .research-mini-bars i.is-latest {
    background: var(--green);
}

body.symbol-detail-dashboard-shell .research-market-cap-spark {
    height: 2.2rem;
    margin-top: 0.25rem;
    width: 100%;
}

body.symbol-detail-dashboard-shell .research-market-cap-spark polyline {
    fill: none;
    stroke: var(--green);
    stroke-width: 1.5;
    vector-effect: non-scaling-stroke;
}

body.symbol-detail-dashboard-shell .symbol-research-valued-grid #research-street-panel {
    align-items: stretch;
    display: grid;
    gap: 0.55rem;
    grid-template-columns: minmax(0, 1fr);
}

body.symbol-detail-dashboard-shell .symbol-research-valued-grid #research-street-panel > .mt-3 {
    grid-column: auto;
}

body.symbol-detail-dashboard-shell .symbol-research-valued-grid #research-street-panel .analyst-rating-summary {
    border-left: 0;
    border-top: 0;
    gap: 0.85rem;
    grid-template-columns: 6rem auto;
    justify-content: center;
    margin-top: 0;
    padding: 0.5rem 0 0;
}

body.symbol-detail-dashboard-shell .symbol-research-valued-grid #research-street-panel .analyst-rating-chart {
    width: 6rem;
}

body.symbol-detail-dashboard-shell .symbol-research-valued-grid #research-street-panel .analyst-rating-legend-title {
    font-size: 0.85rem;
}

body.symbol-detail-dashboard-shell .symbol-research-valued-grid #research-street-panel .analyst-rating-pills .app-status-pill {
    font-size: 0.82rem;
    padding: 0.24rem 0.6rem;
}

body.symbol-detail-dashboard-shell .symbol-research-ownership-body .research-ownership-overview {
    align-items: center;
    gap: 0.75rem;
    grid-template-columns: 7.5rem minmax(0, 1fr);
}

body.symbol-detail-dashboard-shell .symbol-research-ownership-body .research-ownership-gauge {
    justify-self: center;
    width: 7.5rem;
}

body.symbol-detail-dashboard-shell .symbol-research-ownership-body .research-ownership-gauge > span {
    box-shadow: 0 0 0 1px var(--border-soft);
    width: 74%;
}

body.symbol-detail-dashboard-shell .symbol-research-ownership-body .research-data-grid {
    grid-template-columns: minmax(0, 1fr);
}

body.symbol-detail-dashboard-shell .symbol-research-ownership-body .research-data-row {
    display: grid;
    gap: 0.7rem;
    grid-template-columns: minmax(9.5rem, 10.5rem) max-content;
    justify-content: center;
}

body.symbol-detail-dashboard-shell .symbol-research-ownership-body .research-data-row dd {
    text-align: right;
}

body.symbol-detail-dashboard-shell .research-position-activity-heading {
    align-items: baseline;
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.4rem;
}

body.symbol-detail-dashboard-shell .research-position-activity-heading span {
    color: var(--text);
    font-size: 0.76rem;
    font-weight: 700;
}

body.symbol-detail-dashboard-shell .research-position-activity-heading small {
    color: var(--muted-strong);
    font-size: 0.65rem;
}

body.symbol-detail-dashboard-shell .research-position-bars {
    align-items: end;
    display: grid;
    gap: 0.4rem;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    min-width: 0;
}

body.symbol-detail-dashboard-shell .research-position-bar {
    display: grid;
    gap: 0.18rem;
    grid-template-rows: auto 3.4rem auto auto;
    min-width: 0;
    text-align: center;
}

body.symbol-detail-dashboard-shell .research-position-bar strong {
    color: var(--text);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.72rem;
}

body.symbol-detail-dashboard-shell .research-position-bar-track {
    align-items: end;
    background: color-mix(in srgb, var(--border-soft) 62%, transparent);
    border-radius: 0.12rem 0.12rem 0 0;
    display: flex;
    justify-content: stretch;
    overflow: hidden;
}

body.symbol-detail-dashboard-shell .research-position-bar-track i {
    background: var(--muted);
    display: block;
    width: 100%;
}

body.symbol-detail-dashboard-shell .research-position-bar.is-positive .research-position-bar-track i {
    background: var(--green);
}

body.symbol-detail-dashboard-shell .research-position-bar.is-negative .research-position-bar-track i {
    background: var(--red);
}

body.symbol-detail-dashboard-shell .research-position-bar > span {
    color: var(--text);
    font-size: 0.72rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.symbol-detail-dashboard-shell .research-position-bar > small {
    color: var(--muted-strong);
    font-size: 0.68rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.symbol-detail-dashboard-shell .symbol-research-ownership-card {
    container-type: inline-size;
}

@container (max-width: 23rem) {
    body.symbol-detail-dashboard-shell .symbol-research-ownership-body .research-ownership-overview {
        gap: 0.55rem;
        grid-template-columns: 5.5rem minmax(0, 1fr);
    }

    body.symbol-detail-dashboard-shell .symbol-research-ownership-body .research-ownership-gauge {
        width: 5.5rem;
    }

    body.symbol-detail-dashboard-shell .symbol-research-ownership-body .research-data-row {
        gap: 0.45rem;
        grid-template-columns: minmax(0, 1fr) max-content;
        justify-content: stretch;
    }

    body.symbol-detail-dashboard-shell .research-position-bars {
        gap: 0.25rem;
    }

    body.symbol-detail-dashboard-shell .research-position-bar {
        grid-template-rows: auto 2.8rem auto auto;
    }

    body.symbol-detail-dashboard-shell .research-position-bar > span {
        font-size: 0.66rem;
    }

    body.symbol-detail-dashboard-shell .research-position-bar > small {
        font-size: 0.63rem;
    }
}

body.symbol-detail-dashboard-shell .symbol-research-overview-short .symbol-research-compact-table,
body.symbol-detail-dashboard-shell .symbol-research-holdings-card .research-holdings-table {
    min-width: 0;
    table-layout: fixed;
    width: 100%;
}

body.symbol-detail-dashboard-shell .research-short-change-row td {
    border-bottom: 0;
}

body.symbol-detail-dashboard-shell .symbol-research-holdings-card .research-holdings-table th:first-child,
body.symbol-detail-dashboard-shell .symbol-research-holdings-card .research-holdings-table td:first-child {
    width: 34%;
}

body.symbol-detail-dashboard-shell .symbol-research-holdings-card .research-holdings-table th,
body.symbol-detail-dashboard-shell .symbol-research-holdings-card .research-holdings-table td,
body.symbol-detail-dashboard-shell .symbol-research-overview-short .symbol-research-compact-table th,
body.symbol-detail-dashboard-shell .symbol-research-overview-short .symbol-research-compact-table td {
    padding-bottom: 0.42rem;
    padding-top: 0.42rem;
}

body.symbol-detail-dashboard-shell .research-holdings-table th:not(:first-child),
body.symbol-detail-dashboard-shell .research-holdings-table td:not(:first-child),
body.symbol-detail-dashboard-shell .research-financial-table th:not(:first-child),
body.symbol-detail-dashboard-shell .research-financial-table td:not(:first-child),
body.symbol-detail-dashboard-shell .research-filings-table th:not(:first-child),
body.symbol-detail-dashboard-shell .research-filings-table td:not(:first-child) {
    text-align: center;
}

body.symbol-detail-dashboard-shell .symbol-research-financials-card #research-financials-panel {
    display: block;
}

body.symbol-detail-dashboard-shell .symbol-research-financials-card .research-financial-table-wrap {
    max-height: none;
    overflow-y: visible;
}

body.symbol-detail-dashboard-shell .research-financial-tabs {
    align-items: center;
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    gap: 1.4rem;
    margin-bottom: 0.55rem;
}

body.symbol-detail-dashboard-shell .research-financial-tabs button {
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    color: var(--muted-strong);
    cursor: pointer;
    font-size: 0.78rem;
    padding: 0.3rem 0.15rem 0.45rem;
}

body.symbol-detail-dashboard-shell .research-financial-tabs button.is-active {
    border-bottom-color: var(--text);
    color: var(--text);
    font-weight: 700;
}

body.symbol-detail-dashboard-shell .research-financial-layout {
    display: grid;
    gap: 0.65rem;
    grid-template-columns: minmax(0, 0.6fr) minmax(15rem, 0.4fr);
    min-width: 0;
}

body.symbol-detail-dashboard-shell .research-financial-unit {
    color: var(--muted-strong);
    font-size: 0.72rem;
    margin-bottom: 0.25rem;
}

body.symbol-detail-dashboard-shell .research-financial-table {
    min-width: 28rem;
    table-layout: fixed;
}

body.symbol-detail-dashboard-shell .research-financial-table th:first-child,
body.symbol-detail-dashboard-shell .research-financial-table td:first-child {
    width: 29%;
}

body.symbol-detail-dashboard-shell .research-financial-table th,
body.symbol-detail-dashboard-shell .research-financial-table td {
    padding-bottom: 0.5rem;
    padding-left: 0.35rem;
    padding-right: 0.35rem;
    padding-top: 0.5rem;
}

body.symbol-detail-dashboard-shell .research-financial-chart {
    align-content: start;
    border-left: 1px solid var(--border-soft);
    color: var(--muted-strong);
    display: grid;
    font-size: 0.7rem;
    gap: 0.65rem;
    grid-template-rows: auto auto auto;
    padding-left: 0.85rem;
    text-transform: uppercase;
}

body.symbol-detail-dashboard-shell .research-financial-latest {
    align-items: baseline;
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    white-space: nowrap;
}

body.symbol-detail-dashboard-shell .research-financial-latest > strong {
    color: var(--text);
    font-family: "JetBrains Mono", monospace;
    font-size: 1.55rem;
    font-weight: 600;
    letter-spacing: -0.035em;
    line-height: 1;
    white-space: nowrap;
}

body.symbol-detail-dashboard-shell .research-financial-latest > div {
    align-items: baseline;
    display: flex;
    gap: 0.45rem;
}

body.symbol-detail-dashboard-shell .research-financial-latest small,
body.symbol-detail-dashboard-shell .research-financial-latest em {
    font-size: 1rem;
    font-style: normal;
    font-weight: 700;
    line-height: 1.1;
    white-space: nowrap;
}

body.symbol-detail-dashboard-shell .research-financial-trend {
    display: block;
    height: auto;
    margin-top: 0.45rem;
    max-height: 13.25rem;
    overflow: visible;
    width: 100%;
}

body.symbol-detail-dashboard-shell .research-financial-guide {
    stroke: var(--muted-strong);
    stroke-dasharray: 5 6;
    stroke-linecap: round;
    stroke-opacity: 0.78;
    stroke-width: 1;
}

body.symbol-detail-dashboard-shell .research-financial-line {
    fill: none;
    stroke: var(--muted-strong);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.25;
}

body.symbol-detail-dashboard-shell .research-financial-point {
    fill: var(--muted-strong);
    stroke: var(--surface);
    stroke-width: 2.25;
}

body.symbol-detail-dashboard-shell .research-financial-point.is-latest {
    fill: var(--green);
}

body.symbol-detail-dashboard-shell .research-financial-point.is-negative {
    fill: var(--red);
}

body.symbol-detail-dashboard-shell .research-financial-value {
    fill: var(--text);
    font-family: "JetBrains Mono", monospace;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0;
}

body.symbol-detail-dashboard-shell .research-financial-period {
    fill: var(--muted-strong);
    font-family: "Source Sans 3", "Segoe UI", sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0;
}

body.symbol-detail-dashboard-shell .research-filings-table-wrap {
    min-width: 0;
    overflow-x: auto;
}

body.symbol-detail-dashboard-shell .research-filings-table {
    min-width: 32rem;
    table-layout: fixed;
    width: 100%;
}

body.symbol-detail-dashboard-shell .research-filings-table th:first-child,
body.symbol-detail-dashboard-shell .research-filings-table td:first-child {
    width: 25%;
}

body.symbol-detail-dashboard-shell .research-filings-table th:nth-child(2),
body.symbol-detail-dashboard-shell .research-filings-table td:nth-child(2) {
    width: 20%;
}

body.symbol-detail-dashboard-shell .research-filings-table th:nth-child(3),
body.symbol-detail-dashboard-shell .research-filings-table td:nth-child(3) {
    width: 18%;
}

body.symbol-detail-dashboard-shell .research-filings-table th:nth-child(4),
body.symbol-detail-dashboard-shell .research-filings-table td:nth-child(4) {
    width: 37%;
}

body.symbol-detail-dashboard-shell .research-filings-table th,
body.symbol-detail-dashboard-shell .research-filings-table td {
    font-size: var(--app-table-body-font-size, 0.92rem);
    overflow: hidden;
    padding-bottom: 0.42rem;
    padding-top: 0.42rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.symbol-detail-dashboard-shell .research-filings-table th {
    font-size: var(--app-table-header-font-size, 0.72rem);
}

body.symbol-detail-dashboard-shell [data-research-desk-hidden] {
    display: none !important;
}

@media (max-width: 1280px) {
    body.symbol-detail-dashboard-shell .symbol-research-story-grid,
    body.symbol-detail-dashboard-shell .symbol-research-ownership-grid,
    body.symbol-detail-dashboard-shell .symbol-research-records-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 780px) {
    body.symbol-detail-dashboard-shell .symbol-research-happening-grid,
    body.symbol-detail-dashboard-shell .symbol-research-valued-grid,
    body.symbol-detail-dashboard-shell .symbol-research-ownership-body {
        grid-template-columns: minmax(0, 1fr);
    }

    body.symbol-detail-dashboard-shell .symbol-research-ownership-body > .detail-card-body + .detail-card-body {
        border-left: 0;
        border-top: 1px solid var(--border-soft);
        padding-left: 0;
        padding-top: 0.7rem;
    }

    body.symbol-detail-dashboard-shell .research-fundamentals-layout,
    body.symbol-detail-dashboard-shell .research-financial-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    body.symbol-detail-dashboard-shell .research-fundamental-visuals,
    body.symbol-detail-dashboard-shell .research-financial-chart {
        border-left: 0;
        border-top: 1px solid var(--border-soft);
        padding-left: 0;
        padding-top: 0.7rem;
    }
}

/* Short Interest settlement comparison: shared zero baseline, latest report highlighted. */
body.symbol-detail-dashboard-shell .short-interest-comparison {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--app-border, #303943);
}
body.symbol-detail-dashboard-shell .short-interest-chart-heading {
    color: var(--app-text-muted, #8997a5);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}
body.symbol-detail-dashboard-shell .short-interest-chart { display: block; width: 100%; height: auto; }
body.symbol-detail-dashboard-shell .short-interest-chart-grid { stroke: #a5b2be; stroke-opacity: .2; stroke-dasharray: 3 3; }
body.symbol-detail-dashboard-shell .short-interest-chart-baseline { stroke: #8193a2; stroke-width: 1; }
body.symbol-detail-dashboard-shell .short-interest-chart-bar { fill: #71869a; }
body.symbol-detail-dashboard-shell .short-interest-chart-bar-latest { fill: #4b9cdb; }
body.symbol-detail-dashboard-shell .short-interest-chart-value,
body.symbol-detail-dashboard-shell .short-interest-chart-date { fill: currentColor; text-anchor: middle; font-size: 12px; }
body.symbol-detail-dashboard-shell .short-interest-chart-value { font-weight: 600; font-variant-numeric: tabular-nums; }

/* Balance activity with the adjacent comparison and seven-row holdings preview. */
@media (min-width: 1281px) {
    body.symbol-detail-dashboard-shell .symbol-research-ownership-body > .detail-card-body + .detail-card-body {
        margin-top: 2rem;
    }
}

/* A notice at the top of every product shell's content frame: Subscribe as an
   app-owned trial nears its end (SIG-335), Confirm your email (SIG-377). */
.app-shell-banner {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.55rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
}

.app-shell-banner .button_to {
    margin: 0;
}

/* An action is waiting on the customer: the warning tint the admin overlap
   notice uses, so it reads as a callout rather than another panel. */
.app-shell-banner-confirm-email {
    background: color-mix(in srgb, var(--yellow) 9%, var(--surface));
    border-color: color-mix(in srgb, var(--yellow) 50%, var(--border-soft));
    border-left: 4px solid var(--yellow);
}

/* An offer, not a problem: the brand green in the same pattern. */
.app-shell-banner-subscribe {
    background: color-mix(in srgb, var(--green) 9%, var(--surface));
    border-color: color-mix(in srgb, var(--green) 50%, var(--border-soft));
    border-left: 4px solid var(--green);
}

.app-shell-banner-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* SIG-335: the billing pages' notes and buttons, spaced like the trial-ended note. */
.billing-stack {
    display: grid;
    gap: 0.75rem;
    margin-top: 1rem;
}

.billing-stack > p,
.billing-stack .button_to {
    margin: 0;
}

.billing-stack .app-form-note,
.billing-renewal-disclosure {
    border-radius: 0.5rem;
    line-height: 1.45;
    padding: 0.85rem;
}

.billing-stack .app-form-note p,
.billing-renewal-disclosure p {
    margin: 0.35rem 0 0;
}

.billing-stack .button_to .content-button {
    justify-content: center;
    width: 100%;
}
