:root {
    --sd-font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    --sd-font-ui: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, Apple Color Emoji, Segoe UI Emoji;
    --sd-bg: #ffffff;
    --sd-text: #111111;
    --sd-text-muted: #666666;
    --sd-text-subtle: #6b7280;
    --sd-border: #d9d9d9;
    --sd-border-soft: #e5e7eb;
    --sd-surface: #ffffff;
    --sd-surface-muted: #f0f2f6;
    --sd-surface-soft: #fafafa;
    --sd-surface-warn: #fff7f7;
    --sd-warn-border: #fca5a5;
    --sd-positive: #15803d;
    --sd-negative: #b91c1c;
    --sd-shadow: 0 2px 8px rgba(0, 0, 0, .03);
    --sd-radius: 10px;
    --sd-radius-sm: 8px;
    --sd-content-width: 1560px;
    --sd-nav-height: 86px;
    --sd-shell-gutter: clamp(20px, 4vw, 48px);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    font-family: var(--sd-font-sans);
    margin: 0;
    padding: 0;
    background: var(--sd-bg);
    color: var(--sd-text);
    -webkit-text-size-adjust: 100%;
}

img,
svg,
canvas,
video,
iframe {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--sd-text);
    text-decoration: underline;
}

a:hover {
    opacity: 0.85;
}

.content {
    width: 100%;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
}

.page {
    width: min(var(--sd-content-width), calc(100vw - (var(--sd-shell-gutter) * 2)));
    margin: 0 auto;
    flex: 1;
    padding: 28px 0 24px;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding-top: 20px;
    padding-bottom: 20px;
    padding-left: var(--sd-shell-gutter);
    padding-right: var(--sd-shell-gutter);
    border-bottom: 1px solid var(--sd-border);
    min-height: var(--sd-nav-height);
}

.nav-right {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.nav-right .link {
    text-decoration: none;
}

.nav-right .link:hover {
    text-decoration: underline;
}

.brand {
    color: var(--sd-text);
    text-decoration: none;
}

.brand-header {
    margin: 0;
}

.symbol-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px 12px;
    align-items: end;
    margin: 12px 0 20px;
    max-width: 400px;
}

.valuation-form {
    max-width: 1080px;
}

.symbol-form label {
    grid-column: 1 / -1;
    margin: 0 0 6px 0;
    display: block;
}

.symbol-form input[type="text"],
.symbol-form input[type="number"] {
    height: 44px;
    font-size: 16px;
    padding: 8px 12px;
    border: 1px solid var(--sd-border-soft);
    border-radius: var(--sd-radius-sm);
    background: var(--sd-surface);
    color: var(--sd-text);
}

.symbol-form input[type="text"]:focus,
.symbol-form input[type="number"]:focus,
.assumption-field input[type="text"]:focus,
.assumption-field input[type="number"]:focus {
    outline: none;
    border-color: var(--sd-text);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, .05);
}

.symbol-label {
    opacity: 0.6;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 14px;
    font-size: 16px;
    border-radius: var(--sd-radius-sm);
    border: 1px solid var(--sd-border-soft);
    background: var(--sd-surface);
    color: var(--sd-text);
    cursor: pointer;
}

.btn:hover {
    background: #f7f7f7;
}

.btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

.hero-btn-secondary {
    border: 1px solid var(--sd-border);
    border-radius: var(--sd-radius);
    padding: 12px;
}

.muted {
    color: var(--sd-text-muted);
    font-style: italic;
}

.subtle {
    color: var(--sd-text-muted);
    font-weight: bold;
}

.helper-text,
.assumption-help,
.kpi-label {
    color: var(--sd-text-subtle);
}

.helper-text {
    display: block;
    margin: 4px 0 10px;
    padding: 0 0 4px;
    font-size: 0.92rem;
    line-height: 1.45;
}

.header-link,
.summary-link,
.footer-link {
    color: inherit;
    text-decoration: none;
}

.header-link:hover,
.summary-link:hover,
.footer-link:hover {
    text-decoration: underline;
}

.table-wrap {
    width: 100%;
    max-height: 600px;
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--sd-surface);
    padding: 0;
    margin: 0;
    border: none;
    position: relative;
}

.table {
    width: max-content;
    min-width: 100%;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.table td,
.table th {
    padding: 8px;
    border: 1px solid var(--sd-border-soft);
}

.table td {
    text-align: center;
}

.table th {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--sd-surface-muted);
    text-align: center;
    text-wrap: auto;
}

.subheader-row th {
    background: #f7f8fb;
}

.date-row td:first-child,
.date-row th:first-child,
.table.narrow-first td:first-child,
.table.narrow-first th:first-child {
    position: sticky;
    left: 0;
    z-index: 4;
    background: var(--sd-surface-muted);
    box-shadow: 1px 0 0 var(--sd-border-soft) inset;
}

