/* Главная клиента «Мой путь» и шапка кабинета клиента в новом виде (этап 2, шаг 3).
   Разметка — public/client-day.js (cd-*) и clientShell в client-home.js (cd-top, cd-lock).
   Размеры текста — только переменные сайта (--ui-body, --ui-caption, --ui-card, --ui-section), интервал --ui-leading.
   Плотность — за счёт отступов (мудборд владелицы), шрифт не уменьшается. Правила ограничены классами cd-. */

/* ---------- Шапка кабинета клиента ---------- */
.cd-top {
  display: flex;
  align-items: center;
  gap: var(--ui-space-1);
  min-height: 56px;
  margin: 0 0 var(--ui-space-4);
  padding: 0 var(--ui-space-1) 0 0;
  border-bottom: 1px solid var(--ui-rule-soft);
}
.cd-top .menuicon {
  display: none !important;
}
.cd-top__brand {
  display: flex;
  align-items: center;
  gap: 3px;
  flex: none;
  min-height: var(--ui-tap);
  padding: 0 var(--ui-space-3) 0 0;
  color: var(--ui-green-dark);
  font-size: var(--ui-card);
  font-weight: 600;
  text-decoration: none;
}
.cd-top__brand svg {
  width: 30px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linejoin: round;
}
.cd-top__hello {
  flex: 1;
  min-width: 0;
  line-height: var(--ui-leading);
}
.cd-top__hello b {
  display: block;
  overflow: hidden;
  color: var(--ui-ink);
  font-size: var(--ui-body);
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.cd-top__hello small {
  display: block;
  overflow: hidden; /* не заходит под значки шапки (независимая проверка 11.11.2026) */
  margin-top: 1px;
  color: var(--ui-muted);
  font-size: var(--ui-caption);
  font-weight: 400;
  white-space: nowrap;
  text-overflow: ellipsis;
}
body.ui-readable .cd-top :is(.notification-button, .cd-top__me) {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: var(--ui-tap);
  height: var(--ui-tap);
  min-height: var(--ui-tap);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--ui-radius);
  background: transparent;
  box-shadow: none;
  color: var(--ui-green-dark);
}
.cd-top .notification-button svg {
  width: 23px;
  height: 23px;
}
.cd-top .notification-button .message-count {
  position: absolute;
  top: 3px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  margin: 0;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--ui-red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}
.cd-top .notification-button .message-count[hidden] {
  display: none;
}
.cd-top__me .home-avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin: 0;
  border: 0;
  border-radius: 50%;
  background: var(--ui-sage);
  color: var(--ui-green);
  object-fit: cover;
  overflow: hidden;
}
.cd-top__me .home-avatar svg {
  width: 20px;
  height: 20px;
}
.cd-top__cam {
  position: absolute;
  right: 1px;
  bottom: 2px;
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 1px var(--ui-rule);
  color: var(--ui-green-dark);
}
.cd-top__cam svg {
  width: 11px;
  height: 11px;
  stroke-width: 2.2;
}
@media (min-width: 761px) {
  /* На компьютере логотип — в боковом меню */
  .cd-top__brand {
    display: none;
  }
}

/* Плашка непрочитанных уведомлений и «Доступ закрыт» — во всём кабинете клиента */
.client-layout .inbox-banner {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--ui-space-4);
  margin: 0 0 var(--ui-space-4);
  padding: var(--ui-space-2) var(--ui-space-2) var(--ui-space-2) var(--ui-space-5);
  border: 1px solid #efd7ae;
  border-radius: var(--ui-radius);
  background: #fff4e3;
  box-shadow: none;
  font-size: var(--ui-caption);
}
.client-layout .inbox-banner strong {
  flex: 1;
  font-weight: 600;
}
body.ui-readable .client-layout :is(.inbox-banner, .cd-lock) button {
  flex: none;
  width: auto;
  min-height: var(--ui-tap);
  margin: 0;
  padding: 0 var(--ui-space-5);
  border: 0;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 0 0 1px var(--ui-rule);
  color: var(--ui-green-dark);
  font-size: var(--ui-caption);
  font-weight: 600;
}
.client-layout .notice.cd-lock {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ui-space-3) var(--ui-space-5);
  margin: 0 0 var(--ui-space-4);
  padding: var(--ui-space-4) var(--ui-space-5);
  border: 1px solid #efc2c5;
  border-radius: var(--ui-radius);
  background: #fbe9e9;
  color: var(--ui-ink);
  font-size: var(--ui-caption);
}
.cd-lock > svg {
  flex: none;
  width: 20px;
  height: 20px;
  color: var(--ui-red);
}
.cd-lock > span {
  flex: 1 1 180px;
  min-width: 0;
}

