/* Dashboard: top bar, next pair + agent, recent notes. Restrained motion. */

.db {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  /* Место под таббар добавляет base.css (body.has-tabbar) — общее для всех
     корневых экранов, а не своё у дашборда. */
  padding-bottom: var(--s-8);
}

/* ---------- Top bar ---------- */
.db-top {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.db-top__inner {
  display: flex;
  align-items: center;
  gap: var(--s-5);
  min-height: calc(64px + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
}
.db-top__right {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-left: auto;
}

.db-nav {
  display: none;
  gap: var(--s-1);
}
@media (min-width: 900px) {
  .db-nav { display: flex; }
}
/* Same gap after the logo as on the dashboard, so the nav stays in place when switching sections. */
.container.sc-top__inner,
.container.hw-top__inner,
.container.lib-top__inner,
.container.cu-top__inner,
.container.ag-top__inner { gap: var(--s-5); }
/* The back arrow is for the screens without the section nav (phone); on a wide screen the nav replaces it. */
@media (min-width: 900px) {
  .sec-back { display: none; }
}
.db-nav__link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 var(--s-3);
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-2);
  font-size: var(--fs-14);
  font-weight: 500;
  transition: color var(--dur-micro) var(--ease-out), background-color var(--dur-micro) var(--ease-out);
}
.db-nav__link:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.db-nav__link[aria-current="page"] { color: var(--text); background: var(--surface-2); font-weight: 600; }
/* Выключенный раздел (App.nav.isOff — Аркада на паузе): виден, но серый и
   без отклика на наведение, чтобы не обещать клик, которого не будет. */
.db-nav__link:disabled,
.db-nav__link:disabled:hover { color: var(--text-3); background: transparent; opacity: 0.55; cursor: not-allowed; }
/* Метка недоделанного раздела (nav.js, beta). Маленькая и тихая: подпись,
   а не призыв — раздел всё равно на паузе. */
.db-nav__beta {
  margin-left: 5px;
  padding: 1px 5px;
  border-radius: var(--r-full);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 0.625rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.02em;
}

/* 900-1279px: лого + разделы + поиск/звёзды/тема/аватар в один ряд без
   переноса — на этой ширине им тесно (Влад, 25.09, «узкое окно»/«съехал
   интерфейс»: не таббар, а сам десктопный ряд не влезал и жал аватар за
   край). Слово в лого уже снято общим правилом в base.css — здесь дожимаем
   отступы самой строки разделов и промежутки по бокам от неё, ничего не пряча.
   Когда в строку вернулась «Аркада» (седьмой пункт, 25.09), запас с прошлого
   раза кончился — на ровно 900px аватар снова вылезал за край на ~19px
   (проверено живьём), поэтому жмём сильнее: padding пунктов и промежуток
   между ними — тоже, не только сама строка и правая кучка. */
@media (min-width: 900px) and (max-width: 1279px) {
  /* Every section header, not only home's: a 24px gap elsewhere moved the nav 16px on each switch (13.10). */
  .db-top__inner,
  .container.sc-top__inner,
  .container.hw-top__inner,
  .container.lib-top__inner,
  .container.cu-top__inner,
  .container.ag-top__inner { gap: var(--s-2); }
  .db-nav { gap: 2px; }
  .db-nav__link { padding: 0 6px; }
  .db-top__right { gap: var(--s-2); }
}

/* Avatar + menu (native popover escapes stacking contexts) */
.avatar-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: var(--r-md);
  background: var(--accent);
  color: #FFFFFF;
  font-family: var(--font-display);
  font-size: var(--fs-14);
  font-weight: 800;
  transition: box-shadow var(--dur-state) var(--ease-out);
}
.avatar-btn:hover { box-shadow: var(--glow-accent); }
@media (pointer: coarse) {
  .avatar-btn { width: 44px; height: 44px; }
}

.menu {
  inset: auto;
  position: fixed;
  top: calc(var(--top-h) + env(safe-area-inset-top, 0px));
  right: var(--gutter);
  margin: 0;
  width: min(280px, calc(100vw - 2 * var(--gutter)));
  padding: var(--s-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface-raised);
  color: var(--text);
  box-shadow: var(--shadow-md);
}
[data-theme="dark"] .menu { box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5); }
.menu:popover-open { animation: menu-in var(--dur-state) var(--ease-out); }
@keyframes menu-in {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
}
.menu__head { padding: var(--s-3); border-bottom: 1px solid var(--border); margin-bottom: var(--s-2); }
.menu__name { font-weight: 600; }
.menu__meta { font-size: var(--fs-14); color: var(--text-2); }
.menu__item {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  width: 100%;
  min-height: 44px;
  padding: 0 var(--s-3);
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  text-align: left;
  font-size: var(--fs-14);
}
/* Пункт «Войти через ЛК» появляется только без сессии и в этот момент важнее
   остальных: без него на экранах демо, и студент об этом может не знать. */
