/* Приёмная Каркасика: собственные классы, без изменения карты и беседы. */
.kr-launcher { position: fixed; z-index: 90; left: max(10px, env(safe-area-inset-left)); bottom: max(12px, env(safe-area-inset-bottom)); display: grid; place-items: center; width: 50px; height: 50px; padding: 2px; border: 1px solid #b39a65; border-radius: 50%; background: #18151def; box-shadow: 0 3px 14px #0009; cursor: pointer; }
.kr-launcher img { width: 100%; height: 100%; object-fit: contain; }
.kr-badge { position: absolute; top: -3px; right: -2px; color: #f3cf77; font-size: 16px; text-shadow: 0 1px 4px #000; }
.kr-badge[hidden] { display: none; }
body.mobile-chat-open .kr-launcher { left: auto; right: 8px; top: calc(var(--lc-view-top, 0px) + 8px); bottom: auto; width: 40px; height: 40px; }
.kr-launcher.kr-map-launcher, body.mobile-chat-open .kr-launcher.kr-map-launcher { position: absolute; z-index: 24; inset: auto 6px 6px auto; width: 46px; height: 46px; }
.kr-launcher.kr-needs-intro { border-color: #f0cf87; animation: kr-intro-pulse 2.4s ease-in-out infinite; }
@keyframes kr-intro-pulse { 0%, 100% { box-shadow: 0 0 3px #d5b15d66; filter: brightness(1); } 50% { box-shadow: 0 0 16px #f0cc78cc, inset 0 0 7px #d5b15d55; filter: brightness(1.18); } }
.kr-dialog.kr-showing-intro .kr-greeting, .kr-dialog.kr-showing-intro .kr-nav { display: none; }
.kr-intro { display: flex; align-items: center; gap: 18px; min-height: 100%; padding: 14px 4px; }
.kr-intro img { width: min(180px, 35%); height: auto; object-fit: contain; flex: none; }
.kr-intro p { margin: 0; font-size: 16px; line-height: 1.6; }
@media (max-width: 640px) { .kr-intro { flex-direction: column; justify-content: center; gap: 8px; text-align: center; } .kr-intro img { width: 120px; max-width: 40%; } .kr-intro p { font-size: 14px; } }
@media (prefers-reduced-motion: reduce) { .kr-launcher.kr-needs-intro { animation: none; box-shadow: 0 0 10px #f0cc7899; } }
.kr-dialog { position: fixed; inset: auto; top: var(--kr-top, 10px); left: 50%; transform: translateX(-50%); margin: 0; padding: 0; width: min(760px, calc(100vw - 20px)); height: min(780px, var(--kr-height, calc(100dvh - 20px))); max-width: none; max-height: none; box-sizing: border-box; overflow: hidden; border: 1px solid #b39a65; border-radius: 8px; background: #1b1720; color: #eee4cf; box-shadow: 0 6px 40px #000b; font: 14px/1.45 var(--body, 'Segoe UI', sans-serif); }
.kr-dialog[open] { display: flex; flex-direction: column; }
.kr-dialog::backdrop { background: #08060dc9; }
.kr-dialog *, .kr-standalone * { box-sizing: border-box; }
.kr-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 14px; border-bottom: 1px solid #b39a6544; flex: none; }
.kr-header strong { font-size: 16px; color: #ead0a0; }
.kr-greeting { display: flex; align-items: center; gap: 12px; padding: 6px 14px; flex: none; }
.kr-greeting img { width: 90px; height: 90px; object-fit: contain; flex: none; }
.kr-greeting p { margin: 0; }
.kr-nav { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 12px 8px; flex: none; }
.kr-button { position: static; inset: auto; transform: none; display: inline-block; min-height: 36px; padding: 6px 10px; border: 1px solid #a58a5f88; border-radius: 4px; color: #e7d9bf; background: #312735; font: inherit; line-height: 1.3; text-align: left; white-space: normal; cursor: pointer; }
.kr-button:hover { background: #453449; }
.kr-button:disabled { opacity: .5; cursor: default; }
.kr-primary { background: #66502d; }
.kr-nav .kr-button[aria-pressed="true"] { border-color: #e3bd70; background: #51402d; }
.kr-dialog :focus-visible, .kr-launcher:focus-visible { outline: 2px solid #e3bd70; outline-offset: 2px; }
.kr-content { min-height: 0; flex: 1; overflow: auto; overscroll-behavior: contain; padding: 8px 14px 16px; }
.kr-actions { flex: none; padding: 7px 12px max(7px, env(safe-area-inset-bottom)); border-top: 1px solid #b39a6544; background: #1b1720; }
.kr-actions[hidden] { display: none; }
.kr-actions > .kr-button { display: block; width: 100%; min-height: 42px; text-align: center; }
.kr-dialog.kr-compact .kr-greeting { display: none; }
.kr-dialog.kr-compact .kr-nav { flex-wrap: nowrap; overflow-x: auto; padding: 3px 8px 5px; }
.kr-dialog.kr-compact .kr-nav .kr-button { flex: none; min-height: 30px; padding: 4px 7px; font-size: 12px; }
.kr-dialog.kr-compact .kr-actions { padding: 6px 10px; }
.kr-dialog.kr-compact .kr-notice { max-height: 56px; }
.kr-dialog.kr-compact textarea { resize: none; min-height: 70px; max-height: 120px; }
.kr-content > .kr-button { display: block; margin-bottom: 8px; }
.kr-notice { flex: none; max-height: 90px; overflow: auto; margin: 0 14px 5px; padding: 7px; border: 1px solid #c77a6855; color: #ffd4ba; font-size: 12px; }
.kr-notice[hidden] { display: none; }
.kr-field { display: flex; flex-direction: column; gap: 4px; margin: 0 0 12px; }
.kr-field:has(input[type=checkbox]) { flex-direction: row-reverse; align-items: center; justify-content: flex-end; }
.kr-dialog input, .kr-dialog textarea, .kr-dialog select { min-width: 0; width: 100%; padding: 8px; border: 1px solid #a58a5f77; border-radius: 4px; background: #100e16; color: #f2e7d3; font: inherit; }
.kr-dialog input[type=checkbox] { width: 18px; height: 18px; flex: none; }
.kr-dialog textarea { resize: vertical; min-height: 70px; max-height: 35dvh; }
.kr-context { max-height: 120px; overflow: auto; padding: 6px; background: #100e1666; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 11px; }
.kr-hint, .kr-meta { color: #bdaf99; font-size: 12px; }
.kr-tools { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 6px; margin-bottom: 12px; }
.kr-record { margin: 0 0 10px; padding: 9px; border: 1px solid #a58a5f44; border-radius: 4px; }
.kr-record > .kr-button { border: 0; padding: 0; background: transparent; color: #efd29e; }
.kr-meta { margin: 5px 0 0; }
.kr-detail h2 { font-size: 18px; margin: 0 0 8px; overflow-wrap: anywhere; }
.kr-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.kr-link, .kr-dialog a { display: inline-block; color: #e2c78d; margin: 8px 0; }
.kr-message { padding: 9px 0; border-top: 1px solid #a58a5f33; }
.kr-message p { margin: 3px 0; }
.kr-message strong { font-size: 12px; color: #d6b980; }
.kr-state { color: #b2bea0; font-size: 12px; }
.kr-similar:not(:empty) { padding: 8px; margin-bottom: 10px; border-left: 2px solid #a58a5f; }
.kr-similar strong { font-size: 12px; }
.kr-standalone { margin: 0; padding: 20px; background: #15121b; color: #eee4cf; font: 15px/1.5 'Segoe UI', sans-serif; }
.kr-standalone a { color: #e2c78d; }
@media (max-width: 640px) {
    .kr-dialog { border-radius: 5px; }
    .kr-greeting { gap: 8px; padding: 2px 10px; font-size: 12px; }
    .kr-greeting img { width: 64px; height: 64px; }
    .kr-header { padding: 5px 10px; }
    .kr-nav { padding: 3px 8px 6px; gap: 4px; }
    .kr-nav .kr-button { font-size: 12px; min-height: 32px; }
    .kr-content { padding: 5px 10px 10px; }
    .kr-dialog input, .kr-dialog textarea, .kr-dialog select { font-size: 16px; }
    .kr-tools { grid-template-columns: minmax(0, 1fr) auto; }
}
@media (max-height: 440px) { .kr-greeting { display: none; } }