/* ---------- Главная: общая колонка ---------- */
.cd-home {
  padding-bottom: var(--ui-space-6);
  color: var(--ui-ink);
  line-height: var(--ui-leading);
}
.cd-home :is(h2, h3, h4, p) {
  margin: 0;
  line-height: var(--ui-leading);
}
.cd-home svg.cd-i,
.cd-home .di.cd-i {
  flex: none;
  width: 20px;
  height: 20px;
}
.cd-home button {
  font-family: inherit;
  line-height: var(--ui-leading);
  -webkit-tap-highlight-color: transparent;
}
.cd-home :is(button, a, summary):focus-visible {
  outline: 2px solid var(--ui-focus);
  outline-offset: 2px;
}
.cd-cap {
  display: block;
  color: var(--ui-muted);
  font-size: var(--ui-caption);
}

/* ---------- Цель, награда и мой путь ---------- */
.cd-motiv > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ui-space-2) var(--ui-space-3);
  min-height: var(--ui-tap);
  padding: 0 var(--ui-space-1);
  list-style: none;
  cursor: pointer;
}
.cd-motiv > summary::-webkit-details-marker {
  display: none;
}
.cd-motiv__title {
  flex: 1;
  color: var(--ui-muted);
  font-size: var(--ui-caption);
  font-weight: 600;
}
.cd-motiv__toggle {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--ui-sage);
  color: var(--ui-green-dark);
}
.cd-motiv__toggle svg {
  transition: transform 0.15s;
}
.cd-motiv[open] .cd-motiv__toggle svg {
  transform: rotate(180deg);
}
/* Свёрнутый вид — одна строка-карточка: цель, приз, день, прогресс, монеты и личная валюта */
.cd-strip {
  display: none;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ui-space-2) var(--ui-space-6);
  width: 100%;
  margin: 0 0 var(--ui-space-2);
  padding: var(--ui-space-4) var(--ui-space-5);
  border-radius: 14px;
  background: var(--ui-surface);
  box-shadow: 0 0 0 1px var(--ui-rule);
  color: var(--ui-ink);
  font-size: var(--ui-caption);
}
.cd-motiv:not([open]) .cd-strip {
  display: flex;
}
.cd-strip b {
  font-weight: 600;
  white-space: nowrap;
}
.cd-strip__goal {
  display: flex;
  align-items: center;
  gap: var(--ui-space-3);
  width: 100%;
  font-size: var(--ui-body);
}
.cd-strip__goal b {
  color: var(--ui-wine);
  white-space: normal;
  overflow-wrap: anywhere;
}
.cd-strip__goal svg {
  width: 20px;
  height: 20px;
  color: var(--ui-green-dark);
}
.cd-strip__cur {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.cd-strip__cur svg {
  width: 20px;
  height: 20px;
}
.cd-card {
  border-radius: 14px;
  background: var(--ui-surface);
  box-shadow: 0 0 0 1px var(--ui-rule);
  overflow: hidden;
}
.cd-goal,
.cd-prize {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: var(--ui-space-5);
  padding: var(--ui-space-5) var(--ui-space-5) var(--ui-space-3);
}
.cd-prize {
  grid-template-columns: 34px minmax(0, 1fr) 62px;
  border-top: 1px solid var(--ui-rule-soft);
}
.cd-goal__icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--ui-green-dark);
  color: #fff;
}
.cd-goal__icon.is-gold {
  background: #f3e3b8;
  color: #7a5410;
}
.cd-goal__body {
  min-width: 0;
}
.cd-goal__title {
  display: block;
  margin: 1px 0 var(--ui-space-3);
  color: var(--ui-wine);
  font-size: var(--ui-card);
  font-weight: 600;
  overflow-wrap: anywhere;
}
.cd-goal__title.is-plain {
  color: var(--ui-ink);
}
.cd-prize p {
  color: var(--ui-muted);
  font-size: var(--ui-caption);
}
.cd-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ui-space-2) var(--ui-space-6);
  margin-top: var(--ui-space-1);
}
.cd-metrics small {
  display: block;
  color: var(--ui-muted);
  font-size: var(--ui-caption);
}
.cd-metrics b {
  font-size: var(--ui-body);
  font-weight: 600;
  white-space: nowrap;
}
.cd-metrics .left b {
  color: var(--ui-green);
}
.cd-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--ui-space-6);
}
body.ui-readable .cd-home .cd-link {
  min-height: var(--ui-tap);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--ui-green);
  font-size: var(--ui-caption);
  font-weight: 400;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
}
/* «Мой прогресс N / 30» — маленькая картинка справа от приза */
.cd-prize .progress-portrait {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 62px;
  margin: 0;
  padding: 0;
  color: var(--ui-muted);
  font-size: var(--ui-caption);
  text-align: center;
}
.cd-prize .progress-portrait > div {
  width: 46px;
  height: 80px;
  margin: 0;
  border-radius: 7px;
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--ui-rule-soft);
}
.cd-prize .progress-portrait :is(img, svg) {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cd-prize .progress-portrait figcaption {
  margin: 0;
  font-size: var(--ui-caption);
  line-height: var(--ui-leading);
}
.cd-prize .progress-count {
  display: block;
  color: var(--ui-ink);
  font-weight: 600;
  white-space: nowrap;
}
.cd-curs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--ui-rule-soft);
}
body.ui-readable .cd-curs button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--ui-space-3);
  min-width: 0;
  min-height: 48px;
  margin: 0;
  padding: var(--ui-space-3) var(--ui-space-3) var(--ui-space-3) var(--ui-space-4);
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--ui-ink);
  font-size: var(--ui-body);
  text-align: left;
}
.cd-curs button + button {
  border-left: 1px solid var(--ui-rule-soft) !important;
}
.cd-curs button > svg:first-child {
  flex: none;
  width: 26px;
  height: 26px;
}
.cd-curs span {
  flex: 1;
  min-width: 0;
}
.cd-curs b {
  display: block;
  font-size: var(--ui-body);
  font-weight: 600;
  overflow-wrap: anywhere;
}
.cd-curs small {
  display: block;
  color: var(--ui-muted);
  font-size: var(--ui-caption);
}
.cd-curs .cd-i {
  width: 16px;
  height: 16px;
  color: #9aa59f;
}
/* Картинка мечты меньше: маршрут на 30 дней виден целиком */
.cd-route {
  position: relative;
  margin-top: var(--ui-space-4);
  aspect-ratio: 1000 / 440;
  max-height: 280px;
  border-radius: 14px;
  background: #b8865a;
  overflow: hidden;
}
.cd-route__bg,
.cd-route__track {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.cd-route__bg {
  object-fit: cover;
}
.cd-route__title {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(20, 30, 25, 0.72);
  color: #fff;
  font-size: var(--ui-caption);
  font-weight: 600;
}
.cd-route__start {
  position: absolute;
  top: 70%;
  left: 2%;
  padding: 1px 5px;
  border-radius: 3px;
  background: #e8d3a2;
  color: #4a3a1c;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transform: rotate(-8deg);
}
.cd-route__mark {
  position: absolute;
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 3px;
  border: 1.5px solid #c99a3d;
  border-radius: 11px;
  background: #fffbee;
  color: #4a3a1c;
  font-size: 11px;
  font-weight: 700;
  transform: translate(-50%, -50%);
}
.cd-route__mark.is-current {
  min-width: 28px;
  height: 28px;
  border: 2px solid #fff;
  border-radius: 14px;
  background: #a35f17;
  color: #fff;
  font-size: 13px;
}
body.ui-readable .cd-route__me {
  position: absolute;
  display: grid;
  place-items: center;
  width: var(--ui-tap);
  height: var(--ui-tap);
  min-height: var(--ui-tap);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  box-shadow: none;
  transform: translate(-50%, -112%);
}
.cd-route__me .home-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #dfe9e1;
  color: var(--ui-green-dark);
  object-fit: cover;
  overflow: hidden;
}
.cd-route__me .home-avatar svg {
  width: 18px;
  height: 18px;
}
.cd-route__me .cd-route__cam {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 15px;
  height: 15px;
  padding: 2px;
  border-radius: 50%;
  background: #fff;
  color: var(--ui-green-dark);
}
.cd-route__day {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 8px;
  background: #fff;
  color: var(--ui-ink);
  font-size: var(--ui-caption);
  font-weight: 600;
}
.cd-route__day svg {
  width: 16px;
  height: 16px;
}

