/* АСЬКА — олдскульный мессенджер в духе ICQ 99/2000.
   Серые панели, фаски, синий заголовок окна, мелкий Tahoma. */

:root {
  --face: #c0c0c0;
  --light: #ffffff;
  --hl: #dfdfdf;
  --shadow: #808080;
  --dark: #404040;
  --black: #000000;
  --title1: #0a246a;
  --title2: #a6caf0;
  --title-inactive1: #808080;
  --title-inactive2: #c0c0c0;
  --desktop: #3a6ea5;
  --paper: #ffffff;
  --sel: #0a246a;
  --link: #000080;
  --green: #3cb44a;
  --green-dark: #1f7a2a;
  --red: #d8232a;
  --me: #0000c0;
  --them: #c00000;
  --fs: 11px;
  --row: 18px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: Tahoma, Verdana, 'Segoe UI', 'MS Sans Serif', Arial, sans-serif;
  font-size: var(--fs);
  line-height: 1.25;
  color: #000;
  background: var(--desktop);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
input, textarea { user-select: text; -webkit-user-select: text; }
svg { display: inline-block; vertical-align: middle; }
[hidden] { display: none !important; }

/* ---------- рабочий стол ---------- */
.desktop {
  position: fixed; inset: 0;
  background: var(--desktop);
  overflow: hidden;
  /* clip, а не hidden: рабочий стол не становится прокручиваемым, и фокус в поле
     не может сдвинуть окна за край экрана */
  overflow: clip;
}
.desktop::before {
  /* едва заметная фактура, как обои Win98 */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 6px 6px;
}
.wins { position: absolute; inset: 0; display: flex; align-items: flex-start; justify-content: center; gap: 10px; padding: 18px 10px; }

/* ---------- окно ---------- */
.win {
  position: relative;
  background: var(--face);
  border: 1px solid;
  border-color: var(--hl) var(--black) var(--black) var(--hl);
  box-shadow: inset 1px 1px var(--light), inset -1px -1px var(--shadow), 2px 2px 0 rgba(0,0,0,.35);
  padding: 3px;
  display: flex; flex-direction: column;
  max-height: calc(100% - 0px);
  animation: winpop .12s steps(2) both;
}
@keyframes winpop { from { transform: scale(.97); opacity: .4; } to { transform: none; opacity: 1; } }
.win.contacts { width: 236px; height: min(560px, 100%); }
.win.chat { width: 404px; height: min(560px, 100%); }
.win.dialog { width: 300px; }
.win.inactive .titlebar { background: linear-gradient(90deg, var(--title-inactive1), var(--title-inactive2)); color: var(--face); }

.titlebar {
  height: 18px; flex: none;
  display: flex; align-items: center; gap: 4px;
  background: linear-gradient(90deg, var(--title1), var(--title2));
  color: #fff; font-weight: bold;
  padding: 0 2px 0 3px;
  cursor: default;
}
.titlebar .ttl { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: 0; }
.titlebar .ttl small { font-weight: normal; opacity: .85; }
.tbtn {
  width: 16px; height: 14px; flex: none; padding: 0;
  background: var(--face); color: #000;
  border: 1px solid; border-color: var(--light) var(--black) var(--black) var(--light);
  box-shadow: inset -1px -1px var(--shadow);
  font: bold 9px/12px Tahoma, Verdana, sans-serif; text-align: center;
}
.tbtn:active { border-color: var(--black) var(--light) var(--light) var(--black); box-shadow: inset 1px 1px var(--shadow); }
.tbtn.back { display: none; }

/* ---------- меню ---------- */
.menubar { display: flex; gap: 0; padding: 1px 0; flex: none; }
.menubar button {
  background: none; border: 1px solid transparent; padding: 1px 6px;
}
.menubar button:hover, .menubar button.open { border-color: var(--light) var(--shadow) var(--shadow) var(--light); }
.menubar button:active { border-color: var(--shadow) var(--light) var(--light) var(--shadow); }
.menu {
  position: absolute; z-index: 30; min-width: 150px;
  background: var(--face);
  border: 1px solid; border-color: var(--hl) var(--black) var(--black) var(--hl);
  box-shadow: inset 1px 1px var(--light), inset -1px -1px var(--shadow), 2px 2px 0 rgba(0,0,0,.3);
  padding: 2px;
}
.menu button { display: flex; align-items: center; gap: 6px; width: 100%; text-align: left; background: none; border: 0; padding: 3px 18px 3px 8px; }
.menu button:hover { background: var(--sel); color: #fff; }
.menu hr { border: 0; border-top: 1px solid var(--shadow); border-bottom: 1px solid var(--light); margin: 2px 1px; }
.menu .chk { width: 10px; display: inline-block; text-align: center; }

/* ---------- элементы ---------- */
.btn {
  background: var(--face);
  border: 1px solid; border-color: var(--light) var(--black) var(--black) var(--light);
  box-shadow: inset -1px -1px var(--shadow), inset 1px 1px var(--hl);
  padding: 2px 10px; min-width: 64px; min-height: 21px;
}
.btn:active, .btn.down { border-color: var(--black) var(--light) var(--light) var(--black); box-shadow: inset 1px 1px var(--shadow); }
.btn.primary { outline: 1px solid var(--black); outline-offset: 0; }
.btn:disabled { color: var(--shadow); text-shadow: 1px 1px var(--light); cursor: default; }
.btn.icon { min-width: 22px; padding: 1px 3px; }

.inset, .field, textarea.field {
  background: var(--paper);
  border: 1px solid; border-color: var(--shadow) var(--light) var(--light) var(--shadow);
  box-shadow: inset 1px 1px var(--black), inset -1px -1px var(--hl);
}
.field { height: 21px; padding: 1px 4px; width: 100%; outline: none; border-radius: 0; -webkit-appearance: none; appearance: none; }
textarea.field { height: auto; resize: none; padding: 2px 4px; line-height: 1.3; }
.field:focus { outline: 1px dotted #000; outline-offset: -3px; }
select.field { padding: 0 2px; }

.groupbox {
  border: 1px solid; border-color: var(--shadow) var(--light) var(--light) var(--shadow);
  box-shadow: inset 1px 1px var(--light), inset -1px -1px var(--shadow);
  padding: 8px 8px 6px; margin: 6px 0; position: relative;
}
.groupbox > legend, .groupbox > .legend { position: absolute; top: -7px; left: 6px; background: var(--face); padding: 0 3px; }

.statusbar {
  display: flex; gap: 2px; flex: none; margin-top: 3px;
}
.statusbar .cell {
  flex: 1; height: 19px; padding: 2px 4px;
  border: 1px solid; border-color: var(--shadow) var(--light) var(--light) var(--shadow);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.statusbar .cell.fit { flex: none; }

.row { display: flex; align-items: center; gap: 6px; }
.col { display: flex; flex-direction: column; gap: 6px; }
.lbl { width: 70px; flex: none; }
.muted { color: var(--shadow); }
.hint { color: #404040; }
.err { color: #c00000; }
.sp { flex: 1; }
.right { text-align: right; }
.center { text-align: center; }
.mt { margin-top: 8px; }
.mb { margin-bottom: 6px; }
a, .link { color: var(--link); text-decoration: underline; cursor: pointer; }

/* ---------- регистрация ---------- */
.login-body { padding: 6px 8px 8px; }
.tabs { display: flex; margin-bottom: -1px; position: relative; z-index: 1; }
.tabs button {
  background: var(--face); border: 1px solid; border-color: var(--light) var(--black) transparent var(--light);
  padding: 2px 10px 3px; margin-right: -1px; position: relative; top: 2px;
}
.tabs button.on { top: 0; padding-bottom: 5px; z-index: 2; }
.tabpanel {
  border: 1px solid; border-color: var(--light) var(--black) var(--black) var(--light);
  box-shadow: inset 1px 1px var(--hl), inset -1px -1px var(--shadow);
  padding: 10px 8px 8px;
}
.bigflower { display: grid; place-items: center; padding: 4px 0 8px; }
.bigflower .link { font-size: 11px; }
.uin-box {
  font: bold 22px/1 'Courier New', Courier, monospace; letter-spacing: 2px;
  padding: 6px 10px; text-align: center; background: #fff;
}
.logo-word { font: bold 16px/1 Tahoma, Verdana, sans-serif; letter-spacing: 1px; }
.logo-word small { font-weight: normal; font-size: 10px; letter-spacing: 0; display: block; margin-top: 2px; color: #404040; }

/* ---------- список контактов ---------- */
.me-panel {
  display: flex; align-items: center; gap: 6px;
  padding: 3px 4px; margin: 1px 0 3px;
  border: 1px solid; border-color: var(--shadow) var(--light) var(--light) var(--shadow);
  background: #d4d0c8;
}
.me-panel .nick { font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-panel .uin { color: #404040; }
.clist { flex: 1; overflow: auto; padding: 1px; }
.cgroup { display: flex; align-items: center; gap: 4px; height: var(--row); padding: 0 2px; font-weight: bold; color: var(--link); cursor: default; }
.cgroup .box {
  width: 9px; height: 9px; border: 1px solid var(--shadow); background: #fff;
  font: bold 8px/7px Tahoma, Verdana, monospace; text-align: center; color: #000; flex: none;
}
.cgroup .cnt { font-weight: normal; color: var(--shadow); }
.citem {
  display: flex; align-items: center; gap: 5px; height: var(--row); padding: 0 2px 0 14px;
  white-space: nowrap; cursor: default;
}
.citem:hover { background: #e8e8ff; }
.citem.sel { background: var(--sel); color: #fff; }
.citem.off .nick { color: #606060; }
.citem.sel.off .nick { color: #d0d0d0; }
.citem .nick { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.citem .ico { width: 16px; height: 16px; flex: none; display: grid; place-items: center; }
.citem .typing { font-size: 9px; color: var(--shadow); }
.blink { animation: blink 1s steps(1) infinite; }
.unread-ico { display: inline-flex; }
@keyframes blink { 50% { opacity: 0; } }
.empty-note { padding: 10px 8px; color: #404040; }

.bottom-bar { display: flex; gap: 3px; margin-top: 3px; flex: none; }
.status-btn {
  display: flex; align-items: center; gap: 5px; padding: 1px 6px 1px 3px; height: 23px; flex: 1; min-width: 0; text-align: left;
}
.status-btn .lab { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- окно чата ---------- */
.chat-tabs { display: flex; gap: 1px; padding: 1px 0 0; flex: none; overflow-x: auto; scrollbar-width: none; }
.chat-tabs::-webkit-scrollbar { display: none; }
.chat-tabs button {
  display: flex; align-items: center; gap: 4px; max-width: 150px;
  background: var(--face); border: 1px solid; border-color: var(--light) var(--black) transparent var(--light);
  padding: 1px 6px 2px; margin-right: -1px; white-space: nowrap; position: relative; top: 1px;
}
.chat-tabs button.on { top: 0; padding-bottom: 3px; z-index: 2; border-bottom-color: var(--face); }
.chat-tabs button span { overflow: hidden; text-overflow: ellipsis; }
.chat-tabs button i { font-style: normal; color: var(--shadow); padding-left: 2px; }
.chat-tabs button i:hover { color: #c00000; }
.chat-head { display: flex; align-items: center; gap: 6px; padding: 3px 4px; margin: 0 0 2px; border: 1px solid; border-color: var(--shadow) var(--light) var(--light) var(--shadow); background: #d4d0c8; flex: none; }
.chat-head .nick { font-weight: bold; }
.history {
  flex: 1; overflow: auto; padding: 3px 4px; line-height: 1.35;
  user-select: text; -webkit-user-select: text; overflow-wrap: anywhere; word-break: break-word;
}
.history .day { text-align: center; color: var(--shadow); margin: 4px 0 2px; }
.history .day::before, .history .day::after { content: ' - - - '; }
.msg { margin: 0 0 3px; }
.msg .hdr { font-weight: bold; }
.msg.me .hdr { color: var(--me); }
.msg.them .hdr { color: var(--them); }
.msg .sys { color: #008000; font-style: italic; }
.msg .txt { white-space: pre-wrap; }
.msg .time { font-weight: normal; color: #606060; }
.sm { display: inline-block; width: 18px; height: 18px; vertical-align: -5px; margin: 0 1px; cursor: pointer; }
.sm svg { width: 18px; height: 18px; display: block; }
.sm:active { transform: scale(1.2); }
.sm.bounce { animation: smbounce .35s ease; }
@keyframes smbounce { 30% { transform: scale(1.5) rotate(-8deg); } 70% { transform: scale(1.1) rotate(6deg); } }

.compose { flex: none; display: flex; flex-direction: column; gap: 3px; margin-top: 3px; }
.compose .tools { display: flex; align-items: center; gap: 3px; }
.compose textarea { height: 52px; }
.send-row { display: flex; gap: 4px; align-items: center; }
.send-row .hint { flex: 1; }

/* панель смайлов */
.smiles {
  position: absolute; z-index: 25; bottom: 86px; left: 6px;
  display: grid; grid-template-columns: repeat(6, 26px); gap: 2px; padding: 4px;
  background: var(--face); border: 1px solid; border-color: var(--hl) var(--black) var(--black) var(--hl);
  box-shadow: inset 1px 1px var(--light), inset -1px -1px var(--shadow), 2px 2px 0 rgba(0,0,0,.3);
}
.smiles button { width: 26px; height: 26px; padding: 0; background: none; border: 1px solid transparent; display: grid; place-items: center; }
.smiles button:hover { border-color: var(--light) var(--shadow) var(--shadow) var(--light); background: #ffffe0; }
.smiles button:active { border-color: var(--shadow) var(--light) var(--light) var(--shadow); }
.smiles button svg { width: 20px; height: 20px; }
.smiles .cap { grid-column: 1 / -1; text-align: center; color: #404040; padding-top: 2px; border-top: 1px solid var(--shadow); margin-top: 2px; }

/* открытки в переписке */
.postcard { width: 200px; max-width: 100%; height: 120px; border: 2px solid #fff; outline: 1px solid #000; box-shadow: 2px 2px 0 rgba(0,0,0,.3); margin: 4px 0 3px; cursor: pointer; background: #fff; display: block; overflow: hidden; }
.postcard svg { width: 100%; height: 100%; display: block; }
.postcard:active { transform: scale(.98); }
.pc-cap { font-size: 10px; color: #404040; margin-bottom: 4px; }
.postcard .sway { animation: pc-sway 2.2s ease-in-out infinite alternate; transform-box: view-box; }
.postcard .rays { animation: pc-spin 14s linear infinite; transform-box: view-box; }
.postcard .drift { animation: pc-drift 5s ease-in-out infinite alternate; }
.postcard .beat { animation: pc-beat 1s ease-in-out infinite; transform-box: view-box; }
.postcard .rise { animation: pc-rise 3s linear infinite; opacity: 0; }
.postcard .tw { animation: pc-tw 1.6s ease-in-out infinite alternate; }
.postcard .flicker { animation: pc-flicker .25s ease-in-out infinite alternate; transform-box: view-box; }
.postcard .wag { animation: pc-wag 1.1s ease-in-out infinite alternate; transform-box: view-box; }
.postcard .blink-eye { animation: pc-blink 4s infinite; transform-box: view-box; }
.postcard .planefly { animation: pc-plane 4.5s linear infinite; }
.postcard .steam { animation: pc-steam 2.4s ease-in-out infinite; opacity: 0; }
@keyframes pc-sway { from { transform: rotate(-4deg); } to { transform: rotate(4deg); } }
@keyframes pc-spin { to { transform: rotate(360deg); } }
@keyframes pc-drift { from { transform: translateX(-8px); } to { transform: translateX(8px); } }
@keyframes pc-beat { 0%, 100% { transform: scale(1); } 30% { transform: scale(1.12); } 45% { transform: scale(1.04); } 60% { transform: scale(1.12); } }
@keyframes pc-rise { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(-80px); opacity: 0; } }
@keyframes pc-tw { from { opacity: .2; } to { opacity: 1; } }
@keyframes pc-flicker { from { transform: scaleY(1) rotate(-3deg); } to { transform: scaleY(1.18) rotate(3deg); } }
@keyframes pc-wag { from { transform: rotate(-14deg); } to { transform: rotate(14deg); } }
@keyframes pc-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes pc-plane { from { transform: translate(-60px, 18px); } to { transform: translate(230px, -16px); } }
@keyframes pc-steam { 0% { transform: translateY(0); opacity: 0; } 30% { opacity: .8; } 100% { transform: translateY(-16px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .postcard * { animation: none !important; } }

/* ---------- режимы, панель, темы ---------- */
.toolbar { display: flex; gap: 3px; align-items: center; padding: 1px 0 3px; flex: none; }
.modes { display: flex; flex: 1; min-width: 0; }
.modes button {
  flex: 1; min-width: 0; background: var(--face); border: 1px solid; border-color: var(--light) var(--black) var(--black) var(--light);
  box-shadow: inset -1px -1px var(--shadow), inset 1px 1px var(--hl); padding: 2px 3px; font-size: 10px; min-height: 21px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.modes button.on { border-color: var(--black) var(--light) var(--light) var(--black); box-shadow: inset 1px 1px var(--shadow); background: var(--mode-on, #e8e8e8); font-weight: bold; flex: 2.4; }
.modes button .lab { display: none; margin-left: 3px; }
.modes button.on .lab { display: inline; }
.modes button .mi { font-size: 12px; }
#p-modes button { flex: 1; } #p-modes button .lab { display: inline; }
.toolbar .btn.icon { min-width: 24px; }
body.theme-close { --desktop: #6b3a63; --title1: #5a1f5c; --title2: #e6a0c4; --sel: #7a2a6a; --link: #7a1f5a; --mode-on: #f3d6e6; }
body.theme-biz { --desktop: #2f4858; --title1: #1b2e40; --title2: #8aa9c9; --sel: #1b3a5c; --link: #1b3a5c; --mode-on: #d6e0ea; }
body.theme-chat { --desktop: #3a6ea5; --mode-on: #d9ecd0; }
.statusbar .cell.np { cursor: pointer; color: var(--link); flex: 1.2; }

/* ---------- окно-приставка: стена, профиль, винил ---------- */
.win.aux { width: 330px; height: min(560px, 100%); }
.aux-body { flex: 1; min-height: 0; overflow: auto; padding: 4px 2px 2px; display: flex; flex-direction: column; gap: 4px; }
.aux-body > .row { flex: none; }
.wall-head { display: flex; gap: 6px; align-items: center; padding: 3px 4px; border: 1px solid; border-color: var(--shadow) var(--light) var(--light) var(--shadow); background: #d4d0c8; flex: none; }
.wall-head .who { flex: 1; min-width: 0; }
.wall-head .who b { white-space: nowrap; }
.pct { font: bold 15px/1 Tahoma, Verdana, sans-serif; color: var(--link); padding: 3px 6px; background: #fff; border: 1px solid var(--shadow); flex: none; }
.pct.big { font-size: 22px; }
.chips { display: flex; flex-wrap: wrap; gap: 3px; flex: none; }
.chip { font-size: 10px; padding: 1px 6px; background: #fff; border: 1px solid var(--shadow); border-radius: 8px; line-height: 1.3; }
.chip.on { background: #ffe14d; border-color: #806a00; font-weight: bold; }
button.chip { cursor: pointer; }
button.chip:hover { border-color: #000; }
.chips.small .chip { font-size: 9px; }
.wall-actions { flex-wrap: wrap; }
.wall-actions .btn { min-width: 0; padding: 2px 7px; }
.wall-posts { flex: 1; min-height: 140px; overflow: auto; padding: 3px; user-select: text; -webkit-user-select: text; }
.post { border-bottom: 1px dotted var(--shadow); padding: 3px 2px 6px; margin-bottom: 3px; }
.post-h { display: flex; align-items: center; gap: 4px; margin-bottom: 3px; }
.post-h .like { background: none; border: 1px solid transparent; color: #a03050; padding: 0 5px; font-weight: bold; }
.post-h .like.on { background: #ffe3ea; border-color: #a03050; }
.post .txt { white-space: pre-wrap; }
.post .postcard { width: 180px; height: 108px; }
.trackcard { display: flex; align-items: center; gap: 6px; background: #fff; border: 1px solid; border-color: var(--shadow) var(--light) var(--light) var(--shadow); padding: 3px 4px; margin: 3px 0; }
.trackcard .disc, .trow .disc { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle, var(--c, #3cb44a) 0 28%, #111 30% 100%); flex: none; box-shadow: 0 0 0 1px #000; }
.trackcard .disc.stack { background: repeating-linear-gradient(0deg, #111 0 3px, #666 3px 4px); border-radius: 3px; }
.trackcard .ti, .trow .ti, .prow .ti { flex: 1; min-width: 0; }
.trackcard .ti b, .trow .ti b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trackcard.np .disc { animation: spin 2s linear infinite; }
.card-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.card-pick button { padding: 0; background: none; border: 0; }
.card-pick .postcard { width: 100%; height: 76px; margin: 0; }
.meet-head { display: flex; gap: 8px; align-items: center; }
.meet-head > div:nth-child(2) { flex: 1; min-width: 0; }

/* винил */
.vinyl { display: flex; flex-direction: column; gap: 5px; }
.np-box { padding: 4px 6px; flex: none; }
.np-box b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-ctrl input[type=range] { flex: 1; min-width: 40px; }
.v-ctrl .btn { min-width: 32px; padding: 2px 6px; }
.v-share { flex-wrap: wrap; }
.v-share .btn { min-width: 0; padding: 2px 7px; }
.v-share select { width: auto; flex: 1; min-width: 70px; }
.v-tabs { margin-top: 2px; flex: none; }
.v-list { max-height: 230px; overflow: auto; padding: 3px; background: #fff; }
.trow, .prow { display: flex; align-items: center; gap: 5px; padding: 2px 2px; border-bottom: 1px dotted #ccc; }
.trow.np, .prow.np { background: #ffffe0; }
.trow .btn.icon, .prow .btn.icon { min-width: 22px; padding: 1px 4px; }
.found .trow { cursor: pointer; }
.found .trow:hover { background: #e8e8ff; }

/* ---------- уровни, аватары, статусы ---------- */
.tier { font-size: 9px; font-weight: bold; padding: 0 4px; border: 1px solid; border-radius: 3px; margin-left: 3px; vertical-align: 1px; white-space: nowrap; }
.tier.gold { color: #7a5a00; background: linear-gradient(#fff2b0, #e8b300); border-color: #a07800; }
.tier.black { color: #fff; background: linear-gradient(#444, #000); border-color: #000; }
.tier-bar { flex: 1; height: 10px; background: #fff; border: 1px solid; border-color: var(--shadow) var(--light) var(--light) var(--shadow); }
.tier-bar i { display: block; height: 100%; background: repeating-linear-gradient(90deg, var(--sel) 0 6px, transparent 6px 8px); }
.av { display: inline-grid; place-items: center; border-radius: 50%; background: #fff; flex: none; }
.av svg { width: 100%; height: 100%; }
.avatars { display: flex; flex-wrap: wrap; gap: 2px; }
.avatars button { width: 28px; height: 28px; padding: 0; background: #fff; border: 1px solid var(--shadow); display: grid; place-items: center; }
.avatars button.on { border: 2px solid var(--sel); background: #ffffe0; }
.legend-line { font-weight: bold; margin: 8px 0 4px; border-top: 1px solid var(--shadow); padding-top: 6px; }

/* магниты и холодильник */
.magnetcard { display: flex; align-items: center; gap: 6px; background: #fff; border: 1px solid; border-color: var(--shadow) var(--light) var(--light) var(--shadow); padding: 3px 4px; margin: 3px 0; }
.magnetcard .mg { flex: none; }
.magnetcard .ti { flex: 1; min-width: 0; }
.magnet-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; padding: 4px; max-height: 210px; overflow: auto; }
.magnet-grid button { padding: 2px; background: #fff; border: 2px solid transparent; display: grid; place-items: center; }
.magnet-grid button:hover { border-color: var(--shadow); }
.magnet-grid button.on { border-color: var(--sel); background: #ffffe0; }
.magnet-grid button.locked { opacity: .45; }
.fridge { display: flex; flex-direction: column; position: relative; flex: none; }
.fridge-top { height: 12px; background: linear-gradient(#f4f4f4, #c8c8c8); border: 2px solid #777; border-bottom: 0; border-radius: 6px 6px 0 0; }
.fridge-door { position: relative; min-height: 180px; background: linear-gradient(135deg, #fbfbfb, #dedede); border: 2px solid #777; display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 24px 14px 10px; align-content: flex-start; box-shadow: inset 0 0 20px rgba(0,0,0,.08); }
.fridge-handle { position: absolute; right: 8px; top: 30px; width: 6px; height: 70px; background: linear-gradient(90deg, #aaa, #eee, #999); border: 1px solid #666; border-radius: 3px; }
.fridge .magnet { position: relative; padding: 0; background: none; border: 0; transform: rotate(var(--r, -3deg)); filter: drop-shadow(1px 2px 1px rgba(0,0,0,.35)); transition: transform .15s; }
.fridge .magnet:nth-child(2n) { --r: 4deg; } .fridge .magnet:nth-child(3n) { --r: -6deg; } .fridge .magnet:nth-child(5n) { --r: 2deg; }
.fridge .magnet:hover { transform: rotate(0) scale(1.08); z-index: 2; }
.fridge .magnet .from { position: absolute; left: 0; right: 0; bottom: -6px; font-size: 8px; background: #ffe14d; border: 1px solid #806a00; border-radius: 3px; padding: 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* досье */
.dossier-head { display: flex; gap: 6px; align-items: center; padding: 4px; background: #efe6c8; border: 1px solid #a08a50; flex: none; }
.dossier-head .who { flex: 1; min-width: 0; }
.dossier-head .eyebrow { font: bold 9px/1 'Courier New', Courier, monospace; letter-spacing: 1px; color: #6a5a30; }
.stamp { font: bold 11px/1 'Courier New', Courier, monospace; letter-spacing: 1px; padding: 3px 6px; border: 2px solid; transform: rotate(-8deg); flex: none; }
.stamp.ok { color: #1f7a2a; border-color: #1f7a2a; } .stamp.no { color: #c00; border-color: #c00; }
.dossier { background: #fdf8e7; border: 1px solid #a08a50; padding: 6px 8px; font: 11px/1.45 'Courier New', Courier, monospace; flex: none; user-select: text; -webkit-user-select: text; }
.dossier p { margin: 0 0 4px; }
.dossier-sec { margin-bottom: 8px; }
.dossier-t { font-weight: bold; text-transform: uppercase; letter-spacing: .5px; border-bottom: 1px dashed #a08a50; margin-bottom: 4px; font-size: 10px; }
.dossier .verdict { background: #fff3c4; padding: 4px 6px; border: 1px dashed #a08a50; font-weight: bold; }

/* ---------- интересы, сообщества, мероприятия, рефералы, аватар ---------- */
.big-emoji { font-size: 20px; width: 24px; text-align: center; }
.ilist { max-height: 320px; overflow: auto; padding: 2px; }
.irow { display: flex; align-items: center; gap: 4px; padding: 3px 4px; border-bottom: 1px dotted #ccc; cursor: pointer; }
.irow:hover { background: #e8e8ff; }
.irow.mine b { color: var(--link); }
.plist { max-height: 160px; overflow: auto; padding: 2px; }
.prow-person { cursor: pointer; padding-left: 4px; }
.crow { display: flex; align-items: center; gap: 6px; padding: 4px 0; border-bottom: 1px dotted var(--shadow); }
.crow .ti { flex: 1; min-width: 0; }
.hist div { padding: 2px 0; }
.evcard { background: #fff; border: 1px solid; border-color: var(--shadow) var(--light) var(--light) var(--shadow); padding: 4px 6px; margin: 3px 0; }
.evcard.past { opacity: .7; }
.ev-h { display: flex; gap: 6px; align-items: flex-start; }
.ev-ico { font-size: 18px; flex: none; }
.ev-h .ti { flex: 1; min-width: 0; }
.ev-btns { flex-wrap: wrap; margin-top: 4px; }
.ev-btns .btn { min-width: 0; padding: 2px 8px; }
.chain { display: flex; flex-direction: column; gap: 0; align-items: stretch; }
.chain-l { font-size: 9px; text-transform: uppercase; letter-spacing: 1px; color: var(--shadow); margin: 6px 0 2px; text-align: center; }
.block { background: #0a1a2a; color: #cfe3ff; border: 1px solid #3a6ea5; padding: 3px 6px; margin: 0 0 8px; position: relative; box-shadow: 2px 2px 0 rgba(0,0,0,.4); }
.block::after { content: ''; position: absolute; left: 50%; bottom: -8px; width: 2px; height: 8px; background: #3a6ea5; }
.block:last-child::after { display: none; }
.block.lv1 { margin-left: 14px; border-color: #3cb44a; } .block.lv2 { margin-left: 28px; border-color: #e8b300; } .block.lv3 { margin-left: 42px; border-color: #d8232a; }
.block .bh { display: flex; gap: 6px; font-size: 9px; color: #8fb3e0; }
.block .bb { display: flex; align-items: center; gap: 6px; }
.block .bb .link { color: #fff; }
.block .muted { color: #8fb3e0; }
.mono { font-family: 'Courier New', Courier, monospace; }
.ledger { font-size: 10px; padding: 3px 4px; border-left: 3px solid #3a6ea5; background: #f4f8ff; margin-bottom: 3px; }
.twin-ico { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; box-shadow: 0 0 0 1px #3a6ea5, 0 0 0 2px #fff; }

/* ---------- UX: панель с подписями, подсказки, стена, холодильник ---------- */
.mode-sel { height: 22px; font-size: 11px; width: 100%; }
.toolbar.tb2 { gap: 2px; }
.tb-btn { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; padding: 2px 0; min-height: 30px; line-height: 1; }
.tb-btn i { font-style: normal; font-size: 13px; }
.tb-btn span { font-size: 8px; margin-top: 1px; white-space: nowrap; }
.tips .tip { padding: 4px 0; border-bottom: 1px dotted var(--shadow); line-height: 1.4; }
.tips .tip:last-child { border: 0; }
.composer { background: #e8e4dc; border: 1px solid; border-color: var(--shadow) var(--light) var(--light) var(--shadow); padding: 4px 6px 6px; flex: none; }
.composer .legend-line { margin: 0 0 4px; border: 0; padding: 0; }
.composer textarea { margin-bottom: 4px; }
.replies { margin: 4px 0 0 10px; border-left: 2px solid #d8d8d8; padding-left: 6px; }
.reply { font-size: 10px; padding: 2px 0; display: flex; gap: 4px; align-items: flex-start; flex-wrap: wrap; }
.reply .rt { flex-basis: 100%; }
.reply-add .field { height: 19px; font-size: 10px; margin-top: 2px; }
.post .wall-actions .btn { padding: 2px 6px; }
/* анимированные смайлы */
.sm .an-glass-l { animation: clink-l 1.2s ease-in-out infinite; }
.sm .an-glass-r { animation: clink-r 1.2s ease-in-out infinite; }
.sm .an-spark, .smiles .an-spark { animation: spark 1.2s ease-in-out infinite; transform-origin: 10px 3px; }
.sm .an-heart { animation: heartpop 1.6s ease-in-out infinite; }
.smiles .an-glass-l { animation: clink-l 1.2s ease-in-out infinite; } .smiles .an-glass-r { animation: clink-r 1.2s ease-in-out infinite; } .smiles .an-heart { animation: heartpop 1.6s ease-in-out infinite; }
@keyframes clink-l { 0%, 100% { transform: rotate(-14deg); } 45%, 55% { transform: rotate(6deg); } }
@keyframes clink-r { 0%, 100% { transform: rotate(14deg); } 45%, 55% { transform: rotate(-6deg); } }
@keyframes spark { 0%, 35%, 70%, 100% { opacity: 0; transform: scale(.3); } 50% { opacity: 1; transform: scale(1.4); } }
@keyframes heartpop { 0% { transform: scale(.2); opacity: 0; } 30% { transform: scale(1.15); opacity: 1; } 45% { transform: scale(1); } 60% { transform: scale(1.1); } 75%, 100% { transform: scale(1); opacity: 1; } }
/* холодильник с дверцей */
.food-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; padding: 4px; max-height: 240px; overflow: auto; }
.food-grid button, .food-pick { padding: 2px; background: #fff; border: 2px solid transparent; display: flex; flex-direction: column; align-items: center; line-height: 1.05; }
.food-grid button i, .food-pick i { font-style: normal; font-size: 20px; }
.food-grid button span { font-size: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 48px; }
.food-grid button.on, .food-pick.on { border-color: var(--sel); background: #ffffe0; }
.food-ico { font-size: 28px; width: 44px; text-align: center; }

/* ---------- винил: прогресс, вкладки, киберпанк ---------- */
.v-top { flex: none; }
.prog { height: 7px; background: #fff; border: 1px solid; border-color: var(--shadow) var(--light) var(--light) var(--shadow); margin: 4px 0 2px; cursor: pointer; }
.prog i { display: block; height: 100%; background: var(--sel); width: 0; transition: width .3s linear; }
.embed-box { background: #000; padding: 2px; flex: none; }
.embed-box iframe { width: 100%; border: 0; display: block; }
.btn.icon.on { background: #ffe3ea; color: #a03050; }
.vinyl.cyber { background: #07040f; color: #c8f7ff; padding: 6px; border: 1px solid #ff2bd6; box-shadow: 0 0 12px #ff2bd6, inset 0 0 20px rgba(0,240,255,.15); }
.vinyl.cyber .neon-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(0,240,255,.12) 1px, transparent 1px), linear-gradient(90deg, rgba(0,240,255,.12) 1px, transparent 1px); background-size: 18px 18px; pointer-events: none; transform: perspective(200px) rotateX(55deg) translateY(40px); }
.vinyl.cyber .np-box, .vinyl.cyber .v-list, .vinyl.cyber .prog { background: #0e0820; color: #c8f7ff; border-color: #ff2bd6 #00f0ff #00f0ff #ff2bd6; box-shadow: none; }
.vinyl.cyber .prog i { background: linear-gradient(90deg, #ff2bd6, #00f0ff); }
.vinyl.cyber .muted, .vinyl.cyber .hint { color: #8fd3e8; }
.vinyl.cyber .trow { border-bottom-color: #2a1a4a; } .vinyl.cyber .trow.np, .vinyl.cyber .prow.np { background: #2a0a3a; }
.vinyl.cyber .btn { background: #1a0a2e; color: #c8f7ff; border-color: #ff2bd6 #00f0ff #00f0ff #ff2bd6; box-shadow: none; }
.vinyl.cyber .btn.primary { outline-color: #ffe14d; }
.vinyl.cyber .tabs button { background: #1a0a2e; color: #c8f7ff; border-color: #ff2bd6 #00f0ff transparent #ff2bd6; }
.vinyl.cyber .tabpanel { border-color: #ff2bd6 #00f0ff #00f0ff #ff2bd6; box-shadow: none; }
.vinyl.cyber .field { background: #0e0820; color: #c8f7ff; border-color: #ff2bd6 #00f0ff #00f0ff #ff2bd6; box-shadow: none; }
.vinyl.cyber .cgroup { color: #ffe14d; }
.vinyl.cyber .link { color: #00f0ff; }
.vinyl.cyber .v-top .hint { color: #ff2bd6; text-transform: uppercase; letter-spacing: 1px; font-weight: bold; text-shadow: 0 0 6px #ff2bd6; }
.v-tabs button { padding: 2px 6px 3px; }

/* ---------- кино ---------- */
.cinema, .watch { display: flex; flex-direction: column; gap: 4px; min-height: 0; flex: 1; }
.cinema .tabpanel { flex: 1; min-height: 0; overflow: auto; }
.c-tabs button { padding: 2px 6px 3px; }
.poster { display: block; border: 1px solid #000; box-shadow: 1px 1px 0 var(--shadow); flex: none; }
.mcard { display: flex; gap: 6px; padding: 5px 4px; border-bottom: 1px solid var(--shadow); align-items: flex-start; }
.mcard .mi { flex: 1; min-width: 0; }
.mposter { position: relative; cursor: pointer; flex: none; }
.mposter .playo { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: rgba(0,0,0,.55); color: #fff; border-radius: 50%; width: 22px; height: 22px; line-height: 22px; text-align: center; font-size: 11px; opacity: 0; transition: opacity .15s; pointer-events: none; }
.mposter:hover .playo { opacity: 1; }
.mdesc { margin: 2px 0; }
.mact { margin-top: 3px; flex-wrap: wrap; }
.cont { color: #0a6a2a; }
.recs { display: flex; gap: 4px; overflow-x: auto; padding: 2px 2px 4px; }
.rec { flex: none; width: 120px; display: flex; gap: 4px; align-items: flex-start; cursor: pointer; padding: 3px; border: 1px solid var(--shadow); background: #fffbe6; }
.rec:hover { background: #fff3b0; }
.rec .ti { min-width: 0; } .rec .ti b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.moviecard { display: flex; align-items: center; gap: 5px; background: #fff; border: 1px solid; border-color: var(--shadow) var(--light) var(--light) var(--shadow); padding: 3px 4px; margin: 2px 0; max-width: 320px; cursor: pointer; }
.moviecard .ti { flex: 1; min-width: 0; }
.moviecard .ti b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.watch .screen { background: #000; aspect-ratio: 16 / 9; width: 100%; position: relative; border: 2px solid; border-color: var(--shadow) var(--light) var(--light) var(--shadow); flex: none; overflow: hidden; }
.watch .screen video, .watch .screen iframe { width: 100%; height: 100%; border: 0; display: block; background: #000; }
.watch .screen .empty-note { color: #ddd; padding: 20px 8px; }
.watch .screen .err { position: absolute; left: 0; right: 0; bottom: 0; margin: 0; }
.watch .screen .err a { color: #ffd; }
.ep-list { display: flex; flex-wrap: wrap; gap: 3px; }
.ep-list .btn { padding: 2px 6px; }
.btn.down { border-color: var(--shadow) var(--light) var(--light) var(--shadow); background: #d4d0c8; box-shadow: inset 1px 1px 0 var(--dark); }
label.btn { cursor: pointer; }
.err { background: #ffe0e0; color: #900; border: 1px solid #c66; padding: 3px 6px; margin: 2px 0; }

/* ---------- обучение аватара ---------- */
.twinwin { display: flex; flex-direction: column; gap: 4px; flex: 1; min-height: 0; }
.twinwin .tabpanel { flex: 1; min-height: 0; overflow: auto; }
.tw-tabs button { padding: 2px 6px 3px; }
.tw-how { margin: 2px 0 4px 16px; padding: 0; } .tw-how li { margin: 2px 0; }
.tl { padding: 3px 2px; border-bottom: 1px dotted var(--shadow); }
.tl .row { margin-top: 2px; }


/* ---------- проигрыватель: SVG-вертушка ---------- */
.tt { --tt-bg: #5a4634; --tt-edge: #2e2217; --tt-platter: #202020; --tt-strobe: #777; --tt-record: #161616; --tt-groove: #3a3a3a; --tt-labelring: #111; --tt-labeltext: #fff; --tt-arm: #d8d8d8; --tt-weight: #555; --tt-head: #333; --tt-needle: #eee; --tt-pivot: #777; --tt-btn: #c9b89a; --tt-text: #e8dcc4;
  position: relative; flex: none; border: 2px solid #3a2c20; box-shadow: inset 0 0 0 2px #7a6248, 2px 2px 0 rgba(0,0,0,.3); background: var(--tt-bg); overflow: hidden; }
.ttsvg { display: block; width: 100%; height: auto; max-height: 190px; }
.tt-record { transform-origin: 84px 80px; transform-box: view-box; will-change: transform; }
.tt-arm { transform-origin: 188px 26px; transform-box: view-box; transition: transform 1.1s cubic-bezier(.45,.05,.2,1); }
.tt-armshadow { transform-origin: 188px 26px; transform-box: view-box; transition: transform 1.1s cubic-bezier(.45,.05,.2,1), opacity .4s; transform: translate(3px, 4px) rotate(-9deg); opacity: .5; }
.tt.lifted .tt-armshadow { opacity: .35; }
.vinyl.cyber .tt { --tt-bg: #07040f; --tt-edge: #ff2bd6; --tt-platter: #000; --tt-strobe: #00f0ff; --tt-record: #0a0a1a; --tt-groove: #2a1a4a; --tt-labelring: #fff; --tt-labeltext: #000; --tt-arm: #00f0ff; --tt-weight: #1a1a2e; --tt-head: #1a1a2e; --tt-needle: #ffe14d; --tt-pivot: #1a1a2e; --tt-btn: #1a0a2e; --tt-text: #00f0ff; border-color: #00f0ff; box-shadow: inset 0 0 0 2px #ff2bd6, 0 0 18px rgba(0,240,255,.5); }
.vinyl.cyber .tt-record > circle:first-child { filter: drop-shadow(0 0 6px #ff2bd6); }
.vinyl.cyber .tt-arm { filter: drop-shadow(0 0 4px #00f0ff); }
.cv { display: inline-flex; flex: none; } .cv .cover { display: block; box-shadow: 1px 1px 0 rgba(0,0,0,.4); cursor: pointer; }
.cv.big .cover { box-shadow: 3px 3px 0 rgba(0,0,0,.35); }
.trow .cv { margin: 0 2px; }

/* ---------- радио ---------- */
.station { display: flex; align-items: center; gap: 6px; padding: 5px 6px; margin: 3px 0; border: 1px solid #333; background: linear-gradient(135deg, var(--c1), var(--c2)); color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.4); }
.station .ti { flex: 1; min-width: 0; } .station .muted { color: rgba(255,255,255,.85); }
.station.on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--c1); }
.st-dial { width: 40px; height: 40px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff, #bbb 60%, #666); border: 2px solid #333; display: grid; place-items: center; flex: none; box-shadow: inset 0 0 6px rgba(0,0,0,.4); }
.st-ico { font-size: 18px; }
.st-slogan { font-style: italic; }
.onair { color: #ffe14d; font-weight: bold; animation: onair 1.4s steps(2) infinite; }
@keyframes onair { 50% { opacity: .55; } }
.np-box.radio { background: linear-gradient(90deg, var(--c1), #fff 55%); }
.onair-line { font-weight: bold; margin-bottom: 2px; }
.vinyl.cyber .station { border-color: #00f0ff; }

/* ---------- страница трека ---------- */
.trackpage { display: flex; flex-direction: column; gap: 5px; overflow: auto; flex: 1; min-height: 0; }
.tp-head { display: flex; gap: 8px; align-items: flex-start; }
.tp-info { flex: 1; min-width: 0; } .tp-title { font-size: 14px; }
.tp-actions { margin-top: 4px; flex-wrap: wrap; }
.nftpass { background: linear-gradient(135deg, #fff8dc, #f4e6b8); border: 1px solid #a08a40; padding: 4px 6px; box-shadow: 2px 2px 0 rgba(0,0,0,.2); }
.np-row { display: flex; gap: 6px; align-items: baseline; padding: 1px 0; flex-wrap: wrap; }
.np-k { color: #7a6a30; width: 84px; flex: none; font-size: 10px; text-transform: uppercase; letter-spacing: .3px; }
.mono { font-family: 'Courier New', monospace; }
.tp-story { background: #fff; border: 1px solid; border-color: var(--shadow) var(--light) var(--light) var(--shadow); padding: 4px 6px; line-height: 1.3; }
.tp-log { font-size: 10px; } .tp-logline { padding: 1px 0 1px 8px; border-left: 2px solid var(--sel); margin: 1px 0; }

/* ---------- люди ---------- */
.people { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.people .tabpanel { flex: 1; min-height: 0; overflow: auto; }
.pp-tabs button { padding: 2px 6px 3px; }
.pcard { border: 1px solid; border-color: var(--light) var(--shadow) var(--shadow) var(--light); background: #fff; padding: 5px 6px; margin: 4px 2px; }
.pcard.big { background: linear-gradient(#fffdf5, #fff); box-shadow: 2px 2px 0 rgba(0,0,0,.2); }
.pc-head { display: flex; gap: 6px; align-items: flex-start; }
.pc-head .who { flex: 1; min-width: 0; }
.pct { font-weight: bold; font-size: 14px; padding: 2px 6px; border: 1px solid var(--shadow); background: #eee; flex: none; }
.pct.hi { background: #d9f7d0; border-color: #2a8a2a; color: #1a5a1a; } .pct.mid { background: #fff3b0; border-color: #a08000; }
.pc-dossier { margin-top: 4px; padding: 3px 6px; background: #fffbe6; border-left: 3px solid #e8b300; font-size: 10px; line-height: 1.3; }
.pc-verdict { font-style: italic; margin-top: 2px; }
.pc-actions { margin-top: 4px; flex-wrap: wrap; }

/* ---------- холодильник «Холодок-99» ---------- */
.fridge-stage { height: 330px; perspective: 900px; flex: none; margin: 6px 0 2px; display: flex; justify-content: center; }
.fridge3 { position: relative; width: min(100%, 300px); height: 100%; transform-style: preserve-3d; }
.fr-cabinet { position: absolute; inset: 0 0 10px; background: linear-gradient(180deg, #f3ead6, #e3d8bd); border: 3px solid #8a7f66; border-radius: 16px 16px 6px 6px; box-shadow: inset 0 0 0 3px #fbf6ea, 4px 6px 0 rgba(0,0,0,.25); overflow: hidden; }
.fr-gasket { position: absolute; inset: 8px; border: 4px solid #2b2b2b; border-radius: 10px; pointer-events: none; opacity: 0; transition: opacity .3s; }
.fridge3.open .fr-gasket { opacity: .8; }
.fr-light { position: absolute; left: 50%; top: 12px; width: 70px; height: 7px; margin-left: -35px; background: #fff9c4; border-radius: 3px; box-shadow: 0 0 14px 4px #fff9c4; opacity: 0; transition: opacity .3s .3s; z-index: 2; }
.fridge3.open .fr-light { opacity: 1; }
.fr-inside { position: absolute; inset: 14px 12px 12px; display: flex; flex-direction: column; gap: 4px; background: linear-gradient(#eef4f8, #dde6ec); border-radius: 8px; padding: 4px; }
.shelf { background: linear-gradient(rgba(255,255,255,.85), rgba(220,228,235,.9)); border-bottom: 4px solid #9fb0bf; box-shadow: 0 4px 3px -2px rgba(0,0,0,.25); padding: 2px 4px 3px; min-height: 62px; flex: 1; overflow: hidden; }
.shelf.freezer, .shelf.drawer { min-height: 40px; flex: .6; }
.shelf.freezer { background: linear-gradient(#f4fbff, #d8ecf7); border-bottom-color: #b9d4e6; border-top: 1px dashed #b9d4e6; }
.shelf.drawer { background: rgba(190, 220, 200, .55); border: 2px solid #8fb09a; border-radius: 4px; box-shadow: inset 0 6px 8px rgba(0,0,0,.08); }
.shelf-l { font-size: 8px; color: #607080; display: block; margin-bottom: 1px; text-transform: uppercase; letter-spacing: .3px; }
.shelf-items { display: flex; gap: 3px; flex-wrap: wrap; align-items: flex-end; }
.food { width: 50px; padding: 0; background: none; border: 0; display: flex; flex-direction: column; align-items: center; line-height: 1.05; position: relative; filter: drop-shadow(1px 2px 1px rgba(0,0,0,.3)); }
.food svg { display: block; }
.food span { font-size: 7px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 50px; }
.food small { font-size: 6.5px; color: #a06000; }
.food em { position: absolute; top: 0; right: -2px; font-size: 6.5px; background: #ffe14d; border: 1px solid #806a00; border-radius: 3px; padding: 0 2px; font-style: normal; }
.food:hover { transform: translateY(-2px); }
.fr-door { position: absolute; inset: 0 0 10px; background: linear-gradient(100deg, #f7f0dd 0%, #efe5cc 60%, #d9cdaf 100%); border: 3px solid #8a7f66; border-radius: 16px 16px 6px 6px; box-shadow: inset 0 0 0 3px #fbf6ea, inset 0 -30px 40px rgba(0,0,0,.05); transform-origin: left center; transition: transform .9s cubic-bezier(.4,0,.2,1); cursor: pointer; backface-visibility: hidden; display: flex; flex-direction: column; }
.fridge3.open .fr-door { transform: rotateY(-112deg); }
.fr-badge { position: absolute; left: 14px; top: 10px; background: linear-gradient(#d41b1b, #8f0f0f); color: #fff; border: 2px solid #ffd27a; border-radius: 50% / 60%; padding: 3px 10px 4px; text-align: center; line-height: 1; box-shadow: 1px 1px 0 rgba(0,0,0,.4); }
.fr-badge span { font: italic bold 11px Georgia, serif; letter-spacing: .5px; display: block; }
.fr-badge small { font-size: 6px; display: block; opacity: .85; }
.fr-magnets { flex: 1; display: flex; flex-wrap: wrap; gap: 8px; padding: 42px 30px 10px 14px; align-content: flex-start; }
.fr-magnets .magnet { position: relative; padding: 0; background: none; border: 0; transform: rotate(var(--r, -4deg)); filter: drop-shadow(2px 3px 2px rgba(0,0,0,.4)); transition: transform .15s; }
.fr-magnets .magnet:nth-child(2n) { --r: 5deg; } .fr-magnets .magnet:nth-child(3n) { --r: -7deg; } .fr-magnets .magnet:nth-child(5n) { --r: 3deg; }
.fr-magnets .magnet:hover { transform: rotate(0) scale(1.1); z-index: 2; }
.fr-magnets .magnet .from { position: absolute; left: 0; right: 0; bottom: -7px; font-size: 7px; background: #ffe14d; border: 1px solid #806a00; border-radius: 3px; padding: 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fr-handle { position: absolute; right: 10px; top: 34px; width: 12px; height: 110px; background: linear-gradient(90deg, #8f8f8f, #f4f4f4 45%, #9a9a9a); border: 1px solid #555; border-radius: 6px; box-shadow: 2px 2px 3px rgba(0,0,0,.35); }
.fr-handle::before, .fr-handle::after { content: ''; position: absolute; left: 1px; width: 8px; height: 6px; background: #777; border: 1px solid #444; border-radius: 2px; }
.fr-handle::before { top: -7px; } .fr-handle::after { bottom: -7px; }
.fr-handle i { position: absolute; left: 3px; top: 10px; bottom: 10px; width: 2px; background: rgba(255,255,255,.7); border-radius: 1px; }
.fr-plate { position: absolute; left: 14px; right: 40px; bottom: 10px; font-size: 8px; color: #6b6049; text-align: center; border: 1px solid #b7ab8e; background: rgba(255,255,255,.5); padding: 2px; border-radius: 3px; letter-spacing: .3px; }
.fr-feet { position: absolute; left: 0; right: 0; bottom: 0; height: 10px; display: flex; justify-content: space-between; padding: 0 22px; }
.fr-feet i { width: 22px; height: 10px; background: linear-gradient(#444, #111); border-radius: 0 0 4px 4px; }
.fr-hint { padding: 6px; }

/* ---------- диалоги ---------- */
.overlay { position: absolute; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(0,0,0,.15); }
.dialog .body { padding: 10px 10px 8px; }
.dialog .btns { display: flex; justify-content: flex-end; gap: 6px; margin-top: 10px; }
.status-list button { display: flex; align-items: center; gap: 6px; width: 100%; text-align: left; background: none; border: 1px solid transparent; padding: 2px 6px; }
.status-list button:hover { background: var(--sel); color: #fff; }
.found { max-height: 150px; overflow: auto; margin-top: 6px; }
.found .citem { padding-left: 4px; }

/* всплывающее «о-оу» уведомление */
.toast {
  position: absolute; right: 8px; bottom: 8px; z-index: 50; width: 220px;
  background: #ffffe1; border: 1px solid #000; padding: 5px 6px; display: flex; gap: 6px; align-items: center;
  box-shadow: 2px 2px 0 rgba(0,0,0,.35); animation: winpop .15s steps(3) both;
}
.toast b { display: block; }
.toast .t { flex: 1; overflow: hidden; }
.toast .t div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- телефон ---------- */
@media (max-width: 719px), (pointer: coarse) and (max-width: 900px) {
  :root { --fs: 12px; --row: 24px; }
  /* высота = видимая часть экрана: когда выезжает клавиатура, поле ввода остаётся над ней */
  .desktop { bottom: auto; height: var(--vvh, 100%); }
  .wins { padding: var(--safe-t) 0 0; gap: 0; align-items: stretch; }
  .win.contacts, .win.chat { width: 100%; height: auto; flex: 1; margin: 0; box-shadow: none; border-width: 0 0 0 0; padding: 3px 3px calc(3px + var(--safe-b)); max-height: none; }
  .win.contacts { display: flex; }
  .win.chat { display: none; position: absolute; inset: var(--safe-t) 0 0 0; }
  .desktop.mode-chat .win.chat { display: flex; }
  .desktop.mode-chat .win.contacts { display: none; }
  .win.aux { display: none; position: absolute; inset: var(--safe-t) 0 0 0; width: 100%; height: auto; margin: 0; box-shadow: none; border-width: 0; padding: 3px 3px calc(3px + var(--safe-b)); max-height: none; }
  .desktop.mode-aux .win.aux { display: flex; }
  .desktop.mode-aux .win.contacts, .desktop.mode-aux .win.chat { display: none; }
  .tbtn.close-aux { display: none; }
  .modes button { font-size: 11px; min-height: 26px; }
  .magnet-grid { grid-template-columns: repeat(4, 1fr); max-height: 260px; }
  .food-grid { grid-template-columns: repeat(4, 1fr); }
  .tb-btn span { font-size: 9px; }
  .fridge-stage { height: 360px; }
  .food { width: 54px; } .food span { font-size: 8px; max-width: 52px; }
  .mode-sel { height: 28px; font-size: 13px; }
  .dossier { font-size: 12px; }
  .chip { font-size: 11px; padding: 2px 8px; }
  .chips.small .chip { font-size: 10px; }
  .v-list { max-height: none; }
  .wall-posts { min-height: 200px; }
  .tbtn.back { display: inline-block; width: 18px; }
  .tbtn.close-chat { display: none; }
  .titlebar { height: 24px; }
  .tbtn { width: 20px; height: 18px; font-size: 11px; line-height: 16px; }
  .btn { min-height: 28px; padding: 3px 12px; }
  .field { height: 28px; font-size: 14px; }
  textarea.field { font-size: 14px; }
  .compose textarea { height: 56px; }
  .menubar button { padding: 3px 8px; }
  .menu button { padding: 6px 18px 6px 10px; }
  .status-btn { height: 28px; }
  .smiles { grid-template-columns: repeat(6, 36px); bottom: 100px; }
  .smiles button { width: 36px; height: 36px; }
  .smiles button svg { width: 26px; height: 26px; }
  .sm { width: 20px; height: 20px; vertical-align: -5px; }
  .sm svg { width: 20px; height: 20px; }
  .win.dialog { width: min(320px, 92vw); }
  .citem { height: var(--row); }
  .statusbar .cell { height: 22px; }
}
