/* ============ Molio admin (поверх style.css) ============ */

.adm {
  padding-bottom: 120px;
}

.adm .top {
  flex-wrap: wrap;
}

.adm-nav {
  display: flex;
  gap: 4px;
  padding: 6px;
  background: var(--grey);
  border-radius: 99px;
}

.adm-nav a {
  padding: 11px 16px;
  font-size: 15px;
  color: #3a3d3a;
  border-radius: 99px;
  white-space: nowrap;
  transition: background-color .2s;
}

.adm-nav a:hover,
.adm-nav a.on {
  background: #fff;
}

/* Разделы с подменю: подменю позиционируется от шапки (.top), а не от строки меню —
   на узком экране строка прокручивается вбок и иначе обрезала бы его */
.adm .top {
  position: relative;
}

.adm-nav__btn {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 11px 14px 11px 16px;
  font: inherit;
  font-size: 15px;
  color: #3a3d3a;
  white-space: nowrap;
  background: none;
  border: 0;
  border-radius: 99px;
  cursor: pointer;
  transition: background-color .2s;
}

.adm-nav__btn:hover,
.adm-nav__btn.on,
.adm-nav__btn[aria-expanded="true"] {
  background: #fff;
}

.adm-nav__btn svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .2s;
}

.adm-nav__btn[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.adm-nav__sub {
  position: absolute;
  top: calc(100% + 6px);
  z-index: 60;
  display: grid;
  gap: 2px;
  min-width: 220px;
  padding: 6px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 12px 32px rgba(17, 17, 17, .12), 0 0 0 1px var(--line);
}

.adm-nav__sub[hidden] {
  display: none;
}

.adm-nav__sub a {
  padding: 10px 14px;
  border-radius: 14px;
}

.adm-nav__sub a:hover {
  background: var(--bg);
}

.adm-nav__sub a.on {
  font-weight: 500;
  background: var(--sage);
}

.adm-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-top: 48px;
}

.adm-head h1 {
  margin: 0;
  font-size: clamp(34px, 3.6vw, 52px);
}

.adm-head .sub {
  margin-top: 10px;
  font-size: 16px;
  color: var(--muted);
}

.adm-head .sub a {
  border-bottom: 1px solid currentColor;
}

.btn.sm {
  padding: 6px 6px 6px 18px;
  font-size: 15px;
}

.btn.sm .circ {
  width: 34px;
  height: 34px;
}

.btn.plain {
  padding: 12px 20px;
  font-size: 15px;
  color: var(--ink);
  background: #fff;
}

.btn.plain:hover {
  background: var(--sage);
}

.btn.danger {
  color: #a1281f;
}

.btn.danger:hover {
  background: #f6dcd9;
}

.link-btn {
  padding: 0;
  font: inherit;
  font-size: 14px;
  color: var(--muted);
  background: none;
  border: 0;
  border-bottom: 1px solid currentColor;
  cursor: pointer;
}

.link-btn:hover {
  color: var(--ink);
}

/* Flash */
.flash {
  margin-top: 24px;
  padding: 14px 20px;
  font-size: 15px;
  color: var(--green-ink);
  background: var(--green-bg);
  border-radius: 16px;
}

.flash.err {
  color: #8a2a20;
  background: #f6dcd9;
}

