/* Manrope — вариативный гротеск с полноценной кириллицей. Лежит на своём
   сервере: без обращений к Google, значит грузится всегда и одинаково быстро.
   Четыре поднабора символов, около 54 КБ на все начертания. */

@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/fonts/manrope-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/fonts/manrope-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/fonts/manrope-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/fonts/manrope-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Фирменная бирюзово-белая палитра. Тема Telegram намеренно не используется:
   приложение выглядит одинаково у всех сотрудников, в светлом и тёмном оформлении. */

:root {
  /* Дизайн-система «Держатели 2026–2028»: тёмно-зелёный «капот», бирюзовые
     акценты на действиях и цифрах, плоский светлый фон. */
  --bg: #ffffff;              /* карточки, поля ввода */
  --wall: #f4f7f5;            /* основной фон контента (плоский, без обоев) */
  --ornament: #17a88c;
  --secondary-bg: var(--wall);
  --header-dark: #0e3327;     /* тёмно-зелёный: шапка-«капот», нижнее меню, тёмные кнопки */
  --header-deep: #0a241b;
  --on-wall: #123d31;                        /* текст на светлом фоне */
  --on-wall-dim: rgba(18, 61, 49, .55);
  --header-bg: #0e3327;
  --text: #123d31;
  --hint: rgba(18, 61, 49, .55);
  --link: #17a88c;            /* акцент: ссылки, цифры, активные элементы */
  --accent: #3fd0b5;          /* яркая бирюза: активная вкладка, CTA, точки */
  --button: #0e3327;          /* основная кнопка — тёмно-зелёная */
  --button-press: #0a241b;
  --button-text: #ffffff;
  --section-bg: #ffffff;
  --separator: rgba(18, 61, 49, .08);
  --shadow: 0 4px 12px rgba(18, 61, 49, .06);

  /* Статусы дизайн-системы */
  --green: #35b27c;   /* выполнено */
  --orange: #f4a62a;  /* на доработке / не сделано */
  --red: #e0563f;     /* просрочена */
  --blue: #17a88c;    /* в работе */
  --purple: #8c6fe8;  /* на проверке */

  --radius: 14px;
  --gap: 12px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* Цвет страницы держим на html, а не на body: фон body уезжает на канву,
   и слой с орнаментом, лежащий под ним, становится невидимым. */
html { background: var(--secondary-bg); }

html, body {
  margin: 0;
  padding: 0;
  background-color: transparent;
  color: var(--text);
  font: 400 16px/1.5 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  /* Сглаживание: без него Manrope на светлом фоне выглядит жирнее задуманного */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
}

/* Крупный текст набираем плотнее — так заголовки читаются как единое слово,
   а не как набор букв. Чем крупнее кегль, тем заметнее нужен минус. */
h1, h2, h3, .brand-title, .stat-v, .fb-score, .duo-t, .tile-t {
  letter-spacing: -0.02em;
}

.stat-v, .fb-score, .score, .att-pct, .bd-p, .bar-v {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

/* Обои: эмблема факультета поверх кремового фона.
   Рисунок подключён маской, а не картинкой, — цвет знака задаётся здесь же,
   поэтому один и тот же ornament.svg годится и для светлого, и для тёмного фона. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  /* Именно background-image, а не mask-image: маска в браузерах считает яркость
     источника, тёмный контур эмблемы в неё почти не попадает и фон выходит пустым.
     Цвет знака задан прямо в ornament.svg. */
  background-image: url("/ornament.svg");
  background-repeat: repeat;
  background-size: 190px;
  /* Дизайн-система «Держатели»: плоский светлый фон без обоев */
  opacity: 0;
  display: none;
  pointer-events: none;
}

#app {
  position: relative;   /* содержимое рисуется поверх слоя с орнаментом */
  z-index: 1;
  min-height: 100vh;
  padding: 0 0 calc(96px + env(safe-area-inset-bottom));   /* под плавающее меню-пилюлю */
}

/* ---------- загрузка ---------- */