.menu__item--accent {
  color: var(--accent-text);
  font-weight: 600;
}
.menu__item--accent svg { color: var(--accent-text); }
.menu__item svg { width: 18px; height: 18px; color: var(--text-2); }
.menu__item:hover { background: var(--surface-2); }
.menu__item:disabled,
.menu__item:disabled:hover { color: var(--text-3); background: transparent; opacity: 0.55; cursor: not-allowed; }
/* «Агент» в меню нужен только телефону: в его таббаре пункта нет, а на
   широком экране раздел стоит в навигации шапки. */
@media (min-width: 900px) {
  .menu__item--phone { display: none; }
}

/* ---------- Greeting ---------- */
.db-hello-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--s-5);
}
.db-hello-row .db-hello { flex: 1 1 320px; min-width: 0; }
/* Квадратный загон питомца рядом с приветствием — вертикальные отступы
   подогнаны под padding-block .db-hello ниже, чтобы верх и низ совпадали
   на обеих раскладках. */
.db-hello-row .pen--square {
  flex: none;
  width: 132px;
  height: 132px;
  margin: var(--s-6) 0 var(--s-5);
}
@media (min-width: 900px) {
  .db-hello-row .pen--square { width: 152px; height: 152px; margin-top: var(--s-7); margin-bottom: var(--s-6); }
}

.db-hello {
  display: grid;
  gap: var(--s-3);
  padding-block: var(--s-6) var(--s-5);
}
@media (min-width: 900px) {
  .db-hello { padding-block: var(--s-7) var(--s-6); }
}
.db-hello__date {
  color: var(--text-2);
  font-size: var(--fs-14);
  font-weight: 500;
}
.db-hello__date::first-letter { text-transform: uppercase; }
.db-hello__title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  letter-spacing: -0.045em;
}
.db-hello__summary {
  max-width: 60ch;
  color: var(--text-2);
  font-size: var(--fs-18);
}
.db-hello__summary strong {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.db-hello__summary strong { color: var(--text); font-weight: 700; }
.db-hello__summary .is-hot { color: var(--danger-text); }

/* Зверёк с репликой: одна строка рядом с загоном. На телефоне пузыря нет —
   там он стоял бы между приветствием и парой и толкал её за первый экран. */
/* Редизайн 2: на главной зверька нет — экран как в прототипе, без картинок.
   Загон остаётся в разметке (звёзды питомца копятся), просто не показывается. */
.db-pet { display: none; }
.db-top .star-count { display: none; }
.db-pet__say { display: none; }
@media (min-width: 900px) {
  .db-pet__say:not([hidden]) {
    display: block;
    position: relative;
    max-width: 240px;
    margin-bottom: calc(var(--s-6) + var(--s-5));
    padding: var(--s-3) var(--s-4);
    border: 1px solid var(--border);
    border-radius: 14px 14px 4px 14px;
    background: var(--surface);
    color: var(--text-2);
    font: 500 var(--fs-14)/1.4 var(--font-ui);
    text-align: left;
    cursor: pointer;
  }
}
/* The homework part of the summary is the entry point to the list; it looks like every other link (.who-link,
   css/teacher.css). */

/* ---------- Подписка ---------- */
.db-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  margin-top: var(--s-2);
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
}
.db-sub--off { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, var(--surface)); }
.db-sub__text { font-size: var(--fs-14); color: var(--text-2); }
.db-sub__text b { color: var(--text); font-weight: 600; }
.db-sub__actions { display: flex; flex-wrap: wrap; gap: var(--s-2); }

/* ---------- Ссылки с пары ---------- */
/* Лента дня, а не архив: секции нет вовсе, когда сегодня ничего не кидали. */
.db-links {
  display: grid;
  gap: var(--s-4);
}
@media (min-width: 900px) {
  .db-links { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--s-5); }
}
.db-links__pair {
  display: grid;
  align-content: start;
  gap: var(--s-3);
  min-width: 0;
  padding: var(--s-4) var(--s-5);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: var(--surface);
}
.db-links__subject { color: var(--text-2); font-size: var(--fs-14); }
.db-links__list {
  display: grid;
  gap: var(--s-3);
  margin: 0;
  padding: 0;
  list-style: none;
}
.db-links__item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "icon link" "icon quote";
  gap: 2px var(--s-3);
  align-items: center;
}
.db-links__icon {
  grid-area: icon;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--accent-text);
}
.db-links__icon svg { width: 15px; height: 15px; }
.db-links__link {
  grid-area: link;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  color: var(--text);
}
.db-links__link:hover { color: var(--accent-text); }
.db-links__quote {
  grid-area: quote;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-3);
  font-size: var(--fs-12);
}