/* ---------- Фраза дня ---------- */
.cd-quote {
  position: relative;
  margin: var(--ui-space-4) 0 0;
  padding: var(--ui-space-3) var(--ui-space-6) var(--ui-space-4);
  border: 1px solid #c7d7ee;
  border-radius: var(--ui-radius);
  background: #eef4fb;
  text-align: center;
}
.cd-quote::before {
  content: '“';
  position: absolute;
  top: -4px;
  left: 9px;
  color: #b9cde8;
  font-family: Georgia, serif;
  font-size: 40px;
  line-height: 1;
}
.cd-quote small {
  color: #50698a;
  font-size: var(--ui-caption);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.cd-quote p {
  margin-top: 2px;
  color: #34557d;
  font-size: var(--ui-body);
  font-style: italic;
}

/* ---------- Мой день ---------- */
.cd-dayhead {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--ui-space-2) var(--ui-space-4);
  margin-top: var(--ui-space-6);
}
.cd-dayhead h2 {
  font-size: var(--ui-section);
  font-weight: 600;
}
.cd-dayhead p {
  margin-top: 1px;
  color: var(--ui-muted);
  font-size: var(--ui-caption);
}
.cd-calink {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: var(--ui-tap);
  color: var(--ui-ink);
  font-size: var(--ui-caption);
  text-decoration: none;
}
.cd-calink svg {
  width: 18px;
  height: 18px;
  color: var(--ui-green-dark);
}
.cd-datebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--ui-tap);
  margin-top: var(--ui-space-2);
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
  box-shadow: 0 0 0 1px var(--ui-rule);
}
body.ui-readable .cd-datebar > button {
  width: 48px;
  height: var(--ui-tap);
  min-height: var(--ui-tap);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--ui-radius);
  background: none;
  box-shadow: none;
  color: var(--ui-green-dark);
  font-size: 24px;
}
body.ui-readable .cd-datebar > button:disabled {
  color: #c3cac6;
}
.cd-dpick {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  height: var(--ui-tap);
  margin: 0;
  padding: 0 var(--ui-space-5);
  color: var(--ui-ink);
  font-size: var(--ui-body);
  font-weight: 600;
}
.cd-dpick svg {
  width: 18px;
  height: 18px;
  color: var(--ui-green-dark);
}
body.ui-readable .cd-dpick input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
}
.cd-diary {
  display: flex;
  align-items: center;
  gap: var(--ui-space-5);
  margin-top: var(--ui-space-4);
  padding: var(--ui-space-3) var(--ui-space-3) var(--ui-space-3) var(--ui-space-4);
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
  box-shadow: 0 0 0 1px var(--ui-rule);
}
.cd-disc {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--ui-sage);
  color: var(--ui-green-dark);
}
.cd-diary > div {
  flex: 1;
  min-width: 0;
}
.cd-diary b {
  display: block;
  font-size: var(--ui-body);
  font-weight: 600;
}
.cd-diary small {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  color: var(--ui-green);
  font-size: var(--ui-caption);
}
.cd-diary small.is-wait {
  color: #b00000;
  font-weight: 600;
}
.cd-diary small svg {
  width: 15px;
  height: 15px;
}
body.ui-readable .cd-home .cd-open {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
  min-height: var(--ui-tap);
  margin: 0;
  padding: 0 var(--ui-space-5);
  border: 0;
  border-radius: 10px;
  background: linear-gradient(125deg, #218c70, #005840);
  box-shadow: none;
  color: #fff;
  font-size: var(--ui-body);
  font-weight: 600;
}
.cd-open svg {
  width: 18px;
  height: 18px;
}
/* Вкладки дел дня: полоса прокручивается вбок, закрепляется при прокрутке */
.cd-home .cd-tabs {
  position: sticky;
  top: 0;
  z-index: 15;
  margin: var(--ui-space-4) 0 0;
}
@media (max-width: 760px) {
  .cd-home .cd-tabs {
    margin-right: -12px;
    margin-left: -12px;
    padding: 0 var(--ui-space-2);
  }
}
.cd-home .cd-tabs .ui-tab {
  flex-direction: column;
  gap: 2px;
  min-width: 64px;
  min-height: 52px;
  padding: 2px var(--ui-space-5) 0;
}
body.ui-readable .cd-home .cd-tabs button.ui-tab {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  min-height: 52px;
  padding: 2px var(--ui-space-5) 0;
}
.cd-home .cd-tabs .ui-tab__count {
  padding: 0 6px;
  white-space: nowrap;
}
/* Блок вкладки */
.cd-block {
  margin-top: var(--ui-space-4);
  border-radius: 14px;
  background: var(--ui-surface);
  box-shadow: 0 0 0 1px var(--ui-rule);
  overflow: hidden;
}
.cd-bhead {
  display: flex;
  align-items: center;
  gap: var(--ui-space-4);
  padding: var(--ui-space-2) var(--ui-space-1) var(--ui-space-2) var(--ui-space-5);
}
.cd-bhead > svg {
  width: 24px;
  height: 24px;
  color: var(--ui-green-dark);
}
.cd-bhead > div {
  flex: 1;
  min-width: 0;
}
.cd-bhead h3 {
  font-size: var(--ui-card);
  font-weight: 600;
}
.cd-bhead p {
  color: var(--ui-muted);
  font-size: var(--ui-caption);
}
.cd-bhead__cal svg {
  width: 22px;
  height: 22px;
}
.cd-dline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ui-space-4);
  min-height: 32px;
  padding: var(--ui-space-2) var(--ui-space-5);
  border-top: 1px solid var(--ui-rule-soft);
  color: var(--ui-muted);
  font-size: var(--ui-caption);
}
.cd-dline b {
  color: var(--ui-ink);
  font-weight: 600;
}
.cd-note {
  padding: var(--ui-space-3) var(--ui-space-5);
  border-top: 1px solid var(--ui-rule-soft);
  background: #fbf5ea;
  color: var(--ui-amber);
  font-size: var(--ui-caption);
}
.cd-empty {
  padding: var(--ui-space-5);
  border-top: 1px solid var(--ui-rule-soft);
  color: var(--ui-muted);
  font-size: var(--ui-caption);
}
/* Группы по времени (вкладка «Все») */
.cd-tgroup > h4 {
  padding: var(--ui-space-2) var(--ui-space-5);
  border-top: 1px solid var(--ui-rule-soft);
  background: var(--ui-surface-soft);
  color: var(--ui-muted);
  font-size: var(--ui-caption);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
/* Сворачиваемые группы (витамины, спорт, личное) */
.cd-group > summary {
  display: flex;
  align-items: center;
  gap: var(--ui-space-3);
  min-height: 40px;
  padding: 0 var(--ui-space-3) 0 var(--ui-space-5);
  border-top: 1px solid var(--ui-rule-soft);
  background: var(--ui-surface-soft);
  color: var(--ui-muted);
  font-size: var(--ui-caption);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  list-style: none;
  cursor: pointer;
}
.cd-group > summary::-webkit-details-marker {
  display: none;
}
.cd-group__count {
  margin-left: auto;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
}
.cd-group__count.is-full {
  color: var(--ui-green);
}
.cd-group > summary svg {
  width: 18px;
  height: 18px;
  transition: transform 0.15s;
}
.cd-group[open] > summary svg {
  transform: rotate(180deg);
}
/* Строка дела: время, значок или фото, название с подписью, отметка справа */
.cd-row {
  display: flex;
  align-items: center;
  gap: var(--ui-space-4);
  width: 100%;
  min-height: var(--ui-tap);
  margin: 0;
  padding: var(--ui-space-1) var(--ui-space-1) var(--ui-space-1) var(--ui-space-5);
  border: 0;
  border-top: 1px solid var(--ui-rule-soft);
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--ui-ink);
  font-size: var(--ui-body);
  text-align: left;
  text-decoration: none;
  box-sizing: border-box;
}
body.ui-readable .cd-home button.cd-row {
  display: flex;
  justify-content: flex-start;
  min-height: var(--ui-tap);
  margin: 0;
  padding: var(--ui-space-1) var(--ui-space-1) var(--ui-space-1) var(--ui-space-5);
  border: 0;
  border-top: 1px solid var(--ui-rule-soft);
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--ui-ink);
  font-size: var(--ui-body);
}
.cd-row__time {
  flex: none;
  width: 44px;
  color: var(--ui-muted);
  font-size: var(--ui-caption);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.cd-row.is-done .cd-row__time {
  color: var(--ui-green);
}
.cd-row__photo,
.cd-row__sym {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
}
.cd-row__photo {
  background: #fff;
  box-shadow: 0 0 0 1px var(--ui-rule-soft);
  object-fit: contain;
}
.cd-row__sym {
  background: var(--ui-sage);
  color: var(--ui-green-dark);
}
.cd-row__sym svg {
  width: 19px;
  height: 19px;
}
.cd-row__text {
  display: block;
  flex: 1;
  min-width: 0;
  padding: var(--ui-space-3) 0;
  color: inherit;
  text-decoration: none;
}
body.ui-readable .cd-home button.cd-row__text {
  display: block;
  flex: 1;
  min-width: 0;
  min-height: var(--ui-tap);
  margin: 0;
  padding: var(--ui-space-3) 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: inherit;
  font-size: var(--ui-body);
  font-weight: 400;
  text-align: left;
}
.cd-row__text > b {
  display: block;
  font-size: var(--ui-body);
  font-weight: 600;
  overflow-wrap: anywhere;
}
.cd-row.is-done .cd-row__text > b {
  color: var(--ui-green-dark);
}
.cd-row__text > small {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px 6px;
  margin-top: 2px;
  color: var(--ui-muted);
  font-size: var(--ui-caption);
}
.cd-row__text .ui-tag svg {
  width: 13px;
  height: 13px;
}
.cd-row__chev {
  width: 44px !important;
  height: 16px !important;
  color: var(--ui-muted);
}
/* Галочка: отметить сразу, повторное нажатие снимает отметку */
body.ui-readable .cd-home .cd-tick {
  display: grid;
  place-items: center;
  flex: none;
  width: var(--ui-tap);
  height: var(--ui-tap);
  min-height: var(--ui-tap);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  box-shadow: none;
}
.cd-tick i {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px #93a199;
  color: #fff;
}
.cd-tick i svg {
  width: 17px;
  height: 17px;
  stroke-width: 2.6;
  opacity: 0;
}
.cd-tick[aria-pressed='true'] i {
  background: var(--ui-green);
  box-shadow: none;
}
.cd-tick[aria-pressed='true'] i svg {
  opacity: 1;
}
.cd-tick i.is-missed {
  box-shadow: inset 0 0 0 2px var(--ui-red);
  color: var(--ui-red);
}
.cd-tick i.is-missed svg {
  opacity: 1;
}
.cd-tick:disabled {
  cursor: default;
}
.cd-tick:disabled i {
  opacity: 0.45;
}
/* Личные действия: текстовые кнопки «Отметить», «Выполнено», «Пропущено» */
body.ui-readable .cd-home .cd-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
  min-width: var(--ui-tap);
  min-height: 38px;
  margin: 3px var(--ui-space-2) 3px 0;
  padding: 0 var(--ui-space-4);
  border: 0;
  border-radius: 9px;
  background: var(--ui-wine);
  box-shadow: none;
  color: #fff;
  font-size: var(--ui-caption);
  font-weight: 600;
  white-space: nowrap;
}
body.ui-readable .cd-home .cd-status.is-done {
  background: var(--ui-sage);
  color: var(--ui-green);
}
body.ui-readable .cd-home .cd-status.is-missed {
  background: var(--ui-red-bg);
  color: var(--ui-red);
}
body.ui-readable .cd-home .cd-status:disabled {
  opacity: 0.7;
  cursor: default;
}
.cd-home .cd-status.is-none {
  display: inline-flex;
  margin-right: var(--ui-space-3);
  color: var(--ui-muted);
  font-size: var(--ui-caption);
  white-space: nowrap;
}
.cd-status svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.4;
}
/* Ручка перестановки ⠿ (общая логика agenda-order.js) */
body.ui-readable .cd-home .agenda-drag-handle {
  flex: none;
  width: 22px;
  height: var(--ui-tap);
  min-height: var(--ui-tap);
  margin: 0 calc(-1 * var(--ui-space-2)) 0 calc(-1 * var(--ui-space-4));
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: #8a978f;
  font-size: 18px;
  line-height: 1;
  cursor: grab;
  touch-action: none;
}
.cd-home .agenda-dragging {
  opacity: 0.55;
  background: #fffbe9;
}
.cd-home .agenda-drop-before {
  box-shadow: inset 0 3px 0 var(--ui-green);
}
.cd-home .agenda-drop-after {
  box-shadow: inset 0 -3px 0 var(--ui-green);
}
/* Питание — как на сайте */
.cd-meal {
  padding: var(--ui-space-4) var(--ui-space-5);
  border-top: 1px solid var(--ui-rule-soft);
}
body.ui-readable .cd-home .cd-meal__top {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr) 16px;
  align-items: center;
  gap: var(--ui-space-5);
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--ui-ink);
  font-size: var(--ui-body);
  font-weight: 400;
  text-align: left;
}
.cd-meal__photo {
  display: grid;
  place-items: center;
  width: 80px;
  height: 80px;
  border-radius: 10px;
  background: var(--ui-sage);
  color: var(--ui-green-dark);
  object-fit: cover;
}
.cd-meal__photo svg {
  width: 30px;
  height: 30px;
}
.cd-meal__text {
  min-width: 0;
}
.cd-meal__cap {
  display: block;
  color: var(--ui-muted);
  font-size: var(--ui-caption);
}
.cd-meal__cap b {
  color: var(--ui-ink);
  font-weight: 600;
}
.cd-meal__title {
  display: block;
  margin: 1px 0;
  font-size: var(--ui-body);
  font-weight: 600;
  overflow-wrap: anywhere;
}
.cd-meal__fact {
  display: block;
  color: var(--ui-muted);
  font-size: var(--ui-caption);
}
.cd-meal__chev {
  width: 16px !important;
  height: 16px !important;
  color: var(--ui-muted);
}
.cd-meal__state {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: var(--ui-space-3);
  color: var(--ui-muted);
  font-size: var(--ui-caption);
}
.cd-meal__state svg {
  width: 16px !important;
  height: 16px !important;
}
.cd-meal__state.is-done {
  color: #286145;
}
.cd-meal__state.has-issue {
  color: #924b17;
}
.cd-meal__btns {
  display: grid;
  grid-template-columns: minmax(104px, auto) minmax(0, 1fr);
  gap: var(--ui-space-3);
  margin-top: var(--ui-space-3);
}
body.ui-readable .cd-home :is(.cd-mark, .cd-report) {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--ui-tap);
  margin: 0;
  padding: 0 var(--ui-space-3);
  border-radius: 10px;
  box-shadow: none;
  font-size: var(--ui-control);
  font-weight: 600;
}
body.ui-readable .cd-home .cd-mark {
  border: 0;
  background: var(--ui-wine);
  color: #fff;
}
body.ui-readable .cd-home .cd-report {
  border: 1px solid #cfd6d2;
  background: #fff;
  color: var(--ui-ink);
  font-weight: 400;
}
.cd-bang {
  display: grid;
  place-items: center;
  flex: none;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #1d1d1d;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}
.cd-reason {
  margin-top: var(--ui-space-2);
  border-radius: 9px;
  background: #fbf3ec;
}
.cd-reason > summary {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 44px; /* область нажатия от 44 px (независимая проверка 11.11.2026; было 38) */
  padding: 0 var(--ui-space-3) 0 var(--ui-space-4);
  color: #7c3e14;
  font-size: var(--ui-caption);
  list-style: none;
  cursor: pointer;
}
.cd-reason > summary::-webkit-details-marker {
  display: none;
}
.cd-reason > summary span {
  flex: 1;
}
.cd-reason > summary svg {
  width: 16px !important;
  height: 16px !important;
  transform: rotate(90deg);
  transition: transform 0.15s;
}
.cd-reason[open] > summary svg {
  transform: rotate(-90deg);
}
.cd-reason__body {
  padding: 0 var(--ui-space-4) var(--ui-space-3);
  font-size: var(--ui-caption);
}
.cd-reason__body small {
  color: var(--ui-muted);
  font-size: var(--ui-caption);
}
/* Ссылки внизу блока: «Статистика», «Все препараты и календарь», «Добавить действие» */
.cd-foot {
  display: flex;
  align-items: center;
  gap: var(--ui-space-4);
  width: 100%;
  min-height: var(--ui-tap);
  padding: 0 var(--ui-space-3) 0 var(--ui-space-5);
  border-top: 1px solid var(--ui-rule-soft);
  color: var(--ui-ink);
  font-size: var(--ui-body);
  text-decoration: none;
  box-sizing: border-box;
}
body.ui-readable .cd-home button.cd-foot {
  display: flex;
  justify-content: flex-start;
  min-height: var(--ui-tap);
  margin: 0;
  padding: 0 var(--ui-space-3) 0 var(--ui-space-5);
  border: 0;
  border-top: 1px solid var(--ui-rule-soft);
  border-radius: 0;
  box-shadow: none;
  font-size: var(--ui-body);
}
.cd-foot span {
  flex: 1;
  text-align: left;
}
.cd-foot svg {
  width: 18px !important;
  height: 18px !important;
  color: var(--ui-muted);
}
.cd-foot.is-soft,
body.ui-readable .cd-home button.cd-foot.is-soft {
  background: #f1f5f1;
  color: var(--ui-green-dark);
  font-weight: 600;
}
.cd-foot.is-soft svg {
  color: var(--ui-green-dark);
}

/* ---------- Специалист и администратор ---------- */
.cd-contacts {
  margin-top: var(--ui-space-6);
  border-radius: 14px;
  background: var(--ui-surface);
  box-shadow: 0 0 0 1px var(--ui-rule);
  overflow: hidden;
}
.cd-crow {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--ui-space-5);
  padding: var(--ui-space-4) var(--ui-space-4) var(--ui-space-4) var(--ui-space-5);
}
.cd-crow + .cd-crow {
  border-top: 1px solid var(--ui-rule-soft);
}
.cd-cav {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #dfe9e1;
  color: var(--ui-green-dark);
  font-size: var(--ui-caption);
  font-weight: 600;
  object-fit: cover;
}
.cd-cav svg {
  width: 21px;
  height: 21px;
}
.cd-crow small {
  display: block;
  color: var(--ui-muted);
  font-size: var(--ui-caption);
}
.cd-crow b {
  display: block;
  margin: 1px 0 2px;
  font-size: var(--ui-body);
  font-weight: 600;
  overflow-wrap: anywhere;
}
.cd-crow p {
  color: var(--ui-muted);
  font-size: var(--ui-caption);
}
body.ui-readable .cd-home .cd-write {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: var(--ui-tap);
  margin: 0;
  padding: 0 var(--ui-space-5);
  border: 0;
  border-radius: 10px;
  background: var(--ui-sage);
  box-shadow: none;
  color: var(--ui-green-dark);
  font-size: var(--ui-caption);
  font-weight: 600;
}
body.ui-readable .cd-home .cd-write:disabled {
  opacity: 0.5;
}
.cd-write svg {
  width: 17px !important;
  height: 17px !important;
}

