:root {
  /* Светлая палитра — бело-мягко-розовая (жемчужный фон, пудрово-коралловые акценты).
     Вторая тема — «Тёмное» оформление (океан): переключатель в Кабинете, оверрайды
     в блоке :root[data-theme="dark"] ниже. Всё тематическое — ТОЛЬКО через переменные. */
  --bg: #f2ede8;            /* тёплый светлый грейж (сплошной фолбек для компонентов) */
  /* Фон страницы — вертикальный градиент: ТЕМНЕЕ вверху, СВЕТЛЕЕ книзу. */
  --page-grad: linear-gradient(180deg, #e7dbd2 0%, #efe6e0 42%, #f7f3f0 78%, #fbf9f7 100%);
  --wash-opacity: 0.62;     /* видимость текстурной «воды» сверху */
  --text: #413a36;          /* тёплый угольный текст */
  --hint: #a89f99;          /* мягкий тёпло-серый */
  --section-bg: #ffffff;    /* белые поверхности (карточки, поля, смайлы) — чтобы не сливались с фоном */
  --line: #e7ded7;          /* мягкий грейж для рамок/разделителей (бывший фон карточек) */
  --bg-tint: #f1ece7;       /* чуть глубже фона — карточка на нём читается даже без тени */
  --card-solid: #ffffff;    /* белый «лист» (welcome-card) поверх тонированного фона */
  --card-border: rgba(87, 76, 70, 0.09);
  --accent: #d09a92;        /* приглушённая пыльная роза (кнопки, активное, тумблеры) */
  --accent-text: #ffffff;
  --title: #574c46;         /* тёмный тёпло-угольный (заголовки — как в референсе, НЕ розовый) */
  --ok: #9aa886;            /* мягкий шалфей (успех / премиум активен) */
  --gold-soft: rgba(200, 150, 142, 0.12);   /* очень мягкая розовая подложка */
  --icon: #c3b2ab;          /* приглушённо-грейжевые иконки навигации */
  --warn: #bf8074;          /* тёпло-терракот: тумблеры тягот, удаление */
  --switch-off: #e0d7d2;    /* выключенный тумблер */
  --quote-border: var(--accent);      /* полоска цитаты на «Главной» */
  --mark-bg: #f2d3cf;       /* пудрово-розовая подложка <mark> в редактируемых текстах */
  --cover-img: url("/assets/cover-rose.svg?v=1788506810");
  --cover-fallback: #ebe0dc;          /* верхний цвет мягкой грейж-обложки */
  --name-on-cover: #413a36;           /* имя юзера на обложке */
  --name-shadow: rgba(255, 255, 255, 0.6);
  --tabbar-h: 64px;
  /* Верхний отступ (вырез устройства + нативная шапка Telegram). JS ставит --app-top-inset
     из SDK; фолбек — CSS-переменные Telegram + env(). Этим цветом красим саму обложку,
     чтобы вверху не оставалось белой полосы под кнопками ✕/⌄. */
  --top-inset: var(--app-top-inset, calc(var(--tg-safe-area-inset-top, env(safe-area-inset-top, 0px)) + var(--tg-content-safe-area-inset-top, 0px)));
}

/* «Тёмное» оформление — океан: жемчужно-белый фон, глубокий сине-зелёный,
   пудрово-розовые акценты. Премиальный минимализм, комфортно глазам. */
:root[data-theme="dark"] {
  --bg: #eaf1ef;            /* холодный светлый грейж (сплошной фолбек для компонентов) */
  --page-grad: linear-gradient(180deg, #d6e6e2 0%, #e3eeeb 45%, #f1f7f5 82%, #f6faf9 100%);
  --wash-opacity: 0.5;
  --text: #14424d;          /* глубокий океанический сине-зелёный (чернила) */
  --hint: #7c939a;          /* приглушённый сине-серый */
  --section-bg: #ffffff;    /* белые поверхности (карточки, поля, смайлы) */
  --line: #dae6e2;          /* мягкий сине-грейж для рамок/разделителей */
  --bg-tint: #e2edea;       /* чуть глубже фона */
  --card-solid: #ffffff;    /* белый «лист» (welcome-card) поверх океанического фона */
  --card-border: rgba(20, 66, 77, 0.09);
  --accent: #17606b;        /* океаническая волна (кнопки, активное) */
  --accent-text: #ffffff;
  --title: #145059;         /* заголовки — глубокий океан */
  --ok: #3f8578;            /* морская зелень (успех) */
  --gold-soft: rgba(23, 96, 107, 0.10);  /* мягкая океаническая подложка */
  --icon: #8fb0b6;          /* приглушённые сине-зелёные иконки */
  --warn: #c47b76;          /* пудрово-розовый тёплый (тяготы, удаление) */
  --switch-off: #ccd8d6;
  --quote-border: #e5b3ae;  /* пудрово-розовая полоска цитаты */
  --mark-bg: #eec4bf;       /* пудрово-розовая подложка <mark> в редактируемых текстах */
  --cover-img: url("/assets/cover-ocean.svg?v=1788506810");
  --cover-fallback: #cfe3e2;
  --name-on-cover: #14424d;
  --name-shadow: rgba(255, 255, 255, 0.5);
}

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

/* <mark> в редактируемых текстах (админка → data-html): браузер по умолчанию
   красит его в жёлтый — здесь подложка из палитры. Класс не нужен: <mark>слово</mark>. */
mark { background: var(--mark-bg); color: inherit; padding: 0 .18em; border-radius: 4px; }

html {
  background: var(--bg);   /* сплошной фолбек под градиентом */
}
html, body {
  margin: 0;
  padding: 0;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
body {
  /* Градиент фона привязан к экрану (fixed): верх темнее, низ светлее — не «едет» при скролле. */
  background: var(--page-grad) fixed;
  min-height: 100vh;
}

#app {
  max-width: 520px;
  margin: 0 auto;
  /* Верхний вырез/шапку Telegram закрашиваем самой обложкой (.cover), а не отступом —
     иначе сверху видна белая полоса. Поэтому здесь padding-top больше не нужен. */
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  min-height: 100vh;
  position: relative;
  z-index: 0;              /* контент над фоновой «водой» ниже */
}

/* Мягкая декоративная «вода» СВЕРХУ: обложка темы (var(--cover-img)) продолжается от
   шапки вниз и гаснет книзу — картинка светлеет и сливается с фоном (--bg). Крепим к
   #app (а не body): #app прозрачен и создаёт свой стек-контекст НАД непрозрачным фоном
   body, иначе фон body перекрыл бы слой с z-index:-1. Карточки непрозрачны и лежат сверху. */
#app::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 62vh;
  background-image: var(--cover-img);
  background-size: cover;
  background-position: top center;
  opacity: var(--wash-opacity);
  pointer-events: none;
  z-index: -1;
  /* Плотно вверху (у шапки), плавно гаснет книзу → сливается с фоном. */
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 22%, transparent 80%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 22%, transparent 80%);
}

