/* Общие компоненты «Общаги»: персонаж, сцена комнаты, модальные окна, магазин. */

.hidden { display: none !important; }
/* Тост выше онбординга и экрана блокировки — иначе ошибка входа не видна. */
.toast { z-index: 40; }
.link-button { border: 0; background: none; padding: 0; color: #ec6680; font: 800 11px Manrope; cursor: pointer; }
button.ghost { border: 1px solid #e7e1e8; background: #fff; color: #6f6b7c; border-radius: 9px; padding: 7px 10px; font: 800 11px Manrope; cursor: pointer; }
button.ghost:hover { border-color: #ff9db0; color: #e85975; }

/* ---------- персонаж ---------- */

.character { --ch-height: 120px; position: relative; display: block; height: var(--ch-height); width: calc(var(--ch-height) * 300 / 620); flex: none; }
.character .ch-body, .character .ch-head { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: bottom center; pointer-events: none; }
/* Голова лежит ПОД одеждой: воротник и плечи с портрета прячутся за костюм,
   наружу торчит только лицо и короткая шея. */
.character .ch-head { z-index: 1; }
.character .ch-body { z-index: 2; }
.character.mini { width: 42px; height: 42px; border-radius: 50%; overflow: hidden; background: linear-gradient(160deg, #ffe6ec, #fff3ea); }
/* В кружке показываем только портрет: он занимает верхние 232 точки холста,
   поэтому высоту слоя считаем от него, а не от всей фигуры. */
.character.mini .ch-body, .character.mini .ch-head { inset: auto; left: 50%; top: -12px; height: 122px; width: auto; transform: translateX(-50%); object-fit: contain; }

.avatar-slot { display: grid; place-items: center; width: 42px; height: 42px; flex: none; }
.profile-card > span:nth-child(2) { flex: 1; min-width: 0; }
.profile-card b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.wallet-chip { display: flex; align-items: center; gap: 8px; width: 100%; margin-bottom: 18px; padding: 11px 13px; border: 1px solid #f2e6ea; border-radius: 14px; background: #fffaf6; font: inherit; cursor: pointer; }
.wallet-chip span { font-size: 10px; font-weight: 800; letter-spacing: .6px; color: #b3a6ab; }
.wallet-chip b { font: 900 14px Nunito; color: #3a3748; }
.wallet-chip em { margin-left: auto; font-style: normal; font: 800 10px Manrope; color: #ec6680; }

/* ---------- главная ---------- */

.hero-scene { display: grid; place-items: end center; padding-bottom: 0; }
.hero-character { --ch-height: 250px; margin-bottom: -4px; filter: drop-shadow(0 12px 16px #6b45383d); }
.edit-character-home { position: absolute; z-index: 3; top: 16px; right: 18px; border: 0; border-radius: 10px; background: #ffffffcc; padding: 8px 11px; color: #7a5a5f; font: 800 10px Manrope; cursor: pointer; }
.room-facts { margin-top: 26px; }
.right-title button { cursor: pointer; }
.favorites-empty { grid-column: 1 / -1; border: 1px dashed #ecdfe4; border-radius: 17px; padding: 26px; color: #a5a1af; font-size: 12px; text-align: center; }
.room-card { position: relative; }
.favorite-toggle { position: absolute; top: 12px; right: 12px; border: 0; background: none; color: #f0a0b1; font-size: 17px; cursor: pointer; }
.room-card .join:disabled { color: #b6b2c0; cursor: default; }
.people button { width: 100%; }
.people button > span { flex: 1; min-width: 0; }
.people small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }

/* ---------- сцена комнаты ---------- */

/* Комната — обычный раздел страницы, а не всплывающая панель поверх неё:
   страница листается как обычно, а «← В меню» возвращает на главную. */
/* В комнате чат идёт первым и занимает всё свободное место, а сцена стоит
   внизу на всю ширину — как подоконник, из-за которого смотришь на переписку. */
.world-dock { display: none; flex-direction: column; overflow: hidden; background: #fff; }
.world-dock.open { display: flex; }
.dock-chat { order: 1; flex: 1; min-height: 0; height: auto; border-top: 0; }
.dock-scene { order: 2; flex: none; }
.content.in-room .hero, .content.in-room .section-head, .content.in-room .room-grid { display: none; }
/* Правая колонка в комнате не нужна: она забирала треть ширины под пустоту. */
.app-shell.in-room { max-width: none; grid-template-columns: 254px minmax(0, 1fr); }
.app-shell.in-room .rightbar { display: none; }
.content.in-room { display: flex; flex-direction: column; height: 100vh; padding-bottom: 0; }
.content.in-room .world-dock { flex: 1; min-height: 0; margin: 0 -42px; border-top: 1px solid var(--line); }
.dock-scene { position: relative; height: min(46vh, 420px); border-top: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; background: #eae4ee; cursor: grab; scrollbar-width: thin; }
.dock-scene.dragging-scene { cursor: grabbing; }
.dock-scene-track { position: relative; height: 100%; min-width: 100%; aspect-ratio: var(--scene-aspect, 2900 / 500); min-height: 240px; background-repeat: no-repeat; background-position: center bottom; background-size: 100% 100%; }
/* Общественные локации теперь такие же длинные, как комнаты, и так же
   прокручиваются: в них собирается толпа, и ширина там нужнее всего. */
.long-room-note { position: absolute; left: 18px; top: 14px; border-radius: 9px; background: #ffffffbb; padding: 6px 10px; color: #6d6878; font-size: 10px; }

.scene-decor, .scene-people { position: absolute; inset: 0; }
.decoration { position: absolute; transform: translate(-50%, -100%); transform-origin: bottom center; }
.decoration img { display: block; width: 100%; height: auto; }
.decoration.on-wall { filter: drop-shadow(0 4px 6px #1d151233); }
.decoration.draggable { cursor: grab; outline: 2px dashed #ff8ba0; outline-offset: 4px; border-radius: 6px; }
.decoration.dragging { cursor: grabbing; opacity: .8; }

/* Ник над головой: снизу он спорил с полом и налезал на соседей. */
.scene-person { position: absolute; bottom: 5%; display: grid; justify-items: center; transform: translateX(-50%); }
.scene-person b { order: -1; margin: 0 0 5px !important; }
.scene-person .character { --ch-height: 165px; filter: drop-shadow(0 8px 10px #3a2d3540); }
.scene-person b { border-radius: 9px; background: #ffffffd9; padding: 3px 8px; font: 800 10px Manrope; color: #4a4557; white-space: nowrap; }
.scene-person.is-me b { background: #ff6d85; color: #fff; }
.scene-person.is-me { cursor: grab; touch-action: none; }   /* иначе на телефоне тащится страница, а не персонаж */
.scene-person.dragging { cursor: grabbing; }
.person-tag { margin-left: 5px; font-style: normal; opacity: .65; }

/* ---------- чат ---------- */

.dock-chat { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 236px; }
.dock-chat header { display: flex; align-items: center; gap: 12px; padding: 11px 20px; border-bottom: 1px solid var(--line); font: 800 12px Manrope; color: #4b4759; }
.dock-chat header i { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: #51c894; }
.chat-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.chat-actions button { border: 1px solid #ece7ef; border-radius: 9px; background: #fff; padding: 6px 10px; color: #6f6b7c; font: 800 10px Manrope; cursor: pointer; }
.chat-actions button.active { border-color: #ff6d85; background: #fff1f3; color: #e85975; }
.chat-actions small { color: #a5a1af; font-weight: 700; }
.dock-messages { overflow-y: auto; padding: 14px 20px; display: grid; align-content: start; gap: 7px; }
.dock-messages p { margin: 0; font-size: 12px; line-height: 1.5; color: #4a4658; overflow-wrap: anywhere; }
.dock-messages p b { color: #d8577a; }
.dock-messages p.me b { color: #4b8f74; }
.dock-messages p.system-message { color: #a5a1af; font-size: 11px; font-style: italic; }
/* Обращённое к тебе письмо должно ловиться взглядом в бегущей ленте. */
.dock-messages p.to-me { border-left: 3px solid #ff6d85; border-radius: 0 8px 8px 0; margin-left: -20px; padding: 4px 8px 4px 17px; background: #fff2f4; }
.dock-messages p.to-me b.nick { color: #d8577a; }
.dock-messages b.nick { cursor: pointer; }
.dock-messages b.nick:hover { text-decoration: underline; }
.scene-person b { cursor: pointer; }
.dock-input { display: flex; gap: 9px; padding: 12px 20px; border-top: 1px solid var(--line); }
.dock-input input { flex: 1; border: 1px solid #e8e3ec; border-radius: 11px; padding: 11px 13px; outline: none; font: 500 13px Manrope; color: #3f3b4d; }
.dock-input input:focus { border-color: #ff9db0; }
.dock-input button { border: 0; border-radius: 11px; background: #ff6d85; padding: 0 18px; color: #fff; font-size: 15px; cursor: pointer; }

/* ---------- модальные окна ---------- */

.modal { position: fixed; z-index: calc(18 + var(--depth, 0) * 2); inset: 0; display: grid; place-items: center; padding: 24px; background: #2e2a3a55; backdrop-filter: blur(5px); overflow-y: auto; }
.modal-card { position: relative; width: min(460px, 100%); max-height: 88vh; overflow-y: auto; border-radius: 24px; background: #fff; padding: 32px 34px; box-shadow: 0 25px 65px #4e3c5540; }
.modal-card.wide { width: min(760px, 100%); }
.modal-card h2 { margin: 0 0 8px; font: 900 22px Nunito; color: #343247; }
.modal-card h3 { margin: 22px 0 10px; font: 900 14px Nunito; color: #514d61; }
.modal-card > p { margin: 0 0 18px; color: #858193; font-size: 12px; line-height: 1.6; }
.close-modal { position: absolute; top: 16px; right: 18px; width: 30px; height: 30px; border: 0; border-radius: 10px; background: #f5f2f7; color: #7c7789; font-size: 18px; cursor: pointer; }
.modal-card label { display: grid; gap: 6px; margin: 13px 0; color: #656173; font-size: 11px; font-weight: 800; }
.modal-card input[type="text"], .modal-card input[type="url"], .modal-card input:not([type]), .modal-card textarea { width: 100%; border: 1px solid #e6e2e9; border-radius: 10px; padding: 12px 13px; outline: none; color: #403c4d; font: 500 13px Manrope; }
.modal-card textarea { min-height: 78px; resize: vertical; }
.modal-card input:focus, .modal-card textarea:focus { border-color: #ff8ba0; box-shadow: 0 0 0 3px #ff8ba022; }
.profile-photo { position: relative; display: grid; place-items: center; height: 190px; margin: 6px 0 14px; border-radius: 18px; background: linear-gradient(#f7e6dd, #e6cdbd); }
.profile-photo .character { --ch-height: 176px; }
.profile-photo-image { position: absolute; top: 12px; left: 14px; width: 54px; height: 54px; border: 3px solid #fff; border-radius: 50%; object-fit: cover; box-shadow: 0 6px 14px #6b453833; }
.profile-stats { display: flex; flex-wrap: wrap; gap: 14px; margin: 16px 0 18px; color: #7d7989; font-size: 11px; }
.profile-stats b { color: #3d3950; }

/* ---------- выбор внешности ---------- */

.asset-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; align-items: start; }
/* Холст персонажа 300 × 620: шея — на строке 245, голова занимает всё выше неё
   (плюс распущенные волосы ниже), фигура — от шеи до пола на строке 618.
   Высота головы у причёсок разная: пышная выше, но лицо у всех одного размера.
   Плитки показывают ровно свой кусок, поэтому ничего не режется и не пустует. */
/* Селектор с двумя классами перебивает .asset-grid span из onboarding.css,
   который задавал плиткам фиксированную высоту 27 точек. */
.asset-grid .asset-cell { position: relative; width: 100%; height: auto; overflow: hidden; padding: 0; border: 1px solid #e4dfe8; border-radius: 10px; background: #fdf7f4; cursor: pointer; }
.asset-grid .asset-cell img { display: block; width: 100%; height: auto; }
.asset-grid.heads .asset-cell { aspect-ratio: 300 / 300; }
.asset-grid.outfits .asset-cell { aspect-ratio: 300 / 373; }
.asset-grid.outfits .asset-cell img { margin-top: -81.7%; }
.asset-grid .asset-cell.selected { border-color: #ff6d85; background: #fff0f3; box-shadow: 0 0 0 2px #ff8ba033; }
.wardrobe-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 22px; align-items: start; }
.wardrobe-preview { display: grid; place-items: end center; height: 320px; border-radius: 18px; background: linear-gradient(#f6ded1, #dcb290); }
.wardrobe-preview .character { --ch-height: 300px; }
.editor-label { margin: 14px 0 6px !important; text-align: left !important; font-size: 10px !important; font-weight: 800; color: #656173; }
.editor-label span { color: #9a95a3; font-weight: 500; }
.character-preview { display: grid !important; place-items: end center; height: 230px; overflow: hidden; border-radius: 17px; background: linear-gradient(#f3ddd0, #deb087); }
.character-preview .character { --ch-height: 220px; }
.onboarding .asset-grid { grid-template-columns: repeat(5, 1fr); }
.onboarding .asset-grid { gap: 5px; }

/* ---------- список комнат ---------- */

.room-search, .people-search { width: 100%; margin-bottom: 14px; border: 1px solid #e6e2e9; border-radius: 11px; padding: 12px 13px; outline: none; font: 500 13px Manrope; color: #403c4d; }
.rooms-list { display: flex; flex-direction: column; gap: 10px; }
.floor-block { border: 1px solid #efe9f0; border-radius: 16px; background: #fff; }
/* Заголовок этажа липнет к верху окна: на тридцати комнатах иначе через
   пару прокруток уже не помнишь, какой этаж листаешь. */
.floor-block > summary { position: sticky; top: 0; z-index: 1; display: flex; align-items: baseline; gap: 10px;
  border-radius: 15px; padding: 13px 16px; background: #fbf8fc; cursor: pointer; list-style: none; }
.floor-block[open] > summary { border-radius: 15px 15px 0 0; border-bottom: 1px solid #f2ecf3; }
.floor-block > summary::-webkit-details-marker { display: none; }
.floor-block > summary::before { content: '▸'; color: #b6adb8; font-size: 11px; transition: transform .15s; }
.floor-block[open] > summary::before { transform: rotate(90deg); }
.floor-block > summary b { font: 900 13px Nunito; color: #3c3950; }
.floor-block > summary span { color: #a29daf; font: 700 10px Manrope; }
.floor-block > summary em { margin-left: auto; color: #a29daf; font: 800 10px Manrope; font-style: normal; }
.floor-block > summary em.floor-live { color: #3fae7a; }
.floor-rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(216px, 1fr)); gap: 12px; padding: 4px 16px 16px; }
.floor-part { grid-column: 1 / -1; margin: 8px 0 0; color: #b6adb8; font: 800 9px Manrope; letter-spacing: .7px; text-transform: uppercase; }
.move-room-card { display: grid; gap: 4px; border: 1px solid #efe9f0; border-radius: 16px; padding: 14px; background: #fdfbfe; }
.move-room-card.kind-dorm { background: #fff6f1; }
.room-kind { font-size: 9px; font-weight: 800; letter-spacing: .7px; color: #b6adb8; text-transform: uppercase; }
.move-room-card b { font: 900 13px Nunito; color: #3c3950; }
.move-room-card small { color: #8a8695; font-size: 10px; }
.room-residents { color: #a29daf !important; }
.room-card-actions { display: flex; gap: 6px; margin-top: 8px; }
.room-card-actions button { flex: none; border: 0; border-radius: 9px; background: #ff6d85; padding: 7px 11px; color: #fff; font: 800 10px Manrope; cursor: pointer; }
.room-card-actions button:disabled { background: #efeaf1; color: #a9a4b3; cursor: default; }
.room-card-actions button.ghost { background: #fff; color: #6f6b7c; border: 1px solid #e7e1e8; }

/* ---------- магазин и кошелёк ---------- */

.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(126px, 1fr)); gap: 10px; }
.shop-card { display: grid; justify-items: center; gap: 5px; border: 1px solid #ece6ee; border-radius: 14px; padding: 12px 8px; background: #fff; cursor: pointer; }
.shop-card:hover { border-color: #ff9db0; }
.shop-card.selected { border-color: #ff6d85; background: #fff1f3; }
.shop-card img { width: 66px; height: 56px; object-fit: contain; }
.shop-card b { font: 800 11px Manrope; color: #46425a; text-align: center; }
.shop-card small { color: #8d8899; font-size: 10px; }
.shop-swatch { width: 66px; height: 44px; border-radius: 9px; background: #ffd9c7 no-repeat center top; background-size: 420% auto; }
.decor-list { display: grid; gap: 8px; }
.decor-row, .person-row { display: flex; align-items: center; gap: 10px; border: 1px solid #f0eaf1; border-radius: 12px; padding: 9px 12px; }
.decor-row img { width: 38px; height: 32px; object-fit: contain; }
.decor-row span, .person-row span { flex: 1; min-width: 0; font-size: 12px; color: #4a465a; }
.person-row b { display: block; font-size: 12px; }
.person-row small { color: #9b96a6; font-size: 10px; }
.person-row .character.mini { width: 34px; height: 34px; }
.person-row .character.mini .ch-body, .person-row .character.mini .ch-head { top: -10px; height: 99px; }
.people-results { display: grid; gap: 8px; }
.room-name-row span { display: flex; gap: 8px; }
.room-name-row button { border: 0; border-radius: 10px; background: #413e56; padding: 0 14px; color: #fff; font: 800 11px Manrope; cursor: pointer; }
.room-private-row { display: flex !important; align-items: center; gap: 8px; grid-template-columns: none !important; font-size: 12px !important; font-weight: 600 !important; color: #56526a; }
.room-private-row input { width: auto; }
.wallet-balance { border-radius: 14px; background: #fff6d9; padding: 14px 16px; color: #9f8c64; font-size: 12px; font-weight: 700; }
.wallet-balance b { margin-left: 8px; font: 900 20px Nunito; color: #4b4633; }
.wallet-chip b { font-variant-numeric: tabular-nums; }
.wallet-packs { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 8px; margin: 14px 0 10px; }
.pack-card { display: grid; gap: 2px; border: 1px solid #e7e1e8; border-radius: 14px; background: #fff; padding: 13px 14px; text-align: left; cursor: pointer; }
.pack-card:hover { border-color: #ff9db0; }
.pack-card b { font: 900 15px Nunito, sans-serif; color: #3d3950; }
.pack-price { font: 800 12px Manrope, sans-serif; color: #e85975; }
.pack-card small { color: #9b96a6; font-size: 10px; }
.wallet-note { color: #a09bab; font-size: 11px; line-height: 1.5; }
.wallet-history { display: grid; gap: 6px; }
.wallet-row { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid #f4eff5; padding: 8px 2px; font-size: 12px; color: #56526a; }
.wallet-row b.plus { color: #45a173; }
.wallet-row b.minus { color: #d8577a; }

@media (max-width: 900px) {
  .wardrobe-layout { grid-template-columns: 1fr; }
  .wardrobe-preview { height: 240px; }
  .wardrobe-preview .character { --ch-height: 220px; }
  .modal-card { padding: 26px 22px; }
}

.mood-title { margin: 16px 0 8px; font: 800 11px Manrope; letter-spacing: .6px; color: #a09aa8; text-transform: uppercase; }
.mood-options { display: flex; flex-wrap: wrap; gap: 8px; }
.mood-options button { display: flex; align-items: center; gap: 7px; border: 1px solid #ece6ee; border-radius: 13px; background: #fdfbfe; padding: 9px 13px; font: 700 12px Manrope; color: #4a4658; cursor: pointer; }
.mood-options button span { font: inherit; }
.mood-options button:hover { border-color: #ffc0cb; }
.mood-options button.selected { border-color: #ff6d85; background: #fff0f3; color: #d8577a; box-shadow: 0 0 0 2px #ff8ba033; }
.mood-chip { border: 0; border-radius: 10px; background: #f3eef6; padding: 7px 11px; color: #6a6478; font: 800 11px Manrope; cursor: pointer; }
.mood-chip:hover { background: #ece5f1; }

.report-support { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; border: 1px solid #f4e2e6; border-radius: 12px; padding: 10px 12px; background: #fff7f8; font-size: 12px; color: #6c6579; }
.price-tag.rank-tag { background: #ffcf5c; color: #6b4b00; }
.save-outfit:disabled { opacity: .65; cursor: default; }
.floor-shout { border: 0; border-radius: 10px; background: #fff0d6; padding: 7px 11px; color: #9a6b18; font: 800 11px Manrope; cursor: pointer; }

.admin-broadcast { display: flex; gap: 8px; margin: 0 0 14px; }
.admin-broadcast input { flex: 1; border: 1px solid #e6e2e9; border-radius: 11px; padding: 10px 12px; outline: none; font: 500 12px Manrope; color: #403c4d; }
.admin-tools { display: grid; gap: 8px; margin-top: 10px; border-top: 1px dashed #ece6ee; padding-top: 10px; }
.admin-tools label { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.admin-tools label > span { min-width: 78px; font: 800 10px Manrope; color: #8a8695; text-transform: uppercase; letter-spacing: .5px; }
.admin-tools input { flex: 1; min-width: 90px; border: 1px solid #e6e2e9; border-radius: 10px; padding: 8px 10px; outline: none; font: 500 12px Manrope; color: #403c4d; }
.admin-tools input[type="number"] { flex: none; width: 108px; }

/* ---------- предпросмотр в лавке ---------- */

.shop-preview { display: flex; align-items: center; gap: 16px; margin: 4px 0 18px; border: 1px solid #efe9f0; border-radius: 18px; padding: 14px; background: #fdfbfe; }
.shop-preview-frame { position: relative; display: grid; place-items: end center; width: 190px; height: 108px; flex: none; border-radius: 12px; background: #f1ecf3 center/cover no-repeat; overflow: hidden; }
.shop-preview-frame img { max-width: 62%; max-height: 84%; margin-bottom: 6%; filter: drop-shadow(0 6px 8px #2a1f2540); }
.shop-preview b { display: block; font: 900 14px Nunito; color: #3c3950; }
.shop-preview small { color: #8a8695; font-size: 11px; }
.shop-preview .shop-buy { margin-left: auto; flex: none; }
.shop-card.picked { border-color: #ff6d85; box-shadow: 0 0 0 2px #ff8ba033; }
.save-outfit.buying { background: #ff7087; }

/* ---------- личные сообщения ---------- */

.messages-card { padding-bottom: 24px; }
.messages-layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 18px; height: 460px; }
.dialog-list { display: grid; align-content: start; gap: 4px; overflow-y: auto; padding-right: 4px; border-right: 1px solid var(--line); }
.dialog-row { display: flex; align-items: center; gap: 9px; width: 100%; border: 0; border-radius: 12px; background: none; padding: 8px 9px; text-align: left; font: inherit; cursor: pointer; }
.dialog-row:hover { background: #fdf5f7; }
.dialog-row.active { background: #fff0f3; }
.dialog-row > span { flex: 1; min-width: 0; }
.dialog-row b { display: block; font-size: 12px; color: #3d3950; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dialog-row small { display: block; font-size: 10px; color: #9b96a6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dialog-meta { display: grid; justify-items: end; gap: 4px; font-style: normal; }
.dialog-meta em { font-style: normal; font-size: 9px; color: #b3aebc; }
.dialog-unread { display: grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #ff6d85; color: #fff; font-size: 10px; font-weight: 800; text-decoration: none; }
.dialog-thread { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 10px; }
.thread-head { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.thread-head b { display: block; font-size: 13px; color: #3d3950; }
.thread-head small { display: block; font-size: 10px; color: #9b96a6; }
.thread-head > span:nth-child(3) { flex: 1; min-width: 0; }
.thread-back { display: none; border: 0; background: none; color: #7c7789; font-size: 18px; cursor: pointer; }
.thread-messages { overflow-y: auto; display: grid; align-content: start; gap: 7px; padding: 2px; }
.letter { position: relative; justify-self: start; max-width: 78%; margin: 0; border-radius: 14px 14px 14px 4px; background: #f5f2f7; padding: 9px 12px 16px; font-size: 12px; line-height: 1.5; color: #45415a; overflow-wrap: anywhere; }
.letter.me { justify-self: end; border-radius: 14px 14px 4px; background: #ffeef1; color: #4a3945; }
.letter em { position: absolute; right: 10px; bottom: 4px; font-style: normal; font-size: 9px; color: #b3aebc; }
.thread-input { display: flex; gap: 9px; }
.thread-input input { flex: 1; border: 1px solid #e8e3ec; border-radius: 11px; padding: 11px 13px; outline: none; font: 500 13px Manrope; color: #3f3b4d; }
.thread-input input:focus { border-color: #ff9db0; }
.thread-input button { border: 0; border-radius: 11px; background: #ff6d85; padding: 0 18px; color: #fff; font-size: 15px; cursor: pointer; }

/* ---------- карточка соседа ---------- */

.person-hero { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.person-hero .character { --ch-height: 150px; }
.person-hero h2 { margin: 0 0 4px; }
.person-status { margin: 0 0 3px; font-size: 12px; color: #6f6a7d; }
.person-place { margin: 0; font-size: 11px; color: #a09bab; }
.person-bio { margin: 0 0 4px; border-radius: 12px; background: #faf7fb; padding: 12px 14px; font-size: 12px; line-height: 1.6; color: #55506a; overflow-wrap: anywhere; }
.person-actions { display: grid; gap: 10px; }
.action-line { display: flex; flex-wrap: wrap; gap: 8px; }
.action-line.main .primary { flex: 1 1 150px; }
.action-line.quiet { border-top: 1px solid #f2ecf3; padding-top: 10px; gap: 16px; }
.action-line.quiet .link-button { color: #a5a1af; font: 700 11px Manrope; }
.action-line.quiet .link-button:hover { color: #6a6478; }
.action-line.quiet .link-button.danger { color: #c9526f; }
.person-actions .primary { width: auto; flex: 1 1 140px; padding: 11px 16px; }
.person-actions .ghost { padding: 11px 14px; }
.person-actions .ghost.danger { color: #c9526f; border-color: #f3d7de; }
.person-actions .ghost.danger:hover { border-color: #e5859b; }

@media (max-width: 760px) {
  .messages-layout { grid-template-columns: 1fr; height: 66vh; }
  .dialog-list { border-right: 0; }
  .messages-modal.thread-open .dialog-list { display: none; }
  .messages-modal:not(.thread-open) .dialog-thread { display: none; }
  .thread-back { display: block; }
}

/* ---------- жалобы и модерация ---------- */

.report-flag { margin-left: 6px; border: 0; background: none; padding: 0 2px; color: #d3ccd6; font-size: 11px; cursor: pointer; opacity: 0; transition: opacity .15s; }
.dock-messages p:hover .report-flag { opacity: 1; }
.report-flag:hover { color: #e8637f; }
.report-target { margin: 0 0 10px; font-size: 12px; font-weight: 800; color: #4a465a; }
.report-snippet, .admin-report blockquote { margin: 0 0 12px; border-left: 3px solid #f0d5dc; border-radius: 0 8px 8px 0; background: #faf7fb; padding: 9px 12px; font-size: 12px; color: #5a5568; overflow-wrap: anywhere; }
.report-reasons { display: flex; flex-wrap: wrap; gap: 7px; }
.report-reasons button { border: 1px solid #e7e1e8; border-radius: 9px; background: #fff; padding: 8px 12px; color: #6f6b7c; font: 800 11px Manrope; cursor: pointer; }
.report-reasons button.selected { border-color: #ff6d85; background: #fff0f3; color: #e85975; }

.admin-overview { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; margin-bottom: 16px; }
.admin-stat { display: grid; gap: 2px; border-radius: 13px; background: #faf7fb; padding: 11px 12px; }
.admin-stat b { font: 900 19px Nunito; color: #3d3950; }
.admin-stat span { font-size: 10px; color: #948fa1; }
.admin-tabs { display: flex; gap: 7px; margin-bottom: 10px; }
.admin-tabs button { border: 1px solid #e7e1e8; border-radius: 10px; background: #fff; padding: 8px 13px; color: #6f6b7c; font: 800 11px Manrope; cursor: pointer; }
.admin-tabs button.active { border-color: #ff6d85; background: #fff0f3; color: #e85975; }
.admin-controls { display: grid; gap: 8px; margin-bottom: 12px; }
.admin-search, .admin-reason { width: 100%; border: 1px solid #e6e2e9; border-radius: 11px; padding: 11px 13px; outline: none; font: 500 12px Manrope; color: #403c4d; }
.admin-search:focus, .admin-reason:focus { border-color: #ff8ba0; }
.admin-list { display: grid; gap: 10px; max-height: 46vh; overflow-y: auto; }
.admin-report { border: 1px solid #efe9f0; border-radius: 15px; padding: 13px 15px; }
.admin-report header { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-bottom: 8px; }
.admin-report header b { font: 900 13px Nunito; color: #3c3950; }
.admin-report header small { color: #a09bab; font-size: 10px; }
.admin-report .character.mini { width: 30px; height: 30px; }
.admin-report .character.mini .ch-body, .admin-report .character.mini .ch-head { top: -9px; height: 88px; }
.report-reason { border-radius: 8px; background: #fff0f3; padding: 3px 8px; color: #e85975; font: 800 10px Manrope; }
.report-reason.online { background: #e9f8f0; color: #3f9a72; }
.report-note { margin: 0 0 8px; font-size: 12px; color: #55506a; overflow-wrap: anywhere; }
.report-sanctions { margin: 0 0 8px; font-size: 11px; color: #c9526f; }
.admin-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.admin-actions .primary.small { width: auto; padding: 8px 14px; font-size: 11px; }
.admin-reset { display: grid; gap: 6px; border: 1px solid #ffd9e0; border-radius: 13px; background: #fff7f9; padding: 12px 14px; }
.admin-reset b { font-size: 11px; color: #b0526b; }
.reset-link { width: 100%; border: 1px solid #f0d5dc; border-radius: 9px; padding: 9px 11px; font: 500 11px Manrope; color: #4a465a; }

.ban-screen { position: fixed; z-index: 30; inset: 0; display: grid; place-items: center; padding: 24px; background: linear-gradient(135deg, #2a2431ee, #4a3140ee); backdrop-filter: blur(8px); }
.ban-screen.hidden { display: none; }
.ban-card { width: min(420px, 100%); border-radius: 26px; background: #fff; padding: 34px; text-align: center; }
.ban-card h1 { margin: 0 0 10px; font: 900 26px Nunito; color: #343247; }
.ban-card p { margin: 0 0 22px; color: #7d788b; font-size: 13px; line-height: 1.6; }
.dock-input input:disabled, .thread-input input:disabled { background: #f7f4f8; color: #a5a1af; cursor: not-allowed; }

/* ---------- мобильная вёрстка ---------- */

.mobile-bar, .sidebar-scrim { display: none; }
/* Онбординг и экран блокировки перекрывают вообще всё, включая мобильную панель.
   safe center — чтобы на низком окне карточка не уезжала за верхний край
   вместе с кнопкой «Заселиться», до которой тогда не докрутить. */
.onboarding {
  z-index: 29;
  display: flex;
  align-items: safe center;
  justify-content: center;
  overflow-y: auto;
}
.onboarding.hidden { display: none; }
.onboarding-card { flex: none; }

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 220px minmax(0, 1fr); }
  .rightbar { display: block; grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); padding: 24px 30px 40px; }
  .rightbar > section { display: inline-block; vertical-align: top; width: min(320px, 100%); margin-right: 20px; }
  .rightbar .online { display: block; width: auto; }
}

@media (max-width: 760px) {
  body { padding-top: 56px; }
  .mobile-bar { position: fixed; z-index: 26; inset: 0 0 auto; display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 14px; border-bottom: 1px solid var(--line); background: #fff; }
  .mobile-bar .brand-mark { width: 28px; height: 26px; border-radius: 10px 10px 6px 6px; font-size: 17px; }
  .mobile-brand { display: flex; align-items: center; gap: 8px; font: 900 19px Nunito; color: #302e45; }
  .menu-toggle, .mobile-chat { width: 38px; height: 38px; border: 1px solid #ece7ef; border-radius: 11px; background: #fff; color: #605c6e; font-size: 17px; cursor: pointer; }
  .mobile-chat { margin-left: auto; }
  .sidebar-scrim { position: fixed; z-index: 27; inset: 0; display: block; background: #2e2a3a55; }
  .sidebar-scrim[hidden] { display: none; }
  .sidebar { position: fixed; z-index: 28; top: 0; bottom: 0; left: 0; display: flex; width: min(280px, 84vw); padding-top: 24px; background: #fff; transform: translateX(-104%); transition: transform .22s ease; overflow-y: auto; }
  .sidebar.open { transform: none; box-shadow: 0 0 40px #2c283a33; }
  .rightbar { padding: 20px 16px 36px; }
  .rightbar > section { display: block; width: auto; margin: 0 0 22px; }
  .hero { height: auto; min-height: 260px; padding: 26px 22px 0; }
  .hero-copy { width: 100%; }
  .hero h2 { font-size: 30px; }
  .hero-scene { position: relative !important; width: 100%; height: 190px; background: none; }
  .hero-character { --ch-height: 185px; }
  .edit-character-home { top: 0; right: 0; }
  .content.in-room { height: auto; }
  .content.in-room .world-dock { margin: 0 -16px; }
  .dock-scene { height: 38vh; }
  .dock-chat { min-height: 52vh; }
  .dock-scene-track { min-height: 200px; }

  .dock-chat header { flex-wrap: wrap; gap: 7px; padding: 9px 14px; }
  .chat-actions { margin-left: 0; width: 100%; }
  .dock-messages, .dock-input { padding-inline: 14px; }
  .scene-person .character { --ch-height: 128px; }
  .modal { z-index: calc(27 + var(--depth, 0) * 2); padding: 0; place-items: stretch; }   /* окно во весь экран перекрывает и верхнюю панель */
  .modal-card, .modal-card.wide { width: 100%; max-height: 100vh; min-height: 100vh; border-radius: 0; padding: 60px 18px 28px; }
  .close-modal { top: 14px; right: 14px; width: 36px; height: 36px; }
  .floor-rooms { grid-template-columns: 1fr; padding: 4px 12px 14px; }
  .floor-block > summary { padding: 12px; }
  .admin-list { max-height: none; }
  .profile-photo { height: 150px; }
  .profile-photo .character { --ch-height: 138px; }
  .person-hero { flex-direction: column; align-items: flex-start; }
  .toast { bottom: 16px; width: calc(100% - 32px); text-align: center; }
}

/* ---------- видимая ошибка в формах входа ---------- */

.form-error {
  margin: 10px 0 0;
  border-radius: 10px;
  background: #fff0f2;
  padding: 10px 12px;
  color: #c0405c;
  font: 700 12px/1.45 Manrope, sans-serif;
  text-align: left;
}
.form-error.hidden { display: none; }

/* ---------- подарки, авторитет, действия ---------- */

.rank-mark { margin-right: 4px; color: #ffcc57; font-size: 9px; letter-spacing: -1px; text-decoration: none; }
.scene-person.is-me .rank-mark { color: #fff3c4; }
.dock-messages p.action-message { color: #b0678a; font-size: 11.5px; }
.dock-messages p.action-message::before { content: "✦ "; opacity: .6; }
.room-topic { font-style: normal; font-weight: 500; color: #a09bab; }

.gift-shelf { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 14px; min-height: 34px; }
.gift-shelf .muted { margin: 0; align-self: center; }
.gift {
  display: grid; place-items: center; width: 34px; height: 34px;
  border: 1px solid #f2e6ea; border-radius: 11px; background: #fffaf7; font-size: 17px; cursor: default;
}
.gift.more { font: 700 11px Manrope, sans-serif; color: #a09bab; }

.gift-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.gift-card {
  display: grid; justify-items: center; gap: 3px;
  border: 1px solid #ece6ee; border-radius: 13px; background: #fff; padding: 12px 8px; cursor: pointer;
}
.gift-card:hover { border-color: #ff9db0; }
.gift-card.selected { border-color: #ff6d85; background: #fff1f3; box-shadow: 0 0 0 2px #ff8ba033; }
.gift-emoji { font-size: 26px; line-height: 1.1; }
.gift-card b { font: 700 11px Manrope, sans-serif; color: #46425a; text-align: center; }
.gift-card small { color: #8d8899; font-size: 10px; }

.action-row { margin: 4px 0 14px; }
.action-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.gesture {
  border: 1px solid #e7e1e8; border-radius: 999px; background: #fff;
  padding: 7px 12px; color: #6f6b7c; font: 700 11px Manrope, sans-serif; cursor: pointer;
}
.gesture:hover { border-color: #ff9db0; background: #fff6f8; color: #e85975; }
.go-lively { background: #413e56; }

@media (max-width: 760px) {
  .top-actions { flex-wrap: wrap; }
  .go-lively { font-size: 11px; padding: 10px 12px; }
}

/* ---------- ЗАГС ---------- */

.marriage-state { margin-bottom: 8px; }
.marriage-card, .proposal-row {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid #f0eaf1; border-radius: 14px; padding: 12px 14px;
}
.marriage-card { border-color: #ffd9e0; background: #fff7f9; }
.marriage-card > span, .proposal-row > span { flex: 1; min-width: 0; }
.marriage-card b, .proposal-row b { display: block; font: 700 13px "Nunito", sans-serif; color: #3d3950; }
.marriage-card small, .proposal-row small { display: block; font-size: 11px; color: #9b96a6; overflow-wrap: anywhere; }
.proposal-row { margin-bottom: 8px; }
.proposal-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.proposal-actions .primary.small { width: auto; padding: 8px 14px; font-size: 11px; }
.modal-card [data-role="marriage-lists"] h3:first-child { margin-top: 18px; }

/* ---------- платный гардероб и стипендия ---------- */

.asset-grid .asset-cell.locked { background: #f6f2f7; }
.asset-grid .asset-cell.locked img { filter: grayscale(1) opacity(.45); }
.asset-grid .asset-cell.locked:hover img { filter: grayscale(.3) opacity(.8); }
.price-tag {
  position: absolute; left: 50%; bottom: 4px; transform: translateX(-50%);
  border-radius: 999px; background: #413e56; padding: 2px 7px;
  color: #fff; font: 700 9px/1.5 Manrope, sans-serif; font-style: normal; white-space: nowrap;
}
.wardrobe-hint { margin: 14px 0 10px; font-size: 12px; color: #9b96a6; }

.stipend-row {
  display: grid; gap: 2px; width: 100%; margin-top: 12px; text-align: left; cursor: pointer;
  border: 1px dashed #e2d7dd; border-radius: 14px; background: #fffaf7; padding: 13px 15px; font: inherit;
}
.stipend-row.ready { border-style: solid; border-color: #ffcf7a; background: #fff8e6; }
.stipend-row b { font: 900 14px Nunito, sans-serif; color: #4b4633; }
.stipend-row small { font-size: 11px; color: #a4998a; }
.stipend-row:disabled { cursor: default; opacity: .75; }