.flash.warn {
  color: var(--amber-ink, #7a5410);
  background: var(--amber-bg, #f4e8cc);
}

.flash ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

/* Lists */
.alist {
  margin-top: 32px;
  padding: 8px 28px;
  background: #fff;
  border-radius: var(--r);
}

.arow {
  display: grid;
  grid-template-columns: 110px minmax(0, 1.4fr) minmax(0, 1fr) 150px 120px 128px;
  gap: 8px 20px;
  align-items: center;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.arow:first-child {
  border-top: 0;
}

.arow--head {
  padding: 14px 0 10px;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

.arow__n {
  font-size: 14px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.arow__t {
  font-size: 17px;
  font-weight: 500;
  line-height: 1.35;
}

.arow__t a:hover {
  text-decoration: underline;
}

.arow__t small {
  display: block;
  margin-top: 2px;
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
}

.arow__c {
  font-size: 15px;
  color: var(--muted);
}

.arow__sum {
  font-size: 17px;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.arow__act {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.ic-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  color: var(--ink);
  background: var(--grey);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color .2s;
}

.ic-btn:hover {
  background: var(--sage);
}

.ic-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ic-btn.is-copied {
  background: var(--accent);
}

.empty {
  padding: 40px 0;
  text-align: center;
  color: var(--muted);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 28px;
}

.filters a {
  padding: 9px 16px;
  font-size: 14px;
  color: var(--muted);
  background: var(--grey);
  border-radius: 99px;
}

.filters a.on {
  color: #fff;
  background: var(--dark);
}

/* Поля дат: Safari на iOS иначе шире карточки, выше соседних полей и с датой по центру */
.f input[type="date"],
.f input[type="month"] {
  display: block;
  -webkit-appearance: none;
  appearance: none;
  height: 46px;
  text-align: left;
}

.f input[type="date"]::-webkit-date-and-time-value,
.f input[type="month"]::-webkit-date-and-time-value {
  text-align: left;
}

/* Forms */
.aform {
  display: grid;
  gap: 16px;
  margin-top: 32px;
}

.fs {
  padding: 28px 32px;
  background: #fff;
  border-radius: var(--r);
}

.fs > h2 {
  margin: 0 0 20px;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.fs > h2 small {
  margin-left: 8px;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px 16px;
}

.c-12 { grid-column: span 12; }
.c-8 { grid-column: span 8; }
.c-6 { grid-column: span 6; }
.c-4 { grid-column: span 4; }
.c-3 { grid-column: span 3; }
.c-2 { grid-column: span 2; }

.f {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.f > .seg-switch {
  align-self: flex-start;
}

.f > label,
.f > .lbl {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.f .hint {
  font-size: 13px;
  color: var(--soft);
}

.in,
.f input[type="text"],
.f input[type="email"],
.f input[type="password"],
.f input[type="number"],
.f input[type="date"],
.f input[type="month"],
.f input[type="url"],
.f select,
.f textarea {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 11px 14px;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #d9ddd9;
  border-radius: 14px;
  transition: border-color .2s, box-shadow .2s;
}

.f textarea {
  min-height: 92px;
  line-height: 1.45;
  resize: vertical;
}

.f input:focus,
.f select:focus,
.f textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(17, 17, 17, .08);
}

.f .is-invalid {
  border-color: #c4473b;
}

/* UA / RU пара */
.tr {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.tr__in {
  position: relative;
}

.tr__in::before {
  content: attr(data-l);
  position: absolute;
  top: 14px;
  left: 12px;
  z-index: 1;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: var(--grey);
  border-radius: 6px;
  pointer-events: none;
}

.tr__in input,
.tr__in textarea {
  padding-left: 48px !important;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  font-size: 15px;
  cursor: pointer;
}

.check input {
  width: 20px;
  height: 20px;
  accent-color: var(--dark);
}

/* Repeaters */
.rep__rows {
  display: grid;
  gap: 10px;
}

.rep-row {
  position: relative;
  /* строка сетки: длинное название в свёрнутой строке обрезается, а не растягивает страницу вбок */
  min-width: 0;
  padding: 18px 18px 18px 20px;
  background: var(--bg);
  border-radius: 20px;
}

.rep-row .rep-row {
  background: #fff;
}

.rep-row__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.rep-row__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.rep-row__ctl {
  display: flex;
  gap: 4px;
}

.rep-row__ctl .ic-btn {
  width: 32px;
  height: 32px;
  background: #fff;
}

.rep-row .rep-row .rep-row__ctl .ic-btn {
  background: var(--grey);
}

.rep-row__ctl .ic-btn:hover {
  background: var(--sage);
}

.rep-row__ctl .ic-btn.del:hover {
  color: #a1281f;
  background: #f6dcd9;
}

.rep__add {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 16px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  background: var(--grey);
  border: 0;
  border-radius: 99px;
  cursor: pointer;
}

.rep__add:hover {
  background: var(--sage);
}

.rep-row .rep__add {
  background: #fff;
}

.rep-row .rep-row .rep__add {
  background: var(--grey);
}

.sub-h {
  margin: 18px 0 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Компактная строка задачи */
.task-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) 150px 90px 100px;
  gap: 8px;
  align-items: start;
}

.task-grid .task-note {
  grid-column: 1 / -1;
}

.file-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) 90px 150px;
  gap: 8px;
  align-items: start;
}

.item-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) 110px 120px 110px;
  gap: 8px;
  align-items: start;
}

.item-grid .desc {
  grid-column: 1 / -1;
}

/* Sticky save bar */
.savebar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  padding: 14px 0;
  background: rgba(244, 244, 241, .92);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
}

.savebar__in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 40px;
}

.savebar__info {
  font-size: 14px;
  color: var(--muted);
}

.savebar__acts {
  display: flex;
  gap: 8px;
}

.side-list {
  display: grid;
  gap: 8px;
}

.side-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 18px;
  background: var(--bg);
  border-radius: 16px;
}

.side-item b {
  font-weight: 500;
}

.side-item small {
  display: block;
  font-size: 13px;
  color: var(--muted);
}

/* Login */
.login {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.login .fs {
  width: 100%;
  max-width: 420px;
}

.login h1 {
  margin: 0 0 24px;
  font-size: 34px;
}

/* Dashboard */
.dash-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.dash-cols .alist {
  margin-top: 0;
}

.dash-cols h2 {
  margin: 20px 0 6px;
  font-size: 20px;
  font-weight: 500;
}

.mini-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.mini-row:first-of-type {
  border-top: 0;
}

.mini-row a:hover b {
  text-decoration: underline;
}

.mini-row b {
  font-weight: 500;
}

.mini-row small {
  display: block;
  font-size: 13px;
  color: var(--muted);
}

[hidden] {
  display: none !important;
}

@media (max-width: 1100px) {
  .arow {
    grid-template-columns: 90px minmax(0, 1fr) 140px 128px;
  }


  .arow__c,
  .arow--head .arow__c {
    display: none;
  }

  .arow__sum {
    display: none;
  }

  .dash-cols {
    grid-template-columns: 1fr;
  }

  .savebar__in {
    padding: 0 24px;
  }
}

@media (max-width: 760px) {
  .adm-nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
  }

  .adm-nav a {
    padding: 10px 12px;
    font-size: 14px;
  }

  .alist {
    padding: 4px 18px;
  }

  .arow {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .arow--head {
    display: none;
  }

  /* заголовок таблицы скрыт — первая строка без верхней линии */
  .arow--head + .arow {
    border-top: 0;
  }

  /* проекты: группировка и вид — в одну строку, вид — иконками */
  .list-tools__right {
    flex-wrap: nowrap;
    gap: 6px;
  }

  .list-tools__right .filters.seg a {
    padding: 8px 12px;
    font-size: 13px;
    white-space: nowrap;
  }

  .list-tools__right .vicon-label {
    display: none;
  }

  .list-tools__right .filters.seg a:has(.vicon) {
    display: grid;
    place-items: center;
    padding: 8px 10px;
  }

  .list-tools__right .vicon {
    display: block;
  }

  .arow__n {
    grid-column: 1 / -1;
  }

  .arow .st {
    grid-column: 1;
    justify-self: start;
  }

  .fs {
    padding: 20px;
  }

  .grid > [class*="c-"] {
    grid-column: span 12;
  }

  .tr,
  .task-grid,
  .file-grid,
  .item-grid {
    grid-template-columns: 1fr 1fr;
  }

  .task-grid > :first-child,
  .file-grid > :first-child,
  .item-grid > :first-child {
    grid-column: 1 / -1;
  }

  .tr {
    grid-template-columns: 1fr;
  }

  .savebar__in {
    padding: 0 16px;
  }

  .savebar__info,
  .hide-m {
    display: none;
  }

  /* панель сохранения на телефоне — одной строкой: «Сохранить» прижата справа и всегда видна,
     вспомогательные кнопки, если не помещаются, прокручиваются вбок; отступ под полоску «домой» iPhone */
  .savebar {
    padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
  }

  .savebar__acts {
    flex-wrap: nowrap;
    gap: 6px;
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .savebar__acts::-webkit-scrollbar {
    display: none;
  }

  .savebar .btn.plain {
    flex: 0 0 auto;
    width: auto;
    padding: 8px 12px;
    font-size: 13px;
    white-space: nowrap;
  }

  .savebar__acts > .btn.dark {
    position: sticky;
    right: 0;
    order: 10;
    flex: 0 0 auto;
    width: auto;
    margin-left: auto;
    padding: 4px 4px 4px 16px;
    font-size: 14px;
    box-shadow: -14px 0 12px rgba(244, 244, 241, .95);
  }

  .savebar__acts > .btn.dark .circ {
    width: 30px;
    height: 30px;
  }

  /* пустая подпись-распорка над чекбоксом не нужна в одну колонку */
  .f:has(> .check) > .lbl {
    display: none;
  }

  .check {
    min-height: 36px;
  }
}

/* Компактнее строки задач и файлов внутри этапа/месяца */
.rep-row .rep-row {
  padding: 12px 14px;
  border-radius: 16px;
}

.rep-row .rep-row .rep-row__bar {
  margin-bottom: 8px;
}

.rep-row .rep-row .f input,
.rep-row .rep-row .f select,
.rep-row .rep-row .f textarea {
  min-height: 40px;
  padding-top: 8px;
  padding-bottom: 8px;
  font-size: 15px;
}

.rep-row .rep-row .tr__in::before {
  top: 11px;
}

.rep-row .rep-row .task-note input {
  min-height: 36px;
  font-size: 14px;
  color: var(--muted);
}

/* Шапка таблицы: все подписи одного размера, над своими колонками */
.arow--head > * {
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--muted);
}

.arow--head .arow__sum {
  text-align: right;
}

.arow .st {
  justify-self: start;
}

/* Список проектов: фильтры статуса + переключатель группировки */
.list-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
}

.list-tools .filters {
  margin-top: 0;
}

.filters.seg {
  gap: 2px;
  padding: 4px;
  background: var(--grey);
  border-radius: 99px;
}

.filters.seg a {
  background: transparent;
}

.filters.seg a.on {
  color: var(--ink);
  background: #fff;
}

.pgroup {
  margin-top: 36px;
}

.pgroup h2 {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0;
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.pgroup h2 small {
  font-size: 15px;
  font-weight: 400;
  color: var(--muted);
}

.pgroup .alist {
  margin-top: 14px;
}

/* ---------- Фирменные select ---------- */
.f select,
select.in {
  padding-right: 44px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%23111' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 14px;
}

.f select:hover {
  border-color: #b9bdb9;
}

.f select:focus {
  background-color: #fff;
}

/* ---------- Круглые чекбоксы ---------- */
.check input[type="checkbox"] {
  position: relative;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  margin: 0;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background: #fff;
  border: 1.5px solid #c9cdc9;
  border-radius: 50%;
  transition: background-color .15s, border-color .15s;
}

.check input[type="checkbox"]:hover {
  border-color: var(--ink);
}

.check input[type="checkbox"]:checked {
  background: var(--dark) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.4l2.6 2.6L12 5.4' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
  border-color: var(--dark);
}

.check input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* ---------- Фирменный выпадающий список (admin.js → .cs) ---------- */
.cs {
  position: relative;
  min-width: 0;
}

.cs > select {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  opacity: 0;
  pointer-events: none;
}

.cs__btn {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 46px;
  padding: 11px 44px 11px 14px;
  font: inherit;
  font-size: 16px;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%23111' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right 14px center / 14px no-repeat;
  border: 1px solid #d9ddd9;
  border-radius: 14px;
  transition: border-color .2s, box-shadow .2s;
}

.cs__btn:hover {
  border-color: #b9bdb9;
}

.cs__btn:focus-visible,
.cs.is-open .cs__btn {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(17, 17, 17, .08);
}

.cs.is-open .cs__btn {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 10l4-4 4 4' fill='none' stroke='%23111' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.cs__val {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.cs__list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 60;
  min-width: 100%;
  max-height: 280px;
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  list-style: none;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 0 0 1px rgba(17, 17, 17, .06), 0 20px 50px rgba(0, 0, 0, .14);
  animation: cs-in .14s ease-out;
}

.cs.is-up .cs__list {
  top: auto;
  bottom: calc(100% + 6px);
}

@keyframes cs-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

.cs__list li {
  position: relative;
  padding: 10px 36px 10px 12px;
  font-size: 15px;
  line-height: 1.3;
  white-space: nowrap;
  cursor: pointer;
  border-radius: 12px;
}

.cs__list li.is-active {
  background: var(--bg);
}

.cs__list li[aria-selected="true"] {
  font-weight: 500;
}

.cs__list li[aria-selected="true"]::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 10px;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.4l2.6 2.6L12 5.4' fill='none' stroke='%23161616' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat;
  border-radius: 50%;
}

/* компактнее во вложенных строках (задачи, файлы) */
.rep-row .rep-row .cs__btn {
  min-height: 40px;
  padding-top: 8px;
  padding-bottom: 8px;
  font-size: 15px;
}

/* ---------- Переключатель-сегменты (как меню в шапке) ---------- */
.seg-switch {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px;
  background: var(--grey);
  border-radius: 99px;
}

.seg-switch label {
  position: relative;
  cursor: pointer;
}

.seg-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.seg-switch span {
  display: inline-block;
  padding: 10px 16px;
  font-size: 15px;
  color: #3a3d3a;
  white-space: nowrap;
  border-radius: 99px;
  transition: background-color .2s, color .2s;
}

.seg-switch label:hover span {
  background: rgba(17, 17, 17, .05);
}

.seg-switch input:checked + span {
  color: var(--ink);
  background: #fff;
}

.seg-switch input:focus-visible + span {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* Задача периода: статус · часы · оценка → название → комментарий */
.task-meta {
  display: grid;
  grid-template-columns: 190px 110px 130px;
  gap: 8px;
}

.task-meta .f > label {
  font-size: 12px;
}

.task-text {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

@media (max-width: 760px) {
  .task-meta {
    grid-template-columns: 1fr 1fr;
  }

  .task-meta > :first-child {
    grid-column: 1 / -1;
  }
}

/* ---------- Сворачиваемый блок (периоды) ---------- */
.rep-row__head {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  background: none;
  border: 0;
}

.rep-row__chev {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s, background-color .2s;
}

.rep-row__head:hover .rep-row__chev {
  background: var(--sage);
}

.rep-row__chev svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rep-row.is-collapsed > .rep-row__bar .rep-row__chev {
  transform: rotate(-90deg);
}

.rep-row__sum {
  min-width: 0;
  overflow: hidden;
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.rep-row.is-collapsed > .rep-row__body {
  display: none;
}

.rep-row.is-collapsed > .rep-row__bar {
  margin-bottom: 0;
}

.rep-row__head:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
  border-radius: 12px;
}

/* пустая ячейка, чтобы следующая пара полей начиналась с новой строки */
@media (max-width: 760px) {
  .grid-break {
    display: none;
  }
}

/* Отклонено (оценка) */
.st--rejected {
  color: #8a2a20;
  background: #f6dcd9;
}

/* Счёт ещё не выставлен — пунктирная рамка */
.side-item.is-todo {
  background: #fff;
  border: 1.5px dashed #d2d6d2;
}

/* Ссылка для клиента + иконка копирования */
.link-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  vertical-align: middle;
}

.ic-btn--xs {
  width: 28px;
  height: 28px;
}

.ic-btn--xs svg {
  width: 13px;
  height: 13px;
}

/* Нет оценки / счёта у периода */
.hint.is-missing {
  color: #8a5a10;
}

/* ---------- Проекты карточками ---------- */
.list-tools__right {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pcards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.pgroup .pcards {
  margin-top: 14px;
}

.pcard {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 260px;
  padding: 24px 26px;
  background: #fff;
  border-radius: var(--r);
  transition: box-shadow .2s, transform .2s;
}

.pcard:hover {
  box-shadow: 0 14px 40px rgba(0, 0, 0, .08);
  transform: translateY(-2px);
}

/* вся карточка кликабельна, кнопки — поверх */
.pcard__link {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}

.pcard .arow__act {
  position: relative;
  z-index: 2;
}

.pcard__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pcard__mode {
  font-size: 13px;
  color: var(--muted);
}

.pcard__title {
  margin-top: 18px;
  font-size: 22px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.pcard__meta {
  margin-top: 6px;
  font-size: 15px;
  color: var(--muted);
}

.pcard__progress {
  margin-top: auto;
  padding-top: 22px;
}

.pcard__progress .bar {
  margin-top: 0;
  background: var(--grey);
}

.pcard__progress .bar i {
  background: var(--dark);
}

.pcard__cap {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}

.pcard__foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.pcard__nums {
  display: grid;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
}

.pcard__due {
  font-size: 15px;
  font-weight: 500;
  color: var(--amber-ink);
}

@media (max-width: 760px) {
  .pcards {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .pcard {
    min-height: 0;
    padding: 20px;
  }
}

/* =====================================================================
   Переводы: одно RU-поле + метка UA; панель переводов справа
   ===================================================================== */
.trf {
  position: relative;
}

.trf .trf__ru {
  padding-right: 52px !important;
}

.trf__ua {
  position: absolute;
  top: 9px;
  right: 9px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 8px;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--green-ink);
  cursor: pointer;
  background: var(--green-bg);
  border: 0;
  border-radius: 8px;
  transition: filter .2s;
}

.trf__ua::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.trf__ua:hover {
  filter: brightness(.95);
}

.trf__ua.is-manual {
  color: var(--muted);
  background: var(--grey);
}

.trf__ua.is-missing,
.trf__ua.is-stale {
  color: var(--amber-ink);
  background: var(--amber-bg);
}

.trf__ua.is-empty {
  color: var(--soft);
  background: var(--grey);
}

.rep-row .rep-row .trf__ua {
  top: 7px;
  height: 24px;
}

/* кнопка «Переводы» в нижней панели */
.trb {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.trb__n:empty {
  display: none;
}

.trb__n {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--amber-ink);
  background: var(--amber-bg);
  border-radius: 99px;
}

/* панель */
.trd-bg {
  position: fixed;
  inset: 0;
  z-index: 79;
  background: rgba(17, 17, 17, .22);
}

.trd {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  width: min(480px, 100vw);
  background: #fff;
  box-shadow: -20px 0 60px rgba(0, 0, 0, .12);
  transform: translateX(105%);
  transition: transform .25s ease-out;
}

.trd.is-open {
  transform: none;
}

body.trd-open {
  overflow: hidden;
}

.trd__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 22px 14px;
}

.trd__head b {
  display: block;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.trd__head small {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}

.trd__acts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding: 0 22px 14px;
  border-bottom: 1px solid var(--line);
}

.trd__msg {
  margin: 12px 22px 0;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--green-ink);
  background: var(--green-bg);
  border-radius: 12px;
}

.trd__msg.is-err {
  color: #8a2a20;
  background: #f6dcd9;
}

.trd__list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 22px 28px;
}

.trd__group {
  margin: 18px 0 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}

.trd__item {
  margin-bottom: 8px;
  padding: 12px 14px;
  background: var(--bg);
  border-radius: 16px;
  transition: box-shadow .3s;
}

.trd__item.is-flash {
  box-shadow: 0 0 0 2px var(--accent);
}

.trd__top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.trd__lbl {
  flex: 1;
  font-size: 12px;
  color: var(--muted);
}

.trd__badge {
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.trd__badge.is-ok { color: var(--green-ink); }
.trd__badge.is-manual { color: var(--muted); }
.trd__badge.is-missing { color: var(--amber-ink); }

.trd__item .ic-btn {
  background: #fff;
}

.trd__ru {
  margin: 6px 0 8px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
  white-space: pre-line;
}

.trd__uk {
  display: block;
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  font: inherit;
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  resize: none;
  overflow: hidden;
  background: #fff;
  border: 1px solid #d9ddd9;
  border-radius: 12px;
}

.trd__uk:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(17, 17, 17, .08);
}

/* ---------- Документы: редактор ---------- */
.doc-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.doc-ed {
  min-height: 240px;
  padding: 20px 24px;
  background: var(--bg);
  border-radius: 20px;
}

.doc-ed .ce-block__content,
.doc-ed .ce-toolbar__content {
  max-width: 760px;
}

.doc-ed .ce-paragraph,
.doc-ed .cdx-list,
.doc-ed .cdx-checklist {
  font-size: 17px;
  line-height: 1.6;
}

.doc-ed h2.ce-header {
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.doc-ed h3.ce-header {
  font-size: 22px;
  font-weight: 500;
}

.doc-ukbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.doc-ukstate {
  padding: 8px 14px;
  font-size: 14px;
  border-radius: 12px;
}

.doc-ukstate.is-ok { color: var(--green-ink); background: var(--green-bg); }
.doc-ukstate.is-manual { color: var(--muted); background: var(--grey); }
.doc-ukstate.is-warn { color: var(--amber-ink); background: var(--amber-bg); }
.doc-ukstate.is-err { color: #8a2a20; background: #f6dcd9; }

@media (max-width: 760px) {
  .doc-ed {
    padding: 14px 12px;
  }
}

/* ---------- Окно «Вставить Markdown» ---------- */
.md-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(17, 17, 17, .3);
}

.md-modal[hidden] {
  display: none;
}

.md-modal__box {
  width: min(720px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 24px;
  background: #fff;
  border-radius: var(--r);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .18);
}

.md-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.md-modal__head b {
  font-size: 20px;
  font-weight: 500;
}

.md-modal__hint {
  margin: 10px 0 14px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

.md-modal__hint code {
  padding: 1px 5px;
  font-size: 12px;
  background: var(--grey);
  border-radius: 5px;
}

.md-modal__ta {
  width: 100%;
  min-height: 280px;
  padding: 14px;
  font: 14px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--ink);
  resize: vertical;
  background: var(--bg);
  border: 1px solid #d9ddd9;
  border-radius: 14px;
}

.md-modal__ta:focus {
  outline: none;
  border-color: var(--ink);
}

.md-modal__info {
  min-height: 20px;
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.md-modal__acts {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  margin-top: 12px;
}

/* ============ Документы: дерево разделов ============ */
.dtree-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  margin-top: 32px;
}

.dtree {
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 12px;
  background: #fff;
  border-radius: var(--r);
}

.dtree__list,
.dtree__sub {
  margin: 0;
  padding: 0;
  list-style: none;
}

.dtree__sub {
  padding-left: 14px;
}

.dtree__row {
  display: flex;
  align-items: center;
  gap: 2px;
  min-height: 38px;
  padding: 0 8px 0 2px;
  font-size: 15px;
  color: var(--ink);
  border-radius: 12px;
  transition: background-color .15s;
}

.dtree__row:hover {
  background: var(--grey);
}

.dtree__row.on {
  background: var(--sage);
  font-weight: 500;
}

.dtree__row > a,
.dtree__all {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 0;
}

.dtree__row a > span,
.dtree__all > span:not(.dtree__tog):not(.dtree__n) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dtree__row svg {
  flex: none;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dtree__row.is-stage svg,
.dtree__row.is-period svg,
.dtree__row.is-block svg {
  color: var(--muted);
}

.dtree__all {
  margin-bottom: 4px;
}

.dtree__tog {
  display: grid;
  flex: none;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  color: var(--muted);
  background: none;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.dtree__tog svg {
  width: 12px;
  height: 12px;
  stroke-width: 2;
  transition: transform .15s;
}

.dtree__tog[aria-expanded="true"] svg {
  transform: rotate(90deg);
}

.dtree__n {
  flex: none;
  margin-left: 6px;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.dtree__hint {
  margin: 12px 8px 4px;
  font-size: 13px;
  color: var(--muted);
}

/* перетаскивание */
[draggable="true"] {
  cursor: grab;
}

.is-dragged {
  opacity: .4;
}

.dtree-layout.is-dragging [data-drop] {
  transition: background-color .1s, box-shadow .1s;
}

.dtree-layout [data-drop].is-over {
  background: var(--accent);
  box-shadow: inset 0 0 0 2px var(--dark);
}

.dtree-layout.is-busy {
  opacity: .6;
  pointer-events: none;
}

/* правая часть: раздел */
.dpanel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 20px;
}

.dpanel__head h2 {
  margin: 0;
  font-size: 30px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -.02em;
}

.dpanel__acts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dpanel__acts form {
  margin: 0;
}

.dpanel__acts .btn {
  width: auto;
  justify-content: center;
  gap: 0;
}

.dpanel__acts .btn.dark {
  gap: 10px;
}

.dpanel__acts .btn svg {
  width: 13px;
  height: 13px;
  margin-right: 4px;
  vertical-align: -1px;
}

.dcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--muted);
}

.dcrumbs a {
  padding: 2px 6px;
  margin: -2px -6px;
  border-radius: 8px;
}

.dcrumbs a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.dfold {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px 10px;
  align-items: center;
  margin-top: 20px;
  padding: 20px 24px 24px;
  background: #fff;
  border-radius: var(--r);
}

.dfold[hidden] {
  display: none;
}

.dfold__lbl {
  grid-column: 1 / -1;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}

.dfold .in:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(17, 17, 17, .08);
}

.btn.dfold__cancel {
  background: var(--grey);
}

@media (max-width: 760px) {
  .dfold {
    grid-template-columns: 1fr auto;
    padding: 16px 18px 18px;
  }

  .dfold .in {
    grid-column: 1 / -1;
  }
}

.dpanel .list-tools {
  margin-top: 20px;
}

.dlist {
  margin-top: 16px;
}

.arow--doc {
  grid-template-columns: 110px minmax(0, 1fr) 130px 96px 128px;
}

.arow--node {
  grid-template-columns: 38px minmax(0, 1fr) auto;
  padding: 12px 10px;
}

/* Строки разделов и документов: разделитель — псевдоэлемент, при наведении строка скругляется */
.dlist .arow--node,
.dlist .arow--doc {
  position: relative;
  margin: 0 -10px;
  border-top: 0;
  border-radius: 16px;
  transition: background-color .15s;
}

.dlist .arow--doc {
  padding: 18px 10px;
}

.dlist .arow[hidden] {
  display: none;
}

.dlist .arow--node::before,
.dlist .arow--doc::before {
  content: "";
  position: absolute;
  top: 0;
  right: 10px;
  left: 10px;
  height: 1px;
  background: var(--line);
  transition: opacity .15s;
}

.dlist .arow:first-child::before,
.dlist .arow:hover::before,
.dlist .arow:hover + .arow::before,
.dlist .arow.is-over::before,
.dlist .arow.is-over + .arow::before {
  opacity: 0;
}

.dlist .arow--node:hover,
.dlist .arow--doc:hover {
  background: var(--bg);
}

.dnode__ic {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  background: var(--grey);
  border-radius: 12px;
}

.dnode__ic svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 1100px) {
  .dtree-layout {
    grid-template-columns: 1fr;
  }

  .dtree {
    position: relative;
    top: 0;
    max-height: 340px;
  }

  .arow--doc {
    grid-template-columns: 90px minmax(0, 1fr) 130px 128px;
  }

  .arow--node .arow__c {
    display: block;
  }
}