/* Зернистая текстура поверх фона (тонкий «шум») — заметная, но неагрессивная. Fixed на весь
   экран, ПОД контентом (z-index:-1); на белых листах не видна (они выше по стеку). */
#app::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='150'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 150px 150px;
  opacity: 0.12;
  mix-blend-mode: multiply;
}

/* Шапка (обложка + аватар + имя) — ТОЛЬКО на «Главной». На остальных вкладках она
   пряталась бы «висящей» над белым листом, поэтому убираем её и верхнюю «воду», а
   контент поднимаем к верху (отступ = вырез/шапка Telegram, чтобы не под ✕/⋮). */
#app:not([data-tab="home"]) .profile { display: none; }
#app:not([data-tab="home"])::after { display: none; }
#app:not([data-tab="home"]) .content { padding-top: calc(var(--top-inset) + 30px); }

/* --- Профиль: тонкая обложка + аватар (крупнее, выше, ближе к центру), имя под аватаром --- */
.profile { position: relative; }

.cover {
  /* Обложка тянется до самого верха экрана и поглощает верхний вырез/шапку Telegram,
     поэтому цвет идёт от края, без белой полосы сверху. Нижний край РАЗМЫТ маской —
     обложка плавно растворяется в контенте, без резкой линии (её продолжает «вода» #app::after). */
  height: calc(30px + var(--top-inset));   /* совсем тонкая полоса-шапка → карточка ещё выше */
  background-image: var(--cover-img);
  background-size: cover;
  background-position: top center;
  background-color: var(--cover-fallback);   /* фолбек — верхний цвет градиента обложки */
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 42%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0, #000 42%, transparent 100%);
}

