html{background:#0b0f13}
html.ay-boot,html.ay-boot body{background:#0b0f13!important}
html.ay-boot body{visibility:hidden!important}
html,body{width:100%!important;max-width:100%!important;overflow-x:hidden!important}
/* Owner27.09: no page-loading bars in any theme, viewport or loading stage.
   Keep the nodes for existing readiness/error observers. Repeated IDs make
   this presentation contract win over late Admin flow-position rules. */
html:root body :is(#ayAdminLoadProgress#ayAdminLoadProgress,#ayMechLoadProgress#ayMechLoadProgress){display:none!important}
/* Match the visible Administrator subtitle; wide desktop keeps its existing
   header structure, where this separate Mechanic role copy is hidden. */
@media(max-width:700px){
html:root body.ay-role-mech #ayTop .ay-cowork-role-copy>b{
  color:var(--ay-chrome-ink,var(--ink))!important;
  -webkit-text-fill-color:currentColor!important;opacity:.72!important;
}
}
body *,body *::before,body *::after{box-sizing:border-box}
/* Карточка роли идёт тем же тоном, что и плитки под ней.

   Было: карточка брала --card2, а блоки страницы --card. В тёмной теме разница
   почти не читалась, в светлой карточка выходила откровенно белой:
   rgba(255,255,255,.79) против rgba(255,255,255,.66) у соседей.

   Токен не новый и палитра не меняется — берём тот же, которым уже покрашены
   соседние блоки, поэтому правило работает в обеих темах само. */
html body .ay-page-card{background:var(--card)!important}
body.admin-tight>.app{width:100%!important;max-width:1180px!important;margin-left:auto!important;margin-right:auto!important;padding-left:16px!important;padding-right:16px!important;overflow-x:clip!important}
body.admin-tight .app>.panel,body.admin-tight .app>.block,body.admin-tight .app>.overall{width:100%!important;max-width:100%!important;margin-left:0!important;margin-right:0!important}
body.admin-tight .panel>*,body.admin-tight .block>*,body.admin-tight .overall>*,body.admin-tight .role-grid,body.admin-tight .role-tile{min-width:0!important;max-width:100%!important}
@media(max-width:640px){body.admin-tight>.app{padding-left:14px!important;padding-right:14px!important}}
.clock,.ay-clock{background:transparent!important;border:0!important;border-radius:0!important;box-shadow:none!important;padding:0!important;min-width:132px!important;max-width:none!important;text-align:right!important;overflow:visible!important}
.clock .t,.ay-clock .t{font-family:var(--disp,'Manrope',system-ui,sans-serif)!important;font-weight:800!important;font-size:17px!important;line-height:1!important;color:var(--ink)!important;text-align:right!important}
.clock .d,.ay-clock .d{font-size:10.5px!important;line-height:1.25!important;color:var(--ink2)!important;margin-top:4px!important;white-space:nowrap!important;text-align:right!important}
@media(max-width:640px){.clock,.ay-clock{min-width:100px!important;padding:0!important}.clock .t,.ay-clock .t{font-size:15px!important}.clock .d,.ay-clock .d{font-size:9.2px!important}}
@media(max-width:390px){.clock,.ay-clock{min-width:92px!important}.clock .t,.ay-clock .t{font-size:14px!important}.clock .d,.ay-clock .d{font-size:8.8px!important}}
.shell.loading,.loading[data-ay-loading],#loading.shell{background:#0b0f13!important;color:transparent!important;border:0!important;box-shadow:none!important}
.shell.loading>*,.loading[data-ay-loading]>*,#loading.shell>*{visibility:hidden!important}
body .home .htile .hic:has(.ay-theme-role-emblem),body .home .htile .hic:has(.ay-theme-function-emblem){width:72px!important;height:72px!important;min-width:72px!important;border:0!important;background:transparent!important;box-shadow:none!important;padding:0!important;overflow:visible!important}
body .home .htile .ay-theme-role-emblem,body .home .htile .ay-theme-function-emblem{width:72px!important;height:72px!important;flex:0 0 72px!important;border:0!important;box-shadow:none!important}
@media(max-width:640px){body .home .htile .hic:has(.ay-theme-role-emblem),body .home .htile .hic:has(.ay-theme-function-emblem),body .home .htile .ay-theme-role-emblem,body .home .htile .ay-theme-function-emblem{width:66px!important;height:66px!important;min-width:66px!important;flex-basis:66px!important}}

/* Поздние локальные стили некоторых страниц не должны возвращать часам вид кнопки. */
html body .top .right .clock,
html body .top .top-right .clock,
html body .ay-top .ay-right .ay-clock,
html body .clock,
html body .ay-clock{
  background:transparent!important;border:0!important;border-radius:0!important;
  box-shadow:none!important;padding:0!important;
}
html body .top .right .clock .t,
html body .top .top-right .clock .t,
html body .ay-top .ay-right .ay-clock .t,
html body .clock .t,html body .ay-clock .t{
  font-family:var(--disp,'Manrope',system-ui,sans-serif)!important;
  font-weight:800!important;line-height:1!important;text-align:right!important;
}
html body .top .right .clock .d,
html body .top .top-right .clock .d,
html body .ay-top .ay-right .ay-clock .d,
html body .clock .d,html body .ay-clock .d{
  margin-top:4px!important;white-space:nowrap!important;text-align:right!important;
}

/* Верхний бренд-блок одинаков на всех страницах.

   Контроль Cowork 09.08.2026 сравнил снимки boss и logist и увидел разное:
   слева от логотипа подзаголовок «Система управления компанией» то есть, то
   нет. Замер по семи страницам подтвердил и уточнил картину:

     без подзаголовка   boss, buh
     с подзаголовком    admin, logist, manager, mech, product

   Эталон общих элементов — страница руководителя, а там подзаголовка нет.
   Приводим к ней: подпись компании и так продублирована логотипом рядом, а на
   узких экранах именно она первой отдавала место при сжатии шапки. */
html:root body :is(.ay-sub,.brand-sub,.ay-brand-sub){
  display:none!important;
}

/* «ВЫЙТИ» живёт в КАРТОЧКЕ РОЛИ, а не в верхней тонкой плашке.

   Решение Игоря 09.08.2026 (переделка вместо PR #363): в шапке остаются
   только логотип, часы и смена темы; роль и выход переезжают в толстую
   карточку с эмблемой и подписью «панель руководителя».

   Роль отдельной подписью НЕ дублируем — карточка называет её сама. Прежняя
   «• РЕЖИМ: {роль}» стояла бы второй строкой о том же (пункт 4 ответов Игоря).

   Градиент идёт от СЕРЕДИНЫ карточки ВПРАВО: слева прозрачно и незаметно, к
   правому краю сплошной #e3a33b. Кривая та же, что подбиралась для плашки в
   шапке — восемь стопов, прибавка между соседними не больше 0.14, поэтому
   воспринимаемой «черты» нет. Полосы слева нет: левый край растворяется.
   Тёмный текст кнопки стоит на сплошном участке и читается в обеих темах. */
html:root body :is(.ay-page-card,.ay-user-card,.user){
  position:relative!important;
  /* градиент обрезается по скруглению карточки, иначе угол вылезает поверх */
  overflow:hidden!important;
}
.ay-role-exit-zone{
  position:absolute!important;
  right:0!important;top:0!important;bottom:0!important;
  width:50%!important;max-width:420px!important;
  display:flex!important;align-items:center!important;justify-content:flex-end!important;
  padding:0 16px!important;box-sizing:border-box!important;
  pointer-events:none!important;   /* фон не перехватывает клики по карточке */
  /* Сплошной цвет достигается к 76%, а не к самому краю: замер показал, что
     кнопка стоит на 79% ширины зоны, и при заливке «до 100%» она сидела бы на
     80-процентном оранжевом. Фон у кнопки свой, светлый, но за ней должен быть
     ровный #e3a33b — иначе правый край карточки выглядит недокрашенным.
     Оставшиеся 24% идут сплошными. */
  background:linear-gradient(90deg,
    rgba(227,163,59,0) 0%,
    rgba(227,163,59,.07) 11%,
    rgba(227,163,59,.18) 21%,
    rgba(227,163,59,.32) 31%,
    rgba(227,163,59,.47) 41%,
    rgba(227,163,59,.62) 51%,
    rgba(227,163,59,.76) 60%,
    rgba(227,163,59,.90) 69%,
    #e3a33b 76%)!important;
}
.ay-role-exit-btn{
  pointer-events:auto!important;
  flex:0 0 auto!important;font-family:Arial,Helvetica,sans-serif!important;
  font-size:11px!important;font-weight:700!important;letter-spacing:.04em!important;
  padding:7px 12px!important;border-radius:16px!important;cursor:pointer!important;
  background:rgba(255,255,255,.62)!important;color:#231803!important;
  border:1px solid rgba(72,50,10,.45)!important;
  height:auto!important;min-height:0!important;max-height:none!important;
  text-transform:uppercase!important;
}
/* Роль остаётся в разметке для замера и программ чтения, но не показывается:
   второй раз называть её незачем. */
.ay-role-exit-sr{
  position:absolute!important;width:1px!important;height:1px!important;
  padding:0!important;margin:-1px!important;overflow:hidden!important;
  clip-path:inset(50%)!important;white-space:nowrap!important;border:0!important;
}
.ay-header-role-exit{
  display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:6px!important;
  flex:0 0 auto!important;min-width:0!important;min-height:44px!important;padding:0 14px!important;border:0!important;border-radius:11px!important;
  background:#F5821F!important;color:#fff!important;-webkit-text-fill-color:#fff!important;font:700 12px/1 Inter,system-ui,sans-serif!important;
  cursor:pointer!important;white-space:nowrap!important;overflow:visible!important;text-overflow:clip!important;box-shadow:0 5px 14px -10px rgba(245,130,31,.9)!important;
}
.ay-header-role-exit svg{width:19px!important;height:19px!important;fill:none!important;stroke:currentColor!important;stroke-width:2!important;flex:0 0 auto!important}
.ay-role-exit-label{display:inline!important;white-space:nowrap!important;overflow:visible!important;text-overflow:clip!important}
.ay-role-exit-confirm{position:fixed!important;inset:0!important;z-index:3000!important;display:flex!important;align-items:center!important;justify-content:center!important;padding:20px!important;background:rgba(0,0,0,.58)!important}
.ay-role-exit-confirm-card{width:min(360px,100%)!important;padding:22px!important;border:1px solid var(--line,#35476B)!important;border-radius:16px!important;background:var(--card2,#17243D)!important;color:var(--ink,#F4F7FB)!important;box-shadow:0 20px 50px rgba(0,0,0,.35)!important}
.ay-role-exit-confirm-card h2{margin:0 0 8px!important;font-size:18px!important}.ay-role-exit-confirm-card p{margin:0 0 18px!important;color:var(--muted,#AEBBCF)!important;font-size:13px!important}
.ay-role-exit-confirm-actions{display:flex!important;gap:10px!important}.ay-role-exit-confirm-actions button{flex:1!important;min-height:44px!important;border-radius:10px!important;font-weight:800!important;cursor:pointer!important}.ay-role-exit-confirm-actions [data-ay-role-stay]{border:1px solid var(--line,#35476B)!important;background:transparent!important;color:var(--ink,#F4F7FB)!important}.ay-role-exit-confirm-actions [data-ay-role-leave]{border:0!important;background:#F5821F!important;color:#fff!important}
@media(max-width:480px){.ay-header-role-exit{width:52px!important;height:52px!important;min-width:52px!important;max-width:52px!important;min-height:52px!important;max-height:52px!important;padding:0!important;gap:0!important;border-radius:12px!important}.ay-header-role-exit .ay-role-exit-label{display:none!important}.ay-global-surface-header .brand,.top .brand{min-width:0!important;flex:1 1 auto!important}.ay-global-surface-header .brand>div{min-width:0!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}}
html:root body .ay-header-role-exit.ay-header-role-exit[data-ay-action-control="1"]{background:#F5821F!important;background-color:#F5821F!important;background-image:none!important;border:0!important;color:#FFFFFF!important;-webkit-text-fill-color:#FFFFFF!important}
html:root body button.ay-header-role-exit.ay-header-role-exit{height:44px!important;min-height:44px!important;max-height:44px!important}
@media(max-width:480px){html:root body button.ay-header-role-exit.ay-header-role-exit{width:52px!important;height:52px!important;min-width:52px!important;max-width:52px!important;min-height:52px!important;max-height:52px!important}}
/* Admin role mirror: only the explicit exit affordance differs from the role. */
@media(max-width:700px){
  html:root[data-ay-role-mirror][data-ay-role-mirror] body:is(#ayOwnerMobilePage,.ay-cowork-mobile) :is(#ayTop,.ay-global-surface-header,.ay-top,.top,.header,.wrap>.top) :is(.clock,.ay-clock,[data-ay-time],[data-ay-date]){display:none!important}
  html:root body button.ay-header-role-exit.ay-header-role-exit[data-ay-header-role-exit]{width:52px!important;height:52px!important;min-width:52px!important;max-width:52px!important;min-height:52px!important;max-height:52px!important;padding:0!important;background:transparent!important;background-color:transparent!important;background-image:none!important;color:#DF433D!important;-webkit-text-fill-color:#DF433D!important;box-shadow:none!important;border:1px solid #DF433D!important;animation:none!important}
  html:root body button.ay-header-role-exit .ay-role-exit-label{display:none!important}
  html:root body .ay-role-exit-zone{display:none!important;background:none!important;animation:none!important}
}
@media(min-width:701px){
  html:root body .ay-role-exit-zone.ay-role-mirror-desktop[data-ay-role-mirror-zone]{display:flex!important;background:linear-gradient(90deg,rgba(227,163,59,0) 0%,rgba(227,163,59,.07) 11%,rgba(227,163,59,.18) 21%,rgba(227,163,59,.32) 31%,rgba(227,163,59,.47) 41%,rgba(227,163,59,.62) 51%,rgba(227,163,59,.76) 60%,rgba(227,163,59,.90) 69%,#e3a33b 76%)!important;box-shadow:none!important}
  html:root body .ay-role-exit-zone.ay-role-mirror-desktop[data-ay-role-mirror-zone] .ay-role-exit-btn{background:rgba(255,255,255,.62)!important;color:#231803!important;-webkit-text-fill-color:#231803!important;border:1px solid rgba(72,50,10,.45)!important;box-shadow:none!important}
}
@media(max-width:640px){
  /* На телефоне карточка уже, поэтому зона выхода забирает больше её ширины —
     иначе кнопка встаёт на почти прозрачном участке и тёмный текст ложится
     на фон карточки. */
  .ay-role-exit-zone{width:62%!important;padding:0 12px!important}
  .ay-role-exit-btn{padding:6px 9px!important;font-size:10px!important}
}
/* Дата в часах вернулась на телефон.

   Её прятали 09.08.2026 ради подписи роли: на 390px шапка не вмещала бренд,
   индикатор роли, часы и кнопку темы разом — часы и смена темы уезжали за
   правый край. Индикатор роли из шапки убран (переехал в карточку), и место
   освободилось: замер на 390px после переноса показывает, что дата умещается
   и кнопка темы остаётся в пределах экрана. Пункт 8 ответов Игоря от
   09.08.2026 — «пересмотреть после переноса» — закрыт замером. */
/* Сжатие ряда шапки остаётся: бренд по-прежнему длинный, и на планшете 768px
   без него кнопка темы вылезала за край. */
@media(max-width:820px){
  html:root body :is(.ay-top,.top,.ay-global-surface-header){
    flex-wrap:nowrap!important;
    gap:8px!important;
    min-width:0!important;
  }
  html:root body :is(.ay-top,.top,.ay-global-surface-header) > *{
    min-width:0!important;
  }
  html:root body :is(.ay-clock,.clock){
    min-width:0!important;
    flex:0 1 auto!important;
    overflow:hidden!important;
  }
  html:root body :is(.ay-right,.right,.top-right){
    flex:0 0 auto!important;
    min-width:0!important;
  }
  /* бренд отдаёт место первым: название компании и так продублировано */
  html:root body :is(.ay-brand,.brand,.ay-name,.nm){
    flex:1 1 0!important;
    min-width:0!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }
}
