/* Prediction workspace: brand-blue surfaces and source-first result hierarchy. */
#predictionView {
  --prediction-error: #b42318;
  --prediction-error-soft: #fff3f1;
  --prediction-family-0: var(--family-telecom, #0d7075);
  --prediction-family-0-soft: #eef8f6;
  --prediction-family-1: var(--family-mobile, #0867cf);
  --prediction-family-1-soft: #eef6ff;
  --prediction-family-2: var(--family-unicom, #7054a3);
  --prediction-family-2-soft: #f6f1fc;
  max-width: 1440px;
  margin: 0 auto 40px;
  color: var(--ink);
  min-width: 0;
}
#predictionView [hidden] { display: none !important; }
#predictionView .prediction-icon { flex: 0 0 auto; vertical-align: middle; }
#predictionView .eyebrow { color: var(--primary) !important; font-size: 15px !important; font-weight: 650; letter-spacing: 1px; }
#predictionView .prediction-intro,
#predictionView .prediction-result-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 0 0 24px; }
#predictionView .prediction-intro > div,
#predictionView .prediction-result-heading > div { min-width: 0; }
#predictionView .prediction-intro h2,
#predictionView .prediction-result-heading h2 { margin: 8px 0 10px; color: var(--ink); font-size: 27px; line-height: 1.45; font-weight: 650; letter-spacing: -.4px; text-wrap: balance; }
#predictionView .prediction-intro p,
#predictionView .prediction-result-heading p { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.7; overflow-wrap: anywhere; }
#predictionView .prediction-secondary { display: inline-flex; align-items: center; justify-content: center; gap: 10px; flex-shrink: 0; min-height: 42px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--primary); font-size: 16px; font-weight: 550; text-decoration: none; white-space: nowrap; transition: background .16s ease, border-color .16s ease; }
#predictionView .prediction-secondary:hover { border-color: var(--primary); background: var(--primary-soft); }
#predictionView .prediction-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; align-items: start; }
#predictionView.has-results .prediction-workspace { grid-template-columns: minmax(0, 1fr); }
#predictionView .prediction-upload { min-width: 0; padding: 26px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 3px 14px rgb(23 43 70 / 3%); }
#predictionView .prediction-upload-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
#predictionView .prediction-section-icon { display: grid; place-items: center; width: 42px; height: 42px; flex-shrink: 0; border-radius: 10px; background: var(--primary-soft); color: var(--primary); }
#predictionView .prediction-upload-heading h3 { margin: 0 0 4px; font-size: 17px; font-weight: 650; line-height: 1.5; }
#predictionView .prediction-upload-heading p { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.6; }
#predictionView .prediction-required { margin-left: auto; flex-shrink: 0; padding: 3px 8px; border-radius: 5px; color: var(--muted); background: var(--bg); font-size: 15px; }
#predictionView .upload-zone { position: relative; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 10px; min-height: 264px; padding: 28px 20px; border: 1px dashed #a8bfdb; border-radius: 10px; background: #f8fbff; text-align: center; cursor: pointer; transition: background .16s ease, border-color .16s ease; }
#predictionView .upload-zone:hover,
#predictionView .upload-zone.dragging { border-color: var(--primary); background: var(--primary-soft); }
#predictionView .upload-zone:focus-within { outline: 3px solid var(--primary); outline-offset: 3px; }
#predictionView .upload-zone.has-file { border-color: var(--primary); background: var(--primary-soft); }
#predictionView .upload-zone.has-error { border-color: var(--prediction-error); }
#predictionView .upload-zone[aria-disabled="true"] { opacity: .65; cursor: wait; }
#predictionView .upload-symbol { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 4px; border: 1px solid #d7e5f5; border-radius: 14px; background: var(--surface); color: var(--primary); line-height: 1; }
#predictionView .upload-symbol svg { width: 27px; height: 27px; }
#predictionView .upload-zone strong { max-width: 100%; color: var(--ink); font-size: 16px; font-weight: 600; line-height: 1.6; word-break: normal; overflow-wrap: anywhere; }
#predictionView #fileMeta { color: var(--muted); font-size: 15px; line-height: 1.7; }
#predictionView .prediction-file-types { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; }
#predictionView .prediction-file-types span { padding: 2px 7px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--muted); font-size: 15px; line-height: 1.5; font-weight: 550; letter-spacing: .3px; }
#predictionView .upload-zone > .prediction-choose-file { margin-top: 4px; min-height: 36px; display: inline-flex; align-items: center; padding: 7px 16px; border: 1px solid #bed3ed; border-radius: 6px; background: var(--surface); color: var(--primary); font-size: 16px; font-weight: 550; }
#predictionView .upload-zone input { position: absolute; width: 1px; height: 1px; padding: 0; margin: 0; opacity: 0; overflow: hidden; }
#predictionView .prediction-upload-help { margin: 10px 0 0; color: var(--muted); font-size: 15px; line-height: 1.7; }
#predictionView .prediction-profiles { margin-top: 24px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
#predictionView .prediction-profiles summary { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; min-height: 56px; padding: 14px 0; font-size: 16px; font-weight: 600; list-style: none; cursor: pointer; }
#predictionView .prediction-profiles summary::-webkit-details-marker { display: none; }
#predictionView .prediction-profiles summary::after { content: ''; width: 7px; height: 7px; margin-left: auto; margin-right: 4px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg); transition: transform .16s ease; }
#predictionView .prediction-profiles[open] summary::after { transform: rotate(225deg); }
#predictionView .prediction-profiles summary .prediction-profile-title { margin: 0; color: var(--ink); font-size: 16px; font-weight: 600; }
#predictionView .prediction-profiles summary .prediction-optional { margin-left: 5px; padding: 2px 6px; border-radius: 4px; background: var(--bg); color: var(--muted); font-size: 15px; font-weight: 400; }
#predictionView .prediction-profiles summary .prediction-profile-subtitle { margin: 0; color: var(--muted); font-size: 15px; font-weight: 400; }
#predictionView .prediction-profiles > p { margin: 0 0 16px; color: var(--muted); font-size: 16px; line-height: 1.8; }
#predictionView .profile-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; padding-bottom: 20px; }
#predictionView .profile-grid label { min-width: 0; color: var(--ink); font-size: 16px; font-weight: 550; }
#predictionView .profile-grid textarea { display: block; width: 100%; margin-top: 8px; padding: 10px; border: 1px solid #b9c8da; border-radius: 7px; background: var(--surface); color: var(--ink); font: inherit; font-weight: 400; line-height: 1.7; resize: vertical; }
#predictionView .profile-grid textarea::placeholder { color: var(--muted); }
#predictionView .prediction-submit { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 22px; }
#predictionView .prediction-submit p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.7; }
#predictionView #startPrediction { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 44px; padding: 12px 22px; flex-shrink: 0; border: 1px solid var(--primary); border-radius: 8px; background: var(--primary); color: #fff; font-size: 16px; font-weight: 600; line-height: 1.4; white-space: nowrap; cursor: pointer; transition: background .16s ease; }
#predictionView #startPrediction:hover { border-color: var(--primary-hover); background: var(--primary-hover); }
#predictionView #startPrediction:disabled { cursor: wait; opacity: .6; }
#predictionView #predictionProgress { margin: 16px 0 0; padding: 12px 14px; border-radius: 7px; background: var(--primary-soft); color: var(--primary); font-size: 16px; line-height: 1.7; overflow-wrap: anywhere; }
#predictionView #predictionProgress[data-tone="error"] { background: var(--prediction-error-soft); color: var(--prediction-error); }
#predictionView #predictionProgress:empty { display: none; }
#predictionView .prediction-spinner { width: 16px; height: 16px; border: 2px solid rgb(255 255 255 / 35%); border-top-color: #fff; border-radius: 50%; animation: prediction-spin .8s linear infinite; }
#predictionView .prediction-empty { display: block; margin: 0; padding: 26px 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
#predictionView .prediction-empty > div { padding: 0; border: 0; }
#predictionView .prediction-guide-heading h3 { margin: 10px 0 8px; font-size: 17px; line-height: 1.6; font-weight: 650; }
#predictionView .prediction-guide-heading p { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.8; }
#predictionView .prediction-steps { margin: 26px 0; padding: 0; list-style: none; }
#predictionView .prediction-steps li { display: flex; align-items: flex-start; gap: 12px; position: relative; padding-bottom: 26px; }
#predictionView .prediction-steps li:last-child { padding-bottom: 0; }
#predictionView .prediction-steps li:not(:last-child)::after { content: ''; position: absolute; top: 37px; bottom: 8px; left: 15px; width: 1px; background: var(--line); }
#predictionView .prediction-step-number { display: grid; place-items: center; width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; }
#predictionView .prediction-steps h4 { margin: 4px 0 6px; font-size: 16px; line-height: 1.6; font-weight: 600; }
#predictionView .prediction-steps p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.8; }
#predictionView .prediction-empty > .prediction-guide-note { padding: 14px; border-radius: 8px; background: var(--bg); color: var(--muted); font-size: 15px; line-height: 1.8; }
/* The main table is a compact index; complete rules and editing live in the item dialog. */
#predictionView { --review-body: 16px; --review-small: 15px; --review-title: 18px; --review-number: 24px; --review-muted: #46566c; --prediction-toolbar-height: 42px; --review-row: 32px; font-size: var(--review-body); }
#predictionView[data-text-size="large"] { --review-body: 18px; --review-small: 16px; --review-title: 20px; --review-number: 28px; --review-row: 36px; }
#predictionView.has-results #predictionResults { margin: 0; padding: 0; border: 0; }
#predictionView.has-results .prediction-workspace:not([hidden]) { margin-bottom: 20px; }
#predictionView #hidePredictionUpload { margin-left: auto; min-height: 44px; flex-shrink: 0; font-size: var(--review-body); }
#predictionView.has-results .prediction-required { display: none; }
#predictionView .prediction-result-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 6px; min-height: 36px; }
#predictionView .prediction-result-heading h2 { flex: 1; min-width: 0; margin: 0; font-size: 20px; line-height: 1.6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#predictionView .prediction-result-actions { display: flex; flex-shrink: 0; gap: 8px; }
#predictionView .prediction-result-actions button { min-height: 32px; padding: 3px 10px; gap: 5px; border-color: #a3b5cc; font-size: var(--review-body); line-height: 1.5; white-space: nowrap; }
#predictionView #exportPrediction { color: #0954a8; }
#predictionView .prediction-result-actions .prediction-icon { width: 16px; height: 16px; }
#predictionView .prediction-project-info { margin: 8px 0; padding: 16px 20px; border: 1px solid #c4d2e3; border-radius: 8px; background: #fff; font-size: var(--review-body); color: #34465e; line-height: 1.8; overflow-wrap: anywhere; }
#predictionView .prediction-project-info h3 { margin: 0 0 12px; font-size: var(--review-title); }
#predictionView .prediction-project-info p { margin: 8px 0; }
#predictionView .prediction-draft-status[data-tone="error"] { color: var(--prediction-error); }
#predictionView .prediction-legacy-note { margin: 8px 0; padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px; color: var(--review-muted); font-size: var(--review-small); }
#predictionView .prediction-summary-strip { display: flex; align-items: center; gap: 10px; }
#predictionView .prediction-summary-label { flex-shrink: 0; color: #34465e; font-size: 15px; font-weight: 600; }
#predictionView .prediction-cards { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin: 4px 0 6px; }
#predictionView .family-0 { --prediction-family-color: var(--prediction-family-0); --prediction-family-soft: var(--prediction-family-0-soft); }
#predictionView .family-1 { --prediction-family-color: var(--prediction-family-1); --prediction-family-soft: var(--prediction-family-1-soft); }
#predictionView .family-2 { --prediction-family-color: var(--prediction-family-2); --prediction-family-soft: var(--prediction-family-2-soft); }
#predictionView .prediction-cards article { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 36px; padding: 3px 10px; border: 1px solid #cbd7e6; border-left: 3px solid var(--prediction-family-color); border-radius: 5px; background: #fff; }
#predictionView .prediction-cards h3 { margin: 0; flex-shrink: 0; color: var(--ink); font-size: var(--review-body); line-height: 1.5; font-weight: 600; }
#predictionView .prediction-card-value { flex-shrink: 0; font-size: 20px; line-height: 1.3; font-weight: 700; font-variant-numeric: tabular-nums; }
#predictionView .prediction-card-value small { font-size: 14px; font-weight: 400; }
#predictionView .prediction-cards p { margin: 0 0 0 auto; color: #46566c; font-size: 14px; line-height: 1.5; white-space: nowrap; }
#predictionView .prediction-review-toolbar { position: sticky; top: var(--header-height,56px); z-index: 12; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; min-height: 42px; padding: 4px 10px; border: 1px solid #c3d1e3; border-bottom: 0; border-radius: 6px 6px 0 0; background: #fff; }
#predictionView .prediction-detail-heading { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
#predictionView .prediction-detail-heading h3 { margin: 0; font-size: var(--review-body); font-weight: 650; white-space: nowrap; }
#predictionView .prediction-detail-heading p { margin: 0; color: #46566c; font-size: 14px; white-space: nowrap; }
#predictionView .prediction-review-controls { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
#predictionView .prediction-review-controls label { display: flex; align-items: center; gap: 6px; font-size: var(--review-body); }
#predictionView .prediction-review-controls select { width: auto; max-width: 230px; min-height: 32px; padding: 3px 24px 3px 8px; border-color: #99acc6; border-radius: 5px; font-size: var(--review-body); line-height: 1.5; }
#predictionView .prediction-table-scroll { position: relative; overflow: visible; border: 1px solid #c3d1e3; border-radius: 0 0 6px 6px; }
#predictionView .prediction-table { width: 100%; min-width: 0; table-layout: fixed; border-collapse: separate; border-spacing: 0; background: #fff; color: var(--ink); font-size: var(--review-body); }
#predictionView .prediction-table thead th { position: sticky; top: calc(var(--header-height,56px) + var(--prediction-toolbar-height)); z-index: 10; height: 34px; padding: 3px 8px; border-bottom: 1px solid #b8c8dc; background: #eaf0f7; color: #253b56; font-size: var(--review-body); font-weight: 600; text-align: center; line-height: 1.5; white-space: nowrap; }
#predictionView .prediction-table thead th:first-child { width: 52%; text-align: left; padding-left: 12px; }
#predictionView .prediction-table thead th:nth-child(2) { width: 9%; }
/* Wider than the plain family columns, to fit the member-company picker. */
#predictionView .prediction-table .prediction-family-heading { width: 13%; background: var(--prediction-family-soft); color: var(--prediction-family-color); }
#predictionView .prediction-table td { height: var(--review-row); padding: 0 8px; border-top: 1px solid #d6dfeb; vertical-align: middle; color: var(--ink); font-size: var(--review-body); line-height: 1.5; }
#predictionView .prediction-table tbody tr:first-child td { border-top: 0; }
#predictionView .prediction-table .prediction-group-row th { height: 22px; padding: 0 8px 0 calc(12px + var(--rule-depth) * 12px); border-top: 1px solid #c4d1e2; background: #e6edf6; color: #314761; text-align: left; font-size: 16px; font-weight: 650; line-height: 20px; }
#predictionView .prediction-tree-mark { display: inline-block; height: 11px; width: 3px; margin: 0 7px 0 0; border-radius: 1px; background: #8099b9; }
#predictionView .prediction-table .prediction-criterion-cell { padding-left: calc(8px + var(--rule-depth) * 10px); }
#predictionView .prediction-objective .prediction-criterion-cell { background: #edf4ff; box-shadow: inset 3px 0 #0867cf; }
#predictionView .prediction-subjective td { background: #f1f3f6; color: #263a53; }
#predictionView .prediction-table tr[data-criterion]:hover td { background: #e7f0fc; }
#predictionView .prediction-rule-line { display: flex; align-items: center; gap: 7px; min-width: 0; height: calc(var(--review-row) - 1px); }
#predictionView .prediction-rule-number { flex: 0 0 21px; color: #4b5d75; font-size: 14px; font-variant-numeric: tabular-nums; }
#predictionView .prediction-nature { display: inline-block; flex-shrink: 0; padding: 0 5px; border-radius: 3px; background: #dceaff; color: #084c99; font-size: 14px; font-weight: 600; line-height: 22px; }
#predictionView .prediction-subjective .prediction-nature { background: #e1e6ed; color: #34465b; }
#predictionView .prediction-rule-title { display: block; flex: 1; min-width: 0; min-height: 30px; height: calc(var(--review-row) - 2px); margin: 0; padding: 1px 0; overflow: hidden; border: 0; border-radius: 3px; background: transparent; color: var(--ink); text-align: left; text-overflow: ellipsis; white-space: nowrap; font: inherit; font-size: var(--review-body); font-weight: 550; line-height: 1.5; cursor: pointer; }
#predictionView .prediction-rule-title:hover { color: #0954a8; text-decoration: underline; text-underline-offset: 3px; }
#predictionView .prediction-max-cell { text-align: center; }
#predictionView .prediction-max-cell > strong { color: var(--ink); font-size: var(--review-body); font-weight: 650; font-variant-numeric: tabular-nums; }
#predictionView .prediction-score-button { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 30px; height: calc(var(--review-row) - 2px); padding: 0 4px; border: 0; border-radius: 4px; background: transparent; color: #0954a8; font: inherit; cursor: pointer; }
#predictionView .prediction-score-button:hover { background: #dceaff; }
#predictionView .prediction-score-button.is-subjective { color: #34465e; }
#predictionView .prediction-score-value { font-size: var(--review-body); font-weight: 600; line-height: 1.5; font-variant-numeric: tabular-nums; text-decoration: underline; text-underline-offset: 3px; }
#predictionView .prediction-score-button.is-subjective .prediction-score-value { text-decoration-style: dotted; }
#predictionView .prediction-table .prediction-no-results { height: auto; padding: 20px; color: var(--review-muted); text-align: center; }
#predictionView .prediction-table button { scroll-margin-top: calc(var(--header-height,56px) + var(--prediction-toolbar-height) + 44px); }
#predictionView :is(a,button,input,textarea,select,summary):focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
#predictionView :is(button,summary,a) { touch-action: manipulation; }
#predictionView .prediction-quote { white-space: pre-wrap; overflow-wrap: anywhere; }
#predictionView .prediction-rule-list { margin: 10px 0 0; padding: 0; list-style: none; }
#predictionView .prediction-rule-list > li { margin: 12px 0; }
#predictionView .prediction-rule-list > li + li { padding-top: 14px; border-top: 1px solid #c7d4e5; }
#predictionView .prediction-rule-list > li > p { white-space: pre-wrap; }
#predictionView #comparisonScore { width: 112px; min-width: 0; min-height: 48px; padding: 9px 10px; border: 1px solid #8a9fb9; border-radius: 7px; background: #fff; color: var(--ink); font: inherit; font-size: var(--review-number); font-weight: 600; font-variant-numeric: tabular-nums; }
#predictionView #comparisonScore::placeholder { color: #495a70; font-size: var(--review-body); font-weight: 500; }
#predictionView #comparisonScore:disabled { border-color: #9caec4; background: #e8edf3; color: #46566c; cursor: not-allowed; }
#predictionView #predictionComparison { width: min(1440px,calc(100vw - 40px)); height: min(1000px,calc(100dvh - 40px)); max-width: none; max-height: calc(100dvh - 40px); margin: auto; padding: 0; border: 1px solid #b8c8dc; border-radius: 12px; background: #fff; color: var(--ink); box-shadow: 0 24px 80px rgb(23 43 70 / 24%); overflow: hidden; font-size: var(--review-body); }
#predictionView #predictionComparison[open] { display: flex; flex-direction: column; }
#predictionView #predictionComparison::backdrop { background: rgb(20 36 60 / 55%); }
#predictionView #predictionComparison :is(h2,h3,h4,h5) { margin: 0; line-height: 1.65; overflow-wrap: anywhere; }
#predictionView #predictionComparison p { line-height: 1.85; overflow-wrap: anywhere; }
#predictionView .comparison-dialog-heading { flex: none; padding: 18px 24px 14px; border-bottom: 1px solid var(--line); background: #fff; }
#predictionView .comparison-heading-main { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
#predictionView .comparison-heading-main > div { min-width: 0; }
#predictionView .comparison-dialog-heading .eyebrow { margin: 0 0 4px; }
#predictionView .comparison-dialog-heading h2 { font-size: calc(var(--review-title) + 2px); font-weight: 650; }
#predictionView #comparisonSubtitle { margin: 5px 0 0; color: var(--review-muted); font-size: var(--review-small); }
#predictionView .comparison-close { display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex-shrink: 0; min-width: 96px; min-height: 48px; border: 1px solid #8fa5c0; border-radius: 8px; background: #fff; color: var(--ink); font-size: var(--review-body); font-weight: 600; cursor: pointer; }
#predictionView .comparison-close:hover { background: #edf2f8; }
#predictionView .comparison-navigation { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px 16px; margin-top: 14px; }
#predictionView .comparison-family-switch,
#predictionView .comparison-item-switch { display: flex; gap: 8px; }
#predictionView .comparison-navigation button { min-height: 48px; padding: 9px 18px; font-size: var(--review-body); border-color: #97adc9; }
#predictionView .comparison-family-switch [aria-pressed="true"] { color: #fff; border-color: var(--primary); background: var(--primary); font-weight: 650; }
#predictionView .comparison-navigation button:disabled { color: #596c85; background: #f0f3f7; cursor: not-allowed; border-color: #c5d1e0; }
#predictionView .comparison-layout { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0,.88fr) minmax(0,1.12fr); align-items: start; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
#predictionView .comparison-rules { min-width: 0; min-height: 100%; padding: 24px; border-right: 1px solid var(--line); background: #f4f8ff; font-size: var(--review-body); color: #253a55; }
#predictionView .comparison-rules > .eyebrow { margin: 0 0 4px; }
#predictionView .comparison-rules h3 { font-size: calc(var(--review-title) + 2px); }
#predictionView .comparison-rules > .prediction-quote { margin: 16px 0 0; }
#predictionView .comparison-rules section { margin-top: 24px; padding-top: 20px; border-top: 1px solid #c3d1e4; }
#predictionView .comparison-rules h4 { font-size: var(--review-title); }
#predictionView .comparison-rules section p { margin: 10px 0 0; }
#predictionView .comparison-max-score { display: block; margin-top: 10px; font-size: var(--review-number); font-weight: 700; font-variant-numeric: tabular-nums; }
#predictionView .comparison-analysis { min-width: 0; padding: 24px; }
#predictionView .comparison-verdict { padding: 16px 18px; border: 1px solid #b7cdea; border-radius: 8px; background: #eaf3ff; }
#predictionView .comparison-verdict > div { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: 8px; }
#predictionView .comparison-verdict h3 { font-size: var(--review-title); font-weight: 650; }
#predictionView .comparison-basis { color: #0954a8; font-size: var(--review-small); font-weight: 600; }
#predictionView .comparison-verdict > strong { display: block; margin-top: 6px; font-size: calc(var(--review-number) + 6px); font-weight: 700; font-variant-numeric: tabular-nums; }
#predictionView .comparison-verdict > strong small { font-size: var(--review-small); font-weight: 500; }
#predictionView .comparison-verdict p { margin: 10px 0 0; font-size: var(--review-body); }
#predictionView #predictionComparison summary { min-height: 48px; padding: 10px 0; color: #0954a8; font-size: var(--review-body); line-height: 1.8; cursor: pointer; }
#predictionView .comparison-history-note { margin: 14px 0 20px; color: #40516a; font-size: var(--review-small); }
#predictionView .comparison-section { margin-top: 24px; }
#predictionView .comparison-section-heading,
#predictionView .comparison-match-heading { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 8px 12px; }
#predictionView .comparison-section-heading h3 { font-size: var(--review-title); font-weight: 650; }
#predictionView .comparison-section-summary { margin: 8px 0 12px; color: #34465e; font-size: var(--review-body); }
#predictionView .comparison-status { display: inline-block; flex-shrink: 0; padding: 4px 8px; border-radius: 5px; background: #e7ecf3; color: #34465e; font-size: var(--review-small); font-weight: 650; line-height: 1.6; }
#predictionView .comparison-status.is-matched { background: #e2f2ee; color: #175944; }
#predictionView .comparison-status.is-partial { background: #fff1cf; color: #704900; }
#predictionView .comparison-status.is-unmatched { background: #ffece7; color: #933422; }
#predictionView .comparison-match { padding: 16px; margin-top: 12px; border: 1px solid #c4d2e3; border-radius: 8px; }
#predictionView .comparison-match h4 { font-size: var(--review-title); font-weight: 650; }
#predictionView .comparison-match > p { margin: 10px 0; color: #34465e; font-size: var(--review-body); }
#predictionView .comparison-conditions { display: grid; grid-template-columns: minmax(0,1fr); gap: 12px; margin: 14px 0; }
#predictionView .comparison-condition-list { padding: 14px 16px; border: 1px solid #ced8e5; border-radius: 6px; background: #f4f6f9; }
#predictionView .comparison-condition-list.is-matched { background: #eef5ff; border-color: #c2d6ee; }
#predictionView .comparison-condition-list.is-missing { background: #fff9ed; border-color: #e5d4b0; }
#predictionView .comparison-condition-list h5 { font-size: var(--review-body); font-weight: 650; }
#predictionView .comparison-condition-list ul { padding-left: 20px; margin: 8px 0 0; }
#predictionView .comparison-condition-list li { margin: 7px 0; color: #263c57; font-size: var(--review-body); line-height: 1.8; overflow-wrap: anywhere; }
#predictionView .comparison-condition-list p { margin: 8px 0 0; color: #40516a; font-size: var(--review-body); }
#predictionView .comparison-source-details { margin-top: 12px; border-top: 1px solid var(--line); font-size: var(--review-body); color: #34465e; }
#predictionView .comparison-source-details h5 { font-size: var(--review-body); margin-top: 14px !important; }
#predictionView .comparison-source-details ul { padding-left: 22px; line-height: 1.85; }
#predictionView .comparison-match a { color: #0954a8; text-decoration: underline; text-underline-offset: 3px; }
#predictionView .comparison-source-links { margin-top: 12px; font-size: var(--review-body); }
#predictionView .comparison-source-links a { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; }
#predictionView .comparison-projects li { margin: 12px 0; }
#predictionView .comparison-projects li > span { display: block; color: #40516a; font-size: var(--review-small); }
#predictionView .comparison-projects .prediction-icon { width: 17px; height: 17px; }
#predictionView .comparison-empty { padding: 16px; border: 1px dashed #9bafc8; border-radius: 7px; color: #40516a; background: #f4f6f9; font-size: var(--review-body); }
#predictionView .comparison-footer { display: flex; flex: none; justify-content: space-between; align-items: center; gap: 16px; margin: 0; padding: 14px 24px; border-top: 1px solid #bdcde1; background: #fff; }
#predictionView .comparison-score-editor { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
#predictionView .comparison-footer label { font-size: var(--review-body); font-weight: 650; }
#predictionView .comparison-score-control { display: flex; align-items: center; gap: 10px; }
#predictionView .comparison-score-control > span { color: #34465e; font-size: var(--review-body); }
#predictionView .comparison-footer p { flex-basis: 100%; margin: 0; color: #40516a; font-size: var(--review-small); }
#predictionView .comparison-footer-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
#predictionView #comparisonSaved { color: #0954a8; font-size: var(--review-small); }
#predictionView #applyComparisonScore { min-height: 48px; padding: 10px 20px; border: 1px solid var(--primary); border-radius: 8px; background: var(--primary); color: #fff; font: inherit; font-size: var(--review-body); font-weight: 650; cursor: pointer; }
#predictionView #applyComparisonScore:disabled { background: #e5eaf1; border-color: #acbdd1; color: #53657c; cursor: not-allowed; }
#predictionView .comparison-subjective { padding: 22px; border: 1px solid #c6d3e4; border-radius: 8px; background: #f5f7fa; }
#predictionView .comparison-subjective > .prediction-nature { margin-bottom: 10px; }
#predictionView .comparison-subjective h3 { font-size: var(--review-title); }
#predictionView .comparison-subjective-scores { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin: 22px 0; }
#predictionView .comparison-subjective-scores > div { padding: 14px 10px; border: 1px solid #c6d3e4; border-radius: 6px; background: #fff; }
#predictionView .comparison-subjective-scores .is-current { border-color: #0867cf; background: #eaf3ff; }
#predictionView .comparison-subjective-scores dt { font-size: var(--review-body); }
#predictionView .comparison-subjective-scores dd { margin: 8px 0 0; font-size: var(--review-number); font-weight: 650; }
@keyframes prediction-spin { to { transform: rotate(360deg); } }
@media (max-width: 1100px) {
 #predictionView .prediction-workspace { grid-template-columns: minmax(0,1fr); }
 #predictionView .prediction-cards article { gap: 6px; padding-inline: 8px; }
 #predictionView .prediction-cards p { white-space: normal; font-size: 13px; }
 #predictionView .prediction-review-toolbar { flex-wrap: wrap; }
}
@media (max-width: 760px) {
 #predictionView .prediction-intro { align-items: flex-start; flex-direction: column; gap: 16px; }
 #predictionView .prediction-intro h2 { font-size: 24px; }
 #predictionView .prediction-upload { padding: 20px; }
 #predictionView .prediction-upload-heading { flex-wrap: wrap; }
 #predictionView .prediction-upload-heading > div:nth-child(2) { min-width: 0; flex: 1; }
 #predictionView #hidePredictionUpload { margin-left: 0; }
 #predictionView .upload-zone { min-height: 250px; padding: 24px 16px; }
 #predictionView .prediction-profile-subtitle { display: none; }
 #predictionView .profile-grid { grid-template-columns: 1fr; }
 #predictionView .profile-grid textarea { font-size: 16px; }
 #predictionView .prediction-submit { flex-direction: column-reverse; align-items: stretch; gap: 12px; }
 #predictionView .prediction-submit p { text-align: center; }
 #predictionView #startPrediction { width: 100%; min-height: 48px; }
 #predictionView .prediction-result-heading { flex-wrap: wrap; gap: 5px; }
 #predictionView .prediction-result-heading h2 { flex-basis: 100%; font-size: 18px; }
 #predictionView .prediction-result-actions { width: 100%; flex-wrap: wrap; }
 #predictionView .prediction-result-actions button { flex: 1 1 auto; min-height: 36px; }
 #predictionView #toggleTenderPreview .prediction-icon { display: none; }
 #predictionView .prediction-summary-strip { display: block; }
 #predictionView .prediction-summary-label { display: block; margin-top: 4px; }
 #predictionView .prediction-cards { gap: 5px; }
 #predictionView .prediction-cards article { justify-content: center; flex-wrap: wrap; gap: 2px 5px; padding: 5px; }
 #predictionView .prediction-cards h3 { font-size: 15px; }
 #predictionView .prediction-card-value { font-size: 18px; }
 #predictionView .prediction-cards p { flex-basis: 100%; margin: 0; text-align: center; font-size: 12px; }
 #predictionView .prediction-review-toolbar { position: static; padding: 7px 8px; gap: 5px; }
 #predictionView .prediction-detail-heading { width: 100%; justify-content: space-between; gap: 6px; }
 #predictionView .prediction-detail-heading p { font-size: 13px; }
 #predictionView .prediction-review-controls { width: 100%; flex-wrap: wrap; gap: 6px; }
 #predictionView .prediction-review-controls label { flex: 1; min-width: 0; }
 #predictionView .prediction-review-controls select { width: 100%; max-width: 100%; min-height: 36px; }
 #predictionView .prediction-table-scroll { border-top: 0; }
 #predictionView .prediction-table { display: block; background: transparent; }
 #predictionView .prediction-table thead { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
 #predictionView .prediction-table tbody { display: block; }
 #predictionView .prediction-table tr[data-criterion] { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); border-top: 1px solid #cbd7e6; }
 #predictionView .prediction-table .prediction-group-row { display: block; }
 #predictionView .prediction-table .prediction-group-row th { display: block; width: 100%; height: 26px; line-height: 24px; }
 #predictionView .prediction-table td { display: block; min-width: 0; height: auto; padding: 1px 4px 3px; text-align: center; border-top: 0; }
 #predictionView .prediction-table .prediction-criterion-cell { grid-column: 1 / -1; padding: 3px 8px; text-align: left; }
 #predictionView .prediction-table .prediction-rule-line { height: 34px; }
 #predictionView .prediction-rule-title { height: 34px; min-height: 34px; }
 #predictionView .prediction-table td:not(.prediction-criterion-cell)::before { content: attr(data-label); display: block; color: #46566c; font-size: 13px; line-height: 18px; }
 #predictionView .prediction-table .prediction-max-cell > strong { display: block; line-height: 32px; }
 #predictionView .prediction-score-button { min-height: 32px; height: 32px; }
 #predictionView .prediction-table .prediction-no-results { grid-column: 1 / -1; }
 #predictionView #predictionComparison { width: calc(100vw - 16px); height: calc(100dvh - 16px); max-height: calc(100dvh - 16px); border-radius: 10px; }
 #predictionView .comparison-dialog-heading { padding: 14px; }
 #predictionView .comparison-heading-main { gap: 10px; }
 #predictionView .comparison-dialog-heading h2 { font-size: var(--review-title); }
 #predictionView .comparison-close { min-width: 76px; padding: 8px; }
 #predictionView .comparison-close .prediction-icon { width: 18px; height: 18px; }
 #predictionView .comparison-navigation { margin-top: 10px; gap: 8px; }
 #predictionView .comparison-family-switch { width: 100%; }
 #predictionView .comparison-family-switch button { flex: 1; padding-inline: 8px; }
 #predictionView .comparison-item-switch { width: 100%; justify-content: flex-end; }
 #predictionView .comparison-item-switch button { padding-inline: 12px; }
 #predictionView .comparison-layout { display: block; }
 #predictionView .comparison-rules { min-height: 0; padding: 20px; border-right: 0; border-bottom: 1px solid var(--line); }
 #predictionView .comparison-analysis { padding: 20px; }
 #predictionView .comparison-verdict,#predictionView .comparison-subjective { padding: 16px; }
 #predictionView .comparison-subjective-scores { gap: 6px; }
 #predictionView .comparison-subjective-scores > div { padding: 10px 7px; }
 #predictionView .comparison-footer { padding: 12px 14px; align-items: stretch; flex-direction: column; gap: 10px; }
 #predictionView .comparison-score-editor { gap: 8px; }
 #predictionView .comparison-footer-actions { justify-content: space-between; }
 #predictionView .comparison-footer-actions button { margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) {
 #predictionView *,#predictionView *::before,#predictionView *::after { transition: none !important; animation: none !important; }
}

/* Budget and price scoring */
#predictionView .prediction-budget { display: inline-flex; flex-shrink: 0; align-items: baseline; gap: 8px; min-height: 32px; padding: 3px 12px; border: 1px solid #a3b5cc; border-radius: 5px; background: #fff; color: #34465e; font: inherit; font-size: var(--review-body); line-height: 1.5; white-space: nowrap; }
#predictionView button.prediction-budget { cursor: pointer; }
#predictionView button.prediction-budget:hover { border-color: #0867cf; background: #eaf3ff; }
#predictionView .prediction-budget strong { color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; }
#predictionView .comparison-price { padding: 22px; border: 1px solid #c6d3e4; border-radius: 8px; background: #f5f7fa; }
#predictionView .comparison-price > .prediction-nature { margin-bottom: 10px; }
#predictionView .comparison-price h3 { font-size: var(--review-title); }
#predictionView .comparison-price-form { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin-top: 16px; }
#predictionView .comparison-price-form label { display: grid; gap: 6px; color: #34465e; font-size: var(--review-small); font-weight: 600; }
#predictionView .comparison-price-form input,#predictionView .comparison-price-form select { width: 100%; min-height: 40px; padding: 6px 10px; border: 1px solid #a3b5cc; border-radius: 5px; background: #fff; color: var(--ink); font: inherit; font-size: var(--review-body); font-variant-numeric: tabular-nums; }
#predictionView .comparison-price-hint,#predictionView .comparison-price-outcome,#predictionView .comparison-price-form > button { grid-column: 1 / -1; }
#predictionView .comparison-price-hint { margin: 0; color: #46566c; font-size: var(--review-small); line-height: 1.7; }
#predictionView .comparison-price-outcome .comparison-subjective-scores { margin: 12px 0 0; }
#predictionView .comparison-price-outcome .comparison-subjective-scores p { margin: 8px 0 0; color: #46566c; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
#predictionView .comparison-price-outcome .is-over_budget { border-color: #d9534f; background: #fdf1f0; }
#predictionView .comparison-price-form > button { justify-self: end; min-height: 40px; padding: 6px 18px; border: 1px solid #0867cf; border-radius: 5px; background: #0867cf; color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
#predictionView .comparison-price-form > button:disabled { border-color: #a3b5cc; background: #a3b5cc; cursor: not-allowed; }
@media (max-width: 720px) {
 #predictionView .comparison-price { padding: 16px; }
 #predictionView .comparison-price-form { grid-template-columns: 1fr; }
 #predictionView .comparison-price-outcome .comparison-subjective-scores { grid-template-columns: 1fr; }
}

/* Full-screen review: results use the whole workspace and carry a running total. */
#predictionView.has-results { max-width: none; margin: 0; }
#predictionView .prediction-summary-strip { align-items: stretch; gap: 8px; margin: 6px 0 7px; }
#predictionView .prediction-total-max { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; min-height: 40px; padding: 3px 14px; border: 1px solid #cbd7e6; border-radius: 5px; background: #f2f6fb; }
#predictionView .prediction-total-max span { flex-shrink: 0; color: #34465e; font-size: var(--review-body); font-weight: 600; line-height: 1.5; }
#predictionView .prediction-total-max strong small { color: #46566c; }
#predictionView .prediction-total-max strong { color: var(--ink); font-size: 20px; line-height: 1.3; font-weight: 700; font-variant-numeric: tabular-nums; }
#predictionView .prediction-total-max small { font-size: 14px; font-weight: 400; }
#predictionView .prediction-cards { margin: 0; }
#predictionView .prediction-cards article { gap: 9px; min-height: 40px; padding: 3px 12px; }
#predictionView .prediction-total-tag { flex-shrink: 0; padding: 0 6px; border-radius: 3px; background: var(--prediction-family-soft); color: var(--prediction-family-color); font-size: 13px; font-weight: 600; line-height: 20px; }
#predictionView .prediction-total-value { flex-shrink: 0; color: var(--prediction-family-color); font-size: 22px; line-height: 1.3; font-weight: 700; font-variant-numeric: tabular-nums; }
#predictionView .prediction-total-value small { font-size: 13px; font-weight: 400; }
#predictionView .prediction-card-breakdown { flex: 0 1 auto; min-width: 0; margin: 0 0 0 auto; overflow: hidden; color: #46566c; font-size: 14px; line-height: 1.5; white-space: nowrap; text-overflow: ellipsis; }
#predictionView .prediction-cards article { min-width: 0; }
/* Item counts are a second-order detail: they appear once the row has space.
   The screen-reader summary in .prediction-card-maximum always carries them. */
#predictionView .prediction-card-counts { display: none; }
@media (min-width: 1900px) {
 #predictionView .prediction-card-counts { display: inline; }
}
/* Stacked cards on small screens: the total row keeps the same four columns. */
@media (max-width: 760px) {
 #predictionView .prediction-summary-strip { display: block; }
 #predictionView .prediction-total-max { justify-content: center; margin-bottom: 5px; min-height: 34px; }
 #predictionView .prediction-cards { grid-template-columns: minmax(0,1fr); }
 #predictionView .prediction-cards article { flex-wrap: wrap; justify-content: flex-start; min-height: 46px; }
 #predictionView .prediction-card-breakdown { flex-basis: 100%; margin: 0; text-align: left; white-space: normal; }
 #predictionView .prediction-total-value { margin-left: auto; }
 #predictionView .prediction-table tfoot { display: block; }
 #predictionView .prediction-table .prediction-total-row { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); }
 #predictionView .prediction-table tfoot :is(th,td) { position: static; display: block; height: auto; padding: 3px 4px 5px; text-align: center; }
 #predictionView .prediction-total-row th { grid-column: 1 / -1; padding: 4px 8px; text-align: left; white-space: normal; }
 #predictionView .prediction-total-row td::before { content: attr(data-label); display: block; color: #46566c; font-size: 13px; font-weight: 500; line-height: 18px; }
 #predictionView .prediction-total-row .prediction-family-cell strong { font-size: 15px; }
}
#predictionView .prediction-card-breakdown b { color: #253b56; font-weight: 650; font-variant-numeric: tabular-nums; }
#predictionView .prediction-card-breakdown .prediction-card-value { font-size: 15px; }
#predictionView .prediction-card-breakdown i { font-style: normal; color: #7a8aa0; }
/* The breakdown gets its own line, so no operator's figures are truncated. */
#predictionView .prediction-cards article { flex-wrap: wrap; align-content: center; row-gap: 0; min-height: 52px; }
#predictionView .prediction-card-breakdown { flex-basis: 100%; margin: 0; }
/* Short screens: trim the chrome so every rule still fits without scrolling. */
@media (max-height: 820px) and (min-width: 1024px) {
 body.prediction-fullscreen .analysis-main { padding: 10px 24px 12px; }
 #predictionView .prediction-summary-strip { margin: 4px 0 5px; }
 #predictionView .prediction-cards article { flex-wrap: nowrap; min-height: 40px; }
 #predictionView .prediction-card-breakdown { flex: 0 1 auto; margin-left: auto; }
 #predictionView .prediction-review-toolbar { min-height: 38px; }
 #predictionView .prediction-table tfoot :is(th,td) { height: 30px; }
}
/* Taller screens can afford roomier rows. */
@media (min-height: 860px) {
 #predictionView { --review-row: 36px; }
 #predictionView[data-text-size="large"] { --review-row: 40px; }
}
@media (min-height: 1000px) {
 #predictionView { --review-row: 40px; }
 #predictionView[data-text-size="large"] { --review-row: 46px; }
 #predictionView .prediction-table .prediction-group-row th { height: 26px; line-height: 24px; }
}
/* Sticky total row: the sum of every rule stays visible while reviewing. */
#predictionView .prediction-table tfoot :is(th,td) { position: sticky; bottom: 0; z-index: 9; height: 34px; padding: 0 8px; border-top: 2px solid #b8c8dc; background: #eaf0f7; color: #253b56; font-size: var(--review-body); font-weight: 650; line-height: 1.5; }
#predictionView .prediction-total-row th { padding-left: 12px; text-align: left; white-space: nowrap; }
#predictionView .prediction-total-row th small { color: #46566c; font-size: 14px; font-weight: 400; }
#predictionView .prediction-total-row td { text-align: center; font-variant-numeric: tabular-nums; }
#predictionView .prediction-total-row .prediction-family-cell { background: var(--prediction-family-soft); color: var(--prediction-family-color); }
#predictionView .prediction-total-row .prediction-family-cell strong { font-size: 17px; font-weight: 700; }
@media (min-width: 761px) {
 #predictionView .prediction-table :is(.prediction-family-cell,.prediction-family-heading,.prediction-max-cell) { border-left: 1px solid #dbe3ee; }
 #predictionView .prediction-table thead th:first-child { width: auto; }
 #predictionView .prediction-table thead th:nth-child(2) { width: 118px; }
 #predictionView .prediction-table .prediction-family-heading { width: 164px; }
}
@media (min-width: 1024px) {
 body.prediction-fullscreen .analysis-main { display: flex; flex-direction: column; height: calc(100dvh - var(--header-height)); padding: 14px 24px 16px; }
 body.prediction-fullscreen #predictionView.has-results { display: flex; flex: 1; flex-direction: column; min-height: 0; }
 body.prediction-fullscreen #predictionResults { display: flex; flex: 1; flex-direction: column; min-height: 0; }
 body.prediction-fullscreen #predictionView .prediction-table-scroll { flex: 0 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; }
 body.prediction-fullscreen #predictionView .prediction-review-toolbar { position: static; }
 body.prediction-fullscreen #predictionView .prediction-table thead th { top: 0; }
 body.prediction-fullscreen #predictionView .prediction-table button { scroll-margin-top: 44px; }
}

/* Original tender preview beside the scoring table */
#predictionView .prediction-result-layout { min-width: 0; }
#predictionView .prediction-split { display: none; }
#predictionView .tender-preview-notice { margin: 0 0 10px; padding: 8px 10px; border: 1px solid #f0d9a8; border-radius: 6px; background: #fdf6e6; color: #6b5220; font-size: var(--review-small); line-height: 1.7; }
#predictionView .tender-preview { display: flex; flex-direction: column; min-width: 0; min-height: 0; max-height: calc(100dvh - var(--header-height) - 120px); border: 1px solid #c4d2e3; border-radius: 8px; background: #fff; overflow: hidden; }
#predictionView[data-preview="hidden"] .tender-preview { display: none; }
#predictionView .tender-preview-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; padding: 8px 12px; border-bottom: 1px solid #dbe4ef; }
#predictionView .tender-preview-title { min-width: 0; }
#predictionView .tender-preview-tools { display: flex; align-items: center; gap: 6px; }
#predictionView .tender-preview-views { display: flex; border: 1px solid #a3b5cc; border-radius: 6px; overflow: hidden; }
#predictionView .tender-preview-views button { min-height: 30px; padding: 2px 10px; border: 0; border-radius: 0; background: #fff; color: #46566c; font-size: var(--review-small); }
#predictionView .tender-preview-views button + button { border-left: 1px solid #cdd9e7; }
#predictionView .tender-preview-views button[aria-pressed="true"] { background: var(--primary-soft); color: #0954a8; font-weight: 650; }
#predictionView .tender-preview-zoom { display: flex; align-items: center; border: 1px solid #a3b5cc; border-radius: 6px; overflow: hidden; }
#predictionView .tender-preview-zoom button { min-height: 30px; min-width: 30px; padding: 2px 8px; border: 0; border-radius: 0; background: #fff; color: #46566c; font-size: var(--review-small); }
#predictionView .tender-preview-zoom button + button { border-left: 1px solid #cdd9e7; }
#predictionView #tenderZoomLevel { min-width: 46px; font-variant-numeric: tabular-nums; }
#predictionView .tender-preview-download { display: inline-flex; align-items: center; min-height: 30px; padding: 2px 10px; border: 1px solid #a3b5cc; border-radius: 6px; color: #0954a8; font-size: var(--review-small); }
#predictionView .tender-frame { display: block; width: 100%; height: 100%; min-height: 60vh; border: 0; }
#predictionView .tender-preview-body:has(.tender-frame) { padding: 0; }
#predictionView .tender-plain { white-space: pre-wrap; }
/* Word print layout: the page, its margins and the document's own formatting. */
#predictionView .tender-docx { padding: 12px; background: #e8ecf2; text-align: center; }
#predictionView .tender-docx .docx-page { display: inline-block; width: auto; max-width: none; margin: 0 auto; background: #fff; box-shadow: 0 1px 6px #172b4626; text-align: left; color: #000; font-family: "Times New Roman","SimSun","宋体",serif; font-size: 14px; line-height: 1.6; zoom: var(--docx-zoom,1); }
#predictionView .tender-docx .docx-p { margin: 0; line-height: inherit; }
#predictionView .tender-docx :is(h3,h4,h5,h6) { margin: 0; font-weight: inherit; line-height: inherit; }
#predictionView .tender-docx .docx-tab { display: inline-block; min-width: 2em; }
#predictionView .tender-docx .docx-image { max-width: 100%; }
#predictionView .tender-docx .docx-table { margin: 0 0 6px; border-collapse: collapse; table-layout: fixed; max-width: 100%; }
#predictionView .tender-docx .docx-table td { padding: 2px 5px; border: 1px solid #d7dee8; vertical-align: top; overflow-wrap: anywhere; }
#predictionView .tender-docx mark.tender-hit { padding: 0; }
#predictionView .tender-preview-head .eyebrow { margin: 0 0 2px; }
#predictionView .tender-preview-head h3 { margin: 0; max-width: 20ch; font-size: var(--review-body); line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#predictionView #hideTenderPreview { min-height: 30px; padding: 2px 10px; border-color: #a3b5cc; font-size: var(--review-small); }
#predictionView .tender-preview-search { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-bottom: 1px solid #eef2f7; }
#predictionView .tender-preview-search input { flex: 1; min-width: 0; min-height: 34px; padding: 4px 10px; font-size: var(--review-small); }
#predictionView .tender-preview-search button { flex: none; min-height: 34px; min-width: 34px; padding: 2px 6px; border-color: #a3b5cc; }
#predictionView .tender-preview-search .prediction-icon { width: 16px; height: 16px; }
#predictionView #tenderPreviewMatches { flex: none; color: #46566c; font-size: 13px; white-space: nowrap; }
#predictionView .tender-preview-main { display: flex; flex: 1; min-height: 0; }
#predictionView .tender-outline { display: none; flex: none; width: 212px; padding: 8px 6px; border-right: 1px solid #dbe4ef; background: #fafcfe; overflow: auto; overscroll-behavior: contain; }
#predictionView .tender-preview.has-outline .tender-outline { display: block; }
#predictionView .tender-outline button { display: block; width: 100%; min-height: 0; margin: 1px 0; padding: 5px 8px 5px calc(8px + (var(--level,1) - 1) * 10px); border: 0; border-radius: 4px; background: transparent; color: #34465e; font-size: 13px; line-height: 1.55; text-align: left; white-space: normal; overflow-wrap: anywhere; }
#predictionView .tender-outline button:hover { background: var(--primary-soft); color: #0954a8; }
#predictionView .tender-outline button[aria-current="true"] { background: var(--primary-soft); color: #0954a8; font-weight: 650; }
#predictionView #toggleTenderOutline,#predictionView #toggleTenderFull { min-height: 30px; padding: 2px 10px; border-color: #a3b5cc; font-size: var(--review-small); }
#predictionView #toggleTenderOutline[aria-pressed="true"],#predictionView #toggleTenderFull[aria-pressed="true"] { border-color: #0867cf; background: var(--primary-soft); color: #0954a8; }
#predictionView .tender-preview-body { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 12px 14px; font-size: var(--review-small); line-height: 1.9; color: #34465e; overflow-wrap: anywhere; }
#predictionView .tender-preview-hint { margin: 0; color: #46566c; }
#predictionView .tender-preview-hint.is-error { color: var(--prediction-error); }
#predictionView .tender-preview-note { margin: 0; padding: 8px 12px; border-top: 1px solid #eef2f7; color: #5b6b80; font-size: 13px; line-height: 1.6; }
/* Word documents often use an exact line spacing equal to the font size, so the box of a
   highlighted line overlaps the glyphs of the line above. An opaque fill (and its 2px
   spread) painted over that text; multiplying the colour tints the page without hiding ink. */
#predictionView mark.tender-hit { --hit: #fffae6; background: linear-gradient(var(--hit), var(--hit)) center / 100% 1em no-repeat; color: inherit; border-radius: 2px; mix-blend-mode: multiply; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
/* The fill is never taller than one line, so it cannot reach the line above or below. */
@supports (height: 1lh) { #predictionView mark.tender-hit { background-size: 100% min(100%, 1lh); } }
#predictionView mark.tender-hit.is-active { --hit: #fff1c2; }
#predictionView #toggleTenderPreview .prediction-icon { width: 16px; height: 16px; }
@media (min-width: 1024px) {
 body.prediction-fullscreen #predictionView .prediction-result-layout { flex: 1; min-height: 0; display: flex; flex-direction: column; }
 /* Beside a widened document column the score columns compress first, and the table
    scrolls sideways only once even the compact columns no longer fit. */
 #predictionView[data-preview="shown"].has-results #predictionResults { container-type: inline-size; }
 #predictionView[data-preview="shown"].has-results .prediction-table { min-width: 540px; }
 #predictionView[data-preview="shown"].has-results .prediction-table-scroll { overflow: auto; }
 /* Inside its own scroll container the header sticks to that container's top. */
 #predictionView[data-preview="shown"].has-results .prediction-table thead th { top: 0; }
 #predictionView[data-preview="shown"].has-results .prediction-review-toolbar { position: static; }
 @container (max-width: 900px) {
  #predictionView .prediction-cards article { flex-wrap: nowrap; min-height: 40px; }
  #predictionView .prediction-card-breakdown { flex: 0 1 auto; margin-left: auto; }
  #predictionView .prediction-table thead th:nth-child(2) { width: 82px; }
  #predictionView .prediction-table .prediction-family-heading { width: 102px; }
  #predictionView .prediction-total-row th small { display: none; }
 }
 #predictionView[data-preview="shown"].has-results .prediction-result-layout { display: grid; /* however far the separator is dragged, the scoring table keeps 600px */ grid-template-columns: minmax(280px, min(var(--preview-width,50%), calc(100% - 610px))) 10px minmax(0, 1fr); gap: 0; align-items: stretch; }
 #predictionView[data-preview="shown"].has-results .prediction-split { display: block; align-self: stretch; margin: 0 2px; border-radius: 3px; background: transparent; cursor: col-resize; touch-action: none; }
 #predictionView[data-preview="shown"].has-results .prediction-split::before { content: ""; display: block; width: 3px; height: 100%; margin: 0 auto; border-radius: 3px; background: #ccd8e6; }
 #predictionView .prediction-split:hover::before,#predictionView .prediction-split:focus-visible::before { background: var(--primary); }
 body.prediction-fullscreen #predictionView .tender-preview { max-height: none; }
 /* Full-screen reading: the document takes the workspace, with its outline beside it. */
 #predictionView[data-preview-mode="full"][data-preview="shown"].has-results .prediction-result-layout { display: flex; flex-direction: column; }
 #predictionView[data-preview-mode="full"] #predictionResults,#predictionView[data-preview-mode="full"] .prediction-split { display: none; }
 #predictionView[data-preview-mode="full"] .tender-preview { flex: 1; min-height: 0; max-height: none; }
 body.prediction-fullscreen #predictionResults { min-width: 0; }
}
@media (max-width: 1023px) {
 #predictionView .tender-preview { max-height: 46dvh; margin-bottom: 12px; }
}

/* Analysis in progress: the document is already open on the left. */
#predictionView .prediction-analyzing { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 420px; padding: 32px 24px; border: 1px solid #c4d2e3; border-radius: 8px; background: #fff; text-align: center; }
#predictionView .prediction-analyzing img { width: min(220px, 50%); height: auto; aspect-ratio: 1; /* the animation is 16:9 with the figure in the middle; show the centred square */ object-fit: cover; }
#predictionView .prediction-analyzing h2 { margin: 4px 0 0; font-size: 22px; }
#predictionView .prediction-analyzing-stage { margin: 0; color: #0954a8; font-size: var(--review-body); font-weight: 600; }
#predictionView .prediction-analyzing-hint { margin: 8px 0 0; color: #46566c; font-size: var(--review-small); line-height: 1.8; overflow-wrap: anywhere; }
@media (prefers-reduced-motion: reduce) { #predictionView .prediction-analyzing img { display: none; } }

/* Home before an analysis: one composed screen — upload, guide and capabilities. */
body.prediction-home .analysis-main { display: flex; flex-direction: column; min-height: calc(100dvh - var(--header-height)); }
body.prediction-home #predictionView { display: flex; flex: 1; flex-direction: column; margin-bottom: 0; }
#predictionView .prediction-highlights[hidden] { display: none; }
#predictionView .upload-symbol,#predictionView .upload-zone > .prediction-choose-file { flex-shrink: 0; }
@media (min-width: 1024px) {
 body.prediction-home #predictionView .prediction-intro { margin-bottom: 18px; }
 body.prediction-home #predictionView .prediction-workspace { flex: 1; align-items: stretch; grid-template-columns: minmax(0,1fr) clamp(304px,23vw,380px); gap: 20px; }
 body.prediction-home #predictionView .prediction-upload { display: flex; flex-direction: column; padding: 22px 24px; }
 body.prediction-home #predictionView .prediction-upload-heading { margin-bottom: 16px; }
 body.prediction-home #predictionView .upload-zone { flex: 1 1 auto; min-height: 196px; max-height: 460px; }
 body.prediction-home #predictionView .prediction-profiles { margin-top: auto; }
 body.prediction-home #predictionView .prediction-profiles summary { min-height: 48px; padding: 10px 0; }
 body.prediction-home #predictionView .prediction-submit { margin-top: 16px; }
 body.prediction-home #predictionView .prediction-empty { display: flex; flex-direction: column; padding: 22px; }
 body.prediction-home #predictionView .prediction-steps { flex: 1; display: flex; flex-direction: column; margin: 20px 0; }
 body.prediction-home #predictionView .prediction-steps li { flex: 1 1 auto; padding-bottom: 20px; }
 body.prediction-home #predictionView .prediction-steps li:last-child { flex: 0 0 auto; }
}
#predictionView .prediction-highlights { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; margin: 20px 0 0; }
#predictionView .prediction-highlights article { display: flex; align-items: flex-start; gap: 12px; min-width: 0; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 3px 14px rgb(23 43 70 / 3%); }
#predictionView .prediction-highlight-icon { display: grid; place-items: center; width: 34px; height: 34px; flex-shrink: 0; border-radius: 9px; background: var(--primary-soft); color: var(--primary); }
#predictionView .prediction-highlights h4 { margin: 4px 0 6px; color: var(--ink); font-size: 16px; font-weight: 650; line-height: 1.5; }
#predictionView .prediction-highlights p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.75; }
@media (max-width: 1200px) {
 #predictionView .prediction-highlights { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 760px) {
 #predictionView .prediction-highlights { grid-template-columns: minmax(0,1fr); gap: 10px; margin-top: 16px; }
 #predictionView .prediction-highlights article { padding: 14px; }
}
/* Laptop-height screens: the whole home still lands on one screen. */
@media (min-width: 1024px) and (max-height: 940px) {
 body.prediction-home #predictionView .prediction-intro { margin-bottom: 14px; }
 body.prediction-home #predictionView .prediction-intro h2 { margin: 4px 0 6px; font-size: 24px; }
 body.prediction-home #predictionView .prediction-intro p { font-size: 15px; }
 body.prediction-home #predictionView .prediction-upload { padding: 18px 20px; }
 body.prediction-home #predictionView .prediction-upload-heading { margin-bottom: 12px; }
 body.prediction-home #predictionView .upload-zone { min-height: 150px; gap: 6px; padding: 16px; }
 body.prediction-home #predictionView .upload-symbol { width: 46px; height: 46px; margin-bottom: 0; }
 body.prediction-home #predictionView .upload-symbol svg { width: 23px; height: 23px; }
 body.prediction-home #predictionView .prediction-empty { padding: 18px 20px; }
 body.prediction-home #predictionView .prediction-steps { margin: 14px 0; }
 body.prediction-home #predictionView .prediction-steps li { padding-bottom: 14px; }
 body.prediction-home #predictionView .prediction-highlights { gap: 12px; margin-top: 14px; }
 body.prediction-home #predictionView .prediction-highlights article { gap: 10px; padding: 13px 15px; }
 body.prediction-home #predictionView .prediction-highlights h4 { margin: 2px 0 4px; font-size: 15px; }
 body.prediction-home #predictionView .prediction-highlights p { font-size: 14px; line-height: 1.65; }
}
@media (min-width: 1024px) and (max-height: 940px) {
 body.prediction-home #predictionView .prediction-guide-heading h3 { margin: 6px 0; font-size: 16px; }
 body.prediction-home #predictionView .prediction-guide-heading p { font-size: 14px; line-height: 1.7; }
 body.prediction-home #predictionView .prediction-step-number { width: 28px; height: 28px; font-size: 14px; }
 body.prediction-home #predictionView .prediction-steps h4 { margin: 2px 0 4px; font-size: 15px; }
 body.prediction-home #predictionView .prediction-steps p { font-size: 14px; line-height: 1.7; }
 body.prediction-home #predictionView .prediction-steps li:not(:last-child)::after { top: 33px; }
 body.prediction-home #predictionView .prediction-empty > .prediction-guide-note { padding: 11px 12px; font-size: 14px; line-height: 1.7; }
}
@media (min-width: 1024px) and (max-height: 820px) {
 body.prediction-home #predictionView .prediction-guide-heading p:not(.eyebrow) { display: none; }
 body.prediction-home #predictionView .prediction-guide-heading h3 { margin: 4px 0 0; }
 body.prediction-home #predictionView .prediction-steps { margin: 10px 0; }
 body.prediction-home #predictionView .prediction-steps li { padding-bottom: 12px; }
 body.prediction-home #predictionView .prediction-file-types { display: none; }
}
@media (min-width: 1024px) and (max-height: 790px) {
 body.prediction-home #predictionView .prediction-intro { margin-bottom: 10px; }
 body.prediction-home #predictionView .prediction-steps li { padding-bottom: 10px; }
 body.prediction-home #predictionView .prediction-highlights { margin-top: 12px; }
 body.prediction-home #predictionView .prediction-guide-heading .eyebrow { display: none; }
 body.prediction-home #predictionView .prediction-highlights article { padding: 11px 14px; }
}

#predictionView .prediction-analyzing-rules { width: min(100%, 560px); margin-top: 8px; text-align: left; }
#predictionView .prediction-analyzing-rules:empty { display: none; }
#predictionView .prediction-analyzing-rules h3 { margin: 12px 0 6px; font-size: 14px; font-weight: 600; }
#predictionView .prediction-analyzing-rules ol { max-height: 300px; margin: 0; padding: 0; overflow-y: auto; border-top: 1px solid #d7e0ec; list-style: none; }
#predictionView .prediction-analyzing-rules li { display: grid; grid-template-columns: minmax(0, 1fr) 64px 120px; gap: 8px; padding: 6px 2px; border-bottom: 1px solid #e4eaf2; font-size: 13px; }
#predictionView .prediction-analyzing-rule { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#predictionView .prediction-analyzing-max, #predictionView .prediction-analyzing-score { color: #4a5a70; text-align: right; font-variant-numeric: tabular-nums; }

/* Simplified home: one clear action and no explanatory small print. */
body.prediction-home #predictionView { width: 100%; max-width: 1080px; margin-inline: auto; }
body.prediction-home #predictionView .prediction-intro { display: block; margin: 8px 0 20px; text-align: center; }
body.prediction-home #predictionView .prediction-intro h2 { margin: 0; font-size: 30px; line-height: 1.4; }
#predictionView .prediction-highlights article { align-items: center; padding: 14px 18px; }
#predictionView .prediction-highlights h4 { margin: 0; }
#predictionView .prediction-submit { justify-content: stretch; }
#predictionView .prediction-submit #startPrediction { flex: 1; min-height: 52px; font-size: 17px; }
@media (min-width: 1024px) {
 body.prediction-home #predictionView .prediction-workspace { grid-template-columns: minmax(0,1fr); }
 body.prediction-home #predictionView .upload-zone { min-height: 240px; }
}

/* Quotes stay beside the results; advanced formula settings are optional. */
#predictionView .prediction-inline-price { flex: none; margin: 8px 0; padding: 10px 12px; border: 1px solid #c9dcf7; border-radius: 8px; background: #f6faff; }
#predictionView .inline-price-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 12px; margin-bottom: 6px; }
#predictionView .inline-price-heading h3 { margin: 0; color: #183959; font-size: 15px; }
#predictionView .inline-price-heading > span { color: #526b88; font-size: 12px; }
#predictionView .inline-price-fields { display: grid; grid-template-columns: 80px repeat(3, minmax(0, 1fr)); gap: 10px; }
#predictionView .prediction-inline-price label { display: flex; flex-direction: column; gap: 3px; min-width: 0; color: #364f70; font-size: 13px; font-weight: 600; }
#predictionView .prediction-inline-price input,#predictionView .prediction-inline-price select { width: 100%; min-width: 0; min-height: 36px; padding: 5px 8px; border: 1px solid #9cb5d8; border-radius: 5px; background: #fff; font-size: 15px; font-variant-numeric: tabular-nums; }
#predictionView .prediction-inline-price input[aria-invalid=true] { border-color: #b42318; }
#predictionView .price-field-error { color: #a3271a; font-size: 12px; font-weight: 400; }
#predictionView .price-field-error:empty { display: none; }
#predictionView #priceOutcome { margin-top: 5px; color: #405878; font-size: 12px; }
#predictionView #priceOutcome p { margin: 0; }
#predictionView .inline-price-result { display: flex; align-items: baseline; flex-wrap: wrap; gap: 3px 14px; }
#predictionView .inline-price-result b { color: #174a91; font-size: 15px; }
#predictionView .inline-price-result small { font-size: 12px; }
#predictionView .inline-price-settings { margin-top: 4px; font-size: 12px; color: #435b7a; }
#predictionView .inline-price-settings summary { width: fit-content; cursor: pointer; color: #1757a8; padding-block: 3px; }
#predictionView .inline-price-settings[open] { max-height: 180px; overflow: auto; }
#predictionView .inline-price-settings p { margin: 8px 0 0; }
#predictionView .inline-price-options { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; margin-top: 8px; }
@media (max-width: 600px) {
 #predictionView .inline-price-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
 #predictionView .prediction-inline-price input,#predictionView .prediction-inline-price select { min-height: 44px; font-size: 16px; }
 #predictionView .inline-price-settings summary { min-height: 36px; display: flex; align-items: center; }
}
@container (max-width: 800px) {
 #predictionView .prediction-cards article { flex-wrap: wrap; gap: 0 6px; padding-inline: 8px; }
 #predictionView .prediction-cards h3 { flex-basis: 100%; font-size: 14px; }
 #predictionView .prediction-total-value { font-size: 18px; }
 #predictionView .prediction-card-breakdown { flex-basis: 100%; margin: 0; white-space: normal; font-size: 12px; }
}

#predictionView .prediction-table .prediction-bid-row th { height: 36px; line-height: 34px; }
#predictionView .prediction-bid-row td { padding: 3px 8px; border-top: 1px solid #c4d1e2; background: #e6edf6; vertical-align: middle; }
#predictionView .prediction-bid-row input::-webkit-outer-spin-button,#predictionView .prediction-bid-row input::-webkit-inner-spin-button { margin: 0; -webkit-appearance: none; }
#predictionView .prediction-bid-row input { appearance: textfield; -moz-appearance: textfield; width: 100%; min-width: 0; height: 28px; padding: 2px 3px; border: 1px solid #9db4d3; border-radius: 6px; background: #fff; color: #12304f; font: inherit; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: center; }
#predictionView .prediction-bid-row input:focus-visible { outline: 2px solid #2d6cdf; outline-offset: 1px; }
#predictionView .prediction-bid-row input[aria-invalid=true] { border-color: #b42318; }
#predictionView .prediction-bid-row .price-field-error { display: block; color: #b42318; font-size: 11px; line-height: 1.2; text-align: center; }
#predictionView .prediction-bid-row .price-field-error:empty { display: none; }
#predictionView .prediction-bid-unit { display: inline-flex; align-items: center; gap: 6px; float: right; color: #526b88; font-size: 13px; font-weight: 500; }
#predictionView .prediction-bid-unit select { height: 26px; padding: 0 4px; border: 1px solid #9db4d3; border-radius: 6px; background: #fff; font: inherit; font-size: 13px; }
#predictionView .prediction-inline-price.is-below { margin: 6px 0 0; padding: 6px 12px; }
#predictionView .prediction-inline-price.is-below #priceOutcome:empty { display: none; }
@media (max-width: 760px) {
 #predictionView .prediction-table .prediction-bid-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
 #predictionView .prediction-table .prediction-bid-row th { grid-column: 1 / -1; height: 34px; }
 #predictionView .prediction-table .prediction-bid-row td { display: block; padding: 4px 6px; }
 #predictionView .prediction-table .prediction-bid-row td::before { content: attr(data-label) "报价"; display: block; color: #526b88; font-size: 12px; text-align: center; }
}

#predictionView .prediction-max-button { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 28px; padding: 0 6px; border: 0; border-radius: 6px; background: none; color: inherit; font: inherit; cursor: pointer; }
#predictionView .prediction-max-button:hover,#predictionView .prediction-max-button:focus-visible { background: #dfe9f7; outline: none; box-shadow: 0 0 0 2px #2d6cdf55; }
#predictionView .prediction-table tr.is-located > td:first-child { box-shadow: inset 3px 0 0 #d97706; background: #fff8eb; }

/* 历史分析记录: past analyses open from the home page in a compact dialog; each row links to /?view=home&job=<id>. */
#predictionView .home-links { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 18px; margin-left: auto; }
#predictionView button.home-history { padding: 0; border: 0; background: none; color: var(--primary); font: inherit; font-weight: 550; cursor: pointer; }
#predictionView button.home-history:hover, #predictionView a.home-history:hover { text-decoration: underline; }
body.prediction-home #predictionView .prediction-submit .home-links { margin: 0; }
#predictionView #predictionHistory { width: min(760px, calc(100vw - 40px)); max-width: none; max-height: calc(100dvh - 40px); margin: auto; padding: 0; border: 1px solid #b9cce6; border-radius: 12px; background: #fff; color: var(--ink); }
#predictionView #predictionHistory[open] { display: flex; flex-direction: column; }
#predictionView #predictionHistory::backdrop { background: rgb(20 36 60 / 55%); }
#predictionView .prediction-history-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 18px 24px 14px; border-bottom: 1px solid var(--line); }
#predictionView .prediction-history-heading .eyebrow { margin: 0 0 4px; }
#predictionView .prediction-history-heading h2 { margin: 0; font-size: 20px; font-weight: 650; line-height: 1.5; }
#predictionView .prediction-history-heading button { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); cursor: pointer; }
#predictionView .prediction-history-heading button:hover { background: #f4f8ff; }
#predictionView .prediction-history-body { overflow: auto; padding: 6px 24px 18px; }
#predictionView .prediction-history-list { margin: 0; padding: 0; list-style: none; }
#predictionView .prediction-history-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 16px; padding: 12px 0; border-bottom: 1px solid #e6edf6; }
#predictionView .prediction-history-row:last-child { border-bottom: 0; }
#predictionView .prediction-history-row[aria-current] { margin: 0 -12px; padding-inline: 12px; border-radius: 8px; background: #f4f8ff; }
#predictionView .prediction-history-title { grid-column: 1; min-width: 0; color: var(--ink); font-size: 16px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
#predictionView a.prediction-history-title { color: var(--primary); text-decoration: none; }
#predictionView a.prediction-history-title:hover { text-decoration: underline; }
#predictionView .prediction-history-meta { grid-column: 2; grid-row: 1 / 4; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; color: var(--muted); font-size: 13px; line-height: 1.6; white-space: nowrap; }
#predictionView .prediction-history-status { padding: 1px 8px; border-radius: 999px; background: #e8f1ff; color: #0954a8; font-weight: 550; }
#predictionView .prediction-history-row[data-status="running"] .prediction-history-status { background: #fff4e0; color: #9a5b00; }
#predictionView .prediction-history-row[data-status="failed"] .prediction-history-status { background: #fdecea; color: #b42318; }
#predictionView .prediction-history-file, #predictionView .prediction-history-error { grid-column: 1; min-width: 0; color: var(--muted); font-size: 13px; line-height: 1.6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#predictionView .prediction-history-error { color: #b42318; white-space: normal; }
#predictionView .prediction-history-empty { margin: 14px 0; color: var(--muted); font-size: 15px; line-height: 1.7; }
@media (max-width: 520px) {
 #predictionView #predictionHistory { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); }
 #predictionView .prediction-history-heading, #predictionView .prediction-history-body { padding-inline: 14px; }
 #predictionView .prediction-history-row { grid-template-columns: minmax(0, 1fr); }
 #predictionView .prediction-history-meta { grid-column: 1; grid-row: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
}

/* Column pickers: each family column can stand for one member company (2026-09-22). */
#predictionView .prediction-table thead .prediction-family-heading { height: auto; padding: 4px 6px; vertical-align: top; }
#predictionView .prediction-family-name { display: block; line-height: 1.5; }
#predictionView .prediction-subject-select { display: block; width: 100%; min-height: 26px; margin-top: 3px; padding: 2px 4px; border: 1px solid #c7d3e3; border-radius: 4px; background: #fff; color: var(--ink); font-size: 12px; font-weight: 500; line-height: 1.4; text-overflow: ellipsis; cursor: pointer; }
#predictionView .prediction-subject-select:disabled { cursor: progress; opacity: .7; }
#predictionView .prediction-family-heading:not([data-subject=""]) .prediction-subject-select { color: var(--prediction-family-color); font-weight: 650; border-color: currentColor; }
#predictionView .prediction-variant-status { margin: 6px 0 0; padding: 6px 10px; border: 1px solid #c7dcf5; border-radius: 6px; background: #eef6ff; color: #253b56; font-size: var(--review-body); line-height: 1.5; }
#predictionView .prediction-variant-status[data-tone="error"] { border-color: #f0c2c2; background: #fdecec; color: #8a1f1f; }
#predictionView .prediction-variant-status[data-tone="running"]::before { content: ''; display: inline-block; width: 10px; height: 10px; margin-right: 6px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; vertical-align: -1px; animation: prediction-variant-spin 1s linear infinite; }
#predictionView .prediction-variant-status button { margin-left: 8px; min-height: 26px; padding: 2px 10px; }
@keyframes prediction-variant-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { #predictionView .prediction-variant-status[data-tone="running"]::before { animation: none; } }
#predictionView .prediction-subject-summary { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 6px 0 0; padding: 6px 10px; border: 1px solid #c7dcf5; border-radius: 6px; background: #f4f9ff; color: #253b56; font-size: var(--review-body); line-height: 1.5; }
#predictionView .prediction-subject-summary b { font-weight: 600; }
#predictionView .prediction-subject-summary span { white-space: nowrap; }
#predictionView .prediction-subject-summary .family-0 { color: var(--prediction-family-0); }
#predictionView .prediction-subject-summary .family-1 { color: var(--prediction-family-1); }
#predictionView .prediction-subject-summary .family-2 { color: var(--prediction-family-2); }
#predictionView .prediction-subject-summary button { margin-left: auto; min-height: 26px; padding: 2px 10px; }
/* Three comparison companies chosen before the upload (default: largest member of each family). */
#predictionView .upload-subjects { margin: 14px 0 0; padding: 0; border: 0; min-width: 0; }
#predictionView .upload-subjects legend { margin-bottom: 8px; padding: 0; color: var(--text, #1c2b3a); font-size: 15px; font-weight: 600; }
#predictionView .upload-subject-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
#predictionView .upload-subject { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
#predictionView .upload-subject span { color: var(--muted); font-size: 14px; }
#predictionView .upload-subject select { width: 100%; min-width: 0; min-height: 38px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: inherit; font: inherit; font-size: 14px; text-overflow: ellipsis; }
#predictionView .upload-subject-loading { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 14px; }
@media (max-width: 640px) { #predictionView .upload-subject-list { grid-template-columns: 1fr; } }
.prediction-evidence-label{display:inline-block;font-size:11px;font-weight:500;line-height:1.4;color:#475569;margin-left:6px;white-space:normal}
.prediction-calculation{margin:16px 0;padding:14px;border:1px solid #cbd5e1;border-radius:8px;background:#f8fafc}
.prediction-calculation h3{margin:0 0 12px}.prediction-evidence-totals{display:flex;flex-wrap:wrap;gap:16px;margin:0 0 12px}.prediction-evidence-totals dt{font-size:12px;color:#475569}.prediction-evidence-totals dd{font-size:20px;font-weight:700;margin:4px 0}
.prediction-calculation-list{padding-left:24px}.prediction-calculation-list>li{margin:16px 0}.prediction-calculation-list p{white-space:pre-wrap;overflow-wrap:anywhere}.prediction-calculation-list summary{cursor:pointer}.prediction-calculation-list blockquote{margin:8px 0;padding:8px;border-left:3px solid #94a3b8;white-space:pre-wrap;overflow-wrap:anywhere;background:white}.prediction-accuracy-summary{font-size:12px;color:#475569}
