body.matching-operations > main { max-width:800px; }
body.matching-operations h1 { font-size:24px; margin-bottom:20px; }
body.matching-operations .matching-brand { font-size:16px; font-weight:700; margin-right:22px; }
body.matching-operations .matching-panel { padding:24px; background:#fff; border:1px solid #dbe2ea; border-radius:7px; min-width:0; }
body.matching-operations .matching-panel + .matching-panel { margin-top:24px; }
body.matching-operations .matching-panel h2 { font-size:18px; color:#245b91; margin:0 0 18px; }
body.matching-operations .matching-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
body.matching-operations .matching-field { min-width:0; }
body.matching-operations .matching-field label { display:block; margin-bottom:6px; font-size:14px; color:#364c65; }
body.matching-operations .matching-field input { width:100%; }
body.matching-operations .matching-muted { font-size:13px; color:#53657a; }
body.matching-operations .matching-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:22px; }
body.matching-operations .matching-actions button { min-width:96px; }
body.matching-operations .matching-feedback { color:#245b91; font-size:14px; white-space:pre-wrap; overflow-wrap:anywhere; }
body.matching-operations .matching-feedback:empty { display:none; }
body.matching-operations .matching-feedback.error { color:#a33535; }
body.matching-operations .matching-scroll { overflow-x:auto; }
body.matching-operations table { width:100%; min-width:440px; border-collapse:collapse; font-size:13px; }
body.matching-operations th, body.matching-operations td { padding:10px 8px; text-align:left; border-bottom:1px solid #dbe2ea; }
body.matching-operations th { background:#edf2f7; white-space:nowrap; }
body.matching-operations .matching-score-group { border-top:1px solid #dbe2ea; padding-top:14px; margin-top:16px; }
body.matching-operations .matching-score-group h4 { margin:0 0 12px; font-size:14px; }
body.matching-operations .matching-score-group .matching-grid { grid-template-columns:repeat(5,minmax(0,1fr)); }
body.matching-operations .matching-score-group .matching-grid.pair { grid-template-columns:repeat(2,minmax(0,1fr)); }
body.matching-operations .matching-member-tabs { display:flex; gap:8px; }
body.matching-operations .matching-pagination { display:flex; align-items:center; justify-content:center; gap:16px; margin-top:20px; }
body.matching-policy-editor > main { max-width:1040px; }
body.matching-workspace > main { max-width:1240px; }
body.matching-workspace .matching-results-table { min-width:760px; font-size:12px; }
body.matching-workspace .matching-results-table td { overflow-wrap:anywhere; }
body.matching-workspace .matching-context-bar { border:1px solid #dbe2ea; background:#fff; border-radius:7px; padding:14px 20px; margin-bottom:20px; }
body.matching-workspace .matching-context-bar button { margin-left:auto; }
body.matching-workspace .matching-selection-grid { display:grid; grid-template-columns:minmax(320px,.95fr) minmax(400px,1.05fr); gap:20px; align-items:start; }
body.matching-workspace .matching-selection-grid > .matching-panel { margin-top:0; }
body.matching-workspace .matching-selection-grid > .matching-panel + .matching-panel { margin-top:0; }
body.matching-workspace .matching-request-fields { display:grid; grid-template-columns:92px minmax(0,1fr); gap:10px; align-items:center; }
body.matching-workspace #userSelect, body.matching-workspace #caregiverKeyword { width:100%; }
body.matching-workspace .matching-child-selection { margin:18px 0 0; padding:12px; border:1px solid #dbe2ea; border-radius:5px; }
body.matching-workspace .matching-child-selection label { display:flex; align-items:center; gap:8px; margin:8px 0; }
body.matching-workspace #recommendPanel { margin-top:24px; }
body.matching-workspace .matching-roster { max-height:680px; }
body.matching-workspace .matching-roster table { min-width:360px; }
body.matching-workspace .matching-match-action { text-align:center; margin-top:20px; }
body.matching-workspace .matching-limit { display:flex; align-items:center; justify-content:center; gap:16px; }
body.matching-workspace #matchButton { min-width:220px; }
@media(max-width:820px) { body.matching-workspace .matching-selection-grid { grid-template-columns:minmax(0,1fr); } body.matching-workspace .matching-roster { max-height:340px; } }
body.matching-workspace .matching-filter { display:flex; flex-wrap:wrap; align-items:center; gap:10px; }
body.matching-workspace .matching-filter input { flex:1 1 180px; }
body.matching-workspace .matching-panel + .matching-panel { margin-top:24px; }
body.matching-workspace dialog { width:min(680px,calc(100% - 28px)); max-height:90vh; overflow:auto; border:1px solid #dbe2ea; border-radius:7px; padding:24px; color:#203044; }
body.matching-workspace dialog::backdrop { background:rgba(25,40,60,.4); }
body.matching-workspace .matching-scroll button { white-space:nowrap; }
body.matching-operations .matching-page-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; }
body.matching-operations .matching-page-heading h1 { margin:0; }
body.matching-operations .matching-guide { font-size:13px; line-height:1.8; color:#435168; }
body.matching-operations .matching-guide p { margin:12px 0; }
body.matching-operations .matching-note { padding:12px 14px; border-radius:5px; background:#edf2f7; font-size:13px; line-height:1.8; }
body.matching-operations .matching-stage-flow { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; padding:0; list-style:none; }
body.matching-operations .matching-stage-flow li { border:1px solid #dbe2ea; border-radius:5px; padding:12px; background:#f5f7fa; }
body.matching-operations .matching-stage-flow strong, body.matching-operations .matching-stage-flow span { display:block; }
body.matching-policy-editor #weightInputs, body.matching-policy-editor .matching-score-group > .matching-grid { margin-top:18px; }
@media(max-width:600px) {
    body.matching-operations .matching-brand { flex-basis:100%; margin-bottom:4px; }
    body.matching-operations .matching-panel { padding:18px; }
    body.matching-operations .matching-grid, body.matching-operations .matching-score-group .matching-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
    body.matching-operations .matching-stage-flow { grid-template-columns:repeat(2,minmax(0,1fr)); }
}

body.matching-workspace #scoreDialog { box-sizing:border-box; width:min(1060px,calc(100vw - 32px)); max-height:calc(100dvh - 40px); overscroll-behavior:contain; }
body.matching-workspace #scoreDialog > header { position:sticky; top:-24px; background:#fff; padding:16px 0; z-index:1; }
body.matching-workspace .score-total { padding:16px; background:#1f3760; color:white; font-size:24px; font-weight:700; border-radius:6px; }
body.matching-workspace .score-detail-section { border:1px solid #dbe2ea; border-radius:6px; margin-top:12px; overflow:hidden; }
body.matching-workspace .score-detail-section summary { cursor:pointer; padding:16px; background:#f3f6fb; font-weight:700; }
body.matching-workspace .score-detail-section td { line-height:1.7; white-space:normal; }

body.matching-workspace .harmony-explanation { padding:16px; background:#f7faff; line-height:1.8; white-space:pre-line; }
body.matching-workspace .score-detail-section td p { margin:8px 0 0; color:#435168; line-height:1.8; }

body.matching-workspace #surveyDialog { box-sizing:border-box; width:min(1040px,calc(100vw - 32px)); max-height:90vh; }
body.matching-workspace #surveyDialog th:first-child { width:55%; }
body.matching-workspace #surveyDialog td { line-height:1.8; }

body.matching-workspace .matching-query-steps { display:flex; flex-wrap:wrap; gap:8px 28px; padding:12px 16px; margin:18px 0 8px; list-style-position:inside; background:#e9f0f8; border-radius:6px; font-weight:700; }
body.matching-workspace .matching-query-steps + p { margin:8px 0 18px; }
body.matching-workspace .matching-score-summary { min-width:680px; }
body.matching-workspace .matching-score-summary td:nth-child(2) { min-width:180px; line-height:1.7; }
body.matching-workspace .score-calculation { padding:12px 16px; margin:0; background:#f7faff; white-space:pre-line; line-height:1.8; }
@media(max-width:600px) { body.matching-workspace .matching-query-steps { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; font-size:12px; } }

body.matching-policy-list > main { max-width:1240px; }
body.matching-policy-list table { min-width:720px; }
body.matching-policy-list th, body.matching-policy-list td { line-height:1.8; }
body.matching-policy-list #policyHistoryDialog { box-sizing:border-box; width:min(850px,calc(100vw - 32px)); max-height:90vh; overflow:auto; padding:24px; border:1px solid #dbe2ea; border-radius:7px; color:#203044; }
body.matching-policy-list #policyHistoryDialog::backdrop { background:rgba(25,40,60,.4); }
body.matching-policy-list #policyHistoryDialog table { min-width:440px; }
body.matching-policy-list #policyHistoryDialog h2 { margin:0; }