.profile-corner {
  position: absolute;
  top: calc(6px + var(--top-inset));   /* держим имя/аватар ниже нативных кнопок ✕/⌄ */
  right: 24px;             /* немного левее от края */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

/* Профиль-строка в верхней части welcome-card: аватар + имя («кто» перед «что»). */
.wc-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.avatar {
  width: 44px;                 /* чуть меньше — аватар теперь внутри карточки */
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--section-bg) center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  overflow: hidden;
  flex: none;
  box-shadow: 0 2px 8px rgba(60, 50, 45, 0.14);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.user-name {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  color: var(--text);          /* тёмный текст на белой карточке (тени/обрезки больше не нужны) */
  line-height: 1.2;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.intro {
  padding: 4px 4px 0;
  text-align: center;
  color: var(--hint);
  font-size: 15px;
  line-height: 1.5;
}
.intro.left { text-align: left; padding: 0; }
.intro b { color: var(--text); }

/* --- Контент --- */
.content { padding: 10px 16px 24px; }
.panel { display: none; }
.panel.active { display: block; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* Трекер / Тяготы / Обзор — весь контент вкладки в ОДНОМ белом круглом «листе»
   (как welcome-card на Главной), чтобы текст не сливался с тонированным фоном.
   Поля внутри — слегка «утоплены» (--bg-tint), чтобы читаться на белом. */
.panel[data-panel="tracker"].active,
.panel[data-panel="burdens"].active,
.panel[data-panel="stats"].active {
  background: var(--card-solid);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 6px 16px 20px;   /* меньше сверху — блоки сами дают воздух своими margin */
  box-shadow: 0 6px 22px rgba(60, 50, 45, 0.08);
}
/* Первый блок внутри листа не должен «улетать» слишком низко от верхнего края. */
.panel[data-panel="tracker"].active > .block:first-child,
.panel[data-panel="burdens"].active > .block:first-child { margin-top: 10px; }

.panel h2 { font-size: 20px; margin: 8px 0 12px; color: var(--text); }
.back-btn {
  border: none;
  background: var(--section-bg);
  color: var(--text);
  border-radius: 10px;
  padding: 11px 16px;   /* тач-цель ≥40px по высоте (аудит UI) */
  font-size: 14px;
  cursor: pointer;
  margin: 4px 0 4px;
}
.back-btn:active { background: var(--gold-soft); }
.panel h2.section-gap { margin-top: 26px; }
.hint { color: var(--hint); font-size: 14px; }

/* --- Блоки главной --- */
.block { margin: 24px 0; }   /* больше воздуха между секциями (Моё состояние / Цели / Дневник) */
.block-title {
  color: var(--title);
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 10px;
}
.block-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.block-pen {
  flex: none;
  border: none;
  background: var(--section-bg);
  border-radius: 8px;
  /* тач-цель ≥40px (была 32x26 — мелко для пальца, найдено аудитом UI) */
  min-width: 40px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 8px;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  color: var(--hint);            /* карандаш нейтрально-серый — второстепенное действие */
}
.block-pen:active { background: var(--gold-soft); color: var(--accent); }  /* цветной только при нажатии */
.pen-ic { display: block; }

.line-input {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font-size: 16px;
  padding: 8px 2px;
  outline: none;
}
.line-input::placeholder { color: var(--hint); }
.line-input.boxed {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: var(--section-bg);
}

/* --- Оценка состояния: 5 смайлов вместо текстового поля --- */
.mood-scale {
  display: flex;
  gap: 6px;
  justify-content: space-between;
}
.mood-emoji {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 9px 2px;
  border: 1px solid transparent;      /* без обводки в покое — легче; только мягкий фон */
  border-radius: 14px;
  background: var(--bg-tint);
  color: var(--hint);
  cursor: pointer;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
.mood-emoji .mood-face {
  font-size: 26px;
  line-height: 1;
  opacity: .8;
  filter: grayscale(.3);
  transition: transform .12s ease, opacity .12s ease, filter .12s ease;
}
.mood-emoji .mood-label {
  font-size: 11px;
  line-height: 1.1;
  text-align: center;
}
.mood-emoji:active { transform: scale(.94); }
.mood-emoji.on {
  background: var(--gold-soft);
  border-color: var(--accent);
  color: var(--title);
}
.mood-emoji.on .mood-face {
  opacity: 1;
  filter: none;
  transform: scale(1.12);
}

.diary-area, #request-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-tint);
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
  padding: 12px;
  outline: none;
  resize: vertical;
}
.diary-area::placeholder { color: var(--hint); }

/* --- Голосовой ввод: микрофон в углу поля --- */
.voice-field { position: relative; }
/* Микрофон занимает нижний-правый угол → нативный ресайз выключаем.
   padding-bottom с запасом под кнопку (36px + отступы): раньше последняя строка
   текста уезжала ПОД микрофон и была нечитаема (найдено аудитом UI). */
.voice-field .diary-area { resize: none; padding-bottom: 52px; }
.mic-btn {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--bg);
  color: var(--accent);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.10);
  transition: background .15s, color .15s, transform .1s;
  -webkit-tap-highlight-color: transparent;
}
.mic-btn:active { transform: scale(0.92); }
.mic-btn:disabled { opacity: 0.45; cursor: default; }
.mic-btn .mic-spin { display: none; }
/* Идёт запись — красный пульс, тап ещё раз = стоп. */
.mic-btn.recording {
  background: #d9483b;
  color: #fff;
  border-color: #d9483b;
  animation: micPulse 1.3s ease-out infinite;
}
@keyframes micPulse {
  0%   { box-shadow: 0 0 0 0 rgba(217, 72, 59, 0.55); }
  70%  { box-shadow: 0 0 0 10px rgba(217, 72, 59, 0); }
  100% { box-shadow: 0 0 0 0 rgba(217, 72, 59, 0); }
}
/* Идёт расшифровка — прячем иконку, показываем спиннер. */
.mic-btn.busy .mic-ic { display: none; }
.mic-btn.busy .mic-spin {
  display: block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--gold-soft);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: micSpin .7s linear infinite;
}
@keyframes micSpin { to { transform: rotate(360deg); } }

/* --- Переключатели целей --- */
.check-list { display: flex; flex-direction: column; }
.check-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 2px;
  border-bottom: 1px solid var(--line);
  font-size: 16px;
  gap: 12px;
}
.check-row:last-child { border-bottom: none; }
.check-row .title { flex: 1; word-break: break-word; }