/* Во вкладке «Все» время — в заголовке группы, в строке его не повторяем */
.cd-tgroup .cd-row__time {
  display: none;
}
@media (max-width: 359px) {
  /* 320 px: место приветствию, валюты — друг под другом, «Написать» — под текстом */
  .cd-top__brand span {
    display: none;
  }
  .cd-top__hello b {
    white-space: normal;
  }
  .cd-curs {
    grid-template-columns: 1fr;
  }
  .cd-curs button + button {
    border-top: 1px solid var(--ui-rule-soft) !important;
    border-left: 0 !important;
  }
  .cd-crow {
    grid-template-columns: 42px minmax(0, 1fr);
  }
  .cd-crow > .cd-write {
    grid-column: 2;
    justify-self: start;
  }
}

/* Пункт 41 «Доделать» (02.12.2026): время прошло, отметки нет — мягкая подсветка строки; текст состояния остаётся,
   цвет — только дополнение к нему. */
.cd-row.is-overdue,
.cd-meal.is-overdue {
  background: #fff4e0;
  box-shadow: inset 3px 0 0 #e0a030;
}

/* Окно отметки витамина, занятия, личного дела (одно окно для всех действий, решение владелицы 04.12.2026):
   «Сообщить о нарушении» и «Снять отметку» под временем, до кнопок «Отмена» и «Сохранить». */
