/* Разговор как осмотр (13.10.2026, слово Архитектора) — talk.js.
 *
 * Слой ПОВЕРХ прежних стилей разговора (styles.css, «разговор Д6»): кадр по центру экрана,
 * персонажи поверх кадра там, где их поставил автор (left/top/height ставит talk.js в долях
 * кадра), реплика — облачко с хвостиком к говорящему, ответы — отдельные кнопки кучкой.
 * Одинаково на телефоне и компьютере: узкий экран — кадр во всю ширину, облачко под головой.
 */

.talk {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 56px 12px 18px;
    background: radial-gradient(ellipse at 50% 40%, rgba(20, 14, 30, 0.94), rgba(5, 4, 8, 0.98));
    overflow-y: auto;
}
.talk[hidden] { display: none; }
.talk.narrow { justify-content: flex-start; padding-top: 52px; }

/* ---------------------------------------------------------------- кадр */

.talk-stage {
    position: relative;
    flex: none;
    border-radius: 12px;
    background: rgba(8, 6, 12, 0.7);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}
.talk-stage::after {                     /* тонкая золотая рама, как у карты */
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid rgba(var(--gold-rgb, 212, 168, 87), 0.45);
    pointer-events: none;
}
.talk-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;                   /* 20.10: рамка — в пропорции кадра, так что обрезки нет и на телефоне */
    border-radius: inherit;
    filter: brightness(0.62) saturate(0.9);
}
/* 20.10: персонажи — внутри рамки кадра; что вышло за край, то не видно (как в «Кадре» редактора) */
.talk-cast {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: inherit;
    pointer-events: none;
}
.talk.own-frame .talk-frame { filter: none; }   /* свой кадр автора — как есть */
.talk.whole-frame .talk-frame { object-fit: contain; cursor: zoom-in; }   /* 16.10: кадр-схема — целиком, нажатие — крупно */
.talk-frame[hidden] { display: none; }

/* ---------------------------------------------------------------- персонажи поверх кадра */

.talk .talk-figure {
    position: absolute;
    right: auto;
    bottom: auto;
    width: auto;
    max-width: none;
    max-height: none;
    transform: translate(-50%, -50%);
    opacity: 0;
    filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.55));
    transition: opacity 0.35s ease, filter 0.35s ease;
    pointer-events: none;
}
.talk .talk-figure.shown { opacity: 1; }
.talk .talk-figure.leaving { opacity: 0; transition: opacity 0.35s ease; }
.talk .talk-figure.shown.listening { filter: brightness(0.55) drop-shadow(0 10px 18px rgba(0, 0, 0, 0.55)); }
.talk .talk-figure.nod { animation: talk-nod 0.45s ease-out; }
@keyframes talk-nod {
    0% { translate: 0 0; rotate: 0deg; }
    35% { translate: 0 6px; rotate: -2deg; }
    70% { translate: 0 -2px; rotate: 1deg; }
    100% { translate: 0 0; rotate: 0deg; }
}

/* ---------------------------------------------------------------- облачко реплики */

.talk-bubble {
    position: absolute;
    z-index: 3;
    box-sizing: border-box;
    padding: 12px 16px 13px;
    border: 1px solid rgba(var(--gold-rgb, 212, 168, 87), 0.55);
    border-radius: 18px;
    background: rgba(14, 10, 18, 0.93);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
    color: var(--text);
    text-align: left;
    animation: bubble-pop 0.22s ease-out;
}
@keyframes bubble-pop { from { opacity: 0; scale: 0.94; } to { opacity: 1; scale: 1; } }

/* хвостик — ромбик под облачком, к голове говорящего (--tail — где он) */
.talk-bubble::before {
    content: "";
    position: absolute;
    width: 14px;
    height: 14px;
    background: inherit;
    border: inherit;
    border-width: 0 1px 1px 0;
}
.talk-bubble.tail-up::before { top: -8px; left: calc(var(--tail, 50%) - 7px); transform: rotate(-135deg); }
.talk-bubble.tail-down::before { bottom: -8px; left: calc(var(--tail, 50%) - 7px); transform: rotate(45deg); }
.talk-bubble.tail-left::before { left: -8px; top: calc(var(--tail, 30px) - 7px); transform: rotate(135deg); }
.talk-bubble.tail-right::before { right: -8px; top: calc(var(--tail, 30px) - 7px); transform: rotate(-45deg); }

