/* Плашка демо и экран выбора роли. Плашка — строка сетки страницы, не fixed: на iPhone закреплённая панель сбивается после клавиатуры. Один селектор — одна строка. */
body { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); height: 100dvh; }
#board-app { height: 100%; min-height: 0; }

.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: #16161c; color: #f2f2f5; 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: 700; }
.db__note span { display: none; color: #a9a9b4; }
.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: #2b2b33; }
.db__seg button { min-height: 34px; padding: 0 10px; border: 0; border-radius: 8px; background: none; font-size: 13px; font-weight: 600; color: #cfcfd6; white-space: nowrap; transition: background .25s ease-out, color .25s ease-out; }
html[data-role='admin'] .db__seg [data-role-go='admin'], html[data-role='manager'] .db__seg [data-role-go='manager'] { background: #f2f2f5; color: #16161c; }
.db__btn { flex: none; min-height: 38px; padding: 0 12px; border: 0; border-radius: 10px; background: none; font-size: 13px; font-weight: 600; color: #cfcfd6; box-shadow: inset 0 0 0 1px #4a4a55; white-space: nowrap; transition: background .25s ease-out; }
.db__btn:hover { background: #2b2b33; }
.db__btn--order { color: #fff; box-shadow: inset 0 0 0 1px #2f6fe4; background: #2f6fe4; }
.db__btn--order:hover { background: #2a62c9; }
.db__btn:disabled { opacity: .6; }
.db__want { grid-area: want; display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border-radius: 10px; background: var(--brand); color: #fff; font-size: 13.5px; font-weight: 700; 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: 60; max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: 12px; background: #16161c; 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); } }

/* Выбор роли */
.dbe { display: grid; place-items: center; min-height: 0; padding: 24px 16px; overflow: auto; }
.dbe__box { width: 100%; max-width: 480px; padding: 28px 24px; border: 1px solid var(--line); border-radius: 20px; background: var(--pane); }
.dbe__box h1 { margin: 14px 0 6px; font-size: 24px; line-height: 1.2; }
.dbe__box > p { margin: 0 0 18px; color: var(--dim); }
.dbe__role { display: block; width: 100%; margin: 0 0 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); text-align: left; transition: border-color .2s ease-out, transform .2s ease-out; }
.dbe__role:hover { border-color: var(--brand); }
.dbe__role:active { transform: scale(.99); }
.dbe__role b { display: block; font-size: 16px; }
.dbe__role span { color: var(--dim); 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(--dim); font-size: 12px; text-align: center; }
.made a { color: inherit; text-decoration: none; }

@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; }
}
/* На телефоне приложение листается страницей: сетка на всю высоту здесь мешала бы прокрутке */
@media (max-width: 760px) {
  body { display: block; height: auto; }
  #board-app { height: auto; min-height: 0; }
  .dbe { min-height: calc(100dvh - 60px); }
}
@media (max-width: 480px) {
  .db__ctl { flex-wrap: wrap; }
  .db__seg { flex-basis: 100%; }
  .db__btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .db__seg button, .db__btn, .db__want, .dbe__role { transition: none; }
  .db-toast { animation: none; }
}
