:root {
    color: #18212f;
    background: #f3f5f7;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-synthesis: none;
}

* {
    box-sizing: border-box;
}

body {
    min-width: 320px;
    margin: 0;
    background: #f3f5f7;
}

a { color: #116c65; }

.nav-link {
    padding: 8px 6px;
    color: #4c5969;
    font-size: 14px;
    font-weight: 650;
    text-decoration: none;
}

.nav-link:hover { color: #116c65; }

.feedback-trigger {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 15;
    box-shadow: 0 4px 14px rgba(24, 33, 47, 0.14);
}

.feedback-dialog,
.save-dialog {
    width: min(440px, calc(100% - 32px));
    padding: 0;
    border: 1px solid #d8dee5;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 20px 60px rgba(20, 28, 39, 0.22);
}

.feedback-dialog::backdrop,
.save-dialog::backdrop { background: rgba(20, 28, 39, 0.45); }

.feedback-dialog form,
.save-dialog form { display: grid; gap: 16px; padding: 22px; }

.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-heading h2 { margin: 0; font-size: 19px; }
.icon-button { width: 34px; height: 34px; padding: 0; border-radius: 50%; background: #edf1f4; color: #344153; font-size: 22px; }

.feedback-dialog label,
.save-dialog label,
.stack-form label { display: grid; gap: 7px; color: #344153; font-size: 13px; font-weight: 700; }

textarea { min-height: 110px; resize: vertical; }
textarea,
.stack-form input,
.feedback-dialog select,
.save-dialog input {
    width: 100%;
    padding: 10px 11px;
    border: 1px solid #cbd3dc;
    border-radius: 6px;
    background: #fff;
    color: #18212f;
    font: inherit;
}

.form-status { min-height: 20px; margin: 0; color: #596779; font-size: 13px; }

.auth-shell { display: grid; min-height: calc(100vh - 180px); place-items: center; }
.auth-panel { width: min(480px, 100%); padding: 28px; border: 1px solid #d8dee5; border-radius: 8px; background: #fff; box-shadow: 0 4px 18px rgba(24, 33, 47, 0.06); }
.auth-panel h1 { margin-bottom: 24px; font-size: 30px; }
.stack-form { display: grid; gap: 14px; }
.stack-form p { display: grid; gap: 6px; margin: 0; color: #465365; font-size: 13px; font-weight: 650; }
.stack-form .helptext, .stack-form ul { color: #75808e; font-size: 12px; font-weight: 400; line-height: 1.45; }
.stack-form ul { margin: 0; padding-left: 18px; }
.stack-form .errorlist { color: #b42318; }
.auth-copy { margin: 0 0 22px; color: #5f6c7c; line-height: 1.65; }
.verification-waiting { display: flex; margin: -4px 0 22px; align-items: center; gap: 8px; color: #526172; font-size: 13px; font-weight: 700; }
.auth-help { display: flex; margin: 16px 0; justify-content: space-between; gap: 12px; font-size: 13px; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.dashboard-main, .dashboard-side { border: 1px solid #d8dee5; border-radius: 8px; background: #fff; }
.dashboard-main { padding: 20px; }
.dashboard-side { padding: 20px; }
.dashboard-side h2 { margin: 0 0 8px; font-size: 17px; }
.dashboard-side hr { margin: 22px 0; border: 0; border-top: 1px solid #e2e7ec; }
.project-list { display: grid; }
.project-row { display: flex; min-height: 70px; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid #e5e9ed; }
.project-row:last-child { border-bottom: 0; }
.project-row > div { display: grid; gap: 5px; }
.project-row a { color: #243142; text-decoration: none; }
.project-row span { color: #77818f; font-size: 12px; }
.empty-state { padding: 70px 20px; color: #667282; text-align: center; }
.empty-state h2 { color: #263445; font-size: 19px; }

.pricing-shell { max-width: 840px; margin: 0 auto; }
.center-heading { max-width: 620px; margin: 10px auto 34px; text-align: center; }
.center-heading p:last-child { color: #667282; }
.price-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.price-card { position: relative; display: grid; min-height: 310px; padding: 26px; align-content: start; gap: 18px; border: 1px solid #d5dce3; border-radius: 8px; background: #fff; }
.price-card-featured { border: 2px solid #16766f; }
.price-card h2, .price-card p { margin: 0; }
.price-card p { color: #637080; line-height: 1.6; }
.price { color: #172332; font-size: 34px; }
.price small { color: #73808d; font-size: 14px; }
.plan-badge { position: absolute; top: 16px; right: 16px; padding: 4px 8px; border-radius: 5px; background: #e6f4f2; color: #11645e; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.privacy-note { margin-top: 20px; color: #75808e; font-size: 12px; text-align: center; }
.quota-badge, .quota-summary { color: #526172; font-size: 12px; font-weight: 750; white-space: nowrap; }
.quota-summary { padding: 9px 11px; border: 1px solid #d9e0e6; border-radius: 6px; background: #f6f8f9; }
.result-upgrade-link { display: inline-flex; margin-left: 12px; }
.account-list { display: grid; margin: 0 0 22px; }
.account-list div { display: flex; justify-content: space-between; padding: 13px 0; border-bottom: 1px solid #e5e9ed; }
.account-list dt { color: #6a7685; }
.account-list dd { margin: 0; font-weight: 700; }
.account-actions { display: flex; align-items: center; justify-content: space-between; }
.feedback-row { display: grid; grid-template-columns: 60px 1fr auto; gap: 14px; padding: 13px 0; border-bottom: 1px solid #e5e9ed; }
.policy-page { max-width: 760px; margin: 0 auto; }
.policy-page h1 { margin-bottom: 30px; }
.policy-page p { color: #5f6c7c; line-height: 1.7; }
.policy-intro { margin: -18px 0 24px; }
.policy-disclosures { overflow: hidden; border-top: 1px solid #dce2e8; }
.policy-disclosures details { border-bottom: 1px solid #dce2e8; background: #ffffff; }
.policy-disclosures summary { padding: 17px 46px 17px 18px; }
.policy-disclosures details > p { margin: 0; padding: 0 46px 18px 18px; }

@media (max-width: 760px) {
    .app-header-inner { width: min(100% - 24px, 1240px); align-items: flex-start; padding: 12px 0; }
    .page-nav { flex-wrap: wrap; justify-content: flex-end; }
    .nav-link { font-size: 12px; }
    .dashboard-grid, .price-grid { grid-template-columns: 1fr; }
    .feedback-row { grid-template-columns: 50px 1fr; }
    .feedback-row small { grid-column: 2; }
}

button,
input,
select {
    font: inherit;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid #dfe3e8;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
}

.app-header-inner {
    display: flex;
    width: min(1240px, calc(100% - 40px));
    min-height: 64px;
    margin: 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #18212f;
    font-size: 16px;
    font-weight: 750;
    text-decoration: none;
}

.brand-mark {
    display: inline-flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    background: #16766f;
    color: #ffffff;
    font-size: 12px;
    letter-spacing: 0;
}

.page-shell {
    width: min(1240px, calc(100% - 40px));
    margin: 0 auto;
    padding: 36px 0 56px;
}

.page-nav {
    display: flex;
    gap: 8px;
}

.upload-panel,
.result-layout {
    width: 100%;
}

.workspace-intro,
.result-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
    margin-bottom: 24px;
}

.eyebrow {
    margin: 0 0 6px;
    color: #16766f;
    font-size: 12px;
    font-weight: 750;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    color: #141c27;
    font-size: 36px;
    line-height: 1.15;
    letter-spacing: 0;
}

.intro {
    max-width: 440px;
    margin: 0 0 3px;
    color: #657080;
    font-size: 15px;
    line-height: 1.55;
    text-align: right;
}

.input-workspace {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.trust-panel {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 18px;
    overflow: hidden;
    border: 1px solid #d7dfe5;
    border-radius: 8px;
    background: #ffffff;
}

.trust-disclosure {
    min-width: 0;
    border-right: 1px solid #e1e6eb;
}

.trust-disclosure:last-child {
    border-right: 0;
}

.trust-disclosure summary,
.policy-disclosures summary,
.integrity-banner summary {
    position: relative;
    list-style: none;
    color: #263445;
    font-size: 13px;
    font-weight: 750;
    cursor: pointer;
}

.trust-disclosure summary {
    padding: 15px 42px 15px 17px;
}

.trust-disclosure summary::-webkit-details-marker,
.policy-disclosures summary::-webkit-details-marker,
.integrity-banner summary::-webkit-details-marker {
    display: none;
}

.trust-disclosure summary::after,
.policy-disclosures summary::after,
.integrity-banner summary::after {
    position: absolute;
    top: 50%;
    right: 16px;
    color: #16766f;
    content: "+";
    font-size: 18px;
    font-weight: 500;
    transform: translateY(-50%);
}

.trust-disclosure[open] summary::after,
.policy-disclosures details[open] summary::after,
.integrity-banner[open] summary::after {
    content: "-";
}

.trust-disclosure summary:focus-visible,
.policy-disclosures summary:focus-visible,
.integrity-banner summary:focus-visible {
    outline: 3px solid rgba(22, 118, 111, 0.22);
    outline-offset: -3px;
}

.trust-disclosure > p {
    margin: 0;
    padding: 0 17px 15px;
    color: #697585;
    font-size: 12px;
    line-height: 1.5;
}

.input-card {
    border: 1px solid #d9dee5;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(24, 33, 47, 0.04);
}

.upload-card {
    display: grid;
    gap: 16px;
    padding: 20px;
}

.source-heading {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 11px;
}

.source-heading h2,
.table-card-header h2 {
    margin: 0;
    color: #202a38;
    font-size: 17px;
    line-height: 1.3;
}

.step-number {
    display: inline-flex;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    align-items: center;
    justify-content: center;
    border: 1px solid #b7d9d5;
    border-radius: 50%;
    background: #ecf7f5;
    color: #11645e;
    font-size: 13px;
    font-weight: 750;
}

.help-text,
.note {
    margin: 2px 0 0;
    color: #6c7684;
    font-size: 13px;
    line-height: 1.45;
}

.file-dropzone {
    display: grid;
    min-height: 154px;
    padding: 22px 16px;
    align-content: center;
    justify-items: center;
    gap: 7px;
    border: 1px dashed #aeb7c3;
    border-radius: 8px;
    background: #f8fafb;
    color: #344153;
    text-align: center;
    cursor: pointer;
    transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.file-dropzone:hover,
.file-dropzone.is-dragging {
    border-color: #16766f;
    background: #f0f8f7;
    box-shadow: inset 0 0 0 1px #16766f;
}

.file-dropzone.has-file {
    border-style: solid;
    border-color: #7cb7b1;
    background: #edf8f6;
}

.file-dropzone-title {
    max-width: 100%;
    color: #243142;
    font-size: 14px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.file-dropzone-meta {
    color: #7a8491;
    font-size: 12px;
}

.file-dropzone input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

button,
.secondary-link,
.secondary-button,
.danger-button,
.danger-secondary-button {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    border: 1px solid #18212f;
    border-radius: 7px;
    padding: 0 15px;
    background: #18212f;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: transform 120ms ease, background 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

button:hover:not(:disabled),
.secondary-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(24, 33, 47, 0.12);
}

button:focus-visible,
.secondary-link:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 3px solid rgba(22, 118, 111, 0.22);
    outline-offset: 2px;
}

.secondary-link,
.secondary-button {
    border-color: #d4dae2;
    background: #ffffff;
    color: #344153;
}

.danger-button {
    border-color: #c83d4b;
    background: #c83d4b;
}

.danger-secondary-button {
    border-color: #efc4c8;
    background: #fff7f7;
    color: #ad2f3d;
}

.danger-secondary-button:hover:not(:disabled) {
    border-color: #e79ba3;
    background: #ffebed;
}

.compact-primary {
    width: 100%;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.42;
    transform: none;
    box-shadow: none;
}

.table-card {
    min-width: 0;
    overflow: hidden;
}

.table-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.workspace-toolbar {
    min-height: 70px;
    padding: 14px 16px;
    border-bottom: 1px solid #e2e6eb;
}

.table-actions,
.plot-toolbar,
.toolbar-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
}

.table-actions {
    justify-content: flex-end;
}

.table-actions button,
.plot-toolbar button,
.page-nav > * {
    min-height: 34px;
    padding: 0 11px;
    font-size: 13px;
}

.table-edit-status {
    min-height: 34px;
    margin: 0;
    padding: 9px 16px;
    border-bottom: 1px solid #e6e9ed;
    background: #fafbfc;
    color: #687383;
    font-size: 12px;
}

.data-table-wrap {
    max-height: 430px;
    overflow: auto;
    border: 1px solid #d9dee5;
    border-radius: 7px;
    background: #ffffff;
}

.table-card > .data-table-wrap {
    border: 0;
    border-radius: 0;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: auto;
}

.data-table th,
.data-table td {
    min-width: 145px;
    border-right: 1px solid #e4e8ed;
    border-bottom: 1px solid #e4e8ed;
    padding: 0;
}

.data-table th:last-child,
.data-table td:last-child {
    border-right: 0;
}

.data-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    height: 44px;
    padding: 0 12px;
    background: #f0f3f6;
    color: #354153;
    font-size: 13px;
    text-align: left;
}

.data-table .row-selector-header,
.data-table .row-selector-cell {
    width: 68px;
    min-width: 68px;
    max-width: 68px;
}

.row-selector-header,
.row-selector-cell {
    text-align: center;
}

.row-selector-header input,
.row-selector-cell input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #16766f;
    cursor: pointer;
}

.row-selector-cell {
    position: relative;
    height: 44px;
    background: #f7f9fa;
}

.row-selector-cell .row-select-checkbox {
    position: absolute;
    top: 14px;
    left: 10px;
}

.row-number {
    display: block;
    padding-left: 23px;
    color: #798391;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.data-table tr.is-selected td {
    background: #eef8f6;
}

.data-table tr.is-selected .row-selector-cell {
    background: #deefec;
}

.variable-header {
    display: flex;
    min-height: 43px;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.variable-header > span {
    display: grid;
    gap: 1px;
}

.variable-header small {
    color: #75808e;
    font-size: 10px;
    font-weight: 600;
}

.variable-type-select {
    min-width: 108px;
    height: 29px;
    border: 1px solid #c8d0d9;
    border-radius: 6px;
    padding: 0 25px 0 8px;
    background: #ffffff;
    color: #344153;
    font-size: 12px;
    cursor: pointer;
}

.column-delete-button {
    width: 28px;
    min-width: 28px;
    min-height: 28px;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 0;
    background: transparent;
    color: #707b89;
    font-size: 20px;
    font-weight: 400;
    line-height: 1;
}

.column-delete-button:hover:not(:disabled) {
    border-color: #efc4c8;
    background: #ffebed;
    color: #ad2f3d;
}

.data-table input,
.data-table select {
    width: 100%;
    height: 44px;
    border: 0;
    border-radius: 0;
    padding: 0 12px;
    background: #ffffff;
    color: #18212f;
}

.data-table input:hover,
.data-table select:hover {
    background: #fafcfc;
}

.data-table .row-select-checkbox,
.data-table .variable-type-select {
    width: auto;
}

.data-table .row-select-checkbox {
    width: 16px;
    height: 16px;
    border: 0;
    padding: 0;
}

.data-table .variable-type-select {
    min-width: 108px;
    height: 29px;
    border: 1px solid #c8d0d9;
    border-radius: 6px;
    padding: 0 25px 0 8px;
    font-size: 12px;
}

.data-table input:focus,
.data-table select:focus {
    position: relative;
    z-index: 1;
    outline: 2px solid #16766f;
    outline-offset: -2px;
    background: #ffffff;
}

.data-table select {
    cursor: pointer;
}

.table-footer {
    display: flex;
    min-height: 68px;
    padding: 13px 16px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-top: 1px solid #e2e6eb;
}

.messages {
    margin-bottom: 18px;
}

.message {
    margin: 0 0 10px;
    border: 1px solid #d8dee6;
    border-radius: 7px;
    padding: 12px 14px;
    background: #ffffff;
}

.message-error,
.field-errors {
    color: #9c2734;
}

.message-error {
    border-color: #efc4c8;
    background: #fff4f5;
}

.result-header {
    margin-bottom: 18px;
}

.integrity-banner {
    margin-bottom: 14px;
    border-left: 3px solid #c38a20;
    background: #fff9eb;
    color: #5c4a29;
    font-size: 13px;
    line-height: 1.45;
}

.integrity-banner summary {
    padding: 11px 44px 11px 14px;
    color: #5c4a29;
}

.integrity-banner > p {
    margin: 0;
    padding: 0 44px 12px 14px;
    color: #725f3a;
}

.dataset-count {
    margin-bottom: 4px;
    border: 1px solid #d5dbe2;
    border-radius: 999px;
    padding: 7px 11px;
    background: #ffffff;
    color: #536071;
    font-size: 13px;
    font-weight: 650;
}

.plot-toolbar {
    justify-content: space-between;
    gap: 12px;
    border: 1px solid #d9dee5;
    border-bottom: 0;
    border-radius: 8px 8px 0 0;
    padding: 10px;
    background: #ffffff;
}

.toolbar-group-secondary {
    justify-content: flex-end;
}

.selection-bar {
    display: flex;
    min-height: 34px;
    align-items: center;
    gap: 8px;
    border-right: 1px solid #d9dee5;
    border-left: 1px solid #d9dee5;
    padding: 0 13px;
    background: #f8fafb;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #16766f;
}

.selection-status {
    color: #596576;
    font-size: 13px;
    font-weight: 650;
}

.chart-wrap {
    overflow-x: auto;
    border: 1px solid #d9dee5;
    border-radius: 0 0 8px 8px;
    background: #ffffff;
}

.interactive-chart {
    position: relative;
    width: 100%;
}

canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

#selectionCanvas {
    position: absolute;
    inset: 0;
    cursor: crosshair;
    pointer-events: auto;
}

.arrays {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.arrays > div {
    min-width: 0;
}

.arrays h2 {
    margin: 0 0 7px;
    color: #344153;
    font-size: 13px;
}

pre {
    min-height: 76px;
    max-height: 140px;
    margin: 0;
    overflow: auto;
    border: 1px solid #d9dee5;
    border-radius: 7px;
    padding: 13px;
    background: #ffffff;
    color: #344153;
    font-size: 12px;
    line-height: 1.55;
}

.note {
    margin-top: 14px;
}

.renewed-table-section,
.results-section,
.history-section {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid #d9dee5;
}

.renewed-table-section h2,
.results-section h2,
.history-section h2,
.analysis-subsection h2 {
    margin: 0;
    font-size: 18px;
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}

.section-kicker {
    margin: 0 0 4px;
    color: #16766f;
    font-size: 10px;
    font-weight: 750;
    text-transform: uppercase;
}

.history-list {
    display: grid;
    gap: 8px;
    margin-top: 11px;
}

.history-item {
    display: flex;
    min-height: 58px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border: 1px solid #d9dee5;
    border-radius: 7px;
    padding: 10px 12px;
    background: #ffffff;
}

.history-item > div {
    display: grid;
    gap: 3px;
}

.history-item strong {
    color: #273446;
    font-size: 13px;
}

.history-item span {
    color: #707b89;
    font-size: 12px;
}

.history-item button {
    min-height: 32px;
    padding: 0 10px;
    font-size: 12px;
}

.renewed-table-wrap,
.regression-table-wrap {
    margin-top: 11px;
}

#renewedTable td,
.regression-table td {
    height: 40px;
    padding: 0 12px;
    color: #243142;
    font-variant-numeric: tabular-nums;
}

.regression-table th:nth-child(7),
.regression-table td:nth-child(7) {
    min-width: 210px;
}

.confidence-control {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #465365;
    font-size: 13px;
    font-weight: 650;
    white-space: nowrap;
}

.result-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.result-message {
    margin-top: 12px;
    border: 1px solid #ebc7a5;
    border-radius: 7px;
    padding: 11px 13px;
    background: #fff8ef;
    color: #7b4b1f;
    font-size: 13px;
    line-height: 1.5;
}

.confidence-control select {
    min-height: 34px;
    border: 1px solid #c8d0d9;
    border-radius: 7px;
    padding: 0 28px 0 9px;
    background: #ffffff;
    color: #18212f;
}

.significance-note {
    margin-top: 9px;
    font-size: 12px;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.model-summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.analysis-subsection {
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid #d9dee5;
}

.comparison-metrics {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.comparison-table th,
.comparison-table td,
.influence-table th,
.influence-table td {
    min-width: 150px;
}

.method-guide {
    margin-top: 28px;
    border: 1px solid #d9dee5;
    border-radius: 7px;
    background: #ffffff;
}

.method-guide summary {
    padding: 14px 16px;
    color: #273446;
    font-size: 14px;
    font-weight: 750;
    cursor: pointer;
}

.method-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    border-top: 1px solid #e2e6eb;
}

.method-grid > div {
    display: grid;
    gap: 4px;
    padding: 13px 16px;
    border-right: 1px solid #e8ebef;
    border-bottom: 1px solid #e8ebef;
}

.method-grid > div:nth-child(2n) {
    border-right: 0;
}

.method-grid strong {
    color: #344153;
    font-size: 12px;
}

.method-grid span {
    color: #6b7685;
    font-size: 12px;
    line-height: 1.5;
}

.result-metric {
    border: 1px solid #d9dee5;
    border-radius: 7px;
    padding: 13px;
    background: #ffffff;
}

.result-metric span {
    display: block;
    color: #727d8b;
    font-size: 11px;
    font-weight: 750;
    text-transform: uppercase;
}

.result-metric strong {
    display: block;
    margin-top: 7px;
    color: #18212f;
    font-size: 20px;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

@media (max-width: 960px) {
    .input-workspace {
        grid-template-columns: 1fr;
    }

    .upload-card {
        grid-template-columns: minmax(180px, 0.6fr) minmax(260px, 1.4fr) auto;
        align-items: center;
    }

    .file-dropzone {
        min-height: 92px;
    }
}

@media (max-width: 720px) {
    .app-header-inner,
    .page-shell {
        width: min(100% - 24px, 1240px);
    }

    .app-header-inner {
        min-height: 0;
        padding: 12px 0;
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
    }

    .page-nav {
        display: grid;
        width: 100%;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 4px;
    }

    .page-nav > * {
        display: flex;
        min-width: 0;
        padding-right: 6px;
        padding-left: 6px;
        align-items: center;
        justify-content: center;
        text-align: center;
    }

    .page-shell {
        padding: 24px 0 40px;
    }

    .workspace-intro,
    .result-header {
        display: block;
    }

    .trust-panel,
    .method-grid {
        grid-template-columns: 1fr;
    }

    .trust-disclosure,
    .method-grid > div,
    .method-grid > div:nth-child(2n) {
        border-right: 0;
        border-bottom: 1px solid #e1e6eb;
    }

    .trust-disclosure:last-child {
        border-bottom: 0;
    }

    h1 {
        font-size: 30px;
    }

    .intro {
        margin-top: 8px;
        text-align: left;
    }

    .upload-card {
        grid-template-columns: 1fr;
    }

    .workspace-toolbar,
    .table-card-header,
    .table-footer,
    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .integrity-banner,
    .history-item {
        align-items: flex-start;
        flex-direction: column;
    }

    .history-item button {
        width: 100%;
    }

    .result-controls {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
    }

    .table-actions,
    .table-actions > button,
    .table-footer > button {
        width: 100%;
    }

    .table-actions > button {
        flex: 1 1 140px;
    }

    .plot-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .toolbar-group {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .toolbar-group button {
        width: 100%;
        white-space: normal;
    }

    .toolbar-group-secondary .quota-badge {
        grid-column: 1 / -1;
        width: 100%;
        padding: 6px 8px;
        border-radius: 5px;
        background: #f3f6f8;
        text-align: center;
        white-space: normal;
    }

    .arrays,
    .results-grid,
    .model-summary-grid {
        grid-template-columns: 1fr;
    }

    .dataset-count {
        display: inline-block;
        margin-top: 10px;
    }
}