/* ---------- Panels ---------- */
.panel {
  position: relative;
  border: 0;
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--shadow-sm), var(--shadow-inset);
}
.panel__label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
  color: var(--text-2);
  font-size: var(--fs-14);
  font-weight: 600;
}
.panel__label { font-weight: 500; }
/* Предмет ближайшей пары — точка его цвета перед названием. */
.next__subj { display: inline-flex; align-items: center; gap: var(--s-2); }
.next__subj::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--subj, var(--accent-text)); flex: none; }

.db-now {
  display: grid;
  /* minmax(0, …): a bare 1fr column grows to its widest content and pushed the page past 360px. */
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s-4);
}
@media (min-width: 900px) {
  .db-now { grid-template-columns: 7fr 5fr; gap: var(--s-5); }
}

/* Next pair */
.next {
  display: grid;
  gap: var(--s-5);
  padding: var(--s-5);
}
@media (min-width: 600px) {
  .next { padding: var(--s-6); }
}
.next__subject {
  font-size: clamp(1.875rem, 3.6vw, 2.75rem);
  letter-spacing: -0.04em;
}
.next__topic { color: var(--text-2); font-size: var(--fs-18); }
.next__meta { margin-top: calc(-1 * var(--s-3)); color: var(--text-2); }
.next__meta strong { color: var(--text-2); font-weight: 400; font-variant-numeric: tabular-nums; }
.next__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3) var(--s-5); }

/* Шапка карточки — обычная поверхность (редизайн 1.1): предмет узнаётся по
   точке его цвета у метки, а не по заливке всей шапки. */
.next__head { display: grid; gap: var(--s-5); }

.next__tags { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
/* До пары — нейтральный бейдж: фиолетовым на экране залита одна кнопка
   (редизайн 1.1). Идущая пара — цвет «в эфире». */
.countdown { background: var(--surface-2); color: var(--text-2); font-variant-numeric: tabular-nums; }
.countdown.is-live { background: var(--live); color: var(--live-ink); }

/* Day strip: today's pairs as a timeline */
.day {
  display: grid;
  /* Пар в дне бывает от одной до четырёх — фиксированные четыре колонки
     оставляли пустые клетки в лёгкие дни. */
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: var(--s-2);
  margin: 0;
  padding: var(--s-2) 0 0;
  list-style: none;
}
.day__item { display: grid; align-content: start; gap: var(--s-2); min-width: 0; }

/* Отметка «Здесь» на паре. Галочка, а не ещё одна подпись: колонка дня узкая,
   а сказать надо одно — агент за тебя отметился. Подробности (во сколько и
   как расслышал фамилию) висят в title и читаются экранным диктором из
   .sr-only рядом. */
.day__mark {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--success);
}
.day__mark svg { width: 13px; height: 13px; }
.day__item.is-done .day__mark { opacity: 0.75; }

/* Строка переклички в панели агента. Форма — та же таблетка, что у строки про
   железо: обе отвечают на «что агент сделал/может», и заводить им два разных
   вида значило бы придумать второй приём для одного смысла. */
.agent__roll {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  align-self: flex-start;
  max-width: 100%;
  padding: 6px 12px 6px 10px;
  border: 0;
  border-radius: var(--r-full);
  background: var(--surface-2);
  color: var(--text-2);
  font-family: inherit;
  font-size: var(--fs-12);
  font-weight: 600;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out);
}
.agent__roll svg { width: 14px; height: 14px; flex: none; }
.agent__roll svg:first-child { color: var(--success); }
.agent__roll strong { color: var(--text); }
.agent__roll:hover { border-color: var(--border-strong); color: var(--text); }
.agent__roll:hover svg:last-child { transform: translateX(3px); }
.agent__roll svg:last-child { transition: transform var(--dur-micro) var(--ease-out); }

/* Перекличек не было — это сообщение, а не кнопка: вести с него некуда. */
.agent__roll.is-none {
  background: transparent;
  border-style: dashed;
  cursor: default;
}
.agent__roll.is-none svg:first-child { color: var(--text-3); }

