/* Геометрия и оформление из newtpl/prototypes/kredbankir-product-adaptive-concept/app/globals.css. */
.smart-chat-layer {
    --blue: #2157d9;
    --navy: #10233f;
    --muted: #60708a;
    color: var(--navy);
    font-family: "Onest Variable", system-ui, sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    text-rendering: auto;
    -webkit-font-smoothing: auto;
}
.smart-chat-layer *, .smart-chat-layer *::before, .smart-chat-layer *::after { box-sizing: border-box; }
.smart-chat-layer button, .smart-chat-layer input {
    margin: 0;
    padding: 0;
    font: inherit;
    letter-spacing: inherit;
    text-transform: none;
    appearance: none;
}
.smart-chat-layer h2 { font-weight: inherit; }
.smart-chat-layer b { font-weight: bolder; }
.smart-chat-layer small { line-height: inherit; }
.smart-chat-layer[hidden], .smart-chat-layer [hidden] { display: none !important; }
.smart-chat-layer { position: fixed; z-index: 90; right: 22px; bottom: max(20px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: flex-end; gap: 11px; }
.smart-chat-layer .chat-avatar { width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; gap: 3px; flex: none; border: 1px solid #b7cff6; border-radius: 14px 14px 14px 5px; color: var(--blue); background: #edf5ff; box-shadow: 0 8px 18px rgba(33,87,217,.12); }
.smart-chat-layer .chat-avatar i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.smart-chat-layer .chat-avatar.inverse { border-color: rgba(255,255,255,.35); color: white; background: rgba(255,255,255,.17); box-shadow: none; }
.smart-chat-layer .chat-launcher { min-height: 58px; padding: 8px 17px 8px 8px; display: flex; align-items: center; gap: 10px; border: 1px solid rgba(255,255,255,.38); border-radius: 19px; color: white; background: linear-gradient(145deg,#2e6ff3,#194bbd); box-shadow: 0 18px 38px rgba(25,73,174,.3); font-size: 13px; cursor: pointer; }
.smart-chat-layer .chat-launcher b { white-space: nowrap; }
.smart-chat-layer .chat-nudge { position: relative; width: min(338px,calc(100vw - 32px)); padding: 18px; border: 1px solid #bfd5f7; border-radius: 23px 23px 8px 23px; background: rgba(255,255,255,.98); box-shadow: 0 25px 65px rgba(19,49,93,.22); }
.smart-chat-layer .chat-dismiss { position: absolute; top: 9px; right: 10px; width: 30px; height: 30px; border: 0; color: #718098; background: transparent; font-size: 21px; cursor: pointer; }
.smart-chat-layer .chat-identity { padding-right: 28px; display: flex; align-items: center; gap: 11px; }
.smart-chat-layer .chat-identity p, .smart-chat-layer .chat-panel-head p { min-width: 0; margin: 0; display: grid; gap: 4px; }
.smart-chat-layer .chat-identity b, .smart-chat-layer .chat-panel-head b { font-size: 13px; }
.smart-chat-layer .chat-panel-head b { overflow-wrap: anywhere; line-height: 1.2; }
.smart-chat-layer .chat-identity small, .smart-chat-layer .chat-panel-head small { color: var(--muted); font-size: 10px; }
.smart-chat-layer .chat-nudge h2 { margin: 16px 2px 14px; font-size: 18px; line-height: 1.25; letter-spacing: -.025em; }
.smart-chat-layer .chat-nudge-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.smart-chat-layer .chat-nudge-actions button, .smart-chat-layer .chat-quick-actions button { min-height: 38px; padding: 7px 9px; border: 1px solid #c8daf5; border-radius: 11px; color: #275ab7; background: #f4f8ff; font-size: 10px; font-weight: 720; cursor: pointer; }
.smart-chat-layer .chat-panel { width: 382px; max-width: calc(100vw - 32px); height: min(630px,calc(100vh - 40px)); overflow: hidden; display: grid; grid-template-rows: auto minmax(0,1fr) auto auto auto; border: 1px solid #aac8f3; border-radius: 27px 27px 9px 27px; background: white; box-shadow: 0 28px 80px rgba(17,47,91,.28); }
.smart-chat-layer .chat-panel-head { min-height: 79px; padding: 14px 14px 14px 16px; display: grid; grid-template-columns: 42px 1fr 32px; gap: 11px; align-items: center; color: white; background: linear-gradient(135deg,#245ed9,#153d9f); }
.smart-chat-layer .chat-panel-head small { color: #d9e7ff; }
.smart-chat-layer .chat-panel-head small span { width: 6px; height: 6px; margin-right: 4px; display: inline-block; border-radius: 50%; background: #65e0b7; box-shadow: 0 0 0 3px rgba(101,224,183,.15); }
.smart-chat-layer .chat-panel-head > button { width: 32px; height: 32px; border: 0; border-radius: 10px; color: white; background: rgba(255,255,255,.12); font-size: 21px; cursor: pointer; }
.smart-chat-layer .chat-dialog { min-height: 0; padding: 18px 17px; overflow-y: auto; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; background: linear-gradient(#f7faff,#fff); }
.smart-chat-layer .chat-day { align-self: center; margin-bottom: 5px; color: #8190a4; font-size: 9px; }
.smart-chat-layer .chat-message { max-width: 86%; padding: 11px 13px; border-radius: 15px; font-size: 13px; line-height: 1.45; }
.smart-chat-layer .chat-message.assistant { border: 1px solid #dce6f4; border-radius: 15px 15px 15px 5px; color: #33475f; background: white; box-shadow: 0 7px 17px rgba(36,70,115,.06); }
.smart-chat-layer .chat-message.user { align-self: flex-end; border: 0; border-radius: 15px 15px 5px 15px; color: white; background: var(--blue); box-shadow: 0 7px 17px rgba(33,87,217,.22); }
.smart-chat-layer .chat-message.typing { color: #8190a4; }
.smart-chat-layer .chat-quick-actions { padding: 5px 14px 10px; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.smart-chat-layer .chat-quick-actions::-webkit-scrollbar { display: none; }
.smart-chat-layer .chat-quick-actions button { flex: none; white-space: nowrap; }
.smart-chat-layer .chat-return { padding: 0 14px 11px; }
.smart-chat-layer .chat-return button { width: 100%; min-height: 45px; padding: 0 14px; display: flex; align-items: center; justify-content: space-between; border: 0; border-radius: 13px; color: white; background: var(--blue); font-size: 12px; font-weight: 760; cursor: pointer; }
.smart-chat-layer .chat-compose { padding: 11px 12px max(11px,env(safe-area-inset-bottom)); display: grid; grid-template-columns: 1fr 42px; gap: 8px; border-top: 1px solid #e1e8f2; background: #f9fbfe; }
.smart-chat-layer .chat-compose input { min-width: 0; height: 42px; padding: 0 13px; border: 1px solid #d4dfed; border-radius: 12px; outline: none; color: var(--navy); background: white; font-size: 12px; }
.smart-chat-layer .chat-compose input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(33,87,217,.1); }
.smart-chat-layer .chat-compose input::placeholder { opacity: 1; color: color-mix(in oklab, currentColor 50%, transparent); }
.smart-chat-layer .chat-compose button { width: 42px; height: 42px; border: 0; border-radius: 12px; color: white; background: var(--blue); font-size: 19px; font-weight: 750; cursor: pointer; }

@media (max-width: 800px) {
  .smart-chat-layer { right: 10px; bottom: max(10px,env(safe-area-inset-bottom)); }
  .smart-chat-layer .chat-launcher { min-height: 54px; padding-right: 15px; border-radius: 18px; }
  .smart-chat-layer .chat-launcher .chat-avatar { width: 38px; height: 38px; border-radius: 12px 12px 12px 4px; }
  .smart-chat-layer .chat-nudge { width: min(348px,calc(100vw - 20px)); padding: 16px; border-radius: 22px 22px 7px 22px; }
  .smart-chat-layer .chat-nudge h2 { font-size: 17px; }
  .smart-chat-layer .chat-panel { width: calc(100vw - 20px); max-width: none; height: min(72svh,640px); border-radius: 24px 24px 7px 24px; }
  .smart-chat-layer .chat-panel-head { min-height: 72px; padding: 12px 12px 12px 14px; }
  .smart-chat-layer .chat-dialog { padding: 15px 14px; }
  .smart-chat-layer .chat-message { font-size: 12px; }
}

/* Только поведение: изоляция от формы, клавиатура и совместимость с закреплённой кнопкой. */
.smart-chat-layer .chat-message { overflow-wrap: anywhere; }
.smart-chat-layer .chat-dialog, .smart-chat-layer .chat-quick-actions { overscroll-behavior: contain; }
.smart-chat-layer button:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.smart-chat-layer .chat-panel-head button:focus-visible,
.smart-chat-layer .chat-launcher:focus-visible { outline-color: #10233f; }
body[data-smart-chat-expanded] [data-mobile-sticky-cta],
body[data-smart-chat-expanded] [data-sticky-cta] { visibility: hidden; pointer-events: none; transition: none; }
body.legal-modal-open .smart-chat-layer { visibility: hidden; pointer-events: none; }
@media (max-width: 800px) {
    .smart-chat-layer[data-state="closed"] { bottom: max(10px, env(safe-area-inset-bottom), var(--chat-sticky-offset, 0px)); }
    .smart-chat-layer[data-state="open"] { bottom: max(10px, env(safe-area-inset-bottom), var(--chat-keyboard-offset, 0px)); }
    .smart-chat-layer .chat-panel { max-height: calc(var(--chat-viewport-height, 100dvh) - 20px); }
    body.smart-chat-modal-open { overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) {
    .smart-chat-layer *, .smart-chat-layer *::before, .smart-chat-layer *::after { animation: none !important; transition: none !important; scroll-behavior: auto; }
}