@media (max-width: 760px) {
  .dpanel__head h2 {
    font-size: 24px;
  }

  .dpanel__acts .btn {
    padding: 10px 16px;
    font-size: 14px;
  }

  .arow--doc {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .arow--node {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .arow--node .arow__c {
    display: none;
  }
}

@media (hover: none) {
  .dtree__hint {
    display: none;
  }
}

.btn.dfold__cancel:hover {
  background: var(--sage);
}

/* Карточка проекта: «Оценки» и «Счета» рядом на десктопе */
.proj-fin {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
  margin-top: 16px;
}

@media (max-width: 1100px) {
  .proj-fin {
    grid-template-columns: 1fr;
  }
}

/* ============ Карточка проекта: файловый менеджер документов ============ */
.fm {
  margin-top: 16px;
}

.fm__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin-bottom: 20px;
}

.fm__head h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 500;
}

.fm__head h2 small {
  font-size: 15px;
  font-weight: 400;
  color: var(--muted);
}

.fm__tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.fm__tools .filters {
  margin: 0;
}

.fm__tools .filters button {
  padding: 9px 16px;
  font: inherit;
  font-size: 14px;
  color: var(--muted);
  background: var(--grey);
  border: 0;
  border-radius: 99px;
  cursor: pointer;
}

.fm__tools .filters button.on {
  color: #fff;
  background: var(--dark);
}