.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0;
  background: var(--switch-off);
  border-radius: 26px;
  transition: .2s;
}
.slider:before {
  content: "";
  position: absolute;
  width: 20px; height: 20px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider:before { transform: translateX(20px); }

/* Тяготы: отметка «давило» — тёплый терракот/роза, а не «позитивный» акцент целей. */
.switch.warn input:checked + .slider { background: var(--warn); }

/* Подсказка под заголовком блока «Что тебя тяготит?» */
.burden-hint { margin: -2px 0 10px; font-size: 13px; line-height: 1.4; }
.check-row .del-burden { flex: none; }

/* --- Карточка запрос/цели: слегка «утоплена» на белом листе трекера --- */
.green-card {
  background: var(--bg-tint);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  margin: 24px 0;
}
.green-card-label {
  color: var(--title);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .5px;
  margin-bottom: 6px;
}
.green-card-text { font-size: 15px; line-height: 1.45; }
.edit-pen { color: var(--hint); display: inline-flex; vertical-align: -2px; }  /* серый карандаш */
#request-card:active .edit-pen { color: var(--accent); }  /* цветной только при нажатии карточки */
#request-card { cursor: pointer; }
.green-card-edit textarea { margin-top: 4px; background: var(--bg); }

.finish-hint {
  text-align: center;
  color: var(--hint);
  font-size: 13px;
  margin: 8px 4px 0;
  line-height: 1.4;
}

/* --- Кнопки --- */
.finish-btn {
  display: block;
  width: 100%;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  padding: 15px;
  border-radius: 14px;
  margin: 26px 0 8px;   /* воздух перед кнопкой завершения дня */
  cursor: pointer;
}
.finish-btn:disabled { opacity: .6; }
.finish-btn.done { background: var(--ok); }

.btn {
  border: none;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 15px;
  font-weight: 600;
  padding: 12px 18px;
  border-radius: 12px;
  cursor: pointer;
}
.btn.small { padding: 11px 18px; font-size: 14px; }  /* тач-цель ≥40px (аудит UI) */
/* Рамка обязательна: без неё на панели того же цвета кнопка читается как обычный текст. */
.btn.ghost { background: var(--section-bg); color: var(--text); border: 1px solid var(--line); }
.btn.danger { background: transparent; color: var(--warn); font-size: 18px; padding: 6px 8px; }
.row-btns { display: flex; gap: 8px; margin-top: 8px; }
.row-btns.right { justify-content: flex-end; }

/* Намеренно неприметная — необратимое действие, не должно тянуть взгляд. */
.reset-account-btn {
  display: block;
  margin: 28px auto 4px;
  background: none;
  border: none;
  color: var(--hint);
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  padding: 12px 16px;   /* тач-цель ≥40px по высоте (аудит UI) */
}

/* --- Цели (вкладка) --- */
.tip-card {
  background: var(--section-bg);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 14px;
  font-size: 14px;
  line-height: 1.5;
}
.tip-card .tip-title { font-size: 17px; font-weight: 700; margin-bottom: 6px; color: var(--title); }
.tip-card p { margin: 6px 0; }

.goals-counter { color: var(--hint); font-size: 14px; margin: 4px 0 10px; }
.goals-counter b { color: var(--text); }

.goal-list { display: flex; flex-direction: column; gap: 8px; }
.goal-item {
  display: flex;
  align-items: center;
  gap: 2px;              /* иконки сами держат тач-зону 36x40 — лишний зазор съедал ширину заголовка */
  background: var(--section-bg);
  border-radius: 12px;
  padding: 12px 14px;
}
.goal-item .title { flex: 1; font-size: 15px; word-break: break-word; margin-right: 4px; }
/* «Удалить» — деструктивное действие: отделяем от «переименовать», чтобы не промахнуться. */
.goal-item .icon-btn.del { margin-left: 6px; }
.goal-item input {
  flex: 1;
  border: none;
  border-radius: 8px;
  padding: 8px;
  font-size: 15px;
  background: var(--bg);
  color: var(--text);
  outline: none;
}
/* Тач-цель ≥40px: иконки в строке цели были 28x28 и стояли вплотную — «удалить»
   вплотную к «переименовать», легко промахнуться и снести цель (найдено аудитом UI).
   Визуальный размер иконки прежний, растёт только область нажатия. */
.icon-btn {
  border: none; background: none; cursor: pointer;
  font-size: 16px; opacity: .75;
  min-width: 36px; min-height: 40px;
  padding: 4px 2px;
  display: inline-flex; align-items: center; justify-content: center;
}
/* Карандаш «переименовать» в списке целей — нейтрально-серый, цветной при нажатии */
.icon-btn.edit { color: var(--hint); }
.icon-btn.edit:active { color: var(--accent); }
/* «Глаз» активности (цели и тяготы) */
.icon-btn.eye { flex: none; opacity: 1; color: var(--ok); } /* активна — оливковый открытый глаз */
.goal-item.inactive, .check-row.inactive { opacity: .55; }                        /* неактивная строка приглушена */
.goal-item.inactive .icon-btn.eye, .check-row.inactive .icon-btn.eye { color: var(--hint); } /* неактивна — серый перечёркнутый глаз */
/* «Цель достигнута» — зелёная галочка + раздел достигнутых */
.icon-btn.achieve { flex: none; color: var(--ok); }
.ach-mark { flex: none; display: flex; align-items: center; padding: 4px; color: var(--ok); }
.goal-item.achieved .title { text-decoration: line-through; color: var(--hint); }
.achieved-box { margin-top: 16px; }
.achieved-box > summary { cursor: pointer; color: var(--title); font-weight: 600; font-size: 14px; padding: 8px 2px; list-style: none; }
.achieved-box > summary::-webkit-details-marker { display: none; }
.achieved-box > summary::before { content: "▸ "; }
.achieved-box[open] > summary::before { content: "▾ "; }
.ach-tag { font-size: 11px; color: var(--ok); border: 1px solid var(--ok); border-radius: 8px; padding: 0 6px; margin-left: 6px; white-space: nowrap; }

.add-goal { display: flex; gap: 8px; margin-top: 14px; }
.add-goal .line-input { flex: 1; }

/* --- Обзор / календарь выполнения --- */
.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.cal-title { font-size: 16px; font-weight: 600; color: var(--title); }
.cal-nav {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: var(--section-bg);
  color: var(--text);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.cal-nav:active { background: var(--gold-soft); }
.cal-weekdays,
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.cal-weekdays {
  margin-bottom: 6px;
}
.cal-weekdays span {
  text-align: center;
  font-size: 11px;
  color: var(--hint);
}
.cal-cell {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--bg-tint);
  border: 1px solid var(--line);   /* «утопленная» ячейка на белом листе обзора */
  font-size: 13px;
  color: var(--text);
}
.cal-cell.blank { background: transparent; border-color: transparent; }
.cal-cell.future { opacity: .4; }
.cal-cell.full { background: var(--ok); color: #fff; }
.cal-cell.part { background: var(--gold-soft); }
.cal-cell.today { outline: 2px solid var(--accent); outline-offset: -2px; }
.cal-day { position: relative; z-index: 1; }
.cal-check {
  position: absolute;
  right: 3px;
  bottom: 1px;
  font-size: 10px;
  line-height: 1;
  font-weight: 700;
}
.cal-cell.full .cal-check { color: #fff; }
.cal-cell.part .cal-check { color: var(--accent); }
.cal-legend {
  display: flex;
  gap: 16px;
  margin-top: 14px;
  font-size: 12px;
  color: var(--hint);
}
.cal-lg { display: flex; align-items: center; gap: 6px; }
.cal-dot { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.cal-dot.full { background: var(--ok); }
.cal-dot.part { background: var(--gold-soft); }
.cal-cell[data-date] { cursor: pointer; }
.cal-tap-hint { text-align: center; margin-top: 12px; }

/* Детальная страница дня (Обзор → клик по дню) */
.day-title { font-size: 18px; margin: 6px 0 14px; color: var(--title); }
.day-val { font-size: 15px; color: var(--text); white-space: pre-wrap; word-break: break-word; margin: 0; }
.day-val.empty { color: var(--hint); }
.day-checks { display: flex; flex-direction: column; gap: 8px; }
.day-check { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--hint); }
.day-check.done { color: var(--text); }
.day-check .mark { width: 18px; text-align: center; color: var(--ok); font-weight: 700; flex: none; }
.day-status { margin-top: 16px; font-size: 14px; color: var(--hint); }
/* Кнопка «Заполнить этот день» в отчёте дня (вчера/позавчера) */
.edit-day-btn { display: block; width: 100%; margin: 0 0 14px; }

/* Баннер «Заполняешь: <дата>» на Трекере/Тяготах при дозаполнении прошлого дня */
.edit-day-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--gold-soft);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 10px 12px;
  margin: 12px 0 4px;
  font-size: 14px;
  color: var(--title);
}
.edit-day-banner[hidden] { display: none; }
.edit-day-banner b { font-weight: 700; }
.edb-hint { display: block; margin-top: 3px; color: var(--hint); font-size: 12px; font-weight: 400; }
.edb-reset {
  flex: none;
  border: none;
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 10px;
  cursor: pointer;
}

/* Переключатель День / Тяготы в детальной странице дня */
.day-tabs { display: flex; gap: 8px; margin: 0 0 16px; }
.day-tab {
  flex: 1; padding: 8px 12px; border: 1px solid var(--line);
  background: var(--bg-tint); color: var(--hint); border-radius: 10px;
  font-size: 14px; font-weight: 600; cursor: pointer;
}
.day-tab.on { background: var(--accent); color: #fff; border-color: var(--accent); }

/* --- Приветствие на «Главной» --- */
.welcome-card {
  /* Белая карточка с мягкой тенью — чтобы блок с текстом НЕ сливался с тонированным
     фоном (обложка-«вода» сверху), а читался как приподнятый лист. */
  background: var(--card-solid);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 18px 18px 16px;
  margin-bottom: 18px;
  color: var(--text);
  font-size: 16px;          /* «Главная» — чуть крупнее для читаемости (было 14.5px) */
  line-height: 1.5;
  /* Многослойная мягкая тень — карточка «физически» приподнята над фоном. */
  box-shadow: 0 2px 6px rgba(60, 50, 45, 0.05), 0 16px 36px rgba(60, 50, 45, 0.14);
}
.welcome-card p { margin: 0 0 10px; }
.welcome-card .wc-hi { font-size: 18px; font-weight: 700; color: var(--title); }
/* Список с кастомными контурными иконками (в стиле темы, монохром — как карандаш). */
.welcome-card .wc-list { margin: 0 0 10px; padding-left: 0; list-style: none; }
.welcome-card .wc-list li {
  display: flex; align-items: flex-start; gap: 11px; margin-bottom: 11px;
}
.wc-ic { flex: none; color: var(--accent); margin-top: 1px; }  /* цвет темы, не «радужный» эмодзи */
.wc-ic svg { display: block; }
.welcome-card .wc-soft { color: var(--hint); }
.welcome-card .wc-quote {
  font-style: italic; color: var(--title);
  border-left: 3px solid var(--quote-border); padding-left: 12px; margin: 14px 0;
}
.wc-chat {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; margin: 6px 0 12px; padding: 12px;
  background: var(--accent); color: #fff; border: none; border-radius: 12px;
  font-size: 15px; font-weight: 600; cursor: pointer;
}
.wc-chat-ic { display: flex; }
.wc-chat-ic svg { display: block; }
.wc-chat:active { opacity: .9; }

/* --- Тесты --- */
.test-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--section-bg);
  border-radius: 14px;
  padding: 16px 18px;
  margin: 10px 0;
  font-size: 15px;
}
.badge {
  background: var(--gold-soft);
  color: var(--title);
  font-size: 12px;
  font-weight: 600;
  border-radius: 10px;
  padding: 4px 10px;
}
.badge.go { background: var(--accent); color: var(--accent-text); }
.btn.edit-day-btn.locked { background: var(--bg-tint); color: var(--hint); }
.test-card.clickable { cursor: pointer; }
.test-card.clickable:active { background: var(--gold-soft); }

