:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f7f8fb;
  --border: #e4e8ef;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #5b5de9;
  --accent-weak: #eef0ff;
  --shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
  --shadow-sm: 0 6px 16px rgba(15, 23, 42, 0.08);
  /* Единый цвет текста ошибок и деструктивных подписей в UI */
  --error-text: #c62828;
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Apple Color Emoji",
    "Segoe UI Emoji";
  background: var(--bg);
  color: var(--text);
}

/* Скрытие до проверки сессии (см. auth-early-guard.js, meta wb-require-auth). */
html.wb-auth-pending body {
  visibility: hidden !important;
}

.topbar {
  height: 60px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2000;
}

.topbarLink {
  font-weight: 600;
  color: #0f172a;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.2px;
  text-decoration: none;
}

.topbarLink:hover {
  color: var(--accent);
}

/* Boards Sidebar */
.boardsSidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.05);
  z-index: 2100;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.boardsSidebar.hidden {
  transform: translateX(-100%);
  display: flex; /* Keep it flex but moved out of view */
}

.sidebarHeader {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
}

.sidebarTitle {
  font-weight: 700;
  font-size: 16px;
}

.sidebarBody {
  padding: 16px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.fullWidth {
  width: 100%;
}

.boardsList {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.boardItem {
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 1px solid transparent;
}

.boardItem:hover {
  border-color: #cbd5e1;
}

.boardItem.active {
  background: var(--text);
  color: #fff;
}

.boardItem.active .boardTitle {
  color: #fff;
}

.boardItem.active .boardMeta {
  color: rgba(255, 255, 255, 0.7);
}

.boardItem .boardTitle {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.boardItem .boardMeta {
  font-size: 11px;
  color: var(--muted);
}

.loading {
  text-align: center;
  padding: 20px;
  color: var(--muted);
  font-size: 13px;
}

/* Facilitation Toolbar Icons */
.facilitation-toolbar svg {
  flex-shrink: 0;
}

/* Facilitation Toolbar */
.facilitation-toolbar-group {
  position: fixed;
  top: 10px;
  right: 15px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 2001;
}


.facilitation-toolbar {
  position: fixed;
  top: 10px;
  right: 15px;
  height: 52px;
  background: white;
  border-radius: 100px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  padding: 0 6px 0 16px;
  gap: 4px;
  z-index: 2001;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.facilitation-toolbar-group .facilitation-toolbar {
  position: static;
  top: auto;
  right: auto;
  z-index: auto;
}

.ft-section {
  display: flex;
  align-items: center;
  gap: 4px;
}

.layerToggle {
  padding: 4px;
  border-radius: 999px;
  background: #f3f4f6;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.layerToggleBtn {
  border: none;
  background: transparent;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
}

.layerToggleIcon {
  width: 20px;
  height: 20px;
  display: block;
}

.layerToggleBtn.active {
  background: #111827;
  color: #ffffff;
}

.ft-divider {
  width: 1px;
  height: 24px;
  background: #e5e7eb;
  margin: 0 8px;
}

.ft-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: 100px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.2s;
  color: #1f2937;
}

.primaryLink {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #2563eb;
  font-weight: 600;
  text-decoration: none;
}

.primaryLink:hover {
  text-decoration: underline;
}

.notificationsPage {
  padding: 32px;
}

.notificationsPanel {
  background: #ffffff;
  border-radius: 24px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  padding: 24px 32px;
  max-width: 680px;
  margin: 0 auto;
}

.notificationsPanel .modalHeader {
  padding-left: 0;
  padding-right: 0;
}


.notificationGroup {
  padding: 24px 0;
}

.notificationGroupDivided {
  border-bottom: 1px solid #e5e7eb;
}

.notificationGroupHeader {
  margin-bottom: 16px;
}

.notificationGroupTitle {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 3px;
  color: #111827;
}

.notificationGroupSubtitle {
  font-size: 13px;
  color: #6b7280;
  margin: 0;
}

.notificationRow {
  padding: 4px 0;
  border-bottom: 1px solid #f3f4f6;
}

.notificationRowLast {
  border-bottom: none;
}

.notificationRowLabel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  padding: 10px 12px;
  border-radius: 8px;
  margin: 0 -12px;
  transition: background 0.12s ease;
}

.notificationRowLabel:hover {
  background: var(--surface-2);
}

.notificationRowLabel input[type="checkbox"] {
  margin-top: 2px;
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: #111827;
}

.notificationRowText {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.notificationRowTitle {
  font-size: 14px;
  font-weight: 500;
  color: #111827;
}

.notificationRowDesc {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.4;
}

/* ── Notification toggle switch ───────────────────────── */
.notifToggleWrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  cursor: pointer;
}

.notifToggleWrap input[type="checkbox"] {
  position: absolute !important;
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
  pointer-events: none;
}

.notifToggleSlider {
  width: 36px;
  height: 20px;
  background: #d1d5db;
  border-radius: 10px;
  position: relative;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.notifToggleSlider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
}

.notifToggleWrap input:checked ~ .notifToggleSlider {
  background: var(--accent);
}

.notifToggleWrap input:checked ~ .notifToggleSlider::after {
  transform: translateX(16px);
}

.notifToggleWrap input:focus-visible ~ .notifToggleSlider {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 10px;
}

/* ── Section header with icon + toggle-all ────────────── */
.notificationGroupHeaderRow {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.notificationGroupTitleBlock {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.notifToggleAllBtn {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  white-space: nowrap;
  line-height: 1;
  transition: color 0.12s ease;
  margin-top: 5px;
  font-family: inherit;
}

.notifToggleAllBtn:hover {
  color: var(--accent);
}

/* ── Row entrance animation ───────────────────────────── */
@keyframes notifRowIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0);   }
}

.notifRowAnimated {
  animation: notifRowIn 0.28s ease both;
}

/* ── Inline save indicator ────────────────────────────── */
.notifPageHeaderRow {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.notifSaveIndicator {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.notifSaveIndicator.visible {
  opacity: 1;
}

.basicSettingsRow {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
}

.basicSettingsRow label {
  font-weight: 600;
  color: #111827;
}

.basicSettingsSelect {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #111827;
}

.basicSettingsSelect:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.ft-btn:hover {
  background: #f3f4f6;
}

.ft-btn.facilitate {
  padding-left: 0;
  gap: 12px;
}

.ft-btn.facilitate svg {
  width: 28px;
  height: 28px;
}

.ft-btn.share {
  background: #e11d48; /* Red from screenshot */
  color: white;
  padding: 0 20px;
}

.ft-btn.share svg {
  width: 20px;
  height: 20px;
}

.ft-btn.share:hover {
  background: #be123c;
}

.ft-icon-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #1f2937;
  transition: all 0.2s;
}

.ft-icon-btn:hover {
  background: #f3f4f6;
}

#timerMenuItem.timerReadOnly {
  color: #64748b;
}

#timerMenuItem.timerReadOnly:not(.timerBarBtn):not(.timerExpiredState) {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
}

#timerMenuItem.timerReadOnly:not(.timerBarBtn):not(.timerExpiredState):hover {
  background: #f8fafc;
}

.ft-icon-btn.help {
  margin-left: 4px;
}

.downloadWrap {
  position: relative;
  display: inline-flex;
}

.downloadIcon {
  width: 20px;
  height: 20px;
  display: block;
}

.authorHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.authorHeader .panelTitle {
  margin: 0 !important;
}
.authorValue {
  display: flex;
  align-items: center;
  gap: 8px;
}

.infoRow {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  gap: 8px;
}
.infoRow .label {
  margin-bottom: 0;
}
.infoAvatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
}
.infoName {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.infoDate {
  font-size: 13px;
  color: var(--muted);
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.activityIcon {
  width: 20px;
  height: 20px;
  display: block;
}
.paramsIcon {
  width: 20px;
  height: 20px;
  display: block;
}

.deleteIcon {
  width: 20px;
  height: 20px;
  display: block;
}

.downloadMenu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  padding: 8px;
  min-width: 200px;
  z-index: 3001;
  display: flex;
  flex-direction: column;
}

.downloadMenu.hidden {
  display: none;
}
.ft-icon-btn.params {
  color: #1f2937;
}

.ft-profile {
  position: relative;
  width: 40px;
  height: 40px;
  margin-left: 8px;
  cursor: pointer;
}

.ft-profile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 0 0 1px #e5e7eb;
}

.ft-label {
  font-family: inherit;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-decoration: none;
  color: inherit;
  position: relative;
}
.brandBack {
  display: none;
  width: 32px;
  height: 32px;
  place-items: center;
  color: #0f172a;
}
.brand:hover .brandMark,
.brand:hover .brandLogo {
  display: flex;
}
.brand:hover .brandBack {
  display: none;
}
.brand::after {
  content: attr(data-hint);
  position: absolute;
  left: 0;
  top: calc(100% + 10px);
  background: #18191b;
  color: #fff;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 1001;
  font-weight: 400;
}
.brand::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 100%;
  border: 6px solid transparent;
  border-bottom-color: #18191b;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 1001;
}
.brand:hover::after,
.brand:hover::before {
  display: none;
}
.brandMark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s;
}
.brandMark:hover {
  background: #4a4cd6;
}
.brandText {
  font-size: 15px;
}
.brandLogo {
  margin-left: 0;
  display: flex;
  align-items: center;
  height: 20px; /* 100% of 20px hamburger height */
  user-select: none;
  pointer-events: none;
}
.brandLogo img {
  height: 100%;
  width: auto;
  display: block;
}
.boardNameContainer {
  display: flex;
  align-items: center;
  margin-left: 8px;
  height: 32px;
  position: relative;
}
.boardNameDisplay {
  padding: 4px 8px;
  border: 2px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  transition: border-color 0.2s;
}
.boardNameDisplay:hover {
  border-color: #3b82f6; /* Blue border 2px on hover */
}
.containerOptionsBtn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  color: #1f2937;
  transition: all 0.2s;
  margin-left: 2px;
}
.containerOptionsBtn:hover,
.containerOptionsBtn.active {
  background: #f0f9ff; /* bg-sky-50 */
}
.containerMenu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 8px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  padding: 8px;
  min-width: 240px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
}
.containerMenu.hidden {
  display: none;
}
.menuItem {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 13px;
  font-weight: 500;
  color: #1f2937;
  position: relative;
}
.menuItem.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}
.menuItem:hover {
  background: #f3f4f6;
}
.menuItem.danger {
  color: var(--error-text);
}
.menuItem.danger:hover {
  background: #fef2f2;
}
.menuIcon {
  width: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4b5563;
}
.menuItem.danger .menuIcon {
  color: var(--error-text);
}
.menuLabel {
  flex: 1;
}
.menuShortcut {
  font-size: 11px;
  color: #9ca3af;
  margin-left: auto;
}
.menuChevron {
  font-size: 16px;
  color: #9ca3af;
  margin-left: auto;
}
.menuSeparator {
  height: 1px;
  background: #e5e7eb;
  margin: 6px 8px;
}
.submenu {
  position: absolute;
  left: calc(100% - 4px);
  top: -8px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  padding: 8px;
  min-width: 200px;
  display: none;
  flex-direction: column;
  z-index: 3001;
}
.menuItem.hasSubmenu:hover > .submenu {
  display: flex;
}
.boardNameInput {
  padding: 4px 8px;
  border: 2px solid #3b82f6;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  outline: none;
  min-width: 150px;
  background: #fff;
}
.userAvatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.userAvatarFallback {
  width: 100%;
  height: 100%;
  background: #3b82f6;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: bold;
}
.spacer {
  flex: 1;
}
.topbarGroup {
  display: flex;
  align-items: center;
  gap: 8px;
}

button {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
button:hover:not(:disabled) {
  border-color: rgba(15, 23, 42, 0.12);
}
button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 10px 22px rgba(91, 93, 233, 0.25);
}
button.ghost {
  background: var(--surface-2);
  box-shadow: none;
}
button.toolBtn {
  width: 100%;
  text-align: left;
}
button.small {
  padding: 6px 10px;
  font-size: 12px;
}

input {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 8px;
  border-radius: 10px;
  outline: none;
  min-width: 170px;
  box-shadow: inset 0 1px 0 rgba(15, 23, 42, 0.04);
}

.field {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}
.field span {
  opacity: 0.9;
}
.field.compact input {
  min-width: 160px;
}
.field.small input {
  min-width: 72px;
  width: 72px;
  text-align: right;
}

.layout {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: auto;
}
.layout.space-pan-ready {
  cursor: grab;
}
body.space-panning .layout {
  cursor: grabbing;
  user-select: none;
}

