* { box-sizing: border-box; }
.claim-review-main [hidden] { display: none !important; }

.claim-review-main {
    width: min(1280px, calc(100% - 36px));
    margin: 0 auto;
    padding: 26px 0 38px;
}

.standard-notice {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    margin-bottom: 18px;
    padding: 16px 18px;
    border: 1px solid #cbdcf8;
    border-radius: 12px;
    background: #edf4ff;
    color: #173f85;
}

.standard-notice > i {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #dce9ff;
    color: #0849df;
}

.standard-notice strong { display: block; margin-bottom: 4px; font-size: .94rem; }
.standard-notice p { margin: 0; color: #47658f; font-size: .83rem; line-height: 1.65; }

.review-workspace,
.result-section,
.loading-state,
.scope-note {
    border: 1px solid #dce4f2;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 10px 26px rgba(34, 66, 132, .08);
}

.review-workspace { padding: 24px; }
.workspace-heading,
.result-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 20px;
}

.workspace-heading h2,
.result-heading h2,
.scope-note h2 { margin: 0; color: #172554; font-size: 1.16rem; }
.workspace-heading p,
.result-heading p { margin: 6px 0 0; color: #667085; font-size: .86rem; line-height: 1.6; }

.text-button {
    flex: 0 0 auto;
    padding: 8px 10px;
    border: 0;
    background: transparent;
    color: #0849df;
    cursor: pointer;
    font: inherit;
    font-size: .84rem;
    font-weight: 700;
}

.text-button:hover { color: #073fcb; }
.text-button:active { transform: translateY(1px); }
.workspace-tools { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: flex-end; }

.input-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(340px, .75fr); gap: 22px; align-items: start; }
.input-panel { min-width: 0; }
.input-panel label,
.field-label { display: block; margin-bottom: 8px; color: #344054; font-size: .88rem; font-weight: 700; }

#claimText {
    display: block;
    width: 100%;
    min-height: 230px;
    padding: 14px;
    resize: vertical;
    border: 1px solid #cdd7e7;
    border-radius: 10px;
    outline: none;
    background: #fbfcfe;
    color: #17213c;
    font: inherit;
    font-size: .9rem;
    line-height: 1.75;
}

#claimText:focus { border-color: #0849df; box-shadow: 0 0 0 3px rgba(8, 73, 223, .11); background: #fff; }
#claimText::placeholder { color: #7a869e; }
.field-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 7px; color: #69758b; font-size: .76rem; }

.upload-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 230px;
    padding: 30px 24px;
    border: 2px dashed #85a8e8;
    border-radius: 12px;
    background: #f5f8ff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .8);
    color: #172554;
    cursor: pointer;
    font: inherit;
    text-align: center;
    transition: border-color .16s, background-color .16s, transform .16s;
}

.upload-zone:hover,
.upload-zone.dragging { border-color: #0849df; background: #eaf1ff; }
.upload-zone:focus-visible { outline: 3px solid rgba(8, 73, 223, .22); outline-offset: 3px; }
.upload-zone:active { transform: scale(.99); }
.upload-zone > i {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    margin-bottom: 16px;
    border-radius: 12px;
    background: #dbe8ff;
    color: #0849df;
    font-size: 1.45rem;
}
.upload-zone strong { color: #172554; font-size: 1rem; line-height: 1.45; }
.upload-zone span { margin-top: 7px; color: #425574; font-size: .82rem; line-height: 1.5; }
.upload-zone small { margin-top: 12px; color: #5f6f89; font-size: .74rem; line-height: 1.5; }

.image-list { display: grid; gap: 8px; margin-top: 10px; }
.image-item { display: grid; grid-template-columns: 54px minmax(0, 1fr) 32px; gap: 10px; align-items: center; padding: 7px; border-radius: 9px; background: #f4f7fb; }
.image-preview-button { position: relative; width: 54px; height: 54px; padding: 0; overflow: hidden; border: 1px solid #cbd8eb; border-radius: 8px; background: #fff; cursor: zoom-in; }
.image-preview-button img { width: 100%; height: 100%; object-fit: cover; }
.image-preview-button i { position: absolute; right: 3px; bottom: 3px; display: grid; width: 20px; height: 20px; place-items: center; border-radius: 6px; background: rgba(15, 49, 104, .84); color: #fff; font-size: .66rem; }
.image-preview-button:hover { border-color: #4e7fe5; box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.image-preview-button:focus-visible { outline: 3px solid rgba(37, 99, 235, .28); outline-offset: 2px; }
.image-item div { min-width: 0; }
.image-item strong { display: block; overflow: hidden; color: #334155; font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.image-item span { display: block; margin-top: 3px; color: #718096; font-size: .7rem; }
.image-remove { width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: #9a3412; cursor: pointer; }
.image-remove:hover { background: #ffedd5; }

.claim-image-preview-dialog { width: min(1120px, calc(100vw - 32px)); max-height: 92vh; }
.claim-image-preview-body { display: flex; min-height: 240px; max-height: calc(92vh - 76px); align-items: center; justify-content: center; overflow: auto; background: #0f1f38; }
.claim-image-preview-body img { display: block; max-width: 100%; max-height: calc(92vh - 108px); object-fit: contain; }

.form-error { margin-top: 16px; padding: 11px 13px; border: 1px solid #fecaca; border-radius: 9px; background: #fff1f2; color: #9f1239; font-size: .84rem; }
.review-actions { display: flex; justify-content: flex-start; gap: 10px; margin-top: 20px; }
.review-actions .tool-button { min-width: 126px; }
.review-actions .review-button { min-width: 184px; }

.loading-state { margin-top: 18px; padding: 24px; }
.loading-copy { display: flex; gap: 13px; align-items: center; color: #1e3a78; }
.loading-copy > i { font-size: 1.25rem; }
.loading-copy strong,
.loading-copy span { display: block; }
.loading-copy span { margin-top: 4px; color: #6a7892; font-size: .8rem; }
.skeleton-lines { display: grid; gap: 9px; margin-top: 20px; }
.skeleton-lines span { height: 11px; border-radius: 6px; background: #e9eef7; }
.skeleton-lines span:nth-child(2) { width: 82%; }
.skeleton-lines span:nth-child(3) { width: 61%; }
@media (prefers-reduced-motion: no-preference) {
    .skeleton-lines span { animation: claim-pulse 1.35s ease-in-out infinite alternate; }
}
@keyframes claim-pulse { to { opacity: .42; } }

.result-section { margin-top: 18px; padding: 24px; scroll-margin-top: 18px; }
.decision-badge { flex: 0 0 auto; padding: 7px 12px; border-radius: 9px; font-size: .82rem; font-weight: 800; }
.decision-badge.high_risk { background: #fee2e2; color: #991b1b; }
.decision-badge.needs_review { background: #fef3c7; color: #92400e; }
.decision-badge.no_obvious_risk { background: #dcfce7; color: #166534; }

.matched-context { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.matched-context > div { padding: 14px 16px; border-radius: 11px; background: #f6f8fc; }
.matched-context span,
.matched-context strong,
.matched-context small { display: block; }
.matched-context span { color: #68758d; font-size: .74rem; }
.matched-context strong { margin-top: 5px; color: #1f3b70; font-size: .95rem; }
.matched-context small { margin-top: 5px; color: #76839a; font-size: .72rem; line-height: 1.5; }

.finding-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.finding-summary span { padding: 5px 9px; border-radius: 8px; background: #f2f4f7; color: #475467; font-size: .76rem; }
.finding-list { display: grid; gap: 12px; }
.finding-card { overflow: hidden; border: 1px solid #e1e7f0; border-left: 4px solid #d97706; border-radius: 11px; background: #fff; }
.finding-card.high { border-left-color: #dc2626; }
.finding-card.info { border-left-color: #2563eb; }
.finding-card-header { display: flex; justify-content: space-between; gap: 16px; padding: 15px 16px 12px; }
.finding-card-header span { display: block; margin-bottom: 4px; color: #667085; font-size: .72rem; }
.finding-card-header h3 { margin: 0; color: #233252; font-size: .95rem; }
.severity { flex: 0 0 auto; align-self: flex-start; padding: 4px 8px; border-radius: 7px; background: #fef3c7; color: #92400e; font-size: .72rem; font-weight: 800; }
.severity.high { background: #fee2e2; color: #991b1b; }
.severity.info { background: #dbeafe; color: #1d4ed8; }
.finding-body { display: grid; gap: 11px; padding: 0 16px 16px; }
.finding-row { font-size: .82rem; line-height: 1.7; }
.finding-row > strong { display: block; margin-bottom: 3px; color: #41516d; font-size: .76rem; }
.finding-row p { margin: 0; color: #4d5c73; }
.finding-quote { padding: 9px 11px; border-radius: 8px; background: #f7f9fc; color: #243653; white-space: pre-wrap; word-break: break-word; }
.evidence-gap { padding: 9px 11px; border-radius: 8px; background: #fff7ed; color: #9a3412; }
.source-list { display: grid; gap: 7px; }
.source-item { padding: 9px 11px; border-radius: 8px; background: #f4f7fb; color: #53627a; font-size: .78rem; line-height: 1.6; }
.source-item a { color: #0849df; font-weight: 700; text-decoration: none; }
.source-item a:hover { text-decoration: underline; }
.source-status { color: #7a5665; }
.source-clause { margin-top: 8px; padding: 9px 11px; border-left: 3px solid #c8d5e8; border-radius: 0 7px 7px 0; background: #fff; }
.source-clause strong { display: block; margin-bottom: 3px; color: #40516e; font-size: .74rem; }
.source-clause p { margin: 0; color: #53627a; white-space: pre-wrap; word-break: break-word; }
.no-findings { display: flex; gap: 14px; align-items: flex-start; padding: 18px; border-radius: 11px; background: #effaf4; color: #17613f; }
.no-findings > i { margin-top: 2px; font-size: 1.35rem; }
.no-findings strong { display: block; }
.no-findings p { margin: 5px 0 0; color: #4e7563; font-size: .82rem; line-height: 1.65; }

.extracted-text { margin-top: 18px; border-radius: 10px; background: #f7f9fc; }
.extracted-text summary { padding: 12px 14px; color: #40516e; cursor: pointer; font-size: .82rem; font-weight: 700; }
.extracted-text pre { max-height: 300px; margin: 0; padding: 0 14px 14px; overflow: auto; color: #516079; font: .78rem/1.7 "Microsoft YaHei", sans-serif; white-space: pre-wrap; word-break: break-word; }
.billing-note { margin-top: 12px; color: #7a8699; font-size: .74rem; text-align: right; }

.scope-note { margin-top: 18px; padding: 22px 24px; }
.scope-note h2 { margin-bottom: 14px; }
.scope-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 24px; }
.scope-grid p { margin: 0; color: #657188; font-size: .8rem; line-height: 1.65; }
.scope-grid strong { color: #34445f; }

@media (max-width: 760px) {
    .claim-review-main { width: calc(100% - 24px); padding-top: 16px; }
    .review-workspace, .result-section, .scope-note { padding: 17px; }
    .workspace-heading, .result-heading { align-items: stretch; flex-direction: column; gap: 10px; }
    .text-button { align-self: flex-start; padding-left: 0; }
    .workspace-tools { justify-content: flex-start; }
    .input-grid, .matched-context, .scope-grid { grid-template-columns: 1fr; }
    .input-panel--image { order: 1; }
    .input-panel--text { order: 2; }
    .upload-zone { min-height: 200px; padding: 24px 18px; }
    #claimText { min-height: 210px; }
    .field-meta { align-items: flex-end; flex-direction: column; gap: 3px; }
    .review-actions { flex-direction: column; }
    .review-actions .tool-button { width: 100%; }
    .decision-badge { align-self: flex-start; }
    .finding-card-header { align-items: flex-start; flex-direction: column; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