/* Полоска дня раньше никуда не вела — теперь это вход в неделю целиком. */
.next__week {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  justify-self: start;
  margin-top: calc(var(--s-5) * -1 + var(--s-3));
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text-2);
  font-size: var(--fs-14);
  font-weight: 600;
}
.next__week svg {
  width: 14px;
  height: 14px;
  color: var(--text-3);
  transition: transform var(--dur-micro) var(--ease-out);
}
.next__week:hover { color: var(--text); }
.next__week:hover svg { transform: translateX(3px); color: var(--accent-text); }
.day__bar {
  position: relative;
  height: 4px;
  border-radius: var(--r-full);
  background: var(--surface-2);
  overflow: hidden;
}
.day__bar span {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--subj, var(--text-3));
  transform-origin: left center;
  transform: scaleX(var(--p, 0));
}
.day__item.is-done .day__bar span { opacity: 0.55; }
.day__time { font-size: var(--fs-12); font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.day__name::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  vertical-align: 0.1em;
  background: var(--subj, var(--text-3));
}
.day__name {
  font-size: var(--fs-12);
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.day__item.is-done .day__time,
.day__item.is-done .day__name { color: var(--text-3); }
/* На телефоне четыре колонки по ~70px превращали предметы в «Методы с…» и
   «Machine L…». Там полоска едет вбок: у колонки своя нормальная ширина и
   предмет в две строки, а следующая пара выглядывает из-за края — видно, что
   дальше есть ещё. */
@media (max-width: 519px) {
  .day {
    grid-auto-columns: minmax(118px, 1fr);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    padding-bottom: var(--s-1);
  }
  .day::-webkit-scrollbar { display: none; }
  .day__item { scroll-snap-align: start; }
  .day__name {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    white-space: normal;
  }
}

/* Agent */
/* desc row absorbs spare height so the footer sits at the bottom when the card is stretched */
/* Колонка, а не сетка строк: строк у карточки от трёх до семи в зависимости
   от состояния, и с картинкой сверху позиции строк всё равно бы съехали.
   Низ карточки прижат к низу через margin-top: auto у .agent__foot. */
.agent {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  padding: var(--s-5);
}
.agent > .panel__label { margin-bottom: 0; }


/* Короткая сводка по железу: ответ «можно ли рассчитывать на агента сегодня».
   Список самих проверок — на отдельном экране, тут он был бы стеной. */
.agent__devices {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  align-self: flex-start;
  padding: 6px 12px 6px 10px;
  border: 0;
  border-radius: var(--r-full);
  background: var(--surface-2);
  color: var(--text-2);
  font-family: inherit;
  font-size: var(--fs-12);
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out);
}
.agent__devices svg {
  width: 13px;
  height: 13px;
  transition: transform var(--dur-micro) var(--ease-out);
}
.agent__devices:hover { border-color: var(--border-strong); color: var(--text); }
.agent__devices:hover svg { transform: translateX(3px); }
.agent__devicesDot {
  width: 7px;
  height: 7px;
  border-radius: var(--r-full);
  background: var(--success);
}
.agent__devices.is-warn .agent__devicesDot { background: var(--warning); }
.agent__devices.is-off .agent__devicesDot { background: var(--danger); }
@media (min-width: 600px) {
  .agent { padding: var(--s-6); }
}
.agent__status {
  font-family: var(--font-display);
  font-size: 1.3125rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.agent__status em { font-style: normal; color: var(--accent-text); }
.agent__desc { color: var(--text-2); }
.agent__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  margin-top: auto;
  padding-top: var(--s-2);
  font-size: var(--fs-14);
  color: var(--text-2);
}
.agent__foot strong { color: var(--text); font-variant-numeric: tabular-nums; }

/* The weekly count is also the way into the agent log: the number is what the log is about. */
.agent__log {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
}
.agent__log svg {
  width: 14px;
  height: 14px;
  color: var(--text-3);
  transition: transform var(--dur-micro) var(--ease-out);
}
.agent__log:hover { color: var(--text); }
.agent__log:hover svg { transform: translateX(3px); color: var(--accent-text); }
.agent.is-paused .pulse-dot::after { animation: none; }

/* ---------- Notes ---------- */
.db-section { padding-top: var(--s-8); }
.db-section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-4);
  margin-bottom: var(--s-4);
}
.db-section__title { font-size: clamp(1.75rem, 3vw, 2.5rem); letter-spacing: -0.04em; }
.db-section__link {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  font-size: var(--fs-16);
  font-weight: 500;
}
.db-section__link svg { display: none; }
.db-section__link::after { content: "\203A"; }

/* ---------- Где горит ---------- */
.db-burn__hint { max-width: 64ch; margin: calc(-1 * var(--s-2)) 0 var(--s-3); color: var(--text-3); font-size: var(--fs-12); line-height: 1.5; }
.db-burn__empty { color: var(--text-2); font-size: var(--fs-14); }
/* Есть просрочка — точка цвета опасности перед предметом: «горит»
   по-настоящему, в отличие от строк, где всё ещё успеваешь. */
