/* 💬 Чат с Директором в Офисе (#1073). «Тёплая сцена»: Арман справа — золото, Директор слева — крем. ≥14px, кнопки ≥44px. */
.oc { position: absolute; inset: 0; z-index: 7; display: flex; flex-direction: column; background: #1b0c10; color: #fbf1de; }
.oc[hidden] { display: none; }
.oc-head { display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 4px; border-bottom: 1.5px solid rgba(242,196,109,.26); background: #241114; flex: none; }
.oc-back { width: 44px; height: 44px; border: 0; background: transparent; color: #f2c46d; font-size: 30px; line-height: 1; }
.oc-ava { width: 36px; height: 36px; border-radius: 50%; background: rgba(224,164,58,.18); border: 1.5px solid rgba(242,196,109,.5); display: grid; place-items: center; overflow: hidden; flex: none; font-size: 18px; }
.oc-ava canvas { width: 24px; height: 48px; margin-top: 14px; image-rendering: pixelated; }
.oc-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.oc-who b { font-size: 17px; font-weight: 800; }
.oc-status { font-size: 14px; color: #cbb89c; }
.oc-tasks { min-height: 44px; padding: 0 12px; border-radius: 12px; border: 1.5px solid rgba(242,196,109,.5); background: rgba(40,19,21,.9); color: #f2c46d; font-size: 14px; font-weight: 700; white-space: nowrap; font-family: inherit; }
.oc-list { flex: 1; min-height: 0; margin-bottom: var(--oc-ch, 92px); overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 10px 12px 12px; display: flex; flex-direction: column; }
#ocItems { display: flex; flex-direction: column; }
.oc-older { align-self: center; min-height: 44px; padding: 0 16px; margin-bottom: 8px; border-radius: 14px; border: 1.5px solid rgba(242,196,109,.5); background: transparent; color: #f2c46d; font-size: 14px; font-weight: 700; }
.oc-empty { margin: auto; padding: 24px 8px; text-align: center; font-size: 17px; line-height: 1.4; color: #e3d3ba; }
.oc-day { align-self: center; margin: 10px 0 6px; padding: 3px 12px; border-radius: 999px; background: rgba(255,255,255,.06); color: #cbb89c; font-size: 14px; }
.oc-msg { position: relative; max-width: 84%; margin: 4px 0; padding: 10px 12px 20px; border-radius: 16px; font-size: 16px; line-height: 1.4; overflow-wrap: anywhere; }
.oc-msg p { margin: 0; }
.oc-msg a { color: inherit; }
.oc-msg.is-me { align-self: flex-end; background: rgba(242,196,109,.18); border: 1.5px solid rgba(242,196,109,.45); border-bottom-right-radius: 5px; }
.oc-msg.is-dir { align-self: flex-start; background: #fbf1de; color: #2a1a12; border-bottom-left-radius: 5px; }
.oc-msg.is-card { max-width: 92%; background: #241114; color: #fbf1de; border: 1.5px solid rgba(242,196,109,.45); padding-bottom: 10px; }
.oc-meta { position: absolute; right: 10px; bottom: 4px; display: inline-flex; align-items: center; gap: 4px; font-size: 14px; color: #8a8179; }
.oc-msg.is-dir .oc-meta { color: #8a7a62; }
.oc-tick { font-style: normal; font-size: 14px; }
.oc-tick.is-read { color: #4cc08a; }
.oc-task { display: inline-block; margin-top: 4px; font-size: 14px; color: #cbb89c; }
.oc-msg.is-dir .oc-task { color: #8a7a62; }
.oc-img { display: block; max-width: 100%; max-height: 240px; margin: 0 0 6px; border-radius: 10px; cursor: zoom-in; }
.oc-imgs { display: grid; gap: 4px; margin: 0 0 6px; }
.oc-imgs.n1 { grid-template-columns: 1fr; } .oc-imgs.n2, .oc-imgs.n3, .oc-imgs.n4 { grid-template-columns: 1fr 1fr; }
.oc-imgs .oc-img { margin: 0; max-height: 160px; width: 100%; object-fit: cover; }
.oc-card.is-info .oc-card-tag { background: rgba(203,184,156,.2); color: #e3d3ba; }
.oc-openbtn { flex: 1 1 100%; }
.oc-video { display: block; width: 100%; max-height: 240px; margin: 0 0 6px; border-radius: 10px; background: #000; }
.oc-voice { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 16px; }
.oc-voice audio { width: 200px; max-width: 100%; height: 40px; }
.oc-link { display: block; margin-top: 8px; border-radius: 12px; overflow: hidden; background: rgba(0,0,0,.18); border: 1px solid rgba(255,255,255,.12); text-decoration: none; }
.oc-msg.is-dir .oc-link { background: rgba(42,26,18,.08); border-color: rgba(42,26,18,.2); }
.oc-link-img { display: block; width: 100%; max-height: 160px; object-fit: cover; }
.oc-link-host { display: inline-block; padding: 8px 10px 0; font-size: 14px; opacity: .85; }
.oc-link-open { display: block; min-height: 44px; line-height: 44px; padding: 0 10px; font-size: 16px; font-weight: 700; color: #f2c46d; }
.oc-msg.is-dir .oc-link-open { color: #a0621a; }
.oc-card { font-size: 16px; }
.oc-card-tag { display: inline-block; margin-bottom: 6px; padding: 2px 8px; border-radius: 6px; background: rgba(242,196,109,.2); color: #f2c46d; font-size: 14px; font-weight: 700; }
.oc-card .of-btns { margin-top: 10px; }
.oc-answered { margin: 10px 0 0; font-size: 14px; font-weight: 700; color: #4cc08a; }
.oc-typing { align-self: flex-start; margin: 6px 0; padding: 10px 12px; border-radius: 16px; border-bottom-left-radius: 5px; background: #fbf1de; color: #6a5a42; font-size: 14px; }
.oc-typing span { display: inline-block; width: 6px; height: 6px; margin-right: 3px; border-radius: 50%; background: #8a7a62; animation: ocDot 1.2s infinite ease-in-out; }
.oc-typing span:nth-child(2) { animation-delay: .2s; } .oc-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes ocDot { 0%, 80%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-4px); opacity: 1; } }
.oc-compose { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; box-sizing: border-box; flex: none; padding: 6px 12px calc(6px + env(safe-area-inset-bottom, 0px)); background: #1b0c10; border-top: 1.5px solid rgba(242,196,109,.26); }
.oc-row { display: flex; align-items: flex-end; gap: 6px; }
.oc-ta { flex: 1 1 auto; min-width: 0; box-sizing: border-box; height: 44px; min-height: 44px; max-height: 120px; padding: 11px 12px; border-radius: 12px; border: 1.5px solid rgba(242,196,109,.5); background: #140a0c; color: #fbf1de; font-size: 16px; line-height: 1.25; font-family: inherit; resize: none; overflow-y: auto; }
.oc-ib { width: 44px; height: 44px; flex: none; border-radius: 12px; border: 1.5px solid rgba(242,196,109,.5); background: rgba(40,19,21,.9); font-size: 20px; line-height: 1; color: #f2c46d; }
.oc-send { background: linear-gradient(#f6d58b, #e0a43a); color: #2a1a12; border: 0; }
.oc-send:disabled { opacity: .55; }
.oc-att { display: block; margin: 6px 2px 0; font-size: 14px; color: #cbb89c; overflow-wrap: anywhere; }
.oc-att[hidden] { display: none; }
.oc-rec { display: flex; align-items: center; gap: 10px; margin: 8px 0 0; font-size: 16px; color: #fbf1de; }
.oc-rec .of-btn { flex: 1 1 auto; min-height: 44px; }
.oc-rec-dot { width: 12px; height: 12px; border-radius: 50%; background: #ff9d8f; animation: ocBlink 1s ease-in-out infinite; flex: none; }
@keyframes ocBlink { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
.oc-hint { margin: 6px 2px 0; font-size: 14px; color: #8a8179; }
.oc-full { position: absolute; inset: 0; z-index: 9; background: rgba(0,0,0,.92); display: grid; place-items: center; }
.oc-full[hidden] { display: none; }
.oc-full img { max-width: 100%; max-height: 100%; }
.oc-full-x { position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; border-radius: 22px; border: 0; background: rgba(255,255,255,.15); color: #fff; font-size: 20px; }
/* кнопка 💬 в шапке Офиса */
.of-chat { position: relative; min-width: 44px; min-height: 44px; border-radius: 22px; border: 1.5px solid rgba(242,196,109,.5); background: rgba(40,19,21,.9); color: #f2c46d; font-size: 18px; }
.of-chat-badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #ff9d8f; color: #3a100a; font-size: 14px; font-weight: 800; line-height: 18px; text-align: center; }
.of-chat-badge[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .oc-typing span, .oc-rec-dot { animation: none; } }
.oc-ta::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* #1195: при вводе чат на всю видимую область (над клавиатурой), поле ввода прибито внизу; «‹» = убрать клавиатуру */
.o5-chat .oc.oc-kb { position: fixed; left: 0; right: 0; bottom: auto; z-index: 60; }
.o5-chat .oc.oc-kb .oc-back { display: block; }
.o5-chat .oc.oc-kb .oc-compose { padding-bottom: 6px; }

/* #1405b: карточки Диспетчера — свёрнутые строки сверху (одна раскрыта за раз) */
.oc-cards { flex: none; max-height: 46%; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 6px 12px; border-bottom: 1.5px solid rgba(242,196,109,.26); background: #1f0f12; display: flex; flex-direction: column; gap: 4px; }
.oc-cards[hidden] { display: none; }
.oc-crow { border-radius: 12px; border: 1.5px solid rgba(242,196,109,.25); background: #241114; }
.oc-crow.is-wait { border-color: rgba(242,196,109,.7); background: #3a2410; }
.oc-crow.is-open { border-color: #f2c46d; }
.oc-chead { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 48px; padding: 0 12px; border: 0; background: transparent; color: #fbf1de; font-weight: 600; font-size: 15px; line-height: 1.25; font-family: inherit; text-align: left; }
.oc-crow.is-done .oc-chead { color: #a89d90; }
.oc-cdot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: #e0a43a; box-shadow: 0 0 0 3px rgba(224,164,58,.25); }
.oc-cnum { flex: none; color: #f2c46d; font-size: 14px; }
.oc-crow.is-done .oc-cnum { color: #8a8179; }
.oc-ctitle { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oc-res { flex: none; font-size: 16px; }
.oc-chev { flex: none; color: #f2c46d; font-size: 20px; line-height: 1; }
.oc-cbody { padding: 0 12px 12px; }
.oc-cbody .oc-card { font-size: 16px; }
.oc-oldbtn { min-height: 44px; border-radius: 12px; border: 1.5px dashed rgba(242,196,109,.4); background: transparent; color: #cbb89c; font-size: 14px; font-weight: 700; font-family: inherit; }
.oc-cbody .oc-card-tag { display: none; }

/* #1408: ответили — строка плавно уходит; «Отложенные» и «Архив» — экран поверх чата */
.oc-crow { transition: opacity .3s ease, max-height .3s ease, margin .3s ease, border-width .3s ease; overflow: hidden; }
.oc-crow.is-out { opacity: 0; max-height: 0 !important; margin: 0; border-width: 0; }
@media (prefers-reduced-motion: reduce) { .oc-crow { transition: none; } }
.oc-laterbtn { display: flex; align-items: center; gap: 6px; min-height: 48px; padding: 0 12px; border-radius: 12px; border: 1.5px solid rgba(242,196,109,.45); background: rgba(40,19,21,.9); color: #f2c46d; font-weight: 700; font-size: 15px; line-height: 1.2; font-family: inherit; text-align: left; }
.oc-laterbtn .oc-chev { margin-left: auto; }
.oc-arch { padding: 0 10px; }
.oc-head { gap: 6px; }
.oc-sheet { position: absolute; left: 0; right: 0; top: 61px; bottom: 0; z-index: 3; background: #1b0c10; display: flex; flex-direction: column; }
.oc-sheet[hidden] { display: none; }
.oc-shead { display: flex; align-items: center; gap: 6px; padding: 4px 12px 4px 4px; border-bottom: 1.5px solid rgba(242,196,109,.26); background: #241114; flex: none; }
.oc-shead b { font-size: 17px; font-weight: 800; }
.oc-sbody { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 8px 12px calc(16px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 4px; }
.oc-ans { flex: none; font-size: 14px; font-weight: 700; color: #cbb89c; white-space: nowrap; }
.oc-who b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 400px) { .oc-head .oc-ava { display: none; } .oc-tasks { padding: 0 9px; } }

/* #1454: вверху чата одна строка «🔔 Ждут ответа · N ›»; список — в экране поверх чата */
.oc-cards { max-height: none; overflow: visible; padding: 6px 12px; }
.oc-sumbtn { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 52px; padding: 0 14px; border-radius: 12px; border: 1.5px solid rgba(242,196,109,.5); background: #2a1a12; color: #f6d58b; font-weight: 800; font-size: 16px; line-height: 1.2; font-family: inherit; text-align: left; }
.oc-sumbtn.is-wait { border-color: rgba(242,196,109,.9); background: #3a2410; }
.oc-sumbtn .oc-chev { margin-left: auto; }
.oc-stabs { display: flex; gap: 8px; padding: 8px 12px 0; flex: none; }
.oc-stab { flex: 1; min-height: 48px; border-radius: 12px; border: 1.5px solid rgba(242,196,109,.4); background: rgba(40,19,21,.9); color: #cbb89c; font-weight: 700; font-size: 15px; font-family: inherit; }
.oc-stab.is-on { background: linear-gradient(#f6d58b, #e0a43a); color: #2a1a12; border-color: transparent; }

/* #1557: две вкладки «Чат» / «Ждут ответа»; шторка карточек не закрывает поле ввода */
.oc-sheet { bottom: var(--oc-ch, 92px); }
.oc-tabs { display: flex; gap: 8px; }
.oc-tab { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 0 8px; border-radius: 12px; border: 1.5px solid rgba(242,196,109,.4); background: rgba(40,19,21,.9); color: #cbb89c; font-weight: 800; font-size: 15px; font-family: inherit; }
.oc-tab.is-on { background: linear-gradient(#f6d58b, #e0a43a); color: #2a1a12; border-color: transparent; }
.oc-tab.is-wait:not(.is-on) { border-color: rgba(242,196,109,.9); color: #f6d58b; background: #3a2410; }

/* #1559: строки карточек не сжимаются (overflow:hidden у flex-детей делал их min-height:0) — открытая во всю высоту, свёрнутые не ниже 52px; список прокручивается целиком */
.oc-sbody > .oc-crow, .oc-cards > .oc-crow { flex: none; }
.oc-sbody > .oc-crow:not(.is-open) { min-height: 52px; }
.oc-crow.is-open { overflow: visible; max-height: none !important; }
.oc-crow.is-open .oc-cbody { overflow: visible; }
.oc-sbody { overscroll-behavior: contain; }
