/* ==========================================================================
   LoreBox — стили сайта
   Старый дизайн сохранён в /_backup_old_design/css/style.css (вне сайта).
   Единственный шрифт сайта — Nunito.

   СОДЕРЖАНИЕ
     1. Масштаб и токены
     2. Основа
     3. Вход
     4. Оболочка (боковое меню и рабочая область)
     5. Главная админа (виджеты)
     6. Главная игрока (общие виджеты берутся из блока 5)
     7. Профиль (имя и аватарка)
     8. Библиотека (пересказы партий)
     9. Лист персонажа (вкладка «Бой»)
    10. Редактор чарлиста
    11. Выбор эмодзи (значки предметов)
    12. Чарлисты (админ)
    13. Аккаунты (админ)
    14. Кампании (админ)

   КАК РАБОТАЕТ МАСШТАБ
   Макет Figma нарисован для ширины 1280 px. Все размеры здесь заданы в rem,
   а 1rem = 10 px макета (30 px в Figma = 3rem). Размер rem привязан к ширине
   окна (см. html ниже), поэтому при любой ширине от ~1090 px и больше сайт
   выглядит ровно как в макете, только пропорционально крупнее. Предела сверху
   нет: боковое меню всегда у левого края, фон на всю ширину, пустых полей нет.
   Новые стили пишем так же: размер из Figma в px делим на 10 и пишем в rem.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,400;0,600;0,700;0,800;0,900;1,200;1,700&display=swap');

/* ============ 1. Масштаб и токены ============ */
html {
  /* 0.78125vw = 10px при ширине 1280. Ниже 8.5px (~1090 px) не уменьшаем, сверху предела нет. */
  font-size: max(8.5px, 0.78125vw);
}

/* Сверхширокие экраны (например, 3440×1440): масштаб по ширине дал бы страницу выше окна.
   Здесь масштаб считается от высоты: макет главной (~84rem) целиком помещается без прокрутки,
   а блок с виджетами остаётся своей обычной ширины и стоит по центру (см. .dashboard). */
@media (min-aspect-ratio: 21/10) {
  html { font-size: max(8.5px, 1.17vh); }
}

:root {
  --page-bg: #f5f5f5;
  --ink: #282826;          /* основной тёмный: текст, тёмные кнопки */
  --ink-muted: #727272;    /* второстепенный текст */
  --ink-faint: #a8a8a8;    /* самый бледный текст */
  --olive: #686744;        /* акцент: галочки, ссылки, активные кнопки */
  --red: #d84f40;
  --error: #b3403a;

  --sidebar-bg: #c6c6c6;
  --card-bg: #e4e4e4;      /* карточки виджетов */
  --tile-bg: #f5f5f5;      /* плашки и поля внутри карточек */
  --dark-bg: #282826;      /* тёмная карточка (кубик) */
  --dark-btn: #383838;

  --tone-olive: #686744;
  --tone-blue: #526e78;
  --tone-teal: #527778;
  --tone-purple: #5c5278;
  --tone-maroon: #785253;
  --tone-brown: #786c52;
}

/* ============ 2. Основа ============ */
*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  font-family: 'Nunito', sans-serif;
  font-size: 1.6rem;
  line-height: 1.4;
  color: var(--ink);
  background: var(--page-bg);
}

button, input, select, textarea { font-family: inherit; }

.icon { width: 2.4rem; height: 2.4rem; flex: none; }

/* Круглая аватарка-эмодзи */
.avatar {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
  background: var(--tile-bg);
}
.avatar img { width: 86%; height: 86%; object-fit: contain; }
.avatar-xl { width: 10rem; height: 10rem; }
.avatar-lg { width: 5rem; height: 5rem; }
.avatar.is-online::after {
  content: "";
  position: absolute;
  top: 0.1rem;
  right: 0.1rem;
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
  background: var(--olive);
  box-shadow: 0 0 0 0.2rem var(--card-bg);
}

/* ============ 3. Вход ============ */
.page-login { overflow: hidden; }

.login-page {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2.4rem;
}

/* Две группы персонажей по краям экрана. Размеры как в макете (69.4rem из 83.2rem высоты),
   но не выше окна — на широких низких экранах иначе обрежутся головы. */
.login-art {
  position: absolute;
  bottom: min(2rem, 2.5vh);
  height: min(69.4rem, 83.5vh);
  width: auto;
  pointer-events: none;
  user-select: none;
  /* тень рисуем здесь — в самих картинках её нет */
  filter: drop-shadow(-0.6rem 1.2rem 2.2rem rgba(0, 0, 0, 0.22)) drop-shadow(0 0 4rem rgba(0, 0, 0, 0.1));
}
.login-art-left  { left: 0.8rem; }
.login-art-right { right: 0; }

.login-card {
  position: relative;
  z-index: 1;
  width: 36.1rem;
  padding: 3.6rem 3rem 2.8rem;
  border-radius: 3.2rem;
  background: rgba(222, 222, 222, 0.8);
}

.login-title {
  margin: 0;
  text-align: center;
  font-size: 3.8rem;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.05rem;
}

.login-subtitle {
  margin: 0.6rem 0 2.4rem;
  text-align: center;
  font-size: 1.3rem;
  color: var(--ink-muted);
}

.login-error {
  margin-bottom: 1.2rem;
  padding: 0.8rem 1.2rem;
  border-radius: 1.2rem;
  background: rgba(179, 64, 58, 0.12);
  color: var(--error);
  font-size: 1.3rem;
  text-align: center;
}

.login-form label:not(.login-remember) {
  display: block;
  margin: 0 0 0.6rem;
  font-size: 1.5rem;
  font-weight: 600;
}

.login-form input:not([type="checkbox"]) {
  display: block;
  width: 100%;
  height: 3.5rem;
  margin: 0 0 1.4rem;
  padding: 0 1.4rem;
  border: 0;
  border-radius: 1.2rem;
  background: var(--tile-bg);
  color: var(--ink);
  font-size: 1.5rem;
  outline: none;
}
.login-form input:not([type="checkbox"]):focus { box-shadow: 0 0 0 0.2rem var(--olive); }

.login-password { position: relative; margin-bottom: 1.4rem; }
.login-form .login-password input { margin-bottom: 0; padding-right: 4rem; }
.login-password input::-ms-reveal { display: none; }
.login-password-toggle {
  position: absolute; inset: 0 0.3rem 0 auto; width: 3.4rem; padding: 0;
  display: grid; place-items: center; border: 0; border-radius: 0.9rem;
  background: transparent; color: var(--ink-muted); cursor: pointer;
}
.login-password-toggle[hidden] { display: none; }
.login-password-toggle:hover { color: var(--ink); }
.login-password-toggle:focus-visible { outline: 0.2rem solid var(--olive); outline-offset: -0.3rem; }
.login-password-toggle svg { width: 1.8rem; height: 1.8rem; }
.login-password-toggle .login-eye-off,
.login-password-toggle[aria-pressed="true"] .login-eye { display: none; }
.login-password-toggle[aria-pressed="true"] .login-eye-off { display: block; }

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  margin: 0 0 1.4rem;
  font-size: 1.1rem;
}

.login-remember {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
}

.login-remember input {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 1.9rem;
  height: 1.9rem;
  margin: 0;
  border-radius: 0.5rem;
  background: var(--tile-bg);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.login-remember input:checked { background: var(--olive); }
.login-remember input:checked::after {
  content: "✓";
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
}
.login-remember input:focus-visible { box-shadow: 0 0 0 0.2rem var(--olive); }

.login-forgot { color: var(--olive); text-decoration: none; }
.login-forgot:hover { text-decoration: underline; }

.login-submit {
  display: block;
  width: 100%;
  height: 3.3rem;
  border: 0;
  border-radius: 1.4rem;
  background: var(--ink);
  color: #fff;
  font-size: 1.5rem;
  font-weight: 800;
  cursor: pointer;
}
.login-submit:hover { background: #3a3a37; }

.login-footnote {
  max-width: 21rem;
  margin: 1.6rem auto 0;
  text-align: center;
  font-size: 1rem;
  line-height: 1.4;
  color: var(--ink-faint);
}

/* ============ 4. Оболочка: боковое меню + рабочая область ============ */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  flex: 0 0 20.8rem;
  width: 20.8rem;
  height: 100vh;
  padding: 2.8rem 0 2.4rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow-y: auto;
  background: var(--sidebar-bg);
  border-radius: 0 3.2rem 3.2rem 0;
  z-index: 2;
}

.sidebar-logo {
  display: block;
  text-align: center;
  font-size: 3.2rem;
  font-weight: 800;
  line-height: 4.2rem;
  letter-spacing: -0.04rem;
  color: var(--ink);
  text-decoration: none;
}

.sidebar-user {
  margin-top: 1.8rem;
  color: inherit;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
}
.sidebar-user .avatar { box-shadow: 0 0 0 0.3rem var(--tile-bg); }
.sidebar-user:hover .sidebar-user-name { font-weight: 700; }
.sidebar-user-name {
  max-width: 17.6rem;
  font-size: 1.7rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  overflow-wrap: anywhere;
}

.sidebar-nav { margin-top: 6.8rem; display: flex; flex-direction: column; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 4.4rem;
  padding: 0 0 0 2.4rem;
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
}
.nav-icon {
  background-color: currentColor;
  mask: var(--nav-icon) center / contain no-repeat;
}
.sidebar-link:hover, .sidebar-link.is-active { font-weight: 700; }
.sidebar-logout { margin-top: 5.3rem; }

.app-main {
  position: relative;
  flex: 1;
  min-width: 0;
  padding: 2.8rem 2.9rem 2.6rem 2.7rem;
}
/* Фон окон: облачная текстура сверху, растворяется книзу */
.app-main::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 23rem;
  background: url('/assets/img/ui/window-bg.webp') center top / 100% auto no-repeat;
  -webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent);
          mask-image: linear-gradient(to bottom, #000 30%, transparent);
  pointer-events: none;
}
.app-main > * { position: relative; }

/* Страницы без бокового меню (служебные) */
.site-header { padding: 1.6rem 2.4rem; }
.site-header .brand { font-size: 2.4rem; font-weight: 800; color: var(--ink); text-decoration: none; }
.site-main { padding: 0 2.4rem 2.4rem; }

/* ============ 5. Главная админа ============ */
/* Ширина содержимого — как в макете (1016 px = 101.6rem). На обычных экранах она и так равна
   ширине области справа от меню, а на сверхшироких блок стоит по центру, виджеты не растягиваются. */
.dashboard { max-width: 101.6rem; margin: 0 auto; }