/* рассказчик — подпись внизу кадра, без хвостика */
.talk-bubble.narrator {
    left: 4%;
    right: 4%;
    bottom: 4%;
    top: auto;
    width: auto !important;
    border-radius: 8px;
    font-style: italic;
}
.talk-bubble.narrator::before { display: none; }

/* пэт говорит — облачко сиреневое */
.talk-bubble.pet { border-color: rgba(var(--glow-rgb, 143, 91, 255), 0.6); background: rgba(22, 14, 36, 0.94); }

/* крик (ярость, гнев) — рваный край */
.talk-bubble.shout {
    border: 0;
    border-radius: 4px;
    background: rgba(48, 14, 10, 0.95);
    clip-path: polygon(0% 6%, 4% 0%, 9% 5%, 15% 0%, 21% 6%, 28% 0%, 35% 5%, 42% 0%, 49% 6%, 56% 0%, 63% 5%, 70% 0%, 77% 6%, 84% 0%,
        91% 5%, 96% 0%, 100% 7%, 97% 14%, 100% 22%, 96% 30%, 100% 38%, 96% 46%, 100% 54%, 96% 62%, 100% 70%, 96% 78%, 100% 86%, 97% 93%,
        100% 100%, 93% 95%, 86% 100%, 79% 95%, 72% 100%, 65% 95%, 58% 100%, 51% 95%, 44% 100%, 37% 95%, 30% 100%, 23% 95%, 16% 100%,
        9% 95%, 3% 100%, 0% 93%, 4% 86%, 0% 78%, 4% 70%, 0% 62%, 4% 54%, 0% 46%, 4% 38%, 0% 30%, 4% 22%, 0% 14%);
    padding: 18px 22px;
    animation: bubble-shout 0.3s ease-out;
}
.talk-bubble.shout::before { display: none; }
@keyframes bubble-shout { 0% { scale: 0.9; } 40% { scale: 1.04; } 70% { translate: 2px 0; } 85% { translate: -2px 0; } 100% { scale: 1; translate: 0 0; } }