.table.narrow-first thead th:first-child,
.table.narrow-first tr:first-child th:first-child {
    top: 0;
    left: 0;
    z-index: 6;
    background: #e9ebef;
}

table.table.week-period td:first-child,
table.table.week-period th:first-child,
table.table.narrow-first td:first-child,
table.table.narrow-first th:first-child {
    max-width: 150px;
    white-space: normal;
    overflow: hidden;
    overflow-wrap: anywhere;
    word-break: break-word;
    text-wrap: auto;
}

.table.insider-totals tbody tr:last-child td {
    border-top: 1px solid var(--sd-text);
}

.sort-indicator {
    font-size: 12px;
    margin-left: 4px;
}

.sort-btn {
    padding: 0;
    margin-left: 6px;
    font-size: 12px;
    cursor: pointer;
}

.card {
    border: 1px solid var(--sd-border-soft);
    border-radius: var(--sd-radius);
    padding: 14px;
    background: var(--sd-surface);
    margin: 14px 0;
    box-shadow: var(--sd-shadow);
}

.analyst-quote-card {
    border: 0;
    box-shadow: none;
    background: transparent;
    padding: 0;
}

.pair-quote-card {
    border: 0;
    box-shadow: none;
    background: transparent;
    padding: 0;
}

.warning-card {
    border-color: var(--sd-warn-border);
    background: var(--sd-surface-warn);
}

.warning-list {
    margin: 0;
}

.warning-list {
    padding-left: 20px;
}

.val-pos {
    color: var(--sd-positive);
}

.val-neg,
.error {
    color: var(--sd-negative);
}

.val-zero {
    color: var(--sd-text);
}

.table + h3,
.card + h3,
.table + .card {
    margin-top: 18px;
}

.header-card {
    display: flex;
    flex-wrap: wrap;
    gap: 50px;
}

.header-data {
    flex: 1 1 550px;
}

.summary-list,
.section-header {
    margin-top: 0;
    margin-bottom: 0;
}

.summary-panel {
    padding: 8px 0 10px;
}

.summary-title {
    margin: 0 0 12px 0;
    font-size: 1.3em;
    line-height: 1.1;
}

.summary-stats {
    margin: 0 0 10px 0;
    font-size: 0.92rem;
    line-height: 1.4;
}

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

.kpi-card {
    border: 1px solid var(--sd-border-soft);
    border-radius: var(--sd-radius);
    padding: 12px;
    background: var(--sd-surface-soft);
}

.kpi-label {
    opacity: 0.7;
    font-size: 13px;
    margin-bottom: 6px;
}

.kpi-value {
    font-size: 18px;
    font-weight: 600;
}

.assumption-grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 4px;
}

.assumption-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.assumption-field label {
    margin: 0;
    opacity: 0.7;
    font-size: 14px;
}

.assumption-field input[type="text"],
.assumption-field input[type="number"] {
    width: 100%;
    height: 44px;
    font-size: 16px;
    padding: 8px 12px;
    border: 1px solid var(--sd-border-soft);
    border-radius: var(--sd-radius-sm);
    background: var(--sd-surface);
    color: var(--sd-text);
    box-sizing: border-box;
}

.badge-row,
.horizon-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
}

.horizon-badges {
    margin-top: 6px;
    margin-bottom: 10px;
}

.pill {
    display: inline-flex;
    align-items: center;
    height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--sd-border-soft);
    background: var(--sd-surface-soft);
}

.pill.warn {
    border-color: #f5c2c7;
    background: #fff5f5;
}

.pill.confidence {
    font-weight: 600;
}

.pill.confidence-high {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: var(--sd-positive);
}

.pill.confidence-moderate {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
}

.pill.confidence-low {
    border-color: #fde68a;
    background: #fffbeb;
    color: #b45309;
}

.pill.confidence-experimental {
    border-color: #fecaca;
    background: #fef2f2;
    color: var(--sd-negative);
}

.chart-placeholder {
    border: 1px dashed var(--sd-border-soft);
    border-radius: var(--sd-radius-sm);
    background: var(--sd-surface-soft);
    padding: 14px;
    margin: 12px 0;
}

.chart-stack {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 12px 0;
    align-items: start;
}

.forecast-svg {
    width: 100%;
    height: auto;
    min-height: 0;
    display: block;
}

.output {
    padding-bottom: 24px;
}

.news-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    align-items: start;
}

.news-layout-single {
    grid-template-columns: minmax(0, 1fr);
}

.news-layout > * {
    min-width: 0;
}

.news-table-section {
    margin-top: 0;
    min-width: 0;
}

.news-table-wrap {
    max-height: 1000px;
    margin-top: 12px;
    border: 1px solid var(--sd-border-soft);
    border-radius: var(--sd-radius-sm);
}

.news-table {
    width: 100%;
    min-width: 620px;
    table-layout: fixed;
}

