#kmchatBtn.kmc-launch {
  position:fixed;right:20px;bottom:20px;z-index:120;
  display:grid!important;place-items:center;width:48px;height:48px;padding:0;cursor:pointer;
  border:1px solid #a88866;border-radius:16px;background:#29262d;color:#ffcc8d;
  box-shadow:0 3px 16px #16121c45;
}
html[data-theme=light] #kmchatBtn.kmc-launch {background:#fffbf3;border-color:#a17e59;color:#765025}
#kmchatBtn.kmc-launch::before {content:none!important}
#kmchatBtn svg {display:block;width:26px;height:26px}
#kmchatBtn.kmc-over-film {visibility:hidden;pointer-events:none}

#kmchat {
  --kmc-bg:#211f26;--kmc-panel:#2b292f;--kmc-paper:#26242b;--kmc-text:#f8f3ed;
  --kmc-dim:#cac2cd;--kmc-line:#504952;--kmc-accent:#d8baff;--kmc-amber:#f3c28d;
  --kmc-own:#44374e;--kmc-input:#302d35;--kmc-button:#f1c48e;--kmc-button-ink:#302214;
  --kmc-shadow:#15121955;--kmc-gutter:clamp(16px,3vw,26px);
  box-sizing:border-box;position:fixed;inset:auto 20px 20px auto;margin:0;
  width:min(510px,calc(100vw - 32px));height:min(674px,calc(100dvh - 38px));max-width:none;max-height:none;
  overflow:hidden;padding:0;border:1px solid var(--kmc-line);border-radius:20px;
  color:var(--kmc-text);background:var(--kmc-bg);text-align:left;
  font:400 15px/1.48 Inter,system-ui,sans-serif;box-shadow:0 14px 75px var(--kmc-shadow);color-scheme:dark;
}
html[data-theme=light] #kmchat {
  --kmc-bg:#fcfaf7;--kmc-panel:#f4f0eb;--kmc-paper:#fffdfa;--kmc-text:#262327;--kmc-dim:#62595f;
  --kmc-line:#d6cdd0;--kmc-accent:#694589;--kmc-amber:#785024;--kmc-own:#eee6f4;
  --kmc-input:#fff;--kmc-button:#36303e;--kmc-button-ink:#fffcf8;--kmc-shadow:#4b3b512b;color-scheme:light;
}
#kmchat[open] {display:block}
#kmchat::backdrop {background:rgba(17,15,21,.48)}
#kmchat [hidden] {display:none!important}
#kmchat * {box-sizing:border-box}
#kmchat button {font-family:inherit;color:inherit;cursor:pointer}
#kmchat button:disabled {cursor:default;opacity:.55}
#kmchat a {color:var(--kmc-accent);text-decoration:underline;text-underline-offset:.2em}
#kmchat :focus-visible,#kmchatBtn:focus-visible {outline:2px solid var(--kmc-accent,#ad82dd);outline-offset:2px}
#kmchat .kmc-shell {height:100%;min-height:0;display:flex;flex-direction:column;overflow-y:auto}
#kmchat .kmc-head {
  display:flex;align-items:center;justify-content:space-between;gap:10px;flex:none;
  padding:15px var(--kmc-gutter) 8px;
}
#kmchat .kmc-identity {display:flex;align-items:center;gap:11px;min-width:0}
#kmchat .kmc-head h2 {font:740 clamp(1rem,2.2vw,1.15rem)/1.2 Manrope,Inter,sans-serif;letter-spacing:-.035em;margin:0;color:var(--kmc-text)}
#kmchat .kmc-symbol {display:grid;place-items:center;width:36px;height:36px;flex:none;border:1px solid var(--kmc-line);border-radius:10px;background:var(--kmc-panel);color:var(--kmc-amber)}
#kmchat :is(.kmc-symbol,.kmc-suggestions) svg {fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round;width:21px;height:21px;flex:none}
#kmchat .kmc-close {
  display:grid;place-items:center;flex:none;width:42px;height:42px;padding:0;border:0;border-radius:50%;
  background:transparent;color:var(--kmc-dim);font:400 27px/1 Inter,sans-serif;
}
#kmchat .kmc-close:hover {background:var(--kmc-panel);color:var(--kmc-text)}
#kmchat .kmc-modes {display:flex;align-items:stretch;flex:none;gap:22px;border-bottom:1px solid var(--kmc-line);padding:0 var(--kmc-gutter)}
#kmchat .kmc-modes button {
  position:relative;min-height:40px;padding:5px 1px 9px;border:0;background:transparent;
  color:var(--kmc-dim);font:640 .9rem/1.3 Inter,sans-serif;
}
#kmchat .kmc-modes button[aria-pressed=true] {color:var(--kmc-text)}
#kmchat .kmc-modes button[aria-pressed=true]::after {
  content:'';position:absolute;bottom:-1px;inset-inline:0;height:2px;background:var(--kmc-amber);
}
#kmchat .kmc-mode {padding:10px var(--kmc-gutter) 0;margin:0;color:var(--kmc-dim);font-size:.85rem}
#kmchat .kmc-conversation {
  flex:1 1 200px;min-height:96px;overflow:auto;overscroll-behavior:contain;
  padding:18px var(--kmc-gutter);scrollbar-width:thin;scrollbar-color:var(--kmc-line) transparent;
}
#kmchat .kmc-opening {
  position:relative;isolation:isolate;overflow:hidden;display:grid;align-content:center;min-height:130px;
  padding:16px 18px;border-radius:13px;border:1px solid var(--kmc-line);background:var(--kmc-paper);
}
#kmchat .kmc-opening img {
  position:absolute;inset:0 0 0 auto;width:45%;height:100%;z-index:-1;object-fit:cover;object-position:center;
  mask-image:linear-gradient(to right,transparent,#000 56%);opacity:.83;
}
html[data-theme=light] #kmchat .kmc-opening img {opacity:.8}
#kmchat .kmc-opening h3 {
  margin:0;max-width:21ch;color:var(--kmc-text);font:760 clamp(1.32rem,3.1vw,1.6rem)/1.15 Manrope,Inter,sans-serif;letter-spacing:-.04em;
}
#kmchat .kmc-opening p {max-width:48ch;margin:8px 0 0;color:var(--kmc-dim);font-size:.86rem;line-height:1.45}
#kmchat .kmc-opening:has(img) :is(h3,p) {max-width:69%}
#kmchat .kmc-suggestions {margin:10px 0 0}
#kmchat .kmc-suggestions button {
  display:flex;align-items:center;gap:11px;width:100%;min-height:43px;padding:9px 3px;cursor:pointer;
  border:0;border-bottom:1px solid var(--kmc-line);border-radius:0;background:transparent;
  text-align:left;color:var(--kmc-text);font-size:.94rem;line-height:1.4;font-weight:580;
}
#kmchat .kmc-suggestions svg {color:var(--kmc-amber);width:18px;height:18px}
#kmchat .kmc-suggestions button::after {content:'↗';margin-left:auto;align-self:center;color:var(--kmc-dim);font-size:1rem}
#kmchat .kmc-suggestions button:hover {color:var(--kmc-amber);border-color:var(--kmc-amber)}
#kmchat .kmc-messages {display:flex;flex-direction:column;gap:12px;padding:0;overflow:visible}
#kmchat .kmc-bubble {max-width:100%;white-space:pre-line;overflow-wrap:anywhere;font-size:.95rem;line-height:1.52}
#kmchat .kmc-bubble.user {align-self:flex-end;max-width:90%;padding:8px 13px;color:var(--kmc-text);background:var(--kmc-own);border-radius:14px 14px 3px 14px}
#kmchat .kmc-bubble.assistant {align-self:stretch;padding:1px 0 5px 13px;border-inline-start:2px solid var(--kmc-amber)}
#kmchat .kmc-reference-note {display:block;margin:0 0 6px;color:var(--kmc-amber);font:600 .78rem/1.4 Inter,system-ui,sans-serif}
#kmchat .kmc-thinking {padding:4px 0 4px 13px;margin:0;border-inline-start:2px solid var(--kmc-amber);color:var(--kmc-dim);font-size:.88rem}
#kmchat .kmc-results {display:flex;align-items:start;gap:5px 14px;flex-wrap:wrap;margin-top:10px}
#kmchat .kmc-results a {line-height:1.4;font-size:.83rem;font-weight:550;white-space:normal;padding-block:3px}
#kmchat .kmc-next {display:flex;flex-wrap:wrap;gap:5px;margin:12px 0 0}
#kmchat .kmc-next button {
  padding:6px 10px;min-height:34px;background:var(--kmc-paper);border:1px solid var(--kmc-line);
  border-radius:8px;color:var(--kmc-text);font:540 .84rem/1.4 Inter,sans-serif;text-align:left;
}
#kmchat .kmc-next button:hover {border-color:var(--kmc-accent);color:var(--kmc-accent)}
#kmchat .kmc-followup,#kmchat .kmc-clear {
  border:0;background:transparent;color:var(--kmc-dim);padding:4px 0;
  text-align:left;text-decoration:underline;text-underline-offset:3px;font-size:.8rem;
}
#kmchat .kmc-followup {display:block;margin-top:7px;color:var(--kmc-accent)}
#kmchat .kmc-input {flex:none;margin:0;padding:12px var(--kmc-gutter) 0;border-top:1px solid var(--kmc-line);background:transparent}
#kmchat .kmc-field {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
#kmchat .kmc-row {display:flex;align-items:center;gap:8px;background:var(--kmc-input);border:1px solid var(--kmc-line);border-radius:12px;padding:5px}
#kmchat .kmc-row:focus-within {border-color:var(--kmc-accent);outline:1px solid var(--kmc-accent);outline-offset:0}
#kmchat .kmc-row textarea {
  display:block;appearance:none;box-sizing:border-box;flex:1;width:0;min-width:0;height:52px;min-height:0;max-height:100px;
  padding:4px 7px;border:0;background:transparent;color:var(--kmc-text);font:400 16px/1.34 Inter,system-ui,sans-serif;
  resize:none;scrollbar-width:thin;outline:none!important;box-shadow:none!important;
}
#kmchat textarea::placeholder {color:var(--kmc-dim);opacity:1}
#kmchat .kmc-send {
  min-height:42px;flex:none;margin:0;padding:7px 12px;border:0;border-radius:8px;
  background:var(--kmc-button);color:var(--kmc-button-ink);font:700 .84rem/1.25 Inter,sans-serif;
}
#kmchat .kmc-send:hover {filter:brightness(1.08)}
#kmchat .kmc-consent {display:flex;align-items:flex-start;gap:9px;margin:10px 0 0;color:var(--kmc-dim);font-size:.8rem}
#kmchat .kmc-consent input {flex:none;width:18px;height:18px;margin:1px 0 0;accent-color:var(--kmc-accent)}
#kmchat .kmc-disclosure {margin:6px 0 0;padding:0;border:0;background:transparent;color:var(--kmc-dim);font-size:.77rem}
#kmchat .kmc-disclosure summary {cursor:pointer;color:var(--kmc-dim)}
#kmchat .kmc-disclosure p {margin:4px 0 0;color:inherit}
#kmchat .kmc-error {margin:5px 0 0;min-height:0;color:var(--kmc-amber);font-size:.8rem}
#kmchat .kmc-error:empty {display:none}
#kmchat .kmc-foot {display:flex;align-items:center;flex-wrap:wrap;justify-content:space-between;gap:0 10px;padding:5px var(--kmc-gutter) 11px;flex:none;color:var(--kmc-dim);font-size:.8rem}
#kmchat .kmc-foot>a {padding:5px 0;color:var(--kmc-amber)}
@media(max-width:600px) {
  #kmchat {inset:auto 6px max(6px,env(safe-area-inset-bottom));width:calc(100% - 12px);height:min(650px,calc(100dvh - 12px - env(safe-area-inset-bottom)));border-radius:16px}
  #kmchat .kmc-head {padding-block:6px 2px}
  #kmchat .kmc-conversation {padding-block:12px}
  #kmchat .kmc-opening {min-height:112px;padding:14px 12px}
  #kmchat .kmc-opening:has(img) :is(h3,p) {max-width:77%}
  #kmchat .kmc-opening img {width:35%}
  #kmchat .kmc-suggestions button {min-height:44px}
  #kmchatBtn.kmc-launch {right:14px;bottom:calc(14px + env(safe-area-inset-bottom))}
}
@media(max-height:620px) {
  #kmchat .kmc-head {padding-block:4px 0}
  #kmchat .kmc-mode {padding-top:4px}
  #kmchat .kmc-conversation {padding-block:9px}
  #kmchat .kmc-opening {min-height:82px;padding-block:10px}
  #kmchat .kmc-opening h3 {font-size:1.22rem}
  #kmchat .kmc-suggestions {margin-top:3px}
  #kmchat .kmc-modes button {min-height:34px}
  #kmchat .kmc-input {padding-top:7px}
  #kmchat .kmc-foot {padding-bottom:5px}
}
@media(prefers-reduced-motion:no-preference) {
  #kmchat[open] {animation:kmc-appear .16s ease-out}
  @keyframes kmc-appear {from {opacity:0;transform:translateY(6px)} to {opacity:1;transform:translateY(0)}}
}
@media print {#kmchatBtn.kmc-launch,#kmchat[open] {display:none!important}}

