/* Smart combinations: one page flow, compact choices, expandable evidence. */
.smart-workspace,
.smart-patient-context {
  --smart-ink: #203d53;
  --smart-muted: #526c7d;
  --smart-line: #cce1ee;
  --smart-blue: #0087bf;
  --smart-blue-tint: #e8f8ff;
  --smart-purple: #8341ce;
  --smart-purple-tint: #f5edff;
  --smart-amber: #a56400;
  --smart-amber-tint: #fff4d9;
  color: var(--smart-ink);
  min-width: 0;
}
.smart-workspace { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.smart-workspace > *, .smart-details-workspace > *, .smart-context-fields > * { min-width: 0; }
.smart-workspace [hidden], .smart-patient-context [hidden] { display: none !important; }
.smart-workspace :is(input, select), .smart-patient-context :is(input, select) { min-width: 0; max-width: 100%; }
.smart-workspace :is(button, input, select, summary):focus-visible,
.smart-patient-context :is(input, select):focus-visible { outline: 3px solid #00a5d6; outline-offset: 3px; }
.smart-workspace button { transition: background-color .15s, border-color .15s; }
.smart-workspace button:disabled { cursor: not-allowed; }
.smart-workspace p, .smart-workspace small, .smart-workspace summary { overflow-wrap: anywhere; }
.smart-workspace :is(.subtle, small) { color: var(--smart-muted); }
.smart-workspace :is(.smart-work-main, .smart-options-panel, .smart-wide-bill, .smart-library, .smart-documents-fold) { scroll-margin-top: 20px; }

/* Patient context stays visible without taking the whole first screen. */
.smart-patient-context { padding: 14px 18px; margin-bottom: 18px; border: 1px solid #a7ddeb; border-top: 4px solid #00afd0; border-radius: 12px; background: #f4fcff; }
.smart-patient-context h2 { margin: 0 0 11px; font-size: 16px; color: #076c92; }
.smart-context-fields { display: grid; grid-template-columns: 1.25fr 1.1fr 1.2fr .8fr .85fr; gap: 12px; }
.smart-context-fields label { margin: 0; font-size: 12px; color: #3b596a; }
.smart-context-fields :is(input, select) { width: 100%; margin-top: 5px; padding: 8px 9px; font-size: 13px; }
.smart-patient-context [role=status] { margin: 9px 0 0; font-size: 12px; line-height: 1.6; color: #426577; }

/* Intent, counts and results form a single full-width reading area. */
.smart-work-main { min-width: 0; }
.smart-match-form { padding: 18px; background: #fff; border: 1px solid #a5dcef; border-top: 4px solid #00a9d6; border-radius: 12px; }
.smart-match-form h2 { margin: 0 0 13px; font-size: 19px; color: #116283; }
.smart-match-shortcuts { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 17px; padding-bottom: 15px; border-bottom: 1px solid #d5eaf4; }
.smart-match-shortcuts button { padding: 8px 12px; border: 1px solid #a9d9ed; border-radius: 7px; background: #f0fbff; color: #076f94; font-size: 13px; line-height: 1.35; }
.smart-match-shortcuts button:hover { background: #dcf5ff; border-color: #00a5d6; }
.smart-match-shortcuts button[aria-pressed=true], .smart-match-shortcuts button.active { background: #008ec0; border-color: #008ec0; color: #fff; }
.smart-match-inputs { display: grid; grid-template-columns: minmax(230px, 2.2fr) repeat(3, minmax(115px, 1fr)); gap: 12px; align-items: end; }
.smart-match-inputs label { margin: 0; font-size: 12px; color: #3e5b70; }
.smart-match-inputs input { width: 100%; margin-top: 6px; padding: 11px 10px; }
.smart-match-inputs label:first-child input { padding: 10px 12px; border: 2px solid #00a4d2; font-size: 15px; background: #faffff; }
.smart-workspace [data-clinical-selection] { margin-top: 13px; }
.smart-workspace [data-clinical-selection]:empty { display: none; }
.smart-workspace [data-clinical-selection] label { max-width: 620px; margin: 0; }
.smart-workspace [data-clinical-variant] { width: 100%; margin-top: 6px; border-color: #9cbde1; background: #f5f9ff; }
.smart-live-label { margin: 12px 0 0; padding: 8px 11px; border-radius: 6px; background: #e9faf3; color: #126c4b; font-size: 12px; line-height: 1.6; }
.smart-workspace [data-match-error]:empty { display: none; }
.smart-workspace [data-match-results]:empty { display: none; }
.smart-match-heading { padding-top: 15px; margin-top: 14px; border-top: 1px solid #cce5f1; }
.smart-match-heading h3 { margin: 0 0 5px; font-size: 17px; color: #076a99; }
.smart-match-heading p { margin: 0 0 12px; font-size: 12px; line-height: 1.65; color: #486276; }
.smart-missing-fields { display: flex; flex-wrap: wrap; gap: 7px; margin: 10px 0 12px; }
.smart-missing-fields button { padding: 7px 10px; background: #fff6df; border-color: #e7bd65; color: #795514; font-size: 12px; }
.smart-match-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; align-items: stretch; }
.smart-match-cards article { display: flex; flex-direction: column; min-width: 0; padding: 15px; border: 1px solid #b4ddec; border-top: 3px solid #00a1cf; border-radius: 9px; background: #fbfeff; }
.smart-match-cards article:nth-child(2) { border-top-color: #9360df; }
.smart-match-cards article:nth-child(3) { border-top-color: #e2a020; }
.smart-match-cards h3 { margin: 0 0 10px; color: #294b64; font-size: 15px; line-height: 1.55; overflow-wrap: anywhere; }
.smart-candidate-top > span { display: inline-block; margin-bottom: 7px; padding: 3px 7px; border-radius: 4px; background: #dcf4ff; color: #08779e; font-size: 11px; }
.smart-match-cards article:nth-child(2) .smart-candidate-top > span { background: #f0e6ff; color: #733abb; }
.smart-match-cards article:nth-child(3) .smart-candidate-top > span { background: #fff0c9; color: #8c6000; }
.smart-match-cards article > strong { display: block; color: #007caf; font-size: 21px; font-variant-numeric: tabular-nums; line-height: 1.4; }
.smart-match-cards article > p { margin: 7px 0 12px; color: #526b7d; font-size: 12px; line-height: 1.6; }
.smart-match-cards article > button { width: 100%; margin-top: auto; padding: 10px; border-color: #008fbd; background: #008fbd; color: #fff; white-space: normal; font-size: 13px; }
.smart-match-cards article > button:hover { background: #007aa4; }
.smart-match-cards article > button:disabled { background: #edf2f7; border-color: #cbd9e3; color: #536c7e; opacity: 1; }
.smart-match-cards article > details { margin: 0 0 13px; font-size: 12px; }
.smart-match-cards article > details > summary { padding: 8px 0; color: #236a90; }
.smart-match-cards article > details[open] { padding-bottom: 4px; }
.smart-candidate-badges { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 0 0 11px; }
.smart-candidate-badges > * { display: block; border-radius: 6px; padding: 7px 5px; background: #e6f7ff; color: #066e94; font-size: 12px; text-align: center; line-height: 1.5; }
.smart-candidate-badges .group-material { background: var(--smart-amber-tint); color: var(--smart-amber); }
.smart-candidate-badges .group-service { background: var(--smart-purple-tint); color: #7335b9; }
.smart-candidate-badges strong { display: block; font-size: 15px; color: inherit; }
.smart-candidate-group h4 { margin: 10px 0 7px; padding: 7px 8px; border-left: 3px solid #16a4d7; background: #e7f7ff; color: #176588; font-size: 12px; }
.smart-candidate-group.group-material h4 { background: var(--smart-amber-tint); border-color: #e5a21d; color: #8e5a00; }
.smart-candidate-group.group-service h4 { background: var(--smart-purple-tint); border-color: #9660d9; color: #7335b9; }
.smart-candidate-group ul { margin: 0 0 9px; padding-left: 18px; font-size: 12px; line-height: 1.8; }
.smart-candidate-group li span { color: #526b7d; }
.smart-candidate-group .subtle { font-size: 12px; }
.smart-candidate-changes { padding: 9px 0; border-top: 1px solid #dbeaf2; color: #48647a; font-size: 12px; line-height: 1.65; }
.smart-candidate-changes details { margin-top: 5px; }
.smart-candidate-changes summary { color: #007ca8; cursor: pointer; }
.smart-candidate-changes p { margin: 6px 0; font-size: 12px; overflow-wrap: anywhere; }
.smart-workspace [data-match-results] > details { margin-top: 12px; font-size: 12px; color: #516b7e; line-height: 1.65; }
.smart-match-confirm { margin: 13px 0 0; color: #36576c; font-size: 12px; line-height: 1.6; }

/* Extra items and the running fee table are adjacent, without nested vertical scroll. */
.smart-details-workspace { display: grid; grid-template-columns: minmax(280px, .7fr) minmax(0, 1.5fr); gap: 18px; align-items: start; }
.smart-options-panel { padding: 16px; border: 1px solid var(--smart-line); border-top: 4px solid #9a63e4; border-radius: 12px; background: #fff; }
.smart-options-panel h2 { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 7px; margin: 0 0 13px; color: #344b70; font-size: 17px; }
.smart-options-panel h2 small { font-size: 12px; font-weight: 400; }
.smart-related-toolbar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; margin-bottom: 13px; }
.smart-related-toolbar button { padding: 9px 4px; border-color: #c8dde9; background: #f7fbff; color: #36617b; border-radius: 6px; font-size: 12px; line-height: 1.5; }
.smart-related-toolbar button[data-option-group=standard][aria-pressed=true] { color: #fff; background: #008cbd; border-color: #008cbd; }
.smart-related-toolbar button[data-option-group=material][aria-pressed=true] { color: #603900; background: #ffc655; border-color: #eaaa26; }
.smart-related-toolbar button[data-option-group=service][aria-pressed=true] { color: #fff; background: #8750ce; border-color: #8750ce; }
.smart-options-search { color: #52677f; font-size: 12px; margin: 0; }
.smart-options-search input { padding: 9px 10px; margin-top: 5px; }
.smart-options-panel [data-related-options] > p { margin: 10px 0; font-size: 12px; line-height: 1.7; }
.smart-related-group { border-top: 3px solid #0aa4d2; }
.smart-related-group.group-material { border-color: #e4a021; }
.smart-related-group.group-service { border-color: #9660d8; }
.smart-related-group > h3 { margin: 0; padding: 10px 7px; background: #eaf8ff; color: #17698c; font-size: 12px; line-height: 1.55; }
.smart-related-group.group-material > h3 { background: var(--smart-amber-tint); color: #8d5a00; }
.smart-related-group.group-service > h3 { background: var(--smart-purple-tint); color: #7335b9; }
.smart-related-line { display: grid; grid-template-columns: minmax(0, 1fr) 73px; gap: 5px 9px; padding: 11px 3px; border-bottom: 1px solid #e1ebf2; }
.smart-related-line.is-smart-selected { background: #f0fbff; }
.smart-related-line > .smart-optional-choice { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; grid-column: 1/-1; margin: 0; padding: 3px 0; border: 0; border-radius: 0; background: transparent; color: #2d4c64; font-size: 13px; line-height: 1.65; text-align: left; overflow-wrap: anywhere; cursor: pointer; }
.smart-related-line > .smart-optional-choice:hover { color: #007b9c; background: transparent; }
.smart-related-line > .smart-optional-choice[aria-pressed=true] { color: #007b9c; font-weight: 600; }
.smart-optional-choice > [data-smart-selection-state] { flex: none; font-size: 11px; color: #007b9c; }
.smart-related-line > small { align-self: center; padding-left: 0; color: #3a647d; font-size: 12px; }
.smart-related-line input[type=number] { width: 100%; padding: 6px; text-align: center; font-size: 12px; }
.smart-related-line input:disabled { background: #f4f7fa; }
.smart-related-note { grid-column: 1/-1; margin-left: 0; color: #526b7f; font-size: 11px; line-height: 1.65; }
.smart-related-note summary { color: #547387; }
.smart-related-note p { margin: 6px 0; }
.smart-policy-notes { padding: 10px; margin-top: 13px; background: #fff8e9; border: 1px solid #f0d699; border-radius: 7px; color: #6c572b; font-size: 12px; line-height: 1.7; }
.smart-policy-notes summary { font-weight: 600; }
.smart-policy-notes p { margin: 7px 0; }
.smart-stage-list { display: flex; flex-wrap: wrap; gap: 4px 23px; padding-left: 20px; margin: 10px 0; }
.smart-wide-bill { border: 1px solid var(--smart-line); border-top: 4px solid #00a8cb; border-radius: 12px; background: #fff; overflow: hidden; }
.smart-wide-bill h2 { margin: 0; padding: 15px 16px; border-bottom: 1px solid #d2e8f2; background: #edfaff; color: #235773; font-size: 17px; line-height: 1.6; }
.smart-wide-bill h2 small { display: block; margin-top: 2px; color: #506d7d; font-size: 12px; font-weight: 400; }
.smart-document-context { padding: 10px 12px; border: 1px solid #d4e8f1; border-radius: 6px; background: #f2fafc; color: #3e5c70; font-size: 12px; line-height: 1.75; overflow-wrap: anywhere; }
.smart-wide-bill > .smart-document-context { margin: 0; padding: 10px 16px; border: 0; border-radius: 0; background: #fbfdff; border-bottom: 1px solid #e3edf3; }
.smart-bill-context { padding: 9px 16px; border-bottom: 1px solid #e1edf4; background: #fbfdff; color: #426a7e; font-size: 12px; }
.smart-bill-context summary { line-height: 1.6; }
.smart-bill-context .smart-document-context { margin: 8px 0 0; }
.smart-draft-state { padding: 9px 12px; margin: 10px 12px 0; border: 1px solid #c5e5f4; border-radius: 6px; background: #edf8ff; color: #286180; font-size: 12px; line-height: 1.7; }
.smart-draft-state[data-state=synced] { border-color: #b1e0d4; background: #effbf6; color: #176b56; }
.smart-draft-state[data-state=pending] { border-color: #edd395; background: #fff8e7; color: #805b19; }
.smart-quote-review { padding: 9px 12px; margin: 8px 12px; border-left: 3px solid #e3ac38; background: #fff7e5; color: #745525; font-size: 12px; line-height: 1.65; }
.smart-match-cards .smart-quote-review { margin: 0 0 10px; padding: 8px; font-size: 11px; }
.smart-wide-table { width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
.smart-wide-table table { width: 100%; min-width: 610px; border-collapse: collapse; font-size: 12px; }
.smart-wide-table th, .smart-wide-table td { padding: 11px 9px; border-bottom: 1px solid #e5eff5; text-align: left; vertical-align: middle; line-height: 1.6; }
.smart-wide-table thead th { background: #f0f6fb; color: #496778; white-space: nowrap; font-weight: 600; }
.smart-wide-table tbody td { background: #fff; }
.smart-wide-table tbody tr:hover td { background: #f4fcff; }
.smart-wide-table td:first-child { width: 36%; min-width: 190px; white-space: normal; color: #294c62; }
.smart-wide-table td:nth-child(2) { white-space: nowrap; }
.smart-wide-table td:nth-child(4), .smart-wide-table td:nth-child(5) { white-space: nowrap; font-variant-numeric: tabular-nums; }
.smart-wide-table td details { margin-top: 5px; color: #59798c; font-size: 11px; }
.smart-wide-table td details p { max-width: 340px; margin: 6px 0; }
.smart-wide-table .smart-group-header th { padding: 9px; background: #e1f5ff; color: #126f96; font-size: 12px; font-weight: 600; }
.smart-wide-table .smart-group-header th:last-child { text-align: right; white-space: normal; }
.smart-wide-table .smart-group-header.group-material th { background: #fff1d0; color: #8c5b00; }
.smart-wide-table .smart-group-header.group-service th { background: #f0e5ff; color: #7336b7; }
.smart-quantity-control { display: flex; align-items: center; gap: 3px; }
.smart-quantity-control input { width: 48px; padding: 6px 3px; text-align: center; }
.smart-quantity-control button { padding: 4px 6px; color: #23718f; border-color: #bddbe8; background: #f1faff; }
.smart-wide-table [data-remove-source] { padding: 5px 7px; color: #956045; border-color: #ecd8cd; background: #fffaf7; font-size: 11px; white-space: nowrap; }
.smart-bill-total { padding: 15px 16px; background: #f1fbff; border-top: 1px solid #c4e8f4; text-align: right; color: #365c73; font-size: 14px; line-height: 1.7; }
.smart-bill-total strong { color: #0084b7; font-size: 23px; font-variant-numeric: tabular-nums; }
.smart-bill-total small { display: block; margin-top: 5px; font-size: 11px; color: #536f80; }

/* Advanced library and documents are closed until needed. */
.smart-library, .smart-documents-fold { padding: 0; border: 1px solid var(--smart-line); border-radius: 11px; background: #fff; }
.smart-library > summary, .smart-documents-fold > summary { padding: 15px 18px; color: #2f607c; font-size: 15px; font-weight: 600; cursor: pointer; }
.smart-library[open] > summary, .smart-documents-fold[open] > summary { border-bottom: 1px solid #dae9f2; background: #f4fbff; border-radius: 10px 10px 0 0; }
.smart-documents-fold > summary small { margin-left: 10px; font-size: 12px; font-weight: 400; }
.smart-library-content { padding: 15px 18px; }
.smart-library h3 { margin: 15px 0 9px; color: #3e6077; font-size: 14px; }
.smart-library input, .smart-library select { width: 100%; margin: 5px 0; }
.smart-library [data-saved-templates] { display: flex; flex-wrap: wrap; gap: 7px; }
.smart-library [data-saved-templates] button { padding: 8px 12px; }
.smart-library [data-source-results] { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 18px; margin-top: 10px; }
.smart-library [data-source-results] article { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-content: start; gap: 6px 10px; padding: 13px 0; border-top: 1px solid #dceaf2; min-width: 0; }
.smart-library [data-source-results] strong { grid-column: 1/-1; color: #315a75; font-size: 13px; line-height: 1.65; overflow-wrap: anywhere; }
.smart-library [data-source-results] small { display: block; font-size: 11px; line-height: 1.65; overflow-wrap: anywhere; }
.smart-library [data-source-results] button { grid-column: 2; grid-row: 2/4; align-self: start; padding: 6px 10px; font-size: 12px; }
.smart-route-directory { margin: 13px 0; font-size: 12px; }
.smart-route-directory summary { color: #246c91; }
.smart-route-directory [data-route-tabs] { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; margin-top: 10px; }
.smart-route-directory [data-route] { padding: 9px; text-align: left; font-size: 12px; border-color: #c8dfe9; background: #f6fcff; }
.smart-route-directory [data-route] small { display: block; margin-top: 3px; color: #59738a; font-size: 11px; }
.smart-route-directory [data-route][aria-pressed=true] { color: #fff; background: #008cbd; border-color: #008cbd; }
.smart-route-directory [data-route][aria-pressed=true] small { color: #fff; }
.smart-document-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; padding: 16px; background: #eaf1f8; align-items: start; border-radius: 0 0 10px 10px; }
.smart-document { min-width: 0; padding: 19px; color: #263d50; background: #fff; border: 1px solid #d3dfe9; box-shadow: 0 2px 6px #14354d0c; }
.smart-document h2 { margin: 4px 0 13px; text-align: center; color: #0086b9; font-size: 21px; }
.smart-document h3 { margin: 15px 0; text-align: center; font-size: 16px; }
.smart-document p { font-size: 13px; line-height: 1.7; }
.smart-document pre { white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; font: 13px/1.85 system-ui, sans-serif; }
.smart-comparison-table { overflow-x: auto; }
.smart-comparison-table table { width: 100%; min-width: 440px; table-layout: fixed; border-collapse: collapse; font-size: 12px; }
.smart-comparison-table :is(th, td) { padding: 8px; border: 1px solid #dbe6ee; white-space: normal; line-height: 1.65; vertical-align: top; overflow-wrap: anywhere; }
.smart-comparison-table th { background: #eff7fd; color: #395e77; }
.smart-comparison-table th:first-child { width: 70px; }
.smart-patient-choice { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; padding: 8px 0; border: 0; }
.smart-patient-choice label { display: flex; align-items: flex-start; gap: 5px; margin: 0; font-size: 12px; }
.smart-patient-choice input { width: 15px; margin: 1px 0 0; flex: 0 0 15px; }
.smart-fee-group h4 { margin: 13px 0 0; padding: 9px; border-left: 4px solid #149fd6; background: #e6f6ff; color: #176a8d; font-size: 13px; }
.smart-fee-group.group-material h4 { border-color: #eba526; background: #fff1d5; color: #8e5c00; }
.smart-fee-group.group-service h4 { border-color: #9259d6; background: #f1e8ff; color: #7335b9; }
.smart-fee-line { display: grid; grid-template-columns: minmax(0, 1fr) 65px 65px; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid #dfe8ef; font-size: 12px; }
.smart-fee-line small { display: block; margin-top: 4px; color: #597183; }
.smart-fee-line button { grid-column: 3; }
.smart-fee-line input { width: 100%; padding: 6px; }
.smart-fee-line details { margin-top: 6px; }
.smart-subtotal { color: #007fae; font-weight: 700; }
.smart-work-status { margin: 0; padding: 11px 14px; border: 1px solid #ebd3a0; border-radius: 8px; background: #fff8e8; color: #765b2c; font-size: 12px; line-height: 1.7; }
.smart-work-toolbar { position: sticky; bottom: 0; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; padding: 11px 13px; border: 1px solid #bfdce9; border-radius: 9px 9px 0 0; background: #f8fdfffa; box-shadow: 0 -4px 16px #2447660d; }
.smart-work-toolbar button { padding: 8px 11px; font-size: 12px; }
.smart-work-jumps { display: flex; flex: 1 1 auto; flex-wrap: wrap; gap: 5px; }
.smart-work-jumps button { background: transparent; border-color: transparent; color: #21678a; }
.smart-work-jumps button:hover { background: #e2f5ff; border-color: #b2deed; }
.smart-work-toolbar [data-save-template] { color: #067698; background: #e8f9ff; border-color: #9dd5e7; }
.smart-work-toolbar [data-print-comparison] { color: #fff; background: #008fbd; border-color: #008fbd; }

@media (max-width: 1200px) {
  .smart-context-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .smart-match-inputs { grid-template-columns: minmax(180px, 2fr) repeat(3, minmax(85px, 1fr)); gap: 9px; }
  .smart-details-workspace { grid-template-columns: minmax(260px, .7fr) minmax(0, 1.3fr); gap: 14px; }
  .smart-match-cards { gap: 10px; }
  .smart-match-cards article { padding: 12px; }
  .smart-library [data-source-results] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .smart-details-workspace, .smart-document-pair { grid-template-columns: minmax(0, 1fr); }
  .smart-context-fields, .smart-match-inputs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .smart-match-inputs label:first-child { grid-column: 1/-1; }
  .smart-match-cards { grid-template-columns: minmax(0, 1fr); }
  .smart-match-cards article > strong { font-size: 21px; }
  .smart-related-toolbar { max-width: 520px; }
  .smart-work-jumps { flex-basis: 100%; }
  .smart-work-toolbar { gap: 6px; }
}
@media (max-width: 540px) {
  .smart-workspace { gap: 13px; }
  .smart-patient-context, .smart-match-form, .smart-options-panel { padding: 13px; }
  .smart-context-fields { grid-template-columns: minmax(0, 1fr); gap: 9px; }
  .smart-match-inputs { gap: 10px 8px; }
  .smart-match-inputs label:first-child { grid-column: 1/-1; }
  .smart-match-shortcuts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .smart-match-shortcuts button { padding: 8px 4px; font-size: 12px; }
  .smart-match-form h2 { font-size: 17px; }
  .smart-route-directory [data-route-tabs] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .smart-library [data-source-results] { grid-template-columns: minmax(0, 1fr); }
  .smart-library > summary, .smart-documents-fold > summary { padding: 13px; }
  .smart-documents-fold > summary small { display: block; margin: 4px 0 0 15px; }
  .smart-library-content { padding: 12px 13px; }
  .smart-document-pair { padding: 8px; gap: 12px; }
  .smart-document { padding: 13px; }
  .smart-document h2 { font-size: 19px; }
  .smart-work-toolbar { position: static; border-radius: 9px; padding: 8px; }
  .smart-work-toolbar > button { flex: 1 1 auto; }
  .smart-work-jumps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; }
  .smart-work-jumps button { padding: 7px 3px; }
}
@media (prefers-reduced-motion: reduce) {
  .smart-workspace button { transition: none; }
}
@media print {
  #print-area .smart-document-pair { display: block; background: #fff; padding: 0; }
  #print-area .smart-document { padding: 0; border: 0; box-shadow: none; break-after: page; }
  #print-area .smart-document:last-child { break-after: auto; }
  #print-area .smart-document pre { font-size: 12px; }
  #print-area .smart-comparison-table { overflow: visible; }
  #print-area .smart-comparison-table table { min-width: 0; }
  #print-area .smart-document h2 { color: #203d53; }
}

/* A choice is a text action, with native focus and a clear selected label. */
.smart-library [data-source-results] .smart-source-choice { border: 0; background: transparent; border-radius: 0; color: #007d9c; padding: 6px 0; }
.smart-library [data-source-results] .smart-source-choice:disabled { color: #7b8b94; }
.smart-match-cards article[tabindex] { cursor: pointer; }
.smart-match-cards article[tabindex]:focus-visible { outline: 3px solid #00a5d6; outline-offset: 3px; }
@media(max-width:720px){.smart-related-line > .smart-optional-choice { min-height: 44px; align-items: center; }.smart-library [data-source-results] .smart-source-choice { min-height: 44px; }}