.fm__tools .filters.seg button {
  background: transparent;
}

.fm__tools .filters.seg button.on {
  color: var(--ink);
  background: #fff;
}

.fm__body {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.fm__tree {
  position: static;
  max-height: 560px;
  padding: 10px;
  background: var(--bg);
  border-radius: 20px;
}

.fm__tree .dtree__row:hover {
  background: #fff;
}

.fm__tree .dtree__row.on {
  background: #fff;
}

.fm__panel h3 {
  margin: 0;
  font-size: 22px;
  font-weight: 500;
  line-height: 1.2;
}

.fm__panel .dfold {
  padding: 16px 18px 18px;
  background: var(--bg);
  border-radius: 20px;
}

.fm__panel .dfold .btn.dfold__cancel {
  background: #fff;
}

.fm__list {
  margin-top: 12px;
}

.fm__list .arow--node {
  cursor: pointer;
}

.fm [data-drop].is-over {
  background: var(--accent) !important;
  box-shadow: inset 0 0 0 2px var(--dark);
}

.fm.is-busy {
  opacity: .6;
  pointer-events: none;
}

@media (max-width: 1100px) {
  .fm__body {
    grid-template-columns: 1fr;
  }

  .fm__tree {
    max-height: 300px;
  }
}

.fm .dpanel__acts .btn.plain {
  background: var(--bg);
}

.fm .dpanel__acts .btn.plain:hover {
  background: var(--sage);
}

/* Заголовок-поле (название проекта): выглядит как h1, по клику правится */
.aform--head {
  grid-template-columns: minmax(0, 1fr);
  margin-top: 0;
}

.edit-head .sub {
  overflow-wrap: anywhere;
}

.aform--head > .adm-head {
  margin-bottom: 16px;
}

.edit-head > div:first-child {
  /* основа 320px: на узком экране переключатель статуса переносится вниз, а не сжимает название */
  flex: 1 1 320px;
  min-width: 0;
}

.adm-kicker {
  margin-bottom: 6px;
  font-size: 15px;
  color: var(--muted);
}

.tr-field--heading {
  gap: 0;
}

.tr-field--heading .trf__ru {
  display: block;
  width: calc(100% + 20px);
  min-height: 0;
  margin: 0 -10px;
  padding: 4px 64px 6px 10px !important;
  overflow: hidden;
  font: inherit;
  font-size: clamp(34px, 3.6vw, 52px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.045em;
  color: var(--ink);
  resize: none;
  background: transparent;
  border: 0;
  border-radius: 16px;
  cursor: text;
  transition: background-color .2s, box-shadow .2s;
}

.tr-field--heading .trf__ru::placeholder {
  color: #b7bbb7;
}

.tr-field--heading .trf__ru:hover,
.tr-field--heading .trf__ru:focus {
  outline: none;
  background: transparent;
  box-shadow: none;
}

.tr-field--heading .trf__ua {
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
}

/* Строка полей, делящих ширину поровну (скрытые поля место не занимают) */
.frow {
  display: flex;
  gap: 16px;
}

.frow > .f {
  flex: 1 1 0;
}

.frow > [hidden] {
  display: none;
}

@media (max-width: 760px) {
  .frow {
    flex-direction: column;
  }
}

/* Документы этапа / задачи (из файлового менеджера) */
.row-docs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.task-text + .row-docs {
  grid-column: 1 / -1;
  margin-top: 4px;
}

.doc-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  padding: 8px 14px 8px 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: border-color .2s, background-color .2s;
}

.doc-chip:hover {
  border-color: var(--ink);
}

.doc-chip__ic {
  display: grid;
  flex: none;
  place-items: center;
  width: 32px;
  height: 32px;
  background: var(--grey);
  border-radius: 10px;
}

.doc-chip__ic svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.doc-chip__t {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

.doc-chip__t b {
  overflow: hidden;
  font-size: 14px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doc-chip__t small {
  font-size: 12px;
  color: var(--muted);
}


/* Диаграмма этапов в карточке проекта (разметка и основные стили — общие, style.css) */
.adm-gantt {
  margin-bottom: 24px;
}

.adm-gantt .gantt {
  margin-top: 0;
  background: var(--bg);
  border-radius: 20px;
}

.adm-gantt .gantt__bar {
  cursor: pointer;
  box-shadow: 0 0 0 3px var(--bg);
}

.adm-gantt .gantt__bar:hover {
  filter: brightness(.95);
}

.adm-gantt__empty {
  padding: 18px 20px;
  font-size: 14px;
  color: var(--muted);
  background: var(--bg);
  border-radius: 16px;
}

.adm-gantt__note {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}

.adm-gantt .gantt__bar.is-optional {
  box-shadow: inset 0 0 0 1.5px var(--soft), 0 0 0 3px var(--bg);
}

.block-link {
  margin-top: 14px;
  font-size: 14px;
  color: var(--muted);
}

/* Задача блока работ: сворачивается как FAQ, название — заголовком над статусом */
.rep-row .task-card .rep-row__chev {
  background: var(--grey);
}

.task-card:not(.is-collapsed) > .rep-row__bar .rep-row__sum {
  visibility: hidden;
}

.task-card .task-title {
  margin: 4px 0 12px;
}

.rep-row .task-card .task-title .trf__ru,
.task-card .task-title .trf__ru {
  min-height: 0;
  padding: 2px 52px 2px 0 !important;
  font-size: 22px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.02em;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.rep-row .task-card .task-title .trf__ru:focus,
.task-card .task-title .trf__ru:focus {
  border: 0;
  box-shadow: none;
}

.task-card .task-title .trf__ru::placeholder {
  color: var(--soft);
}

.task-card .task-title .trf__ua {
  top: 50%;
  transform: translateY(-50%);
}

/* Цвет статуса — как на странице клиента (.st--*): блок работ (переключатель), задача (список), шапка свёрнутой карточки */
.seg-switch[data-tone] input[value="progress"]:checked + span,
.seg-switch[data-tone] input[value="active"]:checked + span,
.seg-switch[data-tone] input[value="open"]:checked + span {
  color: var(--blue-ink);
  background: var(--blue-bg);
}

.seg-switch[data-tone] input[value="delivered"]:checked + span,
.seg-switch[data-tone] input[value="invoiced"]:checked + span {
  color: var(--amber-ink);
  background: var(--amber-bg);
}

.seg-switch[data-tone] input[value="paid"]:checked + span,
.seg-switch[data-tone] input[value="done"]:checked + span {
  color: var(--green-ink);
  background: var(--green-bg);
}

.cs[data-tone-value] .cs__btn {
  font-weight: 500;
}

.cs[data-tone-value="planned"] .cs__btn {
  color: var(--muted);
  background-color: var(--grey);
  border-color: transparent;
}

.cs[data-tone-value="progress"] .cs__btn {
  color: var(--blue-ink);
  background-color: var(--blue-bg);
  border-color: transparent;
}

.cs[data-tone-value="review"] .cs__btn {
  color: var(--amber-ink);
  background-color: var(--amber-bg);
  border-color: transparent;
}

.cs[data-tone-value="done"] .cs__btn {
  color: var(--green-ink);
  background-color: var(--green-bg);
  border-color: transparent;
}

.rep-row__st {
  flex: none;
}

/* Поле со ссылкой-стрелкой справа (домен проекта) */
.in-link {
  position: relative;
  display: block;
}

.f .in-link input {
  padding-right: 48px;
}

.in-link__go {
  position: absolute;
  top: 50%;
  right: 7px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: var(--ink);
  background: var(--grey);
  border-radius: 50%;
  transform: translateY(-50%);
  transition: background-color .2s;
}

.in-link__go:hover {
  background: var(--accent);
}

.in-link__go[hidden] {
  display: none;
}

.in-link__go svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Список счетов: номер · проект · статус · сумма · действия */
.arow--inv {
  grid-template-columns: 110px minmax(0, 1fr) 150px 120px 128px;
}

@media (max-width: 1100px) {
  .arow--inv {
    grid-template-columns: 90px minmax(0, 1fr) 140px 128px;
  }
}

@media (max-width: 760px) {
  .arow--inv {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

/* Главная: проекты, счета к оплате и оценки — списки в стиле «Материалы проекта» */
.dash-cols {
  align-items: start;
}

.dash-side {
  display: grid;
  gap: 16px;
  align-content: start;
}

.dash-list h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 500;
}

.dash-list .flink {
  grid-template-columns: auto minmax(0, 1fr) 36px;
}

.dash-list .flink.has-st {
  grid-template-columns: auto minmax(0, 1fr) auto 36px;
}

.dash-list .flink__ic {
  width: auto;
  min-width: 44px;
  padding: 0 8px;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
  font-variant-numeric: tabular-nums;
}

.dash-list .empty {
  padding: 20px 0 4px;
  text-align: left;
}

@media (max-width: 760px) {
  .dash-list .flink.has-st {
    grid-template-columns: auto minmax(0, 1fr) 36px;
  }

  .dash-list .flink.has-st .st {
    grid-column: 2;
    grid-row: 2;
    justify-self: start;
  }

  .dash-list .flink.has-st .circ {
    grid-column: 3;
    grid-row: 1 / 3;
  }
}

/* Кейсы: пометка в списке проектов и отдельный список */
.case-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 500;
  vertical-align: 2px;
  color: var(--dark);
  background: var(--accent);
  border-radius: 99px;
}

.cases-list {
  margin-top: 32px;
}

.case-row {
  position: relative;
}

.case-row__site {
  display: inline-block;
  margin: -6px 0 6px 70px;
  font-size: 13px;
  color: var(--muted);
  border-bottom: 1px solid currentColor;
}

.case-row__site:hover {
  color: var(--ink);
}

/* Статистика: оплаты по месяцам — график-столбики и раскрывающиеся месяцы */
.st-chart-box {
  margin-top: 20px;
}

.st-chart {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px;
  height: 260px;
  margin-top: 24px;
}

.st-chart__col {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  min-width: 0;
}

.st-chart__v {
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.st-chart__bar {
  width: 100%;
  max-width: 56px;
  min-height: 2px;
  /* место под подпись суммы над столбиком и месяц под ним */
  height: calc((100% - 48px) * var(--h, 0));
  background: var(--accent);
  border-radius: 10px 10px 4px 4px;
}

.st-chart__m {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}

.arow--stat {
  grid-template-columns: minmax(0, 1fr) 90px 160px 140px;
}

.arow--stat .arow__sum {
  display: block;
}

.st-month {
  border-top: 1px solid var(--line);
}

.st-month:first-of-type {
  border-top: 0;
}

.st-month > summary {
  border-top: 0;
  list-style: none;
  cursor: pointer;
}

.st-month > summary::-webkit-details-marker {
  display: none;
}

.st-month > summary .arow__t::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin: 0 0 3px 10px;
  border-right: 1.6px solid var(--muted);
  border-bottom: 1.6px solid var(--muted);
  transform: rotate(45deg);
  transition: transform .2s;
}

.st-month[open] > summary .arow__t::after {
  margin-bottom: 0;
  transform: rotate(-135deg);
}

.st-month__list {
  margin: 0 0 16px;
  padding: 4px 18px;
  list-style: none;
  background: var(--bg);
  border-radius: 18px;
}

.st-month__list li {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.st-month__list li:first-child {
  border-top: 0;
}

.st-month__list a {
  font-size: 15px;
  font-weight: 500;
}

.st-month__list a:hover {
  text-decoration: underline;
}

.st-month__list small {
  display: block;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
}

.st-month__list .arow__sum {
  display: block;
  font-size: 15px;
}

@media (max-width: 1100px) {
  .arow--stat .arow__c {
    display: block;
  }
}

@media (max-width: 760px) {
  .st-chart {
    gap: 4px;
    height: 200px;
  }

  .st-chart__v {
    display: none;
  }

  .st-chart__m {
    font-size: 11px;
  }

  .arow--stat {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .arow--stat > :nth-child(2),
  .arow--stat > :nth-child(3) {
    display: none;
  }

  /* шапка таблицы скрыта — у первой строки линия сверху не нужна */
  .arow--head + .arow--stat,
  .arow--head + .st-month {
    border-top: 0;
  }

  .st-month__list {
    padding: 2px 12px;
  }

  .st-month__list li {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .st-month__list .arow__n {
    grid-column: 1 / -1;
  }
}

/* Статистика: доля способа оплаты */
.st-share {
  display: block;
  height: 6px;
  margin-top: 8px;
  max-width: 320px;
  background: var(--grey);
  border-radius: 99px;
  overflow: hidden;
}

.st-share i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
}

.st-sub {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  color: var(--muted);
}

/* Статистика: партнёры и способы оплаты рядом; «Ещё N» у длинных списков */
.st-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
  margin-top: 32px;
}

.st-split > .alist {
  margin-top: 0;
}

.st-split .arow--stat {
  grid-template-columns: minmax(0, 1fr) 56px 56px 110px;
  gap: 8px 14px;
}

.st-more {
  border-top: 1px solid var(--line);
}

.st-more > summary {
  padding: 16px 0;
  font-size: 15px;
  color: var(--muted);
  list-style: none;
  cursor: pointer;
}

.st-more > summary::-webkit-details-marker {
  display: none;
}

.st-more > summary:hover {
  color: var(--ink);
}

.st-more[open] > summary {
  display: none;
}

.arow--stat .arow__t a:hover {
  text-decoration: underline;
}

@media (max-width: 1100px) {
  .st-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .st-split .arow--stat {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

@media (max-width: 760px) {
  /* таблиц статистики несколько — название оставляем видимым */
  .alist > .arow--head.arow--stat {
    display: grid;
    padding-top: 16px;
  }

  .alist > .arow--head.arow--stat > :not(:first-child) {
    display: none;
  }

  .arow--head + .arow--stat,
  .arow--head + .st-month {
    border-top: 1px solid var(--line);
  }
}

/* Статистика: график по годам — столбик ведёт на год, выбранный год тёмный */
.st-chart--years {
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  gap: 20px;
}

.st-chart--years .st-chart__bar {
  max-width: 120px;
  background: var(--sage);
  transition: background-color .2s;
}

.st-chart--years .st-chart__col:hover .st-chart__bar {
  background: var(--accent);
}

.st-chart--years .st-chart__col.is-on .st-chart__bar {
  background: var(--dark);
}

.st-chart--years .st-chart__col.is-on .st-chart__m {
  color: var(--ink);
  font-weight: 500;
}

.st-chart--years .st-chart__v {
  font-size: 14px;
  color: var(--ink);
}

@media (max-width: 760px) {
  .st-chart--years {
    gap: 8px;
  }

  .st-chart--years .st-chart__v {
    display: block;
    font-size: 11px;
  }
}

/* ============ Задачи на день: доска + задачи из проектов ============ */
.tk-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tk-nav .ic-btn {
  background: #fff;
}

.tk-nav .ic-btn:hover {
  background: var(--sage);
}

.tk-nav__date input {
  height: 38px;
  padding: 0 14px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: #fff;
  border: 0;
  border-radius: 99px;
}

.tk-carry {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin-top: 20px;
  padding: 14px 14px 14px 24px;
  font-size: 15px;
  background: var(--amber-bg, #f4e8cc);
  border-radius: 99px;
}

.tk-carry b {
  font-weight: 600;
}

.tk-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
  align-items: start;
  margin-top: 24px;
}

.tk-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.tk-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 16px 12px 12px;
  background: var(--grey);
  border-radius: 22px;
}

.tk-col__h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 6px;
}

.tk-col__h h2 {
  font-size: 15px;
  font-weight: 500;
}

.tk-col__h h2::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin: 0 8px 1px 0;
  background: var(--soft);
  border-radius: 50%;
}

.tk-col--invoice .tk-col__h h2::before { background: #d9a43a; }
.tk-col--progress .tk-col__h h2::before { background: #4c7fd0; }
.tk-col--done .tk-col__h h2::before { background: var(--accent); }

.tk-col__n {
  min-width: 26px;
  padding: 3px 8px;
  font-size: 13px;
  text-align: center;
  color: var(--muted);
  background: #fff;
  border-radius: 99px;
  font-variant-numeric: tabular-nums;
}

.tk-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 48px;
  border-radius: 16px;
  transition: background-color .15s;
}

.tk-list.is-over {
  background: rgba(143, 220, 160, .35);
}

.tk {
  padding: 14px 14px 10px;
  background: #fff;
  border-radius: 16px;
  cursor: grab;
}

.tk.is-dragged {
  opacity: .4;
}

.tk__t {
  font-size: 15px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.tk-col--done .tk__t {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: var(--soft);
}

.tk__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}

.tk__meta a:not(.st):hover {
  color: var(--ink);
  text-decoration: underline;
}

.tk__meta .st {
  padding: 3px 10px;
  font-size: 12px;
}

.tk__acts {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}

.tk__status {
  max-width: 100%;
  padding: 4px 8px;
  font: inherit;
  font-size: 12px;
  color: var(--muted);
  background: var(--bg);
  border: 0;
  border-radius: 99px;
  cursor: pointer;
}

.tk__acts .ic-btn {
  width: 28px;
  height: 28px;
  background: transparent;
  color: var(--soft);
}

.tk__acts .ic-btn:hover {
  color: #a1281f;
  background: var(--bg);
}

.tk__acts .ic-btn svg {
  width: 12px;
  height: 12px;
}

.tk-add input[type="text"] {
  width: 100%;
  padding: 11px 14px;
  font: inherit;
  font-size: 14px;
  background: transparent;
  border: 1px dashed #c9cdc9;
  border-radius: 14px;
}

.tk-add input[type="text"]:focus {
  background: #fff;
  border-color: transparent;
  outline: 2px solid var(--accent);
}

.tk-add__more {
  display: none;
  gap: 6px;
  margin-top: 6px;
}

.tk-add:focus-within .tk-add__more,
.tk-add:has(input[type="text"]:not(:placeholder-shown)) .tk-add__more {
  display: flex;
}

.tk-add__more select {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
  background: #fff;
  border: 0;
  border-radius: 99px;
}

.tk-add__more .btn {
  padding: 8px 14px;
  font-size: 13px;
}

.tk-side {
  display: grid;
  gap: 16px;
}

.tk-side .box {
  padding: 24px;
}

.tk-side h3 {
  font-size: 20px;
}

.tk-side .sub {
  margin: 4px 0 12px;
  font-size: 13px;
}

.tk-src {
  border-top: 1px solid var(--line);
}

.tk-src > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 0;
  font-size: 15px;
  font-weight: 500;
  list-style: none;
  cursor: pointer;
}

.tk-src > summary::-webkit-details-marker {
  display: none;
}

.tk-src > summary small {
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
}

.tk-src ul,
.tk-src__list {
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}

.tk-src__add {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  font: inherit;
  font-size: 14px;
  line-height: 1.35;
  text-align: left;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
}

.tk-src__add:hover {
  background: var(--sage);
}

.tk-src__add > svg {
  flex: none;
  color: var(--muted);
}

.tk-src__add > span:not(.st) {
  flex: 1;
  min-width: 0;
}

.tk-src__add small {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.tk-src__add .st {
  padding: 2px 8px;
  font-size: 11px;
}

.tk-src__add b {
  font-weight: 500;
  white-space: nowrap;
}

@media (max-width: 1280px) {
  .tk-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .tk-side {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

@media (max-width: 1100px) {
  .tk-board {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .tk-nav {
    width: 100%;
  }

  .tk-nav__date {
    flex: 1;
  }

  .tk-nav__date input {
    width: 100%;
  }

  .tk-carry {
    border-radius: 22px;
  }

  .tk-board,
  .tk-side {
    grid-template-columns: minmax(0, 1fr);
  }

  /* на телефоне перетаскивания нет — колонка меняется выпадающим списком */
  .tk {
    cursor: default;
  }
}

/* Задачи по месяцу: календарь + список дней */
.tk-cal {
  margin-top: 24px;
  padding: 24px;
}

.tk-cal__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.tk-cal__wd {
  padding: 0 0 6px 10px;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

.tk-cal__d {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 92px;
  padding: 10px;
  background: var(--bg);
  border-radius: 14px;
  transition: background-color .15s;
}

.tk-cal__d:hover {
  background: var(--sage);
}

.tk-cal__d.is-out {
  opacity: .4;
}

.tk-cal__d.is-weekend .tk-cal__n {
  color: var(--muted);
}

.tk-cal__d.is-today {
  outline: 2px solid var(--dark);
  outline-offset: -2px;
}

.tk-cal__n {
  font-size: 15px;
  font-weight: 500;
}

.tk-cal__c {
  margin-top: auto;
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.tk-cal__bar {
  display: block;
  height: 4px;
  background: #fff;
  border-radius: 99px;
  overflow: hidden;
}

.tk-cal__bar i {
  display: block;
  height: 100%;
  background: var(--accent);
}

.tk-day {
  margin-top: 16px;
  padding: 24px 28px;
}

.tk-day__h {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
}

.tk-day__h h3 {
  font-size: 20px;
}

.tk-day__h a:hover {
  text-decoration: underline;
}

.tk-day__h .sub {
  font-size: 14px;
  color: var(--muted);
}

.tk-day__list {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.tk-day__list li {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.tk-day__t {
  font-size: 15px;
  overflow-wrap: anywhere;
}

.tk-day__t small {
  display: block;
  font-size: 13px;
  color: var(--muted);
}

.tk-day__list li.is-done .tk-day__t {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: var(--soft);
}

.tk-day__s {
  font-size: 13px;
  color: var(--muted);
}

.tk-dot {
  width: 8px;
  height: 8px;
  background: var(--soft);
  border-radius: 50%;
}

.tk-dot--invoice { background: #d9a43a; }
.tk-dot--progress { background: #4c7fd0; }
.tk-dot--done { background: var(--accent); }

@media (max-width: 760px) {
  .tk-cal {
    padding: 14px 10px;
  }

  .tk-cal__grid {
    gap: 3px;
  }

  .tk-cal__wd {
    padding-left: 4px;
    font-size: 10px;
  }

  .tk-cal__d {
    min-height: 56px;
    padding: 6px;
    border-radius: 10px;
  }

  .tk-cal__n {
    font-size: 13px;
  }

  .tk-cal__c {
    font-size: 11px;
  }

  .tk-day {
    padding: 18px;
  }

  .tk-day__s {
    display: none;
  }
}

/* Меню из 10 разделов: на средних экранах — отдельной строкой под логотипом, с прокруткой */
@media (max-width: 1240px) {
  .adm-nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .adm-nav a {
    padding: 10px 12px;
    font-size: 14px;
  }
}

/* Подборка счетов: список счетов с галочками */
.bnd-head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.bnd-head h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 500;
}

.bnd-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.bnd-list li {
  display: flex;
  gap: 8px;
  align-items: center;
  border-top: 1px solid var(--line);
}

.bnd-row {
  display: grid;
  flex: 1;
  grid-template-columns: 20px 96px minmax(0, 1fr) 150px 100px;
  gap: 14px;
  align-items: center;
  padding: 14px 4px;
  cursor: pointer;
}

.bnd-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--dark);
}

.bnd-row__n {
  color: var(--muted);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.bnd-row__t small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.bnd-row__sum {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.bnd-row.is-paid {
  opacity: .6;
}

.bnd-paid {
  margin-top: 20px;
}

@media (max-width: 760px) {
  .bnd-row {
    grid-template-columns: 20px minmax(0, 1fr) auto;
  }

  .bnd-row__n,
  .bnd-row .st {
    display: none;
  }
}

.head-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* Доступы: каждая строка — кнопка копирования */
.cr-search {
  margin-top: 24px;
}

.cr-search {
  max-width: 420px;
}

.cr-group {
  margin-top: 32px;
}

.cr-group h2 {
  margin: 0 0 14px;
  font-size: 22px;
  font-weight: 500;
}

.cr-group h2 a {
  color: inherit;
  text-decoration: none;
}

.cr-sets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr));
  gap: 16px;
  align-items: start;
}

.cr-set[hidden],
.cr-group[hidden] {
  display: none;
}

.cr-set__h {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.cr-set__h h3 {
  margin: 0;
  overflow-wrap: anywhere;
}

.cr-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  gap: 6px;
  align-items: center;
  border-top: 1px solid var(--line);
}

.cr-row__copy {
  display: grid;
  grid-template-columns: minmax(70px, 110px) minmax(0, 1fr) 20px;
  gap: 12px;
  align-items: center;
  min-width: 0;
  min-height: 46px;
  padding: 8px;
  font: inherit;
  color: inherit;
  text-align: left;
  background: none;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}

.cr-row__copy:hover,
.cr-row__copy:focus-visible {
  background: var(--bg);
}

.cr-row__l {
  font-size: 13px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.cr-row__v {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.cr-row__i svg {
  display: block;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cr-row__ok {
  display: none;
  grid-column: 2 / 4;
  font-size: 14px;
  font-weight: 500;
}

.cr-row__copy.is-copied {
  background: var(--accent);
}

.cr-row__copy.is-copied .cr-row__v,
.cr-row__copy.is-copied .cr-row__i {
  display: none;
}

.cr-row__copy.is-copied .cr-row__ok {
  display: block;
}

.cr-row .ic-btn {
  width: 32px;
  height: 32px;
}

.cr-set__note {
  margin: 10px 0 0;
  padding-top: 10px;
  font-size: 14px;
  color: var(--muted);
  white-space: pre-wrap;
  border-top: 1px solid var(--line);
}

.cr-tpl .rep__add,
.cr-paste .rep__add {
  margin-top: 0;
}

.cr-tpl {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
}

.cr-field {
  display: grid;
  grid-template-columns: minmax(120px, 200px) minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
}

.cr-field textarea {
  min-height: 42px;
  overflow: hidden;
  resize: none;
}

.cr-field .check {
  align-self: center;
  white-space: nowrap;
}

.cr-field__ctl {
  display: flex;
  gap: 4px;
}

.cr-paste {
  margin-top: 16px;
}

.cr-paste summary {
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.cr-paste .f {
  margin: 10px 0;
}

.cr-paste .hint {
  display: block;
  margin-top: 8px;
}

.cr-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

@media (max-width: 760px) {
  .cr-field {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .cr-field > .f {
    grid-column: 1 / -1;
  }
}

/* Ключ доступа клиента */
.access-key {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: center;
  margin-top: 16px;
}

.access-key__v {
  padding: 4px 10px;
  font: inherit;
  font-weight: 600;
  letter-spacing: .04em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: var(--grey);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.access-key__v:hover {
  background: var(--sage);
}

.access-key__v.is-copied,
.link-btn.is-copied {
  background: var(--accent);
}

.cr-key {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px 16px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.cr-key:first-child {
  border-top: 0;
}

.cr-key[hidden] {
  display: none;
}

.cr-key__t {
  color: inherit;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.cr-key__t small {
  display: block;
  color: var(--muted);
}

@media (max-width: 600px) {
  .cr-key {
    grid-template-columns: auto auto;
    justify-content: start;
  }

  .cr-key__t {
    grid-column: 1 / -1;
  }
}

/* Счёт: какие реквизиты показывать клиенту */
.inv-methods {
  display: grid;
  gap: 10px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.inv-methods .lbl {
  font-size: 13px;
  font-weight: 500;
}

.inv-methods__list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
}

.inv-methods .hint {
  font-size: 13px;
  color: var(--muted);
}

/* Описание задачи: textarea в одну строку, растёт по мере ввода */
.trf textarea[data-grow] {
  display: block;
  min-height: 46px;
  overflow: hidden;
  line-height: 1.45;
  resize: none;
}

.rep-row .rep-row .task-note textarea[data-grow] {
  min-height: 36px;
  font-size: 14px;
  color: var(--muted);
}

/* Редактор документа: вложенный блок (Tab) — сдвиг и тонкая линия слева, как у дочерних элементов */
.doc-ed .ce-indent[data-level]:not([data-level="0"]) {
  padding-left: 12px;
  border-left: 2px solid var(--line);
  transition: margin-left .15s;
}

/* Редактор документа: обёртка таблицы — свой слой (z-index: 0), поэтому её меню (строка/колонка) оказывалось
   под следующим блоком и нижние пункты не нажимались. Пока меню открыто — таблица выше соседей */
.doc-ed .tc-wrap:has(.tc-popover--opened) {
  z-index: 3;
}

/* …и само меню — над выделенной ячейкой таблицы (у неё свой слой) */
.doc-ed .tc-toolbox:has(.tc-popover--opened) {
  z-index: 5;
}

/* Квиз: подсказка по формату Markdown и ответы клиента */
.quiz-format {
  margin-top: 16px;
  padding: 16px 20px;
  font-size: 14px;
  background: var(--bg);
  border-radius: 16px;
}

.quiz-format ul {
  margin: 8px 0 12px;
  padding-left: 18px;
  color: var(--muted);
}

.quiz-format code {
  padding: 1px 6px;
  font-size: 13px;
  background: #fff;
  border-radius: 6px;
}

.quiz-format pre {
  margin: 0 0 10px;
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  background: #fff;
  border-radius: 12px;
}

.qa-total {
  margin: -6px 0 16px;
  font-size: 15px;
  color: var(--muted);
}

.qa-total b {
  color: var(--ink);
  font-weight: 600;
}

.qa-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.qa {
  padding: 18px 20px;
  background: var(--bg);
  border-radius: 18px;
}

.qa.is-empty .qa__t {
  color: var(--muted);
}

.qa__h {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
}

.qa__n {
  font-size: 13px;
  color: var(--soft);
  font-variant-numeric: tabular-nums;
}

.qa__t {
  flex: 1;
  min-width: 0;
  font-size: 17px;
  font-weight: 500;
}

.qa__opts {
  display: grid;
  gap: 6px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

/* невыбранный вариант — приглушён, выбранный — белая карточка с зелёной галочкой */
.qa-opt {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 12px;
  font-size: 15px;
  line-height: 1.4;
  color: var(--soft);
  border-radius: 12px;
}

.qa-opt.is-on {
  color: var(--ink);
  background: #fff;
}

.qa-opt__box {
  display: grid;
  flex: none;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border: 1.5px solid var(--line);
  border-radius: 6px;
}

.qa-opt.is-on .qa-opt__box {
  background: var(--accent);
  border-color: var(--accent);
}

.qa-opt__box svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: var(--dark);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.qa-opt.is-changed small {
  display: block;
  font-size: 12px;
  color: var(--amber-ink, #7a5410);
}

.qa__c {
  margin-top: 12px;
  padding: 12px 14px;
  background: #fff;
  border-left: 3px solid var(--accent);
  border-radius: 12px;
}

.qa__c span {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.qa__c p {
  margin: 4px 0 0;
  font-size: 15px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.quiz-answers__acts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

/* Иконки вида списка (таблица / карточки): показываются вместо подписи на телефоне */
.vicon {
  display: none;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