.dashboard-head { margin: 2.8rem 0 2.8rem -1.6rem; }
.dashboard-title {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 0;
  font-size: 3rem;
  font-weight: 800;
  line-height: 4rem;
}
.title-avatar { width: 3rem; height: 3rem; object-fit: contain; }
.dashboard-quote { margin: 0.4rem 0 0; font-size: 1.4rem; color: #555; }

.dash-row { display: grid; gap: 2rem 3rem; margin-bottom: var(--row-gap, 1.9rem); }
.dash-row-1 { grid-template-columns: 372fr 372fr 206fr; min-height: 19.3rem; }
.dash-row-2 { grid-template-columns: 288fr 252fr 418fr; min-height: 22.5rem; }
.dash-row-3 { grid-template-columns: 569fr 418fr;       min-height: 19.9rem; margin-bottom: 0; }

.widget {
  min-width: 0;
  padding: 1.2rem 1.2rem 1rem;
  border-radius: 2.2rem;
  background: var(--card-bg);
}
.widget-dark { background: var(--dark-bg); color: #fff; }

.widget-title {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 0 0 1rem;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 2.6rem;
}
.widget-title img { width: 2.6rem; height: 2.6rem; object-fit: contain; }

/* --- Календарь --- */
.widget-calendar { display: grid; grid-template-columns: 17.5rem 1fr; gap: 1.2rem; align-items: start; }
.calendar { padding-top: 0.6rem; }
.calendar-sessions { display: flex; flex-direction: column; gap: 1.1rem; }
.session-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.8rem 1rem 0.8rem 1.8rem;
  border-radius: 0.8rem;
  background: var(--tile-bg);
  overflow: hidden;
}
.session-tile::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 0.8rem;
  background: var(--sidebar-bg);
}
.session-tile.is-next::before { background: var(--olive); }
.session-tile b { font-size: 1.3rem; font-weight: 600; }
.session-tile small { font-size: 1rem; color: #555; }

.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
  font-size: 1.3rem;
  font-weight: 600;
}
.calendar-nav button {
  width: 2rem; height: 2rem; padding: 0;
  border: 0; background: none; color: var(--ink);
  font-size: 1.8rem; line-height: 1; cursor: pointer;
}
.calendar-nav button:hover:not(:disabled) { opacity: 0.55; }
.calendar-nav button:disabled { opacity: 0.35; cursor: default; }
.calendar-nav span.is-away { color: var(--olive); cursor: pointer; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 1.2rem; }
.calendar-wd { padding-bottom: 0.3rem; font-size: 1.1rem; font-weight: 600; }
.calendar-wd.is-weekend { color: var(--red); }
.calendar-day { display: grid; place-items: center; width: 2rem; height: 1.7rem; margin: 0 auto; border-radius: 50%; }
.calendar-day.is-today { color: var(--olive); font-weight: 800; }
.calendar-day.has-session { width: 2.2rem; border-radius: 0.6rem; background: #d3d2bc; }

/* Пустой виджет */
.widget-empty { margin: 0.4rem 0 0; font-size: 1.1rem; line-height: 1.5rem; color: #777; }

/* --- Игроки --- */
.players-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1rem 0.4rem; justify-items: center; margin-top: -0.2rem; padding: 0 0.4rem; }
.player { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; width: 100%; min-width: 0; }
/* Длинное имя не переносится на вторую строку, а обрезается многоточием (полное — в подсказке) */
.player-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1rem; line-height: 1.2rem; color: #444; }

/* --- Партии --- */
.campaign-list { display: flex; flex-direction: column; gap: 0.6rem; }
.campaign-item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.3rem;
  padding: 0.5rem 0.8rem 0.5rem 0.7rem;
  border-radius: 1rem;
  background: var(--tile-bg);
  color: inherit;
  text-decoration: none;
}
a.campaign-item:hover { box-shadow: 0 0.2rem 0.8rem rgba(0, 0, 0, 0.12); }
.campaign-item b { font-size: 1rem; line-height: 1.2rem; font-weight: 600; }
.tags { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-left: 1rem; }
.tag { padding: 0.15rem 0.5rem; border-radius: 0.6rem; background: var(--tone-olive); color: #f5f5f5; font-size: 0.7rem; font-weight: 600; line-height: 1; }
.tag-olive  { background: var(--tone-olive); }
.tag-blue   { background: var(--tone-blue); }
.tag-teal   { background: var(--tone-teal); }
.tag-purple { background: var(--tone-purple); }
.tag-maroon { background: var(--tone-maroon); }
.tag-brown  { background: var(--tone-brown); }

/* --- Прошлая партия (пересказ из «Библиотеки») --- */
.widget-recap { display: flex; flex-direction: column; }
.recap-summary { display: flex; flex-direction: column; gap: 1rem; }
.recap-meta {
  margin: 0 0 0.6rem; font-size: 1rem; font-weight: 700; color: var(--ink-muted);
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.recap-image { display: block; width: 100%; aspect-ratio: 5 / 2; border-radius: 0.9rem; object-fit: cover; }
.recap-text {
  margin: 0; font-size: 1.2rem; line-height: 1.7rem;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  overflow-wrap: anywhere;
}
.recap-more { margin-top: auto; padding-top: 0.8rem; font-size: 1.1rem; font-weight: 700; color: var(--olive); text-decoration: none; }
.recap-more:hover { text-decoration: underline; }
.widget-recap .widget-empty + .recap-more { margin-top: 0.8rem; }

/* --- Быстрый бросок --- */
.widget-dice { display: flex; flex-direction: column; }
.dice-result { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.dice-value { font-size: 5.6rem; font-weight: 900; line-height: 1; }
.dice-caption { margin-top: 0.2rem; font-size: 1.3rem; color: #dcdcdb; }
.dice-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; padding: 0 0.2rem; }
.dice-buttons button {
  height: 2rem; border: 0; border-radius: 0.7rem;
  background: var(--dark-btn); color: #f5f5f5;
  font-size: 1.1rem; font-weight: 600; cursor: pointer;
}
.dice-buttons button:hover { background: #4a4a47; }
.dice-buttons button.is-active { background: var(--olive); }

/* --- Активность игроков --- */
.activity-list {
  list-style: none; margin: 0.8rem 0 0; padding: 0;
  display: flex; flex-direction: column; gap: 0.8rem;
  max-height: 15.6rem; overflow-y: auto; scrollbar-width: none;
}
.activity-list::-webkit-scrollbar { display: none; }
.activity-list li { display: flex; align-items: center; gap: 0.6rem; font-size: 1rem; }
.activity-list img { width: 2rem; height: 2rem; object-fit: contain; flex: none; }
.activity-text { flex: 1; min-width: 0; }
.activity-text b { font-weight: 700; }
.activity-list time { flex: none; width: 4.4rem; text-align: center; color: #666; }

/* --- Заметки мастера --- */
.widget-notes {
  display: grid;
  grid-template-columns: 1fr 2.2rem minmax(0, 27.5rem);
  grid-template-rows: auto 1fr;
  column-gap: 0.8rem;
}
.widget-notes .widget-title { grid-column: 1; grid-row: 1; }
.notes-body { display: contents; }
.notes-list { grid-column: 1; grid-row: 2; display: flex; flex-direction: column; gap: 0.8rem; align-content: start; min-height: 0; max-height: 14.6rem; overflow-y: auto; scrollbar-width: none; }
.notes-list::-webkit-scrollbar, .memo-list::-webkit-scrollbar { display: none; }
.note-chip {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 0.6rem;
  padding: 0.7rem 1rem; border-radius: 0.8rem;
  background: var(--tile-bg); font-size: 1rem;
}
.note-text { min-width: 0; white-space: pre-line; overflow-wrap: anywhere; }
.note-delete {
  flex: none; width: 1.4rem; height: 1.4rem; margin: -0.2rem -0.4rem 0 0; padding: 0;
  border: 0; border-radius: 50%; background: none;
  color: var(--ink-faint); font-size: 1.4rem; line-height: 1.3rem; cursor: pointer;
  opacity: 0; transition: opacity 0.15s;
}
.note-chip:hover .note-delete, .note-delete:focus-visible { opacity: 1; }.note-delete:hover { color: var(--red); }
.notes-list:empty::before, .memo-list:empty::before { content: "Пока нет заметок"; font-size: 1rem; color: #888; }
.widget-notes .note-chip { align-self: flex-start; }
.notes-format { grid-column: 2; grid-row: 1 / -1; display: flex; flex-direction: column; gap: 0.8rem; padding-top: 0.8rem; }
.notes-format button {
  width: 1.8rem; height: 1.8rem; padding: 0;
  border: 0; border-radius: 0.5rem;
  background: #d9d9d9; color: var(--ink);
  font-size: 1.3rem; line-height: 1; cursor: pointer;
}
.notes-format .fmt-bold { font-weight: 800; }
.notes-format .fmt-italic { font-style: italic; font-weight: 400; }
.notes-format .fmt-underline {
  font-weight: 400;
  text-decoration: underline;
  text-decoration-color: var(--olive);
  text-decoration-thickness: 0.15rem;
  text-underline-offset: 0.2rem;
}
.notes-editor { position: relative; grid-column: 3; grid-row: 1 / -1; margin: 0.4rem 0 0; }
.notes-editor textarea {
  display: block; width: 100%; height: 100%; min-height: 16.4rem;
  padding: 1.2rem 1.4rem; resize: none;
  border: 0; border-radius: 1rem; outline: none;
  background: var(--tile-bg); color: var(--ink);
  font-size: 1.1rem;
}
.notes-editor textarea::placeholder { color: #aaa; }
.notes-add {
  position: absolute; right: 0.8rem; bottom: 0.8rem;
  width: 2rem; height: 2rem; padding: 0;
  border: 0; border-radius: 0.6rem;
  background: var(--ink); color: #fff;
  font-size: 1.4rem; line-height: 1; cursor: pointer;
}

/* --- Картинка внизу справа --- */
.dash-banner { display: flex; align-items: flex-end; min-width: 0; }
.dash-banner img { display: block; width: 100%; height: auto; border-radius: 0 0 2.2rem 2.2rem; }

/* ============ 6. Главная игрока ============ */
/* Виджеты «Кампании», «Уведомления» (.widget-activity), «Быстрый бросок» и плашки заметок
   такие же, как у админа (блок 5). Здесь только то, что есть лишь у игрока.
   Ширина сетки 95.2rem — как у нижних рядов макета, расстояние между рядами 2.4rem. */
.dashboard-player { --row-gap: 2.4rem; }
.dashboard-player .dashboard-head { margin-bottom: 3rem; }
.dashboard-player .dash-row { max-width: 95.2rem; }
.dash-row-p1 { grid-template-columns: 372fr 288fr 206fr; min-height: 13.8rem; }
.dash-row-p2 { grid-template-columns: 359fr 252fr 283fr; min-height: 22.5rem; }
.dash-row-p3 { grid-template-columns: 66.9rem 1fr; min-height: 22.5rem; margin-bottom: 0; }

/* --- Следующая партия --- */
.widget-next { display: flex; flex-direction: column; padding-bottom: 1.8rem; }
.next-when { margin: -0.2rem 0 0; font-size: 2rem; font-weight: 800; line-height: 2.4rem; }
.next-campaign { margin: 0.2rem 0 0; font-size: 1.1rem; color: #a9a9a7; }
.next-actions { display: flex; gap: 1.2rem; margin-top: auto; }
.next-actions button {
  width: 6.4rem; height: 2.4rem; padding: 0;
  border: 0; border-radius: 0.8rem;
  background: var(--dark-btn); color: #f5f5f5;
  font-size: 1.1rem; font-weight: 600; cursor: pointer;
}
.next-actions button:hover { background: #4a4a47; }
.next-actions button.is-active { background: var(--olive); }
.next-none { color: #d7d7d5; }

/* --- Заметки игрока --- */
.widget-memo { display: flex; flex-direction: column; padding-bottom: 1.9rem; }
.memo-list { display: flex; flex-direction: column; gap: 0.6rem; min-height: 0; max-height: 12.4rem; overflow-y: auto; scrollbar-width: none; padding: 0.4rem 0.9rem 0; }
.memo-list .note-chip { padding: 0.5rem 0.8rem; line-height: 1.1rem; }
.memo-new { display: flex; gap: 0.4rem; margin-top: auto; padding: 0 0.9rem; }
.memo-new input {
  flex: 1; min-width: 0; height: 2.2rem; padding: 0 0.8rem;
  border: 0; border-radius: 0.6rem; outline: none;
  background: var(--tile-bg); color: var(--ink); font-size: 1rem;
}
.memo-new input::placeholder { color: #aaa; }
.memo-new button {
  flex: none; width: 2.1rem; height: 2.2rem; padding: 0;
  border: 0; border-radius: 0.5rem;
  background: var(--ink); color: #fff;
  font-size: 1.4rem; line-height: 1; cursor: pointer;
}

/* --- Мои персонажи --- */
.hero-list { display: flex; flex-wrap: wrap; gap: 1.2rem; margin-top: 1.5rem; }
.hero-card {
  position: relative;
  display: grid;
  grid-template-columns: 3.4rem 1fr;
  align-items: center;
  column-gap: 0.5rem;
  width: 18.7rem;
  padding: 0.5rem 0.8rem 0.9rem 0.5rem;
  border-radius: 1.2rem;
  background: var(--tile-bg);
  color: var(--ink);
  text-decoration: none;
}
.hero-card:hover { box-shadow: 0 0.2rem 0.8rem rgba(0, 0, 0, 0.12); }
.hero-dot {
  position: absolute; top: -0.1rem; right: -0.3rem;
  width: 1rem; height: 1rem;
  border-radius: 50%;
  background: var(--red);
}
.hero-portrait {
  display: grid; place-items: center;
  width: 3.4rem; height: 3.4rem;
  border-radius: 50%; overflow: hidden;
  background: var(--hero-color, var(--ink)); color: #fff;
  font-size: 1.6rem; font-weight: 800;
}
.hero-portrait img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hero-info { display: flex; flex-direction: column; min-width: 0; }
.hero-info b { font-size: 1rem; font-weight: 600; line-height: 1.3rem; }
.hero-info small { font-size: 0.7rem; line-height: 1rem; color: #555; }
.hero-progress {
  grid-column: 1 / -1;
  height: 0.5rem; margin: 1.1rem 0 0 0.4rem;
  border-radius: 0.3rem;
  background: var(--card-bg);
  overflow: hidden;
}
.hero-progress i { display: block; height: 100%; border-radius: 0.3rem; background: var(--hero-color, var(--ink)); }

/* ============ 7. Профиль ============ */
.profile-card { max-width: 56rem; padding: 2.4rem; }

.profile-top { display: flex; align-items: center; gap: 2.4rem; }
.profile-name { flex: 1; min-width: 0; }
.profile-name label { display: block; margin: 0 0 0.6rem; font-size: 1.5rem; font-weight: 600; }
.profile-name-row { display: flex; gap: 0.8rem; }
.profile-name-row input {
  flex: 1; min-width: 0; height: 3.5rem; padding: 0 1.4rem;
  border: 0; border-radius: 1.2rem; outline: none;
  background: var(--tile-bg); color: var(--ink); font-size: 1.5rem;
}
.profile-name-row input:focus { box-shadow: 0 0 0 0.2rem var(--olive); }
.profile-name-row input::placeholder { color: var(--ink-faint); }
.profile-random {
  flex: none; display: inline-flex; align-items: center; gap: 0.6rem;
  height: 3.5rem; padding: 0 1.4rem;
  border: 0; border-radius: 1.2rem;
  background: var(--ink); color: #fff;
  font-size: 1.2rem; font-weight: 700; cursor: pointer;
}
.profile-random:hover { background: #3a3a37; }
.profile-random img { width: 2rem; height: 2rem; object-fit: contain; }
.profile-hint { margin: 0.8rem 0 0; font-size: 1.1rem; color: #666; }

.profile-avatars { margin: 2.4rem 0 0; padding: 0; border: 0; min-width: 0; }
.profile-avatars legend { padding: 0; margin-bottom: 1rem; font-size: 1.5rem; font-weight: 600; }
.profile-avatar-grid { display: flex; flex-wrap: wrap; gap: 1.2rem; }
.profile-avatar-option { position: relative; display: block; cursor: pointer; }
.profile-avatar-option input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.profile-avatar-option .avatar { transition: box-shadow 0.15s; }
.profile-avatar-option:hover .avatar { box-shadow: 0 0 0 0.2rem #bdbdb2; }
.profile-avatar-option input:checked + .avatar { box-shadow: 0 0 0 0.3rem var(--olive); }
.profile-avatar-option input:focus-visible + .avatar { box-shadow: 0 0 0 0.3rem var(--ink); }

.profile-message { margin: 1.6rem 0 0; font-size: 1.3rem; font-weight: 600; }
.profile-message.is-error { color: var(--error); }
.profile-message.is-ok { color: var(--olive); }

.profile-save {
  display: block; width: 16rem; height: 3.3rem; margin-top: 2rem;
  border: 0; border-radius: 1.4rem;
  background: var(--ink); color: #fff;
  font-size: 1.5rem; font-weight: 800; cursor: pointer;
}
.profile-save:hover { background: #3a3a37; }

/* ============ 8. Библиотека (пересказы партий) ============ */
.rc-page { max-width: 95.2rem; }
.rc-page .dashboard-title .nav-icon { width: 3rem; height: 3rem; margin-right: 0.8rem; }
.rc-filters { display: flex; flex-wrap: wrap; gap: 0.8rem; margin: 2.4rem 0 0.4rem; }
.rc-chip { height: 3rem; padding: 0 1.4rem; border: 0; border-radius: 1.5rem; background: var(--card-bg); color: var(--ink); font-size: 1.3rem; font-weight: 600; cursor: pointer; }
.rc-chip:hover { background: var(--sidebar-bg); }
.rc-chip.is-on { background: var(--olive); color: #fff; }
.rc-empty { margin: 3rem 0 0; font-size: 1.5rem; color: var(--ink-muted); }
.rc-group { margin-top: 3rem; }
.rc-group[hidden] { display: none; }
.rc-group-title { margin: 0 0 1.2rem; font-size: 2rem; font-weight: 800; }
.rc-list { display: flex; flex-direction: column; gap: 1.2rem; }
.rc-card { padding: 1.8rem 2.2rem 1.6rem; border-radius: 2rem; background: var(--card-bg); }
.rc-card.is-target { box-shadow: 0 0 0 0.3rem var(--olive); }
.rc-card-head {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center; gap: 1rem; list-style: none; cursor: pointer;
}
.rc-card-head::-webkit-details-marker { display: none; }
.rc-card-head:focus-visible { outline: 0.2rem solid var(--ink); outline-offset: 0.4rem; }
.rc-card-head::after {
  content: ""; width: 0.7rem; height: 0.7rem; margin: 0 0.3rem 0.3rem 0;
  border: solid var(--ink-muted); border-width: 0 0.15rem 0.15rem 0;
  transform: rotate(45deg);
}
.rc-card[open] > .rc-card-head::after { transform: rotate(225deg); margin-bottom: 0; }
.rc-card-title { font-size: 1.7rem; font-weight: 800; overflow-wrap: anywhere; }
.rc-card-body { padding-top: 1rem; }
.rc-meta { display: flex; align-items: center; gap: 1rem; flex: none; font-size: 1.2rem; color: var(--ink-muted); }
.rc-status { padding: 0.2rem 0.9rem; border-radius: 1rem; background: var(--tile-bg); font-size: 1.1rem; font-weight: 700; }
.rc-status.is-done { background: var(--olive); color: #fff; }
.rc-text { font-size: 1.4rem; line-height: 2.1rem; white-space: pre-line; overflow-wrap: anywhere; }
.rc-edit {
  display: block; width: 100%; min-height: 9rem; padding: 1.2rem 1.4rem; resize: vertical;
  border: 0; border-radius: 1.4rem; outline: none;
  background: var(--tile-bg); color: var(--ink); font: inherit; font-size: 1.4rem; line-height: 2.1rem;
}
.rc-edit:focus { box-shadow: 0 0 0 0.2rem var(--olive); }
.rc-save { min-height: 1.6rem; margin: 0.6rem 0 0; font-size: 1.1rem; color: var(--ink-muted); }
.rc-save.is-bad, .rc-image-status.is-bad { color: var(--error); }
.rc-image { display: block; width: 100%; height: auto; margin-bottom: 1.2rem; border-radius: 1.2rem; }
.rc-image[hidden] { display: none; }
.rc-image-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem; margin-top: 1rem; }
.rc-image-controls .rc-chip { background: var(--tile-bg); }
.rc-image-controls .rc-chip:hover { background: var(--sidebar-bg); }
.rc-image-controls .rc-chip:disabled { opacity: 0.65; cursor: wait; }
.rc-image-status { font-size: 1.1rem; color: var(--ink-muted); }


/* ============ 9. Лист персонажа (вкладка «Бой») ============ */
/* Окно листа без бокового меню. Акцентный цвет (--accent) задаётся на .sheet-window из темы персонажа.
   Размеры сняты с макета «чарлист - вкладка бой» (1280 px), 1rem = 10 px макета. */
.page-sheet { background: var(--page-bg); }
.page-sheet .site-main { padding: 0; }

.sheet-window {
  --accent-soft: color-mix(in srgb, var(--accent) 68%, #d8d8d8);
  --accent-line: color-mix(in srgb, var(--accent) 60%, #e4e4e4);
  --sheet-text: #525252;
  --sheet-card: #d8d8d8;
  /* Ширина окна — как в макете (125.8rem). На обычных экранах оно и так занимает всю ширину,
     на сверхшироких стоит по центру и не растягивается — как главная. */
  width: calc(100% - 2.2rem);
  max-width: 125.8rem;
  margin: 1.1rem auto 1.2rem;
  min-height: 80.9rem;
  border: 0.2rem solid var(--accent);
  border-radius: 3rem;
  background: #e4e4e4;
  overflow: hidden;
}

/* --- Шапка --- */
.sheet-bar {
  display: flex; align-items: center;
  height: 6.2rem; padding: 0 2rem 0 5.5rem;
  background: var(--sheet-card);
  border-bottom: 0.2rem solid var(--accent);
}
.sheet-bar h1 { flex: 1; margin: 0; font-size: 1.8rem; font-weight: 800; line-height: 1; }
.sheet-status { margin-right: 2rem; font-size: 1.2rem; color: var(--ink-muted); }
.sheet-edit {
  display: inline-flex; align-items: center; height: 3.1rem; padding: 0 1.2rem;
  border-radius: 1rem; background: var(--accent); color: #fff;
  font-size: 1.6rem; font-weight: 600; text-decoration: none;
}
.sheet-edit:hover { filter: brightness(1.12); }
.sheet-close, .sheet-theme {
  display: grid; place-items: center; width: 3.4rem; height: 3.4rem; flex: none;
  border-radius: 0.8rem; background: #e4e4e4; color: #40403e;
}
.sheet-close { margin-left: 5rem; }
.sheet-theme { margin-right: 0.9rem; padding: 0; border: 0; cursor: pointer; }
.sheet-theme + .sheet-close { margin-left: 0; }
.sheet-close svg, .sheet-theme svg { width: 2rem; height: 2rem; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; }
.sheet-close:hover, .sheet-theme:hover { background: #f0f0f0; }
.sheet-theme:focus-visible { outline: 0.2rem solid currentColor; outline-offset: 0.2rem; }
.sheet-theme .theme-icon-sun { display: none; }

/* --- Две колонки --- */
.sheet-body {
  display: grid; grid-template-columns: 30.4rem minmax(0, 1fr); column-gap: 2.8rem; align-items: start;
  padding: 1.5rem 2.3rem 2rem 1.3rem;
}

/* --- Левая колонка --- */
.sheet-portrait {
  position: relative; height: 35.7rem;
  border: 0.2rem solid var(--accent); border-radius: 2rem;
  background: #2d2523; overflow: hidden;
}
.sheet-portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sheet-portrait-letter { display: grid; place-items: center; height: 100%; font-size: 12rem; font-weight: 800; color: rgba(255, 255, 255, 0.55); }
.sheet-level {
  position: absolute; left: 0.9rem; bottom: 1rem;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 5.2rem; height: 5.2rem; border: 0.3rem solid #f5f5f5; border-radius: 50%;
  background: #e4e4e4; line-height: 1;
}
.sheet-level b { font-size: 2.6rem; font-weight: 800; }
.sheet-level small { margin-top: -0.1rem; font-size: 1rem; color: var(--sheet-text); }

.sheet-name { margin: 0.9rem 0 0; font-size: 3.4rem; font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }
.sheet-subtitle { margin: 0.4rem 0 0; min-height: 1.9rem; font-size: 1.5rem; color: var(--sheet-text); }

.sheet-xp { margin-top: 1rem; }
.sheet-xp-text { display: flex; justify-content: space-between; font-size: 1.2rem; color: var(--sheet-text); }
.sheet-xp-bar { height: 0.6rem; margin-top: 0.2rem; border-radius: 0.3rem; background: #cdcdcd; overflow: hidden; }
.sheet-xp-bar i { display: block; height: 100%; border-radius: 0.3rem; background: var(--accent); }

.sheet-rests { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin: 1.2rem 0.4rem 0; }
.sheet-rests button {
  height: 3.2rem; border: 0; border-radius: 1rem;
  background: var(--accent); color: #fff; font-size: 1.4rem; font-weight: 700; cursor: pointer;
}
.sheet-rests button:hover { filter: brightness(1.12); }

.sheet-hp {
  margin: 1.7rem 0.2rem 0; padding: 1.4rem 1.6rem 2.6rem 2rem;
  border-radius: 2rem; background: var(--sheet-card);
}
.sheet-mana {
  margin: 1.7rem 0.2rem 0; padding: 1.4rem 1.6rem 2rem 2rem;
  border-radius: 2rem; background: var(--sheet-card);
}
.sheet-mana[hidden] { display: none; }
.sheet-blood-controls { display: flex; gap: 0.7rem; margin-top: 1rem; }
.sheet-blood-controls button { flex: 1; height: 2.6rem; border: 0; border-radius: 1.3rem; background: var(--accent); font: inherit; font-size: 1.6rem; font-weight: 800; line-height: 1; color: #fff; cursor: pointer; }
.sheet-blood-controls button:hover { filter: brightness(1.12); }
.sheet-mana .sheet-hp-head span { display: inline-flex; align-items: center; gap: 0.6rem; }
.sheet-mana .sheet-glyph { width: 1.8rem; height: 1.8rem; }
.sheet-hp-head { display: flex; align-items: center; height: 2.2rem; line-height: 1; justify-content: space-between; font-size: 1.3rem; font-weight: 700; color: var(--sheet-text); }
.sheet-hp-head b { font-size: 1.4rem; font-weight: 700; }
.sheet-hp-head em { font-size: 2.2rem; font-weight: 800; font-style: normal; color: var(--accent); }
.sheet-hp-head small { font-size: 1.2rem; font-weight: 700; color: var(--accent); }
.sheet-hp-bar { height: 0.7rem; margin-top: 0.6rem; border-radius: 0.4rem; background: #cdcdcd; overflow: hidden; }
.sheet-hp-bar i { display: block; height: 100%; border-radius: 0.4rem; background: var(--accent-soft); }
.sheet-hp-controls { display: flex; gap: 0.7rem; margin-top: 1rem; }
.sheet-hp-controls input {
  width: 4rem; height: 1.7rem; padding: 0; border: 0; border-radius: 0.5rem; outline: none;
  background: #c4c4c4; color: var(--sheet-text); font-size: 1.2rem; text-align: center;
  -moz-appearance: textfield; appearance: textfield;
}
.sheet-hp-controls input::-webkit-outer-spin-button, .sheet-hp-controls input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sheet-hp-controls button {
  height: 1.7rem; padding: 0 0.9rem; border: 0; border-radius: 0.5rem;
  color: #fff; font-size: 1.2rem; font-weight: 700; line-height: 1; cursor: pointer;
}
.sheet-hp-controls .is-damage { background: #9a4949; }
.sheet-hp-controls .is-heal { background: #686743; }
.sheet-hp-controls .is-temp { background: var(--accent); }
.sheet-hp-controls button:hover { filter: brightness(1.12); }
.sheet-hp-row { display: flex; align-items: center; justify-content: space-between; margin-top: 0.9rem; font-size: 1.2rem; font-weight: 700; color: var(--sheet-text); }
.sheet-hp-row + .sheet-hp-row { margin-top: 0.8rem; }
.sheet-hp-row b { font-weight: 800; }
.sheet-dots { display: flex; gap: 0.5rem; align-items: center; }
.sheet-dots i, .sheet-dots button {
  width: 1.2rem; height: 1.2rem; padding: 0; border: 0.1rem solid var(--accent); border-radius: 50%; background: none;
}
.sheet-dots i.is-on { background: var(--accent); }
.sheet-dots button { cursor: pointer; }
.sheet-dots .is-success { border-color: #686743; }
.sheet-dots .is-success.is-on { background: #686743; }
.sheet-dots .is-fail { border-color: #aa6d6d; }
.sheet-dots .is-fail.is-on { background: #9a4949; border-color: #9a4949; }

/* --- Правая колонка: плитки и характеристики --- */
.sheet-main { min-width: 0; padding-top: 0.3rem; }
.sheet-tiles { display: flex; gap: 2rem; }
.sheet-tile {
  display: flex; flex-direction: column; justify-content: center;
  width: 11rem; height: 6.6rem; padding: 0 1.1rem;
  border-radius: 1.5rem; background: var(--accent); color: #fff;
}
.sheet-tile:nth-child(4) { width: 12.2rem; }
.sheet-tile span { font-size: 1.2rem; font-weight: 700; line-height: 1.2; white-space: nowrap; }
.sheet-tile b { margin: 0.25rem 0 0.1rem; font-size: 2.4rem; font-weight: 800; line-height: 1.1; }
.sheet-tile small { min-height: 1rem; margin-top: 0.4rem; font-size: 0.9rem; font-weight: 400; line-height: 1; opacity: 0.9; }

.sheet-abilities { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1.5rem; margin-top: 1.5rem; }
.sheet-ability {
  min-height: 15.1rem; padding: 0.8rem 0.8rem 1.2rem;
  border-radius: 1rem; background: var(--sheet-card);
}
.sheet-ability header { display: flex; align-items: center; justify-content: space-between; gap: 0.4rem; }
.sheet-ability h3 { margin: 0; font-size: 1.3rem; font-weight: 800; line-height: 1.2; text-transform: lowercase; color: var(--sheet-text); }
.sheet-score { min-width: 1.8rem; padding: 0.1rem 0.4rem; border-radius: 0.3rem; background: #c4c4c4; font-size: 0.8rem; font-weight: 700; text-align: center; color: var(--sheet-text); }
.sheet-mod { display: block; margin-top: 0.1rem; font-size: 2.4rem; font-weight: 800; line-height: 1.1; color: var(--accent); }
.sheet-ability ul { list-style: none; margin: 0.2rem 0 0; padding: 0; }
.sheet-ability li { display: flex; align-items: flex-start; gap: 0.3rem; min-height: 1.4rem; font-size: 1rem; line-height: 1.3rem; color: var(--sheet-text); }
.sheet-ability li.is-save { margin-bottom: 0.2rem; padding-bottom: 0.2rem; border-bottom: 0.2rem solid #cac7c5; }
.sheet-pip { flex: none; width: 0.7rem; height: 0.7rem; margin-top: 0.3rem; border: 0.1rem solid var(--accent-soft); border-radius: 50%; }
.sheet-pip.is-on { background: var(--accent); border-color: var(--accent); }
.sheet-skill-name { flex: 1; min-width: 0; }
.sheet-skill-bonus { flex: none; margin-left: 0.3rem; }

/* --- Вкладки --- */
.sheet-tabs { display: flex; margin-top: 1.9rem; border-bottom: 0.2rem solid var(--accent-line); }
.sheet-tabs button {
  height: 2.6rem; padding: 0 1.1rem; border: 0; border-radius: 0.8rem 0.8rem 0 0;
  background: none; color: #3d3d3d; font-size: 1.5rem; font-weight: 700; line-height: 1; cursor: pointer;
  white-space: nowrap;
}
.sheet-tabs button:hover { color: var(--accent); }
.sheet-tabs button.is-active { background: #f5f5f5; color: #282826; }

.sheet-panel[hidden] { display: none; }

/* --- Вкладка «Бой»: таблица атак --- */
.sheet-attacks { margin: 1.9rem 3.1rem 0; padding: 2rem 0 1.1rem 2.3rem; border-radius: 2rem; background: #f5f5f5; }
.sheet-attacks-head, .sheet-attack { display: grid; grid-template-columns: 25.7rem 8.7rem 20.9rem minmax(0, 1fr); align-items: center; }
.sheet-attacks-head { height: 2.2rem; padding-left: 0.7rem; font-size: 1.5rem; color: var(--sheet-text); }
.sheet-attacks-head span:nth-child(2) { width: 6.6rem; text-align: center; }
.sheet-attacks-body {
  max-height: 19.2rem; margin-top: 0.7rem; padding-right: 2.5rem; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: #d2d2d2 transparent;
}
.sheet-attacks-body::-webkit-scrollbar { width: 0.4rem; }
.sheet-attacks-body::-webkit-scrollbar-thumb { border-radius: 0.2rem; background: #d2d2d2; }
.sheet-attack { min-height: 4.8rem; }
.sheet-attack-name { display: flex; align-items: center; gap: 1rem; min-width: 0; }
.sheet-attack-icon { display: grid; place-items: center; flex: none; width: 4rem; height: 4rem; color: var(--accent-soft); font-size: 2rem; }
.sheet-attack-icon img { width: 100%; height: 100%; object-fit: contain; }
.sheet-attack-name b { font-size: 1.5rem; font-weight: 700; color: var(--accent); overflow-wrap: anywhere; }
.sheet-attack-bonus span {
  display: block; width: 6.6rem; height: 2.2rem; border-radius: 0.6rem;
  background: var(--accent); color: #fff; font-size: 1.5rem; line-height: 2.2rem; text-align: center;
}
.sheet-attack-damage { font-size: 1.5rem; padding-right: 1rem; }
.sheet-attack-traits { font-size: 1.2rem; line-height: 1.6rem; color: var(--sheet-text); }
.sheet-empty { margin: 1.4rem 0 0.4rem; font-size: 1.4rem; color: var(--ink-muted); }

/* --- Состояния --- */
.sheet-conditions { display: flex; flex-wrap: wrap; gap: 1.1rem 1.2rem; margin: 2.7rem 3.1rem 0 3.1rem; }
.sheet-conditions button {
  height: 2.1rem; padding: 0 1.2rem; border: 0.1rem solid var(--accent-soft); border-radius: 1.1rem;
  background: none; color: var(--sheet-text); font-size: 1.3rem; font-weight: 600; line-height: 1; cursor: pointer;
}
.sheet-conditions button:hover { border-color: var(--accent); }
.sheet-conditions button.is-on { border-color: var(--accent); background: var(--accent); color: #fff; }
.sheet-conditions { position: relative; }
.sheet-conditions button.is-open { border-color: var(--accent); }
.sheet-cond-pop { position: absolute; z-index: 5; box-sizing: border-box; width: 32rem; max-width: 100%; padding: 1.2rem 1.4rem 1.3rem; border: 0.1rem solid #cfc9c9; border-radius: 1.2rem; background: #fbfafa; box-shadow: 0 0.6rem 2rem rgba(0, 0, 0, 0.22); text-align: left; color: var(--sheet-text); }
.sheet-cond-pop b { display: block; font-size: 1.5rem; font-weight: 800; text-transform: lowercase; }
.sheet-cond-pop p { margin: 0.5rem 0 0; font-size: 1.3rem; line-height: 1.9rem; }

/* --- Остальные вкладки листа (размеры сняты с макетов, 1rem = 10 px макета) --- */
#panel-view { position: relative; margin: 1.3rem 0.9rem 0 1rem; }
#panel-view .sheet-empty-pad { padding: 3rem 2rem; border-radius: 1.6rem; background: #f5f5f5; text-align: center; margin: 0; }
#panel-view button { font-family: inherit; }

/* Умения и заклинания: сетка карточек, справа — описание выбранной */
.sheet-cards { display: block; }
.sheet-cards.has-detail { display: grid; grid-template-columns: 43.1rem minmax(0, 40.6rem); column-gap: 2.5rem; align-items: start; }
.sheet-card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.5rem; }
.sheet-cards.has-detail .sheet-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sheet-card-list { display: grid; gap: 0.6rem; align-content: start; }
.sheet-card {
  display: flex; align-items: center; gap: 1.1rem; height: 7.6rem; padding: 0 0.9rem 0 1rem;
  border: 0.1rem solid transparent; border-radius: 1.6rem; background: #f5f5f5;
  text-align: left; color: inherit; cursor: pointer;
}
.sheet-card:hover { border-color: var(--accent-soft); }
.sheet-card.is-selected { border-color: var(--accent); }
.sheet-card-icon { display: grid; place-items: center; flex: none; width: 4.8rem; height: 4.8rem; color: var(--accent-soft); font-size: 2.6rem; }
.sheet-card-icon img { width: 100%; height: 100%; object-fit: contain; }
.sheet-card-icon.is-round { overflow: hidden; border-radius: 50%; }
.sheet-card-icon.is-round img { object-fit: cover; }
.sheet-card-text { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.sheet-card-text b { font-size: 1.5rem; font-weight: 800; line-height: 1.2; text-transform: lowercase; color: var(--accent); overflow-wrap: anywhere; }
.sheet-card-text small { font-size: 1.1rem; line-height: 1.2; color: var(--sheet-text); }

.sheet-detail { display: flex; flex-direction: column; min-height: 38.8rem; padding: 1.3rem 1.1rem 0.8rem 1.4rem; border-radius: 1.6rem; background: #f5f5f5; }
.sheet-detail header { display: flex; align-items: flex-start; gap: 1.8rem; }
.sheet-detail-icon { display: grid; place-items: center; flex: none; width: 6.4rem; height: 6.4rem; color: var(--accent-soft); font-size: 3.4rem; }
.sheet-detail-icon img { width: 100%; height: 100%; object-fit: contain; }
.sheet-detail h3 { margin: 0.2rem 0 0; font-size: 1.9rem; font-weight: 800; line-height: 1.2; text-transform: lowercase; color: var(--accent); }
.sheet-detail header p { margin: 0.1rem 0 0; font-size: 1.2rem; line-height: 1.3; color: var(--sheet-text); }
.sheet-use-meta { display: flex; align-items: center; gap: 1rem; margin-top: 0.6rem; }
.sheet-use-pill { display: inline-flex; align-items: baseline; justify-content: center; gap: 0.3rem; min-width: 5.3rem; height: 2rem; padding: 0 0.8rem; border: 0.1rem solid var(--accent); border-radius: 0.6rem; font-size: 0.9rem; line-height: 1.8rem; white-space: nowrap; color: var(--sheet-text); }
.sheet-use-pill b { font-size: 1.4rem; font-weight: 800; color: var(--sheet-text); }
.sheet-use-icon { display: grid; place-items: center; width: 1.8rem; height: 1.8rem; }
.sheet-glyph {
  display: inline-block; flex: none; width: 1.8rem; height: 1.8rem; vertical-align: middle; background: var(--accent);
  -webkit-mask: var(--glyph) center / contain no-repeat; mask: var(--glyph) center / contain no-repeat;
}
.sheet-glyph.is-rest-short { --glyph: url("../img/icons/rest-short.svg"); }
.sheet-glyph.is-rest-long { --glyph: url("../img/icons/rest-long.svg"); }
.sheet-glyph.is-point-magic { --glyph: url("../img/points/magic.svg"); }
.sheet-glyph.is-point-blood { --glyph: url("../img/points/blood.svg"); }
.sheet-glyph.is-point-ki { --glyph: url("../img/points/ki.svg"); }
.sheet-glyph.is-point-rauma { --glyph: url("../img/points/rauma.svg"); }
.sheet-use-pill .sheet-glyph { width: 1.4rem; height: 1.4rem; }
.sheet-detail-text { margin-top: 1.5rem; font-size: 1.25rem; line-height: 1.8rem; text-align: justify; color: #3d3d3d; }
.sheet-detail-text strong { font-weight: 800; color: #282826; }
.sheet-detail { position: relative; }
/* Кнопка (i) в правом верхнем углу карточки и всплывающее пояснение мастера */
.sheet-info-btn { position: absolute; top: 1.1rem; right: 1.1rem; z-index: 2; display: grid; place-items: center; width: 2.4rem; height: 2.4rem; padding: 0; border: 0.15rem solid var(--accent); border-radius: 50%; background: none; font: italic 700 1.4rem/1 Georgia, "Times New Roman", serif; color: var(--accent); cursor: pointer; }
.sheet-info-btn:hover, .sheet-info-btn[aria-expanded="true"] { background: var(--accent); color: #fff; }
.sheet-info-pop { position: absolute; top: 4.1rem; right: 1.1rem; z-index: 3; box-sizing: border-box; width: 30rem; max-width: calc(100% - 2.2rem); padding: 1.1rem 1.3rem; border: 0.1rem solid #cfc9c9; border-radius: 1rem; background: #fbfafa; box-shadow: 0 0.6rem 2rem rgba(0, 0, 0, 0.22); font-size: 1.2rem; line-height: 1.8rem; text-align: left; color: var(--sheet-text); }
.sheet-info-pop[hidden] { display: none; }
.sheet-detail header { padding-right: 3rem; }
.ed-suggest { position: fixed; z-index: 500; max-height: 26rem; overflow-y: auto; padding: 0.4rem; border: 0.1rem solid #cfc9c9; border-radius: 1rem; background: #fbfafa; box-shadow: 0 0.6rem 2rem rgba(0, 0, 0, 0.22); }
.ed-suggest[hidden] { display: none; }
.ed-suggest button { display: flex; align-items: center; justify-content: space-between; gap: 1rem; width: 100%; padding: 0.6rem 0.9rem; border: 0; border-radius: 0.6rem; background: none; font: inherit; font-size: 1.3rem; text-align: left; color: #2f2a2d; cursor: pointer; }
.ed-suggest button:hover { background: #ececec; }
.ed-suggest small { font-size: 1.1rem; color: #6d6666; white-space: nowrap; }
.ed-suggest-hb { padding: 0 0.4rem; border-radius: 0.4rem; background: #684a43; font-size: 1rem; font-style: normal; color: #fff; }
.sheet-use {
  height: 2.8rem; min-width: 14.4rem; padding: 0 1.6rem; border: 0.1rem solid var(--accent); border-radius: 0.8rem;
  background: var(--accent); color: #fff; font-size: 1.1rem; font-weight: 700; cursor: pointer;
}
.sheet-use:hover:not(:disabled) { filter: brightness(1.12); }
.sheet-use:disabled { background: none; color: var(--accent); cursor: default; }
.sheet-detail > .sheet-use { align-self: center; margin-top: auto; }
.sheet-detail > .ed-cost-note { font-size: 1.1rem; color: var(--sheet-text); opacity: 0.7; }

/* Воплощения */
.sheet-forms { display: grid; grid-template-columns: 21.3rem minmax(0, 63.8rem); column-gap: 1.1rem; align-items: start; }
.sheet-form { position: relative; display: grid; grid-template-columns: 17.6rem minmax(0, 1fr); column-gap: 0.8rem; min-height: 28.2rem; padding: 0.8rem 0.9rem 1.2rem 0.9rem; border-radius: 1.6rem; background: #f5f5f5; }
.sheet-form-art { display: grid; place-items: center; width: 17.6rem; height: 26.2rem; overflow: hidden; border: 0.1rem solid var(--accent); border-radius: 0.8rem; background: #e4e4e4; color: var(--accent-soft); font-size: 4rem; }
.sheet-form-art img { width: 100%; height: 100%; object-fit: cover; }
.sheet-form-main { min-width: 0; padding-bottom: 4rem; }
.sheet-form-main h3 { margin: 0.7rem 0 0.7rem; font-size: 1.6rem; font-weight: 800; line-height: 1.2; text-transform: lowercase; color: var(--accent); }
.sheet-form-tiles { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.sheet-form-tiles div { display: flex; flex-direction: column; justify-content: center; gap: 0.2rem; width: 9.6rem; height: 4.4rem; padding: 0 0.7rem; border-radius: 0.8rem; background: var(--accent); color: #fff; }
.sheet-form-tiles span { font-size: 0.8rem; font-weight: 700; line-height: 1; }
.sheet-form-tiles b { font-size: 1.4rem; font-weight: 800; line-height: 1.1; }
.sheet-form-stats { display: flex; gap: 0.8rem; margin-top: 0.5rem; }
.sheet-form-stats div { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 6rem; height: 4.5rem; border-radius: 0.8rem; background: #d8d8d8; color: var(--sheet-text); }
.sheet-form-stats span { font-size: 1rem; font-weight: 800; line-height: 1.1; }
.sheet-form-stats b { font-size: 1.6rem; font-weight: 800; line-height: 1.2; }
.sheet-form-attacks { margin-top: 1.9rem; font-size: 1rem; }
.sheet-form-attacks-head, .sheet-form-attack { display: grid; grid-template-columns: 7.6rem 4.6rem minmax(0, 1fr); align-items: center; }
.sheet-form-attacks-head { height: 1.6rem; padding-left: 1rem; font-size: 0.9rem; color: var(--sheet-text); }
.sheet-form-attacks-head span:nth-child(2) { text-align: center; }
.sheet-form-attack { min-height: 2.8rem; }
.sheet-form-attack .sheet-attack-name { gap: 0.6rem; }
.sheet-form-attack .sheet-attack-name i { display: grid; place-items: center; flex: none; width: 1.8rem; height: 1.8rem; font-style: normal; font-size: 1.2rem; color: var(--accent-soft); }
.sheet-form-attack .sheet-attack-name img { width: 100%; height: 100%; object-fit: contain; }
.sheet-form-attack .sheet-attack-name b { font-size: 1rem; text-transform: lowercase; }
.sheet-form-bonus em { display: block; width: 3.6rem; height: 1.4rem; margin: 0 auto; border-radius: 0.5rem; background: var(--accent); color: #fff; font-size: 0.9rem; font-style: normal; line-height: 1.4rem; text-align: center; }
.sheet-form-features { margin: 1.4rem 0 0; padding: 0; list-style: none; font-size: 1rem; line-height: 1.5rem; color: #3d3d3d; }
.sheet-form-features li + li { margin-top: 0.4rem; }
.sheet-form-features b { color: var(--accent); }
.sheet-form-go { position: absolute; right: 1.2rem; bottom: 1.2rem; }
.sheet-form-go.is-on { background: none; color: var(--accent); }

/* Инвентарь */
.sheet-inventory { display: grid; grid-template-columns: 50.9rem minmax(0, 33.8rem); column-gap: 1.4rem; align-items: start; }
.sheet-items { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.8rem 0.6rem; }
.sheet-item {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem;
  height: 9.8rem; padding: 0.6rem 0.7rem; border: 0; border-radius: 1.4rem; background: #f5f5f5; text-align: center;
}
.sheet-item-icon { font-size: 4rem; line-height: 1; }
.sheet-item b { font-size: 0.95rem; font-weight: 800; line-height: 1.15; color: #3d3d3d; overflow-wrap: anywhere; }
.sheet-item-remove {
  position: absolute; top: 0.4rem; right: 0.5rem; display: none; width: 1.8rem; height: 1.8rem; padding: 0;
  border: 0; border-radius: 50%; background: #e4e4e4; color: var(--accent); font-size: 1.4rem; line-height: 1.8rem; cursor: pointer;
}
.sheet-item:hover .sheet-item-remove { display: block; }
.sheet-item.is-add { background: #d8d8d8; color: #40403e; font-size: 3.4rem; font-weight: 300; cursor: pointer; }
.sheet-item.is-add:hover { background: #cfcfcf; }
.sheet-item.is-adding input { width: 100%; height: 3rem; border: 0.1rem solid var(--accent); border-radius: 0.8rem; background: #fff; font: inherit; font-size: 1.2rem; text-align: center; outline: none; }
.sheet-inv-side { display: grid; gap: 0.5rem; }
.sheet-box { padding: 1.7rem 1.7rem 1.6rem; border-radius: 1.6rem; background: #f5f5f5; }
.sheet-box h3 { margin: 0; font-size: 1.4rem; font-weight: 800; line-height: 1.3; text-transform: lowercase; color: var(--accent); }
.sheet-coins { display: flex; justify-content: center; gap: 0.9rem; margin-top: 1rem; }
.sheet-coin { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 7.4rem; height: 4.1rem; border-radius: 0.8rem; background: #e4e4e4; cursor: text; }
.sheet-coin span { font-size: 1rem; font-weight: 800; line-height: 1.1; text-transform: lowercase; color: var(--sheet-text); }
.sheet-coin input { width: 100%; padding: 0; border: 0; background: none; font: inherit; font-size: 1.8rem; font-weight: 800; line-height: 1.2; text-align: center; color: var(--accent); outline: none; -moz-appearance: textfield; }
.sheet-coin input::-webkit-outer-spin-button, .sheet-coin input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sheet-box dl { margin: 1.4rem 0 0; }
.sheet-box dl div { display: grid; grid-template-columns: 10.1rem minmax(0, 1fr); padding: 0.2rem 0; border-bottom: 0.1rem solid #e4e4e4; font-size: 1.1rem; line-height: 1.6rem; }
.sheet-box dt { font-weight: 800; color: var(--accent); }
.sheet-box dd { margin: 0; color: #3d3d3d; }
.sheet-box .sheet-empty { margin: 1rem 0 0; font-size: 1.1rem; }

/* Личность */
.sheet-personality { display: grid; grid-template-columns: 53.7rem minmax(0, 32.4rem); column-gap: 0.9rem; align-items: start; }
.sheet-pers-art { position: relative; height: 39.7rem; }
.sheet-pers-art > img {
  position: absolute; left: 6rem; top: 0; width: 47.4rem; height: 39.7rem; object-fit: contain; object-position: center;
}
.sheet-bubble { position: absolute; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.9rem; padding: 0 2rem; text-align: center; color: #fff; }
.sheet-bubble i { position: absolute; inset: 0; z-index: 0; border-radius: 45%; background: var(--accent); opacity: 0.82; filter: blur(1.6rem); }
.sheet-bubble span, .sheet-bubble b { position: relative; z-index: 1; text-shadow: 0 0 0.6rem rgba(0, 0, 0, 0.35); }
.sheet-bubble span { font-size: 1.5rem; font-weight: 200; font-style: italic; line-height: 1; }
.sheet-bubble b { font-size: 1.1rem; font-weight: 700; font-style: italic; line-height: 1.5rem; }
.sheet-bubble.is-traits { left: 4rem; top: 5.2rem; width: 19rem; height: 9rem; }
.sheet-bubble.is-bonds { left: 38.2rem; top: 10.1rem; width: 16rem; height: 8.4rem; }
.sheet-bubble.is-ideals { left: 4rem; top: 20.2rem; width: 24rem; height: 10rem; }
.sheet-bubble.is-flaws { left: 33.7rem; top: 25.2rem; width: 20rem; height: 10rem; }
.sheet-story { display: flex; flex-direction: column; height: 39.4rem; padding: 1.2rem 0.6rem 1.4rem 1.2rem; border-radius: 1.6rem; background: #f5f5f5; }
.sheet-story h3 { flex: none; margin: 0 0 0.9rem; font-size: 1.6rem; font-weight: 800; line-height: 1.3; color: var(--accent); }
.sheet-story-text { flex: 1; min-height: 0; padding-right: 0.6rem; overflow-y: auto; scrollbar-width: none; }
.sheet-story-text::-webkit-scrollbar { display: none; }
.sheet-story p { margin: 0 0 1.1rem; font-size: 0.95rem; line-height: 1.22; color: #3d3d3d; }
.sheet-story .sheet-empty { margin: 0; }

/* Дневник */
.sheet-journal { margin: 0 0 1rem 0.4rem; }
.sheet-compose { padding: 1.4rem 1.4rem 1.2rem; border-radius: 1.4rem; background: #f5f5f5; }
.sheet-compose header { display: flex; align-items: center; justify-content: space-between; }
.sheet-compose h3 { margin: 0; font-size: 1.4rem; font-weight: 800; line-height: 1.3; text-transform: lowercase; color: #4d4d4d; }
.sheet-compose label { display: flex; align-items: center; gap: 0.8rem; font-size: 1rem; color: var(--sheet-text); }
.sheet-compose select { width: 14.4rem; height: 1.7rem; padding: 0 0.4rem; border: 0; border-radius: 0.4rem; background: #e4e4e4; font: inherit; font-size: 1rem; color: #3d3d3d; outline: none; }
.sheet-compose textarea {
  display: block; width: 100%; height: 7rem; margin-top: 1rem; padding: 1rem; border: 0; border-radius: 0.8rem; background: #e4e4e4;
  font: inherit; font-size: 1.1rem; line-height: 1.5rem; color: #3d3d3d; resize: vertical; outline: none;
}
.sheet-compose textarea::placeholder, .sheet-journal-filter input::placeholder { color: #8a8a8a; }
.sheet-compose footer { display: flex; align-items: center; gap: 1rem; margin-top: 0.6rem; }
.sheet-compose-tags { display: flex; gap: 0.5rem; margin-right: auto; }
.sheet-compose footer > span { font-size: 1rem; color: var(--sheet-text); }
.sheet-compose #jAdd { height: 1.8rem; padding: 0 1.4rem; border: 0; border-radius: 0.6rem; background: var(--accent); color: #fff; font-size: 1rem; font-weight: 700; cursor: pointer; }
.sheet-compose #jAdd:hover { filter: brightness(1.12); }
.sheet-tag { display: inline-block; min-width: 6rem; height: 1.6rem; padding: 0 0.8rem; border: 0; border-radius: 0.4rem; background: #526e78; color: #fff; font-size: 1rem; line-height: 1.6rem; text-align: center; white-space: nowrap; }
.sheet-tag.is-plot { background: #526e78; }
.sheet-tag.is-npc { background: #5c5278; }
.sheet-tag.is-loot { background: #785253; }
.sheet-tag.is-lore { background: #786c52; }
button.sheet-tag { cursor: pointer; }
button.sheet-tag.is-on { box-shadow: 0 0 0 0.2rem #f5f5f5, 0 0 0 0.4rem var(--accent); }
.sheet-journal-filter { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; margin-top: 1.9rem; }
.sheet-pills { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.sheet-pills button { height: 2rem; padding: 0 1.3rem; border: 0.1rem solid var(--accent); border-radius: 1rem; background: none; color: var(--accent); font-size: 1.2rem; font-weight: 700; line-height: 1.8rem; cursor: pointer; }
.sheet-pills button.is-on { background: var(--accent); color: #fff; }
.sheet-journal-filter input { width: 19.2rem; height: 2rem; padding: 0 1rem; border: 0; border-radius: 0.6rem; background: #d8d8d8; font: inherit; font-size: 1.2rem; color: #3d3d3d; outline: none; }
.sheet-tag-filter { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.8rem; font-size: 1rem; color: var(--sheet-text); }
.sheet-tag-filter span { margin-right: 0.3rem; }
.sheet-tag-filter button { height: 1.4rem; min-width: 5rem; padding: 0 0.8rem; border: 0.1rem solid var(--accent); border-radius: 0.5rem; background: none; color: var(--accent); font-size: 0.9rem; line-height: 1.2rem; cursor: pointer; }
.sheet-tag-filter button.is-on { background: var(--accent); color: #fff; }
.sheet-day { margin-top: 2.2rem; }
.sheet-day header { display: flex; align-items: baseline; justify-content: space-between; }
.sheet-day h3 { margin: 0; font-size: 1.3rem; font-weight: 800; line-height: 1.4; color: #3d3d3d; }
.sheet-day h3 span { font-weight: 400; }
.sheet-day small { font-size: 1.2rem; color: var(--sheet-text); }
.sheet-entry { position: relative; display: grid; grid-template-columns: 4rem minmax(0, 1fr) auto; align-items: start; margin-top: 0.8rem; padding: 0.9rem 1rem 0.9rem 0.8rem; border: 0.1rem solid transparent; border-radius: 0.8rem; background: #d8d8d8; }
.sheet-entry.is-starred { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.sheet-entry time { font-size: 0.9rem; line-height: 1.4rem; color: var(--sheet-text); }
.sheet-entry-body p { margin: 0; font-size: 1.1rem; line-height: 1.4rem; color: #3d3d3d; overflow-wrap: anywhere; }
.sheet-entry-tags { display: flex; gap: 0.4rem; margin-top: 0.4rem; }
.sheet-entry-tags .sheet-tag { min-width: 3.4rem; height: 1.1rem; padding: 0 0.5rem; border-radius: 0.3rem; font-size: 0.7rem; line-height: 1.1rem; }
.sheet-entry-tools { display: flex; gap: 0.6rem; }
.sheet-entry-tools button { width: 1.6rem; height: 1.6rem; padding: 0; border: 0; background: none; color: var(--accent); font-size: 1.4rem; line-height: 1.6rem; cursor: pointer; }
.sheet-entry-tools button:hover { filter: brightness(1.3); }

/* --- Окно короткого отдыха --- */
.sheet-modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(40, 40, 38, 0.45); }
.sheet-modal[hidden] { display: none; }
.sheet-modal-card {
  width: 36rem; max-width: calc(100vw - 4rem); padding: 2.4rem;
  border: 0.2rem solid #684a43; border-radius: 2rem; background: #e4e4e4;
}
.sheet-modal-card h3 { margin: 0 0 1rem; font-size: 2rem; font-weight: 800; }
.sheet-modal-card p { margin: 0 0 1.2rem; font-size: 1.4rem; }
.sheet-rest-pick { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 1rem; font-size: 1.3rem; }
.sheet-rest-pick button {
  width: 3rem; height: 3rem; border: 0; border-radius: 0.8rem;
  background: #d8d8d8; font-size: 1.8rem; line-height: 1; cursor: pointer;
}
.sheet-rest-pick input { width: 5rem; height: 3rem; border: 0; border-radius: 0.8rem; background: #f5f5f5; font-size: 1.5rem; text-align: center; outline: none; }
.sheet-rest-pick span { margin-left: 0.6rem; color: var(--ink-muted); }
.sheet-rest-hint { min-height: 1.8rem; color: var(--ink-muted); }
.sheet-modal-actions { display: flex; justify-content: flex-end; gap: 1rem; margin-top: 0.6rem; }
.sheet-modal-actions button { height: 3.2rem; padding: 0 1.8rem; border: 0; border-radius: 1rem; background: #d8d8d8; font-size: 1.4rem; font-weight: 700; cursor: pointer; }
.sheet-modal-actions .is-primary { background: #684a43; color: #fff; }

/* ============ 10. Редактор чарлиста ============ */
/* Это тот же лист (классы и размеры блока 9), только с полями ввода. Всё, что относится только к режиму
   правки, живёт под .is-edit; поля выглядят как обычный текст листа и подсвечиваются при наведении. */
.is-edit input:not([type="checkbox"]):not([type="file"]):not([type="color"]), .is-edit textarea, .is-edit select {
  box-sizing: border-box; min-width: 0; margin: 0; padding: 0 0.3rem;
  border: 0; border-radius: 0.5rem; outline: none;
  background: rgba(104, 74, 67, 0.07); color: inherit; font: inherit; line-height: inherit;
}
.is-edit textarea { padding: 0.5rem 0.7rem; resize: vertical; }
.is-edit input:hover, .is-edit textarea:hover, .is-edit select:hover { background: rgba(104, 74, 67, 0.13); }
.is-edit input:focus, .is-edit textarea:focus, .is-edit select:focus { background: #fff; box-shadow: 0 0 0 0.1rem var(--accent); }
.is-edit input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.is-edit input[type="number"]::-webkit-outer-spin-button, .is-edit input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.is-edit input::placeholder, .is-edit textarea::placeholder { color: #9a9a9a; font-weight: 400; }
.is-edit button { font-family: inherit; }
.is-inert { opacity: 0.45; pointer-events: none; }

/* Шапка */
.sheet-color { display: flex; align-items: center; gap: 0.8rem; margin-right: 2rem; font-size: 1.2rem; color: var(--sheet-text); }
.sheet-color input { width: 3.2rem; height: 2.6rem; padding: 0; border: 0.1rem solid var(--accent); border-radius: 0.6rem; background: none; cursor: pointer; }

/* Мелкие кнопки редактора */
.ed-btn {
  display: inline-flex; align-items: center; height: 2.2rem; padding: 0 1rem; border: 0; border-radius: 0.8rem;
  background: rgba(45, 37, 35, 0.78); color: #fff; font-size: 1.1rem; font-weight: 700; cursor: pointer;
}
.ed-btn:hover { background: var(--accent); }
.ed-tools { position: absolute; right: 0.8rem; top: 0.8rem; z-index: 2; display: flex; gap: 0.4rem; }
.ed-x { width: 2rem; height: 2rem; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--accent); font-size: 1.6rem; line-height: 2rem; cursor: pointer; }
.ed-x:hover { background: rgba(104, 74, 67, 0.15); }
.ed-add {
  display: block; margin: 0.8rem 0 0; padding: 0.4rem 1.2rem; border: 0.1rem dashed var(--accent-soft); border-radius: 0.8rem;
  background: none; color: var(--accent); font-size: 1.2rem; font-weight: 700; cursor: pointer;
}
.ed-add:hover { border-color: var(--accent); background: rgba(104, 74, 67, 0.07); }
.ed-note { margin: 0.8rem 0 0; font-size: 1rem; color: var(--sheet-text); text-align: center; }

/* Левая колонка */
.is-edit .sheet-level input { width: 3.6rem; height: 2.8rem; padding: 0; background: none; font-size: 2.6rem; font-weight: 800; text-align: center; }
.is-edit .sheet-level input:hover { background: rgba(104, 74, 67, 0.1); }
.is-edit .sheet-name input { width: 100%; height: 4.2rem; font-size: 3.4rem; font-weight: 800; }
.is-edit .sheet-subtitle input { width: 100%; height: 2.4rem; font-size: 1.5rem; }
.is-edit .sheet-xp-text input { width: 6.4rem; height: 1.8rem; font-size: 1.2rem; text-align: center; }
.is-edit .sheet-xp-text span:last-child { display: flex; align-items: center; gap: 0.4rem; }
.is-edit .ed-hp { width: 7rem; height: 3rem; font-size: 2.2rem; font-weight: 800; text-align: right; color: var(--accent); }
.is-edit .ed-dice { width: 7rem; height: 2rem; margin-left: 0.4rem; font-size: 1.2rem; font-weight: 800; text-align: center; }
.sheet-hp-row .ed-dice { margin-left: 0.4rem; }

/* Плитки и характеристики */
.is-edit .sheet-tile input { width: 7rem; height: 3.2rem; padding: 0 0.3rem; background: rgba(255, 255, 255, 0.14); color: #fff; font-size: 2.4rem; font-weight: 800; }
.is-edit .sheet-tile input:hover { background: rgba(255, 255, 255, 0.24); }
.is-edit .sheet-tile input:focus { color: var(--accent); }
.is-edit .sheet-tile b { display: flex; align-items: center; white-space: nowrap; }
.is-edit .sheet-tile .ed-speed { width: 4.6rem; }
.is-edit .sheet-tile .ed-prof { width: 4.6rem; }
.is-edit .sheet-tile input { width: 5.6rem; }
.sheet-tile b em { font-size: 2.4rem; font-style: normal; }
.is-edit .ed-score { width: 3.2rem; height: 1.6rem; padding: 0; background: #c4c4c4; font-size: 0.9rem; font-weight: 700; text-align: center; color: var(--sheet-text); }
.is-edit .ed-mod { display: block; width: 7rem; height: 3.2rem; margin-top: 0.1rem; font-size: 2.4rem; font-weight: 800; color: var(--accent); }
.is-edit .ed-bonus { width: 3.4rem; height: 1.4rem; padding: 0; font-size: 1rem; text-align: right; }
.sheet-ability li .sheet-pip { padding: 0; background: none; cursor: pointer; }
.sheet-ability li .sheet-pip.is-on { background: var(--accent); }
.sheet-ability li .sheet-pip:hover { border-color: var(--accent); }

/* Вкладки */
.sheet-tabs button.is-hidden-tab { opacity: 0.55; text-decoration: line-through; }

/* Бой: атаки */
.is-edit .ed-attack { align-items: center; }
.is-edit .ed-attack input { width: 100%; height: 2.6rem; font-size: 1.5rem; }
.is-edit .ed-attack .sheet-attack-name { gap: 0.8rem; }
.is-edit .ed-attack .sheet-attack-name input { font-weight: 700; color: var(--accent); }
.is-edit .ed-attack .sheet-attack-bonus input { width: 6.6rem; text-align: center; background: var(--accent); color: #fff; }
.is-edit .ed-attack .sheet-attack-bonus input:focus { background: #fff; color: var(--accent); }
.is-edit .ed-attack .sheet-attack-damage input { padding-right: 0.3rem; }
.is-edit .ed-attack .sheet-attack-traits { display: flex; align-items: center; gap: 0.4rem; }
.is-edit .ed-attack .sheet-attack-traits input { font-size: 1.2rem; }
.is-edit .sheet-attacks { padding-right: 2.3rem; }
.is-edit .sheet-attacks-body { max-height: none; padding-right: 0; }
.is-edit .sheet-attacks .ed-add { margin-top: 0.8rem; }
.ed-icon { position: relative; cursor: pointer; }
.ed-icon:hover { outline: 0.1rem dashed var(--accent); outline-offset: 0.2rem; border-radius: 0.8rem; }

/* Умения, заклинания, воплощения */
.ed-strip { display: flex; align-items: center; gap: 1.4rem; min-height: 3rem; margin-bottom: 0.9rem; font-size: 1.2rem; color: var(--sheet-text); }
.ed-strip select { height: 2.2rem; font-size: 1.2rem; }
.ed-strip input[type="number"] { width: 5rem; height: 2.2rem; text-align: center; }
.ed-inline { display: inline-flex; align-items: center; gap: 0.6rem; }
.ed-switch { display: inline-flex; align-items: center; gap: 0.8rem; cursor: pointer; }
.ed-switch input { position: absolute; opacity: 0; pointer-events: none; }
.ed-switch i { position: relative; width: 3.4rem; height: 1.8rem; border-radius: 1rem; background: #c4c4c4; transition: background 0.15s; }
.ed-switch i::after { content: ""; position: absolute; top: 0.2rem; left: 0.2rem; width: 1.4rem; height: 1.4rem; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.ed-switch input:checked + i { background: var(--accent); }
.ed-switch input:checked + i::after { transform: translateX(1.6rem); }
.ed-switch input:focus-visible + i { box-shadow: 0 0 0 0.2rem var(--accent-soft); }

.sheet-card.is-add { justify-content: center; border: 0.1rem dashed var(--accent-soft); background: none; color: var(--accent); font-size: 3.2rem; font-weight: 300; cursor: pointer; }
.sheet-card.is-add:hover { border-color: var(--accent); background: rgba(104, 74, 67, 0.07); }
.ed-detail { min-height: 0; }
.ed-detail header > div { min-width: 0; flex: 1; }
.ed-detail h3 input { width: 100%; height: 2.6rem; font-size: 1.9rem; font-weight: 800; color: var(--accent); }
.ed-detail header p input { width: 100%; height: 2rem; margin-top: 0.2rem; font-size: 1.2rem; }
.ed-detail .sheet-use-meta { flex-wrap: wrap; gap: 0.6rem; }
.ed-detail select { height: 2.2rem; font-size: 1.1rem; }
.ed-detail .sheet-use-pill { align-items: center; padding: 0 0.4rem; }
.is-edit .ed-small { width: 4rem; height: 1.6rem; padding: 0; font-size: 1.2rem; font-weight: 800; text-align: center; }
.ed-detail .sheet-use-pill small { font-size: 0.9rem; }
.ed-text-head { display: flex; align-items: center; justify-content: space-between; margin: 1.2rem 0 0.4rem; font-size: 1.1rem; color: var(--sheet-text); }
.is-edit textarea.ed-text { display: block; width: 100%; font-size: 1.25rem; line-height: 1.8rem; }
.is-edit textarea.ed-info { font-size: 1.1rem; line-height: 1.5rem; }
.ed-format { display: inline-flex; gap: 0.3rem; }
.ed-format button { width: 2.2rem; height: 2rem; padding: 0; border: 0; border-radius: 0.5rem; background: #d8d8d8; color: #282826; font-size: 1.2rem; cursor: pointer; }
.ed-format button:hover { background: var(--accent); color: #fff; }
.ed-delete { margin: 1.4rem auto 0; background: none; color: #9a4949; border-color: #9a4949; }
.ed-delete:hover:not(:disabled) { background: #9a4949; color: #fff; filter: none; }
.sheet-detail > .ed-delete { align-self: center; }

.is-edit .ed-form { min-height: 32rem; }
.ed-form .sheet-form-art { position: relative; }
.is-edit .ed-form .sheet-form-main { padding-bottom: 5rem; }
.is-edit .ed-form h3 input { width: 100%; height: 2.6rem; font-size: 1.6rem; font-weight: 800; color: var(--accent); }
.is-edit .sheet-form-tiles input { width: 100%; height: 2.4rem; padding: 0 0.3rem; background: rgba(255, 255, 255, 0.14); color: #fff; font-size: 1.4rem; font-weight: 800; }
.is-edit .sheet-form-tiles input:focus { color: var(--accent); }
.is-edit .sheet-form-stats input { width: 100%; text-align: center; background: none; }
.is-edit .sheet-form-stats .ed-statname { height: 1.4rem; font-size: 1rem; font-weight: 800; }
.is-edit .sheet-form-stats .ed-statmod { height: 2.4rem; font-size: 1.6rem; font-weight: 800; }
.is-edit .sheet-form-attack input { width: 100%; height: 2.2rem; font-size: 1rem; }
.is-edit .sheet-form-attack .sheet-attack-name input { font-weight: 700; color: var(--accent); }
.is-edit .sheet-form-attack .sheet-attack-bonus input, .is-edit .sheet-form-attack .sheet-form-bonus input { text-align: center; }
.ed-damage { display: flex; align-items: center; gap: 0.2rem; }
.ed-form .ed-add { font-size: 1rem; padding: 0.2rem 1rem; }
.is-edit .ed-form .ed-text { font-size: 1.1rem; line-height: 1.5rem; }

/* Инвентарь */
.is-edit .sheet-item { padding: 0.6rem 0.5rem; }
.is-edit .sheet-item textarea { width: 100%; height: 3.4rem; padding: 0.2rem; font-size: 0.95rem; font-weight: 800; line-height: 1.2rem; text-align: center; background: none; resize: none; overflow: hidden; }
.is-edit .sheet-item textarea:hover { background: rgba(104, 74, 67, 0.1); }
.is-edit .sheet-item .sheet-item-remove { display: none; }
.is-edit .sheet-item:hover .sheet-item-remove { display: block; }
.is-edit .sheet-coin input { height: 2.6rem; padding: 0; font-size: 1.8rem; font-weight: 800; text-align: center; color: var(--accent); background: none; }
.is-edit .sheet-box dl div { align-items: center; }
.is-edit .sheet-box dt input { width: 100%; height: 2.2rem; font-weight: 800; color: var(--accent); }
.is-edit .sheet-box dd { display: flex; align-items: center; gap: 0.2rem; }
.is-edit .sheet-box dd input { flex: 1; height: 2.2rem; }
.is-edit .sheet-box .ed-add { margin-top: 1rem; }

/* Личность */
.ed-tools-art { left: 17rem; right: auto; top: 0; }
.is-edit .sheet-bubble { z-index: 1; }
.is-edit .sheet-bubble textarea {
  position: relative; z-index: 1; width: 100%; height: 6rem; padding: 0.4rem 0.6rem; background: rgba(0, 0, 0, 0.22); color: #fff;
  font-size: 1.1rem; font-weight: 700; font-style: italic; text-align: center; line-height: 1.4rem; resize: none;
}
.is-edit .sheet-bubble textarea:focus { background: rgba(0, 0, 0, 0.45); box-shadow: 0 0 0 0.1rem #fff; }
.is-edit .sheet-bubble textarea::placeholder { color: rgba(255, 255, 255, 0.6); }
.is-edit .sheet-bubble.is-traits, .is-edit .sheet-bubble.is-bonds, .is-edit .sheet-bubble.is-ideals, .is-edit .sheet-bubble.is-flaws { padding: 0 2.2rem; }
.ed-story { overflow-y: auto; scrollbar-width: none; }
.ed-story::-webkit-scrollbar { display: none; }
.is-edit .ed-story h3 input { width: 100%; height: 2.8rem; font-size: 1.6rem; font-weight: 800; color: var(--accent); }
.is-edit .ed-story textarea { flex: 1; min-height: 0; width: 100%; font-size: 1.1rem; line-height: 1.5rem; resize: none; }
.is-edit .sheet-tile small { display: block; margin-top: 0.3rem; }
.is-edit .sheet-tile small input { width: 100%; height: 1.5rem; padding: 0 0.3rem; background: rgba(255, 255, 255, 0.12); color: #fff; font-size: 0.9rem; font-weight: 400; }
.is-edit .sheet-tile small input:hover { background: rgba(255, 255, 255, 0.22); }
.is-edit .sheet-tile small input:focus { background: #fff; color: var(--accent); }
.is-edit .sheet-tile small input::placeholder { color: rgba(255, 255, 255, 0.45); }


/* ============ 11. Выбор эмодзи (значки предметов) ============ */
.sheet-item-icon { padding: 0.2rem 0.6rem; border: 0; border-radius: 1rem; background: none; font-family: inherit; font-size: 4rem; line-height: 1; cursor: pointer; }
.sheet-item-icon:hover { background: rgba(104, 74, 67, 0.12); }
.sheet-item.is-adding { gap: 0.5rem; }
.emoji-picker {
  position: fixed; z-index: 80; width: 31rem; padding: 1rem; box-sizing: border-box;
  border: 0.2rem solid #684a43; border-radius: 1.6rem; background: #f5f5f5;
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.25); font-family: 'Nunito', sans-serif; color: #3d3d3d;
}
.emoji-tabs { display: flex; gap: 0.3rem; }
.emoji-tabs button { flex: 1; height: 3.2rem; padding: 0; border: 0; border-radius: 0.8rem; background: #e4e4e4; font-size: 1.8rem; line-height: 1; cursor: pointer; }
.emoji-tabs button:hover { background: #d8d8d8; }
.emoji-tabs button.is-active { background: #fff; box-shadow: 0 0 0 0.2rem #684a43; }
.emoji-title { margin: 1rem 0 0.6rem 0.2rem; font-size: 1.2rem; font-weight: 700; color: #727272; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 0.2rem; min-height: 12.6rem; align-content: start; }
.emoji-grid button { height: 3.4rem; padding: 0; border: 0; border-radius: 0.8rem; background: none; font-size: 2.2rem; line-height: 1; cursor: pointer; }
.emoji-grid button:hover { background: #e4e4e4; }
.emoji-foot { display: flex; gap: 0.5rem; margin-top: 1rem; padding-top: 1rem; border-top: 0.1rem solid #e4e4e4; }
.emoji-foot input { flex: 1; min-width: 0; height: 2.8rem; padding: 0 0.8rem; border: 0; border-radius: 0.8rem; background: #e4e4e4; font: inherit; font-size: 1.3rem; outline: none; }
.emoji-foot input:focus { background: #fff; box-shadow: 0 0 0 0.1rem #684a43; }
.emoji-foot button { height: 2.8rem; padding: 0 1.2rem; border: 0; border-radius: 0.8rem; background: #684a43; color: #fff; font-family: inherit; font-size: 1.2rem; font-weight: 700; cursor: pointer; }
.emoji-foot button[data-auto] { background: #d8d8d8; color: #3d3d3d; }
.emoji-foot button:hover { filter: brightness(1.1); }
.emoji-img { width: 1em; height: 1em; vertical-align: -0.12em; }


/* ============ 12. Чарлисты (админ) ============ */
/* Размеры сняты с макета «админка чарлисты» (1280 px). Карточки персонажей — те же, что «Мои персонажи» на главной игрока. */
.chars-head { position: relative; margin-bottom: 0.7rem; }
.chars-head .dashboard-title .icon { width: 2.6rem; height: 2.6rem; }
.chars-new {
  position: absolute; top: 1.6rem; right: 0.2rem;
  display: inline-flex; align-items: center; height: 3.1rem; padding: 0 1.2rem;
  border-radius: 1rem; background: var(--ink); color: #fff;
  font-size: 1.35rem; text-decoration: none;
}
.chars-new:hover { filter: brightness(1.25); }
.chars-note { margin: 0 0 1rem; font-size: 1.3rem; color: #555; }
.chars-note.is-error { color: var(--red); }

.chars-controls { display: flex; align-items: center; gap: 1.2rem; margin-left: -1.6rem; }
.chars-controls input {
  flex: 1; min-width: 0; height: 2.7rem; padding: 0 2.3rem; box-sizing: border-box;
  border: 0; border-radius: 1.35rem; outline: none;
  background: var(--card-bg); color: var(--ink); font: inherit; font-size: 1.4rem;
}
.chars-controls input::placeholder { color: #9a9a9a; }
.chars-controls input:focus { box-shadow: 0 0 0 0.1rem var(--ink); }
.chars-sort { display: flex; gap: 0.6rem; margin-right: 0.3rem; }
.chars-sort button {
  height: 2.7rem; padding: 0 1.6rem; border: 0; border-radius: 1.35rem;
  background: var(--card-bg); color: var(--ink); font: inherit; font-size: 1.35rem; cursor: pointer; white-space: nowrap;
}
.chars-sort button:hover { filter: brightness(0.96); }
.chars-sort button.is-on { background: var(--ink); color: #fff; }

.chars-grid {
  display: grid; grid-template-columns: repeat(auto-fill, 24rem); gap: 2.4rem;
  margin: 3.9rem -1.5rem 0 -0.5rem;
}
.char-item { position: relative; display: flex; }
.char-item[hidden] { display: none; }
/* Карточки крупнее, чем «Мои персонажи» на главной игрока: их на этой странице нужно хорошо читать. */
.char-card {
  grid-template-columns: 5rem 1fr; column-gap: 1rem;
  flex: 1; box-sizing: border-box; padding: 0.9rem 1.1rem 1.3rem 0.9rem; align-content: start;
  border-radius: 1.6rem; background: var(--card-bg);
}
.char-card:hover { box-shadow: 0 0.2rem 0.8rem rgba(0, 0, 0, 0.12); }
.char-card .hero-portrait { width: 5rem; height: 5rem; font-size: 2.2rem; }
.char-card .hero-info b { font-size: 1.6rem; line-height: 2rem; }
.char-card .hero-info small { font-size: 1.15rem; line-height: 1.6rem; }
.char-card .hero-info small strong { font-weight: 700; color: var(--ink); }
.char-card .hero-dot { top: -0.2rem; right: -0.3rem; width: 1.4rem; height: 1.4rem; }
.char-card .hero-progress { height: 0.7rem; margin: 0.9rem 0 0 0.2rem; background: var(--tile-bg); }
.hero-owner {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 0.6rem; min-height: 2rem;
  margin: 0.8rem 0 0 0.2rem; font-size: 1.35rem; line-height: 2rem; color: #8a8a8a; flex-wrap: wrap;
}
.hero-owner img { flex: none; width: 2rem; height: 2rem; object-fit: contain; }
.char-delete { position: absolute; right: 1rem; bottom: 2.1rem; margin: 0; opacity: 0; transition: opacity 0.12s; }
.char-item:hover .char-delete, .char-delete:focus-within { opacity: 1; }
.char-delete button {
  width: 2.2rem; height: 2.2rem; padding: 0; border: 0; border-radius: 50%;
  background: none; color: #8a8a8a; font-size: 2rem; line-height: 2.2rem; cursor: pointer;
}
.char-delete button:hover { background: var(--red); color: #fff; }
.chars-empty { margin: 4rem 0 0; font-size: 1.4rem; color: #8a8a8a; }
.chars-empty[hidden] { display: none; }
.chars-party {
  flex: none; max-width: 20rem; height: 2.7rem; padding: 0 3.2rem 0 1.6rem; box-sizing: border-box;
  border: 0; border-radius: 1.35rem; outline: none; cursor: pointer;
  background: var(--card-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23282826' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right 1.3rem center / 1rem no-repeat;
  color: var(--ink); font: inherit; font-size: 1.35rem; -webkit-appearance: none; appearance: none; text-overflow: ellipsis;
}
.chars-party:focus-visible { box-shadow: 0 0 0 0.1rem var(--ink); }
.chars-party.is-on { background-color: var(--ink); color: #fff; }


/* ============ 13. Аккаунты (админ) ============ */
/* Размеры сняты с макетов «админка аккаунты 1/2» (1280 px); мелкий текст макета чуть увеличен, чтобы его было удобно читать. */
.accounts .chars-controls input { max-width: 73.2rem; }
.acc-layout { display: grid; grid-template-columns: minmax(0, 1fr); margin: 3.9rem 0 0 -0.5rem; align-items: start; }
.acc-layout.has-detail { grid-template-columns: 38.2rem minmax(0, 59.6rem); column-gap: 3.2rem; }
.acc-list { display: grid; grid-template-columns: repeat(auto-fill, 38.2rem); gap: 1rem 0.5rem; align-content: start; }
.acc-layout.has-detail .acc-list { grid-template-columns: 38.2rem; }

.acc-card {
  display: flex; align-items: flex-start; gap: 1.1rem; min-height: 7.6rem; box-sizing: border-box; padding: 0.5rem 1rem 1rem 0.5rem;
  border: 0.1rem solid transparent; border-radius: 1.2rem; background: var(--card-bg); cursor: pointer;
}
.acc-card:hover { box-shadow: 0 0.2rem 0.8rem rgba(0, 0, 0, 0.12); }
.acc-card:focus-visible { outline: 0.2rem solid var(--ink); outline-offset: 0.2rem; }
.acc-card.is-selected { border-color: var(--olive); }
.acc-avatar { display: grid; place-items: center; flex: none; width: 5rem; height: 5rem; border-radius: 50%; background: var(--tile-bg); }
.acc-avatar img { width: 4.2rem; height: 4.2rem; object-fit: contain; }
.acc-avatar.is-big { width: 8.6rem; height: 8.6rem; }
.acc-avatar.is-big img { width: 7.4rem; height: 7.4rem; }
.acc-main { flex: 1; min-width: 0; padding-top: 0.3rem; }
.acc-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.acc-top b { min-width: 0; font-size: 1.8rem; font-weight: 800; line-height: 2.4rem; overflow-wrap: anywhere; }
.acc-seen {
  flex: none; display: inline-flex; align-items: center; height: 1.8rem; padding: 0 1rem; border-radius: 0.9rem;
  background: #d0d0d0; color: #7a7a7a; font-size: 1.05rem; line-height: 1;
}
.acc-seen.is-online { background: var(--olive); color: #fff; }
.acc-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.8rem; }
.acc-chip { padding: 0.25rem 0.9rem; border-radius: 0.5rem; background: var(--tile-bg); color: #8a8a8a; font-size: 1.1rem; line-height: 1.4rem; }
.acc-chip.is-admin { background: var(--ink); color: #fff; }
.acc-chip.is-empty { background: none; padding-left: 0; color: #a5a5a5; }

.acc-detail { position: relative; box-sizing: border-box; min-height: 34.6rem; padding: 1.8rem 1.5rem 2.6rem 1rem; border-radius: 2rem; background: var(--card-bg); }
.acc-detail[hidden] { display: none; }
.acc-close {
  position: absolute; top: 1.4rem; right: 1rem; display: grid; place-items: center; width: 3rem; height: 3rem; padding: 0;
  border: 0; border-radius: 50%; background: var(--tile-bg); color: var(--ink); cursor: pointer;
}
.acc-close svg { width: 1.8rem; height: 1.8rem; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; }
.acc-close:hover { background: #fff; }
.acc-detail-head { display: flex; align-items: center; gap: 1.2rem; }
.acc-detail-head h2 { margin: 0 0 0.6rem; font-size: 2.4rem; font-weight: 800; line-height: 3rem; overflow-wrap: anywhere; }
.acc-body { max-width: 49.1rem; margin: 0.4rem 0 0 0.5rem; }
.acc-label { display: flex; align-items: baseline; justify-content: space-between; margin: 0.4rem 0 0.4rem 0.3rem; font-size: 1.25rem; color: #8a8a8a; }
.acc-label.is-top { margin-top: 1.8rem; }
.acc-label small { font-size: 1.15rem; }
.acc-input {
  display: block; width: 100%; height: 3.2rem; padding: 0 1.9rem; box-sizing: border-box;
  border: 0; border-radius: 0.9rem; outline: none; background: var(--tile-bg); color: var(--ink); font: inherit; font-size: 1.4rem;
}
.acc-input::placeholder { color: #a5a5a5; }
.acc-input:focus { box-shadow: 0 0 0 0.1rem var(--ink); }

.acc-chars { display: grid; gap: 0.5rem; }
.acc-nochars { margin: 0; padding: 1rem 0 0.4rem 0.3rem; font-size: 1.25rem; color: #8a8a8a; }
.acc-char { display: flex; align-items: center; gap: 0.9rem; padding: 0.6rem 1rem 0.6rem 0.6rem; border-radius: 1rem; background: var(--tile-bg); }
.acc-char-portrait {
  display: grid; place-items: center; flex: none; width: 3.8rem; height: 3.8rem; overflow: hidden; border-radius: 50%;
  background: #684a43; color: #fff; font-size: 1.6rem; font-weight: 800;
}
.acc-char-portrait img { width: 100%; height: 100%; object-fit: cover; }
.acc-char-main { flex: 1; min-width: 0; }
.acc-char-main b { display: block; font-size: 1.4rem; font-weight: 700; line-height: 1.8rem; }
.acc-char-main small { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; font-size: 1.05rem; line-height: 1.5rem; color: #666; }
.acc-char-main small strong { color: var(--ink); }
.acc-party { padding: 0 0.7rem; border-radius: 0.4rem; background: var(--olive); color: #fff; font-size: 1rem; line-height: 1.5rem; }
.acc-party button { margin-left: 0.4rem; padding: 0; border: 0; background: none; color: #fff; font: inherit; font-size: 1.2rem; line-height: 1; opacity: 0.75; cursor: pointer; }
.acc-party button:hover { opacity: 1; }
.acc-char-actions { display: flex; flex: none; align-items: center; gap: 1rem; font-size: 1.15rem; }
.acc-char-actions button, .acc-char-actions a { padding: 0; border: 0; background: none; color: var(--ink); font: inherit; cursor: pointer; text-decoration: none; }
.acc-char-actions .is-olive { color: var(--olive); }
.acc-char-actions .is-red { color: #9a4949; }
.acc-char-actions button:hover, .acc-char-actions a:hover { text-decoration: underline; }
.acc-party-form { display: flex; align-items: center; gap: 0.8rem; }
.acc-party-form input { width: 17rem; height: 2.4rem; padding: 0 0.8rem; border: 0; border-radius: 0.6rem; outline: none; background: #fff; font: inherit; font-size: 1.2rem; box-shadow: 0 0 0 0.1rem var(--olive); }

.acc-add { display: flex; gap: 0.5rem; margin-top: 1rem; }
.acc-btn {
  height: 2.6rem; padding: 0 1.4rem; border: 0; border-radius: 0.7rem; font: inherit; font-size: 1.25rem; line-height: 1; cursor: pointer;
}
.acc-btn:hover { filter: brightness(0.95); }
.acc-btn.is-dark { background: var(--ink); color: #fff; }
.acc-btn.is-dark:hover { filter: brightness(1.25); }
.acc-btn.is-light { background: var(--tile-bg); color: var(--ink); }
.acc-btn.is-red { background: #9a4949; color: #fff; }
.acc-pick { display: grid; gap: 0.3rem; max-height: 19rem; margin-top: 0.8rem; padding: 0.6rem; overflow-y: auto; border-radius: 1rem; background: var(--tile-bg); }
.acc-pick button { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: 0.6rem 0.9rem; border: 0; border-radius: 0.7rem; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.acc-pick button:hover { background: var(--card-bg); }
.acc-pick b { font-size: 1.3rem; }
.acc-pick small { font-size: 1.05rem; color: #8a8a8a; }
.acc-pick p { margin: 0; padding: 0.6rem 0.9rem; font-size: 1.2rem; color: #8a8a8a; }
.acc-body hr { height: 0.1rem; margin: 2.2rem 0 1.6rem; border: 0; background: #b5b5b5; }
.acc-access { display: flex; align-items: center; gap: 0.5rem; }
.acc-label-inline { margin-right: 0.9rem; font-size: 1.3rem; font-weight: 700; }
.acc-self { font-size: 1.15rem; color: #8a8a8a; }
.acc-password { display: flex; gap: 0.5rem; margin-top: 1rem; }
.acc-password input { flex: 1; min-width: 0; height: 2.6rem; padding: 0 1.2rem; border: 0; border-radius: 0.7rem; outline: none; background: var(--tile-bg); font: inherit; font-size: 1.25rem; }
.acc-password input:focus { box-shadow: 0 0 0 0.1rem var(--ink); }
.acc-msg { margin: 0.8rem 0 0 0.5rem; font-size: 1.25rem; color: var(--olive); }
.acc-msg.is-error { color: var(--red); }

.acc-modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(40, 40, 38, 0.45); }
.acc-modal[hidden] { display: none; }
.acc-modal-card { display: grid; gap: 1.2rem; width: 36rem; max-width: calc(100vw - 4rem); padding: 2.4rem; box-sizing: border-box; border-radius: 2rem; background: var(--card-bg); }
.acc-modal-card h2 { margin: 0; font-size: 2rem; font-weight: 800; }
.acc-modal-card label { display: grid; gap: 0.5rem; font-size: 1.25rem; color: #6a6a6a; }
.acc-modal-card small { font-size: 1.05rem; color: #9a9a9a; }
.acc-modal-card input, .acc-modal-card select { height: 3.4rem; padding: 0 1.4rem; border: 0; border-radius: 1rem; outline: none; background: var(--tile-bg); color: var(--ink); font: inherit; font-size: 1.4rem; }
.acc-modal-card input:focus, .acc-modal-card select:focus { box-shadow: 0 0 0 0.1rem var(--ink); }
.acc-modal-actions { display: flex; justify-content: flex-end; gap: 0.8rem; }
.acc-modal-actions .acc-btn { height: 3.2rem; padding: 0 1.8rem; font-size: 1.4rem; }


/* ============ 14. Кампании (админ) ============ */
/* Размеры сняты с макетов «админка кампании …» (1280 px); мелкий текст макета чуть увеличен, чтобы его было удобно читать. */
.dm-head .dashboard-title .icon { width: 2.6rem; height: 2.6rem; }
.dm-head-buttons { position: absolute; top: 1.6rem; right: 0.2rem; display: flex; gap: 0.7rem; }
.dm-btn {
  display: inline-flex; align-items: center; height: 3.1rem; padding: 0 1.2rem; box-sizing: border-box;
  border: 0.1rem solid var(--ink); border-radius: 1rem; font: inherit; font-size: 1.35rem; line-height: 1; cursor: pointer; text-decoration: none;
}
.dm-btn.is-dark { background: var(--ink); color: #fff; }
.dm-btn.is-dark:hover { filter: brightness(1.25); }
.dm-btn.is-line { background: transparent; color: var(--ink); }
.dm-btn.is-line:hover { background: #fff; }
.dm-controls input { flex: none; width: 47.5rem; max-width: 100%; }
.dm-controls .chars-sort { margin-left: auto; }
.chars-sort a {
  display: inline-flex; align-items: center; height: 2.7rem; padding: 0 1.6rem; box-sizing: border-box; border-radius: 1.35rem;
  background: var(--card-bg); color: var(--ink); font-size: 1.35rem; text-decoration: none;
}
.chars-sort a.is-on { background: var(--ink); color: #fff; }
.dm-emoji { flex: none; width: 1.6rem; height: 1.6rem; vertical-align: middle; }

/* Список */
.dm-page .dm-section { margin: 3.4rem 0 0 -0.5rem; }
.dm-section[hidden], .dm-card[hidden] { display: none; }
.dm-section-title { margin: 0 0 1.4rem 0.2rem; font-size: 2rem; font-weight: 800; line-height: 2.6rem; }
.dm-grid { display: grid; grid-template-columns: repeat(auto-fill, 27.3rem); gap: 1rem; align-items: start; }
.dm-card {
  position: relative; display: block; overflow: hidden; box-sizing: border-box; min-height: 9.3rem;
  border-radius: 1.2rem; background: var(--card-bg); color: var(--ink); text-decoration: none;
}
.dm-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 1.2rem; background: var(--c); }
.dm-card:hover { box-shadow: 0 0.2rem 0.8rem rgba(0, 0, 0, 0.12); }
.dm-card-body { display: block; padding: 1rem 1.3rem 1.2rem 2.2rem; }
.dm-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.8rem; }
.dm-card-top b { min-width: 0; font-size: 1.8rem; font-weight: 800; line-height: 2.1rem; overflow-wrap: anywhere; }
.dm-badge {
  flex: none; height: 1.7rem; padding: 0 0.9rem; border-radius: 0.85rem;
  font-size: 1rem; font-weight: 800; line-height: 1.7rem; color: #fff;
}
.dm-badge.is-active { background: var(--c); }
.dm-badge.is-done { background: #9a9a9a; }
.dm-badge.is-planned { background: var(--tile-bg); color: #666; }
.dm-world { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.5rem; font-size: 1.3rem; line-height: 1.6rem; color: #333; }
.dm-date { display: inline-flex; align-items: center; gap: 0.3rem; margin-left: 0.5rem; font-size: 1.05rem; font-weight: 700; }
.dm-date .dm-emoji { width: 1.3rem; height: 1.3rem; }
.dm-bars { display: flex; gap: 0.5rem; margin-top: 1rem; }
.dm-bars i { flex: 1; height: 0.4rem; border-radius: 0.2rem; background: #919191; }
.dm-bars i.is-on { background: var(--c); }
.dm-caption { display: flex; justify-content: space-between; gap: 0.6rem; margin-top: 0.4rem; font-size: 1.05rem; line-height: 1.4rem; color: #8a8a8a; }
.dm-avatars { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.9rem; }
.dm-ava {
  display: grid; place-items: center; overflow: hidden; width: 2.3rem; height: 2.3rem; border-radius: 50%;
  background: var(--c); color: #fff; font-size: 1.1rem; font-weight: 800;
}
.dm-ava img { width: 100%; height: 100%; object-fit: cover; }
.dm-ava.is-more { background: var(--tile-bg); color: #666; font-size: 1rem; }

/* Хлебные крошки и «сохранено» */
.dm-crumbs { margin: 3.4rem 0 1.2rem 0.2rem; font-size: 1.5rem; line-height: 2rem; color: #8a8a8a; }
.dm-crumbs a { color: #8a8a8a; text-decoration: none; }
.dm-crumbs a:hover { color: var(--ink); text-decoration: underline; }
.dm-crumbs b { font-weight: 400; color: var(--ink); }
.dm-crumbs span { color: var(--ink); }
.dm-saved { margin-left: 1.2rem; font-size: 1.15rem; color: var(--olive); }
.dm-saved.is-error { color: var(--red); }
.dm-saved:empty { display: none; }
.dm-crumbs.is-side .dm-saved { display: block; margin: 0.3rem 0 0; }

/* Общие поля */
.dm-label { display: block; margin: 1.3rem 0 0.4rem 0.2rem; font-size: 1.3rem; line-height: 1.6rem; color: #8a8a8a; }
.dm-label.is-strong { margin: 0.8rem 0 0.4rem 0.2rem; font-size: 1.15rem; font-weight: 800; color: var(--ink); }
.dm-label.is-ok { color: #4f6a3f; }
.dm-label.is-bad { color: #8f4a43; }
.dm-in, .dm-ta {
  display: block; width: 100%; box-sizing: border-box; border: 0; border-radius: 0.8rem; outline: none;
  background: var(--tile-bg); color: var(--ink); font: inherit; font-size: 1.4rem;
}
.dm-in { height: 3.2rem; padding: 0 1.4rem; }
.dm-in::placeholder, .dm-ta::placeholder { color: #a5a5a5; }
.dm-in:focus, .dm-ta:focus { box-shadow: 0 0 0 0.1rem var(--ink); }
.dm-in.is-title { font-size: 1.7rem; font-weight: 800; }
.dm-ta { min-height: 3.2rem; padding: 0.7rem 1.4rem; line-height: 1.8rem; resize: none; overflow: hidden; }
.dm-ta.is-italic { font-style: italic; }
.dm-ta.is-line { margin-top: 0.6rem; }
.dm-select {
  padding-right: 3.4rem; cursor: pointer; text-overflow: ellipsis; -webkit-appearance: none; appearance: none;
  background: var(--tile-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23282826' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right 1.4rem center / 1.1rem no-repeat;
}
.dm-field { display: block; min-width: 0; }
.dm-field-head { display: flex; align-items: flex-end; justify-content: space-between; }
.dm-field-head .dm-label { margin-bottom: 0.3rem; }
.dm-field.is-dark .dm-ta { background: var(--ink); color: #fff; }
.dm-field.is-dark .dm-ta::placeholder { color: #b5b5b5; }
.dm-tb { display: inline-flex; gap: 0.3rem; }
.dm-tb button { width: 2.2rem; height: 2rem; padding: 0; border: 0; border-radius: 0.4rem; background: #d3d3d3; color: var(--ink); font: inherit; font-size: 1.2rem; cursor: pointer; }
.dm-tb button:hover { background: #c4c4c4; }
.dm-empty { margin: 0.6rem 0 0.2rem 0.2rem; font-size: 1.25rem; color: #8a8a8a; }
.dm-hint { margin: 0 0 1.2rem 0.2rem; font-size: 1.3rem; color: #8a8a8a; }
.dm-danger { padding: 0; border: 0; background: none; color: #9a4949; font: inherit; font-size: 1.25rem; cursor: pointer; }
.dm-danger:hover { text-decoration: underline; }

.dm-swatches { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0.6rem 0 0.2rem; }
.dm-swatches[hidden] { display: none; }
.dm-swatch { width: 2.4rem; height: 2.4rem; padding: 0; border: 0; border-radius: 50%; background: var(--c); cursor: pointer; }
.dm-swatch.is-on { box-shadow: 0 0 0 0.2rem var(--card-bg), 0 0 0 0.35rem var(--ink); }
.dm-swatches.is-inline .dm-swatch { background: color-mix(in srgb, var(--c) 30%, #f5f5f5); }

.dm-chip {
  display: inline-flex; align-items: center; justify-content: center; height: 2.4rem; min-width: 8.5rem; padding: 0 1.2rem; box-sizing: border-box;
  border: 0; border-radius: 0.6rem; background: var(--tile-bg); color: var(--ink); font: inherit; font-size: 1.35rem; line-height: 1;
}
.dm-chip.is-active { background: var(--c, var(--olive)); color: #fff; }
.dm-chip.is-done { background: #c5c5c5; color: #8a8a8a; }
button.dm-chip { cursor: pointer; opacity: 0.65; }
button.dm-chip.is-on { opacity: 1; box-shadow: 0 0 0 0.15rem var(--ink); }
button.dm-chip:hover { opacity: 1; }

/* Страница кампании */
.dm-campaign { display: grid; grid-template-columns: minmax(0, 61.1rem) minmax(0, 40.7rem); gap: 2.3rem; align-items: start; margin-left: -0.5rem; }
.dm-panel { box-sizing: border-box; padding: 1.6rem 1.6rem 3rem 2rem; border-radius: 2rem; background: var(--card-bg); }
.dm-colorbar { display: block; width: 100%; height: 0.9rem; padding: 0; border: 0; border-radius: 0.5rem; background: var(--c); cursor: pointer; }
.dm-colorbar:hover { filter: brightness(1.15); }
.dm-two { display: grid; grid-template-columns: 1fr 1fr; gap: 2.8rem; }
.dm-textarea { min-height: 7rem; padding: 1rem 1.4rem; }
.dm-chars { display: grid; gap: 0.5rem; }
.dm-char {
  display: flex; align-items: center; gap: 0.9rem; min-height: 4.6rem; box-sizing: border-box; padding: 0.4rem 1.2rem 0.4rem 0.8rem;
  border-radius: 0.8rem; background: var(--tile-bg); color: var(--ink); text-decoration: none;
}
.dm-char:hover { box-shadow: 0 0 0 0.1rem var(--ink); }
.dm-char-ava {
  display: grid; place-items: center; flex: none; overflow: hidden; width: 3.4rem; height: 3.4rem; border-radius: 50%;
  background: var(--c, #684a43); color: #fff; font-size: 1.4rem; font-weight: 800;
}
.dm-char-ava img { width: 100%; height: 100%; object-fit: cover; }
.dm-char-main { flex: 1; min-width: 0; }
.dm-char-main b { display: block; font-size: 1.4rem; font-weight: 800; line-height: 1.8rem; }
.dm-char-main small { display: block; font-size: 1.1rem; line-height: 1.5rem; color: #666; }
.dm-char-main small strong { color: var(--ink); }
.dm-char-count { flex: none; font-size: 1.1rem; font-weight: 800; }
.dm-panel .dm-danger { margin-top: 2.4rem; }

.dm-side-title { margin: 0.3rem 0 1.4rem; font-size: 2.2rem; font-weight: 800; line-height: 2.8rem; }
.dm-party {
  display: flex; align-items: center; gap: 1.4rem; min-height: 6.5rem; box-sizing: border-box; margin-bottom: 0.8rem; padding: 0.5rem 1.2rem 0.5rem 1.2rem;
  border-radius: 1rem; background: var(--card-bg); color: var(--ink); text-decoration: none;
}
.dm-party:hover { box-shadow: 0 0.2rem 0.8rem rgba(0, 0, 0, 0.12); }
.dm-party-num { display: grid; place-items: center; flex: none; width: 5rem; height: 5rem; border-radius: 50%; background: var(--c); color: #fff; font-size: 2.8rem; font-weight: 800; }
.dm-party-main { flex: 1; min-width: 0; }
.dm-party-main b { display: block; font-size: 1.8rem; font-weight: 800; line-height: 2.2rem; }
.dm-party-main small { display: flex; align-items: center; gap: 0.4rem; margin-top: 0.2rem; font-size: 1.3rem; color: #8a8a8a; }
.dm-party-main small .dm-emoji { width: 1.3rem; height: 1.3rem; }
.dm-add {
  display: block; width: 100%; height: 7rem; margin-top: 1rem; border: 0.1rem dashed #8a8a8a; border-radius: 1.2rem;
  background: none; color: var(--ink); font: inherit; font-size: 1.9rem; cursor: pointer;
}
.dm-add:hover { background: rgba(255, 255, 255, 0.6); }
.dm-editor-main > .dm-add { margin-top: 0; height: 5.2rem; font-size: 1.6rem; }

/* Редактор партии */
.dm-editor { display: grid; grid-template-columns: 20.6rem minmax(0, 1fr); gap: 1.6rem; align-items: start; margin: 5.4rem 0 4rem -0.5rem; }
.dm-editor-nav { position: sticky; top: 1.6rem; }
.dm-editor-nav .dm-crumbs { margin: 0; }
.dm-side-name { margin: 1.1rem 0 2.8rem; font-size: 2.2rem; font-weight: 800; line-height: 3rem; color: var(--c); overflow-wrap: anywhere; }
.dm-tabs { display: grid; gap: 0.3rem; justify-items: start; }
.dm-tab {
  display: flex; align-items: center; gap: 1rem; height: 3.1rem; padding: 0 1.3rem 0 0.9rem; border: 0; border-radius: 0.7rem;
  background: none; color: var(--ink); font: inherit; font-size: 1.7rem; line-height: 1; cursor: pointer;
}
.dm-tab .dm-emoji { width: 2.4rem; height: 2.4rem; }
.dm-tab:hover { background: rgba(0, 0, 0, 0.06); }
.dm-tab.is-on { background: var(--ink); color: #fff; }

.dm-card-panel { margin-bottom: 1.3rem; padding: 1.4rem 1.6rem 1.8rem; border-radius: 1.4rem; background: var(--card-bg); }
.dm-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.dm-panel-head h3 { margin: 0; font-size: 1.9rem; font-weight: 800; line-height: 2.6rem; }
.dm-panel-head small { font-size: 1.15rem; color: #8a8a8a; }
.dm-status-chips { display: flex; gap: 0.5rem; }
.dm-status-chips .dm-chip { min-width: 0; height: 2.3rem; padding: 0 1.1rem; font-size: 1.2rem; }
.dm-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.dm-grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.8rem; }
.dm-grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.8rem; margin-top: 0.6rem; }
.dm-grid5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.8rem; }
.dm-grid4 .dm-label { margin-top: 0.4rem; }
.dm-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.dm-tag { padding: 0.3rem 1rem; border: 0; border-radius: 0.5rem; background: var(--tile-bg); color: #555; font: inherit; font-size: 1.15rem; line-height: 1.5rem; cursor: pointer; }
.dm-tag:hover { background: #fff; }
.dm-tag.is-on { background: var(--ink); color: #fff; }
.dm-foot { display: flex; align-items: flex-end; gap: 1rem; margin-top: 1.4rem; padding-top: 1.1rem; border-top: 0.1rem solid #cfcfcf; }
.dm-foot .dm-field { flex: 1; max-width: 26rem; }
.dm-foot .dm-label { margin-top: 0; }
.dm-foot .dm-danger { margin: 0 0 0.9rem auto; }

.dm-pcs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.8rem; margin-top: 0.8rem; }
.dm-pcs .dm-empty { grid-column: 1 / -1; }
.dm-pc { position: relative; display: flex; gap: 0.8rem; min-width: 0; padding: 0.8rem 0.9rem 0.9rem 0.8rem; border-radius: 1rem; background: var(--tile-bg); }
.dm-pc-main { flex: 1; min-width: 0; }
.dm-pc-main b { display: block; padding-right: 3.6rem; font-size: 1.25rem; line-height: 1.6rem; overflow-wrap: anywhere; }
.dm-pc-main small { display: block; font-size: 1rem; line-height: 1.4rem; color: #666; }
.dm-pc-main small strong { color: var(--ink); }
.dm-pc-main em { display: flex; align-items: center; gap: 0.4rem; margin-top: 0.5rem; font-size: 1.05rem; font-style: normal; color: #8a8a8a; }
.dm-pc-main em img { width: 1.5rem; height: 1.5rem; object-fit: contain; }
.dm-pc-tools { position: absolute; top: 0.6rem; right: 0.7rem; display: flex; align-items: center; gap: 0.5rem; font-size: 1rem; }
.dm-pc-tools a { color: #8a8a8a; text-decoration: none; }
.dm-pc-tools a:hover { color: var(--ink); text-decoration: underline; }
.dm-pc-tools button { padding: 0; border: 0; background: none; color: #b0413a; font: inherit; font-size: 1.1rem; line-height: 1; cursor: pointer; }
.dm-attach-label { margin-top: 1.6rem; color: var(--ink); font-size: 1.15rem; }
.dm-attach { display: flex; gap: 0.6rem; }
.dm-attach .dm-select { flex: 1; min-width: 0; }
.dm-attach .dm-btn { height: 3.2rem; border-radius: 0.8rem; }

/* Карточки сцен, НПС, заметок */
.dm-ib {
  display: inline-grid; place-items: center; flex: none; width: 2.4rem; height: 2.4rem; padding: 0; border: 0; border-radius: 0.6rem;
  background: none; color: #555; font: inherit; font-size: 1.5rem; line-height: 1; cursor: pointer;
}
.dm-ib:hover:not(:disabled) { background: rgba(0, 0, 0, 0.08); color: var(--ink); }
.dm-ib:disabled { opacity: 0.25; cursor: default; }
.dm-ib svg { width: 1.4rem; height: 1.4rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dm-ib svg.is-up { transform: rotate(180deg); }
.dm-card-tools { display: inline-flex; flex: none; align-items: center; gap: 0.2rem; }
.dm-handle { flex: none; width: 1.6rem; color: #9a9a9a; font-size: 1.8rem; line-height: 1; text-align: center; cursor: grab; user-select: none; }
.dm-handle:hover { color: var(--ink); }
.is-dragging { opacity: 0.45; }
.is-drop-before { box-shadow: 0 -0.35rem 0 0 var(--ink); }
.is-drop-after { box-shadow: 0 0.35rem 0 0 var(--ink); }

.dm-in.is-bare { background: transparent; padding: 0 0.6rem; font-weight: 800; font-size: 1.8rem; }
.dm-in.is-bare:hover { background: rgba(255, 255, 255, 0.5); }
.dm-in.is-bare:focus { background: var(--tile-bg); }
.dm-scene-head { display: flex; align-items: center; gap: 0.9rem; }
.dm-scene-head .is-title { flex: 1; min-width: 0; }
.dm-scene-head .is-zone { flex: none; width: 24rem; text-align: right; }
.dm-num { display: grid; place-items: center; flex: none; width: 4.6rem; height: 4.6rem; border-radius: 50%; background: var(--c); color: #fff; font-size: 2.5rem; font-weight: 800; }
.dm-scene-body { margin: 0.9rem 0.4rem 0 2.6rem; }
.dm-scene { padding-bottom: 1.6rem; }

.dm-block { margin-bottom: 0.8rem; padding: 0.7rem 1rem 1rem; border-radius: 1rem; background: var(--tile-bg); }
.dm-block .dm-in, .dm-block .dm-ta { background: #fff; }
.dm-block-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 2.6rem; }
.dm-block-title { display: inline-flex; align-items: center; gap: 0.6rem; font-size: 1.1rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: #555; }
.dm-block-title i { font-style: normal; font-size: 1.2rem; }
.dm-block-tools { display: inline-flex; align-items: center; gap: 0.2rem; }
.dm-block-tools .dm-tb { margin-right: 0.8rem; }
.dm-block.is-text { background: #d3d3d3; padding-top: 0.3rem; }
.dm-block.is-text .dm-block-head .dm-label { margin: 0; font-size: 1.4rem; color: #666; }
.dm-block.is-text .dm-ta { background: var(--tile-bg); }
.dm-block.is-text .dm-tb button { background: #e6e6e6; }
.dm-block.is-highlight { background: color-mix(in srgb, var(--c) 22%, #f5f5f5); }
.dm-block.is-highlight .dm-ta { background: rgba(255, 255, 255, 0.55); }
.dm-block.is-note { background: #2b2b28; }
.dm-block.is-note .dm-block-title, .dm-block.is-note .dm-ib { color: #d8d8d4; }
.dm-block.is-note .dm-ta { background: #3a3a34; color: #fff; }
.dm-block.is-note .dm-ta::placeholder { color: #a8a8a0; }
.dm-block.is-note .dm-tb button { background: #4a4a44; color: #fff; }
.dm-block.is-quote { border-left: 0.4rem solid var(--olive); border-radius: 0.4rem 1rem 1rem 0.4rem; }
.dm-block.is-quote .is-author { width: 24rem; margin-top: 0.6rem; }
.dm-block.is-check { border: 0.15rem solid var(--olive); }
.dm-block.is-hidden { border: 0.1rem dashed #b07880; background: repeating-linear-gradient(135deg, #f7ebed 0 0.7rem, #f2e0e3 0.7rem 1.4rem); }
.dm-hidden-item { margin-top: 0.4rem; }
.dm-hidden-top { display: flex; align-items: center; gap: 0.4rem; }
.dm-hidden-top .dm-in { flex: 1; font-weight: 700; font-size: 1.3rem; background: rgba(255, 255, 255, 0.7); }
.dm-hidden-body { margin: 0.6rem 0 0.4rem 1rem; padding-left: 1rem; border-left: 0.2rem solid #c9a0a7; }
.dm-block.is-hidden .dm-block { background: rgba(255, 255, 255, 0.6); }

.dm-drop {
  position: relative; display: grid; place-items: center; width: 100%; min-height: 15rem; box-sizing: border-box;
  border: 0.1rem dashed #8a8a8a; border-radius: 1rem; background: transparent; color: var(--ink); font: inherit; font-size: 1.35rem; font-weight: 800; cursor: pointer;
}
.dm-drop:hover { background: rgba(255, 255, 255, 0.6); }
.dm-drop.has-image { display: block; min-height: 0; border-style: solid; border-color: transparent; background: none; cursor: default; }
.dm-drop.has-image img { display: block; max-width: 100%; max-height: 40rem; margin: 0 auto; border-radius: 0.8rem; }
.dm-drop-x {
  position: absolute; top: 0.6rem; right: 0.6rem; width: 2.4rem; height: 2.4rem; padding: 0; border: 0; border-radius: 50%;
  background: rgba(40, 40, 38, 0.75); color: #fff; font-size: 1.2rem; line-height: 1; cursor: pointer;
}
.dm-drop-x:hover { background: var(--red); }
.dm-palette { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.8rem; }
.dm-pill { padding: 0.35rem 1.1rem; border: 0; border-radius: 0.6rem; background: var(--tile-bg); color: var(--ink); font: inherit; font-size: 1.3rem; line-height: 1.6rem; cursor: pointer; }
.dm-pill:hover { background: #fff; }
.dm-pill.is-on { background: var(--c, var(--ink)); color: #fff; }
.dm-addblock {
  margin-top: 0.8rem; padding: 0.5rem 1.4rem; border: 0.1rem dashed #777; border-radius: 0.8rem;
  background: none; color: #666; font: inherit; font-size: 1.5rem; line-height: 1.8rem; cursor: pointer;
}
.dm-addblock:hover { background: rgba(255, 255, 255, 0.6); color: var(--ink); }
.dm-addblock.is-small { padding: 0.25rem 1rem; border-radius: 0.7rem; font-size: 1.2rem; font-weight: 700; color: var(--ink); }
.dm-npc-picks { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.4rem; }

.dm-npc { border-left: 0.6rem solid var(--c); padding-left: 1.2rem; }
.dm-npc-head { display: flex; align-items: center; gap: 0.9rem; }
.dm-dot { flex: none; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--c); }
.dm-npc-head .is-title { flex: 1; min-width: 0; }
.dm-npc-head .is-role { flex: 1; min-width: 0; text-align: center; font-weight: 400; font-size: 1.4rem; color: #777; }
.dm-npc-body { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 1.4rem; margin-top: 0.8rem; }
.dm-portrait {
  position: relative; display: grid; place-content: center; justify-items: center; gap: 0.4rem; width: 100%; aspect-ratio: 3 / 4; overflow: hidden; box-sizing: border-box;
  border: 0.1rem dashed #8a8a8a; border-radius: 1rem; background: none; color: var(--ink); font: inherit; cursor: pointer;
}
.dm-portrait span { font-size: 3rem; font-weight: 800; line-height: 1; }
.dm-portrait b { font-size: 1.15rem; }
.dm-portrait:hover { background: rgba(255, 255, 255, 0.6); }
.dm-portrait.has-image { border-style: solid; border-color: transparent; cursor: default; }
.dm-portrait.has-image img { width: 100%; height: 100%; object-fit: cover; }
.dm-npc-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.8rem; align-items: start; }
.dm-npc-fields .dm-label { margin-top: 0; }
.dm-npc-fields .dm-ta { min-height: 9rem; }

/* Статблоки */
.dm-stat-card { margin-bottom: 1.3rem; overflow: hidden; border: 0.2rem solid var(--c); border-radius: 1.6rem; background: var(--tile-bg); }
.dm-stat-head { display: flex; align-items: center; gap: 0.9rem; padding: 0.9rem 1.2rem; background: var(--c); color: #fff; }
.dm-stat-head .dm-handle, .dm-stat-head .dm-ib { color: rgba(255, 255, 255, 0.85); }
.dm-stat-head .dm-ib:hover:not(:disabled) { background: rgba(255, 255, 255, 0.18); color: #fff; }
.dm-stat-names { flex: 1; min-width: 0; display: grid; }
.dm-stat-names .dm-in { height: 2.8rem; color: #fff; }
.dm-stat-names .dm-in.is-sub { height: 2.2rem; font-size: 1.2rem; font-weight: 400; }
.dm-stat-names .dm-in::placeholder { color: rgba(255, 255, 255, 0.55); }
.dm-stat-names .dm-in:hover { background: rgba(255, 255, 255, 0.14); }
.dm-stat-names .dm-in:focus { background: rgba(255, 255, 255, 0.22); box-shadow: none; }
.dm-badge-diff { flex: none; padding: 0.3rem 1.1rem; border-radius: 1rem; background: rgba(0, 0, 0, 0.28); font-size: 1.15rem; font-weight: 800; white-space: nowrap; }
.dm-stat-body { padding: 1rem 1.6rem 1.6rem; }
.dm-stat-body .dm-in, .dm-stat-body .dm-ta { background: #fff; }
.dm-stat-body .dm-label { margin-top: 0.8rem; }
.dm-diff { display: flex; align-items: center; gap: 0.6rem; }
.dm-diff .dm-label { margin: 0 0.6rem 0 0; }
.dm-diff .dm-chip { min-width: 0; height: 2.6rem; padding: 0 1.2rem; background: #e0e0e0; cursor: pointer; opacity: 1; font-size: 1.25rem; font-weight: 700; }
.dm-diff .dm-chip.is-on { background: var(--c); color: #fff; box-shadow: none; }
.dm-stats { display: grid; grid-template-columns: repeat(6, 1fr); margin: 1.2rem 0 0.8rem; padding: 0.6rem 0 0.8rem; border-top: 0.2rem solid var(--c); border-bottom: 0.2rem solid var(--c); text-align: center; }
.dm-stat { display: grid; justify-items: center; gap: 0.3rem; }
.dm-stat .dm-label { margin: 0; }
.dm-stat .dm-in.is-num { width: 5.6rem; height: 3rem; padding: 0; text-align: center; font-weight: 800; -moz-appearance: textfield; }
.dm-stat .dm-in.is-num::-webkit-outer-spin-button, .dm-stat .dm-in.is-num::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.dm-stat small { font-size: 1.15rem; color: #555; }
.dm-actions-title { margin: 1.4rem 0 0.8rem; padding-bottom: 0.2rem; border-bottom: 0.2rem solid var(--c); font-size: 1.25rem; font-weight: 800; letter-spacing: 0.04em; color: var(--c); }
.dm-action { display: grid; grid-template-columns: 16rem minmax(0, 1fr) auto; gap: 0.6rem; align-items: start; margin-bottom: 0.6rem; }
.dm-stat-body .dm-grid3.is-main { margin-top: 0.4rem; }

/* Дневник */
.dm-note-body { margin: 0.6rem 0 0 2.5rem; }
.dm-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.dm-pills .dm-pill { opacity: 0.6; }
.dm-pills .dm-pill.is-on { opacity: 1; }

/* Просмотр партии (admin/oneshot_view.php): тот же вид, что у редактора, но без кнопок правки */
.dm-mode { margin-top: 2.6rem; }
.is-readonly .dm-ib:not([data-act="collapse"]):not([data-act="collapse-item"]),
.is-readonly .dm-tb, .is-readonly .dm-addblock, .is-readonly .dm-add, .is-readonly .dm-handle, .is-readonly .dm-drop-x,
.is-readonly .dm-palette, .is-readonly .dm-foot, .is-readonly .dm-attach, .is-readonly .dm-attach-label,
.is-readonly .dm-pc-tools button, .is-readonly .dm-swatches, .is-readonly .dm-drop:not(.has-image),
.is-readonly .dm-portrait:not(.has-image) > *, .is-readonly .dm-field:has(#dmTagInput),
.is-readonly .dm-tag:not(.is-on), .is-readonly .dm-status-chips .dm-chip:not(.is-on),
.is-readonly .dm-diff .dm-chip:not(.is-on), .is-readonly .dm-pills .dm-pill:not(.is-on) { display: none; }
.is-readonly .dm-in:focus, .is-readonly .dm-ta:focus { box-shadow: none; }
.is-readonly .dm-in, .is-readonly .dm-ta { cursor: default; }
.is-readonly .dm-in::placeholder, .is-readonly .dm-ta::placeholder { color: transparent; }
.is-readonly select:disabled { opacity: 1; color: var(--ink); -webkit-text-fill-color: var(--ink); }
.is-readonly .dm-in.is-bare:hover { background: transparent; }
.is-readonly button.dm-chip.is-on { box-shadow: none; cursor: default; }
.is-readonly .dm-tag, .is-readonly .dm-pill, .is-readonly .dm-portrait, .is-readonly .dm-drop { cursor: default; }
.is-readonly .dm-field.is-dark .dm-ta::placeholder { color: transparent; }

/* Заголовки в тексте, цвет проверок, список сцен в просмотре */
.rich-h1, .rich-h2, .rich-h3 { display: block; line-height: 1.3; }
.rich-h1 { font-size: 2.2rem; font-weight: 800; }
.rich-h2 { font-size: 1.8rem; font-weight: 800; }
.rich-h3 { font-size: 1.55rem; font-weight: 700; }
.dm-rt { min-height: 3.2rem; white-space: normal; overflow-wrap: anywhere; }
.dm-tb button { width: auto; min-width: 2.2rem; padding: 0 0.4rem; }
.dm-block.is-check { --ck: var(--olive); border: 0.2rem solid var(--ck); background: color-mix(in srgb, var(--ck) 9%, #f5f5f5); }
.dm-block.is-check [data-bind$=".skill"], .dm-block.is-check [data-bind$=".ability"] { color: color-mix(in srgb, var(--ck) 78%, #222); font-weight: 800; }
.dm-block.is-check .dm-in { background: rgba(255, 255, 255, 0.75); }
.dm-block-title i { display: none; }
.dm-spills { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.3rem; }
.dm-spill {
  display: inline-flex; align-items: center; gap: 0.6rem; max-width: 100%; height: 2.8rem; padding: 0 1.1rem 0 0.4rem; border: 0; border-radius: 1.4rem;
  background: var(--card-bg); color: var(--ink); font: inherit; font-size: 1.25rem; font-weight: 700; cursor: pointer;
}
.dm-spill b { display: grid; place-items: center; flex: none; width: 2rem; height: 2rem; border-radius: 50%; background: var(--c); color: #fff; font-size: 1.15rem; }
.dm-spill span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-spill:hover { filter: brightness(0.96); }
.dm-spill.is-on { background: var(--ink); color: #fff; }
.is-readonly .dm-hidden-top, .is-readonly .dm-hidden-top .dm-in { cursor: pointer; }
.is-readonly .dm-hidden-body .dm-empty { display: none; }
.is-readonly .dm-in.is-bare { padding-left: 0; }

/* Скрытый блок без полосок, переход, НПС и статблоки плашками, окна */
.dm-block.is-hidden { border: 0.1rem dashed #b9b9b9; background: var(--tile-bg); }
.dm-block.is-hidden.is-view { border: 0; background: none; padding: 0; }
.dm-hpills { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.dm-hpill {
  max-width: 100%; padding: 0.7rem 1.5rem; border: 0; border-radius: 1.2rem; background: #fff; color: var(--ink);
  font: inherit; font-size: 1.45rem; font-weight: 800; line-height: 1.8rem; cursor: pointer;
}
.dm-hpill:hover { background: #f0f0f0; }
.dm-hpill.is-on { background: var(--ink); color: #fff; }
.dm-hidden-view { margin-top: 0.8rem; padding: 0.8rem 0.8rem 0.1rem; border-radius: 1.2rem; background: rgba(255, 255, 255, 0.55); }
.dm-block.is-link { padding: 0; background: none; }
.dm-golink {
  display: inline-flex; align-items: center; padding: 0.6rem 1.4rem; border: 0; border-radius: 1.2rem; background: var(--ink); color: #fff;
  font: inherit; font-size: 1.4rem; font-weight: 700; cursor: pointer;
}
.dm-golink:hover { filter: brightness(1.25); }
.dm-block.is-npcs { padding: 0; background: none; }
.dm-npcrow { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.dm-npcchip {
  max-width: 100%; padding: 0.55rem 1.5rem; border: 0; border-radius: 3rem; background: var(--c); color: #fff;
  font: inherit; font-size: 1.5rem; font-weight: 700; line-height: 1.9rem; cursor: pointer;
}
.dm-npcchip:hover { filter: brightness(1.1); }
.dm-npcchip-ava, .dm-npcw-ava {
  display: grid; place-items: center; flex: none; overflow: hidden; width: 3.4rem; height: 3.4rem; border-radius: 50%;
  background: var(--c); color: #fff; font-size: 1.5rem; font-weight: 800;
}
.dm-npcchip-ava img, .dm-npcw-ava img { width: 100%; height: 100%; object-fit: cover; }
.dm-colorpick { display: block; width: 100%; height: 3.4rem; padding: 0.2rem; box-sizing: border-box; border: 0; border-radius: 0.8rem; background: var(--tile-bg); cursor: pointer; }

.dm-wgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(25rem, 1fr)); gap: 1rem; }
.dm-npcw, .dm-statw {
  display: flex; align-items: center; gap: 1.1rem; min-width: 0; padding: 1rem 1.3rem 1rem 1rem; border: 0; border-left: 0.6rem solid var(--c);
  border-radius: 1.2rem; background: var(--card-bg); color: var(--ink); font: inherit; text-align: left; cursor: pointer;
}
.dm-npcw:hover, .dm-statw:hover { box-shadow: 0 0.2rem 0.8rem rgba(0, 0, 0, 0.12); }
.dm-npcw-ava { width: 4.8rem; height: 4.8rem; font-size: 2rem; }
.dm-npcw-text { min-width: 0; }
.dm-npcw-text b, .dm-statw b { display: block; font-size: 1.6rem; font-weight: 800; line-height: 2rem; overflow-wrap: anywhere; }
.dm-npcw-text small, .dm-statw small { display: block; margin-top: 0.2rem; font-size: 1.2rem; line-height: 1.5rem; color: #666; }
.dm-statw { display: block; }
.dm-statw span { display: block; margin-top: 0.6rem; font-size: 1.2rem; font-weight: 800; color: var(--c); }

.dm-modal { position: fixed; inset: 0; z-index: 70; display: grid; place-items: start center; overflow-y: auto; padding: 4rem 2rem; box-sizing: border-box; background: rgba(40, 40, 38, 0.5); }
.dm-modal[hidden] { display: none; }
.dm-modal-card { position: relative; width: min(84rem, 100%); box-sizing: border-box; padding: 2.4rem; border-radius: 2rem; background: #f5f5f5; }
.dm-modal-card.is-stat { width: min(115rem, 100%); padding: 0; border-radius: 2.4rem; background: none; }
.dm-modal-x {
  position: absolute; top: 1.2rem; right: 1.2rem; z-index: 2; width: 3.2rem; height: 3.2rem; padding: 0; border: 0; border-radius: 50%;
  background: rgba(40, 40, 38, 0.8); color: #fff; font-size: 1.4rem; line-height: 1; cursor: pointer;
}
.dm-modal-x:hover { background: var(--red); }
.dm-modal .dm-ib { display: none; }
.dm-dossier-head { display: flex; align-items: center; gap: 2rem; padding-right: 4rem; }
.dm-dossier-photo {
  display: grid; place-items: center; flex: none; overflow: hidden; width: 15rem; aspect-ratio: 3 / 4; border-radius: 1.4rem;
  background: var(--c); color: #fff; font-size: 5rem; font-weight: 800;
}
.dm-dossier-photo img { width: 100%; height: 100%; object-fit: cover; }
.dm-dossier-title h2 { margin: 0; font-size: 3.2rem; font-weight: 800; line-height: 3.8rem; }
.dm-dossier-title p { margin: 0.4rem 0 0; font-size: 1.8rem; color: #666; }
.dm-dossier-body h4 { margin: 2.2rem 0 0.6rem; font-size: 1.3rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: #8a8a8a; }
.dm-prose { margin: 0; font-size: 1.6rem; line-height: 2.3rem; }
ul.dm-prose { padding-left: 2rem; }
.dm-quote { margin: 2.4rem 0 0; padding: 0.4rem 0 0.4rem 1.6rem; border-left: 0.4rem solid var(--c); font-size: 1.7rem; font-style: italic; line-height: 2.4rem; }
.dm-modal .dm-stat-card { margin: 0; }
.dm-modal .dm-stat-head { padding-right: 5.4rem; }

/* Просмотр партии: блоки сцены для чтения (макет «просмотр партии») */
.dm-rscene { padding: 1.4rem 1.8rem 2.2rem; border-radius: 1.6rem; background: var(--card-bg); }
.dm-rscene-head { display: flex; align-items: center; gap: 1.4rem; margin-bottom: 1.6rem; }
.dm-rscene-head h3 { flex: 1; min-width: 0; margin: 0; font-size: 2rem; font-weight: 800; line-height: 2.6rem; overflow-wrap: anywhere; }
.dm-rscene-zone { flex: none; max-width: 40%; font-size: 1.6rem; font-weight: 800; text-align: right; }
.dm-r-stack { display: flex; flex-direction: column; gap: 1.2rem; }
.dm-r { box-sizing: border-box; font-size: 1.6rem; line-height: 2.3rem; overflow-wrap: anywhere; }
.dm-r-text, .dm-r-quote, .dm-r-out { text-align: justify; }
.dm-r-text { padding: 1rem 1.4rem; border-radius: 1.2rem; background: #f5f5f5; }
.dm-r-hl { padding: 1.4rem; border: 0.2rem solid var(--c); border-radius: 1.2rem; background: color-mix(in srgb, var(--c) 24%, #f5f5f5); text-align: justify; }
.dm-r-note { padding: 1.2rem 1.4rem; border-radius: 1.2rem; background: #282826; color: #f0f0ee; font-style: italic; text-align: justify; }
.dm-r-quote { margin: 0; padding: 1.2rem 1.4rem 1.2rem 2.8rem; border: 0.1rem dashed var(--olive); border-left: 1.4rem solid var(--olive); border-radius: 1.2rem; background: #f5f5f5; font-style: italic; }
.dm-r-quote cite { display: block; margin-top: 0.6rem; font-size: 1.4rem; text-align: right; color: #666; }
.dm-r-check { padding: 1.2rem 1.4rem 1.4rem; border: 0.2rem solid var(--ck); border-radius: 1.2rem; background: color-mix(in srgb, var(--ck) 22%, #f5f5f5); }
.dm-r-check-head { display: flex; align-items: center; gap: 1.2rem; margin-bottom: 1rem; }
.dm-r-check-head b { font-size: 1.7rem; font-weight: 800; color: color-mix(in srgb, var(--ck) 82%, #3a2a10); }
.dm-r-check-head span { padding: 0 1.1rem; border: 0.1rem solid var(--ck); border-radius: 1.4rem; background: #f5f5f5; font-size: 1.5rem; line-height: 2.4rem; }
.dm-r-out { margin-top: 0.8rem; padding: 0.8rem 1.4rem 1rem; border-radius: 1rem; background: #f5f5f5; }
.dm-r-check-head + .dm-r-out { margin-top: 0; }
.dm-r-out b { display: block; font-size: 1.4rem; font-weight: 800; color: color-mix(in srgb, var(--ck) 82%, #3a2a10); }
.dm-r-out b.is-ok { color: var(--olive); }
.dm-r-out b.is-bad { color: #9c5049; }
.dm-r-go {
  display: block; width: 100%; padding: 1.1rem 1.4rem; border: 0; border-radius: 1.2rem; background: #282826; color: #fff;
  font: inherit; font-size: 1.8rem; font-weight: 800; text-align: left; cursor: pointer;
}
.dm-r-go:hover { background: #3a3a36; }
.dm-r-npcs { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.dm-r-map, .dm-r-image { margin: 0; text-align: center; }
.dm-r-map img { display: block; width: 100%; box-sizing: border-box; padding: 0.5rem; border-radius: 1.4rem; background: #fff; box-shadow: 0 0.2rem 0.8rem rgba(0, 0, 0, 0.12); }
.dm-r-image img { display: block; max-width: min(100%, 48rem); max-height: 44rem; margin: 0.4rem auto; }
.dm-r-map figcaption, .dm-r-image figcaption { margin-top: 0.6rem; font-size: 1.4rem; color: #666; }
.dm-r-hidden .dm-hpills { margin-bottom: 0; }
.dm-r-hidden .dm-r-stack { margin-top: 1.2rem; }
.dm-hpill { padding: 0.4rem 1.6rem; border: 0.15rem solid var(--ink); border-radius: 2rem; background: #f5f5f5; font-size: 1.5rem; line-height: 2rem; font-weight: 800; }
.dm-hpill:hover { background: #fff; }
.dm-hpill.is-on { background: var(--ink); color: #fff; }

/* Статблок в окне (макет «статблок») */
.dm-sv { overflow: hidden; border: 0.2rem solid var(--c); border-radius: 2.4rem; background: #e6e6e6; }
.dm-sv-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 2rem; padding: 2rem 8rem 1.8rem 2rem; background: var(--c); color: #fff; }
.dm-sv-title h2 { margin: 0; font-size: 3.6rem; font-weight: 800; line-height: 4.4rem; overflow-wrap: anywhere; }
.dm-sv-title p { margin: 0.4rem 0 0; font-size: 2.2rem; line-height: 2.8rem; }
.dm-sv-meta { display: flex; flex: none; align-items: center; gap: 2.4rem; padding-top: 0.8rem; font-size: 2rem; font-weight: 700; white-space: nowrap; }
.dm-sv-badge { padding: 0.3rem 2.4rem; border-radius: 2rem; background: rgba(255, 255, 255, 0.28); font-size: 1.9rem; }
.dm-sv-body { padding: 2rem 5.5rem 4rem; }
.dm-sv-boxes { display: flex; flex-wrap: wrap; gap: 1rem; padding-bottom: 2.6rem; border-bottom: 0.2rem solid var(--c); }
.dm-sv-box { min-width: 14.2rem; box-sizing: border-box; padding: 0.8rem 1.2rem 0.6rem; border: 0.2rem solid var(--c); border-radius: 1.2rem; }
.dm-sv-box small { display: block; font-size: 1.4rem; font-weight: 800; line-height: 1.8rem; color: var(--c); }
.dm-sv-box b { display: block; font-size: 2.4rem; font-weight: 800; line-height: 3rem; color: var(--c); overflow-wrap: anywhere; }
.dm-sv-abil { display: grid; grid-template-columns: 21rem repeat(6, 7.8rem); gap: 0.4rem 1.9rem; align-items: center; justify-content: start; padding: 1rem 0; border-bottom: 0.2rem solid var(--c); text-align: center; }
.dm-sv-name { font-size: 2.4rem; font-weight: 800; line-height: 3rem; }
.dm-sv-mod { padding: 0.3rem 0; border-radius: 0.8rem; background: #f5f5f5; font-size: 2.4rem; font-weight: 800; color: var(--c); }
.dm-sv-rowlabel { text-align: right; font-size: 1.6rem; color: #b0b0b0; }
.dm-sv-save { font-size: 1.6rem; color: #b0b0b0; }
.dm-sv-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.8rem; align-items: start; margin-top: 1.4rem; }
.dm-sv-field h4 { margin: 0 0 0.6rem; font-size: 1.6rem; font-weight: 800; line-height: 2rem; }
.dm-sv-val { min-height: 2.9rem; margin-bottom: 1.2rem; padding: 0.4rem 1.1rem; border-radius: 0.8rem; background: #f5f5f5; font-size: 1.3rem; line-height: 2.1rem; overflow-wrap: anywhere; }
.dm-sv-title-act { margin: 1.6rem 0 0; padding-bottom: 0.2rem; border-bottom: 0.2rem solid var(--c); font-size: 2.2rem; font-weight: 800; line-height: 2.8rem; color: var(--c); }
.dm-sv-actions { margin-top: 1.2rem; font-size: 1.6rem; line-height: 2.5rem; }
.dm-sv-actions p { margin: 0; }
.dm-stat .dm-in.is-sv { width: 5.6rem; height: 2.2rem; padding: 0; text-align: center; font-size: 1.15rem; }
.dm-stat-body .dm-grid4.is-main { margin-top: 0.4rem; }
.dm-outcomes { margin-top: 0.4rem; }
.dm-outcome { display: grid; grid-template-columns: 14rem minmax(0, 1fr) auto; gap: 0.6rem; align-items: start; margin-top: 0.5rem; }
.dm-outcome .dm-in.is-range { font-weight: 800; }

/* Дневник мастера: готовые заметки читаются, правятся по кнопке */
.dm-add-top { margin-bottom: 1rem; }
.dm-note.is-saved { border-left: 0.6rem solid var(--c); padding-left: 1.4rem; }
.dm-note-top { display: flex; align-items: center; gap: 1rem; }
.dm-note-top h3 { flex: 1; min-width: 0; margin: 0; font-size: 1.8rem; font-weight: 800; line-height: 2.4rem; overflow-wrap: anywhere; }
.dm-note-level { flex: none; padding: 0.2rem 1.1rem; border-radius: 1.2rem; background: var(--c); color: #fff; font-size: 1.2rem; font-weight: 800; }
.dm-note-actions { display: inline-flex; flex: none; align-items: center; gap: 0.4rem; }
.dm-note-actions .dm-btn { height: 2.8rem; padding: 0 1.2rem; font-size: 1.3rem; }
.dm-note-text { margin-top: 0.8rem; font-size: 1.6rem; line-height: 2.3rem; overflow-wrap: anywhere; }
.dm-note.is-editing .dm-btn.is-dark { height: 2.8rem; padding: 0 1.4rem; font-size: 1.3rem; }

/* ============ 15. Стол мастера (админ) ============ */
/* Размеры сняты с макетов «стол мастера …» (1280 px); мелкий текст макета чуть увеличен. */
.dk-btn {
  display: inline-flex; align-items: center; justify-content: center; flex: none; height: 3rem; padding: 0 1.3rem; box-sizing: border-box;
  border: 0.1rem solid transparent; border-radius: 0.9rem; font: inherit; font-size: 1.3rem; font-weight: 700; line-height: 1; white-space: nowrap; cursor: pointer;
}
.dk-btn.is-dark { background: var(--ink); color: #fff; }
.dk-btn.is-dark:hover { filter: brightness(1.3); }
.dk-btn.is-gray { background: #8a8a86; color: #fff; }
.dk-btn.is-olive { background: var(--olive); color: #fff; }
.dk-btn.is-red, .dk-btn.is-line-red { border-color: #9c5049; background: transparent; color: #9c5049; }
.dk-btn.is-gray:hover, .dk-btn.is-olive:hover { filter: brightness(1.12); }
.dk-btn.is-red:hover, .dk-btn.is-line-red:hover { background: #9c5049; color: #fff; }
.dk-hint { margin: 0; padding: 0.6rem 0.8rem; font-size: 1.3rem; line-height: 1.8rem; color: #8a8a8a; }

/* Список партий */
.dk-pick { margin: 3.4rem 0 1.8rem 0.2rem; font-size: 1.8rem; font-weight: 800; line-height: 2.4rem; }
.dk-cards { margin-left: -0.5rem; }
.dk-card { min-height: 0; }
.dk-card .dm-card-top b { font-size: 1.8rem; line-height: 2.2rem; }
.dk-date { display: inline-flex; flex: none; align-items: center; gap: 0.4rem; padding-top: 0.5rem; font-size: 1.1rem; font-weight: 700; white-space: nowrap; }
.dk-date .dm-emoji { width: 1.4rem; height: 1.4rem; }
.dk-card .dm-world { margin-top: 0.3rem; }
.dk-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; margin-top: 0.9rem; }
.dk-card-foot .dm-avatars { margin-top: 0; flex-wrap: nowrap; }
.dk-card-foot .dk-btn { height: 2.6rem; padding: 0 1.2rem; font-size: 1.2rem; }

/* Экран ведения партии: без бокового меню, как лист персонажа */
.page-desk { background: var(--page-bg); }
.page-desk .site-main { position: relative; min-height: 100vh; padding: 0 1.6rem 3.2rem 2.2rem; }
.page-desk .site-main::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 23rem;
  background: url('/assets/img/ui/window-bg.webp') center top / 100% auto no-repeat;
  -webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent); mask-image: linear-gradient(to bottom, #000 30%, transparent);
  pointer-events: none;
}
.page-desk .dk { position: relative; }
.dk-head { margin: 0; padding: 5.7rem 0 0 1.8rem; }
.dk-head .dashboard-title { display: inline-flex; color: var(--ink); text-decoration: none; }
.dk-head .dashboard-title .icon { width: 3rem; height: 3rem; }
.dk-head .dashboard-title:hover { opacity: 0.7; }
.dk-head .dashboard-quote { margin-top: 0.2rem; }
.dk-head .dm-saved { margin-left: 1.4rem; }

.dk-top { display: flex; align-items: center; flex-wrap: wrap; gap: 0.8rem 2rem; margin-top: 6.6rem; }
.dk-crumbs { font-size: 1.6rem; line-height: 2.2rem; color: #6f6f6f; }
.dk-crumbs b { font-weight: 700; color: var(--ink); }
.dk-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.dk-pills .dm-spill b { background: var(--olive); }
.dk-pills .dm-spill.is-on { background: var(--ink); }
.dk-cols { display: flex; align-items: flex-start; gap: 1.7rem; margin-top: 1.4rem; }

/* Чарлисты партии слева */
.dk-side { flex: none; width: 20.3rem; box-sizing: border-box; padding: 0.9rem 0.8rem 0.8rem; border-radius: 1.2rem; background: var(--card-bg); }
.dk-side h3 { margin: 0 0 0.8rem 0.4rem; font-size: 1.7rem; font-weight: 800; line-height: 2.2rem; }
.dk-pc {
  display: flex; align-items: center; gap: 0.8rem; margin-top: 0.6rem; padding: 0.6rem 0.9rem 0.6rem 0.6rem; border-radius: 1.2rem;
  background: var(--tile-bg); color: var(--ink); text-decoration: none;
}
.dk-pc:hover { background: #fff; }
.dk-ava {
  display: grid; place-items: center; flex: none; overflow: hidden; width: 3.6rem; height: 3.6rem; border-radius: 50%;
  background: var(--c); color: #fff; font-size: 1.5rem; font-weight: 800;
}
.dk-ava img { width: 100%; height: 100%; object-fit: cover; }
.dk-pc-main { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 0.2rem; }
.dk-pc-main b { overflow: hidden; font-size: 1.3rem; line-height: 1.6rem; text-overflow: ellipsis; white-space: nowrap; }
.dk-pc-main small { overflow: hidden; font-size: 1rem; line-height: 1.2rem; color: #666; text-overflow: ellipsis; white-space: nowrap; }
.dk-bar { display: block; height: 0.4rem; overflow: hidden; border-radius: 0.2rem; background: #cfcfcf; }
.dk-bar u { display: block; height: 100%; border-radius: 0.2rem; background: #6b4c44; text-decoration: none; }
.dk-pc em { align-self: flex-end; flex: none; font-size: 1.1rem; font-style: normal; font-weight: 600; }

/* Сцена */
.dk-main { flex: 1; min-width: 0; }
.dk-scene { padding: 0.9rem 1.2rem 1.9rem; border-radius: 1.4rem; background: var(--card-bg); }
.dk-scene-head, .dk-map-head { display: flex; align-items: flex-end; gap: 1.2rem; margin-bottom: 1.2rem; }
.dk-scene-head .dm-num, .dk-map-head .dm-num { width: 4.5rem; height: 4.5rem; font-size: 2.5rem; }
.dk-scene-title { flex: 1; min-width: 0; align-self: center; }
.dk-scene-title h2 { margin: 0; font-size: 2.1rem; font-weight: 800; line-height: 2.6rem; overflow-wrap: anywhere; }
.dk-scene-title p { margin: 0.1rem 0 0; font-size: 1.3rem; line-height: 1.6rem; color: #444; }
.dk-scene-body { display: grid; grid-template-columns: minmax(0, 38fr) minmax(0, 62fr); gap: 1.4rem; }
/* Слева листается содержимое сцены: его высоту задаёт правая колонка (карта, НПС, бой), поэтому она остаётся на месте. */
.dk-scene-text { position: relative; min-height: 38rem; }
.dk-scroll { position: absolute; inset: 0; overflow-y: auto; padding-right: 0.4rem; scrollbar-width: thin; scrollbar-color: #b5b5b5 transparent; }
/* Содержимое сцены слева — мельче, чем в просмотре партии */
.dk-scroll { gap: 0.9rem; }
.dk-scroll .dm-r { font-size: 1.2rem; line-height: 1.75rem; }
.dk-scroll .dm-r-text { padding: 0.8rem 1.1rem; }
.dk-scroll .dm-r-hl, .dk-scroll .dm-r-note { padding: 0.9rem 1.1rem; }
.dk-scroll .dm-r-quote { padding: 0.9rem 1.1rem 0.9rem 2.2rem; border-left-width: 1rem; }
.dk-scroll .dm-r-quote cite { font-size: 1.1rem; }
.dk-scroll .dm-r-check { padding: 0.9rem 1.1rem 1.1rem; }
.dk-scroll .dm-r-check-head b { font-size: 1.35rem; }
.dk-scroll .dm-r-check-head span { font-size: 1.15rem; line-height: 2rem; }
.dk-scroll .dm-r-out { padding: 0.6rem 1.1rem 0.8rem; }
.dk-scroll .dm-r-out b { font-size: 1.1rem; }
.dk-scroll .dm-r-go { padding: 0.8rem 1.1rem; font-size: 1.35rem; }
.dk-scroll .dm-hpill { padding: 0.3rem 1.2rem; font-size: 1.2rem; line-height: 1.6rem; }
.dk-scroll .rich-h1 { font-size: 1.8rem; }
.dk-scroll .rich-h2 { font-size: 1.5rem; }
.dk-scroll .rich-h3 { font-size: 1.3rem; }
.dk-scroll .dm-r-image figcaption, .dk-scroll .dm-r-map figcaption { font-size: 1.1rem; }
.dk-scene-side { display: flex; flex-direction: column; gap: 1.1rem; min-width: 0; }
.dk-pic { margin: 0; }
.dk-pic img { display: block; width: 100%; box-sizing: border-box; padding: 0.4rem; border-radius: 1.4rem; background: #fff; box-shadow: 0 0.2rem 0.8rem rgba(0, 0, 0, 0.12); }
.dk-pic figcaption { margin-top: 0.5rem; font-size: 1.3rem; text-align: center; color: #666; }

/* Бой */
.dk-combat { margin-top: 0.4rem; padding: 1rem 1rem 1.1rem; border-radius: 1.2rem; background: rgba(255, 255, 255, 0.5); }
.dk-combat.is-idle { display: flex; align-items: center; gap: 1rem; padding: 0.8rem 1.4rem 0.8rem 0.8rem; }
.dk-swords { flex: none; width: 5.6rem; height: 5.6rem; object-fit: contain; }
.dk-combat-text { flex: 1; min-width: 0; }
.dk-combat-text b { font-size: 1.8rem; font-weight: 800; line-height: 2.3rem; }
.dk-combat-text p { margin: 0.2rem 0 0; font-size: 1.4rem; line-height: 1.9rem; }
.dk-combat.is-idle .dk-btn { height: 3.2rem; padding: 0 1.8rem; font-size: 1.4rem; }
.dk-combat-head { display: flex; align-items: center; flex-wrap: wrap; gap: 0.8rem 1rem; }
.dk-combat-head .dk-swords { width: 4.4rem; height: 4.4rem; margin-left: -0.4rem; }
.dk-combat-head h3 { margin: 0; font-size: 2rem; font-weight: 800; line-height: 2.6rem; }
.dk-round { padding: 0 1.4rem; border-radius: 1.3rem; background: var(--olive); color: #fff; font-size: 1.4rem; font-weight: 800; line-height: 2.6rem; }
.dk-combat-buttons { display: inline-flex; flex-wrap: wrap; gap: 0.5rem; margin-left: auto; }
.dk-combat-buttons .dk-btn { height: 2.8rem; padding: 0 1rem; font-size: 1.2rem; }
.dk-add { display: flex; align-items: center; gap: 1rem; margin: 1.2rem 0 1rem 0.2rem; }
.dk-add span { font-size: 1.25rem; font-weight: 700; line-height: 1.5rem; }
.dk-add select {
  flex: none; width: 18rem; height: 3rem; padding: 0 0.8rem; box-sizing: border-box; border: 0; border-radius: 0.8rem; background: var(--tile-bg);
  font: inherit; font-size: 1.4rem; color: var(--ink);
}
.dk-rows { display: flex; flex-direction: column; gap: 0.5rem; }
.dk-row {
  display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem 0.8rem 0.6rem 0.8rem; box-sizing: border-box; border: 0.1rem solid #8d8d6a; border-radius: 1.2rem;
  background: #c3c3b0; --bar: #6b4c44; --chip: #6b4c44;
}
.dk-row.is-foe { border-color: #a46a66; background: #d3b5b5; --bar: #526e78; --chip: #526e78; }
.dk-row.is-turn { box-shadow: 0 0 0 0.3rem var(--ink); }
.dk-row.is-down { opacity: 0.55; }
.dk-row.is-down .dk-name b { text-decoration: line-through; }
.dk-init, .dk-amt {
  flex: none; width: 4.2rem; height: 2.8rem; box-sizing: border-box; padding: 0 0.2rem; border: 0; border-radius: 0.7rem; background: #fff;
  font: inherit; font-size: 1.4rem; text-align: center; color: var(--ink);
}
.dk-init:focus, .dk-amt:focus, .dk-hpnow:focus, .dk-hpmax:focus { outline: 0.2rem solid var(--olive); }
.dk-die { flex: none; width: 2.6rem; height: 2.6rem; padding: 0; border: 0; background: none; cursor: pointer; }
.dk-die img { display: block; width: 100%; height: 100%; object-fit: contain; transition: transform 0.25s; }
.dk-die:hover img { transform: rotate(60deg) scale(1.1); }
.dk-row .dk-ava { width: 3.4rem; height: 3.4rem; font-size: 1.4rem; }
.dk-name { display: flex; flex: 1; min-width: 0; flex-direction: column; align-items: flex-start; gap: 0.2rem; padding: 0; border: 0; background: none; font: inherit; color: var(--ink); text-align: left; text-decoration: none; cursor: pointer; }
.dk-name b { max-width: 100%; overflow: hidden; font-size: 1.4rem; line-height: 1.8rem; text-overflow: ellipsis; white-space: nowrap; }
.dk-name small { max-width: 100%; overflow: hidden; font-size: 1.1rem; line-height: 1.3rem; color: #555; text-overflow: ellipsis; white-space: nowrap; }
.dk-name:hover b { text-decoration: underline; }
.dk-ac { flex: none; padding: 0 0.8rem; border-radius: 0.7rem; background: var(--chip); color: #fff; font-size: 1.2rem; font-weight: 800; line-height: 2.4rem; white-space: nowrap; }
.dk-hp { flex: none; width: 10.4rem; }
.dk-hp-nums { display: flex; align-items: baseline; gap: 0.2rem; margin-bottom: 0.3rem; font-size: 1.3rem; }
.dk-hp-nums em { font-style: normal; color: #555; }
.dk-hp-nums > span { color: #555; }
.dk-hpnow, .dk-hpmax { width: 3.6rem; height: 2.2rem; padding: 0 0.3rem; box-sizing: border-box; border: 0; border-radius: 0.5rem; background: transparent; font: inherit; font-size: 1.5rem; font-weight: 700; color: var(--ink); }
.dk-hpmax { width: 3.8rem; font-weight: 500; font-size: 1.3rem; color: #555; }
.dk-hpnow:hover, .dk-hpmax:hover { background: rgba(255, 255, 255, 0.6); }
.dk-hp .dk-bar { height: 0.6rem; background: rgba(255, 255, 255, 0.55); }
.dk-hp .dk-bar u { background: var(--bar); }
.dk-minus, .dk-plus {
  flex: none; width: 2.6rem; height: 2.6rem; padding: 0; border: 0; border-radius: 0.6rem; color: #fff;
  font: inherit; font-size: 1.9rem; font-weight: 800; line-height: 2.4rem; cursor: pointer;
}
.dk-minus { background: #9c4a45; }
.dk-plus { background: var(--olive); }
.dk-minus:hover, .dk-plus:hover { filter: brightness(1.15); }
.dk-x { flex: none; width: 2.2rem; height: 2.6rem; padding: 0; border: 0; background: none; color: #9c4a45; font-size: 2rem; line-height: 1; cursor: pointer; }
.dk-x:hover { color: var(--red); }

/* Карта на весь экран */
.dk-map { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; background: var(--page-bg); }
.dk-map[hidden] { display: none; }
.dk-map-head { flex: none; align-items: center; margin: 0; padding: 1.4rem 1.5rem; border-bottom: 0.1rem solid #9a9a9a; background: var(--card-bg); }
.dk-map-scenes { display: flex; gap: 0.6rem; }
.dk-map-scenes button {
  min-width: 3.2rem; height: 3rem; padding: 0 0.6rem; box-sizing: border-box; border: 0; border-radius: 0.8rem; background: var(--tile-bg);
  font: inherit; font-size: 1.4rem; font-weight: 800; color: var(--ink); cursor: pointer;
}
.dk-map-scenes button:hover { background: #fff; }
.dk-map-scenes button.is-on { background: var(--olive); color: #fff; }
.dk-map-head .dk-btn { height: 3.4rem; padding: 0 1.6rem; font-size: 1.4rem; }
.dk-map-body { display: flex; flex: 1; min-height: 0; align-items: flex-start; gap: 1.2rem; padding: 1.2rem; }
.dk-map-area { flex: 1; min-width: 0; height: 100%; overflow: auto; }
.dk-mapbox { position: relative; display: inline-block; max-width: 100%; vertical-align: top; touch-action: none; }
.dk-mapbox img { display: block; width: auto; height: auto; max-width: 100%; max-height: calc(100vh - 12.6rem); border: 0.4rem solid #9a9a9a; border-radius: 1.8rem; box-sizing: border-box; user-select: none; }
.dk-token {
  position: absolute; display: grid; place-items: center; width: 6.2%; min-width: 3.6rem; aspect-ratio: 1; box-sizing: border-box; overflow: hidden;
  transform: translate(-50%, -50%); border: 0.3rem solid #fff; border-radius: 50%; background: var(--c); color: #fff;
  font-size: 1.8rem; font-weight: 800; box-shadow: 0 0.2rem 0.8rem rgba(0, 0, 0, 0.5); cursor: grab; user-select: none;
}
.dk-token img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.dk-token.is-npc { border-color: var(--c); }
.dk-token.is-foe { border-color: #c24a3d; }
.dk-token.is-drag { z-index: 2; cursor: grabbing; box-shadow: 0 0.6rem 1.6rem rgba(0, 0, 0, 0.55); }
.dk-map-side { display: flex; flex: none; flex-direction: column; gap: 1rem; width: 21.6rem; max-height: 100%; overflow-y: auto; }
.dk-mpanel { padding: 0.9rem 0.8rem 0.8rem; border-radius: 1.2rem; background: var(--card-bg); }
.dk-mpanel.is-chars { background: #dcdccf; }
.dk-mpanel.is-foes { background: #e5d4d4; }
.dk-mpanel h3 { margin: 0 0 0.6rem 0.4rem; font-size: 1.7rem; font-weight: 800; line-height: 2.2rem; }
.dk-mrow { display: flex; align-items: center; gap: 0.7rem; margin-top: 0.5rem; padding: 0.5rem 0.9rem 0.5rem 0.5rem; border-radius: 1rem; background: var(--tile-bg); }
.dk-mrow .dk-ava { width: 2.8rem; height: 2.8rem; font-size: 1.2rem; }
.dk-mname { flex: 1; min-width: 0; overflow: hidden; font-size: 1.3rem; line-height: 1.6rem; text-overflow: ellipsis; white-space: nowrap; }
.dk-mrow small { flex: none; font-size: 1rem; color: #8a8a8a; }
.dk-madd, .dk-mdel { flex: none; width: 2.4rem; height: 2.4rem; padding: 0; border: 0; border-radius: 50%; background: none; font: inherit; line-height: 1; cursor: pointer; }
.dk-madd { font-size: 2rem; color: var(--ink); }
.dk-madd:hover { background: var(--ink); color: #fff; }
.dk-mdel { font-size: 1.5rem; color: #9c4a45; }
.dk-mdel:hover { color: var(--red); }

/* Кнопки шапки экрана ведения: пауза, закончить партию, закрыть */
.dk-head { position: relative; }
.dk-head-buttons { position: absolute; top: 5.9rem; right: 0.2rem; display: flex; align-items: center; gap: 0.7rem; }
.dk-head-buttons .dk-btn { height: 3.4rem; padding: 0 1.5rem; font-size: 1.35rem; }
.dk-hbtn {
  display: grid; place-items: center; width: 3.4rem; height: 3.4rem; padding: 0; box-sizing: border-box; border: 0; border-radius: 1rem;
  background: var(--card-bg); color: var(--ink); font: inherit; font-size: 1.6rem; line-height: 1; cursor: pointer;
}
.dk-hbtn:hover { background: var(--ink); color: #fff; }
.dk-hbtn svg { width: 1.8rem; height: 1.8rem; fill: currentColor; }
.dk-paused { margin-left: 0.8rem; padding: 0 0.8rem; border-radius: 0.8rem; background: var(--ink); color: #fff; font-size: 1rem; font-weight: 800; line-height: 1.6rem; }

/* Партия на паузе */
.dk-pause { position: fixed; inset: 0; z-index: 65; display: grid; place-items: center; background: rgba(40, 40, 38, 0.6); }
.dk-pause[hidden] { display: none; }
.dk-pause-card { width: min(46rem, calc(100% - 4rem)); box-sizing: border-box; padding: 3rem 3rem 2.8rem; border-radius: 2rem; background: var(--page-bg); text-align: center; }
.dk-pause-mark { display: inline-flex; gap: 0.9rem; margin-bottom: 1.2rem; }
.dk-pause-mark i { display: block; width: 1.4rem; height: 4.4rem; border-radius: 0.5rem; background: var(--ink); }
.dk-pause-card h2 { margin: 0; font-size: 2.6rem; font-weight: 800; line-height: 3.2rem; }
.dk-pause-card p { margin: 0.8rem 0 0; font-size: 1.5rem; line-height: 2.1rem; color: #555; }
.dk-pause-buttons { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.8rem; margin-top: 2.2rem; }
.dk-pause-buttons .dk-btn { height: 3.8rem; padding: 0 2rem; font-size: 1.5rem; }

/* ============ 16. Справочник ============ */
/* Размеры сняты с макетов «справочник …» (1280 px); мелкий текст макета чуть увеличен. Цвет карточки — --c (у класса или расы свой). */
.lib-page .dm-head { margin-bottom: 0; }
.lib-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem; margin: 6rem 0 1.6rem -0.4rem; }
.lib-tab {
  display: inline-flex; align-items: center; height: 2.4rem; padding: 0 1.1rem; box-sizing: border-box; border-radius: 0.8rem;
  background: var(--card-bg); color: var(--ink); font-size: 1.4rem; font-weight: 700; text-decoration: none;
}
.lib-tab:hover { background: #d6d6d6; }
.lib-tab.is-on { background: var(--ink); color: #fff; }
.lib-panel { margin-left: -0.4rem; min-height: 60rem; box-sizing: border-box; padding: 1.5rem; border: 0.1rem solid var(--ink); border-radius: 1.2rem; background: var(--card-bg); }
.lib-costs { margin: 0 0 1.4rem; padding: 1.2rem 1.4rem; border: 0.1rem solid rgba(0, 0, 0, 0.12); border-radius: 1rem; }
.lib-costs summary { cursor: pointer; font-size: 1.4rem; font-weight: 700; }
.lib-costs summary small { font-weight: 500; opacity: 0.7; }
.lib-costs h4 { margin: 1rem 0 0.6rem; font-size: 1.2rem; font-weight: 700; }
.lib-cost-row { display: flex; flex-wrap: wrap; gap: 0.8rem; }
.lib-cost { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; font-size: 1.1rem; }
.lib-cost input { width: 5rem; height: 2.6rem; box-sizing: border-box; border: 0.1rem solid var(--ink); border-radius: 0.6rem; background: none; font: inherit; font-size: 1.3rem; text-align: center; color: var(--ink); }
.lib-cost b { font-size: 1.4rem; }
.lib-cost-foot { display: flex; align-items: center; gap: 1rem; margin-top: 1rem; }
.lib-cost-foot .lib-btn { height: 2.6rem; padding: 0 1.2rem; font-size: 1.2rem; }
.lib-cost-msg { font-size: 1.2rem; }
.lib-cost-msg.is-error { color: #9c5049; }
.lib-costs .lib-hint { margin: 0.8rem 0 0; font-size: 1.1rem; opacity: 0.7; }
.lib-toolbar { display: flex; justify-content: flex-end; margin: -0.3rem 0 1rem; }
.lib-toolbar .lib-btn { height: 2.6rem; padding: 0 1.2rem; font-size: 1.2rem; }
.lib-muted { margin: 0.8rem 0; font-size: 1.3rem; color: #8a8a8a; }
.lib-empty { margin: 1rem 0.4rem; font-size: 1.4rem; color: #8a8a8a; }

/* Заглавная страница */
.lib-home { position: relative; min-height: 62rem; margin: -1.6rem 0 0 -0.4rem; }
.lib-home-hint { position: absolute; z-index: 2; left: 0; top: 9.6rem; margin: 0; font-size: 2.1rem; line-height: 2.8rem; }
.lib-home-arrow { position: absolute; left: 34.4rem; top: 0.4rem; width: 8rem; height: 11rem; color: #9c5049; }
.lib-home-art { position: absolute; left: 25.3rem; top: 10.4rem; width: 56rem; max-width: 100%; height: auto; }

/* Фильтры и список */
.lib-filters { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-bottom: 1.2rem; }
.lib-search, .lib-select {
  height: 3.3rem; box-sizing: border-box; border: 0; border-radius: 1rem; background: var(--tile-bg); padding: 0 1.2rem;
  font: inherit; font-size: 1.4rem; color: var(--ink);
}
.lib-search { width: 30rem; max-width: 100%; }
.lib-select { min-width: 15rem; }
.lib-md { display: block; }
.lib-md.has-detail { display: grid; grid-template-columns: 38.6rem minmax(0, 1fr); gap: 1.8rem; align-items: start; }
/* Список и карточка открытой записи — фиксированной высоты (по высоте окна), внутри прокручивается содержимое */
.lib-panel { scroll-margin-top: 1rem; }
.lib-md.has-detail .lib-list { max-height: calc(100vh - var(--lib-off, 8.2rem)); overflow-y: auto; padding-right: 0.4rem; scrollbar-width: thin; scrollbar-color: #b5b5b5 transparent; position: sticky; top: 1rem; }
.lib-md.has-detail .lib-detail { position: sticky; top: 1rem; height: calc(100vh - var(--lib-off, 8.2rem)); }
.lib-detail .lib-card { height: 100%; box-sizing: border-box; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #b5b5b5 transparent; }
.lib-tiles { display: grid; grid-template-columns: repeat(auto-fill, 18.3rem); gap: 1rem; }
.lib-md.has-detail .lib-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lib-tile {
  display: flex; align-items: center; gap: 0.9rem; min-width: 0; height: 5rem; padding: 0.4rem 0.8rem 0.4rem 0.4rem; box-sizing: border-box;
  border: 0.1rem solid transparent; border-radius: 1rem; background: var(--tile-bg); color: var(--ink); font: inherit; text-align: left; cursor: pointer;
}
.lib-tile:hover { background: #fff; }
.lib-tile.is-on { border-color: var(--ink); }
.lib-tiles.is-nowrap .lib-tile-name { font-size: 1.6rem; white-space: nowrap; }
.lib-tile-name { min-width: 0; font-size: 1.8rem; font-weight: 800; line-height: 2.1rem; overflow-wrap: anywhere; }
.lib-tile-text { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 0.1rem; }
.lib-tile small { font-size: 1.1rem; line-height: 1.3rem; color: #8a8a8a; }
.lib-tile-text:has(small) .lib-tile-name { font-size: 1.5rem; line-height: 1.8rem; }
.lib-ava {
  display: grid; place-items: center; flex: none; overflow: hidden; width: 4.2rem; height: 4.2rem; border-radius: 50%;
  background: var(--c, #686743); color: #fff; font-size: 1.8rem; font-weight: 800;
}
.lib-ava img { width: 100%; height: 100%; object-fit: cover; }
.lib-ava.is-big { width: 10.4rem; height: 10.4rem; font-size: 4rem; }

/* Предыстории: названия по источникам */
.lib-src { margin: 1.4rem 0 0.6rem; padding: 0.7rem 1.2rem; border-radius: 0.8rem; background: #d6d6d6; font-size: 1.5rem; font-weight: 800; letter-spacing: 0.02em; text-transform: uppercase; color: #666; }
.lib-src:first-child { margin-top: 0; }
.lib-names { display: grid; grid-template-columns: repeat(auto-fill, minmax(21rem, 1fr)); gap: 0 2rem; }
.lib-md.has-detail .lib-names { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.lib-name { padding: 0.5rem 0.2rem; border: 0; border-bottom: 0.1rem solid #cfcfcf; background: none; font: inherit; font-size: 1.45rem; text-align: left; color: var(--ink); cursor: pointer; }
.lib-name:hover { color: var(--olive); }
.lib-name.is-on { font-weight: 800; }
.lib-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.6rem; margin: 0.3rem 0 0.8rem; font-size: 1.25rem; line-height: 1.7rem; }
.lib-links.is-col { flex-direction: column; gap: 0.5rem; margin-top: 0.6rem; font-size: 1.3rem; }
.lib-circle { margin: 1rem 0 0.2rem; font-size: 1.25rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em; color: var(--c); }
.lib-gray { margin: 1.6rem 0 0; font-size: 1.1rem; line-height: 1.6rem; color: #8d8d8d; }
.lib-gray a { color: inherit; text-decoration: underline; text-underline-offset: 0.2rem; }
.lib-use { display: flex; align-items: center; gap: 1.2rem; padding: 0.7rem 0.2rem; border-bottom: 0.1rem solid color-mix(in srgb, var(--c) 35%, #e4e0e0); font-size: 1.4rem; }
.lib-use-name { font-weight: 800; color: var(--c); }
.lib-use-lv { display: inline-flex; flex-wrap: wrap; gap: 0.4rem; }
.lib-hb { display: inline-block; min-width: 1.8rem; margin-left: 0.5rem; padding: 0 0.4rem; border-radius: 0.5rem; background: var(--c, #686743); font-size: 1.1rem; font-weight: 800; line-height: 1.8rem; text-align: center; vertical-align: middle; color: #fff; }
.lib-d-head h2 .lib-hb { font-size: 1.4rem; line-height: 2.4rem; min-width: 2.4rem; border-radius: 0.6rem; }
.lib-hb { text-transform: none; }
.lib-tile .lib-hb { font-size: 1.2rem; }
.lib-name .lib-hb { background: #686743; }
.lib-name-lvl { margin-left: 0.7rem; font-size: 1.1rem; font-weight: 400; color: #8a8a8a; }

/* Карточка записи */
.lib-detail { min-width: 0; }
.lib-card { position: relative; padding: 1.4rem 1.4rem 2.2rem; border-radius: 1.4rem; background: var(--tile-bg); --soft: color-mix(in srgb, var(--c) 13%, #f5f5f5); }
.lib-d-tools { position: sticky; top: 1rem; z-index: 3; display: flex; justify-content: flex-end; align-items: flex-start; gap: 0.7rem; height: 0; margin: -0.3rem -0.2rem 0 0; overflow: visible; }
.lib-edit { height: 2.2rem; padding: 0 1.1rem; border: 0; border-radius: 0.7rem; background: #e4e4e4; color: #8a8a8a; font: inherit; font-size: 1.1rem; cursor: pointer; }
.lib-edit:hover { background: var(--ink); color: #fff; }
.lib-close { display: grid; place-items: center; width: 3rem; height: 3rem; padding: 0; border: 0.1rem solid #bdbdbd; border-radius: 50%; background: var(--tile-bg); color: #777; font-size: 1.4rem; cursor: pointer; }
.lib-close:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.lib-d-head { display: flex; align-items: center; gap: 2rem; padding: 0.4rem 15.5rem 0 0.2rem; margin-bottom: 1.2rem; }
.lib-d-head > div { min-width: 0; }
.lib-d-head h2 { margin: 0; overflow-wrap: anywhere; font-size: 2.8rem; font-weight: 800; line-height: 3.3rem; color: var(--c); overflow-wrap: break-word; }
.lib-en { font-weight: 800; }
.lib-d-sub { margin: 0.3rem 0 0; font-size: 1.8rem; line-height: 2.2rem; color: color-mix(in srgb, var(--c) 78%, #555); }
.lib-d-sub a { color: inherit; }
.lib-quote { margin: 1.6rem 0 1.2rem; padding: 0.7rem 1.2rem; border-left: 0.6rem solid var(--c); border-radius: 0.3rem; background: var(--soft); font-size: 1.35rem; font-style: italic; line-height: 1.9rem; }
.lib-prose { margin: 0.6rem 0; font-size: 1.35rem; line-height: 1.95rem; text-align: justify; overflow-wrap: anywhere; }
.lib-card .lib-muted { margin-top: 1.4rem; }
.lib-sep { width: 92%; margin: 1.6rem auto; border: 0; border-top: 0.15rem solid color-mix(in srgb, var(--c) 60%, #f5f5f5); }
.lib-card h3 { margin: 1.4rem 0 0.7rem; font-size: 1.55rem; font-weight: 800; line-height: 2rem; color: var(--c); }
.lib-card h3:first-child { margin-top: 0; }
.lib-card h4 { margin: 1.4rem 0 0.3rem; font-size: 1.35rem; font-weight: 800; color: color-mix(in srgb, var(--c) 85%, #222); }
.lib-card h5 { margin: 1.4rem 0 0; font-size: 1.25rem; font-weight: 800; color: color-mix(in srgb, var(--c) 85%, #222); }
.lib-card .lib-acc-body hr { border: 0; border-top: 0.15rem solid color-mix(in srgb, var(--c) 55%, #f5f5f5); margin: 0.3rem 0 0.4rem; }
.lib-source { margin: 2rem 0 0; font-size: 1.15rem; color: #8a8a8a; }
.lib-tags { display: flex; gap: 0.6rem; margin: 1rem 0 0.6rem; }
.lib-badge { white-space: nowrap; display: inline-flex; align-items: center; gap: 0.5rem; padding: 0 1rem; border-radius: 1.2rem; background: var(--c); color: #fff; font-size: 1.2rem; font-weight: 700; line-height: 2.2rem; }
.lib-badge b { padding-left: 0.4rem; font-weight: 800; }
.lib-spell { color: var(--c); font-weight: 700; text-decoration: underline; text-underline-offset: 0.2rem; }
.lib-spell.is-missing { text-decoration: none; cursor: help; }
/* навык в списке «навыки» карточки класса / предыстории: нажимается, открывает окно с описанием */
.lib-skill { color: var(--c); font-weight: 700; text-decoration: underline dotted; text-underline-offset: 0.25rem; cursor: pointer; }
.lib-skill:hover { text-decoration-style: solid; }
.lib-tip { position: fixed; z-index: 400; box-sizing: border-box; width: 30rem; max-width: calc(100vw - 1.6rem); max-height: 26rem; overflow-y: auto; padding: 1rem 1.2rem 1.1rem; border: 0.1rem solid #cfc9c9; border-radius: 1rem; background: #fbfafa; box-shadow: 0 0.6rem 2rem rgba(0, 0, 0, 0.22); font-size: 1.2rem; line-height: 1.7rem; color: #2f2a2d; }
.lib-tip[hidden] { display: none; }
.lib-tip h4 { margin: 0 0 0.4rem; font-size: 1.4rem; line-height: 1.8rem; font-weight: 800; }
.lib-tip h4 span { font-weight: 600; color: #6d6666; }
.lib-tip p { margin: 0.3rem 0 0; }
.lib-tip .lib-prose { margin: 0.4rem 0 0; font-size: 1.2rem; line-height: 1.7rem; text-align: left; }

.lib-cols { display: grid; grid-template-columns: minmax(0, 1fr) 22rem; gap: 2.4rem; align-items: start; }
.lib-cols.is-race { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 2.4rem; min-height: 16.5rem; }
.lib-cols.is-race .lib-abil h3 { font-size: 1.45rem; }
.lib-cols.is-race .lib-badge { padding: 0 0.9rem; font-size: 1.15rem; }
.lib-cols.is-race h3 { margin-top: 1.1rem; }
.lib-cols.is-race > div > h3:first-child, .lib-cols.is-race > div > .lib-abil:first-child h3 { margin-top: 0; }
.lib-cols.is-race .lib-prose { margin: 0.4rem 0 0; }
.lib-cols.is-race .lib-kv th, .lib-cols.is-race .lib-kv td { padding: 0.9rem 1.2rem; }
.lib-abil { display: flex; flex-wrap: nowrap; align-items: center; gap: 0.6rem; white-space: nowrap; }
.lib-abil h3 { margin: 0 0.6rem 0 0; }
.lib-kv { width: 100%; border-collapse: collapse; }
.lib-kv th, .lib-kv td { padding: 1rem 1.2rem; font-size: 1.3rem; line-height: 1.7rem; font-weight: 400; text-align: left; vertical-align: middle; }
.lib-kv th { width: 38%; border-right: 0.1rem solid color-mix(in srgb, var(--c) 75%, #f5f5f5); }
.lib-kv tr + tr th, .lib-kv tr + tr td { border-top: 0.1rem solid color-mix(in srgb, var(--c) 75%, #f5f5f5); }
/* правая область (умения и заклинания) всегда ровно той же высоты, что левая (хиты и владение): сама высоты не задаёт (contain: size), блоки делят её 58 / 42 и листаются внутри */
.lib-cols:not(.is-race) { align-items: stretch; min-height: 30rem; }
.lib-side { display: flex; flex-direction: column; gap: 1.2rem; contain: size; min-height: 0; }
.lib-box { --box: color-mix(in srgb, var(--c) 9%, #ececec); display: flex; flex-direction: column; box-sizing: border-box; padding: 1rem 1.2rem 1rem; border: 0.2rem solid var(--c); border-radius: 1.4rem; background: var(--box); }
.lib-box { min-height: 0; }
.lib-box.is-feats { flex: 209 1 0; }
.lib-box.is-spells { flex: 150 1 0; }
.lib-box h3 { flex: none; margin: 0 0 0.6rem 0.2rem; font-size: 1.8rem; line-height: 2.2rem; }
.lib-box-scroll { flex: 1; min-height: 0; overflow-y: auto; padding-right: 0.4rem; scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--c) 45%, #f5f5f5) transparent; }
.lib-box-scroll .lib-grid th { position: sticky; top: 0; background: var(--box); }
.lib-feat { display: flex; align-items: center; gap: 1rem; width: 100%; padding: 0.3rem 0; border: 0; background: none; font: inherit; font-size: 1.3rem; line-height: 1.6rem; text-transform: lowercase; text-align: left; color: var(--ink); cursor: pointer; }
.lib-feat b { display: grid; place-items: center; flex: none; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: #f6f4f4; font-size: 1.2rem; font-weight: 800; text-transform: none; color: var(--c); }
.lib-feat { text-decoration: none; }
.lib-feat:hover span, .lib-feat.is-open span { font-weight: 800; }
.lib-feat-text { margin: 0.2rem 0 0.8rem 3.4rem; }
.lib-feat-text .lib-prose { margin: 0; font-size: 1.15rem; line-height: 1.6rem; }
.lib-grid { width: 100%; border-collapse: collapse; font-size: 1.25rem; }
.lib-grid th { padding: 0.3rem 0.6rem 0.5rem; text-align: center; font-size: 1.25rem; font-weight: 700; color: var(--c); }
.lib-grid td { padding: 0.3rem 0.6rem; text-align: center; border-top: 0.1rem solid color-mix(in srgb, var(--c) 22%, #e4e0e0); }
.lib-grid td + td, .lib-grid th + th { border-left: 0.1rem solid color-mix(in srgb, var(--c) 14%, #e8e4e4); }
.lib-grid td:first-child, .lib-grid th:first-child { border-left: 0; }
.lib-box .lib-grid { table-layout: fixed; }
.lib-box .lib-grid th:first-child, .lib-box .lib-grid td:first-child { width: 4.2rem; padding-left: 0.2rem; padding-right: 0.2rem; }
.lib-box .lib-grid th, .lib-box .lib-grid td { padding-left: 0.3rem; padding-right: 0.3rem; }
.lib-lvl { display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: #f6f4f4; font-size: 1.2rem; font-weight: 800; color: var(--c); }
.lib-tablebox { margin: 1rem auto; padding: 0.6rem 1rem; max-width: 62rem; border: 0.1rem solid var(--c); border-radius: 1rem; background: var(--soft); }
/* Таблица в описании умения: без фона и рамки, по центру окна, ширина столбцов — по содержимому. */
.lib-tablebox.is-small { margin: 1.2rem 0; padding: 0; max-width: none; border: 0; border-radius: 0; background: none; }
.lib-tablebox.is-small .lib-grid, .lib-box .lib-tablebox.is-small .lib-grid { width: auto; margin: 0 auto; table-layout: auto; }
.lib-tablebox.is-small .lib-grid th, .lib-tablebox.is-small .lib-grid td,
.lib-box .lib-tablebox.is-small .lib-grid th:first-child, .lib-box .lib-tablebox.is-small .lib-grid td:first-child { width: auto; padding: 0.3rem 1.6rem; position: static; background: none; }
.lib-tablebox .lib-grid th, .lib-tablebox .lib-grid td { text-align: left; font-size: 1.2rem; }
.lib-tablebox .lib-grid th { font-size: 1.15rem; }
.lib-h-wide { margin-top: 2.2rem !important; }

.lib-acc, .lib-deep { margin-top: 0.6rem; border-radius: 0.8rem; }
.lib-acc { background: var(--soft); }
.lib-deep { margin-top: 1.4rem; border: 0.15rem solid var(--c); background: none; }
.lib-acc-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; width: 100%; min-height: 3.2rem; padding: 0.4rem 1.2rem; border: 0; background: none; font: inherit; font-size: 1.3rem; font-weight: 800; text-align: left; color: var(--c); cursor: pointer; }
.lib-deep .lib-acc-head { min-height: 3.6rem; font-size: 1.45rem; }
.lib-caret { flex: none; width: 1.6rem; height: 1rem; transition: transform 0.15s; }
.is-open > .lib-acc-head .lib-caret { transform: rotate(180deg); }
.lib-acc-body { padding: 0.2rem 1.2rem 1.2rem; }
.lib-trait { margin-top: 1.2rem; }
.lib-trait h4 { margin-top: 0; }
/* заголовок умения: «умение» цветом класса жирным, название после точки — тёмным, строчными */
.lib-card .lib-ttl { font-size: 1.35rem; line-height: 1.95rem; font-weight: 700; color: #3a3a3a; }
.lib-ttl b { font-weight: 800; color: var(--c); }
.lib-ttl span { text-transform: lowercase; }

/* Таблицы: навыки, оружие и доспехи */
.lib-table { width: 100%; border-collapse: collapse; overflow: hidden; border-radius: 1rem; font-size: 1.45rem; }
.lib-table + .lib-t-title, .lib-t-title { margin: 2rem 0 0.8rem; font-size: 1.9rem; font-weight: 800; }
.lib-t-title:first-child { margin-top: 0.4rem; }
.lib-table th { padding: 0.9rem 1.2rem; background: #d3d3d3; font-size: 1.4rem; font-weight: 800; text-align: left; }
.lib-table td { padding: 0.8rem 1.2rem; vertical-align: top; }
.lib-table tbody tr:nth-child(odd) { background: var(--tile-bg); }
.lib-table tbody tr:nth-child(even) { background: #ececec; }
.lib-table tr.lib-cat td { background: #dedede; font-weight: 800; color: #555; }
.lib-table tr.is-click { cursor: pointer; }
.lib-table tr.is-click:hover td { background: #fff; }

/* Редактор */
.lib-form { padding: 0.4rem 0.2rem 1rem; }
.lib-form h2 { margin: 0 0 1.2rem; font-size: 2.4rem; font-weight: 800; }
.lib-card .lib-form { padding: 1.4rem 1.4rem 2rem; }
.lib-f { margin-top: 1rem; }
.lib-f label, .lib-f-title { display: block; margin: 0 0 0.3rem 0.2rem; font-size: 1.2rem; line-height: 1.5rem; color: #8a8a8a; }
.lib-f small { display: block; margin: 0.2rem 0 0 0.2rem; font-size: 1.1rem; color: #8a8a8a; }
.lib-f.is-bool label { display: flex; align-items: center; gap: 0.6rem; margin: 0; font-size: 1.35rem; color: var(--ink); }
.lib-in { width: 100%; box-sizing: border-box; min-height: 3.2rem; padding: 0.5rem 1rem; border: 0.1rem solid #d0d0d0; border-radius: 0.9rem; background: #fff; font: inherit; font-size: 1.4rem; color: var(--ink); }
.lib-in:focus { outline: 0.2rem solid var(--olive); outline-offset: 0; }
.lib-ta { display: block; box-sizing: border-box; height: 12rem; min-height: 5rem; resize: vertical; overflow-y: auto; line-height: 2rem; }
.lib-f-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 1rem; }
.lib-f-row.is-media { grid-template-columns: auto auto 1fr; align-items: end; }
.lib-portrait { display: flex; align-items: center; gap: 0.8rem; }
.lib-portrait .lib-ava.is-big { width: 6.4rem; height: 6.4rem; font-size: 2.4rem; }
.lib-color { width: 8rem; height: 3.4rem; padding: 0.2rem; border: 0; border-radius: 0.8rem; background: #fff; cursor: pointer; }
.lib-f.is-list { margin-top: 1.6rem; padding: 0.8rem 1rem 1rem; border: 0.1rem dashed #c4c4c4; border-radius: 1.1rem; }
.lib-li { display: flex; align-items: flex-start; gap: 0.6rem; margin-top: 0.8rem; padding: 0.6rem; border-radius: 0.9rem; background: rgba(0, 0, 0, 0.035); }
.lib-li-fields { display: flex; flex: 1; min-width: 0; flex-wrap: wrap; gap: 0 0.8rem; }
.lib-li-f { flex: 1 1 18rem; min-width: 0; }
.lib-li-f.is-narrow { flex: 0 0 var(--w, 8rem); }
.lib-li-f.is-full { flex: 1 1 100%; }
.lib-li-f .lib-f { margin-top: 0.4rem; }
.lib-li-tools { display: flex; flex: none; flex-direction: column; gap: 0.3rem; }
.lib-li-tools button { width: 2.6rem; height: 2.6rem; padding: 0; border: 0; border-radius: 0.6rem; background: #e4e4e4; font: inherit; font-size: 1.3rem; color: #555; cursor: pointer; }
.lib-li-tools button:hover { background: var(--ink); color: #fff; }
.lib-pick { display: flex; flex-wrap: wrap; gap: 0.5rem 1.6rem; margin-top: 0.5rem; }
.lib-chk { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 1.3rem; cursor: pointer; }
.lib-rt { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.3rem 0 0.5rem; }
.lib-rt-b { min-width: 2.8rem; height: 2.6rem; padding: 0 0.9rem; border: 0.1rem solid #cfcfcf; border-radius: 0.7rem; background: #fff; font: inherit; font-size: 1.2rem; color: var(--ink); cursor: pointer; }
.lib-rt-b:hover { background: #efecec; }
.lib-prose .rich-h2 { margin: 0.6rem 0 0.2rem; font-size: 1.65rem; color: var(--c); }
.lib-prose .rich-h3 { margin: 0.5rem 0 0.1rem; font-size: 1.45rem; color: var(--c); }
.lib-tbl-wrap { overflow-x: auto; margin-top: 0.4rem; border: 0.1rem solid #cfcfcf; border-radius: 0.9rem; background: #fff; }
.lib-tbl-grid { width: 100%; border-collapse: collapse; }
.lib-tbl-grid td { padding: 0; border-bottom: 0.1rem solid #e2dede; }
.lib-tbl-grid tr:last-child td { border-bottom: 0; }
.lib-tbl-grid td + td { border-left: 0.1rem solid #e2dede; }
.lib-tbl-grid tr.is-head td { background: #efecec; }
.lib-tbl-grid tr.is-head .lib-tc { font-weight: 800; }
.lib-tc { display: block; box-sizing: border-box; width: 100%; min-width: 7rem; padding: 0.7rem 0.9rem; border: 0; background: transparent; font: inherit; font-size: 1.3rem; color: var(--ink); outline: none; }
.lib-tc:focus { background: #f6f3ee; box-shadow: inset 0 0 0 0.15rem #b9b2a4; }
.lib-tc::placeholder { color: #bdb7b7; }
.lib-tbl-grid td.lib-tc-x { width: 3rem; text-align: center; border-left: 0; background: #faf9f9; }
.lib-tc-x button { border: 0; background: none; font-size: 1.2rem; color: #9a9a9a; cursor: pointer; }
.lib-tc-x button:hover { color: #a33; }
.lib-tbl-tools { display: flex; flex-wrap: wrap; gap: 0.8rem; }
.lib-li.is-collapsed { padding-bottom: 0.6rem; }
.lib-li-sum { flex: 0 0 100%; box-sizing: border-box; margin: 0.2rem 0 0 0.1rem; font-size: 1.2rem; line-height: 1.6rem; color: #8d8d8d; cursor: pointer; }
.lib-li-sum:hover { color: #555; }
.lib-li-all { display: inline-flex; gap: 1.2rem; margin-left: 1.6rem; }
.lib-link { padding: 0; border: 0; background: none; font: inherit; font-size: 1.2rem; text-decoration: underline; color: #6d6d6d; cursor: pointer; }
.lib-link:hover { color: #222; }
.lib-add { margin-top: 0.8rem; padding: 0.5rem 1.2rem; border: 0.1rem dashed #9a9a9a; border-radius: 0.9rem; background: none; font: inherit; font-size: 1.3rem; color: #555; cursor: pointer; }
.lib-add:hover { background: #fff; }
.lib-hint { margin: 1.4rem 0 0; font-size: 1.15rem; line-height: 1.6rem; color: #8a8a8a; }
.lib-form-buttons { display: flex; align-items: center; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.4rem; }
.lib-btn { height: 3.2rem; padding: 0 1.4rem; box-sizing: border-box; border: 0.1rem solid var(--ink); border-radius: 1rem; background: none; font: inherit; font-size: 1.3rem; font-weight: 600; color: var(--ink); cursor: pointer; }
.lib-btn.is-dark { background: var(--ink); color: #fff; }
.lib-btn.is-dark:hover { filter: brightness(1.3); }
.lib-btn.is-line:hover { background: #fff; }
.lib-btn.is-danger { margin-left: auto; border-color: #9c5049; color: #9c5049; }
.lib-btn.is-danger:hover { background: #9c5049; color: #fff; }
.lib-saved { font-size: 1.2rem; color: var(--olive); }
.lib-saved.is-error { color: var(--red); }
.dm-modal-card.lib-modal { width: min(76rem, 100%); }

/* Чиби-иконка в редакторе чарлиста */
.ed-chibi { display: flex; align-items: center; gap: 1.2rem; margin: 1.2rem 0 0; padding: 1rem 1.2rem; border-radius: 1.6rem; background: rgba(0, 0, 0, 0.05); }
.ed-chibi-pic { flex: none; width: 6.4rem; height: 6.4rem; border-radius: 50%; overflow: hidden; background: var(--accent, #684a43); display: grid; place-items: center; }
.ed-chibi-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ed-chibi-pic .sheet-portrait-letter { font-size: 2.8rem; height: auto; }
.ed-chibi-text { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.ed-chibi-text b { font-size: 1.4rem; font-weight: 800; }
.ed-chibi-text small { font-size: 1.2rem; opacity: 0.65; }
.ed-chibi .ed-tools { position: static; margin-top: 0.6rem; flex-wrap: wrap; }

/* Чиби на месте аватарки: заполняет весь кружок (обрезка по бюст, как на миниатюрах), а не вписывается с полями как эмодзи */
.avatar img[src^="/assets/uploads/"],
.acc-avatar img[src^="/assets/uploads/"] {
  width: 100%; height: 100%; object-fit: cover;
  /* чуть крупнее и ниже: голова не упирается в край, снизу нет пустоты; круг вырезаем в системе координат картинки */
  transform: translateY(5%) scale(1.08);
  clip-path: circle(46.3% at 50% 45.4%);
}
.title-avatar[src^="/assets/uploads/"],
.hero-owner img[src^="/assets/uploads/"] { object-fit: cover; border-radius: 50%; }