/* --- Тест «Колесо баланса» --- */
.wheel-wide-btn { display: block; width: 100%; margin-bottom: 10px; }
.wheel-q-card {
  background: var(--section-bg);
  border-radius: 16px;
  padding: 22px 18px 16px;
  text-align: center;
  margin-bottom: 12px;
}
.wheel-q-card h3 {
  margin: 0 0 14px;
  color: var(--title);
  font-size: 17px;
  line-height: 1.45;
  font-weight: 600;
  min-height: 3.6em;             /* три строки: кнопки ответов не «прыгают» между вопросами */
  display: flex;
  align-items: center;
  justify-content: center;
}
.wheel-progress-bar {
  height: 6px;
  background: var(--bg-tint);
  border-radius: 3px;
  margin: 2px 0 12px;
  overflow: hidden;
}
#wheel-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  width: 0;
  transition: width .25s ease;
}
.wheel-options { display: flex; flex-direction: column; gap: 8px; }
.wheel-options button {
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg-tint);
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}
.wheel-options button.on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}
#wheel-svg-wrap {
  background: var(--section-bg);
  border-radius: 16px;
  padding: 8px;
  margin-bottom: 12px;
}
.wheel-svg { width: 100%; height: auto; display: block; color: var(--text); }
.wheel-svg .wheel-sector {
  transform-box: view-box;
  transform-origin: center;
  animation: wheelGrow .5s ease-out backwards;
}
@keyframes wheelGrow { from { transform: scale(0); } to { transform: scale(1); } }
.wheel-svg .wheel-center { fill: var(--section-bg); stroke: var(--line); stroke-width: 1.5; }
.wheel-svg .wheel-avg { fill: var(--title); }
/* Одна колонка: в две названия сфер («Отдых и удовольствие», «Быт и пространство»)
   обрезались многоточием на телефоне — 5 из 8 подписей были нечитаемы (найдено
   аудитом UI). Две колонки возвращаются только на широких экранах. */
