.anova-page {
    --anova-text: #172033;
    --anova-muted: #64748b;
    --anova-border: #dbe2ea;
    --anova-soft: #f8fafc;
    --anova-primary: #2563eb;
    --anova-primary-soft: #eff6ff;
    width: 100%;
    max-width: none;
    margin: 20px 0 40px;
    padding: 0;
    color: var(--anova-text);
}

.anova-hero {
    margin-bottom: 18px;
    padding: 26px 28px;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
}

.anova-eyebrow {
    margin-bottom: 8px;
    color: var(--anova-primary);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.anova-hero h1 { margin: 0 0 12px; color: #111827; font-size: 2rem; font-weight: 750; }
.anova-hero p { max-width: 1000px; margin: 0; color: #475569; font-size: 1.02rem; line-height: 1.65; }

.anova-tabs,
.anova-subtabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: thin; }
.anova-tabs { margin-bottom: 12px; padding: 0 4px; border-bottom: 1px solid #e5e7eb; }
.anova-subtabs { margin-bottom: 18px; padding: 6px; border: 1px solid #e5e7eb; border-radius: 12px; background: #f8fafc; }
.anova-tab,
.anova-subtab { flex: 0 0 auto; text-decoration: none; transition: .15s ease; }
.anova-tab { padding: 11px 14px; border-bottom: 2px solid transparent; color: #64748b; font-size: .9rem; font-weight: 650; }
.anova-tab:hover,
.anova-tab.active { color: #1d4ed8; text-decoration: none; }
.anova-tab.active { border-bottom-color: #2563eb; }
.anova-subtab { padding: 8px 11px; border: 1px solid transparent; border-radius: 8px; color: #64748b; font-size: .82rem; font-weight: 700; }
.anova-subtab:hover { color: #1d4ed8; text-decoration: none; }
.anova-subtab.active { border-color: #bfdbfe; background: #eff6ff; color: #1d4ed8; }

.anova-section { padding: 22px; border: 1px solid #e5e7eb; border-radius: 16px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.anova-section-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 20px; }
.anova-section-header h2 { margin: 0 0 5px; color: #111827; font-size: 1.28rem; font-weight: 760; }
.anova-section-header p { max-width: 860px; margin: 0; color: #64748b; font-size: .9rem; line-height: 1.55; }
.anova-badge { display: inline-flex; padding: 5px 9px; border: 1px solid #dbeafe; border-radius: 999px; background: #eff6ff; color: #1d4ed8; font-size: .73rem; font-weight: 750; white-space: nowrap; }
.anova-error { margin: 0 0 16px; padding: 12px 14px; border: 1px solid #fecaca; border-radius: 10px; background: #fef2f2; color: #991b1b; font-size: .9rem; }

.anova-workspace { display: grid; grid-template-columns: minmax(320px, .8fr) minmax(520px, 1.5fr); gap: 18px; align-items: start; }
.anova-input-panel,
.anova-result-panel { min-width: 0; padding: 20px; border: 1px solid #e5e7eb; border-radius: 14px; }
.anova-input-panel { position: sticky; top: 16px; background: #f8fafc; }
.anova-result-panel { background: #fff; }

.anova-field { margin-bottom: 16px; }
.anova-field > label,
.anova-field label:not(.anova-segmented label) { display: block; margin-bottom: 6px; color: #334155; font-size: .83rem; font-weight: 750; }
.anova-control,
.anova-textarea { width: 100%; box-sizing: border-box; border: 1px solid #cbd5e1; border-radius: 9px; background: #fff; color: #1e293b; font: inherit; font-size: .9rem; outline: none; transition: border-color .16s ease, box-shadow .16s ease; }
.anova-control { min-height: 40px; padding: 8px 10px; }
.anova-textarea { min-height: 175px; padding: 11px; resize: vertical; line-height: 1.45; }
.anova-control:focus,
.anova-textarea:focus { border-color: #60a5fa; box-shadow: 0 0 0 3px rgba(59,130,246,.11); }
.anova-field-help { margin-top: 6px; color: var(--anova-muted); font-size: .76rem; line-height: 1.45; }
.anova-header-help { margin-top: -9px; margin-bottom: 15px; }
.anova-fields-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

.anova-segmented { display: grid; grid-template-columns: 1fr 1fr; padding: 3px; border: 1px solid #dbe2ea; border-radius: 10px; background: #f1f5f9; }
.anova-segmented label { margin: 0; cursor: pointer; }
.anova-segmented input { position: absolute; opacity: 0; pointer-events: none; }
.anova-segmented span { display: block; padding: 8px 9px; border-radius: 7px; color: #64748b; text-align: center; font-size: .8rem; font-weight: 750; }
.anova-segmented input:checked + span { background: #fff; color: #1d4ed8; box-shadow: 0 1px 3px rgba(15,23,42,.1); }

.anova-check-row { display: flex; align-items: center; gap: 9px; margin-top: 3px; }
.anova-check-row input { width: 16px; height: 16px; margin: 0; }
.anova-check-row label { margin: 0 !important; cursor: pointer; }
.anova-format-note { margin-bottom: 16px; padding: 11px 12px; border: 1px solid #e2e8f0; border-radius: 9px; background: #fff; color: #475569; font-size: .78rem; line-height: 1.55; }
.anova-format-note strong { display: block; margin-bottom: 5px; color: #334155; }
.anova-format-note code { color: #1d4ed8; font-size: .76rem; }
.anova-variable-details { margin-bottom: 16px; border: 1px solid #e2e8f0; border-radius: 9px; background: #fff; }
.anova-variable-details summary { padding: 10px 12px; cursor: pointer; color: #475569; font-size: .8rem; font-weight: 750; }
.anova-variable-details-body { padding: 2px 12px 12px; }
.anova-variable-details-body .anova-field:last-child { margin-bottom: 0; }
.anova-form-actions { display: flex; gap: 9px; margin-top: 8px; flex-wrap: wrap; }
.anova-form-actions .btn { min-width: 110px; }
.is-hidden { display: none !important; }

.anova-textarea.data-paste-area.has-preview { height: 45px !important; min-height: 45px !important; resize: none; overflow: hidden; color: transparent; caret-color: #334155; }
.anova-textarea.data-paste-area.has-preview::selection { color: transparent; background: transparent; }
.anova-data-preview-wrapper { display: none; max-height: 310px; margin-top: 10px; overflow: auto; border: 1px solid var(--anova-border); border-radius: 8px; background: #fff; }
.anova-data-preview-wrapper.has-data { display: block; }
.anova-data-preview-table { width: 100%; border-collapse: collapse; color: #334155; font-size: .82rem; font-variant-numeric: tabular-nums; }
.anova-data-preview-table td,
.anova-data-preview-table th { min-width: 70px; padding: 6px 9px; border: 1px solid #e5e7eb; white-space: nowrap; }
.anova-data-preview-table td { text-align: right; }
.anova-data-preview-table th { position: sticky; top: 0; z-index: 1; background: #eff6ff; color: #1d4ed8; text-align: left; font-weight: 800; }
.anova-data-preview-table tr:nth-child(even) td { background: #f8fafc; }

.anova-result-heading { margin-bottom: 14px; }
.anova-result-heading span { color: #94a3b8; font-size: .72rem; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.anova-result-heading h3 { margin: 3px 0 0; color: #1f2937; font-size: 1rem; font-weight: 780; }
.anova-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 17px; }
.anova-metric-card,
.anova-table-card,
.anova-chart-card,
.anova-notes-card { border: 1px solid var(--anova-border); border-radius: 12px; background: #fff; }
.anova-metric-card { padding: 14px; }
.anova-metric-card span { display: block; color: var(--anova-muted); font-size: .75rem; font-weight: 700; }
.anova-metric-card strong { display: block; margin-top: 5px; font-size: 1.1rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.anova-metric-card small { display: block; margin-top: 4px; color: #94a3b8; font-size: .71rem; }

.anova-status { display: flex; justify-content: space-between; gap: 18px; align-items: center; margin-bottom: 12px; padding: 14px 16px; border-radius: 11px; border: 1px solid; }
.anova-status strong { font-size: .88rem; }
.anova-status p { margin: 3px 0 0; font-size: .8rem; line-height: 1.45; }
.anova-status > span { flex: 0 0 auto; font-size: .73rem; font-weight: 750; }
.anova-status-retain { border-color: #bbf7d0; background: #f0fdf4; color: #166534; }
.anova-status-reject { border-color: #fecaca; background: #fef2f2; color: #991b1b; }

.anova-notes-card { margin-bottom: 17px; padding: 14px 16px; background: #f8fafc; }
.anova-notes-card strong { color: #334155; font-size: .82rem; }
.anova-notes-card p { margin: 6px 0 0; color: #64748b; font-size: .79rem; line-height: 1.5; }
.anova-table-card,
.anova-chart-card { margin-bottom: 17px; padding: 16px; }
.anova-card-heading { margin-bottom: 12px; }
.anova-card-heading h3 { margin: 0; color: #334155; font-size: .9rem; font-weight: 800; }
.anova-card-heading p { margin: 5px 0 0; color: #64748b; font-size: .75rem; line-height: 1.5; }
.anova-table-scroll { overflow-x: auto; }
.anova-results-table { width: 100%; border-collapse: collapse; font-size: .79rem; font-variant-numeric: tabular-nums; }
.anova-results-table th,
.anova-results-table td { padding: 8px 9px; border-bottom: 1px solid #e5e7eb; text-align: right; white-space: nowrap; }
.anova-results-table th { background: #f8fafc; color: #475569; font-weight: 800; }
.anova-results-table th:first-child,
.anova-results-table td:first-child { text-align: left; }
.anova-results-table tbody tr:last-child td { border-bottom: 0; }
.anova-plotly-chart { min-width: 0; min-height: 360px; overflow: hidden; }

.anova-empty-state { min-height: 480px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--anova-muted); }
.anova-empty-icon { width: 56px; height: 56px; display: grid; place-items: center; margin-bottom: 12px; border-radius: 50%; background: #eff6ff; color: #2563eb; font-size: 1.7rem; }
.anova-empty-state h3 { margin: 0 0 6px; color: #334155; font-size: 1rem; }
.anova-empty-state p { max-width: 460px; margin: 0; font-size: .84rem; line-height: 1.55; }

@media (max-width: 1180px) {
    .anova-workspace { grid-template-columns: 1fr; }
    .anova-input-panel { position: static; }
    .anova-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
    .anova-page { margin: 14px 0 28px; }
    .anova-hero,
    .anova-section { padding: 18px; }
    .anova-section-header { flex-direction: column; }
    .anova-input-panel,
    .anova-result-panel { padding: 16px; }
    .anova-fields-grid,
    .anova-metrics { grid-template-columns: 1fr; }
    .anova-status { align-items: flex-start; flex-direction: column; }
}
