.ads-prediction-page {
    --prediction-line: #e2e8f0;
    --prediction-muted: #64748b;
    min-height: calc(100vh - 60px);
}

.prediction-progress[hidden],
.prediction-dashboard[hidden],
.prediction-modal[hidden],
.prediction-confidence[hidden],
#predictionResultContent[hidden],
#predictionResultEmpty[hidden] {
    display: none !important;
}

.ads-prediction-page .page-header {
    align-items: flex-end;
}

.prediction-upload-card {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(420px, 1.1fr);
    gap: 38px;
    margin-top: 22px;
    padding: 30px;
    border: 1px solid var(--hairline);
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.prediction-upload-copy {
    padding: 6px 4px;
}

.prediction-eyebrow,
.prediction-version {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 9px;
    border-radius: 999px;
    background: var(--primary-50);
    color: var(--primary-hover);
    font-size: 11px;
    font-weight: 750;
}

.prediction-upload-copy h2 {
    margin-top: 16px;
    font-size: 23px;
    letter-spacing: -.02em;
}

.prediction-upload-copy > p {
    max-width: 60ch;
    margin-top: 9px;
    color: var(--ink-secondary);
    font-size: 13px;
    line-height: 1.7;
}

.prediction-upload-copy ul {
    display: grid;
    gap: 10px;
    margin-top: 21px;
    list-style: none;
    color: #475569;
    font-size: 12px;
}

.prediction-upload-copy li {
    display: flex;
    align-items: flex-start;
    gap: 9px;
}

.prediction-upload-copy li i {
    margin-top: 3px;
    color: #059669;
}

.prediction-upload-form {
    display: grid;
    align-content: center;
    gap: 14px;
}

.prediction-dropzone {
    display: grid;
    min-height: 184px;
    place-items: center;
    align-content: center;
    gap: 7px;
    padding: 24px;
    border: 1px dashed #c4b5fd;
    border-radius: 13px;
    background: #faf9ff;
    text-align: center;
    cursor: pointer;
    transition: border-color 160ms ease, background-color 160ms ease;
}

.prediction-dropzone:hover,
.prediction-dropzone.is-dragging {
    border-color: var(--primary);
    background: var(--primary-50);
}

.prediction-dropzone input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.prediction-dropzone-icon {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 11px;
    background: #e8f7ee;
    color: #138a5b;
    font-size: 18px;
}

.prediction-dropzone strong {
    max-width: 100%;
    overflow: hidden;
    color: #273449;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.prediction-dropzone small {
    color: #7c8798;
    font-size: 11px;
}

.prediction-upload-row,
.prediction-input-grid {
    display: grid;
    grid-template-columns: minmax(150px, .55fr) minmax(220px, 1fr);
    gap: 10px;
}

.prediction-upload-row label,
.prediction-field {
    display: grid;
    gap: 6px;
    color: #334155;
    font-size: 11px;
    font-weight: 700;
}

.prediction-upload-row select,
.prediction-field select,
.prediction-field input,
.prediction-table-search input {
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    outline: none;
    background: #fff;
    color: #172033;
    font: inherit;
    font-weight: 500;
}

.prediction-upload-row select:focus-visible,
.prediction-field select:focus-visible,
.prediction-field input:focus-visible,
.prediction-table-search input:focus-visible {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgb(139 92 246 / 14%);
}

.prediction-upload-row .btn-primary {
    align-self: end;
    min-height: 40px;
}

.prediction-progress {
    display: grid;
    gap: 7px;
}

.prediction-progress > div {
    display: flex;
    justify-content: space-between;
    color: #64748b;
    font-size: 11px;
}

.prediction-progress-track,
.prediction-confidence > span {
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: #e8ecf3;
}

.prediction-progress-track i,
.prediction-confidence i {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--primary);
    transition: width 180ms ease;
}

.prediction-form-status {
    min-height: 18px;
    color: #64748b;
    font-size: 11px;
}

.prediction-form-status.is-error {
    color: #b42318;
}

.prediction-dashboard {
    margin-top: 20px;
}

.prediction-source-proof {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 13px 15px;
    border: 1px solid #cfe6da;
    border-radius: 11px;
    background: #f4fbf7;
    color: #315c48;
    font-size: 12px;
}