.wheel-legend {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px 12px;
  background: var(--section-bg);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 12px;
  font-size: 13px;
}
@media (min-width: 560px) {
  .wheel-legend { grid-template-columns: 1fr 1fr; }
}
.wheel-leg-item { display: flex; align-items: center; gap: 6px; min-width: 0; }
.wheel-leg-item > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wheel-leg-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.wheel-leg-score { margin-left: auto; font-weight: 700; color: var(--title); }

/* --- Кабинет / премиум --- */
.premium-card {
  background: var(--section-bg);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 16px;
}
.premium-status { font-size: 17px; font-weight: 600; }
.premium-status.active { color: var(--ok); }
.premium-status.inactive { color: var(--hint); }

.premium-info {
  background: var(--section-bg);
  border-radius: 16px;
  padding: 16px 18px;
  margin-bottom: 18px;
}
.premium-info-title { font-weight: 600; margin: 0 0 8px; }
.premium-info ul { margin: 0; padding-left: 20px; line-height: 1.8; }

.buy-row { display: flex; gap: 10px; }
.buy-row.hidden { display: none; }
.buy-btn {
  display: block;
  flex: 1;
  text-align: center;
  text-decoration: none;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 16px;
  font-weight: 600;
  padding: 15px;
  border-radius: 14px;
}
.buy-btn.hidden { display: none; }

.install-btn {
  display: block;
  width: 100%;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-size: 16px;
  font-weight: 600;
  padding: 14px;
  border-radius: 14px;
  margin-bottom: 16px;
  cursor: pointer;
}
.install-note {
  color: var(--ok);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
}

/* --- Напоминание (Кабинет) --- */
.reminder-card {
  background: var(--section-bg);
  border-radius: 16px;
  padding: 14px 16px;
}
.reminder-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  font-size: 15px;
}
.reminder-row[hidden] { display: none; }
#reminder-time {
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
  padding: 8px 10px;
}
.reminder-hint { margin: 8px 0 0; }

/* --- Тарифы (Кабинет) --- */
.tariff-card {
  background: var(--section-bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
  margin-bottom: 14px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.05);
}
.tariff-card.vip { border-color: var(--accent); }
.tariff-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.tariff-name { font-size: 16px; font-weight: 700; color: var(--title); }
.tariff-active-badge {
  font-size: 12px; font-weight: 700; color: var(--ok);
  border: 1px solid var(--ok); border-radius: 10px; padding: 2px 8px;
  white-space: nowrap;
}
.tariff-card ul { margin: 0 0 12px; padding-left: 20px; line-height: 1.7; }
/* Пункты всех тарифов начинаются с эмодзи — он и есть маркер, обычная точка-буллит
   дублировала бы его (как на странице Tribute, см. screenshot в задаче). */
#tariff-free ul, #tariff-premium ul, #tariff-vip ul { list-style: none; padding-left: 0; }
.tariff-card.free { border-style: dashed; }
.tariff-free-note { margin: 0; }

/* Платная функция для free: видно, но серым и без взаимодействия (тап = апселл).
   «Светло-серый фон» — прямое продуктовое требование к заблокированным блокам. */
.locked-feature {
  background: var(--bg-tint);
  border-radius: 12px;
  padding: 10px 12px;
  opacity: 0.75;
  cursor: pointer;
  filter: grayscale(0.55);
}
.locked-feature .check-row { border: none; padding: 6px 0; }
.locked-feature .check-row .title { color: var(--hint); }
.lock-mark { margin-left: auto; font-size: 14px; opacity: .8; }
.locked-note {
  margin: 8px 0 2px;
  font-size: 13px;
  color: var(--hint);
  text-align: center;
}
.tariff-card .buy-btn { margin: 0; }

/* Тумблеры тарифов в админ-таблице */
.adm-tier {
  border: 1px solid var(--line);
  background: var(--bg-tint);
  border-radius: 8px;
  padding: 3px 6px;
  font-size: 12px;
  cursor: pointer;
  color: var(--hint);
}
.adm-tier.on { background: var(--gold-soft); border-color: var(--ok); }