.db-burn__row.is-hot .db-burn__subject::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  flex: none;
}
/* Список одной плоскостью, строки через тонкую линию — как «Настройки». */
.db-burn__list { display: grid; margin: 0; padding: 0; list-style: none; border-radius: 18px; background: var(--surface); overflow: hidden; }
.db-burn__row {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-5);
}
.db-burn__row + .db-burn__row::before { content: ""; position: absolute; top: 0; left: var(--s-5); right: 0; height: 1px; background: var(--border); }
.db-burn__subject { display: inline-flex; align-items: center; gap: var(--s-2); font-size: var(--fs-16); font-weight: 500; }
.db-burn__reasons { display: flex; flex-wrap: wrap; gap: var(--s-2); }

/* Редизайн 2: свежие конспекты — список одной плоскостью, как в прототипе. */
.notes { display: grid; border-radius: 18px; background: var(--surface); overflow: hidden; }

.note {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-4) var(--s-5);
  color: inherit;
  text-align: left;
  transition: background-color var(--dur-micro) var(--ease-out);
}
.note + .note::before { content: ""; position: absolute; top: 0; left: calc(var(--s-5) + 8px + var(--s-4)); right: 0; height: 1px; background: var(--border); }
.note:hover { background: var(--surface-2); }
.note:has(.note__link:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }
.note__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--subj, var(--text-3)); }

/* Вся строка кликабельна через ссылку темы; бейдж домашки лежит поверх. */
.note__link { color: inherit; }
.note__link:hover { text-decoration: none; }
.note__link:focus-visible { outline: none; }
.note__link::after { content: ""; position: absolute; inset: 0; z-index: 0; }

.note__body { min-width: 0; display: grid; gap: 2px; }
.note__topic {
  text-wrap: pretty;
  font-size: var(--fs-16);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.015em;
}
.note__meta { font-size: var(--fs-14); color: var(--text-3); }
.note__meta b { font-weight: 400; }
.note__chev { color: var(--text-3); }
.note__chev svg { width: 18px; height: 18px; }
.badge--hw { background: var(--warning-soft); color: var(--text); }
.badge--hw::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--warning);
}
button.badge--hw {
  position: relative;
  z-index: 1;
  border: 0;
}
button.badge--hw svg { width: 12px; height: 12px; color: var(--text-2); }
@media (pointer: coarse) {
  button.badge--hw::after { content: ""; position: absolute; inset: -9px -4px; }
  .next__week,
  .db-section__link { min-height: 44px; }
}

/* ---------- Skeleton states ---------- */
.sk-line { height: 14px; }
.sk-line--lg { height: 36px; width: 70%; }
.sk-line--md { height: 18px; width: 50%; }
.sk-stack { display: grid; gap: var(--s-3); }

/* ---------- Позвать группу ---------- */
/* Самый низ страницы, после всей работы, — там он ни с чем не спорит.
   Обычная поверхность с маскотом (редизайн 1.1): сноска, а не плакат. */
.db-invite {
  display: grid;
  gap: var(--s-4);
  margin: var(--s-8) 0 var(--s-6);
  padding: var(--s-5);
  border: 0;
  border-radius: var(--r-xl);
  background: var(--surface);
}
@media (min-width: 760px) {
  .db-invite { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--s-6); padding: var(--s-6); }
}
.db-invite__body { display: grid; gap: var(--s-2); }
.db-invite__title {
  font-family: var(--font-display);
  font-size: var(--fs-18);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.db-invite__text { max-width: 52ch; color: var(--text-2); font-size: var(--fs-14); line-height: 1.6; }

.db-invite__actions { display: grid; gap: var(--s-2); justify-items: start; }
.db-invite__link {
  max-width: 100%;
  padding: var(--s-2) var(--s-3);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text-2);
  font-family: var(--font-ui);
  font-size: var(--fs-12);
  overflow-wrap: anywhere;
  user-select: all;
}
.db-invite__buttons { display: flex; flex-wrap: wrap; gap: var(--s-2); }

/* A called name the agent did not answer: the one line on the card that asks for action. */
.agent__roll.is-miss { border-color: var(--warning); color: var(--text); }
.agent__roll.is-miss svg:first-child { color: var(--warning); }

/* Pairs whose note is not ready yet: state in words, no link, nothing drawn in its place. */
.note__state { margin: 4px 0 0; color: var(--text-2); font-size: 0.9375rem; }
.note__state.is-failed { color: var(--danger-text); }
.notes__empty { margin: 0; padding: 20px 0; color: var(--text-2); }

