/* Revision 28 — interface clean-up (see UI_CLEANUP_R28_RU.md). Loaded after revision27.css. */

/* М9 (2026-09-23, владелец, разбор по скриншоту из настоящего Telegram Mini App): кнопка
 * настроек (⚙️, [data-v76-system] в .v76-mobile-header) должна быть самой правой на ВСЁМ
 * экране (тот же принцип, что М5 уже применяет к pin/collapse-кнопкам Dashboard) — а не только
 * самой правой ВНУТРИ средней колонки, которая на ширине планшета заметно уже (.v76-mobile-
 * header не дотягивается до .rightbar — между ними реальный зазор, см. правый столбец
 * "Фокус дня"). DOM-родитель кнопки НЕ меняем (клик обрабатывается делегированием на document
 * через .closest('[data-v76-system]') — см. v76.js/mobile-client.js, — значит визуальный сдвиг
 * через position:fixed ничего не ломает функционально). Прижимаем к правому краю экрана, на
 * той же высоте, где уже сейчас стоит (не трогаем вертикаль — п.3 её уже выровнял с заголовком
 * вкладки). z-index выше .rightbar.r26-dashboard (105, revision26.css), чтобы лежать поверх
 * правой колонки, а не под ней. */
@media(min-width:600px) and (max-width:1024px){
  .v76-mobile-header [data-v76-system]{position:fixed!important;top:9px!important;right:12px!important;z-index:110!important}
}

/* М7. Phone / mobile web: the three round action buttons (note, focus, assistant) sit in ONE row with equal gaps. */
@media (max-width:767px){
  html.v76-phone body .v18-action-dock{flex-direction:row!important;right:calc(16px + 52px + 12px)!important;bottom:calc(80px + env(safe-area-inset-bottom))!important;gap:12px!important}
  html.v76-phone body #dv-mic-wrap{right:16px!important;bottom:calc(80px + env(safe-area-inset-bottom))!important;height:auto!important;min-height:0!important;justify-content:flex-end!important}
}

/* М1. Main menu (desktop / tablet sidebar): the rose and the search field stay in place, the menu scrolls under them
   without a scroll bar. */
@media (min-width:768px){
  html .sidebar{scrollbar-width:none!important;-ms-overflow-style:none!important}
  html .sidebar::-webkit-scrollbar{display:none!important;width:0!important;height:0!important}
  html .sidebar{padding-top:0!important}
  html .sidebar>.brand{position:sticky;top:0;z-index:3;background:var(--bg);padding-top:18px!important;margin-top:0!important}
  html .sidebar>.search{position:sticky;top:var(--r28-brand-h,77px);z-index:3;background:var(--bg)}
  /* М2. The page title row with its buttons stays in place; the list below scrolls. */
  html main.main>.topbar{position:sticky;top:0;z-index:3;background:var(--bg)}
}

/* М5. The default Dashboard title "Панель" is dropped: the pin / collapse buttons move onto the first line of content. */
.rightbar.r26-dashboard{position:relative}
.r26-dashboard-head.r28-notitle,.r26-dashboard-head:has(>.right-title:empty){position:absolute;right:10px;top:8px;z-index:4;padding:0!important;margin:0!important;min-height:0!important;background:none!important}
.r26-dashboard-head.r28-notitle .right-title,.r26-dashboard-head>.right-title:empty{display:none!important}
.r26-dashboard-head.r28-notitle~.rightbar-frozen,.r26-dashboard-head:has(>.right-title:empty)~.rightbar-frozen{padding-right:76px}
/* 2026-09-23 (разбор владельца по новому скриншоту планшета/Telegram, п.5 «мелких правок»):
 * на ширине планшета (600-1024px) .r26-dashboard-toggle (pin/свернуть-кнопки, из-за которых
 * вообще существует этот запас) УЖЕ скрыт правилом чуть выше в этом же файле (М-блок
 * "Планшет... кнопка настроек должна быть самой правой", 2026-09-22) — там ничего не плавает,
 * запас держать не от чего. horizontal-запас 76px тем не менее продолжал молча красть ширину
 * у «Дневная ёмкость» (и любого другого содержимого .rightbar-frozen) на этой же ширине —
 * тот самый смежный баг, найденный в ЭТОМ разборе. Снимаем его именно в этом диапазоне;
 * Desktop/Phone, где кнопки видимы, не трогаем. */