.splash {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 2.5px solid var(--separator);
  border-top-color: var(--link);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- шапка ---------- */

.header {
  padding: 16px 16px 8px;
}

.header h1 {
  color: var(--on-wall);
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header .subtitle {
  margin-top: 2px;
  color: var(--on-wall-dim);
  font-size: 14px;
}

/* ---------- шапка с меню ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 12px 18px 16px;
  /* «Капот»: тёмно-зелёная шапка со скруглёнными нижними углами */
  background: var(--header-dark);
  color: #fff;
  border-radius: 0 0 30px 30px;
}

/* Текст и кнопки внутри «капота» — светлые */
.topbar .hi-t, .topbar .brand-title { color: #fff; }
.topbar .hi-s, .topbar .brand-sub, .topbar .chev { color: rgba(255, 255, 255, .6); }
.topbar .ico-btn { color: #fff; background: none; }
.topbar .ico-btn.has-dot::after { background: var(--accent); border-color: var(--header-dark); }

/* Вся строка — кнопка, открывающая профиль */
.topbar-row {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.topbar-row:active { opacity: .6; }
.brand-text { flex: 1; min-width: 0; }
.chev { color: var(--on-wall-dim); font-size: 22px; line-height: 1; }

.brand-title { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; color: var(--on-wall); }
.brand-sub {
  margin-top: 1px;
  font-size: 13px;
  color: var(--on-wall-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Фигурка и фото занимают одно и то же место — вёрстка не прыгает при загрузке аватара */
.fig, .ava { flex: 0 0 auto; display: block; border-radius: 50%; }
.ava { object-fit: cover; background: var(--separator); }

/* ---------- профиль ---------- */

.profile-head { padding: 22px 16px 4px; text-align: center; }
.profile-ava { display: inline-flex; flex-direction: column; align-items: center; gap: 8px; }
.profile-head h1 { color: var(--on-wall); margin: 12px 0 2px; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.profile-sub { color: var(--on-wall-dim); font-size: 14px; }

.ava-edit {
  font-size: 13px;
  font-weight: 600;
  color: var(--link);
  cursor: pointer;
}
.ava-edit input { display: none; }

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

.chip {
  padding: 8px 14px;
  border: 1px solid var(--separator);
  border-radius: 100px;
  background: var(--bg);
  color: var(--link);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.chip.active { background: var(--button); border-color: var(--button); color: var(--button-text); }

.topbar .tabs { padding: 10px 0; }

/* ---------- вкладки ---------- */

.tabs {
  display: flex;
  gap: 6px;
  padding: 8px 16px 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  flex: 0 0 auto;
  padding: 6px 14px;
  border: 1px solid var(--separator);
  border-radius: 100px;
  background: var(--section-bg);
  color: var(--link);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}

.tab.active {
  background: var(--button);
  border-color: var(--button);
  color: var(--button-text);
}

.tab .badge {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 100px;
  background: var(--red);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
}

.tab.active .badge { background: rgba(255, 255, 255, .28); }

/* ---------- карточки задач ---------- */

.list { padding: 14px 16px 0; display: flex; flex-direction: column; gap: 10px; }

/* ---------- рейтинг ---------- */

.rank {
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--section-bg);
  box-shadow: var(--shadow);
  cursor: pointer;
}

.rank-main { display: flex; align-items: center; gap: 12px; }
.rank.open { background: color-mix(in srgb, var(--button) 4%, var(--section-bg)); }

.rank.me { outline: 2px solid var(--button); }

.rank .place {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--button) 12%, transparent);
  color: var(--link);
  font-size: 15px;
  font-weight: 700;
}

/* У призёров вместо номера медаль — фон только мешает */
.rank .place.medal { background: none; font-size: 24px; }

.rank .who { flex: 1; min-width: 0; }
.rank .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank .stats { margin-top: 3px; font-size: 13px; color: var(--hint); }
.rank .score { font-size: 17px; font-weight: 700; color: var(--link); }

.rating-note {
  padding: 14px 20px 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--on-wall-dim);
  text-align: center;
}

.card {
  background: var(--section-bg);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  border-left: 3px solid transparent;
  box-shadow: var(--shadow);
  transition: transform .1s ease;
}

.card:active { transform: scale(.985); }

.card.st-rework { border-left-color: var(--orange); }
.card.st-submitted { border-left-color: var(--purple); }
.card.st-accepted { border-left-color: var(--green); }
.card.st-new, .card.st-in_progress { border-left-color: var(--blue); }
.card.overdue { border-left-color: var(--red); }

.card .row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.card h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card .meta {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--hint);
  font-size: 13px;
}

.card .desc {
  margin-top: 6px;
  color: var(--hint);
  font-size: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.pill.st-new, .pill.st-in_progress { background: color-mix(in srgb, var(--blue) 15%, transparent); color: var(--blue); }
.pill.st-submitted { background: color-mix(in srgb, var(--purple) 15%, transparent); color: var(--purple); }
.pill.st-accepted { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); }
.pill.st-rework { background: color-mix(in srgb, var(--orange) 18%, transparent); color: var(--orange); }

.deadline.late { color: var(--red); font-weight: 600; }
.deadline.soon { color: var(--orange); font-weight: 600; }

/* ---------- пустое состояние ---------- */

.empty {
  padding: 56px 32px;
  text-align: center;
  color: var(--on-wall-dim);
}
.empty .icon { font-size: 44px; }
.empty p { margin: 12px 0 0; font-size: 15px; }

/* ---------- карточка задачи ---------- */

.detail { padding: 0 16px; display: flex; flex-direction: column; gap: 12px; }

.block {
  background: var(--section-bg);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}

.block .label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--hint);
  margin-bottom: 6px;
}

.block .value { white-space: pre-wrap; word-break: break-word; }

.block.callout-rework { background: color-mix(in srgb, var(--orange) 12%, var(--section-bg)); }
.block.callout-accepted { background: color-mix(in srgb, var(--green) 12%, var(--section-bg)); }

.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 15px; }
.kv + .kv { border-top: 1px solid var(--separator); }
.kv .k { color: var(--hint); }
.kv .v { text-align: right; font-weight: 500; }

/* ---------- формы ---------- */

textarea, input[type="text"], input[type="datetime-local"], select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--separator);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  /* Каретку задаём явно: иначе в тёмной теме Telegram/системы она белая
     и на светлом поле не видна */
  caret-color: var(--text);
  font: inherit;
  font-size: 16px; /* меньше 16px — iOS зумит поле при фокусе */
  outline: none;
}

textarea { min-height: 96px; resize: vertical; }

textarea:focus, input:focus, select:focus { border-color: var(--link); }

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 16px;
  border: none;
  border-radius: 12px;
  background: var(--button);
  color: var(--button-text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.btn:disabled { opacity: .5; }
.btn.secondary { background: var(--section-bg); color: var(--text); }
.btn.danger { background: var(--orange); color: #fff; }
.btn.success { background: var(--green); color: #fff; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }

/* ---------- вложения ---------- */

.files { display: flex; flex-direction: column; gap: 8px; }

.file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--separator);
  font-size: 14px;
}

.file .name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--link);
  text-decoration: none;
}

.file .size { color: var(--hint); font-size: 12px; white-space: nowrap; }

.file .remove {
  border: none;
  background: none;
  color: var(--hint);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}

.upload {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border: 1.5px dashed var(--separator);
  border-radius: 10px;
  color: var(--link);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.upload input { display: none; }

/* ---------- уведомление ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  padding: 11px 18px;
  border-radius: 100px;
  background: rgba(0, 0, 0, .84);
  color: #fff;
  font-size: 14px;
  z-index: 50;
  animation: rise .22s ease;
}

.toast.error { background: var(--red); }

@keyframes rise {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.error-screen { padding: 56px 24px; text-align: center; }
.error-screen .icon { font-size: 44px; }
.error-screen h2 { color: var(--on-wall); font-size: 18px; margin: 14px 0 6px; }
.error-screen p { color: var(--on-wall-dim); font-size: 15px; margin: 0; }

.section-title {
  padding: 18px 16px 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--on-wall-dim);
}

/* ---------- посещаемость ---------- */

.att-hint {
  padding: 14px 20px 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--on-wall-dim);
}