/* --- Админ-панель --- */
.admin-btn { display: block; width: 100%; margin: 0 0 18px; }
/* display:block перебивает HTML-атрибут hidden (та же ловушка, что была с .tab[hidden]) —
   без этого правила кнопку видели ВСЕ юзеры. */
.admin-btn[hidden] { display: none; }
.admin-stats { font-size: 14px; color: var(--text); margin: 4px 0 14px; }
.admin-table-wrap { overflow-x: auto; }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  background: var(--section-bg);
  border-radius: 12px;
  overflow: hidden;
}
.admin-table th, .admin-table td {
  padding: 7px 5px;
  text-align: left;
  border-bottom: 1px solid var(--bg);
  vertical-align: top;
}
.admin-table th { color: var(--title); font-size: 11px; line-height: 1.25; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table .adm-c { text-align: center; }
.admin-table .adm-d { white-space: nowrap; color: var(--hint); font-size: 11px; }
.admin-table .adm-name { word-break: break-word; min-width: 84px; }
.admin-table .adm-c { width: 34px; padding-left: 2px; padding-right: 2px; }
.adm-uname { display: block; color: var(--hint); font-size: 11px; }

/* Промпты в админке */
.prompt-box {
  background: var(--section-bg);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.prompt-box > summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--title);
  word-break: break-word;
}
.prompt-edit {
  width: 100%;
  min-height: 240px;
  margin-top: 10px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  line-height: 1.45;
  padding: 10px;
  resize: vertical;
  outline: none;
}

/* --- Оформление: переключатель Светлое/Тёмное (низ Кабинета) --- */
.theme-switch {
  display: flex;
  gap: 4px;
  background: var(--section-bg);
  border-radius: 14px;
  padding: 4px;
  margin-bottom: 14px;   /* переключатель тем теперь первым блоком Кабинета */
}
.theme-opt {
  flex: 1;
  border: none;
  border-radius: 11px;
  background: transparent;
  color: var(--hint);
  font-size: 14px;
  font-weight: 600;
  padding: 11px 8px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.theme-opt.on {
  background: var(--accent);
  color: var(--accent-text);
}
.theme-note { margin-top: 8px; font-size: 12px; }

/* Плавная смена палитры при переключении темы (после первой отрисовки —
   класс вешает JS, чтобы загрузка не «переливалась»). */
html.theme-anim body,
html.theme-anim .tab-bar,
html.theme-anim .cover,
html.theme-anim .welcome-card,
html.theme-anim .block,
html.theme-anim .premium-card,
html.theme-anim .premium-info,
html.theme-anim .test-card {
  transition: background-color .25s ease, color .25s ease, border-color .25s ease;
}

/* --- Нижняя навигация --- */
.tab-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  max-width: 520px;
  margin: 0 auto;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: flex;
  background: var(--card-solid);                 /* белая панель — не сливается с фоном */
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 16px rgba(60, 50, 45, 0.06);
}
.tab {
  flex: 1;
  border: none;
  background: none;
  color: var(--hint);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 11px;
  cursor: pointer;
  padding: 6px 2px;
  transition: color .15s ease;
}
.tab[hidden] { display: none; }   /* скрытая вкладка («Цели») — иначе .tab{display:flex} перебивает hidden */
.tab .ico { display: flex; align-items: center; justify-content: center; height: 26px; color: var(--icon); }
.tab .ico svg {
  width: 26px;
  height: 26px;
  flex: none;          /* в WebKit (Telegram Desktop) flex-айтем-SVG иначе схлопывается */
  display: block;
  stroke-width: 2.1;   /* линии чуть толще — иконки выразительнее (было 1.8 в разметке) */
}
.tab.active { color: var(--accent); font-weight: 600; }

/* Белые карточки/поверхности заметно приподняты над тонированным фоном — мягкая тень,
   чтобы контентные блоки не сливались с фоном (Кабинет, тесты, цели, напоминание, промпты). */
.tip-card, .goal-item, .test-card, .premium-card, .premium-info,
.reminder-card, .prompt-box, .theme-switch, .admin-table, .admin-btn {
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.05);
}

/* --- Админ-панель: широкий макет + варианты меню -------------------------------
   На телефоне всё как раньше (одна колонка). На широком экране #app расширяется,
   слева меню разделов, справа рабочая область — редактировать десятки полей в
   узкой колонке было неудобно. Вариант меню (sidebar/tabs/flow) выбирается
   тумблером и запоминается на устройстве. */
#app:has(.panel[data-panel="admin"].active) { max-width: 1400px; }

.admin-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.admin-layout-switch { display: flex; gap: 4px; background: var(--section-bg); border-radius: 12px; padding: 4px; }
.admin-layout-switch .theme-opt { padding: 8px 12px; font-size: 13px; }

.admin-shell { display: block; }
.admin-nav { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 4px; }
.admin-nav-item {
  border: 1px solid var(--line);
  background: var(--section-bg);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
  min-height: 40px;
}
.admin-nav-item.active { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }

/* «Списком» — показываем все разделы подряд, меню прячем. */
.admin-shell[data-layout="flow"] .admin-nav { display: none; }
.admin-shell[data-layout="flow"] .admin-sec[hidden] { display: block !important; }

.admin-toolbar { display: flex; gap: 8px; align-items: center; margin: 10px 0; flex-wrap: wrap; }
.admin-toolbar .line-input { flex: 1; min-width: 180px; }