@media(min-width:600px) and (max-width:1024px){
  .r26-dashboard-head.r28-notitle~.rightbar-frozen,.r26-dashboard-head:has(>.right-title:empty)~.rightbar-frozen{padding-right:0}
}

/* Р1. Rituals: no schedule in the Dashboard. */
html[data-r28-route="rituals"] .rightbar .rightbar-schedule-title,
html[data-r28-route="rituals"] .rightbar .timeline{display:none!important}

/* П1. Habits: no "Focus of the day" and no stones in the Dashboard. */
html[data-r28-route="habits"] .rightbar .rightbar-frozen>.right-title,
html[data-r28-route="habits"] .rightbar .rightbar-focus-actions,
html[data-r28-route="habits"] .rightbar .right-title:has(+ .stone-strip),
html[data-r28-route="habits"] .rightbar .stone-strip{display:none!important}

/* Н1. Settings Dashboard: every metric occupies a whole line. */
.rightbar .r26-dashboard-metrics{grid-template-columns:1fr!important}

/* И1. Favorites: the "Add" button is smaller and uses the secondary text size of the type scale. */
.r26-favorite-add{font-size:var(--dj-text-secondary-size,12px)!important;font-weight:var(--dj-text-secondary-weight,500)!important;line-height:1.2!important;min-height:0!important;height:auto!important;padding:4px 10px!important}

/* С1. "Перенести" opened from the time menu must be above it (the time menu is at z-index 99999). */
.modal-backdrop.r25-dialog-backdrop{z-index:100001!important}

/* З1. Recurrence mark in the task menu "Делать" row. */
.r26-time-row .r28-recur{display:inline-flex;align-items:center;margin-left:6px;opacity:.85}
.r26-time-row .r28-recur svg{width:15px;height:15px}

