: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);
}

* {
  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);
}

.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;
  max-width: 960px;
  margin: 0 auto;
}

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

.notificationsTabs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: sticky;
  top: 20px;
  align-self: start;
}

.notificationsTab {
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  color: #374151;
}

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

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

.notificationGroup {
  padding: 16px 0;
  border-bottom: 1px solid #e5e7eb;
}

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

.notificationGroup {
  display: none;
}

.notificationGroup.active {
  display: block;
}

.notificationSection {
  padding-bottom: 16px;
}

.notificationSection:last-child {
  padding-bottom: 0;
}

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

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

.notificationRow label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

.notificationRow input[type="number"] {
  width: 96px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
}

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

.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;
}

.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;
}

.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.facilitate {
  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: #e11d48;
}
.menuItem.danger:hover {
  background: #fef2f2;
}
.menuIcon {
  width: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4b5563;
}
.menuItem.danger .menuIcon {
  color: #e11d48;
}
.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;
}

.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;
}

.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;
}

.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 .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;
}

#facilitateBtn {
  font-weight: 700;
  color: #1f2937;
}
#facilitateBtn: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;
}

.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;
}
.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;
}

/* Line Type Popover */
.typePopover {
  position: absolute;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 3001;
  min-width: 160px;
}

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

.typeOption:hover {
  background: #f3f4f6;
}

.typeOption.active {
  background: #1f2937;
  color: white;
}

.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;
}
.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%;
}
.shapeBox svg {
  display: block;
}
.shapeTextWrapper {
  width: 100%;
  height: 100%;
  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;
}

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

.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;
}

.topbarCenter {
  display: flex;
  align-items: center;
  gap: 12px;
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  height: 52px;
  padding: 0 12px;
  border-radius: 100px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.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-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;
}

.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: #b91c1c; /* Красный для предупреждения */
}

#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;
}

.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: #ef4444;
  color: #ef4444;
}

.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;
}
.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;
}
.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;
}