/* Таблица шире экрана, поэтому прокручивается сама, не утаскивая страницу вбок */
.att-wrap {
  margin: 12px 12px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--section-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.att { border-collapse: separate; border-spacing: 0; font-size: 13px; }

.att th, .att td {
  padding: 8px 6px;
  text-align: center;
  border-bottom: 1px solid var(--separator);
  white-space: nowrap;
}

.att thead th { vertical-align: bottom; font-weight: 600; color: var(--hint); }
.att tbody tr:last-child td { border-bottom: none; }

/* Колонка с именами не уезжает при горизонтальной прокрутке */
.att .att-name {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 132px;
  max-width: 132px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
  background: var(--section-bg);
  border-right: 1px solid var(--separator);
  font-weight: 500;
  color: var(--text);
}

.att tr.me .att-name { color: var(--link); font-weight: 700; }
.att tr.me td { background: color-mix(in srgb, var(--button) 7%, transparent); }

.att .att-pct { font-weight: 600; color: var(--link); }

.att .ev-m,
.att .ev-t,
.att .ev-d { display: block; line-height: 1.25; }

.att .ev-m { font-size: 10px; letter-spacing: .05em; color: var(--button); }
.att .ev-t { font-size: 11px; color: var(--hint); }
.att .ev-d { font-size: 12px; color: var(--text); font-weight: 600; }

/* Клетка-переключатель: пусто → был → не был */
.mk {
  width: 32px;
  height: 32px;
  border: 1px solid var(--separator);
  border-radius: 9px;
  background: var(--bg);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}

.mk:disabled { cursor: default; opacity: .85; }
.mkn { color: var(--hint); }
.mk1 { background: color-mix(in srgb, var(--green) 16%, transparent); border-color: transparent; color: var(--green); }
.mk0 { background: color-mix(in srgb, var(--red) 14%, transparent); border-color: transparent; color: var(--red); }

/* ---------- разбивка баллов в рейтинге ---------- */

.breakdown {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--separator);
}

.bd-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 0;
  font-size: 13px;
}

.bd-t { flex: 1; color: var(--text); }
.bd-v { color: var(--hint); font-variant-numeric: tabular-nums; }

.bd-p {
  min-width: 34px;
  text-align: right;
  font-weight: 700;
  color: var(--link);
  font-variant-numeric: tabular-nums;
}

/* ---------- инфо ---------- */

.info-intro p { margin: 0 0 8px; }
.info-intro p:last-child { margin-bottom: 0; }

/* Полосы выбора блоков и месяцев прокручиваются, если не влезают */
.info-tabs, .info-months { padding: 12px 16px 0; }
.info-months .tab { font-size: 13px; padding: 5px 12px; }

.info-sum {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--separator);
  color: var(--hint);
  font-size: 13px;
}

.info-sum b { font-size: 20px; color: var(--link); }

.bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
  font-size: 13px;
}

.bar-n {
  flex: 0 0 116px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Дорожка и заливка: простая горизонтальная диаграмма без библиотек */
.bar-t {
  flex: 1;
  height: 8px;
  border-radius: 100px;
  background: color-mix(in srgb, var(--button) 12%, transparent);
  overflow: hidden;
}

.bar-f {
  display: block;
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--button), var(--link));
}

.bar-v {
  flex: 0 0 auto;
  min-width: 38px;
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Итог модуля: незачёт красным, зачёт бирюзой, отличие золотом.
   Подпись длиннее числа, поэтому колонке нужно больше места. */
.bar-v.grade-t-0, .bar-v.grade-t-1, .bar-v.grade-t-2 {
  min-width: 118px;
  font-variant-numeric: normal;
  font-size: 13px;
}

/* Пояс. Цвет приходит из листа «ПОЯСА», поэтому задаётся инлайном;
   здесь только форма. Белый пояс на белой карточке нужно обвести. */
.belt-dot {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--separator);
  box-shadow: inset 0 0 0 1px rgba(11, 59, 55, .22);
}

.belt-dot.big { width: 30px; height: 30px; }

/* Пояс поверх фото в списке: цвет виден, а место под него не тратится */
.ava-wrap { position: relative; flex: 0 0 auto; line-height: 0; }

.belt-pip {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--separator);
  box-shadow: 0 0 0 2px var(--bg), inset 0 0 0 1px rgba(11, 59, 55, .22);
}

/* Строки кадровой карточки */
.card-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--separator);
}

.card-row:last-of-type { border-bottom: none; }
.card-l { flex: 0 0 92px; color: var(--hint); font-size: 14px; }
.card-v { flex: 1; min-width: 0; }
.card-v .belt-dot { display: inline-block; vertical-align: -1px; margin-right: 4px; }
.dim { color: var(--hint); }

/* Разброс по баллам столбцами — внутри одной команды */
.hist {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 84px;
  margin-top: 12px;
}

.hist-col {
  flex: 1;
  display: flex;
  align-items: flex-end;
  height: 100%;
}

.hist-bar {
  width: 100%;
  border-radius: 5px 5px 2px 2px;
  background: color-mix(in srgb, var(--button) 34%, transparent);
}

.hist-col.on .hist-bar {
  background: linear-gradient(180deg, var(--button), var(--link));
}

/* Сравнение команд. Полосы горизонтальные: девять названий вроде
   «Даша-Вероника» в ряд не помещаются и вырождаются в инициалы. */
.team-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
}

