/* Chirk v3.10.7 — оформление интерфейса.
   «Классическое» — это style.css без изменений: здесь для него только вид самого переключателя.
   «Тёплый графит» — переопределения под html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]). Затрагивают только оболочку
   интерфейса: холст, фон доски, рисунки, цвета профилей/аватаров/курсоров участников НЕ меняются
   (#boardCanvas, .board-screen, .preview-*, цвета аватаров здесь намеренно не упоминаются). */

/* ───────────────────────── Переключатель оформления (обе темы) ───────────────────────── */

.simple-menu-card {
  position: relative;
}

.ui-theme-switch-home {
  position: absolute;
  top: 26px;
  right: 28px;
  display: grid;
  justify-items: end;
  gap: 4px;
}

.ui-theme-switch-label {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.ui-theme-switch-home .ui-theme-options {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.05);
  border: 1px solid rgba(148, 163, 184, 0.28);
}

.ui-theme-switch-home .ui-theme-option {
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #475569;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}

.ui-theme-switch-home .ui-theme-option:hover {
  background: rgba(15, 23, 42, 0.07);
  color: #0f172a;
}

.ui-theme-switch-home .ui-theme-option[aria-pressed="true"] {
  background: #2563eb;
  color: #fff;
}

.ui-theme-option[aria-pressed="true"]::before {
  content: "✓ ";
}

.ui-theme-switch-home .ui-theme-option:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.ui-theme-menu-section .ui-theme-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.ui-theme-menu-section .ui-theme-option {
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  color: #e5e7eb;
  cursor: pointer;
  font-weight: 800;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.ui-theme-menu-section .ui-theme-option:hover {
  background: rgba(255, 255, 255, 0.14);
}

.ui-theme-menu-section .ui-theme-option[aria-pressed="true"] {
  background: rgba(59, 130, 246, 0.34);
  border-color: #60a5fa;
  color: #fff;
}

.ui-theme-menu-section .ui-theme-option:focus-visible {
  outline: 2px solid #60a5fa;
  outline-offset: 2px;
}

.ui-theme-menu-section .board-menu-note {
  margin-top: 8px;
}

/* Узкий экран: рядом с логотипом не помещается — ставим под него (страница там и так прокручивается). */
@media (max-width: 440px) {
  .ui-theme-switch-home {
    position: static;
    justify-items: start;
    margin: 0 0 6px;
  }
}

/* ───────────────────────── «Тёплый графит» ───────────────────────── */

html[data-ui-theme="warm-graphite"] {
  --wg-bg: #282825;
  --wg-panel: #30302d;
  --wg-panel-raised: #3d3d38;
  --wg-panel-hover: #48483f;
  --wg-panel-pressed: #35352f;
  --wg-panel-inset: #282825;
  --wg-panel-card: #373732;
  --wg-panel-border: #55554d;
  --wg-panel-divider: #45453e;
  --wg-text: #f5f2e9;
  --wg-text-2: #c9c5ba;
  --wg-text-disabled: #8a877d;
  --wg-accent: #c7a466;
  --wg-accent-hover: #d2b37b;
  --wg-accent-pressed: #b8955a;
  --wg-accent-ink: #7a5f2e;
  --wg-on-accent: #282720;
  --wg-surface: #f5f2e9;
  --wg-surface-2: #ece7db;
  --wg-surface-3: #e2dccd;
  --wg-field: #fbf9f4;
  --wg-surface-border: #d5cebf;
  --wg-field-border: #c9c1b0;
  --wg-ink: #30302d;
  --wg-ink-2: #5c5950;
  --wg-ink-3: #6b675e;
  --wg-danger: #a5473a;
  --wg-danger-hover: #8f3a2e;
  --wg-danger-on-dark: #e8a595;
  --wg-danger-soft: #f1ddd6;
  --wg-danger-soft-hover: #e9cdc3;
  --wg-danger-ink: #8a3528;
  --wg-success: #5b7a43;
  --wg-success-on-dark: #b3cc92;
  --wg-warning: #8a5a1f;
  --wg-shadow: 0 8px 24px rgba(24, 23, 20, 0.2);
  --wg-shadow-soft: 0 4px 14px rgba(24, 23, 20, 0.12);
  --wg-ring: 0 0 0 3px rgba(199, 164, 102, 0.4);

  /* переменные из style.css, которыми пользуются общие правила */
  --bg: #282825;
  --text: #30302d;
  --muted: #6b675e;
  --accent: #b8955a;
  --accent-soft: rgba(199, 164, 102, 0.3);
  --danger: #a5473a;
  accent-color: #b8955a;
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) body {
  background: var(--wg-bg);
}

/* Фокус с клавиатуры — песочная рамка (у полей ввода — своё кольцо ниже). */
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) button:focus-visible,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) select:focus-visible,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) a:focus-visible,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) input[type="color"]:focus-visible {
  outline: 2px solid var(--wg-accent);
  outline-offset: 2px;
}