/* ---------- «Сделать до конца пары» ---------- */
.db-urgent {
  display: flex;
  gap: var(--s-3);
  align-items: flex-start;
  margin-top: var(--s-5);
  padding: var(--s-4) var(--s-5);
  border: 1px solid var(--danger);
  border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--danger) 10%, var(--surface));
}
.db-urgent__icon { color: var(--danger-text); flex: none; }
.db-urgent__icon svg { width: 20px; height: 20px; }
.db-urgent__title { font-weight: 700; }
.db-urgent__text { color: var(--text-2); font-size: var(--fs-14); }
/* «Тебя назвали»: a signal, not an alarm — accent, not danger. */
.db-urgent--asked { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.db-urgent--asked .db-urgent__icon { color: var(--accent-text); }
.db-urgent__radio { display: flex; gap: var(--s-2); align-items: center; flex-wrap: wrap; margin-top: var(--s-2); }
.db-urgent__radio .btn svg { width: 14px; height: 14px; }
.db-links__off { color: var(--text-3); font-size: var(--fs-14); }

/* ================= Редизайн 3: главная 1:1 с прототипом 4 (ROADMAP §16.1) =================
   Слева «сейчас» (ближайшая пара, полоса дня, кнопки внизу), справа две плитки:
   агент и цифра недели. Заголовки секций — Onest 20px со ссылкой «Все →». */
@media (min-width: 1024px) {
  .db-now { grid-template-columns: 1.6fr 1fr; gap: 16px; }
}
.db-side { display: grid; gap: 16px; align-content: start; }
@media (min-width: 1024px) { .db-side { grid-template-rows: auto 1fr; align-content: stretch; } }

/* «Сейчас» */
.panel.next { gap: 28px; padding: 32px; align-content: space-between; }
@media (max-width: 599px) { .panel.next { padding: 24px; gap: 22px; } }
.next__top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.next__subj { font-size: var(--fs-14); }
.panel.next .next__subj { color: var(--now-2); }
.next__subject { font-size: clamp(1.9rem, 3.6vw, 3rem); line-height: 1.04; letter-spacing: -0.055em; max-width: 15ch; }
.next__meta { margin-top: 10px; font-variant-numeric: tabular-nums; }
.next__soon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--r-full);
  background: color-mix(in srgb, var(--now-fg) 10%, transparent);
  color: var(--now-fg);
  font-size: var(--fs-14);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.panel.next .badge--neutral { background: color-mix(in srgb, var(--now-fg) 10%, transparent); color: var(--now-fg); }
.next__actions { gap: 10px; }
.next__actions .next__week { margin-left: 6px; }
/* Ссылки в «сейчас» — цвет сливы, не фиолетовый: на лаванде он спорит с ней. */
.panel.next .link-more { color: var(--now-fg); }
/* Онлайн-пара: главная — «Открыть в МТС Линк», брифинг уходит во вторые. */
.panel.next .next__actions:has([data-soon="join"]) .brf__btn { --btn-bg: color-mix(in srgb, var(--now-fg) 10%, transparent); --btn-fg: var(--now-fg); }