/* Ц3. Goals Dashboard: the two figures of a unit are two boxes on one line. */
.r26-dashboard-metric:has(.r28-metric-chips){display:flex;flex-direction:column;gap:5px}
.r28-metric-chips{display:flex;gap:6px}
.r28-metric-chip{flex:1 1 0;min-width:0;white-space:nowrap;padding:4px 6px;border:1px solid var(--line,#ddd);border-radius:8px;background:var(--panel,#fff);color:inherit;font:inherit;font-size:var(--dj-text-secondary-size,12px);font-weight:700;cursor:pointer;text-align:center}
.r28-metric-chip.active{background:var(--red,#d55242);border-color:var(--red,#d55242);color:#fff}
.v43-goal-row[hidden]{display:none!important}

/* М8. Sidebar projects: the "@" has the project colour. М3. Ideas: no "@" after the name. */
.sidebar .v78-sidebar-project-link:not(.r27-idea-link) .v78-sidebar-project-name::before{color:var(--r28-at,inherit)!important}
.sidebar .r27-idea-link .v78-sidebar-project-name::after{content:none!important}

/* Dashboard blocks that do not belong to a section (owner's list, 21.09). Route names come from html[data-r28-route]. */
html:is([data-r28-route="filters"],[data-r28-route="activity"],[data-r28-route="karma"],[data-r28-route="analytics"],[data-r28-route="stones"],[data-r28-route="stone"],[data-r28-route="walls"],[data-r28-route="wall"],[data-r28-route="cathedral"],[data-r28-route="contacts"],[data-r28-route="favorites"],[data-r28-route="tags"],[data-r28-route="tag"],[data-r28-route="habits"],[data-r28-route="rituals"]) .rightbar .capacity{display:none!important}
html:is([data-r28-route="filters"],[data-r28-route="activity"],[data-r28-route="karma"],[data-r28-route="analytics"],[data-r28-route="stones"],[data-r28-route="stone"],[data-r28-route="walls"],[data-r28-route="wall"],[data-r28-route="cathedral"],[data-r28-route="contacts"],[data-r28-route="favorites"],[data-r28-route="tags"],[data-r28-route="tag"]) .rightbar :is(.rightbar-schedule-title,.timeline){display:none!important}
html:is([data-r28-route="rituals"],[data-r28-route="habits"],[data-r28-route="tags"],[data-r28-route="tag"],[data-r28-route="activity"],[data-r28-route="karma"],[data-r28-route="analytics"],[data-r28-route="stones"],[data-r28-route="stone"],[data-r28-route="walls"],[data-r28-route="wall"],[data-r28-route="cathedral"],[data-r28-route="contacts"],[data-r28-route="favorites"]) .rightbar :is(.stone-strip,.right-title:has(+ .stone-strip)){display:none!important}

/* Desktop: the page never scrolls as a whole. The menu, the tab and the Dashboard each scroll inside their own area
   (without a scroll bar), so nothing shakes when the wheel turns. */
@media (min-width:1025px){
  html:not(.notes-editing):not([data-r28-route="calendar"]),html:not(.notes-editing):not([data-r28-route="calendar"]) body{height:100%;overflow:hidden!important}
  html:not(.notes-editing):not([data-r28-route="calendar"]) .app-shell{height:100vh!important;min-height:0!important;overflow:hidden}
  html:not(.notes-editing):not([data-r28-route="calendar"]) .app-shell>.main{height:100vh;overflow-y:auto;overflow-x:hidden;scrollbar-width:none;-ms-overflow-style:none;overscroll-behavior:none}
  html:not(.notes-editing):not([data-r28-route="calendar"]) .app-shell>.main::-webkit-scrollbar{display:none;width:0;height:0}
  /* the top padding moves into the pinned title row, otherwise the row would stick 40px below the edge */
  html:not(.notes-editing):not([data-r28-route="calendar"]) .app-shell>.main{padding-top:0!important}
  html:not(.notes-editing):not([data-r28-route="calendar"]) .app-shell>.main>.topbar{padding-top:40px}
}

/* No elastic bounce / scroll chaining at the end of any scroll area (it made the tab, the Dashboard and the rose jump). */
html,body,.sidebar,.app-shell>.main,.rightbar,.rightbar-scroll{overscroll-behavior:none!important}
/* The calendar keeps the page scroll: its wheel handlers (day change at the end of the list) read the page scroll position. */

/* К2. Phone / mobile web calendar: the whole page (month grid + the day's task list) scrolls up and down. */
@media (max-width:767px){
  html.v76-phone[data-r28-route="calendar"] .app-shell>.main{overflow-y:auto!important;height:100dvh!important;padding-bottom:96px!important;overscroll-behavior:none;-webkit-overflow-scrolling:touch}
  html.v76-phone[data-r28-route="calendar"] .v56-calendar-shell{height:auto!important;min-height:0!important;display:block!important;overflow:visible!important}
  html.v76-phone[data-r28-route="calendar"] .v56-calendar-agenda{height:auto!important;max-height:none!important;overflow:visible!important;touch-action:auto!important}
}

/* М6. The Dashboard always arrives from the right (the tab itself still rises from below). */
@keyframes r28-from-right{from{opacity:0;transform:translateX(40px)}to{opacity:1;transform:none}}
.rightbar.r27-route-enter,.rightbar .r27-route-enter{animation:r28-from-right .3s ease-out both!important}
@media(prefers-reduced-motion:reduce){.rightbar.r27-route-enter,.rightbar .r27-route-enter{animation:none!important}}

/* М7 (2026-09-23, "мелкие правки" п.1): единый шрифт/размер чипов выбора артефакта
 * в ЛЮБОЙ форме (обычная задача, «Цель с цифрами» и т.п.) — кнопка «Напоминание»
 * отличалась от соседних чипов «Тэги»/«Проект / идея»/«Контакт»: молча наследовала
 * body-text (17px) через более специфичное :is()-правило в task-menu-r19.css, а
 * соседние чипы сами были на 15px, а не задуманных r26d-правилом 13px (ещё одна
 * более специфичная поздняя переопределяющая заготовка). Используем ту же
 * специфичность-перебивку (.v19-task-menu×3), что соседние правила чипов дальше по
 * каскаду в этом же файле — она достаточна, чтобы выиграть у обоих конкурентов. */
.v19-task-menu.v19-task-menu.v19-task-menu .v19-pickers-chips>button,
.v19-task-menu.v19-task-menu.v19-task-menu .v19-pickers-chips>button *:not(.v22-icon):not(svg):not(path){
  font-size:13px!important;font-weight:600!important;
}
