/* Kern Digital — compact, accessible local assistant. */
.kd-chat-trigger{position:fixed;right:1.25rem;bottom:1.25rem;z-index:300;display:inline-flex;align-items:center;gap:.7rem;min-height:48px;padding:.65rem 1rem .65rem .65rem;border:1px solid #16181a;border-radius:4px;background:#16181a;color:#f4f3ef;font:500 .86rem/1.35 "Montserrat",system-ui,sans-serif;box-shadow:0 4px 16px #16181a18;cursor:pointer;transition:background .2s,transform .2s}
.kd-chat-trigger__icon{display:grid;place-items:center;width:26px;height:26px;border:1px solid #f4f3ef80;border-radius:50%;font-size:.85rem}
.kd-chat-trigger[aria-busy="true"]{cursor:progress}
.kd-chat-trigger:focus-visible{outline:2px solid #a2542a;outline-offset:4px}
body.cookie-visible .kd-chat-trigger,body.modal-lock .kd-chat-trigger,body:has(.hdr.nav-open) .kd-chat-trigger,body.kd-chat-open .kd-chat-trigger{visibility:hidden;pointer-events:none}
.kd-chat-load-error{position:fixed;right:1.25rem;bottom:5rem;z-index:300;width:min(340px,calc(100vw - 2.5rem));padding:1rem;border:1px solid #e2e0d8;border-radius:4px;background:#f4f3ef;color:#16181a;font:400 .85rem/1.6 "Montserrat",system-ui,sans-serif;box-shadow:0 4px 16px #16181a18}
.kd-chat-load-error a{color:#16181a;text-decoration:underline;text-underline-offset:3px}
body.cookie-visible .kd-chat-load-error,body.modal-lock .kd-chat-load-error,body:has(.hdr.nav-open) .kd-chat-load-error{visibility:hidden}
body.kd-chat-open{overflow:hidden}
body .kd-chat-dialog{position:fixed;inset:auto 1.25rem 1.25rem auto;width:min(460px,calc(100vw - 2.5rem));height:min(760px,calc(100dvh - 2.5rem));max-width:none;max-height:none;margin:0;padding:0;overflow:hidden;border:1px solid #d7d4cd;border-radius:6px;background:#f4f3ef;color:#16181a;box-shadow:0 18px 65px #16181a33;font:400 .86rem/1.65 "Montserrat",system-ui,sans-serif;text-align:left}
body .kd-chat-dialog[open]{display:grid;grid-template-rows:auto auto minmax(0,1fr) auto}
body .kd-chat-dialog:not([open]){display:none}
.kd-chat-dialog::backdrop{background:#16181a36}
.kd-chat-dialog *{box-sizing:border-box}
.kd-chat-dialog button,.kd-chat-dialog textarea{font-family:inherit}
.kd-chat-dialog button{cursor:pointer}
.kd-chat-dialog button:disabled{cursor:default;opacity:.45}
.kd-chat-dialog :focus-visible{outline:2px solid #a2542a;outline-offset:3px}
.kd-chat-header{display:flex;justify-content:space-between;align-items:center;gap:.6rem;padding:1rem 1.1rem;border-bottom:1px solid #e2e0d8}
.kd-chat-identity{display:flex;align-items:center;gap:.7rem;min-width:0}
body .kd-chat-mark{width:26px;height:26px;flex:none;object-fit:contain}
body .kd-chat-title{margin:0;font:650 .98rem/1.35 "Montserrat",system-ui,sans-serif;letter-spacing:-.025em;text-wrap:wrap}
.kd-chat-title:focus{outline:none}
body .kd-chat-subtitle{margin:.12rem 0 0;font-size:.61rem;line-height:1.5;color:#54595e;text-wrap:wrap}
.kd-chat-controls{display:flex;align-items:center;gap:.15rem;flex:none}
.kd-chat-reset{min-height:44px;padding:.35rem .5rem;border:0;background:transparent;color:#54595e;text-decoration:underline;text-underline-offset:3px;font-size:.62rem;line-height:1.35;max-width:73px}
.kd-chat-close{display:grid;place-items:center;width:40px;height:44px;padding:0;border:0;background:transparent;color:#16181a;font-size:1.8rem;line-height:1}
.kd-chat-shortcuts{display:grid;grid-template-columns:1fr auto;gap:.5rem;padding:.75rem 1.1rem;border-bottom:1px solid #e2e0d8}
.kd-chat-project,.kd-chat-topics{min-height:42px;padding:.6rem .8rem;border-radius:3px;font-size:.73rem;line-height:1.4;font-weight:500}
.kd-chat-project{background:#16181a;color:#f4f3ef;border:1px solid #16181a}
.kd-chat-topics{background:transparent;border:1px solid #c6c2b9;color:#16181a}
.kd-chat-body{min-height:0;overflow:auto;overscroll-behavior:contain;padding:1.1rem;scrollbar-gutter:stable}
body .kd-chat-intro{margin:0 0 1.2rem;padding:0 0 1rem;border-bottom:1px solid #e2e0d8;font-size:.65rem;line-height:1.65;color:#54595e;text-wrap:wrap}
.kd-chat-log{display:flex;flex-direction:column;gap:1rem}
.kd-chat-message{min-width:0;max-width:100%;padding:0 .1rem;overflow-wrap:anywhere}
.kd-chat-message--user{align-self:flex-end;max-width:90%;padding:.75rem .85rem;background:#e9e5dc;border-radius:4px 4px 0 4px}
.kd-chat-author{display:block;margin:0 0 .3rem;font-size:.58rem;font-weight:600;letter-spacing:.045em;text-transform:uppercase;color:#54595e}
body .kd-chat-message-text{margin:0;white-space:pre-wrap;font-size:.82rem;line-height:1.75;text-wrap:wrap}
body .kd-chat-answer-title{margin:.15rem 0 .55rem;font:600 .94rem/1.4 "Montserrat",system-ui,sans-serif;letter-spacing:-.015em;text-wrap:wrap}
.kd-chat-links{display:grid;gap:.5rem;list-style:none;padding:0;margin:.8rem 0 0}
.kd-chat-link{display:inline-block;color:#a2542a;font-weight:500;font-size:.79rem;text-decoration:underline;text-underline-offset:3px;padding-block:.2rem}
.kd-chat-actions{display:flex;flex-wrap:wrap;gap:.5rem;margin-top:1rem;padding-bottom:.15rem}
.kd-chat-chip{min-height:44px;max-width:100%;padding:.6rem .8rem;border:1px solid #bdb8ae;border-radius:3px;background:#fbfaf7;color:#16181a;font-size:.74rem;line-height:1.45;font-weight:500;text-align:left;overflow-wrap:anywhere;transition:border-color .2s,background .2s}
.kd-chat-chip--quiet{background:transparent;color:#54595e}
.kd-chat-chip--wide,.kd-chat-chip--choice{flex:1 1 100%}
.kd-chat-summary{display:grid;grid-template-columns:minmax(0,.7fr) minmax(0,1.3fr);gap:.65rem 1rem;margin:1rem 0 0;padding:1rem 0;border-top:1px solid #d7d4cd;border-bottom:1px solid #d7d4cd;font-size:.77rem;line-height:1.65}
.kd-chat-summary dt{font-weight:500;color:#54595e}
.kd-chat-summary dd{margin:0;font-weight:500}
.kd-chat-handoff{width:100%;min-height:48px;padding:.85rem 1rem;border:1px solid #16181a;border-radius:3px;background:#16181a;color:#f4f3ef;font-weight:500;font-size:.77rem;line-height:1.5}
.kd-chat-footer{min-width:0;padding:.85rem 1.1rem 1rem;border-top:1px solid #e2e0d8;background:#fbfaf7}
.kd-chat-label-row{display:flex;justify-content:space-between;align-items:baseline;gap:.75rem;margin-bottom:.4rem}
.kd-chat-label{font-size:.75rem;font-weight:500}
.kd-chat-count{font-size:.59rem;color:#54595e;font-variant-numeric:tabular-nums}
.kd-chat-input-row{display:flex;align-items:stretch;gap:.5rem;min-width:0}
body .kd-chat-input{display:block;flex:1;min-width:0;width:100%;max-height:100px;resize:vertical;margin:0;padding:.7rem .75rem;border:1px solid #c6c2b9;border-radius:3px;background:#fff;color:#16181a;font-size:.8rem;line-height:1.5;box-shadow:none}
.kd-chat-input::placeholder{color:#697078;opacity:1}
.kd-chat-send{flex:none;min-width:64px;min-height:44px;padding:.65rem;border:1px solid #16181a;border-radius:3px;background:#16181a;color:#f4f3ef;font-size:.7rem;font-weight:500}
body .kd-chat-input-hint{margin:.4rem 0 0;font-size:.56rem;line-height:1.5;color:#54595e;text-wrap:wrap}
body .kd-chat-caution{margin:.5rem 0 0;font-size:.59rem;line-height:1.6;color:#54595e;text-wrap:wrap}
.kd-chat-caution a{color:inherit;text-decoration:underline;text-underline-offset:2px;white-space:nowrap}
@media(hover:hover) and (pointer:fine){.kd-chat-trigger:hover{background:#303336;transform:translateY(-2px)}.kd-chat-chip:hover,.kd-chat-topics:hover{border-color:#a2542a;background:#f0ebe1}.kd-chat-close:hover,.kd-chat-reset:hover{color:#a2542a}.kd-chat-project:hover,.kd-chat-handoff:hover,.kd-chat-send:not(:disabled):hover{background:#303336}}
@media(max-width:600px){
 .kd-chat-trigger{right:1rem;bottom:max(1rem,env(safe-area-inset-bottom));min-height:48px;font-size:.8rem}
 body .kd-chat-dialog{inset:.5rem;width:auto;height:calc(100dvh - 1rem);border-radius:4px}
 .kd-chat-header{padding:.65rem .8rem}.kd-chat-shortcuts{padding:.65rem .8rem}.kd-chat-body{padding:.9rem .8rem}.kd-chat-footer{padding:.65rem .8rem max(.7rem,env(safe-area-inset-bottom))}
 body .kd-chat-title{font-size:.9rem}body .kd-chat-subtitle{font-size:.58rem}.kd-chat-reset{font-size:.57rem;max-width:60px;padding-inline:.25rem}.kd-chat-close{width:34px}
 body .kd-chat-input{font-size:16px;resize:none}.kd-chat-send{min-width:60px}
 .kd-chat-input-hint{display:none}.kd-chat-project,.kd-chat-topics{font-size:.7rem}
}
@media(max-height:520px){body .kd-chat-dialog{height:calc(100dvh - 1rem);bottom:.5rem}.kd-chat-header{padding-block:.3rem}.kd-chat-shortcuts{padding-block:.4rem}.kd-chat-footer{padding-block:.45rem}body .kd-chat-input{max-height:65px}.kd-chat-input-hint{display:none}}
@media(prefers-reduced-motion:reduce){.kd-chat-trigger,.kd-chat-chip{transition:none}.kd-chat-trigger:hover{transform:none}}
/* Readable supporting text at small sizes. */ body .kd-chat-subtitle{font-size:.7rem}.kd-chat-reset{font-size:.7rem;max-width:76px}body .kd-chat-intro{font-size:.75rem}body .kd-chat-caution{font-size:.69rem}body .kd-chat-input-hint{font-size:.68rem}