.prediction-source-dot {
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #138a5b;
    box-shadow: 0 0 0 4px rgb(19 138 91 / 10%);
}

.prediction-source-proof strong {
    color: #184d36;
}

.prediction-source-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 15px;
    margin-left: auto;
    color: #48705d;
    font-size: 11px;
}

.prediction-source-meta span + span::before {
    content: '·';
    margin-right: 15px;
    color: #8eaa9b;
}

.prediction-metric-rail {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    margin-top: 14px;
    overflow: hidden;
    border: 1px solid var(--prediction-line);
    border-radius: 14px;
    background: #fff;
}

.prediction-metric-rail > div {
    min-width: 0;
    padding: 16px 18px;
}

.prediction-metric-rail > div + div {
    border-left: 1px solid var(--prediction-line);
}

.prediction-metric-rail span,
.prediction-baseline-box span {
    display: block;
    color: #7b8799;
    font-size: 10px;
}

.prediction-metric-rail strong {
    display: block;
    margin-top: 4px;
    overflow: hidden;
    color: #172033;
    font-size: 20px;
    letter-spacing: -.02em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.prediction-metric-rail small {
    display: block;
    margin-top: 3px;
    color: #64748b;
    font-size: 9px;
}

.prediction-quality-line {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding: 11px 14px;
    border: 1px solid #eed7aa;
    border-radius: 10px;
    background: #fff6e7;
    color: #6f4d1d;
    font-size: 12px;
}

.prediction-quality-line > span {
    flex: 0 0 auto;
    padding: 4px 8px;
    border-radius: 999px;
    background: #f7e5bc;
    color: #7c4c05;
    font-size: 10px;
    font-weight: 800;
}

.prediction-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin: 25px 0 11px;
}

.prediction-section-heading h2 {
    font-size: 18px;
}

.prediction-section-heading p,
.prediction-panel-head p {
    margin-top: 4px;
    color: #64748b;
    font-size: 11px;
}

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

.prediction-panel {
    min-width: 0;
    border: 1px solid var(--prediction-line);
    border-radius: 14px;
    background: #fff;
}

.prediction-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
    padding: 17px 18px 14px;
    border-bottom: 1px solid var(--prediction-line);
}

.prediction-panel-head h3 {
    font-size: 14px;
}

.prediction-panel-body {
    padding: 17px 18px;
}

.prediction-form-stack {
    display: grid;
    gap: 15px;
}

.prediction-field > span:first-of-type {
    justify-self: end;
    margin-top: -21px;
    color: #8a95a6;
    font-size: 9px;
    font-weight: 500;
}

.prediction-fieldset {
    border: 0;
}

.prediction-fieldset legend {
    margin-bottom: 6px;
    color: #334155;
    font-size: 11px;
    font-weight: 700;
}

.prediction-segmented {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3px;
    padding: 3px;
    border: 1px solid var(--prediction-line);
    border-radius: 9px;
    background: #f8fafc;
}

.prediction-segmented button {
    min-height: 31px;
    border-radius: 6px;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
}

.prediction-segmented button.active {
    background: #fff;
    color: var(--primary-hover);
    box-shadow: var(--shadow-sm);
}

.prediction-baseline-box {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--prediction-line);
    border-radius: 9px;
    background: var(--prediction-line);
}

.prediction-baseline-box div {
    min-width: 0;
    padding: 10px;
    background: #f8fafc;
}

.prediction-baseline-box strong {
    display: block;
    margin-top: 4px;
    overflow: hidden;
    color: #344054;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.prediction-input-grid {
    grid-template-columns: 1fr 1fr;
}

.prediction-number {
    position: relative;
    display: block;
}

.prediction-number input {
    padding-right: 37px;
    padding-left: 25px;
}

.prediction-number b,
.prediction-number em {
    position: absolute;
    top: 50%;
    z-index: 1;
    color: #8a95a6;
    font-size: 10px;
    font-style: normal;
    font-weight: 500;
    pointer-events: none;
    transform: translateY(-50%);
}

.prediction-number b { left: 10px; }
.prediction-number em { right: 10px; }

.prediction-field input[type='range'] {
    min-height: auto;
    padding: 0;
    border: 0;
    accent-color: var(--primary);
    box-shadow: none;
}

.prediction-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: -8px;
}