/* Полоса дня по часам */
.tl { display: grid; gap: 8px; }
.tl__bar { position: relative; height: 6px; border-radius: 6px; background: color-mix(in srgb, var(--now-fg) 12%, transparent); }
.tl__seg { position: absolute; top: 0; bottom: 0; border-radius: 6px; background: color-mix(in srgb, var(--now-fg) 35%, transparent); transform-origin: left center; }
.tl__seg.is-done { background: color-mix(in srgb, var(--now-fg) 22%, transparent); }
.tl__seg.is-next { background: var(--now-fg); }
.tl__now { position: absolute; top: -5px; width: 2px; height: 16px; margin-left: -1px; border-radius: 2px; background: #E5484D; }
.tl__ticks { display: flex; justify-content: space-between; color: var(--now-2); font-size: 0.75rem; font-variant-numeric: tabular-nums; }

/* Плитка агента: иконка со статус-точкой, заголовок, строка */
.panel.agent { display: grid; gap: 14px; padding: 24px; align-content: space-between; }
.agent__head { display: flex; align-items: center; gap: 14px; }
.agent__title { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.025em; line-height: 1.25; }
.panel.agent .agent__status { margin: 0; color: var(--text-3); font-family: var(--font-ui); font-size: var(--fs-14); font-weight: 400; letter-spacing: 0; line-height: 1.45; }
.panel.agent .agent__status em { color: var(--text-2); }
.panel.agent .agent__desc { color: var(--text-2); font-size: 0.9375rem; }
.panel.agent .agent__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; padding-top: 0; border-top: 0; }
.agent-stage {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: 0;
  border: 0;
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--accent-text);
}
.agent-stage svg { width: 24px; height: 24px; }
.agent-stage.is-off { background: var(--surface-2); color: var(--text-3); }
.agent-stage__dot { top: -2px; right: -2px; width: 12px; height: 12px; background: var(--border-strong); box-shadow: 0 0 0 3px var(--surface); }
.agent-stage.is-wait .agent-stage__dot { background: var(--lime); }
.agent-stage.is-live .agent-stage__dot { background: #E5484D; }
/* Строки «перекличка / сон / железо» — тихие строки, не таблетки. */
.panel.agent .agent__roll,
.panel.agent .agent__devices { min-height: 0; padding: 0; border: 0; background: transparent; color: var(--text-2); font-size: var(--fs-14); text-align: left; }

/* Цифра недели */
/* Stretched with the pair card, the tile became a tall empty block when the briefing opened, and space-between tore
   the number from its words (ROADMAP-26.09 §32). */
/* Always its own height: switching between stretched and own height made the tile jump with every toggle. */
.db-stat { display: grid; gap: 10px; align-content: start; align-self: start; padding: 24px; }
.db-stat__num { font-family: var(--font-headline); font-size: 3.25rem; font-weight: 600; letter-spacing: -0.06em; line-height: 1; color: var(--accent-text); font-variant-numeric: tabular-nums; }
.db-stat__text { color: var(--text-2); }
/* «Что важнее всего»: подпись, значение, строка; вся плитка — переход (накладка-кнопка поверх). */
.db-stat { position: relative; }
.db-stat__kicker { color: var(--text-3); font-size: var(--fs-14); font-weight: 600; }
/* A deadline in words («просрочено на 2 дня») at the digit size swelled the tile. */
.db-stat__text b { color: var(--danger-text, var(--text)); font-weight: 600; }
.db-stat__more { display: block; margin-top: 6px; color: var(--text-3); font-size: var(--fs-14); }
.db-stat__num--word { font-size: 1.75rem; letter-spacing: -0.03em; line-height: 1.1; }
.db-stat__num small { font-size: 0.45em; color: var(--text-3); letter-spacing: 0; }
.db-stat__go { position: absolute; inset: 0; z-index: 1; padding: 0; border: 0; border-radius: inherit; background: transparent; cursor: pointer; }
.db-stat__go:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.db-stat:has(.db-stat__go) { transition: transform var(--dur-micro) var(--ease-out), box-shadow var(--dur-micro) var(--ease-out); }
.db-stat:has(.db-stat__go:hover) { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* Секции: заголовок Onest 20px + «Все →», как list-head в прототипе */
.db-section { padding-top: 40px; }
.db-section__head { align-items: baseline; margin-bottom: 16px; }
.db-section__title { font-family: var(--font-ui); font-size: 1.25rem; font-weight: 600; letter-spacing: -0.025em; line-height: 1.25; }
.db-section__link::after { content: "\2192"; }
.db-section__link { font-size: var(--fs-16); }
.db-burn__hint { margin: -8px 0 16px; font-size: var(--fs-14); }
.notes, .db-burn__list { border-radius: var(--r-xl); }
.note { padding: 18px 24px; gap: 16px; }
.note + .note::before { left: 48px; }
.note:hover { background: color-mix(in srgb, var(--surface-2) 55%, var(--surface)); }
.db-burn__row { padding: 18px 24px; }
.db-burn__row + .db-burn__row::before { left: 24px; }
.db-invite { padding: 28px; }
.db-invite__title { font-family: var(--font-ui); font-size: 1.25rem; font-weight: 600; letter-spacing: -0.025em; }
.db-invite__link { border: 0; border-radius: var(--r-md); padding: 10px 14px; }

/* Day strip, readable (Max 07.10): every pair a labelled block — start time and subject code, a tick once it
   has passed; a caption above says what the strip is. The hour scale under it is gone: the blocks carry the time. */
.tl__cap { display: flex; justify-content: space-between; gap: 12px; margin: 0; color: var(--now-2); font-size: 0.8125rem; }
.tl__capnow { display: inline-flex; align-items: center; gap: 6px; }
.tl__capnow::before { content: ""; width: 2px; height: 12px; border-radius: 2px; background: #E5484D; }
.tl__bar { height: 30px; border-radius: 10px; }
.tl__seg { border-radius: 10px; overflow: hidden; }
.tl__now { top: -4px; height: 38px; }
.tl__label { display: flex; align-items: center; gap: 6px; height: 100%; padding: 0 10px; white-space: nowrap; color: var(--now-fg); font-size: 0.75rem; }
.tl__label svg { width: 12px; height: 12px; flex: none; }
.tl__seg.is-next .tl__label { color: var(--now-bg); }
.tl__code { opacity: 0.75; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 599px) {
  .tl__label { gap: 4px; padding: 0 6px; font-size: 0.6875rem; justify-content: center; }
  .tl__label svg, .tl__code { display: none; }
}

/* «Новое из ЛК» (Max 12.10): checked / sent back / new points since the last look. One flat list, colour only on
   the icon of a work sent back. */
.db-lxp { display: grid; border-radius: var(--r-xl); background: var(--surface); overflow: hidden; }
.db-lxp__item { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 14px 24px; }
.db-lxp__item + .db-lxp__item::before { content: ""; position: absolute; top: 0; left: 62px; right: 0; height: 1px; background: var(--border); }
.db-lxp__icon { display: grid; place-items: center; width: 24px; height: 24px; color: var(--accent-text); }
.db-lxp__icon svg { width: 18px; height: 18px; }
.db-lxp__item.is-rework .db-lxp__icon { color: var(--danger-text); }
.db-lxp__link { min-width: 0; color: var(--text); }
.db-lxp__link:hover { text-decoration: none; }
.db-lxp__link::after { content: ""; position: absolute; inset: 0; }
.db-lxp__item:hover { background: color-mix(in srgb, var(--surface-2) 55%, var(--surface)); }
.db-lxp__subj { color: var(--text-3); font-size: var(--fs-14); white-space: nowrap; }
.db-lxp__more { margin-top: 8px; color: var(--text-3); font-size: var(--fs-14); }
@media (max-width: 599px) {
  .db-lxp__item { grid-template-columns: auto minmax(0, 1fr); padding: 14px 20px; }
  .db-lxp__subj { grid-column: 2; white-space: normal; }
}

/* Main v2: у состояния агента свой оттенок — ждёт пару шалфеем; пишет — лаванда «сейчас»
   и красная точка (красный только у записи); выключен — нейтральный. */
.agent-stage.is-wait { background: color-mix(in srgb, var(--lime) 26%, var(--lime-soft)); color: var(--lime-ink); }
.agent-stage.is-wait .agent-stage__dot { background: var(--success); }
.agent-stage.is-live { background: var(--now-bg); color: var(--now-fg); }

/* Main v2: полоса дня — пары на подложках своих предметов, следующая чернилами «сейчас»,
   прошедшие гаснут. */
.tl__seg[class*="s-"] { background: var(--subj-soft); }
.tl__seg[class*="s-"] .tl__label { color: var(--subj-ink); }
.tl__seg.is-done[class*="s-"] { opacity: 0.55; }
.tl__seg.is-next[class*="s-"] { background: var(--now-fg); }
.tl__seg.is-next[class*="s-"] .tl__label { color: var(--now-bg); }

/* Main v2: «Новое из ЛК» — значок в кружке цвета события: проверили — шалфей,
   вернули — абрикос, новые баллы — масло. */
.db-lxp__icon { width: 36px; height: 36px; border-radius: 50%; background: var(--butter-soft); color: var(--butter-ink); }
.db-lxp__item.is-passed .db-lxp__icon { background: var(--lime-soft); color: var(--lime-ink); }
.db-lxp__item.is-rework .db-lxp__icon { background: var(--tang-soft); color: var(--tang-ink); }
.db-lxp__item + .db-lxp__item::before { left: 74px; }

/* «Агент не на связи» до пары (А1): above «Сейчас», the button under the sentence. */
.db-silent { margin: 0 0 var(--s-5); }
.db-silent .btn { margin-top: var(--s-3); }

/* «Тебя не отметили» (А3): a thing to do, not an alarm — warning, the draft folded under it. */
.db-marks { border-color: var(--warning); background: var(--warning-soft); }
.db-marks .db-urgent__icon { color: var(--text); }
.db-marks__body { flex: 1; min-width: 0; }
.db-marks__draft { margin-top: var(--s-2); }
.db-marks__draft summary { cursor: pointer; font-size: var(--fs-14); font-weight: 600; }
.db-marks__text { margin: var(--s-2) 0 var(--s-3); }
@media (max-width: 599px) { .db-marks { flex-wrap: wrap; } }

/* «Написать в чат» and «Что было на паре» while the agent sits a pair: a row under the status sentence. */
.db-agent-acts { display: flex; flex-wrap: wrap; gap: 0 var(--s-5); margin-top: var(--s-1); }
.db-agent-acts .link-more { min-height: 36px; }