.team-n {
  flex: 0 0 104px;
  font-size: 13px;
  color: var(--hint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-v {
  flex: 0 0 auto;
  min-width: 34px;
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.team-f {
  display: block;
  height: 100%;
  border-radius: 100px;
  background: color-mix(in srgb, var(--button) 40%, transparent);
}

/* Своя команда — цветом и жирным, чтобы находилась взглядом сразу */
.team-row.on .team-n { color: var(--text); font-weight: 700; }
.team-row.on .team-f { background: linear-gradient(90deg, var(--button), var(--link)); }

.sort-row { padding: 0 16px 4px; }

/* Заявки на аудитории */
.bk-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--separator);
}

.bk-row:last-child { border-bottom: none; }

.bk-room {
  flex: 0 0 46px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.bk-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.bk-top { display: flex; align-items: center; gap: 8px; }
.bk-time { font-size: 13px; }
.bk-who { font-size: 13px; color: var(--hint); }
.bk-why { font-size: 13px; }
.bk-day { margin: 10px 0 2px; font-size: 13px; color: var(--hint); }

.bk-x {
  flex: 0 0 auto;
  border: none;
  background: none;
  color: var(--hint);
  font-size: 15px;
  padding: 2px 4px;
  cursor: pointer;
}

/* Приоритет: цветом, чтобы «высокий» находился взглядом без чтения */
.pr {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 100px;
  background: var(--separator);
  color: var(--hint);
}

.pr-hi { background: color-mix(in srgb, var(--red) 16%, transparent); color: var(--red); }
.pr-mid { background: color-mix(in srgb, var(--button) 16%, transparent); color: var(--link); }
.pr-low { background: var(--separator); color: var(--hint); }

/* Статус заявки цветом: жёлтая ждёт ответственного, зелёная подтверждена,
   красная отклонена. Полоса слева видна даже боковым зрением при прокрутке. */
.bk-row { border-left: 3px solid transparent; padding-left: 9px; }
.bk-wait { border-left-color: var(--orange); }
.bk-ok { border-left-color: var(--green); }
.bk-no { border-left-color: var(--red); }

.pr.bk-wait { background: color-mix(in srgb, var(--orange) 18%, transparent); color: #a86500; }
.pr.bk-ok { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); }
.pr.bk-no { background: color-mix(in srgb, var(--red) 16%, transparent); color: var(--red); }

.bk-slot { font-size: 13px; font-variant-numeric: tabular-nums; }
.bk-acts { display: flex; gap: 2px; flex: 0 0 auto; }

.bk-y {
  border: none;
  background: none;
  color: var(--green);
  font-size: 17px;
  padding: 2px 5px;
  cursor: pointer;
}

/* Занятая аудитория остаётся видимой, но не выбирается: важно понимать,
   что именно занято, а не гадать, куда делась кнопка */
.chip.busy {
  opacity: .45;
  text-decoration: line-through;
  cursor: not-allowed;
}

/* Неделя выбранной аудитории: строка на день, окно на пару.
   Восемь окон в ряд помещаются, если оставить только час начала. */
.slot-day { margin-bottom: 10px; }

.slot-day-t {
  font-size: 13px;
  color: var(--hint);
  margin-bottom: 4px;
}

.slot-row { display: flex; gap: 4px; }

.slot {
  flex: 1;
  min-width: 0;
  padding: 7px 2px;
  border: 1px solid var(--separator);
  border-radius: 8px;
  background: color-mix(in srgb, var(--green) 12%, var(--bg));
  color: var(--text);
  font: inherit;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.slot.busy {
  background: var(--separator);
  color: var(--hint);
  cursor: not-allowed;
}

.slot.active {
  background: var(--button);
  border-color: var(--button);
  color: var(--button-text);
  font-weight: 700;
}

/* Переключатель показателя внутри карточки — отступы уже дал сам блок */
.metric-row { margin: 10px 0 4px; }
.metric-row .chip { font-size: 13px; }

.belt-scale {
  margin-top: 12px;
  height: 8px;
  border-radius: 100px;
  background: color-mix(in srgb, var(--button) 12%, transparent);
  overflow: hidden;
}

.belt-fill {
  display: block;
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--button), var(--link));
}

.belt-ends {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 12px;
  color: var(--hint);
}

/* Кто и когда поставил — служебная строка, не должна спорить с самой оценкой */
.bar-meta {
  font-size: 12px;
  color: var(--hint);
  margin: -2px 0 10px;
}

.fb-c .bar-meta { margin: 4px 0 0; }

.bar-f.grade-0 { background: var(--red); }
.bar-f.grade-2 { background: linear-gradient(90deg, #f0b429, #f59e0b); }
.bar-v.grade-t-0 { color: var(--red); }
.bar-v.grade-t-2 { color: #b7791f; }

.bar-empty { margin: 0; color: var(--hint); font-size: 14px; }

/* Поля ввода в заполняемых блоках «Инфо» */
.bar-in {
  flex: 0 0 78px;
  width: 78px;
  padding: 7px 10px;
  border: 1px solid var(--separator);
  border-radius: 9px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 16px;  /* меньше 16px — iOS зумит поле при фокусе */
  text-align: right;
}

.bar-in:focus { border-color: var(--button); outline: none; }
.bar-in.saving { opacity: .5; }

.bar-row.me .bar-n { color: var(--link); font-weight: 600; }
.bar-ro { flex: 0 0 78px; text-align: right; color: var(--hint); font-variant-numeric: tabular-nums; }

/* ================= оформление в духе крупных маркетплейс-приложений =========
   Крупные скругления, плитки, нижнее меню. Палитра — та же бирюзовая. */

:root { --r-lg: 22px; --r-xl: 26px; }

/* Место под нижнее меню, иначе оно перекроет последнюю карточку */
#app { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }

/* ---------- плитки быстрых переходов ---------- */

.tiles {
  display: flex;
  gap: 10px;
  padding: 14px 16px 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tiles::-webkit-scrollbar { display: none; }

.tile {
  flex: 0 0 128px;
  height: 128px;
  padding: 14px;
  border: none;
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 2px;
  color: #fff;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform .12s ease;
}

.tile:active { transform: scale(.97); }
.tile-t { font-size: 16px; font-weight: 700; line-height: 1.2; }
.tile-s { font-size: 13px; opacity: .85; }

/* Оттенки одной бирюзы вместо разноцветья — так набор читается как система */
.tl-a { background: linear-gradient(150deg, #2dd4bf, #0d9488); }
.tl-b { background: linear-gradient(150deg, #22d3ee, #0e7490); }
.tl-c { background: linear-gradient(150deg, #5eead4, #14b8a6); }
.tl-d { background: linear-gradient(150deg, #99f6e4, #2dd4bf); color: #0b3b37; }
.tl-d .tile-s { opacity: .7; }

/* ---------- пара карточек: слева статистика, справа действие ---------- */

.duo { display: flex; gap: 10px; padding: 12px 16px 0; }
.duo-left { flex: 1; display: flex; flex-direction: column; gap: 10px; min-width: 0; }

.stat {
  padding: 14px;
  border: none;
  border-radius: var(--r-lg);
  background: var(--section-bg);
  box-shadow: var(--shadow);
  font: inherit;
  text-align: left;
  width: 100%;
}

.stat.link { cursor: pointer; }
.stat-l { font-size: 14px; font-weight: 700; color: var(--link); }
.stat-l2 { font-size: 15px; font-weight: 600; color: var(--text); }
.stat-v { margin-top: 4px; font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.stat-s { margin-top: 2px; font-size: 12px; color: var(--hint); }

.duo-right {
  flex: 0 0 46%;
  border: none;
  border-radius: var(--r-lg);
  background: linear-gradient(160deg, #14b8a6, #0d9488);
  color: #fff;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.duo-right:active { transform: scale(.98); }
.duo-t { font-size: 19px; font-weight: 700; line-height: 1.2; }

/* Круглая кнопка со стрелкой — узнаваемый приём из референса */
.duo-arrow {
  align-self: flex-end;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #fff;
  color: var(--link);
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- широкий баннер ---------- */

.promo {
  margin: 12px 16px 0;
  padding: 16px;
  border-radius: var(--r-lg);
  border: none;
  width: calc(100% - 32px);
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.promo-warn { background: linear-gradient(120deg, #fb923c, #ef4444); color: #fff; }
.promo-t { font-size: 17px; font-weight: 700; }
.promo-s { margin-top: 2px; font-size: 13px; opacity: .9; }

/* ---------- заголовок раздела с кнопкой «Все» ---------- */

.sec {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 16px 2px;
}

.sec h2 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -0.02em; color: var(--on-wall); }

.sec-all {
  border: none;
  border-radius: 100px;
  padding: 7px 14px;
  background: var(--section-bg);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.empty.small { padding: 24px 32px; }

/* ---------- нижнее меню ---------- */

.tabbar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  z-index: 30;
  display: flex;
  padding: 8px 8px;
  /* Плавающая тёмно-зелёная пилюля */
  background: var(--header-dark);
  border-radius: 30px;
  box-shadow: 0 10px 26px rgba(14, 51, 39, .4);
}

.tb {
  flex: 1;
  border: none;
  background: none;
  padding: 4px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: rgba(255, 255, 255, .65);
  font: inherit;
  cursor: pointer;
}

/* Активная вкладка — иконка в белом круге, тёмная внутри */
.tb.active { color: #fff; }
.tb-i {
  position: relative;
  width: 38px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.tb-i svg { width: 24px; height: 24px; display: block; }
.tb.active .tb-i { background: #fff; color: var(--header-dark); }
.tb-l { font-size: 11px; font-weight: 600; }

.tb-ava { display: flex; align-items: center; justify-content: center; }
.tb-ava .fig, .tb-ava .ava { width: 24px; height: 24px; }
.tb.active .tb-ava { outline: 2px solid #fff; border-radius: 50%; outline-offset: 1px; }

/* Счётчик непроверенных задач поверх иконки */
.tb-b {
  position: absolute;
  top: -4px;
  right: -7px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 100px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
}

/* Карточки и блоки — крупнее скругления, в тон новому стилю */
.card, .block, .rank, .att-wrap { border-radius: var(--r-lg); }

/* ---------- обратная связь ---------- */

.tl-e { background: linear-gradient(150deg, #0ea5e9, #0369a1); }

.fb-link .fb-url {
  margin-bottom: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  background: var(--secondary-bg);
  font-size: 13px;
  word-break: break-all;
  color: var(--link);
}

.fb-link .btn { text-decoration: none; }

.fb-team.mine { outline: 2px solid var(--button); }

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

.fb-name { font-size: 16px; font-weight: 700; }
.fb-sub { margin-top: 2px; font-size: 13px; color: var(--hint); }

/* Средний балл — главная цифра карточки команды */
.fb-score {
  flex: 0 0 auto;
  font-size: 26px;
  font-weight: 700;
  color: var(--link);
  font-variant-numeric: tabular-nums;
}

.fb-comments {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--separator);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fb-c { font-size: 14px; }
.fb-cq { font-size: 12px; font-weight: 600; color: var(--hint); }
.fb-ct { margin-top: 2px; white-space: pre-wrap; word-break: break-word; }

/* Ряды переключателей внутри закреплённой шапки: у последнего убираем нижний
   отступ, иначе шапка становится непропорционально высокой */
.topbar .tabs { padding: 10px 0 0; }
.topbar .tabs:last-child { padding-bottom: 10px; }
.topbar .info-months .tab { font-size: 13px; padding: 5px 12px; }

/* Баннер «нужно заполнить» — бирюзовый, в отличие от красного о просрочках:
   это не авария, а обычная работа по расписанию */
.promo-fill {
  background: linear-gradient(120deg, #14b8a6, #0d9488);
  color: #fff;
  display: block;
}


/* ==================== оформление в духе присланного макета ====================
   Белый воздух, крупные скругления, цветные карточки-плитки и плавающее
   тёмное меню. Палитра остаётся бирюзовой. */

:root { --r-card: 26px; }

/* Плоский светлый фон дизайн-системы «Держатели» */
html { background: var(--wall); }
body::before { display: none; }

/* ---------- шапка-«капот»: тёмно-зелёная, приветствие слева ---------- */

.topbar {
  background: var(--header-dark);
  border-bottom: none;
  border-radius: 0 0 30px 30px;
  padding: 14px 18px 18px;
}

.topbar .topbar-row { display: flex; align-items: center; gap: 12px; }

.ava-btn, .ico-btn {
  flex: 0 0 auto;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  line-height: 0;
}

.ava-btn .fig, .ava-btn .ava { width: 46px; height: 46px; }

.hi { flex: 1; min-width: 0; text-align: left; }
.hi-t { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; color: #fff; }
.hi-s { margin-top: 2px; font-size: 12px; color: rgba(255, 255, 255, .55); }

.ico-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, .25);
  background: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ico-btn svg { width: 18px; height: 18px; }

/* Аватар в шапке — с тонкой светлой обводкой, как в макете */
.topbar .ava-btn .fig, .topbar .ava-btn .ava {
  border: 2px solid rgba(255, 255, 255, .15);
}

/* Точка-нотификация — яркой бирюзой на «капоте» */
.ico-btn.has-dot::after {
  content: "";
  position: absolute;
  top: 7px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  border: 1.5px solid var(--header-dark);
}

/* ---------- баннер ---------- */

.hero {
  display: block;
  width: calc(100% - 32px);
  margin: 14px 16px 0;
  padding: 22px;
  border: none;
  border-radius: var(--r-card);
  color: #fff;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.hero { box-shadow: 0 12px 26px rgba(15, 107, 87, .35); }
.hero-fill { background: linear-gradient(135deg, #22a98d, #0f6b57); }
.hero-review { background: linear-gradient(135deg, #8c6fe8, #5b3fc4); box-shadow: 0 12px 26px rgba(91, 63, 196, .3); }
.hero-calm { background: linear-gradient(135deg, #22a98d, #0f6b57); }

.hero-t { display: block; font-size: 27px; font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; }
.hero-s { display: block; margin-top: 6px; font-size: 14px; opacity: .9; }

.faces { display: flex; align-items: center; margin-top: 14px; }
.face { display: block; margin-right: -10px; border-radius: 50%; border: 2px solid rgba(255,255,255,.9); line-height: 0; }
.face .fig { width: 30px; height: 30px; display: block; }

.face.more {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .28);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- лента дней ---------- */

.weekstrip {
  display: flex;
  gap: 7px;
  padding: 16px 16px 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.weekstrip::-webkit-scrollbar { display: none; }

.day {
  position: relative;
  flex: 1 0 44px;
  padding: 10px 0 12px;
  border: 1px solid var(--separator);
  border-radius: 100px;
  background: #fff;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.day-n { display: block; font-size: 12px; color: var(--hint); }
.day-d { display: block; margin-top: 2px; font-size: 16px; font-weight: 700; }

.day.active { background: #0b3b37; border-color: #0b3b37; color: #fff; }
.day.active .day-n { color: rgba(255, 255, 255, .7); }

/* Точка — в этот день есть задачи */
.day-dot {
  position: absolute;
  left: 50%;
  bottom: 5px;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--button);
}
.day.active .day-dot { background: #fff; }

/* ---------- план: две колонки разной высоты ---------- */

.plan {
  padding: 8px 16px 0;
  columns: 2;
  column-gap: 10px;
}

.plan .card {
  break-inside: avoid;
  margin: 0 0 10px;
  border-left: none;
  box-shadow: none;
  border-radius: var(--r-card);
  padding: 16px;
}

.card .tag {
  display: inline-block;
  padding: 5px 11px;
  border-radius: 100px;
  background: rgba(255, 255, 255, .55);
  font-size: 12px;
  font-weight: 600;
}

.plan .card h3 { margin: 12px 0 8px; font-size: 19px; font-weight: 700; line-height: 1.15; }
.c-meta { display: flex; flex-direction: column; gap: 2px; font-size: 13px; opacity: .75; }

.c-foot { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.c-foot .fig { width: 30px; height: 30px; }
.c-who { min-width: 0; line-height: 1.2; }
.c-who span { display: block; font-size: 11px; opacity: .7; }
.c-who b { display: block; font-size: 13px; font-weight: 700; }

/* Цвет карточки задаёт статус — как в макете, где каждая плитка своего тона */
.c-new, .c-in_progress { background: #cfe8ff; color: #0b3b37; }
.c-submitted { background: #e6dbff; color: #2c1d52; }
.c-rework { background: #ffd9a8; color: #4a2c00; }
.c-accepted { background: #c9f2e0; color: #06402b; }
.c-late { background: #ffd2d2; color: #5a1414; }

/* ---------- плавающее меню ---------- */

.tabbar {
  left: 12px;
  right: 12px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  padding: 7px;
  border: none;
  border-radius: 30px;
  background: var(--header-dark);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: 0 10px 26px rgba(14, 51, 39, .4);
}

.tb { color: rgba(255, 255, 255, .65); gap: 0; }
.tb .tb-l { display: none; }

/* Активный пункт — белый круг, как в макете */
.tb.active {
  color: #0b3b37;
  background: #fff;
  border-radius: 100px;
  padding: 9px 0;
}

.tb-i { width: 24px; height: 24px; }
.tb-i svg { width: 24px; height: 24px; }
.tb.active .tb-ava { outline: none; }

#app { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }

/* ---------- вход по коду ---------- */

.login { padding: 56px 24px 32px; text-align: center; }
.login-mark { line-height: 0; }
.login h1 { margin: 18px 0 4px; font-size: 28px; font-weight: 800; letter-spacing: -0.03em; }
.login-sub { margin: 0 0 26px; color: var(--hint); font-size: 15px; }
.login-box { text-align: left; border-radius: var(--r-card); }

/* Код набирают вслепую с чужого экрана — крупно и вразрядку */
#code {
  text-align: center;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: .28em;
  padding: 14px 10px;
  font-variant-numeric: tabular-nums;
}

.login-hint { margin-top: 22px; font-size: 13px; line-height: 1.6; color: var(--hint); }

/* ---------- установка на домашний экран ---------- */

.install-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: none;
  font: inherit;
  text-align: left;
  color: var(--text);
  cursor: pointer;
}

.install-row img { border-radius: 11px; flex: 0 0 auto; }
.ir-txt { flex: 1; min-width: 0; }
.ir-txt b { display: block; font-size: 15px; }
.ir-txt span { display: block; margin-top: 2px; font-size: 13px; color: var(--hint); }

.install-banner {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 14px 16px 0;
  padding: 12px 14px;
  border-radius: var(--r-card);
  background: var(--section-bg);
  box-shadow: var(--shadow);
}

.install-banner img { border-radius: 10px; flex: 0 0 auto; }
.ib-txt { flex: 1; min-width: 0; }
.ib-txt b { display: block; font-size: 14px; }
.ib-txt span { display: block; font-size: 12px; color: var(--hint); }

.ib-add {
  flex: 0 0 auto;
  padding: 8px 14px;
  border: none;
  border-radius: 100px;
  background: var(--button);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.ib-close {
  flex: 0 0 auto;
  border: none;
  background: none;
  color: var(--hint);
  font-size: 15px;
  line-height: 1;
  padding: 4px;
  cursor: pointer;
}

/* Подсказка для случаев, когда установку нельзя запустить из кода */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(11, 59, 55, .45);
  animation: fade .18s ease;
}

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.sheet-box {
  width: 100%;
  max-width: 460px;
  /* Прокрутка внутри модалки: без неё длинная форма (сетка брони на две
     недели) вырастает выше экрана, и до кнопок не добраться — окно кажется
     зависшим. */
  max-height: 88vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 26px 22px calc(26px + env(safe-area-inset-bottom));
  border-radius: 26px 26px 0 0;
  background: #fff;
  text-align: center;
  animation: rise-sheet .22s ease;
}

/* Кнопки действия всегда под рукой — прилипают к низу прокручиваемой модалки */
.sheet-box .btn-row {
  position: sticky;
  bottom: calc(-26px - env(safe-area-inset-bottom));
  margin: 4px -22px calc(-26px - env(safe-area-inset-bottom));
  padding: 12px 22px calc(12px + env(safe-area-inset-bottom));
  background: #fff;
  box-shadow: 0 -6px 14px rgba(11, 59, 55, .06);
}

@keyframes rise-sheet { from { transform: translateY(24px); } to { transform: none; } }

.sheet-icon img { border-radius: 16px; }
.sheet-box h3 { margin: 12px 0 14px; font-size: 20px; font-weight: 700; }

.sheet-steps {
  margin: 0 0 20px;
  padding-left: 22px;
  text-align: left;
  font-size: 15px;
  line-height: 1.6;
}

.sheet-steps li { margin-bottom: 6px; }

.sheet-note { margin: 0 0 16px; font-size: 14px; line-height: 1.5; color: var(--hint); }
.sheet-steps b { font-weight: 700; }

/* Ярлык Telegram — второстепенная возможность, поэтому и выглядит скромно */
.sheet-alt {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 0;
  border: none;
  background: none;
  color: var(--hint);
  font: inherit;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
  cursor: pointer;
}

.sheet-close {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 10px;
  border: none;
  background: none;
  color: var(--link);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}


/* Полоса рядом с полем ввода: в заполняемых блоках она уже, чтобы поле
   оставалось удобным для пальца */
.bar-row .bar-in + .bar-t,
.bar-row .bar-t + .bar-in { flex: 0 0 auto; }
.bar-row:has(.bar-in) .bar-t { flex: 1 1 auto; min-width: 40px; }
.bar-row:has(.bar-ro) .bar-t { flex: 1 1 auto; min-width: 40px; }

/* ---------- сравнительный график ---------- */

.chart-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.chart-stats { font-weight: 500; color: var(--hint); font-variant-numeric: tabular-nums; }

.ch-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 0;
  font-size: 14px;
}

/* Место в сравнении — мелкой цифрой, чтобы не спорить с именем */
.ch-pos {
  flex: 0 0 18px;
  font-size: 12px;
  font-weight: 700;
  color: var(--hint);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.ch-name {
  flex: 0 0 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ch-track {
  flex: 1 1 auto;
  height: 12px;
  border-radius: 100px;
  background: color-mix(in srgb, var(--button) 12%, transparent);
  overflow: hidden;
}

.ch-fill {
  display: block;
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(90deg, #5eead4, #0d9488);
}

.ch-val {
  flex: 0 0 auto;
  min-width: 34px;
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Своя строка выделена — её ищут первой */
.ch-row.me .ch-name { color: var(--link); font-weight: 700; }
.ch-row.me .ch-fill { background: linear-gradient(90deg, #0d9488, #0b3b37); }

/* ---------- список разделов «Инфо» ---------- */

.hub-list { padding: 14px 16px 0; display: flex; flex-direction: column; gap: 10px; }

.hub {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 15px 16px;
  border: none;
  border-radius: var(--r-card);
  background: var(--section-bg);
  box-shadow: var(--shadow);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform .1s ease;
}

.hub:active { transform: scale(.99); }
.hub-txt { flex: 1; min-width: 0; }
.hub-txt b {
  display: block;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  /* В одну строку: иначе длинный заголовок обтекает метку «заполнить»
     и карточка разъезжается */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hub-txt span {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  color: var(--hint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Первым идёт то, что не из «Сводной», — отделяем цветом подложки */
.hub-first { background: linear-gradient(135deg, #5eead4, #14b8a6); color: #fff; }
.hub-first .hub-txt span { color: rgba(255, 255, 255, .85); }
.hub-first .chev { color: rgba(255, 255, 255, .8); }

/* Раздел, где ждут ваших цифр */
.hub.need { outline: 2px solid var(--button); }

.hub-flag {
  flex: 0 0 auto;
  padding: 4px 10px;
  border-radius: 100px;
  background: var(--button);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.hub-pen { flex: 0 0 auto; color: var(--hint); font-size: 14px; }

/* Пометка «пара» в разбивке: показатель командный, а не личный */
.bd-t i { font-style: normal; font-size: 11px; color: var(--hint); }

/* Поиск по списку первокурсников: их две сотни, глазами не найти */
.search {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--separator);
  border-radius: 100px;
  background: var(--section-bg);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  box-shadow: var(--shadow);
}

.search:focus { outline: none; border-color: var(--button); }


/* Решение по брони — две полноразмерные кнопки под строкой заявки.
   Крестик в углу для этого мал: Даша разбирает очередь с телефона. */
.bk-acts {
  display: flex;
  gap: 8px;
  margin: -4px 0 14px;
}

.bk-acts .btn {
  flex: 1;
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 15px;
  letter-spacing: -0.01em;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}

/* Подтверждение — главное действие: залито, с мягкой тенью под цвет.
   Отказ рядом нарочно тише, чтобы не спорить с ним за внимание. */
.bk-acts .bk-y {
  background: linear-gradient(180deg, #22c55e, var(--green));
  color: #fff;
  box-shadow: 0 1px 2px rgba(22, 163, 74, .2), 0 6px 16px rgba(22, 163, 74, .26);
}

.bk-acts .bk-n {
  background: var(--bg);
  color: var(--red);
  border: 1px solid color-mix(in srgb, var(--red) 34%, transparent);
  box-shadow: none;
}

/* Отклик на нажатие: кнопка чуть проседает — видно, что палец попал */
.bk-acts .btn:active { transform: translateY(1px); }
.bk-acts .bk-y:active { box-shadow: 0 1px 3px rgba(22, 163, 74, .3); }
.bk-acts .bk-n:active { background: color-mix(in srgb, var(--red) 8%, var(--bg)); }

/* Значок перед подписью — решение считывается раньше, чем прочитан текст */
.bk-acts .bk-y::before { content: '✓'; font-weight: 800; }
.bk-acts .bk-n::before { content: '✕'; font-weight: 700; }

/* Свёрнутый список: разобранное не мешает очереди, но остаётся под рукой */
.fold {
  margin-bottom: 12px;
  border: 1px solid var(--separator);
  border-radius: 12px;
  background: var(--bg);
}

.fold > summary {
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--link);
  cursor: pointer;
  list-style: none;
}

.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after { content: ' ▾'; color: var(--hint); }
.fold[open] > summary::after { content: ' ▴'; }
.fold .block { border: none; box-shadow: none; margin: 0; }

/* ---------- статистика ---------- */

.st-head { display: flex; align-items: center; gap: 11px; margin-bottom: 10px; }
.st-head .who { flex: 1; min-width: 0; }
.st-head .score { font-size: 20px; font-weight: 700; }

/* Полоса задач. Длина — сколько задач у человека относительно самого
   загруженного, доли внутри — в каком они состоянии. Так за один взгляд
   видно и объём, и качество: короткая зелёная лучше длинной серой. */
.tbar-row {
  height: 10px;
  margin-bottom: 6px;
  background: color-mix(in srgb, var(--button) 8%, transparent);
  border-radius: 100px;
}

.tbar { display: flex; height: 100%; border-radius: 100px; overflow: hidden; }
.tb { display: block; height: 100%; }
.tb.ok { background: var(--green); }
.tb.wait { background: var(--purple); }
.tb.open { background: var(--orange); }
.tb-empty { font-size: 12px; color: var(--hint); }

.tb-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 12px;
  padding: 0 2px;
  font-size: 12px;
  color: var(--hint);
}

.tb-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 5px;
  border-radius: 3px;
  vertical-align: -1px;
}

/* Задачи по людям на главной. Имя слева, полоса по центру, счёт справа —
   строки выравниваются в столбцы и читаются как таблица, а не как список. */
.pt-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  cursor: pointer;
}

.pt-name {
  flex: 0 0 108px;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pt-track {
  flex: 1;
  min-width: 0;
  height: 10px;
  background: color-mix(in srgb, var(--button) 8%, transparent);
  border-radius: 100px;
}

.pt-num {
  flex: 0 0 auto;
  min-width: 34px;
  text-align: right;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Разбор задач по статусам: две колонки, число крупнее подписи —
   цифры читаются столбиком, а не вылавливаются из строки текста. */
.st-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px 12px;
  margin: 8px 0 12px;
  font-size: 13px;
  color: var(--hint);
}

.st-grid b {
  min-width: 18px;
  display: inline-block;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.st-grid.small { font-size: 12px; margin-bottom: 10px; }
.st-grid .st-bad, .st-grid .st-bad b { color: var(--red); }

/* ---------- запасные кнопки вне Telegram ----------
   В браузере и установленном на экран приложении нет ни нижней кнопки
   Telegram, ни его стрелки «назад». Без них нельзя сдать задачу и выйти
   из вкладки, поэтому рисуем свои. Внутри Telegram они не появляются. */

.mb-fallback {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(74px + env(safe-area-inset-bottom));
  z-index: 29;
  padding: 14px 16px;
  border: none;
  border-radius: 12px;
  background: var(--button);
  color: var(--button-text);
  font: inherit;
  font-weight: 700;
  font-size: 16px;
  box-shadow: 0 4px 16px rgba(11, 59, 55, .22);
  cursor: pointer;
}

.mb-fallback:active { background: var(--button-press); }

/* Чтобы плавающая кнопка не перекрывала последний блок списка */
body.has-mb #app { padding-bottom: calc(150px + env(safe-area-inset-bottom)); }

.bb-fallback {
  position: fixed;
  top: calc(9px + env(safe-area-inset-top));
  left: 10px;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--separator);
  border-radius: 50%;
  background: var(--bg);
  color: var(--link);
  box-shadow: var(--shadow);
  cursor: pointer;
}

.bb-fallback svg { width: 20px; height: 20px; }
.bb-fallback:active { background: var(--secondary-bg); }

/* Сдвигаем содержимое шапки вправо, освобождая место под стрелку */
body.has-back .topbar-row { padding-left: 44px; }

/* Гендерное соотношение: одна полоса на два цвета, подписи под ней. */
.gbar {
  display: flex;
  height: 10px;
  margin: 8px 0 6px;
  border-radius: 100px;
  overflow: hidden;
  background: var(--separator);
}
.gbar .gf { background: #ec4899; }   /* девушки */
.gbar .gm { background: #3b82f6; }   /* юноши */
.gmeta { display: flex; gap: 14px; font-size: 13px; color: var(--hint); }
.gmeta span { font-variant-numeric: tabular-nums; }