.prediction-quick-actions button {
    padding: 5px 8px;
    border: 1px solid var(--prediction-line);
    border-radius: 999px;
    background: #fff;
    color: #64748b;
    font-size: 9px;
}

.prediction-quick-actions button:hover {
    border-color: #bda9ee;
    color: var(--primary-hover);
}

.prediction-budget-note {
    display: flex;
    gap: 8px;
    padding: 10px;
    border-radius: 8px;
    background: #fff6e7;
    color: #74501d;
    font-size: 10px;
    line-height: 1.55;
}

.prediction-goal-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 92px;
    gap: 9px;
    align-items: end;
}

.prediction-goal-grid .prediction-budget-note {
    min-height: 62px;
}

.prediction-goal-grid .prediction-number input {
    padding-right: 26px;
    padding-left: 10px;
}

.prediction-assumptions {
    padding-top: 13px;
    border-top: 1px solid var(--prediction-line);
    color: #64748b;
    font-size: 10px;
}

.prediction-assumptions summary { cursor: pointer; font-weight: 700; }
.prediction-assumptions ul { margin: 9px 0 0 18px; color: #7b8799; line-height: 1.7; }
.prediction-run-button { width: 100%; min-height: 40px; }

.prediction-status-pill {
    padding: 4px 7px;
    border-radius: 999px;
    background: #eef2ff;
    color: #4f46e5;
    font-size: 9px;
    font-weight: 800;
}

.prediction-status-pill.is-warn { background: #fff6e7; color: #a15c08; }

.prediction-confidence {
    display: grid;
    justify-items: end;
    gap: 2px;
}

.prediction-confidence strong { color: #4f46b8; font-size: 11px; white-space: nowrap; }
.prediction-confidence small { color: #7b8799; font-size: 9px; white-space: nowrap; }

.prediction-result-empty {
    display: grid;
    min-height: 420px;
    place-items: center;
    align-content: center;
    padding: 24px;
    color: #7b8799;
    text-align: center;
}

.prediction-result-empty-core { width: min(100%, 440px); }
.prediction-result-empty-core > i { color: #a78bfa; font-size: 28px; }
.prediction-result-empty-core > strong { display: block; margin-top: 12px; color: #334155; font-size: 13px; }
.prediction-result-empty-core > p { max-width: 44ch; margin: 7px auto 0; font-size: 11px; }

.prediction-result-guide {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-top: 22px;
    padding: 12px 14px;
    border: 1px solid #d8ccfa;
    border-radius: 10px;
    background: #f8f6ff;
    color: #443273;
    text-align: left;
}

.prediction-result-guide-arrow {
    display: grid;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 14px;
}

.prediction-result-guide strong { display: block; color: #382369; font-size: 11px; }
.prediction-result-guide small { display: block; margin-top: 2px; color: #68588f; font-size: 9px; }
.prediction-result-guide .is-mobile { display: none; }

.prediction-result-summary {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(260px, .75fr);
    gap: 16px;
    padding: 18px;
}

.prediction-decision-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 17px 18px 0;
    padding: 12px 13px;
    border: 1px solid var(--prediction-line);
    border-radius: 10px;
    background: #f8fafc;
}

.prediction-decision-banner strong { display: block; color: #273449; font-size: 11px; }
.prediction-decision-banner p { margin-top: 3px; color: #64748b; font-size: 9px; }
.prediction-decision-banner > span {
    flex: 0 0 auto;
    padding: 5px 8px;
    border-radius: 7px;
    background: #fff6e7;
    color: #9a5d09;
    font-size: 9px;
    font-weight: 800;
}
.prediction-decision-banner > span.is-positive { background: #eaf7f1; color: #087f71; }
.prediction-decision-banner > span.is-risk { background: #fff0f1; color: #b23b45; }

.prediction-probability-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 12px 18px 0;
    overflow: hidden;
    border: 1px solid var(--prediction-line);
    border-radius: 10px;
}

.prediction-probability-grid > div {
    min-width: 0;
    padding: 12px;
}

.prediction-probability-grid > div + div { border-left: 1px solid var(--prediction-line); }
.prediction-probability-grid span { display: block; color: #64748b; font-size: 9px; }
.prediction-probability-grid small { display: block; margin-top: 2px; color: #8a95a6; font-size: 8px; }
.prediction-probability-grid strong { display: block; margin-top: 7px; color: #172033; font-size: 20px; letter-spacing: -.02em; }

.prediction-comparison {
    overflow: hidden;
    border: 1px solid var(--prediction-line);
    border-radius: 10px;
}

.prediction-comparison-row {
    display: grid;
    grid-template-columns: minmax(105px, 1.2fr) repeat(3, minmax(80px, 1fr));
    align-items: center;
    min-height: 50px;
    padding: 0 13px;
}

.prediction-comparison-row + .prediction-comparison-row { border-top: 1px solid var(--prediction-line); }
.prediction-comparison-row.is-head { min-height: 36px; background: #f8fafc; color: #7b8799; font-size: 9px; font-weight: 700; }
.prediction-comparison-row > *:not(:first-child) { text-align: right; }
.prediction-comparison-label strong { display: block; font-size: 11px; }
.prediction-comparison-label small { color: #8a95a6; font-size: 8px; }
.prediction-comparison-number { color: #344054; font-size: 12px; font-weight: 700; }
.prediction-interval strong { display: block; color: #344054; font-size: 11px; }
.prediction-interval small { display: block; margin-top: 2px; color: #8a95a6; font-size: 8px; white-space: nowrap; }
.prediction-interval-track { position: relative; display: block; height: 4px; margin-top: 5px; overflow: hidden; border-radius: 999px; background: #e9edf4; }
.prediction-interval-track i { position: absolute; height: 100%; border-radius: inherit; background: #aab2c2; }
.prediction-interval-track.is-scenario i { background: var(--primary); }
.prediction-delta { font-size: 10px; font-weight: 800; }
.prediction-delta.is-positive { color: #138a5b; }
.prediction-delta.is-negative { color: #c33c52; }
.prediction-delta.is-neutral { color: #8a95a6; }

.prediction-decision-panel {
    padding: 14px;
    border-radius: 10px;
    background: #172033;
    color: #fff;
}

.prediction-decision-panel h4 { font-size: 12px; }
.prediction-decision-panel > p { margin: 6px 0 12px; color: #bfc9d9; font-size: 9px; }
.prediction-decision-item { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 9px; padding: 10px 0; }
.prediction-decision-item + .prediction-decision-item { border-top: 1px solid #344056; }
.prediction-decision-item > span { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 7px; background: #29364d; color: #c8b7ff; font-size: 10px; font-weight: 800; }
.prediction-decision-item strong { font-size: 10px; }
.prediction-decision-item p { margin-top: 3px; color: #b8c4d6; font-size: 9px; line-height: 1.55; }

.prediction-legend {
    display: flex;
    justify-content: flex-end;
    gap: 13px;
    padding: 0 18px 12px;
    color: #7b8799;
    font-size: 9px;
}

.prediction-legend span { display: inline-flex; align-items: center; gap: 5px; }
.prediction-legend i { width: 13px; height: 4px; border-radius: 999px; background: #b9c2d0; }
.prediction-legend span:last-child i { background: var(--primary); }
.prediction-forecast-bars { display: grid; gap: 11px; padding: 0 18px 18px; }
.prediction-bar-row { display: grid; grid-template-columns: 86px minmax(0, 1fr) 110px; align-items: center; gap: 11px; }
.prediction-bar-row > span { color: #64748b; font-size: 10px; }
.prediction-bar-pair { display: grid; gap: 4px; }
.prediction-bar-line { height: 8px; overflow: hidden; border-radius: 999px; background: #edf0f5; }
.prediction-bar-line i { display: block; height: 100%; border-radius: inherit; background: #b9c2d0; }
.prediction-bar-line:last-child i { background: var(--primary); }
.prediction-bar-row strong { color: #344054; font-size: 10px; text-align: right; }

.prediction-result-notes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    padding: 0 18px 18px;
}

.prediction-result-notes p {
    min-height: 52px;
    padding: 10px 11px;
    border: 1px solid #d8ccfa;
    border-radius: 8px;
    background: #f8f6ff;
    color: #59487d;
    font-size: 9px;
    line-height: 1.55;
}

.prediction-result-notes p:last-child {
    border-color: #eed7aa;
    background: #fff8eb;
    color: #74501d;
}

.prediction-lower-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr);
    gap: 14px;
    margin-top: 14px;
}

.prediction-chart-toolbar {
    display: flex;
    gap: 3px;
    padding: 3px;
    border: 1px solid var(--prediction-line);
    border-radius: 8px;
    background: #f8fafc;
}

.prediction-chart-toolbar button {
    padding: 5px 8px;
    border-radius: 5px;
    color: #7b8799;
    font-size: 9px;
    font-weight: 700;
}

.prediction-chart-toolbar button.active { background: #fff; color: var(--primary-hover); box-shadow: var(--shadow-sm); }
.prediction-chart-wrap { padding: 10px 16px 16px; }
#predictionHistoryChart { display: block; width: 100%; height: 230px; }

.prediction-coverage-list { display: grid; }
.prediction-coverage-row { display: grid; grid-template-columns: minmax(0, 1fr) 78px; gap: 12px; align-items: center; padding: 12px 0; }
.prediction-coverage-row + .prediction-coverage-row { border-top: 1px solid var(--prediction-line); }
.prediction-coverage-row strong { display: block; font-size: 10px; }
.prediction-coverage-row p { margin-top: 3px; color: #7b8799; font-size: 9px; }
.prediction-coverage-row span { justify-self: end; padding: 5px 8px; border-radius: 999px; background: #eaf7f1; color: #138a5b; font-size: 9px; font-weight: 800; }
.prediction-coverage-row span.is-warn { background: #fff6e7; color: #a15c08; }

.prediction-campaign-section { margin-top: 14px; }

.prediction-method-flow { margin-top: 14px; }
.prediction-flow-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 24px; padding: 17px 18px; }
.prediction-flow-steps > div { position: relative; min-width: 0; }
.prediction-flow-steps > div:not(:last-child)::after { content: '→'; position: absolute; top: 5px; right: -17px; color: #9ba4b5; }
.prediction-flow-steps b { display: grid; width: 25px; height: 25px; place-items: center; margin-bottom: 7px; border-radius: 7px; background: #f0ecff; color: #5837c7; font-size: 10px; }
.prediction-flow-steps strong { display: block; color: #344054; font-size: 10px; }
.prediction-flow-steps span { display: block; margin-top: 3px; color: #7b8799; font-size: 8px; line-height: 1.5; }
.prediction-table-search { position: relative; width: min(240px, 36vw); }
.prediction-table-search i { position: absolute; top: 50%; left: 10px; color: #94a3b8; font-size: 10px; transform: translateY(-50%); }
.prediction-table-search input { min-height: 34px; padding-left: 28px; font-size: 11px; }
.prediction-table-wrap { overflow-x: auto; }
.prediction-table { width: 100%; min-width: 910px; border-collapse: collapse; }
.prediction-table th,
.prediction-table td { padding: 11px 13px; border-bottom: 1px solid var(--prediction-line); text-align: right; font-size: 10px; }
.prediction-table th { background: #f8fafc; color: #7b8799; font-size: 9px; font-weight: 750; }
.prediction-table th:first-child,
.prediction-table td:first-child { width: 34%; text-align: left; }
.prediction-table td:first-child strong { display: block; max-width: 44ch; overflow: hidden; color: #303a4c; text-overflow: ellipsis; white-space: nowrap; }
.prediction-table td:first-child small { color: #8a95a6; font-size: 8px; }
.prediction-table tbody tr:hover { background: #fbfcff; }
.prediction-table button { color: var(--primary-hover); font-size: 9px; font-weight: 800; }

.prediction-method-note {
    margin-top: 14px;
    padding: 13px 15px;
    border: 1px solid var(--prediction-line);
    border-radius: 10px;
    background: #fff;
    color: #64748b;
    font-size: 10px;
    line-height: 1.65;
}

.prediction-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
}

.prediction-modal-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgb(15 23 42 / 42%);
}

.prediction-modal-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: min(460px, 100vw);
    height: 100%;
    overflow-y: auto;
    background: #fff;
    box-shadow: -16px 0 40px rgb(15 23 42 / 14%);
}

.prediction-modal-head {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 22px;
    border-bottom: 1px solid var(--prediction-line);
    background: #fff;
}

.prediction-modal-head h2 { font-size: 17px; }
.prediction-modal-head p { margin-top: 4px; color: #64748b; font-size: 11px; }
.prediction-modal-head button { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 8px; color: #64748b; }
.prediction-modal-head button:hover { background: #f1f5f9; }
.prediction-history-list { display: grid; gap: 9px; padding: 16px; }
.prediction-history-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 14px; border: 1px solid var(--prediction-line); border-radius: 11px; }
.prediction-history-item strong { display: block; color: #273449; font-size: 12px; }
.prediction-history-item p { margin-top: 4px; color: #7b8799; font-size: 10px; }
.prediction-history-item button { align-self: center; color: var(--primary-hover); font-size: 10px; font-weight: 800; }

.prediction-toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1300;
    max-width: 360px;
    padding: 11px 14px;
    border-radius: 9px;
    background: #172033;
    color: #fff;
    font-size: 11px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 180ms ease, transform 180ms ease;
}

.prediction-toast.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 1120px) {
    .prediction-upload-card { grid-template-columns: 1fr; }
    .prediction-metric-rail { grid-template-columns: repeat(3, 1fr); }
    .prediction-metric-rail > div:nth-child(4) { border-left: 0; }
    .prediction-metric-rail > div:nth-child(n+4) { border-top: 1px solid var(--prediction-line); }
    .prediction-scenario-layout,
    .prediction-lower-grid { grid-template-columns: 1fr; }
    .prediction-result-summary { grid-template-columns: 1fr; }
    .prediction-result-guide-arrow i { transform: rotate(90deg); }
    .prediction-result-guide .is-desktop { display: none; }
    .prediction-result-guide .is-mobile { display: block; }
}

@media (max-width: 720px) {
    .ads-prediction-page { padding: 18px 11px 42px; }
    .ads-prediction-page .page-header { align-items: flex-start; flex-direction: column; }
    .ads-prediction-page .page-header-right { width: 100%; }
    .ads-prediction-page .page-header-right button { flex: 1; }
    .prediction-upload-card { gap: 22px; padding: 18px; }
    .prediction-upload-row,
    .prediction-input-grid,
    .prediction-goal-grid,
    .prediction-result-notes { grid-template-columns: 1fr; }
    .prediction-source-proof { align-items: flex-start; flex-wrap: wrap; }
    .prediction-source-meta { width: 100%; margin-left: 22px; }
    .prediction-source-meta span + span::before { display: none; }
    .prediction-metric-rail { grid-template-columns: repeat(2, 1fr); }
    .prediction-metric-rail > div { padding: 13px; }
    .prediction-metric-rail > div:nth-child(3),
    .prediction-metric-rail > div:nth-child(5) { border-left: 0; }
    .prediction-metric-rail > div:nth-child(n+3) { border-top: 1px solid var(--prediction-line); }
    .prediction-quality-line { align-items: flex-start; }
    .prediction-section-heading { align-items: flex-start; flex-direction: column; }
    .prediction-comparison-row { grid-template-columns: minmax(86px, 1fr) repeat(3, minmax(62px, .75fr)); padding: 0 9px; }
    .prediction-comparison-label small { display: none; }
    .prediction-comparison-number { font-size: 10px; }
    .prediction-probability-grid { grid-template-columns: repeat(2, 1fr); }
    .prediction-probability-grid > div:nth-child(3) { border-left: 0; }
    .prediction-probability-grid > div:nth-child(n+3) { border-top: 1px solid var(--prediction-line); }
    .prediction-flow-steps { grid-template-columns: 1fr; gap: 13px; }
    .prediction-flow-steps > div { display: grid; grid-template-columns: 32px 1fr; column-gap: 8px; }
    .prediction-flow-steps b { grid-row: 1 / 3; }
    .prediction-flow-steps > div:not(:last-child)::after { content: '↓'; top: 25px; right: auto; left: 10px; }
    .prediction-bar-row { grid-template-columns: 68px minmax(0, 1fr) 84px; }
    .prediction-panel-head { padding: 15px; }
    .prediction-panel-body { padding: 15px; }
    .prediction-table-search { width: 150px; }
    #predictionHistoryChart { height: 190px; }
    .prediction-toast { right: 11px; bottom: 11px; left: 11px; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
    .prediction-toast,
    .prediction-progress-track i,
    .prediction-confidence i { transition-duration: .01ms; }
}