.mark-extras {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2px 0 4px;
}
.mark-extras .mark-extra {
  min-height: 44px;
  color: var(--ui-ink, #1d1d1d);
  font-weight: 400;
}

/* Таблетница (решение владелицы 04.12.2026): таблетки и капсулы одного времени — одной строкой в стиле строк
   витаминов. Нажатие на название раскрывает её приёмы обычными строками (с отступом), кружок — окно отметки всех. */
.cd-pillbox__chev {
  width: 18px;
  height: 18px;
  margin-left: 4px;
  color: var(--ui-muted);
  vertical-align: -3px;
  transition: transform 0.15s;
}
.cd-row--pillbox [aria-expanded='true'] .cd-pillbox__chev {
  transform: rotate(180deg);
}
.cd-row--pillbox .cd-row__text > small > span {
  overflow-wrap: anywhere;
}
.cd-pillbox__items {
  box-shadow: inset 3px 0 0 var(--ui-sage);
}
.cd-pillbox__items .cd-row {
  padding-left: calc(var(--ui-space-5) + 12px);
}
/* Часть приёмов отмечена: в кружке — сколько принято из скольких («2/3»), текстом, а не только цветом */
body.ui-readable .cd-home .cd-tick.cd-tick--count {
  width: auto;
  min-width: var(--ui-tap);
  padding: 0 2px;
}
.cd-tick i.is-count {
  width: auto;
  min-width: 28px;
  padding: 0 6px;
  border-radius: 14px;
  box-sizing: border-box;
  box-shadow: inset 0 0 0 2px var(--ui-green);
  color: var(--ui-green-dark);
  font-size: var(--ui-caption);
  font-style: normal;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 28px;
  white-space: nowrap;
}
/* Окно отметки Таблетницы: список её препаратов над «Результатом» */
.pillbox-list {
  margin: 0 0 8px;
  padding-left: 1.2em;
  line-height: var(--ui-leading);
}
.pillbox-list li + li {
  margin-top: 4px;
}