.news-table th,
.news-table td {
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
}

.news-table th {
    font-size: 0.82rem;
    letter-spacing: 0;
    color: var(--sd-text);
}

.news-table td {
    font-size: 0.92rem;
    line-height: 1.4;
}

.news-table th:nth-child(2),
.news-table td:nth-child(2) {
    width: 150px;
}

.news-table th:nth-child(3),
.news-table td:nth-child(3) {
    width: 132px;
}

.news-evidence-table {
    min-width: 560px;
}

.news-evidence-table th:nth-child(2),
.news-evidence-table td:nth-child(2) {
    width: 150px;
}

.news-evidence-table th:nth-child(3),
.news-evidence-table td:nth-child(3) {
    width: 132px;
}

.news-title-cell {
    overflow-wrap: anywhere;
}

.news-title-cell a {
    text-decoration: underline;
}

.news-title-cell a:hover {
    opacity: 0.78;
}

.table-empty {
    text-align: left;
    font-style: italic;
}

.subsection-header {
    margin: 16px 0 4px;
    font-size: 1rem;
}

.news-filings-table {
    margin-top: 10px;
}

.news-query-card summary {
    cursor: pointer;
    font-weight: 600;
}

.news-query-list {
    margin: 12px 0 0;
    padding-left: 20px;
    color: var(--sd-text-muted);
    line-height: 1.45;
}

.volatility-surface-card {
    overflow: hidden;
}

.volatility-surface-card h3 {
    margin: 0 0 14px;
    font-size: 1.2rem;
    line-height: 1.2;
}

.vol-surface-stage {
    position: relative;
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    border: 1px solid var(--sd-border-soft);
    border-radius: var(--sd-radius-sm);
    background: #f8fafc;
    overflow: hidden;
}

.vol-surface-toolbar {
    position: absolute;
    z-index: 2;
    top: 12px;
    right: 12px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.vol-surface-control {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    padding: 0 12px;
    border: 1px solid var(--sd-border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--sd-text);
    font: 600 12px/1 var(--sd-font-ui);
    letter-spacing: 0;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.vol-surface-control:hover {
    background: #ffffff;
}

.vol-surface-nav-controls {
    position: absolute;
    z-index: 2;
    right: 12px;
    bottom: 12px;
    display: grid;
    grid-template-columns: repeat(2, 34px);
    gap: 6px;
    padding: 7px;
    border: 1px solid rgba(17, 17, 17, 0.12);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.09);
    backdrop-filter: blur(8px);
}

.vol-surface-nav-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--sd-border-soft);
    border-radius: 8px;
    background: #ffffff;
    color: var(--sd-text);
    font: 800 16px/1 var(--sd-font-ui);
    letter-spacing: 0;
    cursor: pointer;
}

.vol-surface-nav-button:hover {
    background: #f7f7f7;
}

.vol-surface-canvas-host {
    width: 100%;
    height: clamp(360px, 42vw, 560px);
}

.vol-surface-canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: grab;
}

.vol-surface-canvas.is-grabbing {
    cursor: grabbing;
}

.foot-page {
    width: 100%;
    background: var(--sd-surface);
    border-top: 1px solid var(--sd-border-soft);
    padding: 24px var(--sd-shell-gutter);
    margin-top: 24px;
    font-family: var(--sd-font-ui);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 100vh;
    color: var(--sd-text-muted);
}

@media screen and (max-width: 1440px) {
    :root {
        --sd-shell-gutter: 24px;
    }
}

@media screen and (max-width: 900px) {
    .assumption-grid,
    .summary-grid {
        grid-template-columns: repeat(2, minmax(160px, 1fr));
    }

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

@media screen and (max-width: 766px) {
    :root {
        --sd-shell-gutter: 14px;
    }

    .brand-header {
        font-size: 1.3em;
    }

    .nav {
        padding-top: 12px;
        padding-bottom: 12px;
        min-height: 58px;
        flex-wrap: nowrap;
    }

    .nav-right {
        width: auto;
        margin-left: auto;
        flex: 0 0 auto;
        flex-wrap: nowrap;
        justify-content: flex-end;
    }

    .hero-btn-secondary {
        height: 40px;
        padding: 0 12px;
    }

    .foot-page {
        gap: 10px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        flex-wrap: nowrap;
    }

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

    .symbol-form .btn {
        width: 100%;
    }

    .header-card {
        gap: 10px;
    }

    .chart-stack {
        grid-template-columns: 1fr;
        gap: 8px;
        margin: 10px 0 8px;
    }

    .summary-title {
        font-size: 1.15em;
    }

    .summary-stats {
        font-size: 0.88rem;
    }

    .assumption-grid,
    .news-layout,
    .summary-grid {
        grid-template-columns: 1fr;
    }

    .news-table-wrap {
        max-height: 500px;
    }
}