.profilePage {
  min-height: 100vh;
  background: var(--bg);
  padding: 100px 20px 60px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.profilePanel {
  width: min(960px, 100vw);
  background: #fff;
  border-radius: 28px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 30px 60px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
}

.profilePageBody {
  padding-bottom: 40px;
}

.profileFormGrid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.shapeSection {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.shapeSection + .shapeSection {
  margin-top: 16px;
}

.shapeSectionTitle {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

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

.shapesGrid--icons {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.iconsGrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding-top: 8px;
}

.iconItemBtn {
  height: 64px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 8px;
}

.iconItemBtn:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-2px);
}

.iconItemBtn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

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

.shapeBtn,
.connectorBtn {
  height: 44px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #0f172a;
  transition: transform 0.08s ease, border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.shapeBtn svg,
.connectorBtn svg {
  width: 26px;
  height: 26px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
}

.shapeIcon {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shapeIconImg {
  width: 26px;
  height: 26px;
  display: block;
}

.shapeIcon--line .shapeIconImg {
  transform: scaleY(0.18);
}

.shapeIcon--parallelogram .shapeIconImg {
  transform: skewX(-15deg);
}

.shapeIcon--trapezoid .shapeIconImg {
  clip-path: polygon(12% 0, 88% 0, 100% 100%, 0 100%);
}

.shapeBtn:hover,
.connectorBtn:hover {
  background: #f8fafc;
  border-color: rgba(59, 130, 246, 0.35);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.shapeBtn.active,
.connectorBtn.active {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.textOptionsGrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 8px;
}

.textOptionItem {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.textOptionIcon {
  width: 100%;
  aspect-ratio: 1;
  background: #f1f3f5;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.textOptionItem:hover .textOptionIcon {
  background: #e9ecef;
}

.textOptionLabel {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
}

.facilitatePopover {
  position: fixed;
  right: 20px;
  top: 76px;
  width: 320px;
  max-height: calc(100% - 100px);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #4B384C;
  font-family: var(--font-main);
}

.facilitatePopover.hidden {
  display: none;
}

.notificationsBar {
  position: fixed;
  right: 20px;
  top: 76px;
  width: 320px;
  max-height: calc(100% - 100px);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #1f2937;
  font-family: var(--font-main);
}

.notificationsBar.hidden {
  display: none;
}

.notifBarHeader {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

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

.notifBarTitle {
  font-weight: 600;
  font-size: 16px;
}

.notifBarActions {
  display: flex;
  align-items: center;
  gap: 2px;
}

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

.notifUnreadLabel {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.notifUnreadSwitch {
  flex-shrink: 0;
}

.notifIconBtn {
  width: 28px !important;
  height: 28px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: #6b7280;
  text-decoration: none;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.notifIconBtn:hover {
  background: #f3f4f6;
  color: #1f2937;
}

.notifTabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  padding: 0 16px;
}

.notifTab {
  padding: 10px 12px 8px;
  font-size: 13px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  user-select: none;
  transition: color 0.15s, border-color 0.15s;
}

.notifTab:hover {
  color: #1f2937;
}

.notifTab.active {
  color: #1d4ed8;
  border-bottom-color: #1d4ed8;
  font-weight: 600;
}

.notifContent {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.notifLoading {
  padding: 32px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

.notifLoading.hidden {
  display: none;
}

.notifList {
  display: flex;
  flex-direction: column;
}

.notifList.hidden {
  display: none;
}

.notifItem {
  padding: 12px 14px;
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: default;
  transition: background 0.1s;
}

.notifItem:hover {
  background: #f9fafb;
}

.notifItem.unread {
  background: #eff6ff;
}

.notifItem.unread:hover {
  background: #dbeafe;
}

.notifItemMessage {
  font-size: 13px;
  color: #1f2937;
  line-height: 1.4;
}

.notifItemMeta {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.notifItemDot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #1d4ed8;
  flex-shrink: 0;
}

.notifEmpty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  text-align: center;
}

.notifEmpty.hidden {
  display: none;
}

.notifEmptyFlag {
  font-size: 52px;
  margin-bottom: 12px;
  line-height: 1;
}

.notifEmptyText {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.notifFooter {
  border-top: 1px solid var(--border);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  background: #f9fafb;
}

.notifFooterHint {
  font-size: 11px;
  color: var(--muted);
}

.notifNavBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 5px;
  border: 1px solid #d1d5db;
  border-radius: 3px;
  font-size: 11px;
  background: #fff;
  color: #374151;
  cursor: pointer;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  line-height: 1.2;
  transition: background 0.1s, border-color 0.1s;
}

.notifNavBtn:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

.notifNavBtn:active {
  background: #e5e7eb;
}

.notifNavBtn:focus {
  outline: none;
}

.notifItem.navFocused {
  outline: 2px solid #1d4ed8;
  outline-offset: -2px;
}

.ft-icon-btn.notifBtn {
  color: #374151;
}

.participantsBar {
  position: fixed;
  right: 20px;
  top: 76px;
  width: 320px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #4B384C;
  font-family: var(--font-main);
}

.participantsBar.hidden {
  display: none;
}

.participantsHeader {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.participantsTitle {
  font-weight: 600;
  font-size: 16px;
}

.participantsBody {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.participantsList {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 426px; /* Approx 7 items (54px each + 8px gap) */
  overflow-y: auto;
  padding-right: 4px;
}

.participantsList::-webkit-scrollbar {
  width: 6px;
}

.participantsList::-webkit-scrollbar-track {
  background: transparent;
}

.participantsList::-webkit-scrollbar-thumb {
  background: #e2e8f0;
  border-radius: 10px;
}

.participantsList::-webkit-scrollbar-thumb:hover {
  background: #cbd5e1;
}

.participantItem {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid transparent;
}

.participantItem.active {
  border-color: rgba(14, 165, 233, 0.6);
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.15);
}

.participantAvatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
  background: #f3f4f6;
  border: 1px solid rgba(15, 23, 42, 0.1);
}

.participantMeta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.participantNameRow {
  display: flex;
  align-items: center;
  gap: 6px;
}

.participantName {
  font-weight: 600;
  font-size: 14px;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.participantStatusDot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
}

.participantRole {
  font-size: 12px;
  color: #6b7280;
}

.participantsManageBtn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: #374151;
  font-weight: 600;
  font-size: 13px;
}

.participantsManageBtn:hover {
  border-color: rgba(15, 23, 42, 0.12);
  background: #f9fafb;
}

.participantsManageIcon {
  width: 16px;
  height: 16px;
  display: block;
}

.layoutsBar {
  position: fixed;
  right: 20px;
  top: 76px;
  width: 320px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #4B384C;
  font-family: var(--font-main);
}

.layoutsBar.hidden {
  display: none;
}

.layoutsHeader {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.layoutsTitle {
  font-weight: 600;
  font-size: 16px;
}

.layoutsBody {
  padding: 10px 12px;
}

.layoutsBody .zoomMenu {
  width: 100%;
  min-width: 0;
  box-shadow: none;
  border: 1px solid var(--border);
}

:root {
  --activity-bar-width: 320px;
  --activity-bar-gap: 16px;
}

.activityBar {
  position: fixed;
  right: 20px;
  top: 76px;
  bottom: 90px;
  width: var(--activity-bar-width);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #4B384C;
  font-family: var(--font-main);
}

.activityBar.withParams {
  right: calc(20px + var(--activity-bar-width) + var(--activity-bar-gap));
}

.activityBar.hidden {
  display: none;
}

.activityHeader {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.activityTitle {
  font-weight: 600;
  font-size: 16px;
}

.activityBody {
  padding: 12px 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.facilitatePopover .popoverHeader {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.headerTitleRow {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
}

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

.statusIndicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.1);
  display: none; /* Hidden by default, shown when status is set */
}

.statusIndicator.status-1 { 
  background-color: #22c55e; 
  display: block; 
  animation: status-pulse-green 4s infinite ease-in-out;
} /* Active - Green */
.statusIndicator.status-2 { background-color: #94a3b8; display: block; } /* Inactive - Gray */
.statusIndicator.status-3 { background-color: #ef4444; display: block; } /* Deleted - Red */
.statusIndicator.status-4 { background-color: #a855f7; display: block; } /* Archive - Purple */
.statusIndicator.status-5 { background-color: #ffffff; display: block; border: 1px solid #cbd5e1; } /* Draft - White */

@keyframes status-pulse-green {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

.card-title .statusIndicator,
.section-main-title .statusIndicator {
  width: 8px;
  height: 8px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 8px;
  margin-top: -2px;
}

.titleLabel {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 16px;
  color: #4B384C;
}

.regionMeta {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
  margin-left: auto;
  text-align: right;
  flex: 0 0 auto;
}

body.focusMode .topbar,
body.focusMode .boardsSidebar,
body.focusMode .facilitation-toolbar,
body.focusMode .facilitatePopover,
body.focusMode .notificationsBar,
body.focusMode .activityBar,
body.focusMode .participantsBar,
body.focusMode .layoutsBar,
body.focusMode .drawToolbar,
body.focusMode .tool-sidebar-left,
body.focusMode #stickyToolbar,
body.focusMode #connectionToolbar,
body.focusMode #imageToolbar,
body.focusMode #miniMap,
body.focusMode #zoomHudWrap {
  display: none !important;
}

.facilitatePopover .popoverBody {
  padding: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.facilitatePopover .panel {
  padding: 12px 16px;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  margin: 0;
}

.facilitatePopover .panelTitle {
  font-size: 13px;
  font-weight: 600;
  color: #4B384C;
  text-transform: none;
  margin: 0 0 12px 0;
}

.facilitatePopover .label,
.facilitatePopover .propRow .label,
.facilitatePopover .linkField .label {
  font-size: 13px;
  color: #4B384C;
}

/* Position and Size Grid */
.grid2x2 {
  display: grid;
  grid-template-columns: repeat(2, 80px); /* Уменьшил ширину колонок */
  gap: 8px 12px;
}

.field {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 24px 4px 8px;
  height: 32px;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
}

.field input {
  width: 100%;
  border: none;
  outline: none;
  font-size: 14px;
  padding: 0;
  color: #4B384C;
  background: #fff;
  text-align: left;
  box-shadow: none;
  /* Hide arrows in Chrome, Safari, Edge, Opera */
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
}

.field input:disabled {
  color: var(--muted);
  background: #f5f5f5;
}

/* Hide arrows in Firefox */
.field input[type=number] {
  appearance: textfield;
  -webkit-appearance: textfield;
  -moz-appearance: textfield;
}

/* Specific Webkit hide arrows */
.field input::-webkit-outer-spin-button,
.field input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.field .label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  text-align: right;
  pointer-events: none;
}

/* Button Row (Layering, Border) */
.buttonRow {
  display: flex;
  gap: 8px;
}

.facilitatePopover .borderPanelRow {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  width: 100%;
}

.facilitatePopover .borderPanelRow .panelTitle {
  margin: 0;
  white-space: nowrap;
  flex: 0 0 auto;
}

.facilitatePopover .borderPanelRow .buttonRow {
  gap: 2px;
  flex: 1 1 auto;
  justify-content: flex-end;
}

.facilitatePopover .borderPanelRow .toolBtn {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 5px;
}

.facilitatePopover .borderPanelRow .toolBtn svg {
  width: 16px;
  height: 16px;
}

.facilitatePopover .layeringPanelRow {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  width: 100%;
}

.facilitatePopover .layeringPanelRow .panelTitle {
  margin: 0;
  white-space: nowrap;
  flex: 0 0 auto;
}

.facilitatePopover .layeringPanelRow .buttonRow {
  gap: 2px;
  flex: 1 1 auto;
  justify-content: flex-end;
}

.facilitatePopover .layeringPanelRow .toolBtn {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 5px;
}

.facilitatePopover .layeringPanelRow .toolBtn svg {
  width: 16px;
  height: 16px;
}

.toolBtn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  color: #4B384C;
  padding: 0;
}

.toolBtn:hover {
  background: var(--surface-2);
}

.toolBtn.active {
  background: #E8EDFF;
  border-color: #5B5DE9;
  color: #5B5DE9;
}

.toolBtn.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* Properties Panel (Colors, Opacity) */
.propertiesPanel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.drawColorMode {
  display: inline-flex;
  gap: 6px;
}

.drawColorModeBtn {
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.drawColorModeBtn.active {
  background: #111827;
  color: #ffffff;
  border-color: #111827;
}

.drawColorModeRow.hidden {
  display: none;
}

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

.propRow .label {
  font-size: 13px;
  color: #4B384C;
}

.propRow input[type="color"] {
  width: 60px;
  min-width: 0;
  height: 29px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  background: #fff;
  -webkit-appearance: none;
  appearance: none;
}

.propRow input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.propRow input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 6px;
}

.propRow input[type="color"]:disabled {
  filter: none;
  background: #e5e7eb;
  border-color: #d1d5db;
  cursor: not-allowed;
}

.rangeWrap {
  flex: 0 0 150px;
  width: 150px;
  max-width: 150px;
  min-width: 0;
  display: flex;
  align-items: center;
  margin-left: auto;
}

.rangeWrap input[type="range"] {
  width: 100%;
  height: 4px;
  background: #e5e7eb;
  border-radius: 999px;
  appearance: none;
  min-width: 0;
  cursor: pointer;
}

.rangeWrap input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  background: #e5e7eb;
  border-radius: 999px;
}

.rangeWrap input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #cbd5f0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.15);
  margin-top: -5px;
}

.rangeWrap input[type="range"]::-moz-range-track {
  height: 4px;
  background: #e5e7eb;
  border-radius: 999px;
}

.rangeWrap input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #cbd5f0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.15);
}

/* Select Wrap */
.selectWrap {
  position: relative;
  width: 100%;
}

.selectWrap select {
  width: 100%;
  appearance: none;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 32px 6px 12px;
  font-size: 14px;
  color: #4B384C;
  cursor: pointer;
  outline: none;
}

.selectWrap select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.selectWrap .chevron {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  opacity: 0.6;
}

/* Collapsible Panel */
.collapsible {
  padding: 0 !important;
}

.panelHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
}

.panelHeader:hover {
  background: var(--surface-2);
}

.panelHeader .panelTitle {
  margin: 0;
}

.panelHeader .chevron {
  transition: transform 0.2s;
}

.collapsible.expanded .panelHeader .chevron {
  transform: rotate(180deg);
}

.panelContent {
  display: none;
  padding: 0 16px 16px 16px;
}

.collapsible.expanded .panelContent {
  display: block;
}

/* Links Hint */
.hint {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #4B384C;
  margin-bottom: 12px;
}

.hint .icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
}

/* Footer Row */
.footerRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.switch {
  position: relative;
  display: inline-block;
  width: 28px;
  height: 14px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #e5e7eb;
  border-radius: 999px;
  transition: background 0.2s;
}

.switch .slider::before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 0;
  top: 0;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.switch input:checked + .slider {
  background: #5b5de9;
}

.switch input:checked + .slider::before {
  transform: translateX(14px);
}

.scrollbarToggle {
  cursor: pointer;
  color: var(--muted);
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
}

/* Transform Search (Mockup) */
.transformToSearch {
  margin-top: 12px;
}

.searchInput {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #F8F9FA;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  margin-bottom: 8px;
}

.searchInput input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  width: 100%;
}

.transformOptions {
  max-height: 200px;
  overflow-y: auto;
}

.transformOption {
  padding: 8px 12px;
  font-size: 14px;
  cursor: pointer;
  border-radius: 4px;
}

.transformOption:hover {
  background: var(--surface-2);
}

.transformOption.active {
  background: #E8EDFF;
  color: #5B5DE9;
}

#paramsBtn {
  font-weight: 700;
  color: #1f2937;
}
#paramsBtn:hover {
  background: #f3f4f6;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  overflow: auto;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  overflow: auto;
  box-shadow: var(--shadow);
}
.panelTitle {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin: 4px 0 10px;
}

.slides {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.slideBtn {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  cursor: pointer;
}
.slideBtn.active {
  border-color: rgba(91, 93, 233, 0.5);
  box-shadow: 0 0 0 1px rgba(91, 93, 233, 0.25) inset;
  background: #fff;
}
.slideBtn .title {
  font-weight: 600;
}
.slideBtn .meta {
  color: var(--muted);
  font-size: 12px;
}

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

.kv {
  font-size: 12px;
  line-height: 1.4;
  padding: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}
.muted {
  color: var(--muted);
}

.stageWrap {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  min-width: 100%;
  position: relative;
}
.stageHint {
  color: var(--muted);
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px dashed var(--border);
  align-self: flex-start;
}
.stickyToolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  position: fixed;
  z-index: 5000;
  white-space: nowrap;
}
.stickyToolbar.hidden {
  display: none;
}
.toolbarSection {
  display: flex;
  align-items: center;
  gap: 6px;
}
.toolbarDivider {
  width: 1px;
  height: 22px;
  background: var(--border);
}
.toolbarBtn {
  padding: 6px 8px;
  border-radius: 10px;
  font-size: 12px;
  min-width: 28px;
  text-align: center;
  box-shadow: none;
}
.toolbarBtn.active {
  border-color: rgba(91, 93, 233, 0.4);
  box-shadow: 0 0 0 2px rgba(91, 93, 233, 0.15) inset;
}

#connectionToolbar .toolbarBtn {
  width: 28px;
  height: 28px;
  min-width: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.layerSelect {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
}
.lockPicker {
  position: relative;
}
.lockBtn {
  display: flex;
  align-items: center;
  gap: 4px;
}
.lockMenu {
  position: absolute;
  top: 36px;
  left: 0;
  min-width: 240px;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  z-index: 5001;
}
.lockMenu.hidden {
  display: none;
}
.lockBtn:hover {
  background: #f0f9ff; /* bg-sky-50 */
}
.lockBtn.active {
  background: #0ea5e9; /* bg-sky-500 */
  color: #ffffff;
}
.lockBtn.active .chevron {
  color: #ffffff;
}
.lockOption {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #1f2937;
  transition: all 0.2s;
}
.lockOption:hover {
  background: #0ea5e9; /* sky-500 */
  color: #ffffff;
}
.lockOption:hover .lockIcon,
.lockOption:hover .shortcut,
.lockOption:hover .check {
  color: #ffffff;
}
.lockIcon {
  width: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4b5563;
}
.lockOption .label {
  flex: 1;
}
.lockOption .shortcut {
  font-size: 11px;
  color: #9ca3af;
  margin-left: 12px;
}
.lockOption .check {
  width: 14px;
  color: #3b82f6;
  opacity: 0;
  margin-left: auto; /* Push checkmark to the right */
}
.lockOption.active .check {
  opacity: 1;
}
.fontBtn {
  min-width: 170px;
  justify-content: space-between;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
}
.chevron {
  font-size: 11px;
  color: var(--muted);
}
.fontMenu {
  position: absolute;
  top: 36px;
  left: 0;
  min-width: 190px;
  max-height: 260px;
  overflow: auto;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  z-index: 20;
}
.fontMenu.hidden {
  display: none;
}
.fontOption {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  box-shadow: none;
  font-size: 13px;
  text-align: left;
}
.fontOption:hover {
  background: var(--surface-2);
}
.fontOption.active {
  background: var(--accent-weak);
  border-color: rgba(91, 93, 233, 0.4);
}
.fontOption .check {
  width: 14px;
  color: var(--accent);
  opacity: 0;
}
.fontOption.active .check {
  opacity: 1;
}
.fontOption .label {
  flex: 1;
}
.fontSizeValue {
  min-width: 26px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}
.rotationControl {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 4px;
}
.rotationIcon {
  font-size: 14px;
  color: var(--muted);
  font-weight: 700;
}
.rotationInput {
  width: 6ch;
  max-width: 6ch;
  min-width: 0;
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 6px;
  padding: 2px 3px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  box-sizing: content-box;
}
.rotationInput:focus {
  outline: none;
  border-color: var(--accent);
}
.rotationUnit {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.colorPicker {
  position: relative;
}

.linkPicker {
  position: relative;
}
.colorBtn {
  min-width: 44px;
}
.fillIcon {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: var(--accent-weak);
  border: 1px solid rgba(15, 23, 42, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.connColorIcon {
  width: 18px;
  height: 18px;
  display: block;
}
.borderIcon {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 2px solid rgba(15, 23, 42, 0.75);
  display: inline-block;
}
.alignIcon {
  width: 18px;
  height: 18px;
  display: block;
}
.colorPopover {
  position: absolute;
  top: 36px;
  left: 0;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  z-index: 3001;
}
.colorPopover.hidden {
  display: none;
}

.linkPopover {
  position: absolute;
  top: 36px;
  left: 0;
  min-width: 220px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  z-index: 3001;
}

.linkPopover.hidden {
  display: none;
}

.linkPopoverBody {
  display: grid;
  gap: 10px;
}

.linkField {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.linkField input {
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 0 10px;
  font-size: 13px;
  color: var(--text);
  background: #fff;
}

.linkPopoverActions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.toolsLinkPanel {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}
.colorGrid {
  display: grid;
  grid-template-columns: repeat(6, 22px);
  gap: 6px;
}
.colorSwatch {
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: var(--swatch);
  box-shadow: none;
}
.colorSwatch.active {
  outline: 2px solid rgba(91, 93, 233, 0.8);
  outline-offset: 1px;
}
.stage {
  position: relative;
  flex: 1;
  background: var(--surface);
  min-width: 10000px;
  min-height: 10000px;
}
.stageLayer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.slide-region.selected {
  box-shadow: 0 0 0 2px #0ea5e9 inset, 0 0 0 2px #0ea5e9;
}
.connectionsLayer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.cursorsLayer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10000;
}

.remote-cursor {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 10001;
  will-change: transform;
}

.remote-cursor-icon-container {
  color: var(--cursor-color, #3b82f6);
}

.remote-cursor-icon {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
  z-index: 10002;
}

.remote-cursor-bubble {
  position: absolute;
  left: 14px;
  top: 14px;
  /* Light background mixed with user color */
  background: color-mix(in srgb, var(--cursor-color, #3b82f6) 15%, white);
  border: 2px solid var(--cursor-color, #3b82f6);
  padding: 3px 12px 3px 4px;
  border-radius: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  pointer-events: none;
  min-height: 32px;
  z-index: 10001;
}

.remote-cursor-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(0,0,0,0.05);
  background: white;
}

.remote-cursor-text {
  font-size: 14px;
  font-weight: 600;
  color: color-mix(in srgb, var(--cursor-color, #3b82f6) 80%, black);
  white-space: nowrap;
}

.element.locked-by-other {
  pointer-events: none !important;
  opacity: 0.8;
}

.element.locked-by-other::after {
  content: '🔒';
  position: absolute;
  top: -10px;
  right: -10px;
  font-size: 14px;
  background: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  z-index: 10;
}
.connection-path {
  fill: none;
  stroke: #000;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: stroke;
  cursor: pointer;
}
.connection-path-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 15;
  pointer-events: stroke;
  cursor: pointer;
}
.connection-path.selected {
  stroke: #3b82f6;
}
.connection-arrowhead {
  fill: #000;
  pointer-events: all;
  cursor: pointer;
}
.connection-endpoint-handle {
  fill: #3b82f6;
  stroke: white;
  stroke-width: 2;
  cursor: grab;
  pointer-events: all;
}
.connection-endpoint-handle:active {
  cursor: grabbing;
}
.connection-path.selected + .connection-arrowhead {
  fill: #3b82f6;
}

.connection-label-handle {
  cursor: move;
  pointer-events: all;
}

.connection-label-bg {
  fill: #ffffff;
  stroke: rgba(15, 23, 42, 0.2);
  stroke-width: 1;
}

.connection-label-text {
  fill: #111827;
  font-size: 12px;
  font-weight: 600;
  user-select: none;
  pointer-events: none;
}

.connectionLabelEditor {
  position: fixed;
  z-index: 6100;
  min-width: 140px;
  max-width: 320px;
  height: 30px;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid rgba(91, 93, 233, 0.35);
  background: #ffffff;
  color: #111827;
  font-size: 12px;
  font-weight: 600;
  outline: none;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.15);
}

/* Connection dropdown popovers (type/style) */
.typePopover {
  position: absolute;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 3001;
  min-width: 180px;
}

.typeOption {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
  border: 1px solid transparent;
  background: transparent;
  width: 100%;
  text-align: left;
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
}

.typeOption:hover {
  background: var(--surface-2);
}

.typeOption.active {
  background: #e0f2fe;
  border-color: rgba(14, 165, 233, 0.2);
  color: #1f2937;
}

.typeOption .check {
  margin-left: auto;
  opacity: 0;
}

.typeOption.active .check {
  opacity: 1;
}

.typeIcon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
}

.connTypeBtn {
  font-size: 18px;
  padding: 0 8px;
  min-width: 40px;
}

.connStyleMenuBtn {
  width: 28px;
  min-width: 28px;
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lineStyleMenuIcon {
  width: 18px;
  height: 18px;
  display: block;
}

.lineStylePreview path {
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.lineStylePreview .is-dotted {
  stroke-dasharray: 1 5;
}

.lineStylePreview .is-dashed {
  stroke-dasharray: 6 3;
}

.lineStylePreview .is-loosely-dashed {
  stroke-dasharray: 8 5;
}
.grid {
  background-image: radial-gradient(rgba(15, 23, 42, 0.15) 1px, transparent 1px);
  background-size: 30px 30px;
  background-position: 0px 0px; 
}

.element.no-border {
  border: none !important;
}
.element {
  position: absolute;
  border-radius: 12px;
  border: 3px solid #000000;
  box-shadow: none;
  user-select: none;
}
.element-region-tag {
  position: absolute;
  left: 6px;
  bottom: 6px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  color: #0f172a;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 6px;
  padding: 2px 6px;
  pointer-events: none;
}
.element.type-image {
  border: none;
}
.element.selected {
  cursor: grab;
}
.element.selected.editing {
  cursor: default;
}
.element.dragging {
  cursor: grabbing;
}
body.dragging {
  cursor: grabbing;
}
.element.selected {
  outline: 1px solid #3b82f6;
  outline-offset: 0;
}
.element.type-draw.selected {
  outline: none;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.35), 0 0 16px rgba(59, 130, 246, 0.2);
}
.element.type-text.selected,
.element.type-text.selected.editing {
  outline-width: 2px;
}
.element.selected.editing {
  outline: 1px solid #3b82f6;
  outline-offset: 0;
}
.element.focused {
  outline: 1px solid rgba(59, 130, 246, 0.55);
  outline-offset: 0;
}
.resize-handle {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid #3b82f6;
  display: none;
  z-index: 10;
}
.element.selected .resize-handle {
  display: block;
}
.resize-handle.tl {
  left: -4px;
  top: -4px;
  cursor: nwse-resize;
}
.resize-handle.tr {
  right: -4px;
  top: -4px;
  cursor: nesw-resize;
}
.resize-handle.bl {
  left: -4px;
  bottom: -4px;
  cursor: nesw-resize;
}
.resize-handle.br {
  right: -4px;
  bottom: -4px;
  cursor: nwse-resize;
}

.side-handle {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #3b82f6;
  display: none;
  z-index: 10;
  transition: background 0.1s;
}
.side-handle:hover {
  background: #3b82f6;
}
.element.selected .side-handle {
  display: block;
}
.element.show-side-handles .side-handle {
  display: block;
}
.group-selection-active .element.selected .side-handle {
  display: none;
}

.side-handle.t {
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
}
.side-handle.b {
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
}
.side-handle.l {
  left: -20px;
  top: 50%;
  transform: translateY(-50%);
}
.side-handle.r {
  right: -20px;
  top: 50%;
  transform: translateY(-50%);
}

.rotate-handle {
  position: absolute;
  right: -13px;
  bottom: -13px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #3b82f6;
  border: 2px solid #fff;
  display: none;
  z-index: 11;
  cursor: grab;
}
.rotate-handle:active {
  cursor: grabbing;
}
.element.selected .rotate-handle {
  display: block;
}
.group-selection-active .element.selected .rotate-handle {
  display: none;
}
/* Increase hit area for the small rotate handle */
.rotate-handle::before {
  content: "";
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
}

.reactionBtn {
  position: absolute;
  left: 10px;
  bottom: -18px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.18);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  padding: 0;
  z-index: 5;
}
.reactionBtn.inside {
  display: none;
  position: static;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
  color: var(--text);
  opacity: 1;
  transition: transform 0.2s;
  align-items: center;
  justify-content: center;
}
.element.focused:not(.selection-preview) .reactionBtn.inside,
.element.selected:not(.selection-preview) .reactionBtn.inside {
  display: flex;
}
body.group-selection-active .reactionBtn.inside {
  display: none !important;
}
.reactionBtn.inside:hover {
  transform: scale(1.1);
  background: var(--bg);
}
.reactionBtn.inside svg {
  width: 20px;
  height: 20px;
  stroke: var(--text);
}
.reactionBtn.hidden {
  display: none;
}
.element.focused .reactionBtn:not(.inside) {
  display: flex;
}
.element.selected .reactionBtn:not(.inside),
.element.editing .reactionBtn:not(.inside) {
  display: none;
}

.reactionBar {
  position: absolute;
  left: 0;
  top: calc(100% + 10px);
  transform: none;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: var(--surface);
  box-shadow: var(--shadow);
  z-index: 12;
}
.reactionBar.hidden {
  display: none;
}

.reactionSummary {
  position: absolute;
  left: 10px;
  top: calc(100% - 8px); /* Overlap by ~20% of pill height (34px) */
  width: calc(100% - 20px);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 6px;
  padding: 0;
  z-index: 11;
  pointer-events: auto;
}
.reactionSummary.hidden {
  display: none;
}

.reactionPill {
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
  border-radius: 999px;
  padding: 0 10px;
  height: 34px;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}
.reactionPill.active {
  border-color: #0969da;
  background: #ffffff;
}
.reactionPill .cnt {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}
.reactionItem {
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
  border-radius: 10px;
  padding: 6px 8px;
  font-size: 16px;
  line-height: 1;
  position: relative;
}
.reactionItem:hover {
  background: var(--surface-2);
}
.reactionItem.active {
  background: #ffffff;
  border-color: rgba(37, 99, 235, 0.5);
}
.reactionCount {
  position: absolute;
  right: -4px;
  top: -4px;
  min-width: 14px;
  height: 14px;
  padding: 0 4px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.88);
  color: #fff;
  font-size: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.reactionItem.more {
  font-size: 18px;
  padding: 4px 8px;
}

.emojiPicker {
  position: absolute;
  left: 0;
  top: calc(100% + 56px);
  transform: none;
  width: 360px;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: var(--surface);
  box-shadow: var(--shadow);
  z-index: 13;
  overflow: hidden;
}
.emojiPicker.hidden {
  display: none;
}
.emojiPickerHeader {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.emojiSearch {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 12px;
}
.emojiGrid {
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 6px;
  max-height: 320px;
  overflow: auto;
}
.emojiCell {
  border: 1px solid transparent;
  background: transparent;
  box-shadow: none;
  border-radius: 10px;
  padding: 8px 0;
  font-size: 18px;
  line-height: 1;
}
.emojiCell:hover {
  background: var(--surface-2);
}

.contextMenu {
  position: fixed;
  min-width: 240px;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: var(--surface);
  box-shadow: var(--shadow);
  z-index: 999;
}
.contextMenu.hidden {
  display: none;
}
.contextItemWrapper {
  position: relative;
  width: 100%;
}
.contextItemRow {
  display: flex;
  align-items: center;
}
.contextItem {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 10px;
  box-shadow: none;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.contextItem:hover {
  background: var(--surface-2);
}
.contextItemRow:hover .contextItem {
  background: var(--surface-2);
}
.contextSubmenu {
  position: absolute;
  left: calc(100% - 4px);
  top: 0;
  min-width: 220px;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: var(--surface);
  box-shadow: var(--shadow);
  display: none;
  z-index: 1000;
}
.contextItemWrapper.open > .contextSubmenu {
  display: block;
}
.contextIcon {
  width: 18px;
  text-align: center;
  color: rgba(15, 23, 42, 0.75);
}
.contextLabel {
  flex: 1;
}
.contextChevron {
  color: var(--muted);
  font-size: 10px;
}

.contextChevronBtn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  padding: 0 4px;
}
.contextShortcut {
  color: var(--muted);
  font-size: 11px;
  margin-left: auto;
  padding-left: 20px;
}
.contextSeparator {
  height: 1px;
  background: var(--border);
  margin: 6px 4px;
}

.stickyInner {
  width: 100%;
  height: 100%;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-sizing: border-box;
}
.stickyTextBox {
  flex: 1;
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: rgba(15, 23, 42, 0.85);
  font: 600 14px/1.25 ui-sans-serif, system-ui;
  white-space: pre-wrap;
  word-break: break-word;
  box-sizing: border-box;
  padding: 4px 10px;
  overflow: hidden;
  display: grid;
  place-content: center;
  text-align: center;
}
.element.selected:not(.editing) .stickyInner .stickyTextBox,
.element.selected:not(.editing) .textBox,
.element.selected:not(.editing) .shapeTextBox {
  pointer-events: none;
}
.stickyRow {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(15, 23, 42, 0.7);
}
.chip {
  background: rgba(15, 23, 42, 0.1);
  border-radius: 999px;
  padding: 3px 8px;
  font-weight: 600;
}
.tagList {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag {
  background: rgba(15, 23, 42, 0.12);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 700;
}

.textBox {
  padding: 10px;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  background: #fff;
  color: rgba(15, 23, 42, 0.9);
  font-weight: 700;
  overflow: hidden;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.textBox[contenteditable="true"] {
  outline: none;
}

.imageBox {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.05);
}
.imageBox img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.shapeBox {
  width: 100%;
  height: 100%;
  overflow: visible;
  position: relative;
}
.shapeBox svg {
  display: block;
  overflow: visible;
}
.shapeTextWrapper {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  pointer-events: none;
}
.shapeTextBox {
  width: 100%;
  padding: 10px;
  color: rgba(15, 23, 42, 0.9);
  font-weight: 600;
  font-size: 12px;
  background: transparent;
  overflow: visible;
  outline: none;
  box-sizing: border-box;
  text-align: center;
  word-wrap: break-word;
  white-space: pre-wrap;
  pointer-events: auto;
}
.shapeTextBox:empty:before {
  content: attr(data-placeholder);
  color: rgba(15, 23, 42, 0.35);
  text-align: center;
  display: block;
  width: 100%;
  pointer-events: none;
}

.textColorPicker {
  margin-left: 6px;
  position: relative;
}

.textColorIcon {
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
  border-bottom: 2px solid currentColor;
  line-height: 1;
}

body.exporting .topbar,
body.exporting .toolbar,
body.exporting .boardsSidebar,
body.exporting .facilitation-toolbar,
body.exporting #stickyToolbar,
body.exporting #imageToolbar,
body.exporting #connectionToolbar,
body.exporting #zoomHudWrap,
body.exporting #miniMap,
body.exporting #facilitatePopover,
body.exporting #topRightPopovers,
body.exporting .toastContainer {
  display: none !important;
}

.comments {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 100px;
}
.comment {
  padding: 8px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.comment .meta {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}
.commentComposer {
  margin-top: 8px;
  display: flex;
  gap: 8px;
}
.commentComposer input {
  flex: 1;
  min-width: 0;
}

.logsControls {
  display: flex;
  gap: 10px;
  align-items: center;
}
.logs {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.log {
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 12px;
  padding: 12px;
}
.log--rich {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.logHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.logTitle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 13px;
  color: #1f2937;
}
.logAuthor {
  font-weight: 500;
  color: var(--text-main);
  margin-top: 2px;
}

.logHeader .muted {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  line-height: 1.2;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.logBody {
  display: flex;
  gap: 12px;
  align-items: stretch;
}
.logContent {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 120px;
  font-size: 13px;
  color: #111827;
}
.logDetail {
  line-height: 1.35;
  word-break: break-word;
}
.logMeta {
  font-size: 11px;
  line-height: 1.3;
  color: #a3a8b5;
  word-break: break-all;
  margin-top: auto;
}
.logEmpty {
  font-size: 12px;
  color: var(--muted);
}
.logPreview {
  width: 120px;
  height: 120px;
  border-radius: 12px;
  border: 1px dashed var(--border);
  background: var(--surface-1);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.logPreviewStage {
  width: 100%;
  height: 100%;
  position: relative;
}
.logPreviewPlaceholder {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  padding: 6px;
}
.logPreview.is-deleted::after {
  content: "Удалено";
  position: absolute;
  inset: auto 8px 8px 8px;
  background: rgba(15, 23, 42, 0.8);
  color: #fff;
  font-size: 11px;
  text-align: center;
  padding: 4px 6px;
  border-radius: 999px;
}
.logPreview .resize-handle,
.logPreview .side-handle,
.logPreview .rotate-handle,
.logPreview .reactionBar,
.logPreview .reactionSummary,
.logPreview .emojiPicker,
.logPreview .reactionBtn {
  display: none !important;
}
.logPreview .textBox,
.logPreview .shapeTextBox,
.logPreview .stickyTextBox {
  pointer-events: none;
}
.log .t {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}
.pill {
  background: var(--accent-weak);
  border: 1px solid rgba(91, 93, 233, 0.2);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
}
.log pre {
  margin: 8px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: rgba(15, 23, 42, 0.7);
  font-size: 12px;
}

/* Settings Modal */
.settingsModal {
  width: min(560px, 92vw);
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.settingsTabs {
  padding: 0 24px;
  border-bottom: 1px solid #e5e7eb;
}

.settingsTab {
  padding: 12px 16px;
  background: none;
  border: none;
  box-shadow: none;
  color: #3b82f6;
  font-weight: 600;
  font-size: 14px;
  border-bottom: 2px solid #3b82f6;
  border-radius: 0;
  cursor: pointer;
}

.settingsBody {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-height: 60vh;
  overflow-y: auto;
}

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

.settingsLabel {
  font-size: 13px;
  font-weight: 700;
  color: #1f2937;
}

.settingsInput {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
}

.settingsInput:focus {
  border-color: #3b82f6;
}

.canvasColorGrid {
  display: flex;
  gap: 12px;
  padding: 8px;
  border: 2px solid #3b82f6;
  border-radius: 8px;
}

.canvasColorItem {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  border: 1px solid #e5e7eb;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 12px;
}

.settingsRadioGroup {
  display: flex;
  gap: 40px;
}

.settingsRadio {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.settingsRadio input {
  width: 20px;
  height: 20px;
  min-width: 20px;
}

.radioContent {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}

.radioIcon {
  color: #374151;
}

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

.settingsSelect {
  flex: 1;
  padding: 10px 12px;
  border: 2px solid #94a3b8;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  background: #fff;
}

.listenBtn {
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: none;
  box-shadow: none;
  font-weight: 700;
  font-size: 14px;
  color: #1f2937;
}

.avatarThemeGrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.avatarThemeCard {
  background: #f3f4f6;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
}

.avatarThemeCard.active {
  background: #18191b;
  color: #fff;
}

.themeIcons {
  font-size: 24px;
}

.themeLabel {
  font-size: 13px;
  font-weight: 700;
}

.modalFooter {
  padding: 16px 24px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.modalFooter button {
  padding: 10px 20px;
  font-size: 14px;
}

.modalFooter .primary.danger {
  background: #e11d48;
  border-color: #e11d48;
}

.modalCloseBtn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1.5px solid #3b82f6;
  background: #fff;
  color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
  z-index: 10;
}

.modalCloseBtn:hover {
  background: #f8fafc;
}

.checkEmailModal {
  width: 500px;
  padding: 40px;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  position: relative;
}

.checkEmailContent {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.checkEmailIcon {
  width: 120px;
  flex-shrink: 0;
  color: #0f172a;
}

.checkEmailText h1 {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 16px 0;
  color: #0f172a;
}

.checkEmailText p {
  font-size: 14px;
  line-height: 1.5;
  color: #334155;
  margin: 0 0 16px 0;
}

.checkEmailText .spamHint {
  color: #475569;
  margin: 24px 0 0 0;
}

.checkEmailText strong {
  color: #0f172a;
  font-weight: 600;
}

.toastContainer {
  position: fixed;
  bottom: 18px;
  right: 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  z-index: 10002;
  pointer-events: none;
}
.toastItem {
  background: #e0f2fe;
  border-radius: 14px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.2);
  pointer-events: auto;
  min-width: 220px;
}
.toastMessage {
  color: #0ea5e9;
  font-size: 13px;
  font-weight: 500;
}
.toastClose {
  border: none;
  background: transparent;
  color: #0ea5e9;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}
.hidden {
  display: none;
}

/* Restored topbar layout and transparency */
.topbar {
  border-bottom: none;
  background: transparent;
  backdrop-filter: none;
}
.topbar-slider {
  height: 56px;
  padding: 0 16px;
  gap: 20px;
}

.topbarLeft, .topbarRight {
  display: flex;
  align-items: center;
  min-width: 120px;
  gap: 8px;
  height: 100%;
}

.topbarLeft {
  gap: 12px;
  flex: 0 1 auto;
}

.topbarLogoLink {
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
  margin-top: 6px;
  margin-left: 7px;
  margin-right: 8px;
  padding-left: 0;
  text-decoration: none;
  color: inherit;
  transition: padding-left 0.2s ease;
}

.topbarLogoLink:hover {
  padding-left: 36px;
}

.topbarLogo {
  height: 28px;
  width: auto;
  display: block;
  object-fit: contain;
}

.topbarLogoBack {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  color: #111827;
}

.topbarLogoBackIcon {
  width: 100%;
  height: 100%;
  display: block;
}

.topbarLogoLink:hover .topbarLogoBack {
  opacity: 1;
}

/* Название доски в левом баре (объединён с логотипом) */
.topbarLeft .boardNameContainer {
  display: flex;
  align-items: center;
  margin-left: 0;
  background: var(--surface);
  height: 40px;
  padding: 0 14px;
  border-radius: 100px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.myBoardsBtn {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background 0.2s;
}

.myBoardsBtn:hover {
  background: var(--surface-2);
}

.myBoardsLabel {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.topbarDividerVertical {
  width: 1px;
  height: 20px;
  background: var(--border);
}

/* Toasts bottom-left */
.toastContainer {
  left: 18px;
  right: auto;
  align-items: flex-start;
}

/* Zoom HUD and grid menu */
.zoomHudWrap {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10001;
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: 8px;
}

.zoomHud {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 6px 8px;
  box-shadow: var(--shadow-sm);
}

.zoomHud-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.zoomHud-btn,
.zoomHud-value {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 10px;
  height: 32px;
  min-width: 32px;
  padding: 0 10px;
  font-weight: 600;
  cursor: pointer;
}

.zoomHud-btn.hidden {
  display: none;
}

.zoomHud-value {
  min-width: 56px;
}

.zoomMenu {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 180px;
}

.zoomMenu.hidden {
  display: none;
}

.zoomMenuItem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  font-weight: 600;
  color: #1f2937;
}

.zoomMenuIcon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
}

.zoomMenuItem:hover {
  background: var(--surface-2);
}

.zoomMenuItem.active {
  background: #e0f2fe;
  border-color: rgba(14, 165, 233, 0.2);
}

.zoomMenuCheck {
  opacity: 0;
}

.zoomMenuItem.active .zoomMenuCheck {
  opacity: 1;
}

.zoomMenuItem:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.layoutSettingsHeader {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
  cursor: default;
}

.layoutSettingsHeader:hover {
  background: transparent;
}

/* Layout grouping inside layouts popover */
.layoutGroup {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.layoutGroupHeader {
  width: 100%;
}

.layoutGroupHeader .zoomMenuIcon {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 800;
}

.layoutGroupItems {
  display: none;
  margin-left: 18px;
  padding-left: 10px;
  border-left: 2px solid rgba(15, 23, 42, 0.08);
}

.layoutGroupItems .zoomMenuItem {
  padding-left: 12px;
}

.layoutGroup:hover .layoutGroupItems,
.layoutGroup.is-open .layoutGroupItems {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.layoutGroup.is-disabled {
  opacity: 0.6;
}

.layoutGroup.is-disabled .layoutGroupItems {
  display: none !important;
}

/* Mini map */
.miniMap {
  position: fixed;
  right: 18px;
  bottom: 88px;
  width: 320px;
  height: 270px;
  border-radius: 12px;
  border: 1px solid rgba(14, 165, 233, 0.4);
  background: rgba(255, 255, 255, var(--mini-map-bg-alpha, 1));
  box-shadow: var(--shadow-sm);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  user-select: none;
  --mini-map-bg-alpha: 1;
}

.miniMap.hidden {
  display: none;
}

.miniMapHeader {
  height: 26px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-size: 12px;
  color: rgba(15, 23, 42, 0.7);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.8);
  border-bottom: 1px solid rgba(14, 165, 233, 0.2);
  cursor: grab;
}

.miniMapHeader:active {
  cursor: grabbing;
}

.miniMapBody {
  position: relative;
  flex: 1;
  background: rgba(255, 255, 255, var(--mini-map-bg-alpha, 1));
}

.miniMapFooter {
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 8px 4px;
  background: rgba(255, 255, 255, 0.8);
  border-top: 1px solid rgba(14, 165, 233, 0.2);
}

.miniMapFooter input[type="range"] {
  width: 90px;
  height: 4px;
  appearance: none;
  background: #e5e7eb;
  border-radius: 999px;
}

.miniMapFooter input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  background: #e5e7eb;
  border-radius: 999px;
}

.miniMapFooter input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #cbd5f0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.15);
  margin-top: -4px;
}

.miniMapFooter input[type="range"]::-moz-range-track {
  height: 4px;
  background: #e5e7eb;
  border-radius: 999px;
}

.miniMapFooter input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #cbd5f0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.15);
}

.miniMapBody canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.miniMapViewport {
  position: absolute;
  border: 1px solid #0ea5e9;
  background: rgba(14, 165, 233, 0.15);
  pointer-events: none;
  box-sizing: border-box;
}

/* Toolbar active states */
.ft-icon-btn.active {
  background: #e0f2fe;
  color: #0ea5e9;
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.2) inset;
}

.ft-icon-btn.invert-toggle {
  background: #ffffff;
  color: #111827;
  border: 1px solid rgba(15, 23, 42, 0.12);
}

.ft-icon-btn.invert-toggle.active {
  background: #111827;
  color: #ffffff;
  border-color: #111827;
}

.stage {
  min-width: 30000px;
  min-height: 30000px;
}

/* Tool Sidebar Left */
.tool-sidebar-left {
  position: fixed;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  background: #e5e7eb;
  border-radius: 20px;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1000;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

/* Режим только чтение: весь левый бар и потомки не реагируют на клики */
.tool-sidebar-left.read-only-inactive,
.tool-sidebar-left.read-only-inactive * {
  pointer-events: none !important;
}

.tool-item {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1f2937;
  cursor: pointer;
  border-radius: 12px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  border: 1px solid transparent;
}

.tool-item:hover {
  border-color: #94a3b8;
}

.tool-item.active {
  background: #1f2937;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.tool-item svg {
  width: 22px;
  height: 22px;
}

.tool-item-icon {
  width: 22px;
  height: 22px;
  display: block;
}

.tool-item.active svg {
  color: #ffffff;
}

.tool-item.active .tool-item-icon {
  filter: invert(1) brightness(2);
}

.drawToolbar {
  position: fixed;
  top: 68px;
  left: 50%;
  transform: translateX(-50%);
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 2000;
  color: #1f2937;
  font-family: var(--font-main);
}

.drawToolbar.hidden {
  display: none;
}

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

.drawLabel {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
}

.drawSwatch input[type="color"] {
  width: 32px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0;
  background: #fff;
}

.drawPresetRow {
  display: flex;
  gap: 6px;
}

.drawPreset {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.drawPreset .dot {
  display: block;
  border-radius: 999px;
  background: #111827;
}

.drawPreset.active {
  border-color: #111827;
  box-shadow: 0 0 0 2px rgba(17, 24, 39, 0.15);
}

.drawSlider input[type="range"] {
  width: 120px;
}

.drawTool {
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.drawTool.active {
  background: #111827;
  color: #ffffff;
  border-color: #111827;
}

.drawDoneBtn {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #ef4444;
  background: #ef4444;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}

body.drawMode #stage {
  cursor: crosshair;
}

.drawLayer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

.drawElementSvg {
  width: 100%;
  height: 100%;
  display: block;
}

.draw-live-path {
  pointer-events: none;
}

.tool-item::after {
  content: attr(data-hint);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  color: #fff;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 1001;
}

.tool-item:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.tool-item:hover::after {
  opacity: 1;
}

.tool-item.active {
  background: #3b82f6;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.tool-item:active {
  transform: scale(0.92);
}

.selection-frame {
  position: absolute;
  border: 1px dashed #0ea5e9;
  background: rgba(14, 165, 233, 0.5);
  pointer-events: none;
  z-index: 1000;
}

.element.selection-preview {
  outline: 3px solid #0ea5e9 !important;
  outline-offset: 0;
}

.table-widget.selection-preview {
  outline: 3px solid #0ea5e9 !important;
  outline-offset: 0;
}

.group-selection-frame {
  position: absolute;
  border: 2px dashed #0ea5e9;
  background: transparent;
  pointer-events: auto !important;
  z-index: 3000;
  cursor: grab;
}
.group-selection-frame:active {
  cursor: grabbing;
}

.selection-handle {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #fff;
  border: 1px solid #0ea5e9;
  border-radius: 3px;
}
.selection-handle.tl { left: -5px; top: -5px; }
.selection-handle.tr { right: -5px; top: -5px; }
.selection-handle.bl { left: -5px; bottom: -5px; }
.selection-handle.br { right: -5px; bottom: -5px; }

/* Slides modal */
.modal:not(.hidden) {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: grid;
  place-items: center;
}
.modalOverlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
}
.modalPanel {
  position: relative;
  z-index: 9001;
  background: #fff;
}
.modalPanel.slidesModal {
  width: min(980px, 92vw);
  height: min(720px, 86vh);
}

.modalPanel.deleteSlideModal {
  max-width: 600px;
  border-radius: 24px;
  padding: 32px;
}

.deleteSlideModal .modalHeader {
  border-bottom: none;
  padding: 0 0 24px 0;
}

.deleteSlideModal .modalTitle {
  font-size: 28px;
  font-weight: 700;
  color: #1a1a1a;
}

.deleteSlideModal .modalBody {
  padding: 0 0 32px 0;
  display: block;
  width: 100%;
}

.deleteConfirmText {
  font-size: 18px;
  line-height: 1.4;
  color: #1a1a1a;
  margin: 0;
  width: 100%;
}

.deleteSlideOwnerInfo {
  margin-top: 12px;
  font-size: 14px;
  text-align: right;
  width: 100%;
}

.deleteSlideOwnerInfo.is-owner {
  color: #065f46; /* Темно-зеленый */
}

.deleteSlideOwnerInfo.not-owner {
  color: var(--error-text);
}

#deleteSlideConfirmBtn:disabled {
  background-color: #f3f4f6;
  color: #9ca3af;
  cursor: not-allowed;
  opacity: 0.7;
}

.deleteSlideModal .modalFooter {
  border-top: 1px solid #eee;
  padding: 24px 0 0 0;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

#deleteSlideCancelBtn {
  background: white;
  border: 2px solid #3b82f6;
  color: #1a1a1a;
  padding: 10px 24px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 16px;
}

#deleteSlideCancelBtn:hover {
  background: #f8faff;
}

#deleteSlideConfirmBtn {
  background-color: #e11d48;
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 16px;
}

#deleteSlideConfirmBtn:hover {
  background-color: #be123c;
}

/* Timer modal */
.modalPanel.timerModalPanel {
  max-width: 420px;
  border-radius: 24px;
  padding: 32px;
}

.timerModalPanel .modalHeader {
  border-bottom: none;
  padding: 0 0 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.timerModalPanel .modalTitle {
  font-size: 28px;
  font-weight: 700;
  color: #1a1a1a;
}

.timerModalPanel .modalBody {
  padding: 0 0 24px 0;
}

.timerSetTimeSection {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.timerSetTimeLabel {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  margin: 0;
}

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

.timerStepBtn {
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  font-size: 24px;
  line-height: 1;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.timerStepBtn:hover {
  background: var(--surface-2);
  border-color: var(--muted);
}

.timerInputsWrap {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 16px;
  background: var(--surface);
}

.timerInputsWrap:focus-within {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-weak);
}

.timerInput {
  width: 3ch;
  min-width: 2ch;
  flex: 1;
  border: none;
  background: none;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  padding: 12px 4px;
}

.timerInput::-webkit-inner-spin-button,
.timerInput::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.timerInput[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.timerColon {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
}

.timerModalPanel .modalFooter.timerModalFooter {
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.timerModalPanel .modalFooter.timerModalFooter:has(.timerPauseBtn:not(.hidden)) {
  justify-content: space-between;
}

.timerModalPanel .modalFooter.timerModalFooter .timerStartBtn.hidden {
  display: none;
}

.timerModalPanel .modalFooter.timerModalFooter .timerStartBtn:not(.hidden) {
  width: 100%;
  max-width: 280px;
}

.timerModalPanel .modalFooter .timerTimerBtn.hidden {
  display: none;
}

.timerStartBtn {
  padding: 14px 24px;
  border-radius: 12px;
  border: none;
  background: #e11d48;
  color: white;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.timerStartBtn:hover {
  background: #be123c;
}

.timerTimerBtn {
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.timerPauseBtn {
  background: var(--accent);
  color: white;
  border: none;
}

.timerPauseBtn:hover {
  filter: brightness(1.05);
}

.timerFinishBtn {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.timerFinishBtn:hover {
  background: var(--surface-2);
}

/* Кнопка таймера в состоянии «Время вышло!» — медленное мерцание */
/* Кнопка таймера в виде убывающей красной полоски */
#timerMenuItem.timerBarBtn {
  position: relative;
  overflow: hidden;
  min-width: 100px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 10px;
  background: #1a1a1a;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

#timerMenuItem.timerBarBtn.timerReadOnly {
  border-color: rgba(203, 213, 225, 0.9);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

#timerMenuItem.timerBarBtn .timerBarFill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: #e11d48;
  border-radius: 9px 0 0 9px;
  transition: width 1s linear;
  z-index: 0;
}

#timerMenuItem.timerBarBtn .timerBarContent {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

#timerMenuItem.timerBarBtn .timerBarIcon {
  width: 18px;
  height: 18px;
  display: block;
  filter: brightness(0) invert(1);
}

#timerMenuItem.timerBarBtn .timerBarTime {
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Таймер на паузе: deep gray, иконка паузы */
#timerMenuItem.timerBarBtn.timerBarBtnPaused {
  background: #4b5563;
}

#timerMenuItem.timerBarBtn.timerBarBtnPaused .timerBarFill {
  display: none;
}

#timerMenuItem.timerBarBtn.timerBarBtnPaused .timerBarIcon {
  filter: brightness(0) invert(1);
}

#timerMenuItem.timerExpiredState {
  width: auto;
  min-width: 148px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 10px;
  background: #dc2626;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  white-space: nowrap;
  box-shadow: 0 10px 24px rgba(220, 38, 38, 0.28);
  animation: timerExpiredShake 0.9s ease-in-out infinite;
}

#timerMenuItem.timerExpiredState .timerExpiredLabel {
  display: inline-block;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  animation: timerExpiredFontPulse 8s ease-in-out infinite;
}

@keyframes timerExpiredFontPulse {
  0%, 100% {
    font-size: 14px;
  }
  50% {
    font-size: 17px;
  }
}

@keyframes timerExpiredShake {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
  }
  20% {
    transform: translate(-0.5px, 0.5px) rotate(-0.35deg);
  }
  40% {
    transform: translate(0.75px, -0.5px) rotate(0.35deg);
  }
  60% {
    transform: translate(-0.75px, -0.25px) rotate(-0.25deg);
  }
  80% {
    transform: translate(0.5px, 0.5px) rotate(0.25deg);
  }
}

.modalPanel.deletedSlideModal {
  max-width: 560px;
  border-radius: 24px;
  padding: 32px;
}

.deletedSlideModal .modalHeader {
  border-bottom: none;
  padding: 0 0 16px 0;
}

.deletedSlideText {
  font-size: 18px;
  line-height: 1.4;
  color: #1a1a1a;
  margin: 0;
}

.deletedSlideModal .modalFooter {
  border-top: 1px solid #eee;
  padding: 24px 0 0 0;
  display: flex;
  justify-content: flex-end;
}

#deletedSlideBackBtn {
  background: white;
  border: 2px solid #3b82f6;
  color: #1a1a1a;
  padding: 10px 24px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 16px;
}

#deletedSlideBackBtn:hover {
  background: #f8faff;
}

.modalPanel.profileModal {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  background: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0;
  z-index: 9500;
}

.profileModal .modalHeader {
  padding: 16px 60px;
  border-bottom: 1px solid #e5e7eb;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
}

.profileModal .modalTitle {
  font-size: 24px;
}

.profileBody {
  padding: 60px;
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
  overflow-y: auto;
  flex: 1;
}

#profileModal.modal:not(.hidden) {
  display: block;
  z-index: 9500;
}

#profileModal.modal {
  background: #fff;
}

#profileModal .modalOverlay {
  display: none;
}

.profileSection {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 40px;
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid #e5e7eb;
}

.profileSection:last-child {
  border-bottom: none;
}

.sectionTitle {
  font-size: 16px;
  font-weight: 700;
  color: #111827;
  margin: 0;
}

.profileInfoGrid {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.avatarSection {
  display: flex;
  align-items: center;
  gap: 24px;
}

.avatarColumn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.profileAvatarLarge {
  width: 120px;
  height: 120px;
  border-radius: 24px;
  overflow: hidden;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
}

.profileAvatarLarge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatarMeta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
  text-align: left;
}

.fileTypes {
  font-size: 12px;
  color: #6b7280;
}

.changePhotoBtn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.profileStatusBlock {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.statusLabel {
  font-size: 12px;
  color: #6b7280;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.statusValue {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
}

.profileStatusBlock .debugInfo {
  margin-top: 6px;
  text-align: center;
}

.formGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

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

.formGroup.fullWidth {
  grid-column: span 2;
}

.formGroup label {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}

.formGroup input, 
.formGroup select,
.formGroup textarea {
  padding: 10px 12px;
  border-radius: 8px;
  border: 2px solid #e5e7eb;
  font-size: 15px;
  transition: border-color 0.2s;
  background: #fff;
  font-family: inherit;
}

.formGroup textarea {
  resize: vertical;
  min-height: 80px;
}

.formGroup input:focus,
.formGroup select:focus,
.formGroup textarea:focus {
  border-color: #3b82f6;
  outline: none;
}

.formGroup input[readonly] {
  background-color: #f9fafb;
  color: #6b7280;
  cursor: not-allowed;
  border-color: #e5e7eb;
}

.fieldHint {
  font-size: 12px;
  color: #6b7280;
  margin: 4px 0 0;
}

.debugInfo {
  margin-top: 8px;
  font-family: monospace;
  color: #3b82f6;
}

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

.debugToggleBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  color: #374151;
  padding: 0;
}

.debugToggleBtn:hover {
  background: #f3f4f6;
}

.debugToggleBtn[aria-expanded="true"] .debugChevron {
  transform: rotate(180deg);
}

.debugChevron {
  display: inline-block;
  transition: transform 0.15s ease;
}

.sectionContent {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sectionText {
  font-size: 14px;
  color: #4b5563;
  line-height: 1.5;
  margin: 0;
}

.linkBtn {
  background: none;
  border: none;
  padding: 0;
  color: #111827;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.linkBtn:hover {
  text-decoration: underline;
}

.checkboxGroup {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.checkboxGroup input[type="checkbox"] {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  cursor: pointer;
}

.checkboxLabel {
  font-size: 14px;
  font-weight: 600;
  color: #4b5563;
}

.link {
  color: #111827;
  text-decoration: underline;
  font-weight: 600;
}

.danger.ghost:hover {
  background: #fef2f2;
  border-color: var(--error-text);
  color: var(--error-text);
}

.tool-popover {
  position: absolute;
  left: 0;
  top: 0;
  max-height: calc(100vh - 100px);
  height: 600px;
  width: 260px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  color: var(--text);
}

#toolPopoversContainer {
  position: absolute;
  left: calc(100% + 12px);
  top: 0;
  pointer-events: none;
}

#toolPopoversContainer .tool-popover {
  pointer-events: auto;
}
.tool-popover.hidden {
  display: none;
}
#tablesPopover {
  width: 280px;
  height: min(700px, calc(100vh - 100px));
}
.popoverHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 6px;
}
.popoverTitle {
  font-size: 14px;
  font-weight: 700;
}
.popoverBody {
  padding: 0 14px 14px;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
.popoverDesc {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
  margin-bottom: 12px;
}
.tablesTemplateList {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tableTemplateCard {
  width: 100%;
  border: 1px solid #d7dde7;
  border-radius: 10px;
  background: #fff;
  padding: 8px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.tableTemplateCard:not(:disabled) {
  cursor: pointer;
}
.tableTemplateCard:not(:disabled):hover {
  border-color: #9db6ef;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}
.tableTemplateCard:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.tableTemplateCard--active {
  border-color: #7fa4ea;
}
.tableTemplateTitle {
  font-size: 12px;
  font-weight: 700;
  color: #111827;
}
.tableTemplatePreview {
  height: 92px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #f8fafc;
  position: relative;
  overflow: hidden;
}
.tableTemplateGrid {
  position: absolute;
  inset: 10px;
  border: 1px solid #9ca3af;
  border-right: 0;
  border-bottom: 0;
  background:
    linear-gradient(to right, #9ca3af 1px, transparent 1px),
    linear-gradient(to bottom, #9ca3af 1px, transparent 1px);
}
.tableTemplateGrid--3x2 {
  background-size: calc(100% / 3) 100%, 100% calc(100% / 3);
}
.tableTemplatePreview--smart::before,
.tableTemplatePreview--table::before,
.tableTemplatePreview--freeform::before,
.tableTemplatePreview--grid::before {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 4px;
  background: #e5e7eb;
}
.tableTemplatePreview--smart::after {
  content: "";
  position: absolute;
  left: 20px;
  right: 20px;
  top: 22px;
  bottom: 22px;
  border: 1px solid #cfd5de;
}
.tableTemplatePreview--table::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: 18px;
  bottom: 18px;
  background:
    linear-gradient(to right, #9ca3af 1px, transparent 1px),
    linear-gradient(to bottom, #9ca3af 1px, transparent 1px);
  background-size: calc(100% / 3) 100%, 100% calc(100% / 3);
}
.tableTemplatePreview--freeform::after {
  content: "";
  position: absolute;
  left: 24px;
  top: 24px;
  width: 26px;
  height: 26px;
  background: #cdd4de;
  box-shadow: 92px 8px 0 #cdd4de, 44px 44px 0 #cdd4de;
}
.tableTemplatePreview--grid::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: 18px;
  bottom: 18px;
  background:
    linear-gradient(to right, #d1d5db 2px, transparent 2px),
    linear-gradient(to bottom, #d1d5db 2px, transparent 2px);
  background-size: calc(100% / 6) 100%, 100% calc(100% / 3);
}
.stickyTabs {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.stickyTab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 0;
  border: none;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  transition: all 0.2s;
  font-size: 11px;
}
.stickyTab:hover {
  color: var(--text);
  background: transparent;
}
.stickyTab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Import Popover */
#importPopover {
  width: 320px;
  height: min(800px, calc(100vh - 100px));
  top: 50%;
  transform: translateY(-50%);
}
.imageSearchBox {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #fff;
  border: 2px solid #94a3b8;
  border-radius: 10px;
  margin-bottom: 16px;
  transition: border-color 0.2s;
}
.imageSearchBox:focus-within {
  border-color: var(--accent);
}
.imageSearchBox .searchIcon {
  color: #64748b;
  flex-shrink: 0;
}
.imageSearchBox input {
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  width: 100%;
  min-width: 0;
  font-size: 14px;
  box-shadow: none;
  font-weight: 500;
  color: var(--text);
}
.imageSearchBox input::placeholder {
  color: #94a3b8;
}

.imageTabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.imageTab {
  padding: 8px 12px;
  border: none;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  border-bottom: 2px solid transparent;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
}
.imageTab:hover {
  color: var(--text);
}
.imageTab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.imagesEmptyState {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
  color: var(--muted);
}
.emptyIllustration {
  margin-bottom: 16px;
  color: #cbd5e1;
}
.emptyText {
  font-size: 13px;
  margin-bottom: 16px;
  font-weight: 500;
}
.importBtn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  transition: all 0.2s;
}
.importBtn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}
.importBtn svg {
  color: #64748b;
}

/* Import Popover */
.importOption {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background: #f8fafc;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}
.importOption:hover {
  background: #f1f5f9;
  transform: translateY(-2px);
}
.importOption.large {
  flex-direction: row;
  padding: 20px;
  gap: 16px;
  width: 100%;
}
.importOption.large .importIcon {
  width: 48px;
  height: 48px;
  background: #fff;
  border-radius: 12px;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.importOption.large .importLabel {
  font-size: 14px;
  font-weight: 700;
}
.importGrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 16px;
}
.importOption .importIcon {
  color: #475569;
}
.importOption .importLabel {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  text-align: center;
}

.shape-icon {
  width: 16px;
  height: 16px;
  background: #52525b;
  border-radius: 3px;
}
.shape-icon.rectangle {
  width: 22px;
  height: 14px;
}
.shape-icon.circle {
  border-radius: 50%;
}
.stickyColorGrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.stickyColorGrid.shape-rectangle {
  grid-template-columns: repeat(3, 1fr);
}
.stickyColorItem {
  aspect-ratio: 1;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.1s, aspect-ratio 0.2s;
}
.stickyColorGrid.shape-rectangle .stickyColorItem {
  aspect-ratio: 1.6 / 1;
}
.stickyColorGrid.shape-circle .stickyColorItem {
  border-radius: 50%;
}
.stickyColorItem:hover {
  transform: scale(1.02);
}
.corner-fold {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 16px;
  height: 16px;
  background: rgba(0, 0, 0, 0.1);
  clip-path: polygon(100% 0, 0 100%, 100% 100%);
}
.modalHeader {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
}
.modalTitle {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-right: 8px;
}
.modalSearch {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(15, 23, 42, 0.15);
  border-radius: 10px;
  padding: 6px 10px;
  background: #fff;
}
.modalSearch input {
  border: none;
  box-shadow: none;
  padding: 4px 0;
  min-width: 0;
}
.modalSearch input:focus {
  outline: none;
}
.searchIcon {
  font-size: 14px;
  color: var(--muted);
}
.iconBtn {
  border: none;
  background: transparent;
  box-shadow: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.iconBtn:hover {
  background: rgba(15, 23, 42, 0.08);
}
.slidesStrip {
  background: #f1f3f5;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  padding: 10px 16px;
}
.stripTitle {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.slidesStripList {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.slideThumb {
  min-width: 160px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 12px;
  padding: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}
.slideThumb.active {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}
.slideThumbTitle {
  font-size: 13px;
  font-weight: 600;
}
.slideThumbMeta {
  font-size: 11px;
  color: var(--muted);
}
.slideThumbActions {
  display: flex;
  gap: 6px;
}
.slideThumbActions button {
  padding: 4px 6px;
  font-size: 11px;
  border-radius: 8px;
  box-shadow: none;
}
.slideThumb input {
  width: 100%;
  font-size: 13px;
  padding: 4px 6px;
  border-radius: 8px;
}

.modalBody {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 0;
  flex: 1;
  min-height: 0;
}
.templatesSidebar {
  border-right: 1px solid rgba(15, 23, 42, 0.08);
  padding: 16px 12px;
  background: #f7f8fb;
  overflow: auto;
}
.sidebarSectionTitle {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.templateGroups {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.templateGroup {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  color: #374151;
}
.templateGroup.active {
  background: #111827;
  color: #fff;
}
.templateGroup .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.6;
}
.templatesContent {
  padding: 16px 18px;
  overflow: auto;
}
.templatesHeader {
  margin-bottom: 12px;
}
.templatesTitle {
  font-weight: 700;
}
.templatesSubtitle {
  font-size: 12px;
  color: var(--muted);
}
.templatesGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}
.templateCard {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.templateCard.selected {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}
.templatePreview {
  height: 110px;
  background: #e5e7eb;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: rgba(15, 23, 42, 0.6);
}
.templateInfo {
  padding: 10px;
  font-size: 13px;
  font-weight: 600;
}
.modalFooter {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  background: #fff;
}

/* Remove Account Modal Flow */
#removeAccountModal {
  z-index: 10000; /* Absolute top */
}

.removeAccountModalPanel {
  position: relative;
  z-index: 10001;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
  pointer-events: auto;
  width: min(560px, 92vw);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.removeAccountModalPanel .modalHeader {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}

.removeAccountModalPanel .modalFooter {
  border-top: 1px solid #e5e7eb;
}

.removeAccountStep {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.removeAccountBody {
  padding: 24px 32px;
  flex: 1;
  background: #fff;
}

.removeAccountText {
  font-size: 16px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 16px;
}

.removeAccountList {
  list-style: none;
  padding: 0;
  margin: 0 0 24px 0;
}

.removeAccountList li {
  font-size: 14px;
  color: #4b5563;
  margin-bottom: 12px;
  padding-left: 20px;
  position: relative;
  display: flex;
  align-items: center;
}

.removeAccountList .linkBtn {
  font-weight: 400;
  color: #4b5563;
  text-decoration: underline;
}

.removeAccountList .linkBtn:hover {
  color: #111827;
}

.removeAccountList li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: #9ca3af;
}

.removeAccountHint {
  font-size: 14px;
  color: #4b5563;
  margin: 24px 0 0 0;
}

.removeAccountModalPanel .modalFooter {
  padding: 24px 32px;
  justify-content: flex-end;
  background: #fff;
  border-top: none;
}

.removeAccountModalPanel button.danger {
  background: #e11d48;
  border-color: #e11d48;
  color: white;
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.2);
}

.removeAccountModalPanel button.danger:hover:not(:disabled) {
  background: #be123c;
  border-color: #be123c;
}

.removeAccountModalPanel button.primary {
  background: #94a3b8; /* Greyed out initially */
  border-color: #94a3b8;
  color: white;
  box-shadow: none;
}

.removeAccountModalPanel button.primary:not(:disabled) {
  background: #3b82f6;
  border-color: #3b82f6;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.removeAccountModalPanel button.primary.danger:not(:disabled) {
  background: #e11d48;
  border-color: #e11d48;
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.2);
}

/* Step 2: Workspace List */
.workspaceList {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 4px;
}

.workspaceItem {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  border-radius: 12px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
}

.workspaceIcon {
  width: 40px;
  height: 40px;
  background: #e5e7eb;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
}

.workspaceInfo {
  flex: 1;
  min-width: 0;
}

.workspaceName {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.workspaceOwner {
  font-size: 12px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leaveWorkspaceBtn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  white-space: nowrap;
}

/* Step 3: Leave Workspace */
.subHeader {
  padding-top: 0;
  padding-bottom: 0;
}

.currentWorkspaceBox {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  margin-bottom: 24px;
}

.workspaceUserIcon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

.workspaceUserIcon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.workspaceUserInfo {
  flex: 1;
}

.workspaceUserName {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
}

.workspaceUserEmail {
  font-size: 12px;
  color: #6b7280;
}

.ownerSelectWrapper {
  position: relative;
  width: 100%;
}

.ownerSelectWrapper input {
  width: 100%;
  padding: 12px 40px 12px 12px;
  border: 1px solid #94a3b8;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  box-shadow: none;
}

.ownerSelectWrapper input:focus {
  border-color: #3b82f6;
}

.dropdownChevron {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  pointer-events: none;
}

.removeAccountStep.hidden {
  display: none;
}

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

/* Scrollable row for ContainerType BusinessObjectTypes */
.ct-slides-section {
  margin-top: 48px;
  padding: 0 4px;
}

.ct-slides-title {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 24px;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 12px;
}

.ct-slides-title::before {
  content: "";
  display: block;
  width: 4px;
  height: 24px;
  background: var(--accent);
  border-radius: 2px;
}

.bo-cards-scroll {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding: 10px 4px 30px;
  scroll-behavior: smooth;
}

.bo-cards-scroll .bo-card {
  min-width: 260px;
  max-width: 260px;
  flex-shrink: 0;
}

/* Compact "Что внутри" in ContainerType details */
#containerTypeDetailsViewSection .ct-slides-section {
  margin-top: 12px;
  margin-bottom: 12px;
}
#containerTypeDetailsViewSection .ct-slides-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #64748b;
}
#containerTypeDetailsViewSection .ct-slides-title::before {
  height: 18px;
}
#containerTypeDetailsViewSection .bo-cards-scroll {
  display: grid;
  grid-template-columns: repeat(4, 150px);
  grid-auto-rows: 138px;
  gap: 8px;
  overflow: visible;
  padding: 4px 0 12px;
}
#containerTypeDetailsViewSection .bo-card {
  width: 150px;
  min-width: 150px;
  max-width: 150px;
  height: 138px;
  flex-shrink: 0;
}





/* User Dropdown */
.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 240px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
  border: 1px solid #e2e8f0;
  padding: 8px 0;
  display: none;
  flex-direction: column;
  z-index: 3000;
}

.user-dropdown.show {
  display: flex !important;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  color: #4a5568;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  transition: background 0.2s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.dropdown-item:hover {
  background: #f7fafc;
  color: #1a202c;
}

.dropdown-item svg {
  color: #718096;
  flex-shrink: 0;
}

.dropdown-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 4px 0;
}

/* Share Modal Styles */
.shareModal {
  max-width: 520px;
  width: 100%;
}

.shareModal .modalBody {
  display: block;
  padding: 0 20px 20px;
}

.shareModal .modalHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
}

.shareModal .headerActions {
  display: flex;
  gap: 8px;
}

.shareInputContainer {
  border: 2px solid var(--accent);
  border-radius: 4px;
  padding: 8px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
  min-height: 48px;
  align-items: center;
}

.sharePathInfo {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  margin-bottom: 18px;
  word-break: break-all;
}

.shareEntityIds {
  font-size: 8px;
  color: rgba(107, 114, 128, 0.8);
  text-align: center;
  margin-top: 12px;
  letter-spacing: 0.2px;
}

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

.shareChip {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 4px 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.shareChip .removeChip {
  cursor: pointer;
  font-weight: bold;
  color: var(--muted);
}

.shareChip .removeChip:hover {
  color: var(--text);
}

#shareInput {
  border: none;
  outline: none;
  flex: 1;
  min-width: 120px;
  font-size: 14px;
  background: transparent;
}

.sharedUsersSection {
  margin-bottom: 24px;
}

.sharedUsersList {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 200px;
  overflow-y: auto;
}

.sharedUserMessage {
  font-size: 13px;
  padding: 8px 0;
  color: var(--muted);
}
.sharedUserMessage.error {
  color: var(--red);
}
.sharedUserMessage.loading {
  color: var(--muted);
}

.sharedUserItem {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.sharedUserControls {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 200px;
}

.sharedUserRoleBlock {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sharedUserRoleSelect {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--muted);
  background: var(--bg);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}

.sharedUserRoleHelper {
  font-size: 12px;
  color: var(--muted);
  text-align: right;
}

.sharedUserRevokeBtn {
  border: none;
  background: transparent;
  color: var(--red);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.sharedUserRevokeBtn:hover {
  text-decoration: underline;
}

.sharedUserPath {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.sharedUserInfo {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.sharedUserAvatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: #f3f4f6;
  border: 1px solid rgba(15, 23, 42, 0.1);
  flex-shrink: 0;
}

.sharedUserNameWrap {
  flex: 1;
  min-width: 0;
}

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

.sharedUserEmail {
  font-size: 12px;
  color: var(--muted);
}

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

.generalAccessSection {

  margin-bottom: 24px;
}

.sectionTitle {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 12px;
}

.accessRow {
  display: flex;
  align-items: center;
  gap: 16px;
}

.accessIcon {
  width: 40px;
  height: 40px;
  background: var(--bg);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.accessInfo {
  flex: 1;
}

.accessType {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  cursor: pointer;
}

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

.accessDesc a {
  color: var(--accent);
  text-decoration: none;
}

.accessRole select {
  border: none;
  background: transparent;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

.notifySection {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.checkboxLabel {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
}

.addMessageLink {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.shareModalFooter {
  display: flex;
  justify-content: center !important;
  align-items: center;
  padding: 16px 20px;
  gap: 12px;
}

.shareModalFooter .footerLinks {
  display: none;
}

.shareModalFooter .footerActions {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.footerLinks {
  display: flex;
  gap: 16px;
}

.footerActions {
  display: flex;
  gap: 12px;
}

.linkBtn {
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
  padding: 0;
}

.linkBtn:hover {
  color: var(--accent);
}

.widthPicker {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.lineWidthMenuIcon {
  width: 18px;
  height: 18px;
  display: block;
}
.lineWidthPreview path {
  stroke: currentColor;
  stroke-linecap: round;
}

.table-panel {
  position: fixed;
  right: 16px;
  top: 84px;
  width: min(820px, calc(100vw - 40px));
  max-height: calc(100vh - 120px);
  background: #fff;
  border: 1px solid #d9dfe8;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.2);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.table-panel.hidden {
  display: none;
}

.table-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid #e7ebf2;
  cursor: grab;
  user-select: none;
}

.table-panel.dragging .table-panel-header {
  cursor: grabbing;
}

body.table-panel-dragging {
  user-select: none;
}

.table-panel-title {
  font-size: 14px;
  font-weight: 700;
  color: #1f2a44;
}

.table-panel-close {
  border: none;
  background: transparent;
  color: #4f5d75;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.table-panel-controls,
.table-panel-actions {
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid #eef2f7;
}

.table-panel-actions {
  border-bottom: 1px solid #e7ebf2;
}

.table-panel-filters {
  flex-wrap: wrap;
}

.table-panel-filters [data-role="filter-field"] {
  flex: 1 1 180px;
}

.table-panel-filters [data-role="filter-op"] {
  flex: 0 0 110px;
}

.table-panel-filters [data-role="filter-value"] {
  flex: 1 1 180px;
}

.table-panel-input,
.table-panel-select {
  min-width: 0;
  border: 1px solid #cfd8e3;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 13px;
  color: #1f2a44;
  background: #fff;
}

.table-panel-input {
  flex: 1;
}

.table-panel-btn {
  border: 1px solid #cfd8e3;
  border-radius: 8px;
  background: #f7f9fc;
  color: #2d3a55;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.table-panel-content {
  position: relative;
  overflow: auto;
  padding: 8px 12px 12px;
}

.table-field-context {
  position: absolute;
  width: 308px;
  background: #ffffff;
  border: 1px solid #d8dde8;
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.18);
  padding: 6px 0;
  z-index: 4;
}

.table-field-context.hidden {
  display: none;
}

.table-field-context-title {
  display: none;
}

.table-field-context-title.small {
  font-size: 11px;
  font-weight: 600;
  color: #66758f;
}

.table-field-context-list {
  display: grid;
  gap: 0;
}

.table-field-context-divider {
  border-top: 1px solid #eceff5;
  margin: 6px 0;
}

.table-field-context-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #1f2a44;
  text-align: left;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.25;
  padding: 9px 14px;
  cursor: pointer;
}

.table-field-context-item:disabled {
  color: #a0abbd;
  cursor: default;
  opacity: 1;
}

.table-field-context-item:not(:disabled):hover {
  background: #f4f7fb;
}

.table-field-context-item.danger {
  color: #cc1f2f;
}

.table-field-context-item.danger:not(:disabled):hover {
  background: #fff3f5;
}

.table-field-menu-icon {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
}

.table-field-menu-label {
  flex: 1 1 auto;
}

.table-field-menu-badge {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  height: 18px;
  border-radius: 999px;
  background: #e0f2ff;
  color: #2176b3;
  font-size: 11px;
  font-weight: 700;
}

.table-field-menu-check {
  margin-left: auto;
  width: 14px;
  height: 14px;
  pointer-events: none;
}

.table-panel-empty {
  font-size: 13px;
  color: #6f7c92;
  padding: 20px 6px;
}

.table-grid {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
}

.table-grid th,
.table-grid td {
  border: 1px solid #e4eaf3;
  padding: 4px;
  vertical-align: middle;
}

.table-grid th {
  background: #f8fbff;
  text-align: left;
  color: #2d3a55;
  font-weight: 700;
  cursor: default;
}

.table-field-header {
  position: relative;
  padding-right: 26px !important;
}

.table-field-header-title {
  display: inline-block;
  max-width: calc(100% - 16px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-field-header-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 16px);
}

.table-field-type-icon {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  opacity: 0.85;
}

.table-field-menu-trigger {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 4px;
  background: transparent;
  opacity: 0;
  pointer-events: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.table-field-menu-trigger img {
  width: 12px;
  height: 12px;
}

.table-field-header:hover .table-field-menu-trigger,
.table-field-header:focus-within .table-field-menu-trigger {
  opacity: 1;
  pointer-events: auto;
}

.table-field-menu-trigger:hover {
  background: #e8edf6;
}

.table-grid .table-row-action-col {
  width: 32px;
}

.table-grid .table-row-check-col {
  width: 52px;
}

.table-row-check {
  text-align: center;
  padding: 2px 4px !important;
  white-space: nowrap;
}

.table-widget-row-check {
  text-align: center;
  padding: 4px 6px !important;
  vertical-align: middle;
  white-space: nowrap;
  position: relative;
  overflow: visible !important;
}

.table-row-grip-btn,
.table-widget-row-grip-btn {
  width: 16px;
  height: 16px;
  min-width: 16px;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  opacity: 0;
  pointer-events: none;
  cursor: grab;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.table-row-check > .table-row-grip-btn,
.table-widget-row-check > .table-widget-row-grip-btn {
  margin-right: 6px;
  vertical-align: middle;
}

.table-row-grip-btn:active,
.table-widget-row-grip-btn:active {
  cursor: grabbing;
}

.table-row-grip-btn img,
.table-widget-row-grip-btn img {
  width: 12px;
  height: 12px;
}

.table-row-check-input {
  min-width: 14px;
  width: 14px;
  height: 14px;
  padding: 0;
  margin: 0;
  border-radius: 4px;
  border: 1px solid #9fb3cc;
  background: #ffffff;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
  accent-color: #3b82f6;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
}

.table-row-check-input:checked,
.table-widget-row-check-input:checked {
  border-color: #3b82f6;
  background: #3b82f6;
}

.table-row-check-input:checked::after,
.table-widget-row-check-input:checked::after {
  content: "";
  display: block;
  width: 3px;
  height: 7px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: translate(4px, 1px) rotate(45deg);
}

.table-widget-row-check-input {
  all: unset;
  box-sizing: border-box;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid #7f97b6;
  background: #ffffff;
  display: inline-block !important;
  vertical-align: middle;
  cursor: pointer;
}

.table-widget-row-check-input.is-checked {
  border-color: #3b82f6;
  background: #3b82f6;
}

.table-widget-row-check-input.is-checked::after {
  content: "";
  display: block;
  width: 3px;
  height: 7px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: translate(0, -1px) rotate(45deg);
}

.table-widget-row-check-btn {
  all: unset;
  box-sizing: border-box;
  width: 14px;
  height: 14px;
  min-width: 14px;
  border-radius: 4px;
  border: 1px solid #7f97b6;
  background: #ffffff;
  display: inline-block !important;
  vertical-align: middle;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.12s ease;
}

.table-widget-row-check-btn.is-checked {
  border-color: #3b82f6;
  background: #3b82f6;
}

.table-widget-row-check-btn.is-checked::after {
  content: "";
  display: block;
  width: 3px;
  height: 7px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: translate(4px, 1px) rotate(45deg);
}

.table-widget-row-comment-btn {
  all: unset;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0;
  margin-left: 6px;
  border-radius: 0;
  background: transparent;
  color: #2f5fb6;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  vertical-align: middle;
}

.table-widget-row-comment-icon {
  width: 11px;
  height: 11px;
  display: block;
  flex: 0 0 11px;
}

.table-widget-row-comment-count {
  min-width: 6px;
  text-align: center;
  color: #334155;
}

.table-widget-row-insert-btn {
  position: absolute;
  left: -8px;
  bottom: -9px;
  width: 16px;
  height: 16px;
  border: none;
  border-radius: 999px;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  cursor: pointer;
  z-index: 4;
  padding: 0;
}

.table-widget-row-insert-btn img {
  width: 16px;
  height: 16px;
}

.table-widget-row.show-plus-boundary .table-widget-row-insert-btn,
.table-widget-row-insert-btn:focus-visible {
  opacity: 1;
  pointer-events: auto;
}

.table-widget-row-resize-handle {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 8px;
  cursor: row-resize;
  z-index: 3;
}

body.table-row-resizing,
body.table-row-resizing * {
  cursor: row-resize !important;
}

.table-row {
  transition: transform 0.14s ease;
}

.table-row.dragging-row {
  z-index: 3;
  position: relative;
  box-shadow: 0 8px 24px rgba(29, 78, 216, 0.22);
}

.table-row-drop-line {
  position: absolute;
  height: 2px;
  background: #1d4ed8;
  border-radius: 999px;
  pointer-events: none;
  z-index: 5;
}

.table-row-drop-line.hidden {
  display: none;
}

.table-grid tbody tr:hover .table-row-check-input,
.table-grid tbody tr:focus-within .table-row-check-input,
.table-grid tbody tr.table-row-active .table-row-check-input,
.table-grid tbody tr:hover .table-row-grip-btn,
.table-grid tbody tr:focus-within .table-row-grip-btn,
.table-grid tbody tr.table-row-active .table-row-grip-btn,
.table-widget-grid tbody tr:hover .table-widget-row-check-input,
.table-widget-grid tbody tr:focus-within .table-widget-row-check-input,
.table-widget-grid tbody tr.table-widget-row-active .table-widget-row-check-input,
.table-widget-grid tbody tr.table-widget-row-has-selected-cell .table-widget-row-check-input,
.table-widget-grid tbody tr:hover .table-widget-row-check-btn,
.table-widget-grid tbody tr:focus-within .table-widget-row-check-btn,
.table-widget-grid tbody tr.table-widget-row-active .table-widget-row-check-btn,
.table-widget-grid tbody tr.table-widget-row-has-selected-cell .table-widget-row-check-btn,
.table-widget-grid tbody tr:hover .table-widget-row-grip-btn,
.table-widget-grid tbody tr:focus-within .table-widget-row-grip-btn,
.table-widget-grid tbody tr.table-widget-row-active .table-widget-row-grip-btn,
.table-widget-grid tbody tr.table-widget-row-has-selected-cell .table-widget-row-grip-btn {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.table-grid tbody tr:hover td {
  background: #f3f8ff;
}

.table-grid tbody tr.table-row-active td {
  background: #e3efff;
}

.table-grid tbody tr.table-row-active:hover td {
  background: #d8e8ff;
}

.table-cell-input {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 12px;
  color: #1f2a44;
  background: transparent;
}

.table-cell-input:focus {
  outline: none;
  border-color: #7aa2ff;
  background: transparent;
}

.table-row-del {
  width: 24px;
  height: 24px;
  border: 1px solid #e5d0d0;
  border-radius: 6px;
  background: #fff5f5;
  color: #a63a3a;
  cursor: pointer;
}

.table-panel-empty-cell {
  text-align: center;
  color: #6f7c92;
  padding: 14px 8px;
}

.table-grid-footer {
  display: flex;
  gap: 8px;
  padding-top: 8px;
}

.table-widget {
  position: absolute;
  border: 1px solid #cfd8e3;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: none;
  overflow: visible;
  user-select: none;
}

.table-widget.dragging {
  box-shadow: none;
}

.table-widget:hover:not(.selected) {
  outline: 1px solid rgba(59, 130, 246, 0.55);
  outline-offset: 0;
}

.table-widget.selected {
  outline: 1px solid #3b82f6;
  outline-offset: 0;
  cursor: default;
}

.table-widget.selected .side-handle,
.table-widget.show-side-handles .side-handle {
  display: block;
}

.table-widget.selected .resize-handle {
  display: block;
}

.table-widget.selected .rotate-handle {
  display: block;
}

.table-widget-header {
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 10px;
  background: #f8fbff;
  border-bottom: 1px solid #e7edf7;
}

.table-widget-title {
  font-size: 12px;
  font-weight: 700;
  color: #1f2a44;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-widget-title-input {
  width: 100%;
  min-width: 60px;
  border: 1px solid #7aa2ff;
  border-radius: 6px;
  background: #ffffff;
  color: #1f2a44;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 6px;
}

.table-widget-title-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(122, 162, 255, 0.2);
}

.table-widget-body {
  height: calc(100% - 36px);
  border-radius: 0 0 12px 12px;
  padding: 10px;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  overflow: auto;
  position: relative;
}

.table-widget-note {
  font-size: 12px;
  color: #6f7c92;
}

.table-widget-grid {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 11px;
}

.table-widget-grid th,
.table-widget-grid td {
  border: 1px solid #e7edf7;
  padding: 4px 6px;
  vertical-align: middle;
  text-align: left;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-widget-grid th {
  background: #f8fbff;
  font-weight: 600;
  cursor: default;
}

.table-widget-grid th.table-widget-field-header {
  transition: background-color 120ms ease, box-shadow 120ms ease;
}

.table-widget-grid th.table-widget-field-header:hover,
.table-widget-grid th.table-widget-field-header:focus-within {
  background: #eef5ff;
  box-shadow: inset 0 0 0 1px rgba(122, 162, 255, 0.35);
}

.table-widget-grid .table-widget-row-check-col {
  width: 79px;
}

.table-widget-grid tbody tr:hover td {
  background: #f3f8ff;
}

.table-widget-grid tbody tr.table-widget-row-active td {
  background: #e3efff;
}

.table-widget-grid tbody tr.table-widget-row-active:hover td {
  background: #d8e8ff;
}

.table-widget-grid tbody tr.show-row-resize-boundary td {
  box-shadow: inset 0 -1px 0 #3b82f6;
}

body.table-row-grip-dragging,
body.table-row-grip-dragging * {
  cursor: grabbing !important;
}

.table-grid-footer .table-panel-btn.danger {
  margin-left: auto;
  border-color: #f0c6c6;
  background: #fff5f5;
  color: #b73939;
}

.table-widget-field-header {
  position: relative;
  padding-right: 22px !important;
  overflow: visible !important;
}

.table-widget-field-title {
  display: inline-block;
  max-width: calc(100% - 14px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-widget-field-title-input {
  width: 100%;
  min-width: 56px;
  border: 1px solid #7aa2ff;
  border-radius: 4px;
  background: #ffffff;
  color: #1f2a44;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 4px;
  line-height: 14px;
}

.table-widget-field-title-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(122, 162, 255, 0.2);
}

.table-widget-field-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: calc(100% - 14px);
}

.table-widget-field-type-icon {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  opacity: 0.85;
}

.table-widget-field-menu-trigger {
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border: none;
  border-radius: 4px;
  background: transparent;
  opacity: 0;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.table-widget-field-menu-trigger img {
  width: 10px;
  height: 10px;
}

.table-widget-field-header:hover .table-widget-field-menu-trigger,
.table-widget-field-header:focus-within .table-widget-field-menu-trigger {
  opacity: 1;
  pointer-events: auto;
}

.table-widget-field-menu-trigger:hover {
  background: #e8edf6;
}

.table-widget-col-resize-handle {
  position: absolute;
  top: 0;
  right: -4px;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  z-index: 3;
}

.table-widget-col-insert-btn {
  position: absolute;
  top: -8px;
  right: -9px;
  width: 16px;
  height: 16px;
  border: none;
  border-radius: 999px;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  cursor: pointer;
  z-index: 4;
  padding: 0;
}

.table-widget-col-insert-btn img {
  width: 16px;
  height: 16px;
}

.table-widget-field-header.show-plus-boundary .table-widget-col-insert-btn,
.table-widget-col-insert-btn:focus-visible {
  opacity: 1;
  pointer-events: auto;
}

body.table-col-resizing,
body.table-col-resizing * {
  cursor: col-resize !important;
}

.table-widget-cell-text {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #1f2937;
  font-size: 11px;
  padding: 2px 4px;
  min-height: 20px;
  line-height: 16px;
}

.table-widget-cell-text {
  display: block;
  cursor: text;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-widget-grid td.table-widget-cell-selected-cell {
  box-shadow: inset 0 0 0 2px #7aa2ff;
  background: rgba(122, 162, 255, 0.08);
}

.table-widget-cell-text.table-widget-cell-editing:focus {
  outline: none;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.table-widget-cell-text:focus {
  outline: none;
  border-color: transparent;
  background: transparent;
}

.table-widget-cell-wrap {
  white-space: normal !important;
}

.table-widget-cell-has-newlines {
  white-space: pre-wrap !important;
}

.table-widget-cell-text.table-widget-cell-wrap,
.table-widget-cell-text.table-widget-cell-has-newlines,
.table-widget-cell-text.table-widget-cell-editing {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  overflow: visible;
  text-overflow: clip;
}

.table-widget-toolbar {
  z-index: 5001;
}

.table-widget-toolbar.hidden {
  display: none;
}

/* Shared marketing/docs header */
.landing-nav {
  height: 72px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  z-index: 1000;
  border-bottom: 1px solid #e2e8f0;
}

.landing-nav .landing-nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.landing-nav .nav-left {
  display: flex;
  align-items: center;
  gap: 22px;
}

.landing-nav .nav-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-dark, #0f172a);
  font-weight: 700;
  font-size: 18px;
}

.landing-nav .nav-logo img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
}

.landing-nav .nav-links {
  display: flex;
  gap: 22px;
  align-items: center;
}

.landing-nav .nav-link {
  text-decoration: none;
  color: var(--text-dark, #0f172a);
  font-weight: 600;
  font-size: 14px;
  transition: color 0.2s;
}

.landing-nav .nav-link:hover {
  color: var(--primary, #5b5de9);
}

.landing-nav .btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-radius: 10px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  font-size: 14px;
}

.landing-nav .btn-primary {
  background: var(--primary, #5b5de9);
  color: #fff;
}

.landing-nav .btn-primary:hover {
  background: var(--primary-hover, #4a4cd1);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(91, 93, 233, 0.25);
}

/* ── Shared profile card (profile_view + profile settings) ────────────────── */
.profile-header-section {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  box-shadow: 0 1px 6px rgba(15, 23, 42, 0.05);
  padding: 0;
  gap: 0;
  flex-shrink: 0;
  position: relative;
}
.profile-cover {
  height: 192px;
  flex-shrink: 0;
  position: relative;
  background:
    linear-gradient(to bottom, transparent 55%, rgba(255,255,255,0.10) 100%),
    radial-gradient(ellipse at 18% 70%, rgba(198, 40, 40, 0.22) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 30%, rgba(198, 40, 40, 0.10) 0%, transparent 50%),
    linear-gradient(145deg, #0f172a 0%, #1e293b 55%, #2c1a1a 100%);
  background-size: cover;
  background-position: center;
}
.profile-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  transition: background 0.2s;
  pointer-events: none;
}
.profile-cover:hover::after { background: rgba(0,0,0,0.32); }
.profile-cover-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 170px;
  height: 32px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.45);
  background: rgba(0,0,0,0.40);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, background 0.15s;
  white-space: nowrap;
}
.profile-cover:hover .profile-cover-btn { opacity: 1; }
.profile-cover-btn:hover { background: rgba(0,0,0,0.55); }
.cover-btn-label-change { display: none; }
.profile-cover:not(.no-image) .cover-btn-label-add { display: none; }
.profile-cover:not(.no-image) .cover-btn-label-change { display: inline; }
.profile-header-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 80px 24px 24px;
}
.profile-avatar-large {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  border: 4px solid #fff;
  background: #dde3eb;
  overflow: hidden;
  flex-shrink: 0;
  position: absolute;
  top: 128px;
  left: 24px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.16);
  cursor: pointer;
}
.profile-avatar-large img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.profile-avatar-initials {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #e2e8f0;
  background: linear-gradient(135deg, #1e293b 0%, #7f1d1d 100%);
  border-radius: 50%;
  pointer-events: none;
}
.profile-identity {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.profile-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.profile-name-title {
  font-size: 22px;
  margin: 0;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}
.profile-plan-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  background: #e2e8f0;
  color: #64748b;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.profile-plan-badge.is-premium { background: #fef3c7; color: #92400e; }
.profile-email-text {
  margin: 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.4;
}
.profile-stats-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 2px;
}
.profile-stat { font-size: 13px; color: #64748b; }
.profile-stat b { color: #0f172a; font-weight: 700; }
.profile-stat-dot { color: #cbd5e1; font-size: 14px; line-height: 1; user-select: none; }
.profile-about-text {
  margin: 6px 0 0;
  font-size: 13px;
  color: #475569;
  line-height: 1.55;
  max-width: 480px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Profile settings page — card sits flush at top of panel */
.profilePanel > .profile-header-section {
  border-radius: 28px 28px 0 0;
  border: none;
  box-shadow: none;
}

/* Avatar hover overlay (settings page) */
.profile-avatar-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0);
  transition: background 0.2s;
  pointer-events: none;
}
.profile-avatar-large:hover .profile-avatar-overlay {
  background: rgba(0,0,0,0.16);
}
.profile-avatar-overlay svg {
  width: 16px;
  height: 16px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 50%;
  box-sizing: content-box;
  opacity: 0;
  transition: opacity 0.2s;
  color: #fff;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4));
}
.profile-avatar-large:hover .profile-avatar-overlay svg {
  opacity: 1;
}

/* ── Profile Settings two-frame layout ──────────────────────────────────────── */
.ps-layout {
  display: flex;
  margin-top: 60px;
  height: calc(100vh - 60px);
  width: 100%;
  background: #f8fafc;
}
.ps-sidebar {
  width: 220px;
  min-width: 160px;
  max-width: 360px;
  background: #fff;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  padding: 20px 0;
  overflow-y: auto;
  flex-shrink: 0;
}
.ps-resizer {
  width: 4px;
  flex-shrink: 0;
  cursor: col-resize;
  background: transparent;
  position: relative;
  transition: background 0.15s;
}
.ps-resizer::after {
  content: '';
  position: absolute;
  inset: 0 -2px;
}
.ps-resizer:hover,
.ps-resizer.dragging {
  background: #3b82f6;
}
.ps-content {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 32px 48px;
}
.ps-section { margin-bottom: 24px; }
.ps-section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
  padding: 0 16px;
  margin-bottom: 4px;
}
.ps-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  text-decoration: none;
  border-radius: 6px;
  margin: 0 8px;
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
  border: none;
  background: transparent;
  width: calc(100% - 16px);
  text-align: left;
}
.ps-nav-item:hover { background: #f1f5f9; }
.ps-nav-item.active {
  background: #f1f5f9;
  color: #0f172a;
  font-weight: 600;
}
.ps-view { display: none; flex-direction: column; gap: 32px; max-width: 1192px; width: 100%; margin: 0 auto; }
.ps-view.active { display: flex; }
.ps-view > .profile-header-section { flex-shrink: 0; }

/* ── Предпочтения ── */
.pref-page { display: flex; flex-direction: column; gap: 40px; }
.pref-section-title {
  font-size: 16px;
  font-weight: 600;
  color: #0f172a;
  margin: 0 0 0;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}
.pref-rows { display: flex; flex-direction: column; }
.pref-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  padding: 14px 0;
  border-bottom: 1px solid #f1f5f9;
}
.pref-row:last-child { border-bottom: none; }
.pref-row-meta { flex: 1; min-width: 0; }
.pref-row-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 3px;
}
.pref-row-desc {
  font-size: 13px;
  color: #718096;
  line-height: 1.45;
}
.pref-select {
  flex-shrink: 0;
  font-size: 13px;
  padding: 5px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  color: #374151;
  min-width: 160px;
  cursor: pointer;
  margin-top: 1px;
}
.pref-toggle {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
  cursor: pointer;
  margin-top: 2px;
}
.pref-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.pref-toggle-track {
  position: absolute;
  inset: 0;
  background: #cbd5e0;
  border-radius: 10px;
  transition: background 0.2s;
}
.pref-toggle-track::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.pref-toggle input:checked + .pref-toggle-track { background: #3b82f6; }
.pref-toggle input:checked + .pref-toggle-track::after { transform: translateX(16px); }
.cookie-dropdown { position: relative; flex-shrink: 0; }
.cookie-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  padding: 5px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  color: #374151;
  cursor: pointer;
  white-space: nowrap;
}
.cookie-btn:hover { background: #f8fafc; }
.cookie-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  width: 288px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
  z-index: 100;
}
.cookie-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 16px;
  border-bottom: 1px solid #f1f5f9;
}
.cookie-row:last-child { border-bottom: none; }
.cookie-row-meta { flex: 1; min-width: 0; }
.cookie-row-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 2px;
}
.cookie-row-desc { font-size: 12px; color: #718096; line-height: 1.4; }
