:root {
    color-scheme: light;
    font-family: "Segoe UI", "Microsoft JhengHei", sans-serif;
    color: #1c2a3a;
    background: #f3f6fb;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: #f3f6fb; }
.app-header { background: #fff; }
.topbar { align-items: center; background: #10243b; color: #fff; display: flex; height: 66px; justify-content: space-between; padding: 0 max(28px, calc((100vw - 1180px) / 2)); }
.brand { color: inherit; font-size: 17px; font-weight: 750; letter-spacing: .02em; text-decoration: none; }
.brand span { color: #65d9bd; }
.topbar-caption { color: #b9c9dc; font-size: 13px; }
.primary-navigation { background: #fff; border-bottom: 1px solid #dce4ed; }
.primary-navigation-inner { align-items: stretch; display: flex; gap: 5px; margin: 0 auto; max-width: 1180px; overflow-x: auto; padding: 0 28px; }
.nav-tab { align-items: center; background: transparent; border: 0; border-bottom: 3px solid transparent; color: #65758a; cursor: pointer; display: inline-flex; flex: 0 0 auto; font: inherit; font-size: 13px; font-weight: 650; gap: 9px; justify-content: center; min-height: 49px; padding: 0 16px; text-decoration: none; white-space: nowrap; }
.nav-tab:hover:not(:disabled) { background: #f6f9fc; color: #18334f; }
.nav-tab.is-active { border-bottom-color: #16866f; color: #14314b; }
.nav-tab-placeholder { color: #65758a; }
.nav-tab-placeholder:disabled { color: #9aa6b5; cursor: not-allowed; }
.nav-tab-badge { background: #edf2f7; border-radius: 999px; color: #78879a; font-size: 10px; font-weight: 600; padding: 3px 7px; }
.nav-tab-placeholder:disabled .nav-tab-badge { background: #f0f2f5; color: #9aa6b5; }
.page-shell { margin: 0 auto; max-width: 1180px; padding: 48px 28px 72px; }
.knowledge-list-page .page-shell, .wide-management-page .page-shell { max-width: 1760px; padding-left: clamp(24px, 3vw, 56px); padding-right: clamp(24px, 3vw, 56px); }
.wide-management-page .page-shell { padding-top: 38px; padding-bottom: 56px; }
.popup-page { background: #f3f6fb; }
.popup-page .page-shell { max-width: none; padding: 18px; }
.popup-page .compact-hero { margin-bottom: 14px; }
.popup-page .compact-hero h1 { font-size: 28px; }
.popup-page .editor-card { box-shadow: none; max-width: none; padding: 20px; }
.hero { align-items: center; display: flex; justify-content: space-between; margin-bottom: 27px; }
.auth-panel { flex: 0 0 auto; max-width: min(100%, 470px); }
.auth-login-form { align-items: center; display: grid; gap: 7px; grid-template-columns: minmax(105px, 1fr) minmax(110px, 1fr) auto; }
.auth-login-form input { background: #fff; border: 1px solid #d8e0ea; border-radius: 8px; color: #1c2a3a; font: inherit; font-size: 12px; min-height: 40px; min-width: 0; padding: 8px 10px; }
.auth-login-form .primary-button, .auth-panel form > .secondary-button { min-height: 40px; padding: 0 12px; white-space: nowrap; }
.auth-login-form small { color: #718095; font-size: 10px; grid-column: 1 / -1; text-align: right; }
.auth-panel form[data-ajax-logout] { align-items: center; display: flex; gap: 12px; }
.auth-panel form[data-ajax-logout] strong { color: #34465d; font-size: 14px; }
.eyebrow { color: #16866f; font-size: 11px; font-weight: 800; letter-spacing: .14em; }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(30px, 4vw, 40px); letter-spacing: -.035em; margin: 9px 0 10px; }
.hero p { color: #627187; line-height: 1.7; margin: 0; max-width: 720px; }
.hero-mark { align-items: center; background: #dff6ef; border: 1px solid #c8eee3; border-radius: 22px; color: #13866d; display: flex; font-size: 25px; font-weight: 800; height: 76px; justify-content: center; width: 76px; }
.contributor-board { align-items: center; background: #fff; border: 1px solid #e1e8f0; border-radius: 14px; box-shadow: 0 8px 22px rgb(25 45 70 / 5%); display: flex; flex-wrap: wrap; gap: 12px 22px; margin-bottom: 20px; min-height: 92px; padding: 15px 20px; }
.contributor-board-heading { align-items: center; display: flex; flex: 0 0 auto; gap: 14px; }
.contributor-board-heading .eyebrow { font-size: 9px; }
.contributor-board-heading h2 { color: #243a53; font-size: 17px; letter-spacing: -.02em; margin: 3px 0 0; }
.contributor-board-heading > small { color: #8996a6; font-size: 10px; line-height: 1.45; max-width: 118px; }
.contributor-ranking-list[hidden] { display: none !important; }
.contributor-ranking-empty[hidden], .contributor-view-all[hidden] { display: none !important; }
.contributor-ranking-list { align-items: center; display: flex; flex: 1 1 500px; flex-wrap: wrap; gap: 7px 20px; list-style: none; margin: 0; min-width: 0; padding: 0; }
.contributor-rank-item { align-items: center; color: #34485f; display: inline-flex; flex: 0 0 auto; font-size: 12px; gap: 5px; min-height: 42px; white-space: nowrap; }
.contributor-medal { align-items: center; display: inline-flex; height: 38px; justify-content: center; position: relative; width: 38px; }
.contributor-medal svg { height: 33px; overflow: visible; width: 39px; }
.contributor-medal svg use { height: 100%; width: 100%; }
.contributor-medal > span { color: #6d4a08; font-size: 10px; font-weight: 850; left: 0; line-height: 1; position: absolute; right: 0; text-align: center; top: 20px; }
.contributor-medal-2 > span { color: #47576a; }
.contributor-medal-3 > span { color: #6d371f; }
.contributor-rank-number { align-items: center; background: #eef2f6; border: 1px solid #dfe6ed; border-radius: 50%; color: #647489; display: inline-flex; font-size: 11px; font-weight: 750; height: 26px; justify-content: center; width: 26px; }
.contributor-account { color: #243a53; font-weight: 750; }
.contributor-count { color: #7b899a; font-size: 11px; }
.contributor-view-all { background: transparent; border: 0; color: #087d69; cursor: pointer; flex: 0 0 auto; font: inherit; font-size: 12px; font-weight: 750; padding: 8px 2px; white-space: nowrap; }
.contributor-view-all:hover { color: #075c50; text-decoration: underline; }
.contributor-ranking-empty { color: #8390a0; font-size: 12px; margin: 0; }
.contributors-dialog { background: #f7f9fc; border: 0; border-radius: 16px; box-shadow: 0 24px 90px rgb(12 28 48 / 30%); max-height: min(84dvh, 760px); max-width: min(96vw, 660px); overflow: auto; padding: 0; width: min(96vw, 660px); }
.contributors-dialog::backdrop { background: rgb(10 24 40 / 58%); backdrop-filter: blur(3px); }
.contributors-dialog-header { align-items: center; background: #fff; border-bottom: 1px solid #e7edf3; display: flex; justify-content: space-between; padding: 17px 22px; position: sticky; top: 0; }
.contributors-dialog-header h2 { color: #243a53; font-size: 19px; margin: 4px 0 0; }
.contributors-dialog-close { color: #4c6076; }
.contributors-dialog-description { color: #718095; font-size: 12px; line-height: 1.6; margin: 16px 22px 10px; }
.contributors-dialog .notice { margin: 12px 22px; }
.all-contributors-list { list-style: none; margin: 0; padding: 0 22px 22px; }
.all-contributors-list .contributor-rank-item { border-bottom: 1px solid #e9eef4; display: flex; min-height: 53px; padding: 5px 2px; width: 100%; }
.all-contributors-list .contributor-account { flex: 1; }
.notice { background: #eef5ff; border: 1px solid #cfdef4; border-radius: 10px; color: #315986; margin-bottom: 18px; padding: 12px 15px; }
.content-grid { display: grid; gap: 20px; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); }
.card { background: #fff; border: 1px solid #e4eaf2; border-radius: 16px; box-shadow: 0 12px 32px rgb(28 48 76 / 5%); padding: 25px; }
.knowledge-workspace { align-items: start; display: grid; gap: 18px; grid-template-columns: minmax(0, 1.55fr) minmax(390px, .9fr); }
.knowledge-card { min-width: 0; }
.preview-chat-panel { display: flex; flex-direction: column; gap: 12px; height: min(780px, calc(100vh - 110px)); min-height: 600px; overflow: hidden; padding: 20px; position: sticky; top: 18px; }
.preview-chat-header { align-items: center; display: flex; justify-content: space-between; }
.preview-chat-header h2 { font-size: 20px; margin: 5px 0 0; }
.preview-chat-header .eyebrow { font-size: 10px; }
.text-button { background: transparent; border: 0; color: #087d69; cursor: pointer; font: inherit; font-size: 12px; font-weight: 700; padding: 8px; }
.preview-chat-description { color: #718095; font-size: 12px; line-height: 1.5; margin: -5px 0 0; }
.preview-clinic-label { color: #34465d; font-size: 12px; font-weight: 700; }
.preview-clinic-input { background: #fff; border: 1px solid #d8e0ea; border-radius: 8px; color: #1c2a3a; font: inherit; min-height: 40px; padding: 9px 11px; width: 100%; }
.preview-clinic-hint { color: #7b899b; font-size: 11px; line-height: 1.4; margin-top: -8px; }
.preview-chat-messages { background: #f7f9fc; border: 1px solid #edf1f6; border-radius: 11px; display: flex; flex: 1 1 auto; flex-direction: column; gap: 12px; min-height: 180px; overflow-y: auto; padding: 13px; }
.preview-empty-state { align-self: center; color: #8996a7; font-size: 13px; line-height: 1.6; margin: auto; max-width: 280px; text-align: center; }
.preview-message { border-radius: 11px; font-size: 13px; line-height: 1.6; max-width: 96%; overflow-wrap: anywhere; padding: 10px 12px; white-space: pre-wrap; }
.preview-message-user { align-self: flex-end; background: #dff6ef; color: #194d43; }
.preview-message-assistant { align-self: flex-start; background: #fff; border: 1px solid #e5eaf1; color: #34465d; white-space: normal; }
.preview-message-label { color: #718095; font-size: 10px; font-weight: 700; margin-bottom: 5px; }
.preview-markdown { overflow-wrap: anywhere; }
.preview-markdown > :first-child { margin-top: 0; }
.preview-markdown > :last-child { margin-bottom: 0; }
.preview-markdown p { margin: 7px 0; white-space: pre-wrap; }
.preview-markdown h1, .preview-markdown h2, .preview-markdown h3, .preview-markdown h4, .preview-markdown h5, .preview-markdown h6 { color: #253b54; line-height: 1.35; margin: 12px 0 6px; }
.preview-markdown h1 { font-size: 19px; }
.preview-markdown h2 { font-size: 17px; }
.preview-markdown h3, .preview-markdown h4, .preview-markdown h5, .preview-markdown h6 { font-size: 14px; }
.preview-markdown ul, .preview-markdown ol { margin: 7px 0; padding-left: 22px; }
.preview-markdown li { margin: 3px 0; }
.preview-markdown blockquote { border-left: 3px solid #8ccdbd; color: #61738a; margin: 9px 0; padding: 2px 0 2px 11px; }
.preview-markdown pre { background: #f3f6fa; border: 1px solid #e7edf4; border-radius: 7px; margin: 8px 0; overflow: auto; padding: 10px; white-space: pre; }
.preview-markdown code { background: #eef2f7; border-radius: 4px; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .92em; padding: 1px 4px; }
.preview-markdown pre code { background: transparent; padding: 0; }
.preview-markdown a { color: #087d69; text-decoration: underline; }
.preview-markdown table { border-collapse: collapse; display: block; font-size: 11px; margin: 8px 0; max-width: 100%; overflow-x: auto; }
.preview-markdown th, .preview-markdown td { border: 1px solid #dfe6ee; padding: 5px 7px; text-align: left; }
.preview-markdown th { background: #f3f6fa; }
.preview-source-excerpt { color: #66768b; font-size: 11px; line-height: 1.5; margin: 1px 0 0; max-height: 120px; overflow: auto; }
.preview-source-excerpt p { margin: 3px 0; }
.preview-source-excerpt h1, .preview-source-excerpt h2, .preview-source-excerpt h3, .preview-source-excerpt h4, .preview-source-excerpt h5, .preview-source-excerpt h6 { font-size: 11px; margin: 4px 0; }
.preview-source-excerpt pre { max-height: 60px; }
.preview-message-pending { align-self: flex-start; background: #eef2f7; color: #718095; }
.preview-message-error, .preview-no-hits { color: #ad3d32; }
.preview-sources { border-top: 1px solid #edf1f6; margin-top: 9px; padding-top: 7px; }
.preview-sources summary { color: #087d69; cursor: pointer; font-size: 11px; font-weight: 700; }
.preview-source-card { border-left: 2px solid #73c8b1; display: grid; gap: 3px; margin-top: 9px; padding-left: 8px; }
.preview-source-card strong { color: #34465d; font-size: 11px; }
.preview-source-card small { color: #7b899b; font-size: 10px; }
.preview-source-card p { color: #66768b; font-size: 11px; line-height: 1.5; margin: 1px 0 0; max-height: 90px; overflow: auto; white-space: pre-wrap; }
.preview-chat-form { border-top: 1px solid #edf1f6; display: grid; gap: 9px; padding-top: 12px; }
.preview-chat-form textarea { background: #fff; border: 1px solid #d8e0ea; border-radius: 9px; color: #1c2a3a; font: inherit; font-size: 13px; line-height: 1.5; padding: 10px 11px; resize: vertical; width: 100%; }
.preview-chat-actions { align-items: center; display: flex; gap: 8px; justify-content: space-between; }
.preview-chat-actions small { color: #8996a7; font-size: 10px; }
.preview-chat-actions .primary-button { min-height: 39px; padding: 0 13px; }
.record-unresolved-option { align-items: center; color: #526174; display: inline-flex; flex: 0 0 auto; font-size: 11px; gap: 6px; white-space: nowrap; }
.record-unresolved-option[hidden] { display: none !important; }
.record-unresolved-option input { accent-color: #087d69; height: 15px; margin: 0; width: 15px; }
.preview-report-outdated { background: #fff4ec; border: 1px solid #f0ddcf; border-radius: 7px; color: #995532; cursor: pointer; font: inherit; font-size: 11px; font-weight: 700; margin-top: 8px; min-height: 32px; padding: 0 10px; }
.preview-report-outdated:hover:not(:disabled) { background: #ffeadc; }
.preview-report-outdated:disabled { cursor: default; opacity: .7; }
.unresolved-recording-status { border-radius: 6px; display: block; font-size: 11px; line-height: 1.5; margin-top: 8px; padding: 6px 9px; }
.unresolved-recording-recorded { background: #edf8f3; color: #287252; }
.unresolved-recording-duplicate { background: #f1f5f9; color: #586b81; }
.unresolved-recording-failed, .unresolved-recording-classification-unavailable, .unresolved-recording-auto-excluded { background: #fff5e8; color: #80551c; }
.card-heading { align-items: flex-start; display: flex; justify-content: space-between; }
h2 { font-size: 21px; letter-spacing: -.02em; margin: 7px 0 0; }
.status-pill { background: #eef2f7; border-radius: 999px; color: #526174; font-size: 12px; font-weight: 700; padding: 7px 11px; white-space: nowrap; }
.status-pill[data-state="running"], .status-pill[data-state="queued"] { background: #e9f2ff; color: #235ca4; }
.status-pill[data-state="completed"] { background: #e4f7ed; color: #16774b; }
.status-pill[data-state="failed"] { background: #fff0ee; color: #ad3d32; }
.config-list { border-bottom: 1px solid #edf1f6; border-top: 1px solid #edf1f6; display: grid; grid-template-columns: 1fr 1fr; margin: 22px 0 17px; padding: 5px 0; }
.config-list div { padding: 11px 6px; }
.config-list dt, .job-details span { color: #718095; font-size: 12px; margin-bottom: 5px; }
.config-list dd { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 13px; font-weight: 700; margin: 0; overflow-wrap: anywhere; }
.callout { background: #f5f8fc; border-radius: 10px; color: #5c6c80; display: grid; font-size: 13px; gap: 4px; line-height: 1.6; padding: 13px 15px; }
.callout strong { color: #34465d; }
.transfer-form { align-items: center; display: flex; flex-wrap: wrap; gap: 12px 16px; margin-top: 20px; }
.primary-button { align-items: center; background: #087d69; border: 0; border-radius: 10px; color: #fff; cursor: pointer; display: inline-flex; font: inherit; font-size: 14px; font-weight: 700; gap: 9px; min-height: 45px; padding: 0 17px; transition: background .15s ease, transform .15s ease; }
.primary-button:hover:not(:disabled) { background: #066a59; transform: translateY(-1px); }
.primary-button:disabled { cursor: not-allowed; opacity: .58; }
.button-icon { font-size: 18px; }
.form-hint { color: #7b899b; font-size: 12px; }
.progress-card h2 { margin-bottom: 16px; }
.status-message { color: #5c6c80; font-size: 14px; line-height: 1.65; min-height: 46px; }
.progress-track { background: #e9eef5; border-radius: 999px; height: 9px; overflow: hidden; }
.progress-value { background: linear-gradient(90deg, #087d69, #59c9a9); border-radius: inherit; height: 100%; transition: width .3s ease; }
.progress-meta { color: #6d7b8e; display: flex; font-size: 12px; justify-content: space-between; margin-top: 9px; }
.job-details { border-top: 1px solid #edf1f6; display: grid; gap: 13px; margin-top: 21px; padding-top: 16px; }
.job-details div { display: grid; gap: 4px; }
.job-details strong { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12px; font-weight: 600; overflow-wrap: anywhere; }
.failed-list { color: #ad3d32; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12px; margin: 13px 0 0; max-height: 120px; overflow: auto; padding-left: 18px; }
.error-card { margin: 30px auto; max-width: 680px; }
.text-link { color: #087d69; font-weight: 700; }
.notice-error { background: #fff0ee; border-color: #f2cbc5; color: #9a352d; }
.metadata-notice { align-items: center; display: flex; gap: 20px; justify-content: space-between; }
.metadata-notice-copy { min-width: 0; }
.metadata-notice-copy p { margin: 6px 0; }
.metadata-notice > form { flex: 0 0 auto; }
.metadata-maintenance-toolbar { align-items: center; display: flex; flex-wrap: wrap; gap: 10px 14px; margin: 0 0 16px; }
.metadata-maintenance-toolbar small { color: #7b899b; font-size: 11px; }
.knowledge-card { padding-bottom: 18px; }
.list-toolbar { align-items: center; display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; }
.knowledge-create-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; }
.search-form { display: grid; flex: 1 1 360px; gap: 10px; min-width: 0; }
.search-query-row { align-items: center; display: grid; gap: 9px; grid-template-columns: minmax(150px, 1fr) minmax(240px, 2.8fr) auto auto; min-width: 0; }
.search-query-row input { min-width: 0; width: 100%; }
.search-query-row .search-id-filter { flex: none; }
.search-filter-row { align-items: end; display: grid; gap: 9px; grid-template-columns: minmax(150px, 1fr) repeat(3, minmax(140px, .8fr)); }
.search-filter-field { color: #596a80; display: grid; font-size: 11px; font-weight: 700; gap: 5px; min-width: 0; }
.search-filter-field input, .search-filter-field select { background: #fff; border: 1px solid #d8e0ea; border-radius: 8px; color: #1c2a3a; font: inherit; font-size: 12px; font-weight: 400; min-height: 38px; min-width: 0; padding: 7px 9px; width: 100%; }
.search-filter-field input:focus, .search-filter-field select:focus { border-color: #40a992; box-shadow: 0 0 0 3px rgb(8 125 105 / 10%); outline: none; }
.search-filter-field input:disabled, .search-filter-field select:disabled { background: #f2f4f7; color: #929dab; }
.search-filter-hint { align-self: center; color: #8a96a5; font-size: 11px; grid-column: 1 / -1; }
.secondary-button { align-items: center; background: #edf2f7; border: 1px solid #dce4ee; border-radius: 10px; color: #34465d; cursor: pointer; display: inline-flex; font: inherit; font-size: 14px; font-weight: 650; justify-content: center; min-height: 43px; padding: 0 15px; text-decoration: none; }
.secondary-button:hover { background: #e3eaf2; }
.list-summary-row { align-items: center; display: flex; justify-content: space-between; margin: 20px 0 12px; }
.list-summary { color: #718095; font-size: 13px; margin: 0; }
.list-summary-row .primary-button { min-height: 40px; }
.table-scroll { overflow-x: auto; }
.knowledge-table { border-collapse: collapse; min-width: 980px; table-layout: fixed; width: 100%; }
.knowledge-table col.knowledge-main-column { width: auto; }
.knowledge-table col.knowledge-status-column { width: 108px; }
.knowledge-table col.knowledge-period-column { width: 90px; }
.knowledge-table col.knowledge-classification-column { width: 110px; }
.knowledge-table col.knowledge-created-column { width: 100px; }
.knowledge-table col.knowledge-actions-column { width: 108px; }
.knowledge-table th { color: #718095; font-size: 12px; font-weight: 700; padding: 12px 10px; text-align: left; }
.knowledge-table td { border-top: 1px solid #edf1f6; color: #4c5d72; font-size: 13px; padding: 15px 10px; vertical-align: top; }
.knowledge-table .status-scope-heading, .knowledge-table .status-scope-cell { width: 112px; }
.effective-period-cell { white-space: normal; }
.effective-period-range { display: grid; gap: 2px; line-height: 1.35; white-space: nowrap;text-align:center; }
.created-date-time { display: grid; gap: 2px; margin-top: 3px; }
.knowledge-title { color: #1d344d; font-size: 14px; font-weight: 750; text-decoration: none; }
.knowledge-title:hover, .row-actions a:hover { text-decoration: underline; }
.knowledge-summary { color: #718095; line-height: 1.6; margin: 5px 0 0; }
.knowledge-tags { display: flex; flex-wrap: wrap; gap: 5px 9px; margin-top: 10px; }
.knowledge-tag { background: #f2f7f8; border: 1px solid #dcebea; border-radius: 5px; color: #347467; font-size: 11px; line-height: 1.5; padding: 2px 7px; }
.status-scope-cell { white-space: nowrap; }
.lifecycle-icon { align-items: center; border-radius: 50%; display: inline-flex; font-size: 12px; font-weight: 800; height: 23px; justify-content: center; margin-right: 5px; vertical-align: middle; width: 23px; }
.lifecycle-active { background: #e3f6ed; color: #138353; }
.lifecycle-disabled { background: #fff4dc; color: #9a6815; }
.lifecycle-deleted { background: #ffedeb; color: #ad3d32; }
.scope-code { display: inline-block; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 11px; max-width: 6ch; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; white-space: nowrap; width: 6ch; }
.scope-shared { color: #526174; font-family: inherit; font-size: 12px; }
.classification-badges { display: flex; flex-wrap: wrap; gap: 5px; }
.classification-badge { border: 1px solid; border-radius: 7px; display: inline-block; font-size: 11px; line-height: 1.45; padding: 3px 7px; }
.classification-kind { background: #eef4ff; border-color: #d8e5fa; color: #365d91; }
.classification-domain { background: #eef8f3; border-color: #d3eade; color: #357252; }
.knowledge-table code, .document-id code, .document-summary code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 11px; overflow-wrap: anywhere; }
.actions-heading { text-align: right !important; }
.row-actions { text-align: right; white-space: nowrap; }
.row-action-disabled { color: #9aa6b5; font-size: 11px; }
.row-actions a { color: #087d69; font-weight: 700; margin-left: 10px; text-decoration: none; }
.danger-link { color: #ad3d32 !important; }
.pagination { align-items: center; border-top: 1px solid #edf1f6; color: #718095; display: flex; flex-wrap: wrap; font-size: 13px; gap: 12px 18px; justify-content: space-between; margin-top: 15px; padding-top: 17px; }
.pagination-pages { align-items: center; display: flex; flex-wrap: wrap; gap: 6px; }
.pagination a, .pagination-pages button, .pagination-current, .pagination-disabled { border: 1px solid #d8e0ea; border-radius: 7px; padding: 7px 10px; }
.pagination a, .pagination-pages button { background: #fff; color: #087d69; cursor: pointer; font: inherit; font-weight: 700; text-decoration: none; }
.pagination a:hover, .pagination-pages button:hover:not(:disabled) { background: #eef8f5; }
.pagination-pages button:disabled { color: #a7b1bf; cursor: not-allowed; }
.pagination-current { background: #087d69; border-color: #087d69; color: #fff; font-weight: 700; }
.pagination-disabled { color: #a7b1bf; }
.pagination-ellipsis { padding: 0 3px; }
.pagination-jump { align-items: center; display: flex; gap: 8px; }
.pagination-jump input { border: 1px solid #d8e0ea; border-radius: 8px; color: #1c2a3a; font: inherit; min-height: 40px; padding: 8px; width: 82px; }
.empty-state { align-items: center; background: #f7f9fc; border-radius: 11px; color: #718095; display: grid; gap: 6px; justify-items: center; line-height: 1.6; margin: 14px 0 4px; padding: 38px 16px; text-align: center; }
.empty-state[hidden] { display: none; }
.empty-state strong { color: #34465d; }
.compact-hero { margin-bottom: 20px; }
.editor-card { margin: 0 auto; max-width: 920px; }
.editor-card-header { align-items: center; align-self: start; background: #fff; border-bottom: 1px solid #edf1f6; border-radius: 15px 15px 0 0; display: flex; flex-wrap: wrap; gap: 10px 18px; justify-content: space-between; margin: -25px -25px 0; padding: 14px 25px; position: sticky; top: 0; z-index: 10; }
.editor-card-header > strong { color: #34465d; font-size: 14px; }
.editor-card-header .form-actions { margin: 0; }
.popup-page .editor-card-header { margin: -20px -20px 0; padding: 12px 20px; }
.knowledge-form { display: grid; gap: 18px; }
.knowledge-content-field { min-width: 0; }
.knowledge-content-workspace { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.knowledge-content-input-panel, .knowledge-content-preview-panel { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.knowledge-content-panel-label { color: #718095; font-size: 11px; font-weight: 700; }
.knowledge-content-input-panel textarea { flex: 1 1 auto; min-height: 460px; }
.knowledge-content-preview { background: #f8fafc; border: 1px solid #d8e0ea; border-radius: 9px; color: #34465d; flex: 1 1 auto; line-height: 1.65; min-height: 460px; overflow: auto; padding: 12px 14px; }
.knowledge-content-preview:empty::before { color: #9aa6b5; content: "輸入知識內容後，Markdown 預覽會顯示在這裡。"; }
.knowledge-setup-actions { align-items: center; border-bottom: 1px solid #edf1f6; display: flex; flex-wrap: wrap; gap: 12px; padding-bottom: 15px; }
.knowledge-setup-actions > small { color: #718095; flex-basis: 100%; font-size: 12px; }
.markdown-format-option { align-items: center; color: #34465d; display: inline-flex; font-size: 13px; gap: 7px; }
.markdown-format-option input { accent-color: #087d69; height: 16px; margin: 0; width: 16px; }
.form-field { display: grid; gap: 7px; }
.clinic-code-hidden { display: none !important; }
.form-field label { color: #34465d; font-size: 13px; font-weight: 700; }
.form-field input, .form-field textarea, .form-field select, .search-form input { background: #fff; border: 1px solid #d8e0ea; border-radius: 9px; color: #1c2a3a; font: inherit; font-size: 14px; padding: 11px 12px; width: 100%; }
.form-field textarea { line-height: 1.65; min-height: 90px; resize: vertical; }
.form-field input:focus, .form-field textarea:focus, .search-form input:focus { border-color: #40a992; box-shadow: 0 0 0 3px rgb(8 125 105 / 10%); outline: none; }
.form-field small { color: #7b899b; font-size: 12px; line-height: 1.5; }
.form-grid { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.knowledge-form .form-hint { margin: -7px 0 0; }
.form-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 2px; }
.validation-summary:empty { display: none; }
.validation-summary, .field-error { color: #ad3d32; font-size: 13px; }
.validation-summary ul { margin: 0; padding-left: 20px; }
.document-metadata { display: grid; gap: 12px 18px; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 20px; }
.document-id { border-bottom: 1px solid #edf1f6; color: #718095; display: grid; font-size: 12px; gap: 5px; margin: 0; min-width: 0; padding-bottom: 10px; }
.delete-shortcut { margin-left: auto; }
.batch-import-card { margin: 0 auto; max-width: 1240px; }
.batch-import-grid { display: grid; gap: 26px; grid-template-columns: minmax(0, 1.2fr) minmax(340px, .8fr); }
.batch-import-main, .batch-prompt-panel { display: grid; align-content: start; gap: 14px; min-width: 0; }
.batch-import-main h2, .batch-prompt-panel h2 { margin: 0; }
.batch-import-hint { color: #718095; font-size: 12px; line-height: 1.6; margin: -7px 0 0; }
.batch-import-form { display: grid; gap: 15px; }
.batch-prompt-panel { border-left: 1px solid #edf1f6; padding-left: 24px; }
.batch-prompt-panel textarea { background: #f8fafc; border: 1px solid #d8e0ea; border-radius: 9px; color: #41536a; font: 12px/1.55 ui-monospace, "Cascadia Code", Consolas, monospace; min-height: 390px; padding: 12px; resize: vertical; width: 100%; }
.batch-result { line-height: 1.6; overflow-wrap: anywhere; }
.batch-result ul { margin: 9px 0 0; max-height: 260px; overflow: auto; padding-left: 22px; }
.batch-result li { font-size: 12px; margin: 4px 0; }
.delete-card { margin: 0 auto; max-width: 760px; }
.purge-form { margin-top: 18px; }
.purge-confirmation { align-items: center; color: #526174; display: flex; gap: 9px; margin-right: 8px; }
.purge-confirmation input { accent-color: #a63830; height: 17px; width: 17px; }
.hard-delete-warning { display: grid; gap: 4px; }
.delete-warning { background: #fff5e8; border: 1px solid #f0d7b1; border-radius: 9px; color: #80551c; line-height: 1.6; padding: 13px 15px; }
.document-summary { display: grid; gap: 9px 16px; grid-template-columns: 105px 1fr; margin: 22px 0; }
.document-summary dt { color: #718095; font-size: 12px; }
.document-summary dd { margin: 0; overflow-wrap: anywhere; }
.delete-preview { color: #526174; line-height: 1.7; max-height: 230px; overflow: auto; white-space: pre-wrap; }
.danger-button { align-items: center; background: #a63830; border: 0; border-radius: 10px; color: #fff; cursor: pointer; display: inline-flex; font: inherit; font-size: 14px; font-weight: 700; justify-content: center; min-height: 44px; padding: 0 16px; }
.danger-button:hover { background: #8f2f28; }
.unresolved-hero { align-items: center; }
.unresolved-hero-stat { align-items: center; background: #e9f6f1; border: 1px solid #d3ebe1; border-radius: 15px; color: #17765f; display: flex; flex: 0 0 auto; gap: 10px; padding: 12px 17px; }
.unresolved-hero-stat strong { font-size: 27px; line-height: 1; }
.unresolved-hero-stat span { color: #4e7d70; font-size: 12px; }
.unresolved-rankings { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 18px; }
.unresolved-ranking-card { min-width: 0; padding: 17px 20px; }
.unresolved-ranking-heading { align-items: center; display: flex; gap: 10px; }
.unresolved-ranking-heading > div { display: grid; gap: 3px; }
.unresolved-ranking-heading strong { color: #2c425b; font-size: 14px; }
.unresolved-ranking-heading small { color: #8794a4; font-size: 10px; }
.ranking-icon { align-items: center; border-radius: 10px; display: inline-flex; font-size: 14px; font-weight: 800; height: 32px; justify-content: center; width: 32px; }
.ranking-asker { background: #eef4ff; color: #4f73a2; }
.ranking-answerer { background: #eaf7f0; color: #38815d; }
.unresolved-ranking-empty { color: #8b97a7; font-size: 12px; margin: 13px 0 0 42px; }
.unresolved-ranking-list { display: flex; flex-wrap: wrap; gap: 7px 18px; list-style: none; margin: 13px 0 0; padding: 0; }
.unresolved-ranking-list li { align-items: center; color: #3e526b; display: inline-flex; font-size: 12px; gap: 6px; }
.unresolved-ranking-list li strong { color: #2d4057; }
.unresolved-ranking-list li small { color: #8491a1; font-size: 11px; }
.unresolved-rank-number { align-items: center; background: #f0f3f7; border: 1px solid #e3e9ef; border-radius: 50%; color: #60738a; display: inline-flex; font-size: 10px; font-weight: 800; height: 22px; justify-content: center; width: 22px; }
.unresolved-workspace { align-items: start; display: grid; gap: 18px; grid-template-columns: minmax(0, 1.65fr) minmax(320px, .85fr); }
.unresolved-list-card, .unresolved-test-panel { min-width: 0; padding: 18px; }
.unresolved-filter-form { border-bottom: 1px solid #e9eef3; margin-bottom: 13px; padding-bottom: 13px; }
.unresolved-filter-grid { align-items: end; display: grid; gap: 9px 10px; grid-template-columns: 1.05fr 1.05fr .9fr .9fr 1.15fr; }
.unresolved-filter-grid label { color: #5e6f84; display: grid; font-size: 12px; font-weight: 700; gap: 5px; min-width: 0; }
.unresolved-filter-grid input, .unresolved-filter-grid select { background: #fff; border: 1px solid #d8e0ea; border-radius: 8px; color: #2d4057; font: inherit; font-size: 13px; min-height: 40px; min-width: 0; padding: 8px 10px; width: 100%; }
.unresolved-filter-grid input:focus, .unresolved-filter-grid select:focus { border-color: #40a992; box-shadow: 0 0 0 3px rgb(8 125 105 / 10%); outline: none; }
.unresolved-filter-second-row { align-items: end; display: grid; gap: 9px 10px; grid-template-columns: minmax(140px, .75fr) minmax(220px, 1.25fr) minmax(220px, 1.25fr) auto; margin-top: 9px; }
.unresolved-filter-second-row > label { color: #5e6f84; display: grid; font-size: 12px; font-weight: 700; gap: 5px; min-width: 0; }
.unresolved-filter-second-row > label select { appearance: auto; background: #fff; border: 1px solid #d8e0ea; border-radius: 8px; color: #2d4057; font: inherit; font-size: 13px; font-weight: 400; height: 40px; min-width: 0; padding: 8px 10px; width: 100%; }
.unresolved-filter-second-row > label select:focus { border-color: #40a992; box-shadow: 0 0 0 3px rgb(8 125 105 / 10%); outline: none; }
.unresolved-filter-second-row .unresolved-keyword-field { min-width: 0; }
.unresolved-filter-second-row .unresolved-keyword-field input { background: #fff; border: 1px solid #d8e0ea; border-radius: 8px; color: #2d4057; font: inherit; font-size: 13px; font-weight: 400; height: 40px; min-width: 0; padding: 8px 10px; width: 100%; }
.unresolved-filter-second-row .unresolved-keyword-field input:focus { border-color: #40a992; box-shadow: 0 0 0 3px rgb(8 125 105 / 10%); outline: none; }
.unresolved-filter-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 9px; margin-top: 10px; }
.unresolved-filter-actions .primary-button, .unresolved-filter-actions .secondary-button { min-height: 40px; padding: 0 14px; font-size: 13px; }
.unresolved-filter-count { color: #8995a4; font-size: 12px; margin-top: 7px; }
.unresolved-table { min-width: 980px; table-layout: fixed; width: 100%; }
.unresolved-table th:nth-child(1) { width: 12%; }
.unresolved-table th:nth-child(2) { width: 18%; }
.unresolved-table th:nth-child(3) { width: 37%; }
.unresolved-table th:nth-child(4) { width: 17%; }
.unresolved-table th:nth-child(5) { width: 16%; }
.unresolved-table th { color: #718095; font-size: 12px; font-weight: 700; padding: 12px 10px; text-align: left; white-space: nowrap; }
.unresolved-table td { border-top: 1px solid #edf1f6; color: #4c5d72; font-size: 13px; padding: 14px 10px; vertical-align: top; }
.unresolved-state-pill { border-radius: 999px; display: inline-block; font-size: 11px; font-weight: 750; padding: 4px 8px; white-space: nowrap; }
.unresolved-state-pending { background: #fff5e5; color: #9a681b; }
.unresolved-state-completed { background: #eaf6ef; color: #347451; }
.unresolved-question-badges { align-items: center; display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 5px; }
.unresolved-type-pill { border-radius: 999px; display: inline-block; font-size: 11px; font-weight: 750; padding: 4px 8px; white-space: nowrap; }
.unresolved-type-unanswered { background: #eef4ff; color: #426996; }
.unresolved-type-outdated { background: #fff0e9; color: #a35435; }
.outdated-source-list { border-top: 1px solid #e6ebf1; display: grid; gap: 5px; margin-top: 9px; padding-top: 8px; }
.outdated-source-list > strong { color: #66778b; font-size: 11px; }
.outdated-source-list a { color: #087d69; font-size: 12px; font-weight: 650; text-decoration: none; }
.outdated-source-list a:hover { text-decoration: underline; }
.unresolved-resolution-label { color: #56816b; font-size: 11px; font-weight: 700; white-space: nowrap; }
.unresolved-row-actions select { background: #fff; border: 1px solid #d8e0ea; border-radius: 7px; color: #34465d; font: inherit; font-size: 11px; max-width: 155px; min-height: 32px; padding: 4px 7px; }
.unresolved-row-actions .unresolved-mark-updated:disabled { color: #9aa5b2; cursor: not-allowed; }
.unresolved-person-cell { color: #40536b; white-space: nowrap; }
.unresolved-person-cell time, .unresolved-person-cell strong { display: block; }
.unresolved-person-cell time { font-size: 12px; }
.unresolved-person-cell strong { color: #68798e; font-size: 12px; font-weight: 600; margin-top: 4px; }
.unresolved-not-answered { color: #9aa5b2; font-size: 12px; }
.unresolved-question-cell { min-width: 250px; width: 38%; }
.unresolved-question-cell details > summary { color: #2e425b; cursor: pointer; display: -webkit-box; font-size: 13px; font-weight: 650; line-height: 1.55; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.unresolved-chatter-score { background: #f1f4f7; border: 1px solid #e1e7ed; border-radius: 999px; color: #6f7e90; display: inline-block; font-size: 11px; padding: 3px 8px; white-space: nowrap; }
.unresolved-question-details { background: #f6f8fb; border-radius: 8px; color: #586a80; line-height: 1.6; margin-top: 8px; padding: 9px; white-space: pre-wrap; }
.unresolved-question-details strong, .unresolved-question-details small { display: block; font-size: 12px; }
.unresolved-question-details p { font-size: 12px; margin: 4px 0; max-height: 110px; overflow: auto; }
.unresolved-question-details small { color: #8290a0; margin-top: 4px; }
.unresolved-row-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 7px; min-width: 210px; }
.unresolved-row-actions .secondary-button { font-size: 12px; min-height: 36px; padding: 0 11px; }
.unresolved-row-actions .text-button, .unresolved-row-actions .danger-link { background: transparent; border: 0; cursor: pointer; font: inherit; font-size: 12px; font-weight: 700; padding: 5px 4px; text-decoration: none; }
.unresolved-row-actions .danger-link { color: #ad3d32 !important; }
.unresolved-action-form { display: inline-flex; margin: 0; }
.unresolved-pagination { align-items: center; color: #758398; display: flex; font-size: 12px; justify-content: space-between; margin-top: 13px; }
.unresolved-pagination > div { display: flex; gap: 7px; }
.unresolved-pagination .secondary-button { font-size: 12px; min-height: 36px; padding: 0 11px; }
.unresolved-empty-state { margin: 20px 0; }
.unresolved-test-panel { display: flex; flex-direction: column; gap: 9px; position: sticky; top: 16px; }
.unresolved-test-header { align-items: center; display: flex; justify-content: space-between; }
.unresolved-test-header h2 { color: #2d425b; font-size: 17px; margin: 4px 0 0; }
.unresolved-test-hint { color: #7c8999; font-size: 12px; line-height: 1.6; margin: 0; }
.unresolved-test-panel > label:not(.sr-only) { color: #62738a; font-size: 12px; font-weight: 700; }
.unresolved-test-panel > .preview-clinic-input { min-height: 34px; padding: 7px 9px; }
.outdated-source-row { align-items: center; display: flex; flex-wrap: wrap; gap: 7px; min-height: 30px; }
.unresolved-source-update-form { display: inline-flex; margin: 0; }
.source-update-button, .source-update-complete { align-items: center; border-radius: 50%; display: inline-flex; flex: 0 0 23px; font: inherit; height: 23px; justify-content: center; padding: 0; width: 23px; }
.source-update-button { background: #fff; border: 1.5px solid #a8b3c0; cursor: pointer; }
.source-update-button span { border: 1.5px solid #78879a; border-radius: 50%; height: 11px; width: 11px; }
.source-update-button:hover:not(:disabled) { background: #f1f5f8; border-color: #718297; }
.source-update-button:hover:not(:disabled) span { border-color: #327451; }
.source-update-complete { background: #327451; border: 1px solid #327451; color: #fff; font-size: 12px; font-weight: 800; }
.source-update-button:disabled { cursor: wait; opacity: .6; }
.outdated-source-row small { color: #8995a4; font-size: 11px; }
.unresolved-test-messages { background: #f7f9fc; border: 1px solid #e9eef4; border-radius: 9px; display: flex; flex: 1 1 auto; flex-direction: column; gap: 9px; min-height: 250px; max-height: 52vh; overflow: auto; padding: 10px; }
.unresolved-test-question { background: #fff; border: 1px solid #d8e0ea; border-radius: 8px; color: #253950; font: inherit; font-size: 13px; line-height: 1.5; min-height: 62px; padding: 8px 10px; resize: vertical; }
.unresolved-run-test { align-self: flex-end; min-height: 42px; padding: 0 16px; font-size: 13px; }
.unresolved-run-test:disabled { cursor: not-allowed; opacity: .55; }
#unresolved-preview-token[hidden] { display: none !important; }
@media (max-width: 1080px) {
    .unresolved-workspace { grid-template-columns: minmax(0, 1fr); }
    .unresolved-test-panel { position: static; }
}
@media (max-width: 760px) {
    .unresolved-hero { align-items: stretch; }
    .unresolved-hero-stat { align-self: flex-start; }
    .unresolved-rankings { grid-template-columns: minmax(0, 1fr); }
    .unresolved-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .unresolved-filter-second-row { grid-template-columns: minmax(0, 1fr); }
    .unresolved-filter-actions { justify-content: flex-start; }
}
.history-card { padding: 22px; }
.history-filter-form { border-bottom: 1px solid #e8edf3; margin-bottom: 18px; padding-bottom: 18px; }
.history-filter-grid { align-items: end; display: grid; gap: 13px; grid-template-columns: repeat(4, minmax(130px, 1fr)); }
.history-filter-grid > label, .history-sort-group > label { color: #586a80; display: grid; font-size: 12px; font-weight: 650; gap: 6px; min-width: 0; }
.history-filter-grid input, .history-filter-grid select { background: #fff; border: 1px solid #d8e0ea; border-radius: 8px; color: #24364b; font: inherit; font-size: 13px; min-height: 40px; min-width: 0; padding: 8px 10px; }
.history-search-field { grid-column: span 2; }
.history-sort-group { align-items: end; display: grid; gap: 10px; grid-column: span 2; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.history-filter-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 15px; }
.history-filter-actions small { color: #7b899a; font-size: 11px; margin-left: 4px; }
.history-results-summary { align-items: center; color: #67788d; display: flex; font-size: 12px; justify-content: space-between; margin-bottom: 12px; }
.history-results-summary strong { color: #29415c; font-size: 13px; }
.history-table { min-width: 980px; table-layout: fixed; width: 100%; }
.history-table th:nth-child(1) { width: 18%; }
.history-table th:nth-child(2) { width: 14%; }
.history-table th:nth-child(3) { width: 15%; }
.history-table th:nth-child(4) { width: 23%; }
.history-table th:nth-child(5) { width: 30%; }
.history-table th { color: #718095; font-size: 12px; font-weight: 700; padding: 12px 10px; text-align: left; white-space: nowrap; }
.history-table td { border-top: 1px solid #edf1f6; color: #4c5d72; font-size: 13px; padding: 14px 10px; vertical-align: middle; }
.history-time { color: #344a63; white-space: nowrap; }
.history-time span, .history-time small { display: block; }
.history-time small { color: #8b98a8; font-size: 12px; margin-top: 3px; }
.history-id code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12px; overflow-wrap: anywhere; }
.history-action-pill { background: #edf4f8; border: 1px solid #dce8ee; border-radius: 999px; color: #3c6275; display: inline-block; font-size: 12px; font-weight: 700; padding: 4px 9px; white-space: nowrap; }
.history-id { max-width: 210px; }
.history-field-list { display: flex; flex-wrap: wrap; gap: 5px; max-width: 420px; }
.history-field-chip { background: #f1f5f9; border: 1px solid #e2e9f0; border-radius: 5px; color: #5b6c80; font-size: 11px; line-height: 1.5; padding: 2px 6px; }
.history-no-fields { color: #9aa6b5; font-size: 12px; }
.history-empty-state { margin: 20px 0 5px; }
.history-pagination { align-items: center; color: #758398; display: flex; font-size: 13px; justify-content: space-between; margin-top: 16px; }
.history-pagination > div { display: flex; gap: 8px; }
.knowledge-editor-dialog { background: #f3f6fb; border: 0; border-radius: 16px; box-shadow: 0 24px 90px rgb(12 28 48 / 30%); height: min(92dvh, 1100px); max-height: 96dvh; max-width: 1180px; overflow: hidden; padding: 0; width: min(96vw, 1180px); }
.knowledge-editor-dialog::backdrop { background: rgb(10 24 40 / 58%); backdrop-filter: blur(3px); }
.knowledge-editor-dialog-header { align-items: center; background: #10243b; color: #fff; display: flex; height: 54px; justify-content: space-between; padding: 0 18px 0 22px; }
.knowledge-editor-dialog-header h2 { font-size: 16px; margin: 0; }
.dialog-close-button { background: transparent; border: 0; border-radius: 8px; color: #fff; cursor: pointer; font: inherit; font-size: 28px; height: 38px; line-height: 1; width: 38px; }
.dialog-close-button:hover { background: rgb(255 255 255 / 12%); }
.knowledge-editor-dialog iframe { border: 0; display: block; height: calc(100% - 54px); width: 100%; }
.sr-only { clip: rect(0, 0, 0, 0); clip-path: inset(50%); height: 1px; overflow: hidden; position: absolute; white-space: nowrap; width: 1px; }
@media (max-width: 760px) {
    .topbar { height: 60px; padding: 0 18px; }
    .primary-navigation-inner { gap: 0; padding: 0 10px; }
    .nav-tab { font-size: 12px; gap: 6px; min-height: 46px; padding: 0 12px; }
    .nav-tab-badge { font-size: 9px; padding: 3px 6px; }
    .document-metadata { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .history-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .history-search-field, .history-sort-group { grid-column: span 2; }
    .history-results-summary, .history-pagination { align-items: flex-start; flex-direction: column; gap: 9px; }
    .history-filter-actions small { flex-basis: 100%; margin-left: 0; }
    .page-shell { padding: 30px 18px 48px; }
    .hero-mark { display: none; }
    .hero { align-items: stretch; flex-direction: column; gap: 16px; }
    .auth-panel { max-width: none; width: 100%; }
    .auth-login-form { grid-template-columns: 1fr; }
    .auth-login-form small { text-align: left; }
    .contributor-board { align-items: flex-start; flex-direction: column; gap: 8px; padding: 14px; }
    .contributor-board-heading { align-items: flex-start; flex-direction: column; gap: 3px; }
    .contributor-board-heading > small { max-width: none; }
    .contributor-ranking-list { flex-basis: auto; gap: 5px 14px; width: 100%; }
    .contributor-view-all { align-self: flex-end; }
    .metadata-notice { align-items: stretch; flex-direction: column; }
    .content-grid, .config-list { grid-template-columns: 1fr; }
    .card { padding: 20px; }
    .list-toolbar, .search-form { align-items: stretch; flex-direction: column; }
    .search-form { flex-basis: auto; width: 100%; }
    .search-query-row { align-items: stretch; display: grid; grid-template-columns: minmax(0, 1fr); }
    .search-query-row input { min-width: 0; }
    .search-filter-row { grid-template-columns: minmax(0, 1fr); }
    .search-filter-hint { grid-column: 1; }
    .list-toolbar > .primary-button { justify-content: center; }
    .form-grid { grid-template-columns: 1fr; }
    .knowledge-content-workspace { grid-template-columns: minmax(0, 1fr); }
    .knowledge-content-input-panel textarea, .knowledge-content-preview { min-height: 300px; }
    .document-summary { grid-template-columns: 1fr; gap: 5px; }
    .document-summary dd { margin-bottom: 10px; }
    .knowledge-workspace { grid-template-columns: minmax(0, 1fr); }
    .preview-chat-panel { height: 680px; min-height: 520px; position: static; }
    .batch-import-grid { grid-template-columns: minmax(0, 1fr); }
    .batch-prompt-panel { border-left: 0; border-top: 1px solid #edf1f6; padding: 20px 0 0; }
}

@media (min-width: 761px) and (max-width: 1180px) {
    .knowledge-workspace { grid-template-columns: minmax(0, 1.2fr) minmax(340px, .9fr); }
    .preview-chat-panel { min-height: 560px; }
}

/* AI-generated knowledge draft review */
.ai-drafts-hero { align-items: center; }
.ai-draft-count { align-items: center; background: #f0edff; border: 1px solid #dfd8ff; border-radius: 14px; color: #6550b3; display: flex; flex: 0 0 auto; gap: 10px; padding: 12px 17px; }
.ai-draft-count strong { font-size: 27px; line-height: 1; }
.ai-draft-count span { color: #7769ad; font-size: 12px; }
.ai-drafts-workspace { align-items: start; display: grid; gap: 18px; grid-template-columns: minmax(320px, .78fr) minmax(0, 1.55fr); }
.ai-draft-list-card, .ai-draft-detail-card { min-width: 0; padding: 18px; }
.ai-draft-list-header, .ai-draft-detail-header, .ai-draft-source-heading { align-items: center; display: flex; gap: 12px; justify-content: space-between; }
.ai-draft-list-header { border-bottom: 1px solid #e9eef3; margin-bottom: 10px; padding-bottom: 12px; }
.ai-draft-list-header h2, .ai-draft-detail-header h2 { font-size: 19px; margin: 4px 0 0; overflow-wrap: anywhere; }
.ai-draft-filter select { background: #fff; border: 1px solid #d8e0ea; border-radius: 8px; color: #3e536d; font: inherit; font-size: 12px; min-height: 36px; padding: 6px 9px; }
.ai-draft-list { display: grid; gap: 8px; max-height: min(74vh, 980px); overflow: auto; padding-right: 3px; }
.ai-draft-row { background: #fff; border: 1px solid #e5ebf1; border-radius: 10px; min-width: 0; padding: 10px 11px; }
.ai-draft-row.is-selected { background: #f1faf7; border-color: #7fc8b1; box-shadow: 0 0 0 2px rgb(8 125 105 / 7%); }
.ai-draft-select { color: inherit; display: grid; gap: 4px; min-width: 0; text-decoration: none; }
.ai-draft-select > strong { color: #2e435c; font-size: 13px; line-height: 1.45; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-draft-select > small { color: #8491a2; font-size: 10px; }
.ai-draft-select code, .ai-draft-review-meta code, .ai-draft-question-id code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; overflow-wrap: anywhere; }
.ai-draft-status { background: #fff4e1; border-radius: 999px; color: #8c641d; display: inline-flex; font-size: 10px; font-weight: 750; padding: 3px 8px; width: fit-content; }
.ai-draft-status-reviewed { background: #e4f7ed; color: #16774b; }
.ai-draft-status-publishing { background: #e9f2ff; color: #235ca4; }
.ai-draft-row-actions, .ai-draft-source-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 6px 11px; margin-top: 7px; }
.ai-draft-row-actions .text-button { font-size: 10px; min-height: 24px; padding: 0; }
.ai-draft-row-actions a.text-button { text-decoration: none; }
.ai-draft-copy-status { background: #edf8f3; border-radius: 7px; color: #287252; font-size: 11px; line-height: 1.5; margin-top: 10px; overflow-wrap: anywhere; padding: 7px 9px; }
.ai-draft-detail-header { align-items: flex-start; border-bottom: 1px solid #e9eef3; margin-bottom: 14px; padding-bottom: 13px; }
.ai-draft-detail-header p { color: #8290a1; font-size: 11px; margin: 7px 0 0; }
.ai-draft-detail-header p .ai-draft-status { vertical-align: middle; }
.ai-draft-source { background: #f7f9fc; border: 1px solid #e8edf3; border-radius: 10px; margin-bottom: 16px; padding: 12px 14px; }
.ai-draft-source-heading { align-items: flex-start; }
.ai-draft-source-heading h3 { color: #344a63; font-size: 14px; margin: 3px 0 0; }
.ai-draft-source-actions { justify-content: flex-end; margin: 0; }
.ai-draft-source-actions .secondary-button { font-size: 11px; min-height: 34px; padding: 0 10px; text-decoration: none; }
.ai-draft-question-id { align-items: baseline; color: #77869a; display: flex; flex-wrap: wrap; font-size: 10px; gap: 7px 10px; margin-top: 10px; }
.ai-draft-question-id code { color: #43566e; font-size: 11px; }
.ai-draft-question-text { color: #34485f; font-size: 13px; line-height: 1.65; margin: 10px 0 0; white-space: pre-wrap; }
.ai-draft-no-answer { color: #728197; font-size: 11px; margin-top: 8px; }
.ai-draft-no-answer summary { cursor: pointer; font-weight: 700; }
.ai-draft-no-answer p { color: #596c83; line-height: 1.6; margin: 7px 0 0; white-space: pre-wrap; }
.ai-draft-source-missing { color: #9a682d; font-size: 12px; margin: 9px 0 0; }
.ai-draft-review-meta { background: #edf8f3; border-radius: 8px; color: #527d68; display: flex; flex-wrap: wrap; font-size: 11px; gap: 8px 18px; margin-bottom: 14px; padding: 9px 11px; }
.ai-draft-review-meta code { color: #275a43; }
.ai-draft-processing-notice { font-size: 12px; margin: 0 0 14px; }
.ai-draft-detail-empty, .ai-draft-empty { margin: 22px 0; }
.ai-draft-form { display: grid; gap: 14px; }
.ai-draft-form .knowledge-content-workspace { min-height: 360px; }
.ai-draft-form .knowledge-content-workspace textarea { min-height: 310px; }
.ai-draft-form input[readonly], .ai-draft-form textarea[readonly] { background: #f8fafc; color: #44586f; }
.ai-draft-form select:disabled { background: #f8fafc; color: #44586f; opacity: 1; }
.ai-draft-dates { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ai-draft-form-actions { align-items: center; border-top: 1px solid #e9eef3; display: flex; flex-wrap: wrap; gap: 9px; padding-top: 14px; }
.ai-draft-form-actions .secondary-button { text-decoration: none; }
.ai-draft-readonly-hint { color: #7b899b; font-size: 12px; }
.ai-draft-form [hidden], .ai-draft-copy-status[hidden] { display: none !important; }
@media (max-width: 1080px) {
    .ai-drafts-workspace { grid-template-columns: minmax(0, 1fr); }
    .ai-draft-list { max-height: 420px; }
}
@media (max-width: 760px) {
    .ai-drafts-hero { align-items: stretch; }
    .ai-draft-count { align-self: flex-start; }
    .ai-draft-detail-header, .ai-draft-source-heading { align-items: flex-start; flex-direction: column; }
    .ai-draft-source-actions { justify-content: flex-start; }
    .ai-draft-form .knowledge-content-workspace, .ai-draft-form .knowledge-content-workspace textarea { min-height: 260px; }
    .ai-draft-dates { grid-template-columns: minmax(0, 1fr); }
}
.ai-draft-markdown-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 9px 12px; margin: 7px 0 3px; min-height: 34px; }
.ai-draft-markdown-actions .secondary-button { font-size: 12px; min-height: 34px; padding: 0 11px; }
.ai-draft-markdown-actions small { color: #718095; font-size: 11px; line-height: 1.5; }
.ai-draft-form-actions .danger-button { margin-left: auto; }
@media (max-width: 760px) {
    .ai-draft-form-actions .danger-button { margin-left: 0; }
}

.preview-image-controls { align-items: center; display: flex; flex-wrap: wrap; gap: 9px; }
.preview-image-controls > small { color: #7b8797; font-size: 11px; }
.preview-image-help-error { color: #a83232 !important; }
.preview-image-preview { align-items: center; background: #f6f8fb; border: 1px solid #dce4ed; border-radius: 9px; display: flex; gap: 9px; max-width: 100%; padding: 6px 9px; }
.preview-image-preview[hidden] { display: none; }
.preview-image-preview img { border-radius: 5px; height: 46px; object-fit: cover; width: 62px; }
.preview-image-preview span { color: #42536a; font-size: 11px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-image-preview .text-button { margin-left: auto; }
.preview-image-grounding { background: #f6f8fb; border-radius: 8px; color: #586a80; font-size: 12px; margin-top: 9px; padding: 8px 10px; }
.preview-image-grounding summary { cursor: pointer; font-weight: 650; }
.preview-image-grounding pre { font: inherit; margin: 8px 0 0; white-space: pre-wrap; }
.unresolved-image-link { display: inline-block; font-size: 12px; margin-top: 7px; }
.preview-message-image { border: 1px solid rgba(25, 77, 67, .15); border-radius: 8px; display: block; margin-top: 8px; max-height: 180px; max-width: min(280px, 100%); object-fit: contain; }