/* ── Главный экран ── */

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .simple-menu-screen {
  background: var(--wg-bg);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .simple-menu-card,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .menu-side-panel {
  background: var(--wg-surface);
  border-color: var(--wg-surface-border);
  box-shadow: var(--wg-shadow);
  backdrop-filter: none;
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .simple-menu-logo,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .simple-saved-title,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .menu-invite-title,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .profile-invite-title,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .saved-name {
  color: var(--wg-ink);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .simple-saved-title::after,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .menu-invite-note,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .profile-invite-meta,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .saved-meta,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .saved-owner,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .saved-empty,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .board-members-empty {
  color: var(--wg-ink-3);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .ui-theme-switch-label,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .local-account-label,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .simple-menu-field {
  color: var(--wg-ink-2);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .ui-theme-switch-home .ui-theme-options {
  background: var(--wg-surface-2);
  border-color: var(--wg-surface-border);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .ui-theme-switch-home .ui-theme-option {
  color: var(--wg-ink-2);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .ui-theme-switch-home .ui-theme-option:hover {
  background: var(--wg-surface-3);
  color: var(--wg-ink);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .ui-theme-switch-home .ui-theme-option[aria-pressed="true"] {
  background: var(--wg-accent);
  color: var(--wg-on-accent);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .local-account-card,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .local-account-card.profile-card.profile-logged-out {
  background: var(--wg-surface-2);
  border-color: var(--wg-surface-border);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .local-account-avatar {
  box-shadow: var(--wg-shadow-soft);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .local-account-avatar.logged-out-avatar {
  background: #a39e92 !important;
  border-color: var(--wg-surface-border) !important;
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .local-profile-select,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .simple-menu-field input,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .menu-invite-row input,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .chirk-dialog-input {
  background: var(--wg-field);
  border-color: var(--wg-field-border);
  color: var(--wg-ink);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .local-profile-select.empty-profile-select {
  color: var(--wg-ink-3);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .simple-menu-field input::placeholder,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .menu-invite-row input::placeholder,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .chirk-dialog-input::placeholder {
  color: #8c877b;
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .local-profile-select:focus,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .simple-menu-field input:focus,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .menu-invite-row input:focus,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .chirk-dialog-input:focus {
  border-color: var(--wg-accent-pressed);
  box-shadow: var(--wg-ring);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .profile-color-label {
  background: rgba(48, 48, 45, 0.06);
  color: var(--wg-ink-2);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .local-avatar-reset {
  background: rgba(48, 48, 45, 0.07);
  color: var(--wg-ink);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .local-avatar-reset:hover {
  background: rgba(48, 48, 45, 0.13);
}

/* Тёмные кнопки профиля и «Открыть» по ссылке — графит */
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .local-account-save,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .local-profile-create,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .menu-invite-row button,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .primary-btn,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .chirk-dialog-ok {
  background: var(--wg-panel);
  color: var(--wg-text);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .local-account-save:hover,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .local-profile-create:hover,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .menu-invite-row button:hover,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .primary-btn:hover,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .chirk-dialog-ok:hover {
  background: var(--wg-panel-raised);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .local-account-save:active,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .local-profile-create:active,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .menu-invite-row button:active,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .primary-btn:active,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .chirk-dialog-ok:active {
  background: var(--wg-bg);
}

/* Опасные действия на светлом — сдержанный красный */
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .local-profile-delete,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .profile-invite-decline,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .delete-saved {
  background: var(--wg-danger-soft);
  color: var(--wg-danger-ink);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .local-profile-delete:hover,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .profile-invite-decline:hover,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .delete-saved:hover {
  background: var(--wg-danger-soft-hover);
}

/* Главное действие — песочный акцент */
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .simple-menu-primary,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .open-saved {
  background: var(--wg-accent);
  color: var(--wg-on-accent);
  box-shadow: none;
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .simple-menu-primary:hover,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .open-saved:hover {
  background: var(--wg-accent-hover);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .simple-menu-primary:active,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .open-saved:active {
  background: var(--wg-accent-pressed);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .menu-invite-box {
  background: var(--wg-surface-2);
  border-color: var(--wg-surface-border);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .menu-restore-btn {
  border-color: #a39e92;
  color: var(--wg-ink);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .menu-restore-btn:hover {
  background: rgba(199, 164, 102, 0.16);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .profile-invites-refresh {
  background: var(--wg-surface-2);
  color: var(--wg-ink);
  box-shadow: inset 0 0 0 1px var(--wg-surface-border);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .profile-invites-refresh:hover {
  background: var(--wg-surface-3);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .profile-invite-card,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .saved-item {
  background: var(--wg-field);
  border-color: var(--wg-surface-border);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .profile-invite-accept {
  background: var(--wg-success);
  color: #fff;
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .profile-invite-accept:hover {
  background: #4d6939;
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .auto-room-hint {
  background: #efe5cf;
  color: #5a4720;
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .runtime-error-banner {
  background: var(--wg-danger-soft);
  color: var(--wg-danger-ink);
  box-shadow: 0 0 0 1px #d9a99c, var(--wg-shadow);
}

/* ── Редактор: тёмные панели ── */

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .toolbar,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .shape-panel,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .board-menu-panel,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .zoom-widget,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .status-bar {
  background: var(--wg-panel);
  color: var(--wg-text);
  box-shadow: inset 0 0 0 1px var(--wg-panel-border), var(--wg-shadow);
  backdrop-filter: none;
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .shape-panel,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .board-menu-panel {
  scrollbar-color: var(--wg-panel-border) transparent;
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .board-hint,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .shape-category-name,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .shape-panel-note,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .board-menu-subtitle,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .board-menu-note,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .account-menu-note,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .board-member-row-role,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .board-profile-invite-label {
  color: var(--wg-text-2);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .board-menu-section-title,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .account-menu-name,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .board-member-row-name,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .board-share-link-status,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .board-menu-panel .hotkey-grid label {
  color: var(--wg-text);
}

/* Кнопки на тёмной панели: обычная / наведение / нажатие / активная / отключённая */
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .tool-btn,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .shape-item,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .background-option,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .ui-theme-menu-section .ui-theme-option {
  background: var(--wg-panel-raised);
  border-color: var(--wg-panel-border);
  color: var(--wg-text);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .tool-btn:hover,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .shape-item:hover,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .background-option:hover,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .ui-theme-menu-section .ui-theme-option:hover {
  background: var(--wg-panel-hover);
  border-color: #6a6a60;
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .tool-btn:active,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .shape-item:active,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .background-option:active,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .ui-theme-menu-section .ui-theme-option:active {
  background: var(--wg-panel-pressed);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .tool-btn.active,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .shape-item.active,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .background-option.active,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .ui-theme-menu-section .ui-theme-option[aria-pressed="true"] {
  background: var(--wg-accent);
  border-color: var(--wg-accent);
  color: var(--wg-on-accent);
  box-shadow: none;
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .tool-btn.active:hover,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .shape-item.active:hover,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .background-option.active:hover,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .ui-theme-menu-section .ui-theme-option[aria-pressed="true"]:hover {
  background: var(--wg-accent-hover);
  border-color: var(--wg-accent-hover);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .tool-btn:disabled,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .tool-btn.disabled,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .tool-btn:disabled:hover,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .tool-btn.disabled:hover {
  opacity: 1;
  background: transparent;
  border-color: var(--wg-panel-divider);
  color: var(--wg-text-disabled);
  transform: none;
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .danger-btn {
  color: var(--wg-danger-on-dark);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .danger-btn:hover {
  background: rgba(165, 71, 58, 0.38);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .color-label,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .board-menu-field {
  background: var(--wg-panel-raised);
  color: var(--wg-text-2);
  box-shadow: inset 0 0 0 1px var(--wg-panel-border);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .board-account-pill {
  background: var(--wg-panel-raised);
  color: var(--wg-text);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .board-members-pill {
  background: var(--wg-panel-inset);
  border-color: var(--wg-panel-border);
  box-shadow: none;
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .board-member-chip {
  background: var(--wg-panel-raised);
  border-color: var(--wg-panel-border);
  color: var(--wg-text);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .board-member-chip.is-self {
  background: var(--wg-panel-hover);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .board-member-chip.is-online {
  border-color: rgba(150, 186, 110, 0.8);
  box-shadow: 0 0 0 2px rgba(150, 186, 110, 0.14);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .board-member-chip.is-following {
  border-color: var(--wg-accent);
  box-shadow: 0 0 0 3px rgba(199, 164, 102, 0.3);
}

/* ── Меню доски ── */

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .board-menu-close,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .zoom-widget button {
  background: var(--wg-panel-raised);
  color: var(--wg-text);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .board-menu-close:hover,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .zoom-widget button:hover {
  background: var(--wg-panel-hover);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .zoom-widget button:active {
  background: var(--wg-panel-pressed);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .board-menu-section {
  border-top-color: var(--wg-panel-divider);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .account-menu-user {
  background: var(--wg-panel-raised);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .board-profile-invite-card,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .board-share-link-card,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .board-members-card {
  background: var(--wg-panel-card);
  border-color: var(--wg-panel-divider);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .board-profile-invite-input {
  background: var(--wg-surface);
  border-color: var(--wg-panel-border);
  color: var(--wg-ink);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .board-profile-invite-input::placeholder {
  color: #8c877b;
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .board-profile-invite-input:focus {
  border-color: var(--wg-accent);
  box-shadow: var(--wg-ring);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .board-menu-panel .hotkey-grid input {
  border-color: var(--wg-panel-border);
  background: var(--wg-panel-inset);
  color: var(--wg-text);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .board-menu-panel .hotkey-grid input.listening {
  border-color: var(--wg-accent);
  box-shadow: var(--wg-ring);
  background: var(--wg-panel-pressed);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .mini-settings-btn {
  background: var(--wg-panel-raised);
  color: var(--wg-text);
  box-shadow: inset 0 0 0 1px var(--wg-panel-border);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .mini-settings-btn:hover {
  background: var(--wg-panel-hover);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .mini-settings-btn:active {
  background: var(--wg-panel-pressed);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .mini-settings-btn.primary,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .invite-link-copy {
  background: var(--wg-accent) !important;
  color: var(--wg-on-accent) !important;
  box-shadow: none;
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .mini-settings-btn.primary:hover,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .invite-link-copy:hover {
  background: var(--wg-accent-hover) !important;
  box-shadow: none;
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .mini-settings-btn.primary:active,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .invite-link-copy:active {
  background: var(--wg-accent-pressed) !important;
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .invite-link-copy.is-copied {
  background: var(--wg-success) !important;
  color: #fff !important;
  box-shadow: none;
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .mini-settings-btn.danger-mini {
  background: var(--wg-danger);
  color: #fff;
  box-shadow: none;
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .mini-settings-btn.danger-mini:hover {
  background: var(--wg-danger-hover);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .board-share-link-status.is-active {
  color: var(--wg-success-on-dark);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .board-share-link-status.is-revoked {
  color: var(--wg-danger-on-dark);
}

/* ── Панели синхронизации: конфликт / удалена / история / доступ / не сохранено ── */

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .sync-bar {
  color: var(--wg-text);
  box-shadow: var(--wg-shadow);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .sync-conflict-bar {
  background: var(--wg-warning);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .sync-deleted-bar {
  background: #8e3a2c;
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .sync-history-bar {
  background: var(--wg-panel);
  box-shadow: inset 0 0 0 1px var(--wg-panel-border), inset 5px 0 0 var(--wg-accent), var(--wg-shadow);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .sync-access-bar {
  background: #7a4126;
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .sync-bar.sync-bar-danger {
  background: #6e2a20;
  box-shadow: 0 0 0 3px #d9897a, var(--wg-shadow);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .sync-bar-btn {
  background: var(--wg-surface);
  color: var(--wg-on-accent);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .sync-bar-btn:hover {
  background: #fffdf7;
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .sync-bar-btn-secondary {
  background: rgba(245, 242, 233, 0.16);
  color: var(--wg-text);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .sync-bar-btn-secondary:hover {
  background: rgba(245, 242, 233, 0.26);
}

/* ── Окна и подтверждения: светлая поверхность ── */

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .modal,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .chirk-dialog-overlay {
  background: rgba(28, 27, 24, 0.48);
  backdrop-filter: none;
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .modal-card,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .chirk-dialog-card {
  background: var(--wg-surface);
  color: var(--wg-ink);
  border-color: var(--wg-surface-border);
  box-shadow: 0 18px 50px rgba(24, 23, 20, 0.3);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .modal-title,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .chirk-dialog-title {
  color: var(--wg-ink);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .modal-subtitle,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .chirk-dialog-message {
  color: var(--wg-ink-2);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .modal-close,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .chirk-dialog-close,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .chirk-dialog-cancel,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .secondary-btn {
  background: rgba(48, 48, 45, 0.08);
  color: var(--wg-ink);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .modal-close:hover,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .chirk-dialog-close:hover,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .chirk-dialog-cancel:hover,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .secondary-btn:hover {
  background: rgba(48, 48, 45, 0.14);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .hotkey-grid input {
  border-color: var(--wg-field-border);
  background: var(--wg-field);
  color: var(--wg-ink);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .hotkey-grid input.listening {
  border-color: var(--wg-accent-pressed);
  box-shadow: var(--wg-ring);
  background: #fff;
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .chirk-dialog-actions {
  background: var(--wg-surface-2);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .chirk-dialog-danger .chirk-dialog-ok {
  background: var(--wg-danger);
  color: #fff;
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .chirk-dialog-danger .chirk-dialog-ok:hover {
  background: var(--wg-danger-hover);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .chirk-dialog-choice {
  border-color: var(--wg-surface-border);
  color: var(--wg-ink);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .chirk-dialog-choice:hover {
  background: var(--wg-surface-2);
}

html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .chirk-dialog-choice:has(input:checked) {
  background: rgba(199, 164, 102, 0.18);
  border-color: var(--wg-accent-pressed);
}

/* ───────────────────────── v3.11.0: новые элементы в «Тёплом графите» ───────────────────────── */
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .profile-gate-title,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .profile-settings-title,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .profile-settings-name,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .profile-menu-head-text b,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .profile-menu-item {
  color: var(--wg-ink);
}
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .profile-gate-note,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .profile-menu-head-text span,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .profile-chip-caret {
  color: var(--wg-ink-3);
}
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .profile-gate-create {
  background: var(--wg-surface-2);
  border-color: var(--wg-field-border);
  color: var(--wg-ink);
}
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .profile-gate-create:hover {
  background: var(--wg-surface-3);
}
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .profile-gate-card .simple-menu-field input,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .profile-gate-card .simple-menu-field select {
  background: var(--wg-field);
  border-color: var(--wg-field-border);
  color: var(--wg-ink);
}
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .profile-gate-notice {
  background: var(--wg-surface-2);
  border-color: var(--wg-surface-border);
  color: var(--wg-warning);
}
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .profile-chip {
  background: var(--wg-field);
  border-color: var(--wg-field-border);
  color: var(--wg-ink);
}
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .profile-chip:hover {
  border-color: var(--wg-accent-pressed);
}
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .profile-menu-popover,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .profile-settings-card {
  background: var(--wg-surface);
  border-color: var(--wg-surface-border);
  box-shadow: var(--wg-shadow);
}
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .profile-menu-item:hover {
  background: var(--wg-surface-2);
}
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) #profileLogoutBtn {
  color: var(--wg-danger);
}
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .selection-actions {
  background: var(--wg-panel);
  border: 1px solid var(--wg-panel-border);
}
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .selection-action-btn {
  background: var(--wg-panel-raised);
  color: var(--wg-text);
}
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .selection-action-btn:hover {
  background: var(--wg-panel-hover);
}
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .text-size-control {
  background: var(--wg-panel-raised);
  color: var(--wg-text-2);
}
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .text-size-control select {
  background: var(--wg-panel-inset);
  border-color: var(--wg-panel-border);
  color: var(--wg-text);
}
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .tool-btn.icon-only.active {
  box-shadow: 0 0 0 2px var(--wg-accent-hover);
}
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .tool-btn:focus-visible,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .selection-action-btn:focus-visible,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .profile-chip:focus-visible,
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .profile-menu-item:focus-visible {
  outline-color: var(--wg-accent);
}
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .board-toast {
  background: var(--wg-panel);
  color: var(--wg-text);
}
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .board-toast[data-kind="error"] {
  background: var(--wg-danger-hover);
}
html:is([data-ui-theme="warm-graphite"], [data-ui-theme="pony"]) .board-toast[data-kind="ok"] {
  background: var(--wg-success);
}

/* ───────────────────────── v4.2 «Пони» ─────────────────────────
   Оболочка интерфейса: те же правила, что у «Тёплого графита» (селекторы html:is(…graphite…, …pony…) выше),
   со своими переменными — сливово-лавандовые панели, кремово-лавандовые карточки, розовые акценты.
   Декор (наклейки, облака, звёзды, уголок с луной) — отдельно: themes/pony/pony.css и pony.js, загружаются
   только при выборе этой темы. Цвета объектов доски, аватаров и курсоров участников НЕ меняются. */

html[data-ui-theme="pony"] {
  --wg-bg: #3a2950;
  --wg-panel: #4a3466;
  --wg-panel-raised: #5a4279;
  --wg-panel-hover: #6a5089;
  --wg-panel-pressed: #523a70;
  --wg-panel-inset: #3d2b55;
  --wg-panel-card: #553d72;
  --wg-panel-border: #7d62a0;
  --wg-panel-divider: #644a84;
  --wg-text: #fff7fd;
  --wg-text-2: #e8d9f3;
  --wg-text-disabled: #a996bf;
  --wg-accent: #f7a1cf;
  --wg-accent-hover: #fbbadd;
  --wg-accent-pressed: #ee86bd;
  --wg-accent-ink: #9b2e6a;
  --wg-on-accent: #3a1838;
  --wg-surface: #fdf8ff;
  --wg-surface-2: #f6ecfb;
  --wg-surface-3: #eddcf6;
  --wg-field: #fffcfe;
  --wg-surface-border: #ddc9ec;
  --wg-field-border: #c9b0de;
  --wg-ink: #3a2950;
  --wg-ink-2: #5a4672;
  --wg-ink-3: #67537f;
  --wg-danger: #b02a55;
  --wg-danger-hover: #951f46;
  --wg-danger-on-dark: #ffb3c9;
  --wg-danger-soft: #fbdbe6;
  --wg-danger-soft-hover: #f6c8d8;
  --wg-danger-ink: #8e1f45;
  --wg-success: #3f7a57;
  --wg-success-on-dark: #a8e0bd;
  --wg-warning: #8a4f1f;
  --wg-shadow: 0 8px 24px rgba(40, 22, 60, 0.24);
  --wg-shadow-soft: 0 4px 14px rgba(40, 22, 60, 0.14);
  --wg-ring: 0 0 0 3px rgba(247, 161, 207, 0.45);

  --bg: #3a2950;
  --text: #3a2950;
  --muted: #67537f;
  --accent: #d9468f;
  --accent-soft: rgba(247, 161, 207, 0.32);
  --danger: #b02a55;
  accent-color: #d9468f;
}

/* Главный экран и экран входа: светлый кремово-лавандовый фон вместо графитового. */
html[data-ui-theme="pony"] body {
  background: linear-gradient(160deg, #fbf3ff 0%, #f3e6fb 55%, #fde9f4 100%);
  background-attachment: fixed;
}

html[data-ui-theme="pony"] .menu-restore-btn:hover { background: rgba(247, 161, 207, 0.18); }
html[data-ui-theme="pony"] .auto-room-hint { background: #f6e3f6; color: #5a2d5c; }
html[data-ui-theme="pony"] .board-member-chip.is-following { box-shadow: 0 0 0 3px rgba(247, 161, 207, 0.4); }
html[data-ui-theme="pony"] .sync-access-bar { background: #7a2d55; }
html[data-ui-theme="pony"] .sync-bar-btn:hover { background: #fffcfe; }
html[data-ui-theme="pony"] .chirk-dialog-choice:has(input:checked) { background: rgba(247, 161, 207, 0.2); }

/* Холст: при белом фоне доски (по умолчанию) холст прозрачный, под ним — слой темы (themes/pony/pony.css).
   Если у доски свой цвет фона — он рисуется как обычно и закрывает узор. */
html[data-ui-theme="pony"] .board-screen { background: #f8f1fc; }
html[data-ui-theme="pony"] #boardCanvas { background: transparent; position: relative; z-index: 1; }

/* Переключатель: три варианта. */
.ui-theme-menu-section .ui-theme-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ui-theme-menu-section .ui-theme-option { padding: 0 4px; }

/* «Анимация темы» — показывается только при выбранной теме «Пони». */
.ui-theme-anim { display: none; }
html[data-ui-theme="pony"] .ui-theme-anim {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  min-height: 36px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  color: var(--panel-text-strong, #fff);
}
html[data-ui-theme="pony"] .ui-theme-switch-home .ui-theme-anim { color: var(--wg-ink); margin-top: 4px; font-size: 12px; min-height: 28px; }
.ui-theme-anim input { width: 18px; height: 18px; margin: 0; accent-color: #d9468f; }

/* «Пони»: главный экран и вход — светлый кремово-лавандовый фон (у графита там тёмный --wg-bg) */
html[data-ui-theme="pony"] .simple-menu-screen,
html[data-ui-theme="pony"] .screen.menu-screen {
  background: linear-gradient(160deg, #fbf3ff 0%, #f3e6fb 55%, #fde9f4 100%);
}
