/* Плашка демо, выбор роли и чат менеджера. Плашка — строка сетки страницы, не fixed: на iPhone закреплённая панель сбивается после клавиатуры. Один селектор — одна строка. */
@font-face { font-family: 'Golos Text'; src: url('fonts/golos-text-cyrillic.woff2') format('woff2'); font-weight: 400 600; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Golos Text'; src: url('fonts/golos-text-latin.woff2') format('woff2'); font-weight: 400 600; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: 'Piazzolla'; src: url('fonts/piazzolla.woff2') format('woff2'); font-weight: 400 700; font-style: normal; font-display: swap; }

body { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); height: 100dvh; }
.shell { height: 100%; min-height: 0; overflow: auto; }
.rail { height: calc(100dvh - 104px); }
.view { animation: none; }
.team__model:empty, .feed__model:empty { display: none; }

.db { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'note want' 'ctl ctl'; align-items: center; gap: 8px 12px; padding: calc(env(safe-area-inset-top, 0px) + 8px) 12px 8px; background: #221c17; color: #f4efe6; font-size: 13.5px; line-height: 1.25; }
.db__note { grid-area: note; min-width: 0; margin: 0; }
.db__note b { display: block; font-weight: 600; }
.db__note span { display: none; color: #b4aa9c; }
.db__ctl { grid-area: ctl; display: flex; align-items: center; gap: 8px; min-width: 0; }
html:not([data-role]) .db { grid-template-areas: 'note want'; }
html:not([data-role]) .db__ctl { display: none; }
.db__seg { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 2px; border-radius: 10px; background: #3a322a; }
.db__seg button { min-height: 34px; padding: 0 10px; border: 0; border-radius: 8px; background: none; font-size: 13px; font-weight: 600; color: #d8cfc2; white-space: nowrap; transition: background .25s ease-out, color .25s ease-out; }
html[data-role='owner'] .db__seg [data-role-go='owner'], html[data-role='manager'] .db__seg [data-role-go='manager'] { background: #f4efe6; color: #221c17; }
.db__btn { flex: none; min-height: 38px; padding: 0 12px; border: 0; border-radius: 10px; background: none; font-size: 13px; font-weight: 600; color: #d8cfc2; box-shadow: inset 0 0 0 1px #5a5046; white-space: nowrap; transition: background .25s ease-out; }
.db__btn:hover { background: #3a322a; }
.db__want { grid-area: want; display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border-radius: 10px; background: #00b7ff; color: #06202c; font-size: 13.5px; font-weight: 600; text-decoration: none; white-space: nowrap; transition: transform .2s ease-out, filter .2s ease-out; }
.db__want:hover { filter: brightness(1.08); }
.db__want:active { transform: scale(.97); }
.db-toast { position: fixed; left: 50%; bottom: 20px; z-index: 90; max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: 12px; background: #221c17; color: #fff; font-size: 14px; box-shadow: 0 8px 26px rgba(0, 0, 0, .3); transform: translateX(-50%); animation: db-in .3s ease-out; }
@keyframes db-in { from { opacity: 0; transform: translate(-50%, 8px); } }
.acc__logo--mx { background: linear-gradient(135deg, #2e5bff, #8a3ffc); }

/* Выбор роли */
.dbe { display: grid; place-items: center; min-height: 0; padding: 24px 16px; overflow: auto; }
.dbe__box { width: 100%; max-width: 500px; padding: 28px 24px; border: 1px solid var(--line); border-radius: 20px; background: var(--paper-2); }
.dbe__box h1 { margin: 14px 0 6px; font: 600 30px/1.15 var(--display); }
.dbe__box > p { margin: 0 0 18px; color: var(--ink-2); }
.dbe__logo { display: block; height: 44px; width: auto; }
.dbe__role { display: block; width: 100%; margin: 0 0 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); text-align: left; transition: border-color .2s ease-out, transform .2s ease-out; }
.dbe__role:hover { border-color: var(--ink-2); }
.dbe__role:active { transform: scale(.99); }
.dbe__role b { display: block; font-size: 16px; font-weight: 600; }
.dbe__role span { color: var(--ink-2); font-size: 13.5px; }
.dbe__box .dbe__why { margin: 14px 0 0; font-size: 13.5px; text-align: center; }
.made { display: block; margin-top: 14px; color: var(--ink-3); font-size: 12px; text-align: center; }
.made a { color: inherit; text-decoration: none; }

/* Чат менеджера с ботом */
.chat { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; width: 100%; max-width: 620px; height: 100%; min-height: 0; margin: 0 auto; border-inline: 1px solid var(--line); background: var(--paper-2); }
.chat__head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--paper); }
.chat__head img { width: 40px; height: 40px; border-radius: 50%; }
.chat__head b { display: block; font-weight: 600; line-height: 1.25; }
.chat__head span { font-size: 13px; color: var(--ink-3); }
.chat__list { display: flex; flex-direction: column; gap: 10px; min-height: 0; padding: 16px; overflow: auto; }
.cb { position: relative; max-width: 82%; padding: 10px 12px 22px; border-radius: 14px; background: var(--paper); box-shadow: 0 1px 0 var(--line); }
.cb--new { animation: cb-in .3s ease-out; }
.cb--me { align-self: flex-end; background: #dfeee0; }
.cb--bot { align-self: flex-start; }
.cb p { margin: 0; white-space: pre-line; line-height: 1.45; }
.cb img { width: 240px; max-width: 100%; height: auto; border-radius: 10px; }
.cb time { position: absolute; right: 10px; bottom: 5px; font-size: 11px; color: var(--ink-3); }
.cb__btns { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.cb__btn { min-height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper-2); font-weight: 500; text-align: left; transition: background .2s ease-out; }
.cb__btn:hover { background: var(--paper-3); }
.chat__tray { padding: 10px 16px calc(env(safe-area-inset-bottom, 0px) + 12px); border-top: 1px solid var(--line); background: var(--paper); }
.chat__hint { margin: 0 0 8px; font-size: 13px; color: var(--ink-2); }
.chat__row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.ct { position: relative; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: none; aspect-ratio: 4 / 5; transition: transform .2s ease-out; }
.ct:hover:not(:disabled) { transform: translateY(-2px); }
.ct img { width: 100%; height: 100%; object-fit: cover; }
.ct:disabled { cursor: default; }
.ct:disabled img { opacity: .4; }
.ct span { position: absolute; inset: auto 0 6px; font-size: 11px; text-align: center; color: var(--ink); }
@keyframes cb-in { from { opacity: 0; transform: translateY(6px); } }

@media (min-width: 900px) {
  .db { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: 'note ctl want'; padding-inline: 16px; }
  html:not([data-role]) .db { grid-template-areas: 'note note want'; }
  .db__note span { display: block; }
  .db__seg { flex: none; min-width: 230px; }
  .rail { height: calc(100dvh - 58px); }
}
/* На планшете сводка недели не помещается рядом со счётчиками */
@media (max-width: 1100px) {
  .brief { grid-template-columns: minmax(0, 1fr); }
}
/* На телефоне панель листается страницей: сетка на всю высоту мешала бы прокрутке */
@media (max-width: 760px) {
  body { display: block; height: auto; }
  .shell { height: auto; overflow: visible; }
  .rail { height: auto; max-height: none; }
  .dbe { min-height: calc(100dvh - 60px); }
  html[data-role='manager'] body { display: grid; height: 100dvh; }
  .chat { border-inline: 0; }
  .day--past:has(.post--empty) { display: none; }
  #nav a { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
  .cb { max-width: 90%; }
}
@media (prefers-reduced-motion: reduce) {
  .db__seg button, .db__btn, .db__want, .dbe__role, .ct, .cb__btn { transition: none; }
  .db-toast, .cb--new { animation: none; }
}