.talk .talk-name {
    margin: 0 0 4px;
    font-family: var(--title);
    font-size: 17px;
    font-weight: 700;
    color: var(--gold, #d4a857);
}
.talk .talk-name[hidden] { display: none; }
.talk-bubble.pet .talk-name { color: var(--violet); }

/* текст: невидимый «призрак» держит размер облачка, поверх печатается настоящий */
.talk-says { position: relative; }
.talk-ghost { visibility: hidden; }
.talk .talk-ghost, .talk .talk-text {
    font-size: 16px;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.talk .talk-text { position: absolute; inset: 0; min-height: 0; color: var(--text); }
.talk-bubble.narrator .talk-text { color: #ddd4ea; }
.talk-extra:empty { display: none; }
.talk-extra { margin-top: 8px; }
.talk .talk-error { margin-top: 8px; }

/* ---------------------------------------------------------------- ответы — кнопки кучкой */

.talk .talk-answers {
    flex: none;
    display: flex;
    flex-flow: row wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 8px 10px;
    width: min(100%, 860px);
    margin: 0;
}
.talk .talk-answers:empty { display: none; }
.talk .talk-answer-row { display: flex; flex-direction: column; align-items: center; }
.talk .talk-answer {
    width: auto;
    max-width: 100%;
    padding: 9px 16px;
    border: 1px solid var(--gold-line, rgba(212, 168, 87, 0.42));
    border-radius: 999px;
    background: rgba(12, 9, 15, 0.86);
    color: #f1e9d8;
    font-size: 15px;
    text-align: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}
.talk .talk-answer:hover:not(:disabled) {
    border-color: rgba(var(--gold-rgb, 212, 168, 87), 0.95);
    background: rgba(var(--gold-rgb, 212, 168, 87), 0.12);
    box-shadow: 0 0 12px rgba(var(--gold-rgb, 212, 168, 87), 0.3);
}
.talk .talk-answer.back { color: var(--muted); }

/* лавка — своей панелью под кадром */
.talk.shopping .talk-answers { flex-direction: column; align-items: stretch; width: min(100%, 620px); }

/* ---------------------------------------------------------------- облачко игрока: имя и кодовое слово */

.talk .talk-answers.as-player { justify-content: flex-end; }
.talk-player-bubble {
    position: relative;
    box-sizing: border-box;
    width: min(100%, 420px);
    padding: 14px 16px 12px;
    border: 1px solid rgba(var(--glow-rgb, 143, 91, 255), 0.65);
    border-radius: 18px;
    background: rgba(22, 14, 36, 0.95);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: bubble-pop 0.22s ease-out;
}
.talk-player-bubble::before {           /* хвостик вниз-вправо — к игроку за экраном */
    content: "";
    position: absolute;
    right: 34px;
    bottom: -8px;
    width: 14px;
    height: 14px;
    background: inherit;
    border: inherit;
    border-width: 0 1px 1px 0;
    transform: rotate(45deg);
}
.talk-player-bubble.whisper { border-style: dashed; border-width: 1.5px; background: rgba(16, 12, 26, 0.95); }
.talk-player-bubble.whisper::before { border-style: dashed; }
.talk-player-bubble.whisper label { font-style: italic; }
.talk .talk-identity { width: min(100%, 420px); }
.talk .talk-identity .talk-answer { justify-self: start; }
.talk .talk-identity input { background: rgba(8, 6, 12, 0.9); }

/* 16.10 (обучение): ответ вводом — облачко игрока: поле и кнопка */
.talk .talk-typed { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; width: min(100%, 460px); }
.talk .talk-typed input {
    flex: 1 1 180px; min-width: 0; padding: 9px 12px; border: 1px solid var(--line, rgba(255, 255, 255, 0.18));
    border-radius: 10px; background: rgba(8, 6, 12, 0.9); color: #f1e9d8; font: inherit; font-size: 16px;
}
.talk .talk-typed input:focus { outline: none; border-color: rgba(var(--glow-rgb, 143, 91, 255), 0.9); }
.talk .talk-typed .talk-answer { flex: 0 0 auto; }
@media (max-width: 640px) { .talk .talk-typed .talk-answer { flex: 1 1 100%; } }

/* ---------------------------------------------------------------- «Уйти» и «↑» — вверху справа */

.talk-tools {
    position: fixed;
    z-index: 160;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
}
.talk .talk-leave, .talk .talk-history-button { float: none; margin: 0; padding: 6px 14px; font-size: 13px; }

/* история — прошлые облачка, полупрозрачные, над кадром */
.talk .talk-history {
    position: fixed;
    z-index: 158;
    top: 52px;
    left: 50%;
    width: min(92vw, 560px);
    max-height: 46vh;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px;
    border: 0;
    border-radius: 14px;
    background: rgba(6, 4, 10, 0.88);
    overflow-y: auto;
}
.talk .talk-history-line {
    align-self: flex-start;
    max-width: 82%;
    padding: 6px 12px;
    border: 1px solid rgba(var(--gold-rgb, 212, 168, 87), 0.3);
    border-radius: 14px 14px 14px 4px;
    background: rgba(20, 15, 26, 0.9);
    opacity: 0.8;
}
.talk .talk-history-line.choice {
    align-self: flex-end;
    padding-left: 12px;
    border-color: rgba(var(--glow-rgb, 143, 91, 255), 0.5);
    border-radius: 14px 14px 4px 14px;
    color: #e6dcff;
}
.talk .talk-history-line.narrator { align-self: center; border-style: dashed; }

@media (prefers-reduced-motion: reduce) {
    .talk .talk-figure.nod, .talk-bubble, .talk-player-bubble { animation: none; }
}

/* ---------------------------------------------------------------- стартовый экран: кот в плашке */

.pet-panel.greeter { cursor: var(--cursor, pointer); }
.pet-panel.greeter .avatar { overflow: visible; }
.pet-panel.greeter .live-pet-image {
    max-width: 64px;
    max-height: 64px;
    image-rendering: auto;
    animation: greeter-breathe 4.2s ease-in-out infinite;
    transform-origin: 50% 80%;
}
@keyframes greeter-breathe {
    0%, 100% { scale: 1; rotate: 0deg; }
    40% { scale: 1.035; rotate: 0deg; }
    70% { scale: 1.01; rotate: -3deg; }
    80% { scale: 1.01; rotate: -3deg; }
}
/* облачко «…» — кот уже собирается заговорить */
.pet-panel.greeter .avatar::after {
    content: "…";
    position: absolute;
    top: -10px;
    right: -16px;
    padding: 0 7px 4px;
    border: 1px solid rgba(var(--gold-rgb, 212, 168, 87), 0.6);
    border-radius: 10px 10px 10px 2px;
    background: rgba(14, 10, 18, 0.95);
    color: #f1e9d8;
    font-size: 16px;
    line-height: 16px;
    animation: greeter-dots 1.8s ease-in-out infinite;
}
@keyframes greeter-dots { 0%, 100% { opacity: 0.55; translate: 0 0; } 50% { opacity: 1; translate: 0 -2px; } }
.pet-panel.greeter:hover .live-pet-name { color: var(--gold, #d4a857); }
@media (prefers-reduced-motion: reduce) {
    .pet-panel.greeter .live-pet-image, .pet-panel.greeter .avatar::after { animation: none; }
}

/* ---------------------------------------------------------------- гость: кот говорит в плашке, ответы на карте (13.10, вечер) */

.talk-inline[hidden] { display: none; }
.talk-inline { position: relative; margin-top: 4px; }
.pet-panel.cat-talking { height: auto; min-height: 96px; }
.pet-panel.cat-talking .live-pet-note { display: none; }
.pet-panel.cat-talking .avatar::after { content: none; }           /* «…» — он уже говорит */
.talk-inline .talk-bubble {
    position: relative;
    padding: 7px 26px 8px 12px;
    border: 1px solid rgba(var(--gold-rgb, 212, 168, 87), 0.55);
    border-radius: 4px 14px 14px 14px;                               /* хвостик — к морде слева */
    background: rgba(14, 10, 18, 0.95);
    font-size: 14px;
    line-height: 1.4;
    color: var(--text);
    animation: bubble-pop 0.22s ease-out;
}
.talk-inline .talk-says { position: relative; }
.talk-inline .talk-ghost { visibility: hidden; white-space: pre-wrap; }
.talk-inline .talk-text { position: absolute; inset: 0; white-space: pre-wrap; }
.talk-inline .talk-error { margin-top: 4px; color: #ff9c8a; font-size: 13px; }
.talk-inline .talk-error[hidden], .talk-inline .talk-name, .talk-inline .talk-figure,
.talk-inline .talk-history, .talk-inline .talk-history-button { display: none; }
.talk-inline .talk-extra:empty { display: none; }
.talk-inline .talk-extra { margin-top: 6px; }
.talk-inline .talk-recovery { padding: 6px 8px; font-size: 14px; }
.talk-hush {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--muted);
    font-size: 12px;
    cursor: var(--cursor, pointer);
}
.talk-hush:hover { color: var(--text); }
#live-pet-image.nod { animation: talk-nod 0.45s ease-out; }

/* ответы кота-встречающего — кучкой на карте, над «Перейти сюда» */
.guest-answers[hidden] { display: none; }
.guest-answers {
    display: flex;
    flex-flow: row wrap;
    justify-content: center;
    gap: 8px;
    max-width: 100%;
    pointer-events: auto;
}
.guest-answers .talk-answer-row { display: flex; }
.guest-answers .talk-answer {
    width: auto;
    padding: 8px 15px;
    border: 1px solid rgba(var(--gold-rgb, 212, 168, 87), 0.55);
    border-radius: 999px;
    background: rgba(12, 9, 15, 0.92);
    color: #f1e9d8;
    font: inherit;
    font-size: 14px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
    cursor: var(--cursor, pointer);
    animation: bubble-pop 0.22s ease-out both;
}
.guest-answers .talk-answer:hover:not(:disabled) {
    border-color: rgba(var(--gold-rgb, 212, 168, 87), 0.95);
    background: rgba(var(--gold-rgb, 212, 168, 87), 0.14);
}
.guest-answers .talk-answer.back { color: var(--muted); }
.guest-answers.as-player { justify-content: center; }
.guest-answers .talk-identity { display: grid; gap: 8px; width: min(100%, 380px); }
.guest-answers .talk-identity label { display: grid; gap: 4px; font-size: 13px; color: #c9bfae; }
.guest-answers .talk-identity input {
    box-sizing: border-box;
    width: 100%;
    min-height: 40px;
    padding: 8px 11px;
    border: 1px solid rgba(var(--gold-rgb, 212, 168, 87), 0.45);
    border-radius: 6px;
    background: rgba(8, 6, 12, 0.92);
    color: #f3ecdf;
    font: inherit;
}
.guest-answers .talk-identity .talk-answer { justify-self: start; }
.guest-answers .talk-identity-name { opacity: 0.75; }
.talk-inline .talk-bubble { z-index: auto; box-shadow: none; }
.talk-inline .talk-bubble::before { display: none; }
.talk-hush { z-index: 4; }
.talk-inline .talk-text, .talk-inline .talk-ghost { font-size: 14px; line-height: 1.4; min-height: 0; margin: 0; color: var(--text); }

/* ---------------------------------------------------------------- плашка (13.10, вечер, слово Архитектора) */

/* «● в мире N» — в шапке, справа от «Миросток» */
.brand-top { display: flex; align-items: baseline; gap: 12px; }
.brand-top .online-badge { font-size: 12px; white-space: nowrap; }

/* справа в плашке: «Выйти» сверху, «Сумка» и «Летопись» — в одну строку; всё в обычной высоте */
.pet-panel .pet-side { justify-content: center; }
.pet-panel .pet-actions {
    display: grid;
    grid-template-columns: auto auto;
    justify-content: end;
    align-items: center;
    gap: 6px;
}
.pet-panel .pet-actions .account { grid-column: 1 / -1; justify-self: end; flex-direction: row; }
.pet-panel .pet-actions .account:empty { display: none; }
.pet-panel .pet-actions .ghost-button { padding: 5px 12px; }
.pet-panel .pet-actions [hidden] { display: none; }
.pet-panel .avatar, .pet-panel .pet-info { align-self: center; }
/* подписи под ником — в одну строку (полностью — во всплывающей подсказке): плашка не растягивается */
.pet-panel .live-pet-note, .pet-panel .pet-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------------------------------------------------------------- ↻ перевернуть плашку: пэт ⇄ кот (13.10) */

.plaque-flip[hidden] { display: none; }
.plaque-flip {
    position: absolute;
    right: -9px;
    bottom: -7px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 1px solid rgba(var(--gold-rgb, 212, 168, 87), 0.7);
    border-radius: 50%;
    background: rgba(14, 10, 18, 0.95);
    color: #f1e9d8;
    font-size: 14px;
    line-height: 1;
    cursor: var(--cursor, pointer);
}
.plaque-flip::before { content: ""; position: absolute; inset: -8px; }   /* палец попадает с запасом */
.plaque-flip:hover { border-color: var(--violet, #a778ff); color: var(--gold, #d4a857); }
.pet-panel { backface-visibility: hidden; }
/* Оборот у вошедшего: только кот — облачко на всю ширину, высота плашки та же. */
.pet-panel.cat-side .pet-side, .pet-panel.cat-side .pet-line { display: none; }
.pet-panel.cat-side .pet-info { grid-column: 2 / 4; }

/* ---------------------------------------------------------------- обучение: кот показывает, что нажать (14.10) */

body.touring .map-scene.shown .map-point:not(.tour-target):not(.member) { opacity: 0.35; transition: opacity 0.3s; }
.map-point.tour-target { z-index: 6; }
.map-point.tour-target .map-point-icon,
.map-point.tour-target .map-point-mark { animation: tour-point 1.6s ease-in-out infinite; }
@keyframes tour-point {
    0%, 100% { scale: 1.05; filter: opacity(1) drop-shadow(0 0 4px rgba(255, 200, 90, 0.7)); }
    50% { scale: 1.3; filter: opacity(1) brightness(1.3) drop-shadow(0 0 12px rgba(255, 200, 90, 1)) drop-shadow(0 0 22px rgba(255, 170, 60, 0.7)); }
}
.tour-target:not(.map-point) { animation: tour-button 1.6s ease-in-out infinite; z-index: 3; }
@keyframes tour-button {
    0%, 100% { box-shadow: 0 0 0 1px rgba(255, 200, 90, 0.7), 0 0 6px rgba(255, 200, 90, 0.4); }
    50% { box-shadow: 0 0 0 2px rgba(255, 210, 110, 1), 0 0 18px 4px rgba(255, 190, 80, 0.75); }
}
/* «Сумка» и «Летопись» живут на стороне пэта — на время этих шагов видны и на обороте. */
.pet-panel.cat-side.tour-side .pet-side { display: flex; }
.pet-panel.cat-side.tour-side .pet-info { grid-column: 2; }
@media (prefers-reduced-motion: reduce) {
    .map-point.tour-target .map-point-icon, .map-point.tour-target .map-point-mark, .tour-target:not(.map-point) {
        animation: none; filter: drop-shadow(0 0 10px rgba(255, 200, 90, 1));
    }
}
/* На обороте говорит только кот — его имя над облачком не нужно, плашка не растёт. */
.pet-panel.cat-side.cat-talking .live-pet-name { display: none; }
.pet-panel.cat-side.tour-side .pet-actions .account { display: none; }
.pet-panel.cat-side.tour-bag #chronicle-button, .pet-panel.cat-side.tour-chronicle #gear-button { display: none; }

/* ---------------------------------------------------------------- телефон: реплика под кадром (15.10) */

.talk .talk-history[hidden] { display: none; }        /* пустая история не висит тёмной полоской */
.talk-bubble.below {
    position: relative;
    width: var(--w, 100%) !important;
    left: auto;
    top: auto;
    flex: none;
    max-width: 100%;
    margin-top: -4px;
}
.talk-bubble.narrator.below { left: auto; right: auto; bottom: auto; }

/* Ясные поля и конкретная цель проводника, без изменения художественного оформления. */
.talk-identity label { position: relative; min-width: 0; }
.talk-identity label:has(.talk-secret-toggle) input { padding-right: 5.5em; }
.talk-secret-toggle { position: absolute; right: .4em; bottom: .45em; font: inherit; font-size: .78em; }
.talk-identity small { display: block; max-width: 32em; line-height: 1.4; opacity: .85; }
.talk-recovery { overflow-wrap: anywhere; user-select: text; }
.talk-inline .talk-recovery, .talk .talk-recovery { -webkit-user-select: text; user-select: text; }
.talk-recovery-ack { display: flex; align-items: flex-start; gap: .6em; font-size: .9em; line-height: 1.4; }
.talk-recovery-ack input { flex: none; width: auto; margin-top: .25em; }
.cat-guide-target { outline: 2px solid #e6c381 !important; outline-offset: 4px; box-shadow: 0 0 14px #e6c38180; }
.pet-panel.cat-side.cat-guide-active .pet-side { display: flex; }
.pet-panel.cat-side.cat-guide-active .pet-actions .account { display: none; }
.pet-panel.cat-guide-active .pet-actions { flex-wrap: wrap; }
@media (max-width: 600px) {
    .talk-identity { max-width: 100%; box-sizing: border-box; }
    .talk-identity input { min-width: 0; max-width: 100%; box-sizing: border-box; font-size: 16px; }
    .talk-identity .talk-answer { white-space: normal; }
}

/* 02.11 (слово Архитектора): плашка с котом — ВСЕГДА одного размера (иначе карта под ней съезжает). Реплика кота и любой
   другой длинный текст прокручиваются внутри. На обороте (кот) кнопки «Сумка», «Летопись», «Спросить кота» на месте. */
.strip .pet-panel, .strip .pet-panel.cat-talking {
    height: var(--plaque-h, 116px); min-height: var(--plaque-h, 116px); max-height: var(--plaque-h, 116px);
    box-sizing: border-box; overflow: hidden;
}
.pet-panel .pet-info { max-height: 100%; overflow: hidden; }
/* реплика кота прокручивается внутри плашки */
.pet-panel.cat-talking .pet-info { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
/* 02.11 (слово Архитектора): на стороне кота кнопок НЕТ — кот говорит во всю ширину (кнопки — на стороне персонажа).
   Только шаг обучения, где кот показывает «Сумку» / «Летопись», оставляет нужную кнопку (tour-side). */
.pet-panel.cat-side.cat-guide-active .pet-side { display: none; }
.pet-panel.cat-side.cat-guide-active .pet-info { grid-column: 2 / 4; }
/* сторона персонажа: имя, здоровье и где он — видны целиком, в несколько строк, а не обрезаны многоточием */
.pet-panel:not(.cat-side) .live-pet-note:not([hidden]), .pet-panel:not(.cat-side) .pet-line:not([hidden]) {
    white-space: normal; text-overflow: clip; overflow: hidden;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-height: 1.25;
}
/* узкий экран: кнопки компактнее — тексту персонажа больше места */
@media (max-width: 520px) {
    .pet-panel .pet-actions { gap: 4px; }
    .pet-panel .pet-actions .ghost-button { padding: 4px 8px; font-size: 11px; }
    .pet-panel { gap: 10px; }
}
.pet-panel .live-pet-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pet-panel .talk-inline { min-width: 0; max-width: 100%; }
.pet-panel .talk-recovery { width: 100%; max-width: 100%; box-sizing: border-box; overflow-wrap: anywhere; }
.pet-panel .talk-inline .talk-says p, .pet-panel .talk-inline .talk-bubble { overflow-wrap: break-word; }
/* 02.11 (слово Архитектора): и на шаге обучения у кота кнопок нет — «Сумка» и «Летопись» только на стороне персонажа */
.pet-panel.cat-side.tour-side .pet-side { display: none; }
.pet-panel.cat-side.tour-side .pet-info { grid-column: 2 / 4; }

/* 02.11 (слово Архитектора: «несуразно, упорядочить»): сторона персонажа — по строкам, а не тремя узкими столбцами.
   Слева портрет; справа сверху имя («Выйти» — в правом верхнем углу), под ним «❤ 30/30 · где он» на всю ширину,
   ниже — в один ряд компактные кнопки «Сумка», «Летопись», «Спросить кота». Высота плашки прежняя. */
.strip .pet-panel:not(.cat-side) {
    grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto;
    grid-template-areas: "avatar info" "avatar side"; column-gap: 14px; row-gap: 6px; align-content: center;
}
.pet-panel:not(.cat-side) .avatar { grid-area: avatar; align-self: center; }
.pet-panel:not(.cat-side) .pet-info { grid-area: info; grid-column: auto; grid-row: auto; align-self: end; min-width: 0; }
.pet-panel:not(.cat-side) .pet-side { grid-area: side; grid-column: auto; grid-row: auto; align-self: start; align-items: stretch; justify-content: flex-start; min-width: 0; }
.pet-panel:not(.cat-side) .pet-actions {
    position: static; display: flex; flex-direction: row; flex-wrap: wrap; justify-content: flex-start; align-items: center; gap: 6px;
}
.pet-panel:not(.cat-side) .pet-actions .ghost-button { padding: 4px 11px; font-size: 12px; }
.pet-panel:not(.cat-side) .pet-actions .account { position: absolute; top: 9px; right: 14px; grid-column: auto; justify-self: auto; }
.pet-panel:not(.cat-side) .live-pet-name { padding-right: 72px; }
.pet-panel:not(.cat-side) .live-pet-note:not([hidden]), .pet-panel:not(.cat-side) .pet-line:not([hidden]) { -webkit-line-clamp: 2; }
/* 02.11 (слово Архитектора): кнопки «Спросить кота» нет — кот вызывается поворотом плашки */
#cat-guide-button { display: none !important; }
/* 02.11 (слово Архитектора): на стороне персонажа реплик кота нет — они только у кота (talk.js поворачивает плашку к нему) */
.pet-panel:not(.greeter):not(.cat-side) .talk-inline { display: none !important; }
