.kh24-smart-panel,.kh24-selected-news{background:#fff;border:1px solid #dbe5f0;border-radius:20px;padding:clamp(16px,3vw,26px);color:#183153;min-width:0;box-sizing:border-box}
.kh24-smart-panel{max-width:1040px;margin:20px 0}.kh24-smart-panel h2{margin-top:0}.kh24-smart-panel>label{display:block;margin:18px 0 8px;font-weight:600}.kh24-smart-panel input:not([type=checkbox]):not([type=submit]):not([type=hidden]),.kh24-smart-panel textarea,.kh24-smart-panel select{display:block;width:100%;max-width:650px;margin-top:6px;padding:9px;border-radius:8px;border:1px solid #adbfd2}.kh24-smart-panel p{max-width:900px;line-height:1.75}.kh24-smart-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.kh24-smart-metrics>div{background:#eef8fa;border-radius:12px;padding:18px}.kh24-smart-metrics strong{display:block;font-size:26px;color:#007d90}.kh24-smart-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}.kh24-smart-note{font-size:13px;line-height:1.65;color:#536579}.kh24-smart-source{margin:18px 0;border:1px solid #cbd9e7;border-radius:14px;padding:16px}.kh24-smart-source summary{font-size:17px;font-weight:700;cursor:pointer}.kh24-smart-source label{display:block;margin:12px 0}.kh24-smart-source input[type=checkbox]{width:auto;display:inline}.kh24-smart-admin code{overflow-wrap:anywhere}.kh24-smart-panel table{width:100%;border-collapse:collapse}.kh24-smart-panel td,.kh24-smart-panel th{text-align:left;border-bottom:1px solid #dbe5f0;padding:8px;overflow-wrap:anywhere}
.kh24-ai-open{background:#e8fbfc!important;color:#007c8f!important;border:1px solid #66cbd2!important;border-radius:14px;padding:10px 16px;font:inherit;font-weight:700;cursor:pointer;flex-shrink:0;white-space:nowrap;min-height:44px}.kh24-ai-dialog{box-sizing:border-box;width:min(650px,calc(100vw - 24px));max-height:calc(100dvh - 40px);padding:clamp(18px,4vw,28px);border:1px solid #c8e1e6;border-radius:24px;background:#fff;color:#122b49;box-shadow:0 20px 80px #001b3c55;overflow-y:auto;overscroll-behavior:contain;z-index:2147483600}.kh24-ai-dialog::backdrop{background:#092337a6}.kh24-ai-dialog h2{font-size:23px;margin:0}.kh24-ai-dialog p{line-height:1.8;overflow-wrap:anywhere}.kh24-ai-dialog button{font:inherit;cursor:pointer;min-height:44px;border-radius:12px;border:1px solid #bfd4e0;padding:10px 16px}.kh24-ai-close{background:#f2f6fa;color:#123}.kh24-ai-form{display:grid;gap:10px}.kh24-ai-form label{font-weight:700}.kh24-ai-form textarea{box-sizing:border-box;width:100%;font:inherit;border:1px solid #adc9d6;border-radius:12px;padding:12px;resize:vertical;max-height:180px;background:white;color:#132c4c}.kh24-ai-form button{background:#008e9e;color:white;border:0;font-weight:700}.kh24-ai-form button:disabled{opacity:.55;cursor:wait}.kh24-ai-status{background:#eff7fa;border-radius:10px;padding:10px 14px}.kh24-ai-text{white-space:pre-wrap}.kh24-ai-answer a{color:#006f8c;text-decoration:underline;text-underline-offset:3px}.kh24-ai-sources li{margin:10px 0;overflow-wrap:anywhere}.kh24-ai-dialog :focus-visible,.kh24-selected-news :focus-visible,.kh24-ai-open:focus-visible{outline:3px solid #008d9d;outline-offset:3px}
.kh24-selected-news{margin:20px auto;max-width:1180px}.kh24-selected-news h2{font-size:clamp(21px,4vw,27px);margin:0;color:#11284d}.kh24-selected-news>p{margin:10px 0}.kh24-selected-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.kh24-selected-card{display:flex;flex-direction:column;gap:10px;border:1px solid #dfE8f1;border-radius:16px;padding:18px;background:linear-gradient(145deg,#f6fbff,#fff);text-decoration:none;color:#143253;min-width:0;overflow-wrap:anywhere}.kh24-selected-card:hover{border-color:#008da1;background:#effbfc}.kh24-selected-card h3{font-size:17px;line-height:1.65;margin:0}.kh24-selected-card p{font-size:13px;margin:0;color:#48637e;line-height:1.75}.kh24-selected-card span{font-size:12px;color:#08768a}.kh24-selected-card time{font-size:12px;color:#53687a}.kh24-selected-card b{margin-top:auto;font-size:13px;color:#008293}.kh24-selected-news button{font:inherit;border:1px solid #acd5de;border-radius:12px;padding:10px 14px;background:#edfafa;color:#006d80;cursor:pointer;min-height:44px}.kh24-news-origin{border-left:4px solid #0094a5;padding:12px 18px;background:#f0fafb;line-height:1.85}.kh24-auto-cover{display:grid;place-items:center;gap:10px;text-align:center;width:100%;height:100%;background:linear-gradient(150deg,#092d4a,#087c89);color:white;font-size:16px;font-weight:700}.kh24-auto-cover svg{width:54px;height:54px;fill:white}.kh24-news-source-date{font-size:12px;color:#526983}
@media(max-width:700px){.kh24-smart-metrics{grid-template-columns:1fr}.kh24-selected-grid{grid-template-columns:1fr 1fr}.kh24-selected-card{padding:13px}.kh24-selected-news{border-radius:16px}.kh24-smart-panel table{font-size:12px}}
@media(max-width:420px){.kh24-selected-grid{grid-template-columns:1fr}.kh24-ai-open{padding:8px 12px}.kh24-ai-dialog h2{font-size:20px}}
@media(prefers-reduced-motion:reduce){.kh24-selected-news *,.kh24-ai-dialog *{scroll-behavior:auto!important;transition:none!important;animation:none!important}}

.ku-app #searchForm #kh24-ai-open,#searchForm #kh24-ai-open{position:absolute;left:auto;right:4px;top:3px;width:auto;min-width:70px;height:35px;min-height:35px;padding:4px 10px;border-radius:20px;display:block;font-size:13px;z-index:2}.ku-app #searchForm input#q,#searchForm input#q{padding-right:88px}

/* The chat has its own scrolling transcript; its composer stays inside the viewport. */
.kh24-ai-dialog.kh24-ai-chat{width:min(700px,calc(100vw - 24px));height:min(800px,calc(100dvh - 24px));max-height:calc(100dvh - 24px);padding:0;overflow:hidden;margin:auto;font-family:inherit}
.kh24-ai-chat[open]{display:grid;grid-template-rows:auto auto auto minmax(80px,1fr) auto auto}
.kh24-ai-chat-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:18px 22px;background:linear-gradient(120deg,#eefbfc,#f7f5ff);border-bottom:1px solid #dfecf2}
.kh24-ai-brand{display:flex;align-items:center;gap:12px;min-width:0}.kh24-ai-brand h2{font-size:24px;line-height:1.3;overflow-wrap:anywhere}.kh24-ai-avatar{display:grid;place-items:center;width:48px;height:48px;flex-shrink:0;border-radius:17px;background:#0d7e8e;color:white;box-shadow:0 4px 0 #09546d}.kh24-ai-avatar svg{width:34px;height:34px}.kh24-ai-eyebrow{font-size:10px;font-weight:800;letter-spacing:1.2px;color:#49808c}.kh24-ai-chat .kh24-ai-close{padding:0;min-width:44px;font-size:28px;background:white}.kh24-ai-modes{display:flex;gap:6px;padding:12px 18px;border-bottom:1px solid #e6eef4}.kh24-ai-modes button{flex:1;padding:8px 5px;font-size:13px;background:#f4f7fb;color:#526781;line-height:1.3;min-width:0}.kh24-ai-modes button[aria-pressed=true]{background:#dff7f7;border-color:#4db3be;color:#006875;font-weight:700}
.kh24-ai-thread{overflow:auto;overscroll-behavior:contain;padding:22px;position:relative;background:linear-gradient(#fbfdff,#f3f8fc)}.kh24-ai-welcome{padding:8px 0}.kh24-ai-kicker{font-size:24px;font-weight:800;color:#142f53}.kh24-ai-welcome p{font-size:16px;margin:12px 0 18px}.kh24-ai-welcome small{display:block;color:#6a7b8f;line-height:1.7;margin-top:12px;font-size:12px}.kh24-ai-chips{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}.kh24-ai-chips button{padding:12px 6px;background:white;border-color:#d8e5ef;font-size:13px;font-weight:600;color:#315279;box-shadow:0 2px 3px #142c4910}.kh24-ai-chips button:hover{border-color:#0095a5;background:#f2fcfb}
.kh24-ai-message{padding:15px 18px;border-radius:18px;margin:0 0 14px;border:1px solid #dce7f0;background:white;overflow-wrap:anywhere}.kh24-ai-message>strong{font-size:13px;color:#176d7a}.kh24-ai-message p{font-size:15px;line-height:1.8;margin:8px 0}.kh24-ai-user{background:#163750;color:white;margin-left:35px;border-color:#163750;border-bottom-right-radius:4px}.kh24-ai-user>strong{color:#b6edf0}.kh24-ai-answer{margin-right:12px;border-bottom-left-radius:4px}.kh24-ai-kind{display:block;font-size:11px;color:#668196;margin-top:4px}.kh24-ai-message details{font-size:13px;line-height:1.8;padding:8px 0}.kh24-ai-message summary{cursor:pointer;color:#0b7081}.kh24-ai-message .kh24-smart-note{display:block;font-size:11px}.kh24-ai-chat-tools{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:5px 18px;background:#fff;border-top:1px solid #e1eaf1;font-size:11px;color:#64788d}.kh24-ai-chat .kh24-ai-reset{border:0;background:transparent;color:#1e667f;font-size:12px;padding:5px;min-height:36px;white-space:nowrap}.kh24-ai-chat .kh24-ai-form{display:block;padding:8px 18px 12px;background:#fff}.kh24-ai-form>label{display:block;font-size:12px;margin-bottom:6px}.kh24-ai-compose{display:flex;align-items:stretch;gap:8px}.kh24-ai-compose textarea{min-width:0;resize:none;font-size:15px;line-height:1.5;max-height:90px;padding:10px}.kh24-ai-compose button{flex-shrink:0;min-width:56px;padding:8px 12px;background:#008b9c;color:white}.kh24-ai-chat .kh24-ai-status{font-size:11px;line-height:1.6;padding:6px 0;margin:0;background:transparent;color:#587088}.kh24-ai-privacy{font-size:11px;color:#6c7b8d;max-height:90px;overflow:auto;line-height:1.6}.kh24-ai-privacy summary{cursor:pointer}.kh24-ai-privacy p{font-size:11px;margin:8px 0}.kh24-ai-hint{display:flex;gap:4px;align-items:center;background:linear-gradient(110deg,#e6fbfc,#f3f1ff);border:1px solid #d7e9ef;border-radius:14px;margin:10px auto;padding:3px 8px;max-width:1180px;box-sizing:border-box}.kh24-ai-hint button{font:inherit;font-size:13px;line-height:1.6;color:#1c596e;background:transparent;border:0;cursor:pointer;min-height:44px;padding:6px}.kh24-ai-hint button:first-child{flex:1;text-align:left}.kh24-ai-hint button:last-child{width:44px;flex-shrink:0;font-size:22px}.kh24-ai-hint :focus-visible{outline:3px solid #008d9d;outline-offset:2px}
@media(max-width:480px){.kh24-ai-dialog.kh24-ai-chat{width:calc(100vw - 12px);height:calc(100dvh - 12px);max-height:calc(100dvh - 12px);border-radius:20px}.kh24-ai-chat-head{padding:13px 15px}.kh24-ai-brand h2{font-size:21px}.kh24-ai-modes{padding:9px 12px}.kh24-ai-thread{padding:16px}.kh24-ai-chips{grid-template-columns:repeat(2,minmax(0,1fr))}.kh24-ai-chat .kh24-ai-form{padding:6px 12px max(10px,env(safe-area-inset-bottom))}.kh24-ai-chat-tools{padding:4px 12px}.kh24-ai-message{padding:12px 14px}.kh24-ai-message p{font-size:14px}.kh24-ai-user{margin-left:20px}.kh24-ai-answer{margin-right:4px}.kh24-ai-kicker{font-size:22px}}
@media(max-height:550px){.kh24-ai-chat-head{padding:7px 12px}.kh24-ai-avatar{width:35px;height:35px;border-radius:12px}.kh24-ai-avatar svg{width:27px}.kh24-ai-eyebrow{display:none}.kh24-ai-modes{padding:4px 10px}.kh24-ai-modes button{min-height:32px}.kh24-ai-chat .kh24-ai-form{padding:4px 12px}.kh24-ai-form>label{display:none}.kh24-ai-compose textarea{height:48px}.kh24-ai-chat-tools{padding:0 12px}}

/* AI setup status is scoped to the administrator screen. */
.kh24-ai-setup-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.kh24-ai-step{background:#eef8fa;border:1px solid #d8e9ef;border-radius:14px;padding:16px;min-width:0;overflow-wrap:anywhere}.kh24-ai-step h3{margin:0 0 12px;color:#183153}.kh24-ai-step strong{color:#007d90}.kh24-ai-links{display:flex;flex-wrap:wrap;gap:8px}.kh24-ai-setup .button{margin:4px 4px 4px 0;white-space:normal;height:auto}.kh24-ai-setup textarea{box-sizing:border-box;font:13px/1.6 monospace}.kh24-ai-setup summary:focus-visible{outline:2px solid #007d90;outline-offset:4px}#kh24-ai-settings,#kh24-ai-tests{scroll-margin-top:55px}#kh24-ai-tests .button{margin:4px 6px 4px 0;white-space:normal;height:auto}@media(max-width:960px){.kh24-ai-setup-grid{grid-template-columns:1fr}}

.kh24-ai-provider-message{padding:12px;background:#f5f8fc;border-radius:10px;white-space:pre-wrap;overflow-wrap:anywhere;font:14px/1.7 ui-monospace,monospace}

.kh24-ai-availability{margin:0;padding:7px 18px;background:#fff5df;color:#62440c;font-size:12px;line-height:1.6;flex-shrink:0;overflow-wrap:anywhere}.kh24-ai-table-wrap{overflow-x:auto;max-width:100%}.kh24-ai-table caption{text-align:left;padding:10px 0;font-weight:600}.kh24-ai-table{min-width:620px}.kh24-ai-topics{table-layout:fixed}.kh24-ai-topics th:first-child{width:48%}.kh24-ai-topics th,.kh24-ai-topics td{overflow-wrap:anywhere}.kh24-ai-chat .kh24-ai-status a{display:block}@media(max-width:480px){.kh24-ai-availability{padding:6px 12px;font-size:11px}.kh24-ai-topics th,.kh24-ai-topics td{padding:8px 5px}}