/* Редактор текстов */
.txt-group { margin-bottom: 8px; }
.txt-group > summary {
  cursor: pointer; font-weight: 600; color: var(--title);
  padding: 12px 4px; list-style: none; font-size: 15px;
}
.txt-group > summary::-webkit-details-marker { display: none; }
.txt-group > summary::before { content: "▸ "; }
.txt-group[open] > summary::before { content: "▾ "; }
.txt-item { background: var(--section-bg); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; }
.txt-item label { display: block; font-size: 13px; color: var(--hint); margin-bottom: 6px; }
.txt-item .txt-key { font-size: 11px; opacity: .65; }
.txt-item input, .txt-item textarea {
  width: 100%; box-sizing: border-box;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg-tint); color: var(--text);
  padding: 10px 12px; font-size: 14px; font-family: inherit;
}
.txt-item textarea { min-height: 84px; resize: vertical; }
.txt-item.changed { box-shadow: inset 3px 0 0 var(--accent); }
.txt-reset { background: none; border: none; color: var(--hint); font-size: 12px; cursor: pointer; text-decoration: underline; padding: 6px 0 0; }

/* Матрица доступов */
.feature-table td, .feature-table th { vertical-align: middle; }
.feature-table .ft-label { font-weight: 600; color: var(--title); }
.feature-table .ft-hint { display: block; font-size: 12px; color: var(--hint); font-weight: 400; margin-top: 2px; }
.feature-table input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--accent); cursor: pointer; }
.feature-table td.ft-cell { text-align: center; }

@media (min-width: 900px) {
  .admin-shell[data-layout="sidebar"] { display: grid; grid-template-columns: 230px 1fr; gap: 22px; align-items: start; }
  .admin-shell[data-layout="sidebar"] .admin-nav {
    display: flex; flex-direction: column; gap: 6px;
    position: sticky; top: 12px; margin: 0;
  }
  .admin-shell[data-layout="sidebar"] .admin-nav-item { text-align: left; }
  /* Тексты в две колонки — меньше скролла при правке десятков полей. */
  .admin-sec[data-sec="content"] .txt-group-body { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .admin-sec[data-sec="prompts"] .prompt-box { max-width: none; }
}

/* --- Админка: фильтр пользователей + массовая рассылка -------------------------- */
.user-filter { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 4px; }
/* Чипы-переключатели: и фильтр по активности, и выбор типа сообщения (#bc-kind).
   Раньше стиль был привязан только к .user-filter, и чипы рассылки выглядели
   как обычные кнопки браузера. */
.user-filter .filt, .bc-kind .filt {
  border: 1px solid var(--line); background: var(--bg-tint); color: var(--text);
  border-radius: 999px; padding: 8px 14px; font-size: 13px; cursor: pointer; min-height: 36px;
}
.user-filter .filt.on, .bc-kind .filt.on {
  background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600;
}

.bc-box { background: var(--section-bg); border-radius: 14px; padding: 4px 14px 14px; margin: 12px 0; }
.bc-box > summary { cursor: pointer; font-weight: 600; color: var(--title); padding: 12px 2px; list-style: none; }
.bc-box > summary::-webkit-details-marker { display: none; }
.bc-box > summary::before { content: "▸ "; }
.bc-box[open] > summary::before { content: "▾ "; }
#bc-text {
  width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg-tint); color: var(--text); padding: 10px 12px;
  font-size: 14px; font-family: inherit; resize: vertical;
}
.bc-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.bc-status { margin-top: 10px; font-size: 14px; color: var(--title); }
.bc-status .bc-bar { height: 6px; background: var(--bg-tint); border-radius: 3px; overflow: hidden; margin-top: 6px; }
.bc-status .bc-fill { height: 100%; background: var(--accent); width: 0; transition: width .3s ease; }
#bc-history { margin-top: 12px; font-size: 12px; color: var(--hint); }
.admin-table .adm-pick { width: 20px; height: 20px; accent-color: var(--accent); cursor: pointer; }
.admin-table #pick-all { width: 20px; height: 20px; accent-color: var(--accent); cursor: pointer; }
.admin-table .adm-nobot { color: var(--hint); opacity: .6; }
.bc-kind { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 10px; }
.bc-attach { margin-top: 10px; }
/* Системную кнопку «Choose File» прячем — она выпадает из оформления и на разных
   платформах выглядит по-разному. Клик идёт через <label>. */
.bc-attach input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.bc-file-btn {
  display: inline-block; border: 1px solid var(--line); background: var(--bg-tint);
  color: var(--text); border-radius: 12px; padding: 11px 16px; font-size: 14px;
  font-weight: 600; cursor: pointer; min-height: 40px; box-sizing: border-box;
}
#bc-photo-preview { display: block; max-width: 220px; max-height: 160px; border-radius: 10px; margin-top: 8px; }
.bc-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.bc-hist-title { font-size: 15px; color: var(--title); margin: 18px 0 6px; }
#bc-history .bc-row { padding: 10px 0; border-top: 1px solid var(--line); font-size: 13px; color: var(--text); }
#bc-history .bc-meta { color: var(--hint); font-size: 12px; }
#bc-history .bc-body { margin-top: 4px; white-space: pre-wrap; word-break: break-word; }
#bc-history .bc-kind-tag {
  display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 8px;
  background: var(--gold-soft); color: var(--title); margin-right: 6px;
}
#bc-history .bc-more { background: none; border: none; color: var(--accent); font-size: 12px; cursor: pointer; padding: 2px 0; text-decoration: underline; }
#bc-history .bc-hist-more { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
